Merge "make vp9_coef_encodings const"
authorJim Bankoski <jimbankoski@google.com>
Mon, 22 Dec 2014 23:05:25 +0000 (15:05 -0800)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Mon, 22 Dec 2014 23:05:25 +0000 (15:05 -0800)
1  2 
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_tokenize.c
vp9/encoder/vp9_tokenize.h

Simple merge
@@@ -175,20 -152,37 +175,19 @@@ const vp9_extra_bit vp9_extra_bits_high
  };
  #endif
  
- struct vp9_token vp9_coef_encodings[ENTROPY_TOKENS];
- void vp9_coef_tree_initialize() {
-   vp9_tokens_from_tree(vp9_coef_encodings, vp9_coef_tree);
- }
+ const struct vp9_token vp9_coef_encodings[ENTROPY_TOKENS] = {
+   {2, 2}, {6, 3}, {28, 5}, {58, 6}, {59, 6}, {60, 6}, {61, 6}, {124, 7},
+   {125, 7}, {126, 7}, {127, 7}, {0, 1}
+ };
  
 -static void tokenize_init_one(TOKENVALUE *t, const vp9_extra_bit *const e,
 +static void tokenize_init_one(const vp9_extra_bit *const e,
                                int16_t *value_cost, int max_value) {
    int i = -max_value;
 -  int sign = 1;
  
 +  TOKENVALUE t;
    do {
 -    if (!i)
 -      sign = 0;
 -
 -    {
 -      const int a = sign ? -i : i;
 -      int eb = sign;
 -
 -      if (a > 4) {
 -        int j = 4;
 -
 -        while (++j < 11  &&  e[j].base_val <= a) {}
 -
 -        t[i].token = --j;
 -        eb |= (a - e[j].base_val) << 1;
 -      } else {
 -        t[i].token = a;
 -      }
 -      t[i].extra = eb;
 -    }
  
 +    vp9_get_token_extra(i, &t.token, &t.extra);
      // initialize the cost for extra bits for all possible coefficient value.
      {
        int cost = 0;
Simple merge