summaryrefslogtreecommitdiff
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-09-27 02:39:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-09-27 02:39:55 +0000
commit4f8a831994889f2a90669dc230c14d203d52083d (patch)
treebda1bf3ac88ece871b88a36ff6a4d95eb4ef81a3 /libavcodec/h263dec.c
parent718455951c74269a95117b117a2790c4edeef979 (diff)
set AVCodecContext.width/height to the picture width/height instead of the one stored in the bitstream (that only matters if lowres!=0)
Originally committed as revision 3518 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 212d538cc3..6ba0564552 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -37,8 +37,10 @@ int ff_h263_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
s->out_format = FMT_H263;
- s->width = avctx->width;
+ s->width = avctx->width;
s->height = avctx->height;
+ avctx->width = -((-s->width )>>avctx->lowres);
+ avctx->height= -((-s->height)>>avctx->lowres);
s->workaround_bugs= avctx->workaround_bugs;
// set defaults
@@ -637,7 +639,8 @@ retry:
/* FIXME: By the way H263 decoder is evolving it should have */
/* an H263EncContext */
- if ( s->width != avctx->width || s->height != avctx->height) {
+ if ( -((-s->width )>>avctx->lowres) != avctx->width
+ || -((-s->height)>>avctx->lowres) != avctx->height) {
/* H.263 could change picture size any time */
ParseContext pc= s->parse_context; //FIXME move these demuxng hack to avformat
s->parse_context.buffer=0;
@@ -645,8 +648,8 @@ retry:
s->parse_context= pc;
}
if (!s->context_initialized) {
- avctx->width = s->width;
- avctx->height = s->height;
+ avctx->width = -((-s->width)>>avctx->lowres);
+ avctx->height = -((-s->height)>>avctx->lowres);
goto retry;
}