ref: 888699091def8d7dbe53de87826b62d4df8ac051
parent: a60461a34040b046e8cebc9a3ead66a4e972cda4
author: Jim Bankoski <jimbankoski@google.com>
date: Mon Mar 5 03:20:42 EST 2012
vp8e - fix coefficient costing Coefficient costing failed to take account of the first branch being skipped ( 0 vs eob) if the previous token is 0. Fixed rd to account for slightly increased token cost & cleaned up warning message Change-Id: I56140635d9f48a28dded5a816964e973a53975ef
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -137,9 +137,11 @@
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);
-
+ // check for pt=0 and band > 1 if block type 0 and 0 if blocktype 1
+ if(k==0 && j>(i==0) )
+ vp8_cost_tokens2((int *)(c [i][j][k]), p [i][j][k], vp8_coef_tree,2);
+ 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,
@@ -199,7 +201,7 @@
int q;
int i;
double capped_q = (Qvalue < 160) ? (double)Qvalue : 160.0;
- double rdconst = 2.70;
+ double rdconst = 2.60;
vp8_clear_system_state(); //__asm emms;
--- a/vp8/encoder/treewriter.c
+++ b/vp8/encoder/treewriter.c
@@ -37,3 +37,7 @@
{
cost(c, t, p, 0, 0);
}
+void vp8_cost_tokens2(int *c, const vp8_prob *p, vp8_tree t,int start)
+{
+ cost(c, t, p, start, 0);
+}
--- a/vp8/encoder/treewriter.h
+++ b/vp8/encoder/treewriter.h
@@ -119,4 +119,8 @@
int *Costs, const vp8_prob *, vp8_tree
);
+void vp8_cost_tokens2(
+ int *Costs, const vp8_prob *, vp8_tree, int
+);
+
#endif
--
⑨