Optimize cache estimate logic.

Optimize 'VP8LCalculateEstimateForCacheSize' for lower quality ranges (Q < 50).
The entropy is generally lower for higher cache_bits, so start searching from
higher cache_bits and settle for a local minima, instead of evaluating all
values.

This speeds up the lossless encoding at lower qualities by 10-15%.

Change-Id: I33c1e958515a2549f2e6f64b1aab3f128660dcec
This commit is contained in:
Vikas Arora
2014-02-11 10:38:47 -08:00
parent 7fb6095b03
commit a7d2ee39be
3 changed files with 31 additions and 23 deletions

View File

@ -142,7 +142,7 @@ int VP8LGetBackwardReferences(int width, int height,
// Produce an estimate for a good color cache size for the image.
int VP8LCalculateEstimateForCacheSize(const uint32_t* const argb,
int xsize, int ysize,
int xsize, int ysize, int quality,
int* const best_cache_bits);
#ifdef __cplusplus