aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoren Merritt <lorenm@u.washington.edu>2004-11-28 19:19:39 +0000
committerLoren Merritt <lorenm@u.washington.edu>2004-11-28 19:19:39 +0000
commit42dd22c4a5c8463488d442eeb234b822bcc39625 (patch)
tree7514238fd129ee5633cabdce4498e285ffc6148b
parentf37b9768f64f859c67b8592eca618c5d82509025 (diff)
downloadffmpeg-42dd22c4a5c8463488d442eeb234b822bcc39625.tar.gz
fix interlacing check in v1 huffyuv.
Originally committed as revision 3721 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/huffyuv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c
index d529268ada..66a3df169d 100644
--- a/libavcodec/huffyuv.c
+++ b/libavcodec/huffyuv.c
@@ -360,6 +360,7 @@ static int decode_init(AVCodecContext *avctx)
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->bgr32=1;
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->bgr32=1;
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 @@ s->bgr32=1;
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 @@ static int encode_init(AVCodecContext *avctx)
((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;