mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-14 21:09:55 +02:00
lossy encoding: ~3% speed-up
incorporate non-last cost in per-level cost table also: correct trellis-quant cost evaluation at nodes (output a little bit different now). Method 6 is ~4% faster. Change-Id: Ic48bd6d33f9193838216e7dc3a9f9c5508a1fbe8
This commit is contained in:
@ -360,9 +360,10 @@ 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 cost0 = (ctx > 0) ? VP8BitCost(1, p[0]) : 0;
|
||||
const int cost_base = VP8BitCost(1, p[1]) + cost0;
|
||||
int v;
|
||||
table[0] = VP8BitCost(0, p[1]);
|
||||
table[0] = VP8BitCost(0, p[1]) + cost0;
|
||||
for (v = 1; v <= MAX_VARIABLE_LEVEL; ++v) {
|
||||
table[v] = cost_base + VariableLevelCost(v, p);
|
||||
}
|
||||
|
Reference in New Issue
Block a user