summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-02-27 18:58:32 -0800
committerDmitry Kovalev <dkovalev@google.com>2014-03-21 12:14:05 -0700
commit6b32e5f04a7fedb8fbb4d3a000d4951e9b06f91f (patch)
tree5d778b743de1c4824a0d20d5d46f3c4311c3be03 /vp9/encoder
parenta57de9da0374231dc08a97533baabaca9f28ec00 (diff)
downloadlibvpx-6b32e5f04a7fedb8fbb4d3a000d4951e9b06f91f.tar
libvpx-6b32e5f04a7fedb8fbb4d3a000d4951e9b06f91f.tar.gz
libvpx-6b32e5f04a7fedb8fbb4d3a000d4951e9b06f91f.tar.bz2
libvpx-6b32e5f04a7fedb8fbb4d3a000d4951e9b06f91f.zip
Using local variable for token_cache.
We use local variable for token_cache in the decoder. Change-Id: I032763fa7894313cffe73e3f14863ae1d0527665
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_block.h1
-rw-r--r--vp9/encoder/vp9_rdopt.c10
-rw-r--r--vp9/encoder/vp9_tokenize.c5
3 files changed, 7 insertions, 9 deletions
diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h
index 888984cce..1d13a0804 100644
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -157,7 +157,6 @@ struct macroblock {
// note that token_costs is the cost when eob node is skipped
vp9_coeff_cost token_costs[TX_SIZES];
- DECLARE_ALIGNED(16, uint8_t, token_cache[1024]);
int optimize;
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 2fd25ef5b..93f9999ba 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -566,7 +566,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
const int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
unsigned int (*token_costs)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] =
x->token_costs[tx_size][type][is_inter_block(mbmi)];
- uint8_t *p_tok = x->token_cache;
+ uint8_t token_cache[32 * 32];
int pt = combine_entropy_contexts(*A, *L);
int c, cost;
// Check for consistency of tx_size with mode info
@@ -584,7 +584,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
int v = qcoeff[0];
int prev_t = vp9_dct_value_tokens_ptr[v].token;
cost = (*token_costs)[0][pt][prev_t] + vp9_dct_value_cost_ptr[v];
- p_tok[0] = vp9_pt_energy_class[prev_t];
+ token_cache[0] = vp9_pt_energy_class[prev_t];
++token_costs;
// ac tokens
@@ -597,9 +597,9 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
if (use_fast_coef_costing) {
cost += (*token_costs)[!prev_t][!prev_t][t] + vp9_dct_value_cost_ptr[v];
} else {
- pt = get_coef_context(nb, p_tok, c);
+ pt = get_coef_context(nb, token_cache, c);
cost += (*token_costs)[!prev_t][pt][t] + vp9_dct_value_cost_ptr[v];
- p_tok[rc] = vp9_pt_energy_class[t];
+ token_cache[rc] = vp9_pt_energy_class[t];
}
prev_t = t;
if (!--band_left) {
@@ -613,7 +613,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
if (use_fast_coef_costing) {
cost += (*token_costs)[0][!prev_t][EOB_TOKEN];
} else {
- pt = get_coef_context(nb, p_tok, c);
+ pt = get_coef_context(nb, token_cache, c);
cost += (*token_costs)[0][pt][EOB_TOKEN];
}
}
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index bb5f1c23b..76d336d33 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -162,7 +162,6 @@ struct tokenize_b_args {
VP9_COMP *cpi;
MACROBLOCKD *xd;
TOKENEXTRA **tp;
- uint8_t *token_cache;
};
static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
@@ -213,7 +212,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
VP9_COMP *cpi = args->cpi;
MACROBLOCKD *xd = args->xd;
TOKENEXTRA **tp = args->tp;
- uint8_t *token_cache = args->token_cache;
+ uint8_t token_cache[32 * 32];
struct macroblock_plane *p = &cpi->mb.plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
@@ -315,7 +314,7 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
const int ctx = vp9_get_skip_context(xd);
const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
SEG_LVL_SKIP);
- struct tokenize_b_args arg = {cpi, xd, t, cpi->mb.token_cache};
+ struct tokenize_b_args arg = {cpi, xd, t};
if (mbmi->skip) {
if (!dry_run)
cm->counts.skip[ctx][1] += skip_inc;