diff options
author | Roman Shaposhnik <roman@shaposhnik.org> | 2004-03-12 23:39:38 +0000 |
---|---|---|
committer | Roman Shaposhnik <roman@shaposhnik.org> | 2004-03-12 23:39:38 +0000 |
commit | e7a18d5debc40d39e842d7b7bd1f57ab886c47b9 (patch) | |
tree | 55d544d8ff5e4fe6750b9d0c967672adca007fbe /libavcodec/dv.c | |
parent | 6e046750d8aee9010ac923602c4cd6bc6acda78e (diff) | |
download | ffmpeg-e7a18d5debc40d39e842d7b7bd1f57ab886c47b9.tar.gz |
* 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.
Originally committed as revision 2874 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dv.c')
-rw-r--r-- | libavcodec/dv.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 8e041b5039..08be11d45a 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -642,12 +642,6 @@ typedef struct EncBlockInfo { 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 @@ static always_inline void dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, 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); |