cost_coeff speed improvements
Preliminary tests indicated that these changes make cost_coeffs approximately 20% faster which is a 2% improvement overall Change-Id: Iaf013ba75884415cd824e98349f654ffb1c3ef33
This commit is contained in:
@@ -76,6 +76,7 @@ extern const int16_t *vp10_dct_value_cost_ptr;
|
||||
*/
|
||||
extern const TOKENVALUE *vp10_dct_value_tokens_ptr;
|
||||
extern const TOKENVALUE *vp10_dct_cat_lt_10_value_tokens;
|
||||
extern const int *vp10_dct_cat_lt_10_value_cost;
|
||||
extern const int16_t vp10_cat6_low_cost[256];
|
||||
extern const int vp10_cat6_high_cost[64];
|
||||
extern const int vp10_cat6_high10_high_cost[256];
|
||||
@@ -119,6 +120,18 @@ static INLINE int16_t vp10_get_token(int v) {
|
||||
return vp10_dct_cat_lt_10_value_tokens[v].token;
|
||||
}
|
||||
|
||||
static INLINE int vp10_get_token_cost(int v, int16_t *token,
|
||||
const int *cat6_high_table) {
|
||||
if (v >= CAT6_MIN_VAL || v <= -CAT6_MIN_VAL) {
|
||||
EXTRABIT extrabits;
|
||||
*token = CATEGORY6_TOKEN;
|
||||
extrabits = abs(v) - CAT6_MIN_VAL;
|
||||
return vp10_cat6_low_cost[extrabits & 0xff]
|
||||
+ cat6_high_table[extrabits >> 8];
|
||||
}
|
||||
*token = vp10_dct_cat_lt_10_value_tokens[v].token;
|
||||
return vp10_dct_cat_lt_10_value_cost[v];
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user