Cleaning up cost_coeffs().
Change-Id: I02f097fd7c4c787035f03114ddde5b04b2640b39
This commit is contained in:
parent
c9a5584e40
commit
c313c54835
@ -564,13 +564,11 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
|
|||||||
const PLANE_TYPE type = pd->plane_type;
|
const PLANE_TYPE type = pd->plane_type;
|
||||||
const int16_t *band_count = &band_counts[tx_size][1];
|
const int16_t *band_count = &band_counts[tx_size][1];
|
||||||
const int eob = p->eobs[block];
|
const int eob = p->eobs[block];
|
||||||
const int16_t *const qcoeff_ptr = BLOCK_OFFSET(p->qcoeff, block);
|
const int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
|
||||||
const int ref = mbmi->ref_frame[0] != INTRA_FRAME;
|
|
||||||
unsigned int (*token_costs)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] =
|
unsigned int (*token_costs)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] =
|
||||||
x->token_costs[tx_size][type][ref];
|
x->token_costs[tx_size][type][is_inter_block(mbmi)];
|
||||||
const ENTROPY_CONTEXT above_ec = !!*A, left_ec = !!*L;
|
|
||||||
uint8_t *p_tok = x->token_cache;
|
uint8_t *p_tok = x->token_cache;
|
||||||
int pt = combine_entropy_contexts(above_ec, left_ec);
|
int pt = combine_entropy_contexts(*A, *L);
|
||||||
int c, cost;
|
int c, cost;
|
||||||
|
|
||||||
// Check for consistency of tx_size with mode info
|
// Check for consistency of tx_size with mode info
|
||||||
@ -585,7 +583,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
|
|||||||
int band_left = *band_count++;
|
int band_left = *band_count++;
|
||||||
|
|
||||||
// dc token
|
// dc token
|
||||||
int v = qcoeff_ptr[0];
|
int v = qcoeff[0];
|
||||||
int prev_t = vp9_dct_value_tokens_ptr[v].token;
|
int prev_t = vp9_dct_value_tokens_ptr[v].token;
|
||||||
cost = (*token_costs)[0][pt][prev_t] + vp9_dct_value_cost_ptr[v];
|
cost = (*token_costs)[0][pt][prev_t] + vp9_dct_value_cost_ptr[v];
|
||||||
p_tok[0] = vp9_pt_energy_class[prev_t];
|
p_tok[0] = vp9_pt_energy_class[prev_t];
|
||||||
@ -596,7 +594,7 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
|
|||||||
const int rc = scan[c];
|
const int rc = scan[c];
|
||||||
int t;
|
int t;
|
||||||
|
|
||||||
v = qcoeff_ptr[rc];
|
v = qcoeff[rc];
|
||||||
t = vp9_dct_value_tokens_ptr[v].token;
|
t = vp9_dct_value_tokens_ptr[v].token;
|
||||||
pt = get_coef_context(nb, p_tok, c);
|
pt = get_coef_context(nb, p_tok, c);
|
||||||
cost += (*token_costs)[!prev_t][pt][t] + vp9_dct_value_cost_ptr[v];
|
cost += (*token_costs)[!prev_t][pt][t] + vp9_dct_value_cost_ptr[v];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user