changeset 1786:b7340afa261a libavcodec

get_bit_count -> put_bits_count
author alex
date Fri, 06 Feb 2004 15:27:31 +0000
parents 14d918d0ef42
children 752b51a3c8ed
files asv1.c common.c common.h ffv1.c h263.c h264.c huffyuv.c mjpeg.c mpeg12.c mpegvideo.c mpegvideo.h
diffstat 11 files changed, 33 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/asv1.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/asv1.c	Fri Feb 06 15:27:31 2004 +0000
@@ -519,10 +519,10 @@
     emms_c();
     
     align_put_bits(&a->pb);
-    while(get_bit_count(&a->pb)&31)
+    while(put_bits_count(&a->pb)&31)
         put_bits(&a->pb, 8, 0);
     
-    size= get_bit_count(&a->pb)/32;
+    size= put_bits_count(&a->pb)/32;
     
     if(avctx->codec_id == CODEC_ID_ASV1)
         a->dsp.bswap_buf((uint32_t*)buf, (uint32_t*)buf, size);
--- a/common.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/common.c	Fri Feb 06 15:27:31 2004 +0000
@@ -64,7 +64,7 @@
 #if 1
 
 /* return the number of bits output */
-int get_bit_count(PutBitContext *s)
+int put_bits_count(PutBitContext *s)
 {
 #ifdef ALT_BITSTREAM_WRITER
     return s->index;
--- a/common.h	Fri Feb 06 03:56:05 2004 +0000
+++ b/common.h	Fri Feb 06 15:27:31 2004 +0000
@@ -288,7 +288,7 @@
 
 void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size);
 
-int get_bit_count(PutBitContext *s); /* XXX: change function name */
+int put_bits_count(PutBitContext *s);
 void align_put_bits(PutBitContext *s);
 void flush_put_bits(PutBitContext *s);
 void put_string(PutBitContext * pbc, char *s);
--- a/ffv1.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/ffv1.c	Fri Feb 06 15:27:31 2004 +0000
@@ -409,7 +409,7 @@
                 }
             }
             
-//            printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, (int)get_bit_count(&s->pb));
+//            printf("count:%d index:%d, mode:%d, x:%d y:%d pos:%d\n", run_count, run_index, run_mode, x, y, (int)put_bits_count(&s->pb));
 
             if(run_mode == 0)
                 put_vlc_symbol(&s->pb, &p->vlc_state[context], diff, bits);
@@ -689,7 +689,7 @@
         return put_cabac_terminate(c, 1);
     }else{
         flush_put_bits(&f->pb); //nicer padding FIXME
-        return used_count + (get_bit_count(&f->pb)+7)/8;
+        return used_count + (put_bits_count(&f->pb)+7)/8;
     }
 }
 
--- a/h263.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/h263.c	Fri Feb 06 15:27:31 2004 +0000
@@ -1972,7 +1972,7 @@
 
 //            ff_mpeg4_stuffing(&s->pb); ?
             flush_put_bits(&s->pb);
-            s->avctx->extradata_size= (get_bit_count(&s->pb)+7)>>3;
+            s->avctx->extradata_size= (put_bits_count(&s->pb)+7)>>3;
         }
         
         break;
@@ -2146,7 +2146,7 @@
 {
     int length;
     put_bits(pbc, 1, 0);
-    length= (-get_bit_count(pbc))&7;
+    length= (-put_bits_count(pbc))&7;
     if(length) put_bits(pbc, length, (1<<length)-1);
 }
 
@@ -2972,9 +2972,9 @@
 
 void ff_mpeg4_merge_partitions(MpegEncContext *s)
 {
-    const int pb2_len   = get_bit_count(&s->pb2   );
-    const int tex_pb_len= get_bit_count(&s->tex_pb);
-    const int bits= get_bit_count(&s->pb);
+    const int pb2_len   = put_bits_count(&s->pb2   );
+    const int tex_pb_len= put_bits_count(&s->tex_pb);
+    const int bits= put_bits_count(&s->pb);
 
     if(s->pict_type==I_TYPE){
         put_bits(&s->pb, 19, DC_MARKER);
@@ -2992,7 +2992,7 @@
 
     ff_copy_bits(&s->pb, s->pb2_buffer   , pb2_len);
     ff_copy_bits(&s->pb, s->tex_pb_buffer, tex_pb_len);
-    s->last_bits= get_bit_count(&s->pb);
+    s->last_bits= put_bits_count(&s->pb);
 }
 
 #endif //CONFIG_ENCODERS
--- a/h264.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/h264.c	Fri Feb 06 15:27:31 2004 +0000
@@ -1070,7 +1070,7 @@
 static void encode_rbsp_trailing(PutBitContext *pb){
     int length;
     put_bits(pb, 1, 1);
-    length= (-get_bit_count(pb))&7;
+    length= (-put_bits_count(pb))&7;
     if(length) put_bits(pb, length, 0);
 }
 
--- a/huffyuv.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/huffyuv.c	Fri Feb 06 15:27:31 2004 +0000
@@ -1049,7 +1049,7 @@
     }
     emms_c();
     
-    size= (get_bit_count(&s->pb)+31)/32;
+    size= (put_bits_count(&s->pb)+31)/32;
     
     if((s->flags&CODEC_FLAG_PASS1) && (s->picture_number&31)==0){
         int j;
--- a/mjpeg.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/mjpeg.c	Fri Feb 06 15:27:31 2004 +0000
@@ -477,7 +477,7 @@
 
 static void escape_FF(MpegEncContext *s, int start)
 {
-    int size= get_bit_count(&s->pb) - start*8;
+    int size= put_bits_count(&s->pb) - start*8;
     int i, ff_count;
     uint8_t *buf= s->pb.buf + start;
     int align= (-(size_t)(buf))&3;
@@ -533,7 +533,7 @@
 
 void mjpeg_picture_trailer(MpegEncContext *s)
 {
-    int pad= (-get_bit_count(&s->pb))&7;
+    int pad= (-put_bits_count(&s->pb))&7;
     
     put_bits(&s->pb, pad,0xFF>>(8-pad));
     flush_put_bits(&s->pb);
@@ -651,7 +651,7 @@
     
     mjpeg_picture_header(s);
 
-    s->header_bits= get_bit_count(&s->pb);
+    s->header_bits= put_bits_count(&s->pb);
 
     if(avctx->pix_fmt == PIX_FMT_RGBA32){
         int x, y, i;
@@ -770,7 +770,7 @@
 
     flush_put_bits(&s->pb);
     return pbBufPtr(&s->pb) - s->pb.buf;
-//    return (get_bit_count(&f->pb)+7)/8;
+//    return (put_bits_count(&f->pb)+7)/8;
 }
 
 #endif //CONFIG_ENCODERS
--- a/mpeg12.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/mpeg12.c	Fri Feb 06 15:27:31 2004 +0000
@@ -379,7 +379,7 @@
                           s->gop_picture_number) & 0x3ff); 
     put_bits(&s->pb, 3, s->pict_type);
 
-    s->vbv_delay_ptr= s->pb.buf + get_bit_count(&s->pb)/8;
+    s->vbv_delay_ptr= s->pb.buf + put_bits_count(&s->pb)/8;
     put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */
     
     // RAL: Forward f_code also needed for B frames
--- a/mpegvideo.c	Fri Feb 06 03:56:05 2004 +0000
+++ b/mpegvideo.c	Fri Feb 06 15:27:31 2004 +0000
@@ -3734,10 +3734,10 @@
 
     encode_mb(s, motion_x, motion_y);
     
-    score= get_bit_count(&s->pb);
+    score= put_bits_count(&s->pb);
     if(s->data_partitioning){
-        score+= get_bit_count(&s->pb2);
-        score+= get_bit_count(&s->tex_pb);
+        score+= put_bits_count(&s->pb2);
+        score+= put_bits_count(&s->tex_pb);
     }
    
     if(s->avctx->mb_decision == FF_MB_DECISION_RD){
@@ -4012,7 +4012,7 @@
     if(s->current_picture.key_frame)
         s->picture_in_gop_number=0;
 
-    s->last_bits= get_bit_count(&s->pb);
+    s->last_bits= put_bits_count(&s->pb);
     switch(s->out_format) {
     case FMT_MJPEG:
         mjpeg_picture_header(s);
@@ -4041,7 +4041,7 @@
     default:
         assert(0);
     }
-    bits= get_bit_count(&s->pb);
+    bits= put_bits_count(&s->pb);
     s->header_bits= bits - s->last_bits;
     s->last_bits= bits;
     s->mv_bits=0;
@@ -4134,11 +4134,11 @@
                     align_put_bits(&s->pb);
                     flush_put_bits(&s->pb);
 
-                    assert((get_bit_count(&s->pb)&7) == 0);
+                    assert((put_bits_count(&s->pb)&7) == 0);
                     current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob;
                     
                     if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
-                        int r= get_bit_count(&s->pb)/8 + s->picture_number + s->codec_id + s->mb_x + s->mb_y;
+                        int r= put_bits_count(&s->pb)/8 + s->picture_number + s->codec_id + s->mb_x + s->mb_y;
                         int d= 100 / s->avctx->error_rate;
                         if(r % d == 0){
                             current_packet_size=0;
@@ -4169,7 +4169,7 @@
                     }
 
                     if(s->flags&CODEC_FLAG_PASS1){
-                        int bits= get_bit_count(&s->pb);
+                        int bits= put_bits_count(&s->pb);
                         s->misc_bits+= bits - s->last_bits;
                         s->last_bits= bits;
                     }
@@ -4394,23 +4394,23 @@
 
                 copy_context_after_encode(s, &best_s, -1);
                 
-                pb_bits_count= get_bit_count(&s->pb);
+                pb_bits_count= put_bits_count(&s->pb);
                 flush_put_bits(&s->pb);
                 ff_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count);
                 s->pb= backup_s.pb;
                 
                 if(s->data_partitioning){
-                    pb2_bits_count= get_bit_count(&s->pb2);
+                    pb2_bits_count= put_bits_count(&s->pb2);
                     flush_put_bits(&s->pb2);
                     ff_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count);
                     s->pb2= backup_s.pb2;
                     
-                    tex_pb_bits_count= get_bit_count(&s->tex_pb);
+                    tex_pb_bits_count= put_bits_count(&s->tex_pb);
                     flush_put_bits(&s->tex_pb);
                     ff_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count);
                     s->tex_pb= backup_s.tex_pb;
                 }
-                s->last_bits= get_bit_count(&s->pb);
+                s->last_bits= put_bits_count(&s->pb);
                
 #ifdef CONFIG_RISKY
                 if (s->out_format == FMT_H263 && s->pict_type!=B_TYPE)
@@ -4574,7 +4574,7 @@
             }
             if(s->loop_filter)
                 ff_h263_loop_filter(s);
-//printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, get_bit_count(&s->pb));
+//printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, put_bits_count(&s->pb));
         }
     }
     emms_c();
--- a/mpegvideo.h	Fri Feb 06 03:56:05 2004 +0000
+++ b/mpegvideo.h	Fri Feb 06 15:27:31 2004 +0000
@@ -749,7 +749,7 @@
 }
 
 static inline int get_bits_diff(MpegEncContext *s){
-    const int bits= get_bit_count(&s->pb);
+    const int bits= put_bits_count(&s->pb);
     const int last= s->last_bits;
 
     s->last_bits = bits;