ref: 58b004ff643c5314de1ecd9973af2f7358f2ec63
parent: 8dd3905163c5301e6746d7a8583fd68a714e2992
parent: 20f34ff0db64ebc809dd19a184b7b026d145bd7a
author: Dmitry Kovalev <[email protected]>
date: Tue Nov 12 10:48:07 EST 2013
Merge "Adding const to tree pointer inside vp9_extra_bit struct."
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -51,7 +51,7 @@
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;
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -256,7 +256,7 @@
}
}
-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;
@@ -263,8 +263,8 @@
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 @@
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 @@
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;
}
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -57,7 +57,7 @@
// 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 @@
} 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 {