summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2016-01-19 20:04:28 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-01-19 20:04:28 +0000
commitcb785ade5b22029872afbf8103d6df484af66ffa (patch)
tree5fd6750f500f5e12c92bb8fa2c9ad9578bcd15b5 /vp9
parentc0307e6cea0fcd79577eaa107f76b07acaf1d4e6 (diff)
parentdea6f5217ef405cfd1f11f48edf43c4e2ca95e3d (diff)
downloadlibvpx-cb785ade5b22029872afbf8103d6df484af66ffa.tar
libvpx-cb785ade5b22029872afbf8103d6df484af66ffa.tar.gz
libvpx-cb785ade5b22029872afbf8103d6df484af66ffa.tar.bz2
libvpx-cb785ade5b22029872afbf8103d6df484af66ffa.zip
Merge "Deduplicate sign cost for ONE/TWO/THREE/FOUR tokens"
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_tokenize.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index 010903a69..9ac80483a 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -67,10 +67,7 @@ const vpx_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
};
static const int16_t zero_cost[] = {0};
-static const int16_t one_cost[] = {255, 257};
-static const int16_t two_cost[] = {255, 257};
-static const int16_t three_cost[] = {255, 257};
-static const int16_t four_cost[] = {255, 257};
+static const int16_t sign_cost[] = {255, 257};
static const int16_t cat1_cost[] = {429, 431, 616, 618};
static const int16_t cat2_cost[] = {624, 626, 727, 729, 848, 850, 951, 953};
static const int16_t cat3_cost[] = {
@@ -360,10 +357,10 @@ const int16_t vp9_cat6_high12_high_cost[2048] = {
const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS] = {
{0, 0, 0, zero_cost}, // ZERO_TOKEN
- {0, 0, 1, one_cost}, // ONE_TOKEN
- {0, 0, 2, two_cost}, // TWO_TOKEN
- {0, 0, 3, three_cost}, // THREE_TOKEN
- {0, 0, 4, four_cost}, // FOUR_TOKEN
+ {0, 0, 1, sign_cost}, // ONE_TOKEN
+ {0, 0, 2, sign_cost}, // TWO_TOKEN
+ {0, 0, 3, sign_cost}, // THREE_TOKEN
+ {0, 0, 4, sign_cost}, // FOUR_TOKEN
{vp9_cat1_prob, 1, CAT1_MIN_VAL, cat1_cost}, // CATEGORY1_TOKEN
{vp9_cat2_prob, 2, CAT2_MIN_VAL, cat2_cost}, // CATEGORY2_TOKEN
{vp9_cat3_prob, 3, CAT3_MIN_VAL, cat3_cost}, // CATEGORY3_TOKEN
@@ -376,10 +373,10 @@ const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS] = {
#if CONFIG_VP9_HIGHBITDEPTH
const vp9_extra_bit vp9_extra_bits_high10[ENTROPY_TOKENS] = {
{0, 0, 0, zero_cost}, // ZERO
- {0, 0, 1, one_cost}, // ONE
- {0, 0, 2, two_cost}, // TWO
- {0, 0, 3, three_cost}, // THREE
- {0, 0, 4, four_cost}, // FOUR
+ {0, 0, 1, sign_cost}, // ONE
+ {0, 0, 2, sign_cost}, // TWO
+ {0, 0, 3, sign_cost}, // THREE
+ {0, 0, 4, sign_cost}, // FOUR
{vp9_cat1_prob, 1, CAT1_MIN_VAL, cat1_cost}, // CAT1
{vp9_cat2_prob, 2, CAT2_MIN_VAL, cat2_cost}, // CAT2
{vp9_cat3_prob, 3, CAT3_MIN_VAL, cat3_cost}, // CAT3
@@ -390,10 +387,10 @@ const vp9_extra_bit vp9_extra_bits_high10[ENTROPY_TOKENS] = {
};
const vp9_extra_bit vp9_extra_bits_high12[ENTROPY_TOKENS] = {
{0, 0, 0, zero_cost}, // ZERO
- {0, 0, 1, one_cost}, // ONE
- {0, 0, 2, two_cost}, // TWO
- {0, 0, 3, three_cost}, // THREE
- {0, 0, 4, four_cost}, // FOUR
+ {0, 0, 1, sign_cost}, // ONE
+ {0, 0, 2, sign_cost}, // TWO
+ {0, 0, 3, sign_cost}, // THREE
+ {0, 0, 4, sign_cost}, // FOUR
{vp9_cat1_prob, 1, CAT1_MIN_VAL, cat1_cost}, // CAT1
{vp9_cat2_prob, 2, CAT2_MIN_VAL, cat2_cost}, // CAT2
{vp9_cat3_prob, 3, CAT3_MIN_VAL, cat3_cost}, // CAT3