diff h263.c @ 10535:95f3daa991a2 libavcodec

Use get_bits_left() instead of size_in_bits - get_bits_count().
author rbultje
date Mon, 16 Nov 2009 17:42:43 +0000
parents c78fd9154378
children 703cfed31320
line wrap: on
line diff
--- a/h263.c	Mon Nov 16 01:56:47 2009 +0000
+++ b/h263.c	Mon Nov 16 17:42:43 2009 +0000
@@ -2994,7 +2994,7 @@
 
         /* We have a GBSC probably with GSTUFF */
     skip_bits(&s->gb, 16); /* Drop the zeros */
-    left= s->gb.size_in_bits - get_bits_count(&s->gb);
+    left= get_bits_left(&s->gb);
     //MN: we must check the bits left or we might end in a infinite loop (or segfault)
     for(;left>13; left--){
         if(get_bits1(&s->gb)) break; /* Seek the '1' bit */
@@ -3329,7 +3329,7 @@
     //OK, it's not where it is supposed to be ...
     s->gb= s->last_resync_gb;
     align_get_bits(&s->gb);
-    left= s->gb.size_in_bits - get_bits_count(&s->gb);
+    left= get_bits_left(&s->gb);
 
     for(;left>16+1+5+5; left-=8){
         if(show_bits(&s->gb, 16)==0){
@@ -3774,7 +3774,7 @@
     /* per-MB end of slice check */
 
     if(--s->mb_num_left <= 0){
-//printf("%06X %d\n", show_bits(&s->gb, 24), s->gb.size_in_bits - get_bits_count(&s->gb));
+//printf("%06X %d\n", show_bits(&s->gb, 24), get_bits_left(&s->gb));
         if(mpeg4_is_resync(s))
             return SLICE_END;
         else
@@ -5034,7 +5034,7 @@
 
     startcode= get_bits(&s->gb, 22-8);
 
-    for(i= s->gb.size_in_bits - get_bits_count(&s->gb); i>24; i-=8) {
+    for(i= get_bits_left(&s->gb); i>24; i-=8) {
         startcode = ((startcode << 8) | get_bits(&s->gb, 8)) & 0x003FFFFF;
 
         if(startcode == 0x20)