aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-12-09 14:05:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-12-09 14:05:39 +0000
commite4d1d920b097912ac423eee1bba28c8b68e89053 (patch)
tree7b286190c8e1d5d6c592ad7961b56fe417b21b20
parent52255d17466e01aea5113a21f782efc76258b3f3 (diff)
downloadffmpeg-e4d1d920b097912ac423eee1bba28c8b68e89053.tar.gz
Improve time_increment_bits guessing code.
Originally committed as revision 20785 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h263.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 831e4c1697..de76792139 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -5903,7 +5903,11 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
- if(show_bits(gb, s->time_increment_bits+1)&1) break;
+ if ( s->pict_type == FF_P_TYPE
+ || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
+ if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break;
+ }else
+ if((show_bits(gb, s->time_increment_bits+5)&0x1F) == 0x18) break;
}
av_log(s->avctx, AV_LOG_ERROR, "my guess is %d bits ;)\n",s->time_increment_bits);