diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index ca00585ad2..ac260f6a1e 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -409,7 +409,10 @@ s->bgr32=1; return -1; } - s->interlaced= height > 288; + if(((uint8_t*)avctx->extradata)[2] & 0x20) + s->interlaced= ((uint8_t*)avctx->extradata)[2] & 0x10 ? 1 : 0; + else + s->interlaced= height > 288; switch(s->bitstream_bpp){ case 12: @@ -497,10 +500,11 @@ static int encode_init(AVCodecContext *avctx) avctx->bits_per_sample= s->bitstream_bpp; s->decorrelate= s->bitstream_bpp >= 24; s->predictor= avctx->prediction_method; + s->interlaced= avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0; ((uint8_t*)avctx->extradata)[0]= s->predictor; ((uint8_t*)avctx->extradata)[1]= s->bitstream_bpp; - ((uint8_t*)avctx->extradata)[2]= + ((uint8_t*)avctx->extradata)[2]= 0x20 | (s->interlaced ? 0x10 : 0); ((uint8_t*)avctx->extradata)[3]= 0; s->avctx->extradata_size= 4; @@ -546,8 +550,6 @@ static int encode_init(AVCodecContext *avctx) for(j=0; j<256; j++) s->stats[i][j]= 0; - s->interlaced= height > 288; - // printf("pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced); s->picture_number=0; diff --git a/tests/ffmpeg.regression.ref b/tests/ffmpeg.regression.ref index 8c902c706d..e6267ee0b0 100644 --- a/tests/ffmpeg.regression.ref +++ b/tests/ffmpeg.regression.ref @@ -47,7 +47,7 @@ stddev: 2.07 PSNR:41.76 bytes:7602176 554440 ./data/a-odivx.mp4 e400c9175dd1811cdeee7be5555d33f1 *./data/out.yuv stddev: 7.99 PSNR:30.06 bytes:7602176 -5704a082cc5c5970620123ae20566286 *./data/a-huffyuv.avi +08fd4be8dfff31783f83bfc59f8a6cdd *./data/a-huffyuv.avi 5986168 ./data/a-huffyuv.avi 799d3db687f6cdd7a837ec156efc171f *./data/out.yuv stddev: 0.00 PSNR:99.99 bytes:7602176 diff --git a/tests/rotozoom.regression.ref b/tests/rotozoom.regression.ref index 5fff7abce4..b080d5bec9 100644 --- a/tests/rotozoom.regression.ref +++ b/tests/rotozoom.regression.ref @@ -47,7 +47,7 @@ e47f46468b79641e13bb9609be2db5ca *./data/a-odivx.mp4 120196 ./data/a-odivx.mp4 8b7657a7f9fc7298cc016abb466d1d19 *./data/out.yuv stddev: 5.34 PSNR:33.56 bytes:7602176 -242a7a18c2793e115007bc163861ef4e *./data/a-huffyuv.avi +40ddd4437246784a9a7ffa582f99b8d9 *./data/a-huffyuv.avi 4987020 ./data/a-huffyuv.avi dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv stddev: 0.00 PSNR:99.99 bytes:7602176