]> granicus.if.org Git - libvpx/commitdiff
Use precise rate estimate for zero_token
authorJingning Han <jingning@google.com>
Fri, 17 Jun 2016 17:24:34 +0000 (10:24 -0700)
committerJingning Han <jingning@google.com>
Fri, 17 Jun 2016 17:57:30 +0000 (10:57 -0700)
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

index a741e2ecb14ff1e648a08c9ac9190b9b3ee1d31c..085f7fc037e66dfee0bb25b7aa11b4b58981bbeb 100644 (file)
@@ -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;