fix for LevelCost + little speed-up

the p0 proba was incorrectly accumulated. Merging its contribution into
the LevelCost[] was creating more problems than anything (esp. with trellis)
so let's just not.

Change-Id: I4c07bfee471085df901228d97b20a4d9606ba44e
This commit is contained in:
Pascal Massimino
2012-01-23 09:17:35 -08:00
parent 7107d54483
commit 7f23678da0
2 changed files with 6 additions and 3 deletions

View File

@ -359,7 +359,7 @@ void VP8CalculateLevelCosts(VP8Proba* const proba) {
for(ctx = 0; ctx < NUM_CTX; ++ctx) {
const uint8_t* const p = proba->coeffs_[ctype][band][ctx];
uint16_t* const table = proba->level_cost_[ctype][band][ctx];
const int cost_base = VP8BitCost(0, p[0]) + VP8BitCost(1, p[1]);
const int cost_base = VP8BitCost(1, p[1]);
int v;
table[0] = VP8BitCost(0, p[1]);
for (v = 1; v <= MAX_VARIABLE_LEVEL; ++v) {