further speed-up/cleanup of RecordCoeffs() and GetResidualCost()

(note: Incorporated the cost of bin #1 into the LevelCost[])

Change-Id: I6408b2a822efdb97ad6a3a21d380bc7b0da9c715
This commit is contained in:
Pascal Massimino
2012-01-23 06:02:01 -08:00
parent fd22104022
commit 7107d54483
2 changed files with 17 additions and 20 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(1, p[1]);
const int cost_base = VP8BitCost(0, p[0]) + VP8BitCost(1, p[1]);
int v;
table[0] = VP8BitCost(0, p[1]);
for (v = 1; v <= MAX_VARIABLE_LEVEL; ++v) {