shithub: libvpx

Download patch

ref: 157f15e1d3f5343607e683844cfa57bee0dd8cce
parent: 98bf413b4b4e26bec938ceedabdef2b7dab33ee8
author: Jim Bankoski <jimbankoski@google.com>
date: Tue Mar 6 04:31:51 EST 2012

Imported a change from stable branch

https://gerrit.chromium.org/gerrit/#change,17319 fixes cost estimating
to take skip_eob into account. No quality difference seen on derf set
tests, but about .4% gain on STD_HD set.

Change-Id: Ic5fe6d35ee021e664a6fcd28037b8432a0e470ca

--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -214,8 +214,15 @@
     for (i = 0; i < BLOCK_TYPES; i++)
         for (j = 0; j < COEF_BANDS; j++)
             for (k = 0; k < PREV_COEF_CONTEXTS; k++)
-                vp8_cost_tokens((int *)(c [i][j][k]), p [i][j][k], vp8_coef_tree);
+            {
 
+                if(k == 0 && ((j > 0 && i > 0) || (j > 1 && i == 0)))
+                    vp8_cost_tokens_skip((int *)(c [i][j][k]), p [i][j][k], vp8_coef_tree);
+                else
+
+                    vp8_cost_tokens((int *)(c [i][j][k]), p [i][j][k], vp8_coef_tree);
+            }
+
 }
 
 static int rd_iifactor [ 32 ] =  {    4,   4,   3,   2,   1,   0,   0,   0,
@@ -250,7 +257,7 @@
     int q;
 
     q = vp8_dc_quant(qindex,0);
-    return (3 * q * q) >> 4;
+    return (11 * q * q) >> 6;
 }
 
 void vp8cx_initialize_me_consts(VP8_COMP *cpi, int QIndex)
--- a/vp8/encoder/treewriter.c
+++ b/vp8/encoder/treewriter.c
@@ -37,3 +37,9 @@
 {
     cost(c, t, p, 0, 0);
 }
+
+void vp8_cost_tokens_skip(int *c, const vp8_prob *p, vp8_tree t)
+{
+    cost(c, t, p, 2, 0);
+}
+