]> granicus.if.org Git - libvpx/commitdiff
Imported a change from stable branch
authorJim Bankoski <jimbankoski@google.com>
Tue, 6 Mar 2012 17:31:51 +0000 (09:31 -0800)
committerYaowu Xu <yaowu@google.com>
Tue, 6 Mar 2012 20:20:34 +0000 (12:20 -0800)
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

vp8/encoder/rdopt.c
vp8/encoder/treewriter.c

index e239281ffa29d5b2415327955e0a56451bc4c92f..dc12b61981721a139dcaf96943573750c3409e8f 100644 (file)
@@ -214,7 +214,14 @@ static void fill_token_costs(
     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);
+            }
 
 }
 
@@ -250,7 +257,7 @@ int compute_rd_mult( int qindex )
     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)
index 03967c835dc2e0ef57e2b2abaf82691d09c264f5..3a777f222f631744df258aeb948b7bfe4cb480f8 100644 (file)
@@ -37,3 +37,9 @@ void vp8_cost_tokens(int *c, const vp8_prob *p, vp8_tree t)
 {
     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);
+}
+