mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-17 22:39:52 +02:00
Speed-up: Make sure we only initialize histograms when needed.
Also, histograms in a HistogramSet can be initialized all at once. Change-Id: Ibbfa6034dce58dca8bb9113487e2ae507222ce7d
This commit is contained in:
@ -715,6 +715,7 @@ static int CalculateBestCacheSize(const uint32_t* argb, int quality,
|
||||
for (i = 0; i <= cache_bits_max; ++i) {
|
||||
histos[i] = VP8LAllocateHistogram(i);
|
||||
if (histos[i] == NULL) goto Error;
|
||||
VP8LHistogramInit(histos[i], i, /*init_arrays=*/ 1);
|
||||
if (i == 0) continue;
|
||||
cc_init[i] = VP8LColorCacheInit(&hashers[i], i);
|
||||
if (!cc_init[i]) goto Error;
|
||||
|
Reference in New Issue
Block a user