mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
Merge "rationalize use of color-cache" into 0.2.0
This commit is contained in:
@ -21,11 +21,9 @@ extern "C" {
|
||||
// VP8LColorCache.
|
||||
|
||||
int VP8LColorCacheInit(VP8LColorCache* const cc, int hash_bits) {
|
||||
int hash_size;
|
||||
const int hash_size = 1 << hash_bits;
|
||||
assert(cc != NULL);
|
||||
|
||||
if (hash_bits == 0) hash_bits = 1;
|
||||
hash_size = 1 << hash_bits;
|
||||
assert(hash_bits > 0);
|
||||
cc->colors_ = (uint32_t*)calloc(hash_size, sizeof(*cc->colors_));
|
||||
if (cc->colors_ == NULL) return 0;
|
||||
cc->hash_shift_ = 32 - hash_bits;
|
||||
|
Reference in New Issue
Block a user