diff options
author | Arpi <arpi@thot.banki.hu> | 2001-08-03 23:09:15 +0000 |
---|---|---|
committer | Arpi <arpi@thot.banki.hu> | 2001-08-03 23:09:15 +0000 |
commit | 2931ecb90f5518361460805a6b7fbc9690d364cc (patch) | |
tree | f8c0c43bd1f2745e2c5a58ebedbe8c8b06743e17 /libavcodec/common.c | |
parent | 4af7bcc1857e8abfa7ae9a8e3c54c93723219438 (diff) | |
download | ffmpeg-2931ecb90f5518361460805a6b7fbc9690d364cc.tar.gz |
inlineing common case of get_bits() -> gives 2speedup. more optim coming soon...
Originally committed as revision 31 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.c')
-rw-r--r-- | libavcodec/common.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/common.c b/libavcodec/common.c index 2f54b80b3d..47a2125aa5 100644 --- a/libavcodec/common.c +++ b/libavcodec/common.c @@ -199,26 +199,26 @@ void init_get_bits(GetBitContext *s, } /* n must be >= 1 and <= 32 */ -unsigned int get_bits(GetBitContext *s, int n) +/* also true: n > s->bit_cnt */ +unsigned int get_bits_long(GetBitContext *s, int n) { unsigned int val; int bit_cnt; unsigned int bit_buf; - UINT8 *buf_ptr; #ifdef STATS st_bit_counts[st_current_index] += n; #endif - bit_cnt = s->bit_cnt; bit_buf = s->bit_buf; + bit_cnt = s->bit_cnt - n; - bit_cnt -= n; - if (bit_cnt >= 0) { - /* most common case here */ - val = bit_buf >> (32 - n); - bit_buf <<= n; - } else { +// if (bit_cnt >= 0) { +// val = bit_buf >> (32 - n); +// bit_buf <<= n; +// } else + { + UINT8 *buf_ptr; val = bit_buf >> (32 - n); buf_ptr = s->buf_ptr; buf_ptr += 4; |