mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 22:09:57 +02:00
Move the HuffmanCost() function to dsp lib
This is to help further optimizations. (like in https://gerrit.chromium.org/gerrit/#/c/69787/) There's a small slowdown (~0.5% at -z 9 quality) due to function pointer usage. Note that, for speed, it's important to return VP8LStreaks by value, and not pass a pointer. Change-Id: Id4167366765fb7fc5dff89c1fd75dee456737000
This commit is contained in:
@ -90,13 +90,6 @@ static WEBP_INLINE int VP8LHistogramNumCodes(int palette_code_bits) {
|
||||
((palette_code_bits > 0) ? (1 << palette_code_bits) : 0);
|
||||
}
|
||||
|
||||
// Used to finalized the Huffman cost:
|
||||
// cnt_z / cnt_nz: counts the number of 0's and non-0's
|
||||
// streak_{z,nz}_le3 / streak_{z,nz}_gt3: number of streaks larger than 3
|
||||
// or less-or-equal than 3.
|
||||
double VP8FinalHuffmanCost(int cnt_z, int streak_z_le3, int streak_z_gt3,
|
||||
int cnt_nz, int streak_nz_le3, int streak_nz_gt3);
|
||||
|
||||
// Builds the histogram image.
|
||||
int VP8LGetHistoImageSymbols(int xsize, int ysize,
|
||||
const VP8LBackwardRefs* const refs,
|
||||
|
Reference in New Issue
Block a user