(non)interlaced huffyuv patch by (Loren Merritt <lorenm at u dot washington dot edu>)

Originally committed as revision 3473 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Loren Merritt 2004-09-17 10:57:57 +00:00 committed by Michael Niedermayer
parent a6a12a8a5c
commit ee598f7ba4
3 changed files with 8 additions and 6 deletions

View File

@ -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;

View File

@ -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

View File

@ -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