From 157f15e1d3f5343607e683844cfa57bee0dd8cce Mon Sep 17 00:00:00 2001 From: Jim Bankoski Date: Tue, 6 Mar 2012 09:31:51 -0800 Subject: 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 --- vp8/encoder/rdopt.c | 11 +++++++++-- vp8/encoder/treewriter.c | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'vp8/encoder') diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index e239281ff..dc12b6198 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -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) diff --git a/vp8/encoder/treewriter.c b/vp8/encoder/treewriter.c index 03967c835..3a777f222 100644 --- a/vp8/encoder/treewriter.c +++ b/vp8/encoder/treewriter.c @@ -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); +} + -- cgit v1.2.3