]> granicus.if.org Git - libvpx/commitdiff
Adding const to tree pointer inside vp9_extra_bit struct.
authorDmitry Kovalev <dkovalev@google.com>
Tue, 12 Nov 2013 22:21:15 +0000 (14:21 -0800)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 12 Nov 2013 22:21:15 +0000 (14:21 -0800)
Change-Id: I60e02fa3de930ff1f969687ab5af93dee40d86ad

vp9/common/vp9_entropy.h
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_tokenize.c

index ccb9c4c5527193170b81f12492e14153a69a3039..67b1669fc23c821cf5f3dc07280a5051e9d571a9 100644 (file)
@@ -51,7 +51,7 @@ extern const vp9_tree_index vp9_coefmodel_tree[];
 extern struct vp9_token vp9_coef_encodings[MAX_ENTROPY_TOKENS];
 
 typedef struct {
-  vp9_tree_index *tree;
+  const vp9_tree_index *tree;
   const vp9_prob *prob;
   int len;
   int base_val;
index e1978d4c6fd5922faffe34abcdaf0bf3cea4e7b7..1eda8422dfcf4c90476cb9e64c4816a047f886e9 100644 (file)
@@ -256,15 +256,15 @@ static void update_inter_mode_probs(VP9_COMMON *cm, vp9_writer *w) {
   }
 }
 
-static void pack_mb_tokens(vp9_writer* const bc,
+static void pack_mb_tokens(vp9_writer* const w,
                            TOKENEXTRA **tp,
                            const TOKENEXTRA *const stop) {
   TOKENEXTRA *p = *tp;
 
   while (p < stop && p->token != EOSB_TOKEN) {
     const int t = p->token;
-    const struct vp9_token *const a = vp9_coef_encodings + t;
-    const vp9_extra_bit *const b = vp9_extra_bits + t;
+    const struct vp9_token *const a = &vp9_coef_encodings[t];
+    const vp9_extra_bit *const b = &vp9_extra_bits[t];
     int i = 0;
     const vp9_prob *pp;
     int v = a->value;
@@ -287,7 +287,7 @@ static void pack_mb_tokens(vp9_writer* const bc,
 
     do {
       const int bb = (v >> --n) & 1;
-      vp9_write(bc, bb, pp[i >> 1]);
+      vp9_write(w, bb, pp[i >> 1]);
       i = vp9_coef_tree[i + bb];
     } while (n);
 
@@ -302,12 +302,12 @@ static void pack_mb_tokens(vp9_writer* const bc,
 
         do {
           const int bb = (v >> --n) & 1;
-          vp9_write(bc, bb, pb[i >> 1]);
+          vp9_write(w, bb, pb[i >> 1]);
           i = b->tree[i + bb];
         } while (n);
       }
 
-      vp9_write_bit(bc, e & 1);
+      vp9_write_bit(w, e & 1);
     }
     ++p;
   }
index 11dd0c0af3657fa3bd0e298431052f8784c2a32e..3d21ea8cafb8e5341840c82dd7f340e931a18584 100644 (file)
@@ -57,7 +57,7 @@ static void fill_value_tokens() {
     // initialize the cost for extra bits for all possible coefficient value.
     {
       int cost = 0;
-      const vp9_extra_bit *p = vp9_extra_bits + t[i].token;
+      const vp9_extra_bit *p = &vp9_extra_bits[t[i].token];
 
       if (p->base_val) {
         const int extra = t[i].extra;
@@ -73,7 +73,7 @@ static void fill_value_tokens() {
   } while (++i < DCT_MAX_VALUE);
 
   vp9_dct_value_tokens_ptr = dct_value_tokens + DCT_MAX_VALUE;
-  vp9_dct_value_cost_ptr   = dct_value_cost + DCT_MAX_VALUE;
+  vp9_dct_value_cost_ptr = dct_value_cost + DCT_MAX_VALUE;
 }
 
 struct tokenize_b_args {