comparison mjpeg.c @ 3062:8d05d4036b6a libavcodec

Mjpeg interlaced decoding fix, height was wrong while decoding (/2). Patch by Baptiste Coudurier, baptiste _ coudurier at smartjog _ com.
author banan
date Mon, 23 Jan 2006 06:40:08 +0000
parents 0b546eab515d
children 1e63c12c2c71
comparison
equal deleted inserted replaced
3061:259fed5adf5d 3062:8d05d4036b6a
1142 if (width != s->width || height != s->height) { 1142 if (width != s->width || height != s->height) {
1143 av_freep(&s->qscale_table); 1143 av_freep(&s->qscale_table);
1144 1144
1145 s->width = width; 1145 s->width = width;
1146 s->height = height; 1146 s->height = height;
1147 avcodec_set_dimensions(s->avctx, width, height);
1148 1147
1149 /* test interlaced mode */ 1148 /* test interlaced mode */
1150 if (s->first_picture && 1149 if (s->first_picture &&
1151 s->org_height != 0 && 1150 s->org_height != 0 &&
1152 s->height < ((s->org_height * 3) / 4)) { 1151 s->height < ((s->org_height * 3) / 4)) {
1153 s->interlaced = 1; 1152 s->interlaced = 1;
1154 // s->bottom_field = (s->interlace_polarity) ? 1 : 0; 1153 // s->bottom_field = (s->interlace_polarity) ? 1 : 0;
1155 s->bottom_field = 0; 1154 s->bottom_field = 0;
1156 s->avctx->height *= 2; 1155 height *= 2;
1157 } 1156 }
1157
1158 avcodec_set_dimensions(s->avctx, width, height);
1158 1159
1159 s->qscale_table= av_mallocz((s->width+15)/16); 1160 s->qscale_table= av_mallocz((s->width+15)/16);
1160 1161
1161 s->first_picture = 0; 1162 s->first_picture = 0;
1162 } 1163 }