[FFmpeg-cvslog] r10005 - in trunk/libavcodec: cavsdec.c svq3.c vc1.c

alex subversion
Thu Aug 9 03:08:28 CEST 2007


Author: alex
Date: Thu Aug  9 03:08:28 2007
New Revision: 10005

Log:
use skip_bits where appropriate

Modified:
   trunk/libavcodec/cavsdec.c
   trunk/libavcodec/svq3.c
   trunk/libavcodec/vc1.c

Modified: trunk/libavcodec/cavsdec.c
==============================================================================
--- trunk/libavcodec/cavsdec.c	(original)
+++ trunk/libavcodec/cavsdec.c	Thu Aug  9 03:08:28 2007
@@ -432,7 +432,7 @@ static inline void check_for_slice(AVSCo
     int align;
     align = (-get_bits_count(gb)) & 7;
     if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
-        get_bits_long(gb,24+align);
+        skip_bits_long(gb,24+align);
         h->stc = get_bits(gb,8);
         decode_slice_header(h,gb);
     }
@@ -455,7 +455,7 @@ static int decode_pic(AVSContext *h) {
             return -1;
         ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct);
     }
-    get_bits(&s->gb,16);//bbv_dwlay
+    skip_bits(&s->gb,16);//bbv_dwlay
     if(h->stc == PIC_PB_START_CODE) {
         h->pic_type = get_bits(&s->gb,2) + FF_I_TYPE;
         if(h->pic_type > FF_B_TYPE) {
@@ -469,7 +469,7 @@ static int decode_pic(AVSContext *h) {
     } else {
         h->pic_type = FF_I_TYPE;
         if(get_bits1(&s->gb))
-            get_bits(&s->gb,16);//time_code
+            skip_bits(&s->gb,16);//time_code
     }
     /* release last B frame */
     if(h->picture.data[0])
@@ -501,7 +501,7 @@ static int decode_pic(AVSContext *h) {
     if(h->progressive)
         h->pic_structure = 1;
     else if(!(h->pic_structure = get_bits1(&s->gb) && (h->stc == PIC_PB_START_CODE)) )
-        get_bits1(&s->gb);     //advanced_pred_mode_disable
+        skip_bits1(&s->gb);     //advanced_pred_mode_disable
     skip_bits1(&s->gb);        //top_field_first
     skip_bits1(&s->gb);        //repeat_first_field
     h->qp_fixed                = get_bits1(&s->gb);

Modified: trunk/libavcodec/svq3.c
==============================================================================
--- trunk/libavcodec/svq3.c	(original)
+++ trunk/libavcodec/svq3.c	Thu Aug  9 03:08:28 2007
@@ -748,7 +748,7 @@ static int svq3_decode_slice_header (H26
     i = (s->mb_num < 64) ? 6 : (1 + av_log2 (s->mb_num - 1));
     s->mb_skip_run = get_bits (&s->gb, i) - (s->mb_x + (s->mb_y * s->mb_width));
   } else {
-    get_bits1 (&s->gb);
+    skip_bits1 (&s->gb);
     s->mb_skip_run = 0;
   }
 
@@ -757,17 +757,17 @@ static int svq3_decode_slice_header (H26
   s->adaptive_quant = get_bits1 (&s->gb);
 
   /* unknown fields */
-  get_bits1 (&s->gb);
+  skip_bits1 (&s->gb);
 
   if (h->unknown_svq3_flag) {
-    get_bits1 (&s->gb);
+    skip_bits1 (&s->gb);
   }
 
-  get_bits1 (&s->gb);
-  get_bits (&s->gb, 2);
+  skip_bits1 (&s->gb);
+  skip_bits (&s->gb, 2);
 
   while (get_bits1 (&s->gb)) {
-    get_bits (&s->gb, 8);
+    skip_bits (&s->gb, 8);
   }
 
   /* reset intra predictors and invalidate motion vector references */
@@ -834,26 +834,26 @@ static int svq3_decode_frame (AVCodecCon
 
       /* 'frame size code' and optional 'width, height' */
       if (get_bits (&gb, 3) == 7) {
-        get_bits (&gb, 12);
-        get_bits (&gb, 12);
+        skip_bits (&gb, 12);
+        skip_bits (&gb, 12);
       }
 
       h->halfpel_flag = get_bits1 (&gb);
       h->thirdpel_flag = get_bits1 (&gb);
 
       /* unknown fields */
-      get_bits1 (&gb);
-      get_bits1 (&gb);
-      get_bits1 (&gb);
-      get_bits1 (&gb);
+      skip_bits1 (&gb);
+      skip_bits1 (&gb);
+      skip_bits1 (&gb);
+      skip_bits1 (&gb);
 
       s->low_delay = get_bits1 (&gb);
 
       /* unknown field */
-      get_bits1 (&gb);
+      skip_bits1 (&gb);
 
       while (get_bits1 (&gb)) {
-        get_bits (&gb, 8);
+        skip_bits (&gb, 8);
       }
 
       h->unknown_svq3_flag = get_bits1 (&gb);

Modified: trunk/libavcodec/vc1.c
==============================================================================
--- trunk/libavcodec/vc1.c	(original)
+++ trunk/libavcodec/vc1.c	Thu Aug  9 03:08:28 2007
@@ -913,7 +913,7 @@ static int decode_sequence_header_adv(VC
     v->interlace = get_bits1(gb);
     v->tfcntrflag = get_bits1(gb);
     v->finterpflag = get_bits1(gb);
-    get_bits1(gb); // reserved
+    skip_bits1(gb); // reserved
 
     v->s.h_edge_pos = v->s.avctx->coded_width;
     v->s.v_edge_pos = v->s.avctx->coded_height;
@@ -975,11 +975,11 @@ static int decode_sequence_header_adv(VC
     if(v->hrd_param_flag) {
         int i;
         v->hrd_num_leaky_buckets = get_bits(gb, 5);
-        get_bits(gb, 4); //bitrate exponent
-        get_bits(gb, 4); //buffer size exponent
+        skip_bits(gb, 4); //bitrate exponent
+        skip_bits(gb, 4); //buffer size exponent
         for(i = 0; i < v->hrd_num_leaky_buckets; i++) {
-            get_bits(gb, 16); //hrd_rate[n]
-            get_bits(gb, 16); //hrd_buffer[n]
+            skip_bits(gb, 16); //hrd_rate[n]
+            skip_bits(gb, 16); //hrd_buffer[n]
         }
     }
     return 0;
@@ -1005,7 +1005,7 @@ static int decode_entry_point(AVCodecCon
 
     if(v->hrd_param_flag){
         for(i = 0; i < v->hrd_num_leaky_buckets; i++) {
-            get_bits(gb, 8); //hrd_full[n]
+            skip_bits(gb, 8); //hrd_full[n]
         }
     }
 
@@ -1059,7 +1059,7 @@ static int vc1_parse_frame_header(VC1Con
         }
     }
     if(v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE)
-        get_bits(gb, 7); // skip buffer fullness
+        skip_bits(gb, 7); // skip buffer fullness
 
     /* calculate RND */
     if(v->s.pict_type == I_TYPE || v->s.pict_type == BI_TYPE)
@@ -1278,7 +1278,7 @@ static int vc1_parse_frame_header_adv(VC
         return 0;
     }
     if(v->tfcntrflag)
-        get_bits(gb, 8);
+        skip_bits(gb, 8);
     if(v->broadcast) {
         if(!v->interlace || v->psf) {
             v->rptfrm = get_bits(gb, 2);




More information about the ffmpeg-cvslog mailing list