mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-17 14:29:48 +02:00
Switch ExtraCost to ints and implement it in SSE.
The histograms count the occurrences of len/dist in entropy images. Those (at most (1<<14) by (1<<14)) are sub-sampled by at least MIN_HUFFMAN_BITS == 2, hence at most 24 bits in a histogram value. At most, we multiply by 19 (because the longest histogram is of size 40 and we do 40>>1, cf code) for the bit cost. So it all fits in 32 bits. Change-Id: Ife24b035f54794851ff31f2fac07901f724c6d7f
This commit is contained in:
@ -182,9 +182,9 @@ extern VP8LPredictorAddSubFunc VP8LPredictorsSub_C[16];
|
||||
// -----------------------------------------------------------------------------
|
||||
// Huffman-cost related functions.
|
||||
|
||||
typedef float (*VP8LCostFunc)(const uint32_t* population, int length);
|
||||
typedef float (*VP8LCostCombinedFunc)(const uint32_t* X, const uint32_t* Y,
|
||||
int length);
|
||||
typedef uint32_t (*VP8LCostFunc)(const uint32_t* population, int length);
|
||||
typedef uint32_t (*VP8LCostCombinedFunc)(const uint32_t* X, const uint32_t* Y,
|
||||
int length);
|
||||
typedef float (*VP8LCombinedShannonEntropyFunc)(const int X[256],
|
||||
const int Y[256]);
|
||||
|
||||
|
Reference in New Issue
Block a user