mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
Compare commits
2 Commits
cea684626d
...
7bcb36b884
Author | SHA1 | Date | |
---|---|---|---|
|
7bcb36b884 | ||
|
8e0cc14c3e |
@ -287,7 +287,7 @@ static uint64_t FinalHuffmanCost(const VP8LStreaks* const stats) {
|
|||||||
uint64_t retval = InitialHuffmanCost();
|
uint64_t retval = InitialHuffmanCost();
|
||||||
// Second coefficient: Many zeros in the histogram are covered efficiently
|
// Second coefficient: Many zeros in the histogram are covered efficiently
|
||||||
// by a run-length encode. Originally 2/8.
|
// by a run-length encode. Originally 2/8.
|
||||||
uint64_t retval_extra = stats->counts[0] * 1600 + 240 * stats->streaks[0][1];
|
uint32_t retval_extra = stats->counts[0] * 1600 + 240 * stats->streaks[0][1];
|
||||||
// Second coefficient: Constant values are encoded less efficiently, but still
|
// Second coefficient: Constant values are encoded less efficiently, but still
|
||||||
// RLE'ed. Originally 6/8.
|
// RLE'ed. Originally 6/8.
|
||||||
retval_extra += stats->counts[1] * 2640 + 720 * stats->streaks[1][1];
|
retval_extra += stats->counts[1] * 2640 + 720 * stats->streaks[1][1];
|
||||||
@ -296,7 +296,7 @@ static uint64_t FinalHuffmanCost(const VP8LStreaks* const stats) {
|
|||||||
retval_extra += 1840 * stats->streaks[0][0];
|
retval_extra += 1840 * stats->streaks[0][0];
|
||||||
// Originally 26/8.
|
// Originally 26/8.
|
||||||
retval_extra += 3360 * stats->streaks[1][0];
|
retval_extra += 3360 * stats->streaks[1][0];
|
||||||
return retval + (retval_extra << (LOG_2_PRECISION_BITS - 10));
|
return retval + ((uint64_t)retval_extra << (LOG_2_PRECISION_BITS - 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the symbol entropy for the distribution 'population'.
|
// Get the symbol entropy for the distribution 'population'.
|
||||||
|
Loading…
Reference in New Issue
Block a user