use the width & height from the mpeg4 header ... in the case that its complete

Originally committed as revision 340 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2002-03-19 03:51:36 +00:00
parent 019d276a12
commit 488fa19a86
2 changed files with 19 additions and 13 deletions

View File

@ -2149,6 +2149,10 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
skip_bits1(&s->gb); /* marker */ skip_bits1(&s->gb); /* marker */
height = get_bits(&s->gb, 13); height = get_bits(&s->gb, 13);
skip_bits1(&s->gb); /* marker */ skip_bits1(&s->gb); /* marker */
if(width && height){ /* they should be non zero but who knows ... */
s->width = width;
s->height = height;
}
} }
if(get_bits1(&s->gb)) printf("interlaced not supported\n"); /* interlaced */ if(get_bits1(&s->gb)) printf("interlaced not supported\n"); /* interlaced */

View File

@ -59,7 +59,7 @@ static int h263_decode_init(AVCodecContext *avctx)
} }
/* for h263, we allocate the images after having read the header */ /* for h263, we allocate the images after having read the header */
if (avctx->codec->id != CODEC_ID_H263) if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
if (MPV_common_init(s) < 0) if (MPV_common_init(s) < 0)
return -1; return -1;
@ -114,7 +114,9 @@ static int h263_decode_frame(AVCodecContext *avctx,
ret = intel_h263_decode_picture_header(s); ret = intel_h263_decode_picture_header(s);
} else { } else {
ret = h263_decode_picture_header(s); ret = h263_decode_picture_header(s);
/* After H263 header decode we have the height, width, */ }
/* After H263 & mpeg4 header decode we have the height, width,*/
/* and other parameters. So then we could init the picture */ /* and other parameters. So then we could init the picture */
/* FIXME: By the way H263 decoder is evolving it should have */ /* FIXME: By the way H263 decoder is evolving it should have */
/* an H263EncContext */ /* an H263EncContext */
@ -129,7 +131,7 @@ static int h263_decode_frame(AVCodecContext *avctx,
if (MPV_common_init(s) < 0) if (MPV_common_init(s) < 0)
return -1; return -1;
} }
}
if (ret < 0) if (ret < 0)
return -1; return -1;