# HG changeset patch # User lorenm # Date 1101669579 0 # Node ID b36811e1386a8fcf075e003773cd6915917232b5 # Parent f977a8871c2cf483319f7456b81172cd4ee7f0ec fix interlacing check in v1 huffyuv. diff -r f977a8871c2c -r b36811e1386a huffyuv.c --- a/huffyuv.c Sun Nov 28 18:29:38 2004 +0000 +++ b/huffyuv.c Sun Nov 28 19:19:39 2004 +0000 @@ -360,6 +360,7 @@ width= s->width= avctx->width; height= s->height= avctx->height; avctx->coded_frame= &s->picture; + s->interlaced= height > 288; s->bgr32=1; assert(width && height); @@ -374,7 +375,7 @@ s->version=0; if(s->version==2){ - int method; + int method, interlace; method= ((uint8_t*)avctx->extradata)[0]; s->decorrelate= method&64 ? 1 : 0; @@ -382,6 +383,8 @@ s->bitstream_bpp= ((uint8_t*)avctx->extradata)[1]; if(s->bitstream_bpp==0) s->bitstream_bpp= avctx->bits_per_sample&~7; + interlace= (((uint8_t*)avctx->extradata)[2] & 0x30) >> 4; + s->interlaced= (interlace==1) ? 1 : (interlace==2) ? 0 : s->interlaced; s->context= ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0; if(read_huffman_tables(s, ((uint8_t*)avctx->extradata)+4, avctx->extradata_size) < 0) @@ -416,11 +419,6 @@ return -1; } - 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: avctx->pix_fmt = PIX_FMT_YUV420P; @@ -534,7 +532,7 @@ ((uint8_t*)avctx->extradata)[0]= s->predictor; ((uint8_t*)avctx->extradata)[1]= s->bitstream_bpp; - ((uint8_t*)avctx->extradata)[2]= 0x20 | (s->interlaced ? 0x10 : 0); + ((uint8_t*)avctx->extradata)[2]= s->interlaced ? 0x10 : 0x20; if(s->context) ((uint8_t*)avctx->extradata)[2]|= 0x40; ((uint8_t*)avctx->extradata)[3]= 0;