summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorJuanjo <pulento@users.sourceforge.net>2001-11-03 00:49:53 +0000
committerJuanjo <pulento@users.sourceforge.net>2001-11-03 00:49:53 +0000
commit4949028f85dec72a5caf322757a6e6fd6ef711d3 (patch)
treeeb19917fca268793ef4f2e829619f78a3ec5b20c /libavcodec/h263dec.c
parent162caf680fce1005d26dd563901f9c878c0326a3 (diff)
- Bug fix on inter MCBPC table for inter+q.
- H.263/H.263+ decoder now knows GOB start codes. - H.263/H.263+ decoder now returns the size of the stream on the first call. - Added show_bits() functions to see the buffer without loosing the bits. - TODO: H.263v1 UMV parsing is buggy. Originally committed as revision 204 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 7f2a6dd20d..99d7277f61 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -56,8 +56,9 @@ static int h263_decode_init(AVCodecContext *avctx)
}
/* for h263, we allocate the images after having read the header */
- if (MPV_common_init(s) < 0)
- return -1;
+ if (avctx->codec->id != CODEC_ID_H263)
+ if (MPV_common_init(s) < 0)
+ return -1;
/* XXX: suppress this matrix init, only needed because using mpeg1
dequantize in mmx case */
@@ -92,7 +93,7 @@ static int h263_decode_frame(AVCodecContext *avctx,
printf("*****frame %d size=%d\n", avctx->frame_number, buf_size);
printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
#endif
-
+
/* no supplementary picture */
if (buf_size == 0) {
*data_size = 0;
@@ -110,6 +111,16 @@ static int h263_decode_frame(AVCodecContext *avctx,
ret = intel_h263_decode_picture_header(s);
} else {
ret = h263_decode_picture_header(s);
+ /* After H263 header decode we have the height, width, */
+ /* and other parameters. So then we could init the picture */
+ if (s->width != avctx->width || s->height != avctx->height) {
+ avctx->width = s->width;
+ avctx->height = s->height;
+ /* FIXME: By the way H263 decoder is evolving it should have */
+ /* an H263EncContext */
+ if (MPV_common_init(s) < 0)
+ return -1;
+ }
}
if (ret < 0)
return -1;
@@ -126,6 +137,7 @@ static int h263_decode_frame(AVCodecContext *avctx,
#ifdef DEBUG
printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
#endif
+ //fprintf(stderr,"\nFrame: %d\tMB: %d",avctx->frame_number, (s->mb_y * s->mb_width) + s->mb_x);
/* DCT & quantize */
if (s->h263_msmpeg4) {
msmpeg4_dc_scale(s);