Optimize and re-structure VP8LGetHistoImageSymbols

Optimize and re-structured VP8LGetHistoImageSymbols method, by using the bin-hash
for merging the Histograms more efficiently, instead of the randomized
heuristic of existing method HistogramCombine.

This change speeds up the Lossless encoding by 40-50% (for method=4 and Q > 50)
with 0.8% penalty in compression density. For lower method, the speed up is 25-30%,
with 0.4% penalty in the compression density.

Change-Id: If61adadb1a041b95def6405aa1fe3b83c3cb25ce
This commit is contained in:
Vikas Arora
2014-03-13 11:34:12 -07:00
parent 068b14ac57
commit fef22704ec
2 changed files with 287 additions and 78 deletions

View File

@ -40,6 +40,9 @@ typedef struct {
int distance_[NUM_DISTANCE_CODES];
int palette_code_bits_;
double bit_cost_; // cached value of VP8LHistogramEstimateBits(this)
double literal_cost_; // Cached values of dominant entropy costs:
double red_cost_; // literal, red & blue.
double blue_cost_;
} VP8LHistogram;
// Collection of histograms with fixed capacity, allocated as one