summaryrefslogtreecommitdiff
path: root/vp9/decoder
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-11-16 10:48:23 -0800
committerJohn Koleszar <jkoleszar@google.com>2012-12-19 12:52:41 -0800
commit05ec800ea48f5666e2360d67d2e71faff6c0b992 (patch)
treeb8afe19439d0ac461414bb5e63b1675b3ad16818 /vp9/decoder
parent4cca47b5385adb8ace28b10db7a20f337b15bbeb (diff)
downloadlibvpx-05ec800ea48f5666e2360d67d2e71faff6c0b992.tar
libvpx-05ec800ea48f5666e2360d67d2e71faff6c0b992.tar.gz
libvpx-05ec800ea48f5666e2360d67d2e71faff6c0b992.tar.bz2
libvpx-05ec800ea48f5666e2360d67d2e71faff6c0b992.zip
Use boolcoder API instead of inlining
This patch changes the token packing to call the bool encoder API rather than inlining it into the token packing function, and similarly removes a special get_signed case from the detokenizer. This allows easier experimentation with changing the bool coder as a whole. Change-Id: I52c3625bbe4960b68cfb873b0e39ade0c82f9e91
Diffstat (limited to 'vp9/decoder')
-rw-r--r--vp9/decoder/vp9_detokenize.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 8fe218494..55ce0171a 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -60,26 +60,7 @@ static const vp9_prob cat6_prob[15] = {
DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
static int get_signed(BOOL_DECODER *br, int value_to_sign) {
- const int split = (br->range + 1) >> 1;
- const VP9_BD_VALUE bigsplit = (VP9_BD_VALUE)split << (VP9_BD_VALUE_SIZE - 8);
- int v;
-
- if (br->count < 0)
- vp9_bool_decoder_fill(br);
-
- if (br->value < bigsplit) {
- br->range = split;
- v = value_to_sign;
- } else {
- br->range = br->range - split;
- br->value = br->value - bigsplit;
- v = -value_to_sign;
- }
- br->range += br->range;
- br->value += br->value;
- --br->count;
-
- return v;
+ return decode_bool(br, 128) ? -value_to_sign : value_to_sign;
}
#define INCREMENT_COUNT(token) \