diff dv.c @ 1875:45a1592dadca libavcodec

* moving some of the commonly used bit reading/writing functions from common.c -> common.h so that they can be inlined. + performace gain ~1% (measured with DV decoding) + code bloat 0.05% Looks like a win-win solution.
author romansh
date Fri, 12 Mar 2004 23:39:38 +0000
parents 88056e077c7f
children fbcf02596520
line wrap: on
line diff
--- a/dv.c	Thu Mar 11 13:22:39 2004 +0000
+++ b/dv.c	Fri Mar 12 23:39:38 2004 +0000
@@ -642,12 +642,6 @@
     uint32_t partial_bit_buffer; /* we can't use uint16_t here */
 } EncBlockInfo;
 
-static always_inline int dv_bits_left(PutBitContext* s)
-{
-    return (s->buf_end - s->buf) * 8 - 
-           ((s->buf_ptr - s->buf) * 8 + 32 - (int64_t)s->bit_left);
-}
-
 static always_inline void dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, 
                                        int pb_size)
 {
@@ -660,7 +654,7 @@
     bi->partial_bit_count = bi->partial_bit_buffer = 0;
 vlc_loop:
        /* Find suitable storage space */
-       for (; size > (bits_left = dv_bits_left(pb)); pb++) {
+       for (; size > (bits_left = put_bits_left(pb)); pb++) {
           if (bits_left) {
               size -= bits_left;
 	      put_bits(pb, bits_left, vlc >> size);