diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-12-02 21:58:56 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-12-02 21:58:56 +0000 |
commit | 92afdd9267027f569dea2807d7057eaa2bbdb8c9 (patch) | |
tree | a715e06f0c0c9cc2e8074255935f3f0f9665f164 /src/libffmpeg/libavcodec/h263dec.c | |
parent | 0c94a4778c29309553e86e8c39f314277f4b2ddf (diff) | |
download | xine-lib-92afdd9267027f569dea2807d7057eaa2bbdb8c9.tar.gz xine-lib-92afdd9267027f569dea2807d7057eaa2bbdb8c9.tar.bz2 |
update ffmpeg, pass fourcc and other stuff that might be useful
CVS patchset: 3414
CVS date: 2002/12/02 21:58:56
Diffstat (limited to 'src/libffmpeg/libavcodec/h263dec.c')
-rw-r--r-- | src/libffmpeg/libavcodec/h263dec.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/libffmpeg/libavcodec/h263dec.c b/src/libffmpeg/libavcodec/h263dec.c index 69e161766..0c88cd758 100644 --- a/src/libffmpeg/libavcodec/h263dec.c +++ b/src/libffmpeg/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 @@ -356,9 +358,6 @@ uint64_t time= rdtsc(); printf("bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]); #endif - s->hurry_up= avctx->hurry_up; - s->error_resilience= avctx->error_resilience; - s->flags= avctx->flags; *data_size = 0; @@ -495,10 +494,13 @@ 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= s->aspected_width*s->width / (float)(s->height*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; @@ -506,12 +508,7 @@ retry: 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; } @@ -532,9 +529,9 @@ retry: /* skip b frames if we dont have reference frames */ if(s->num_available_buffers<2 && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size); /* skip b frames if we are in a hurry */ - if(s->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size); + if(avctx->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size); /* skip everything if we are in a hurry>=5 */ - if(s->hurry_up>=5) return get_consumed_bytes(s, buf_size); + if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size); if(s->next_p_frame_damaged){ if(s->pict_type==B_TYPE) |