Use the plane code and not the distance when computing statistics.

As backward references use the plane code when checking the cost
of a distance, statistics used to compute the cost should use it too.
This provides a small compression improvement at no speed cost.

Change-Id: Icade150929ee39ef6dc0d8b1fc85973086ecf41d
This commit is contained in:
Vincent Rabaud
2017-06-01 17:08:43 +02:00
parent b903b80c30
commit f209a5481e
3 changed files with 26 additions and 8 deletions

View File

@ -90,7 +90,9 @@ VP8LHistogram* VP8LAllocateHistogram(int cache_bits);
// Accumulate a token 'v' into a histogram.
void VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo,
const PixOrCopy* const v);
const PixOrCopy* const v,
int (*const distance_modifier)(int, int),
int distance_modifier_arg0);
static WEBP_INLINE int VP8LHistogramNumCodes(int palette_code_bits) {
return NUM_LITERAL_CODES + NUM_LENGTH_CODES +