Refactor code for HistogramCombine.

Refactor code for HistogramCombine and optimize the code by calculating
the combined entropy and avoid un-necessary Histogram merges.

This speeds up lossless encoding by 1-2% and almost no impact on compression
density.

Change-Id: Iedfcf4c1f3e88077bc77fc7b8c780c4cd5d6362b
This commit is contained in:
Vikas Arora
2014-03-03 13:49:54 -08:00
parent ca1bfff53f
commit b33e8a05ee
4 changed files with 157 additions and 102 deletions

View File

@ -436,7 +436,8 @@ static int CostModelBuild(CostModel* const m, int xsize, int ysize,
}
VP8LHistogramCreate(&histo, &refs, cache_bits);
ConvertPopulationCountTableToBitEstimates(
VP8LHistogramNumCodes(&histo), histo.literal_, m->literal_);
VP8LHistogramNumCodes(histo.palette_code_bits_),
histo.literal_, m->literal_);
ConvertPopulationCountTableToBitEstimates(
VALUES_IN_BYTE, histo.red_, m->red_);
ConvertPopulationCountTableToBitEstimates(