From 019b75086797567f525d167d4b6e127e578bbb2c Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Fri, 17 Jun 2016 10:24:34 -0700 Subject: [PATCH] Use precise rate estimate for zero_token This commit takes the precise rate estimate for zero_token rate cost update. It improves the compression performance: lowres 0.15% midres 0.23% Change-Id: I36761079f75ce43c814f8c663667e359d4ac2cd4 --- vp10/encoder/encodemb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vp10/encoder/encodemb.c b/vp10/encoder/encodemb.c index a741e2ecb..085f7fc03 100644 --- a/vp10/encoder/encodemb.c +++ b/vp10/encoder/encodemb.c @@ -312,13 +312,14 @@ int vp10_optimize_b(MACROBLOCK *mb, int plane, int block, */ t0 = tokens[next][0].token; t1 = tokens[next][1].token; + pt = get_coef_context(nb, token_cache, i + 1); /* Update the cost of each path if we're past the EOB token. */ if (t0 != EOB_TOKEN) { - tokens[next][0].rate += (*token_costs)[1][0][t0]; + tokens[next][0].rate += (*token_costs)[1][pt][t0]; tokens[next][0].token = ZERO_TOKEN; } if (t1 != EOB_TOKEN) { - tokens[next][1].rate += (*token_costs)[1][0][t1]; + tokens[next][1].rate += (*token_costs)[1][pt][t1]; tokens[next][1].token = ZERO_TOKEN; } best_index[i][0] = best_index[i][1] = 0; -- 2.49.0