diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-10 14:58:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-10 14:58:13 +0100 |
commit | fa024537a39c24bf9fb2e24063acee0daf63dfc1 (patch) | |
tree | 759ef4154a16f572b0782516d641fbb993ff9400 /thirdparty/libwebp/src/enc/histogram_enc.h | |
parent | ca06e656bec5129cc0fc45f83b310976adb752e3 (diff) | |
parent | d4133ac8440321f2ae2e26fb317871bd847b35eb (diff) |
Merge pull request #24258 from volzhs/libwebp-1.0.1
Update libwebp to 1.0.1
Diffstat (limited to 'thirdparty/libwebp/src/enc/histogram_enc.h')
-rw-r--r-- | thirdparty/libwebp/src/enc/histogram_enc.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/thirdparty/libwebp/src/enc/histogram_enc.h b/thirdparty/libwebp/src/enc/histogram_enc.h index e8c4c83f6f..54c2d21783 100644 --- a/thirdparty/libwebp/src/enc/histogram_enc.h +++ b/thirdparty/libwebp/src/enc/histogram_enc.h @@ -44,6 +44,7 @@ typedef struct { double literal_cost_; // Cached values of dominant entropy costs: double red_cost_; // literal, red & blue. double blue_cost_; + uint8_t is_used_[5]; // 5 for literal, red, blue, alpha, distance } VP8LHistogram; // Collection of histograms with fixed capacity, allocated as one @@ -67,7 +68,9 @@ void VP8LHistogramCreate(VP8LHistogram* const p, int VP8LGetHistogramSize(int palette_code_bits); // Set the palette_code_bits and reset the stats. -void VP8LHistogramInit(VP8LHistogram* const p, int palette_code_bits); +// If init_arrays is true, the arrays are also filled with 0's. +void VP8LHistogramInit(VP8LHistogram* const p, int palette_code_bits, + int init_arrays); // Collect all the references into a histogram (without reset) void VP8LHistogramStoreRefs(const VP8LBackwardRefs* const refs, @@ -83,6 +86,9 @@ void VP8LFreeHistogramSet(VP8LHistogramSet* const histo); // using 'cache_bits'. Return NULL in case of memory error. VP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits); +// Set the histograms in set to 0. +void VP8LHistogramSetClear(VP8LHistogramSet* const set); + // Allocate and initialize histogram object with specified 'cache_bits'. // Returns NULL in case of memory error. // Special case of VP8LAllocateHistogramSet, with size equals 1. @@ -113,7 +119,7 @@ double VP8LBitsEntropy(const uint32_t* const array, int n); // Estimate how many bits the combined entropy of literals and distance // approximately maps to. -double VP8LHistogramEstimateBits(const VP8LHistogram* const p); +double VP8LHistogramEstimateBits(VP8LHistogram* const p); #ifdef __cplusplus } |