aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-11-20 13:08:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-11-20 13:08:04 +0000
commit5d3cea3a86a9b994591998fb05cacfc16ae4852d (patch)
treef9611b77616e2f574eb57c531cafa62d916c58a4 /libavcodec/h263dec.c
parent67d06418daaee0ec43418f5e9a6288fc12203f54 (diff)
downloadffmpeg-5d3cea3a86a9b994591998fb05cacfc16ae4852d.tar.gz
aspect ratio cleanup
Originally committed as revision 1254 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 69e1617662..256dd8446e 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -348,6 +348,8 @@ static int h263_decode_frame(AVCodecContext *avctx,
MpegEncContext *s = avctx->priv_data;
int ret,i;
AVPicture *pict = data;
+ float new_aspect;
+
#ifdef PRINT_FRAME_TIME
uint64_t time= rdtsc();
#endif
@@ -495,23 +497,19 @@ retry:
/* and other parameters. So then we could init the picture */
/* FIXME: By the way H263 decoder is evolving it should have */
/* an H263EncContext */
+ if(s->aspected_height)
+ new_aspect= (float)s->aspected_width / (float)s->aspected_height;
+ else
+ new_aspect=0;
+
if ( s->width != avctx->width || s->height != avctx->height
- || avctx->aspect_ratio_info != s->aspect_ratio_info
- || avctx->aspected_width != s->aspected_width
- || avctx->aspected_height != s->aspected_height) {
+ || ABS(new_aspect - avctx->aspect_ratio) > 0.001) {
/* H.263 could change picture size any time */
MPV_common_end(s);
s->context_initialized=0;
}
if (!s->context_initialized) {
- avctx->width = s->width;
- avctx->height = s->height;
- avctx->aspect_ratio_info= s->aspect_ratio_info;
- if (s->aspect_ratio_info == FF_ASPECT_EXTENDED)
- {
- avctx->aspected_width = s->aspected_width;
- avctx->aspected_height = s->aspected_height;
- }
+ avctx->aspect_ratio= new_aspect;
goto retry;
}