changeset 10664:f56b8a9be9e1 libavcodec

Improve time_increment_bits guessing code.
author michael
date Wed, 09 Dec 2009 14:05:39 +0000
parents dc61c373810e
children 6cebfebeb18f
files h263.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Wed Dec 09 12:49:59 2009 +0000
+++ b/h263.c	Wed Dec 09 14:05:39 2009 +0000
@@ -5903,7 +5903,11 @@
         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);