diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-02-22 11:03:14 -0800 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2013-02-22 11:03:14 -0800 |
commit | 548b4dd5f2ace8d1ee9487f166f456621663ff87 (patch) | |
tree | 54e7840bd8fd280f0c74efdcfe181f692c4e99da /vp9/decoder/vp9_dboolhuff.h | |
parent | 5a18106fb7829ecb2a6f8413ff5c34fc6419ea6e (diff) | |
download | libvpx-548b4dd5f2ace8d1ee9487f166f456621663ff87.tar libvpx-548b4dd5f2ace8d1ee9487f166f456621663ff87.tar.gz libvpx-548b4dd5f2ace8d1ee9487f166f456621663ff87.tar.bz2 libvpx-548b4dd5f2ace8d1ee9487f166f456621663ff87.zip |
Code cleanup.
Removing redundant 'extern' keywords and parentheses, fixing indentation,
making variable names lower case, using short expressions x *= c
instead of x = x * c, minor code simplifications.
Change-Id: If6a25fcf306d1db26e90d27e3c24a32735c607de
Diffstat (limited to 'vp9/decoder/vp9_dboolhuff.h')
-rw-r--r-- | vp9/decoder/vp9_dboolhuff.h | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/vp9/decoder/vp9_dboolhuff.h b/vp9/decoder/vp9_dboolhuff.h index bded15942..cf31d380a 100644 --- a/vp9/decoder/vp9_dboolhuff.h +++ b/vp9/decoder/vp9_dboolhuff.h @@ -45,46 +45,13 @@ int vp9_decode_uniform(BOOL_DECODER *br, int n); int vp9_decode_term_subexp(BOOL_DECODER *br, int k, int num_syms); int vp9_inv_recenter_nonneg(int v, int m); -/*The refill loop is used in several places, so define it in a macro to make - sure they're all consistent. - An inline function would be cleaner, but has a significant penalty, because - multiple BOOL_DECODER fields must be modified, and the compiler is not smart - enough to eliminate the stores to those fields and the subsequent reloads - from them when inlining the function.*/ -#define VP9DX_BOOL_DECODER_FILL(_count,_value,_bufptr,_bufend) \ - do \ - { \ - int shift = VP9_BD_VALUE_SIZE - 8 - ((_count) + 8); \ - int loop_end, x; \ - int bits_left = (int)(((_bufend)-(_bufptr))*CHAR_BIT); \ - \ - x = shift + CHAR_BIT - bits_left; \ - loop_end = 0; \ - if(x >= 0) \ - { \ - (_count) += VP9_LOTS_OF_BITS; \ - loop_end = x; \ - if(!bits_left) break; \ - } \ - while(shift >= loop_end) \ - { \ - (_count) += CHAR_BIT; \ - (_value) |= (VP9_BD_VALUE)*(_bufptr)++ << shift; \ - shift -= CHAR_BIT; \ - } \ - } \ - while(0) \ - - static int decode_bool(BOOL_DECODER *br, int probability) { unsigned int bit = 0; VP9_BD_VALUE value; - unsigned int split; VP9_BD_VALUE bigsplit; int count; unsigned int range; - - split = 1 + (((br->range - 1) * probability) >> 8); + unsigned int split = 1 + (((br->range - 1) * probability) >> 8); if (br->count < 0) vp9_bool_decoder_fill(br); |