aboutsummaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodemb.c
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2017-03-16 16:34:26 -0700
committerAlex Converse <aconverse@google.com>2017-03-16 17:03:22 -0700
commit3a6ec9ea72b7cc85f7dceb0753ee2d665ee2ef8c (patch)
treedb1e285af96c2a68af460820e59408e95fa6acbc /vp9/encoder/vp9_encodemb.c
parent8440cc48179d2e5d161007d45618c10a2d9d1352 (diff)
downloadlibvpx-3a6ec9ea72b7cc85f7dceb0753ee2d665ee2ef8c.tar.gz
vp9_optimize_b: Combine extrabits cost with token lookup
About 0.6% fewer cycles spent in vp9_optimize_b. Change-Id: I2ae62a78374c594ed81d4e3100a5848e2f6f2c4e
Diffstat (limited to 'vp9/encoder/vp9_encodemb.c')
-rw-r--r--vp9/encoder/vp9_encodemb.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index 1cf0b02e4..cf92dbafb 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -108,7 +108,6 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
int rate0, rate1;
int64_t error0, error1;
int16_t t0, t1;
- EXTRABIT e0;
unsigned int(*const token_costs)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] =
mb->token_costs[tx_size][type][ref];
int best, band, pt, i, final_eob;
@@ -144,7 +143,7 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
/* Evaluate the first possibility for this state. */
rate0 = tokens[next][0].rate;
rate1 = tokens[next][1].rate;
- vp9_get_token_extra(x, &t0, &e0);
+ vp9_get_token_extracost(cat6_high_cost, x, &t0, &base_bits);
/* Consider both possible successor states. */
if (next < default_eob) {
band = band_translate[i + 1];
@@ -155,7 +154,6 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
UPDATE_RD_COST();
/* And pick the best. */
best = rd_cost1 < rd_cost0;
- base_bits = vp9_get_cost(t0, e0, cat6_high_cost);
dx = (dqcoeff[rc] - coeff[rc]) * (1 << shift);
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
@@ -193,9 +191,9 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
*/
t0 = tokens[next][0].token == EOB_TOKEN ? EOB_TOKEN : ZERO_TOKEN;
t1 = tokens[next][1].token == EOB_TOKEN ? EOB_TOKEN : ZERO_TOKEN;
- e0 = 0;
+ base_bits = 0;
} else {
- vp9_get_token_extra(x, &t0, &e0);
+ vp9_get_token_extracost(cat6_high_cost, x, &t0, &base_bits);
t1 = t0;
}
if (next < default_eob) {
@@ -213,7 +211,6 @@ int vp9_optimize_b(MACROBLOCK *mb, int plane, int block, TX_SIZE tx_size,
UPDATE_RD_COST();
/* And pick the best. */
best = rd_cost1 < rd_cost0;
- base_bits = vp9_get_cost(t0, e0, cat6_high_cost);
#if CONFIG_VP9_HIGHBITDEPTH
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {