Merge "split 64-mult hashing into two 32-bit multiplies"

This commit is contained in:
Pascal Massimino 2015-04-15 23:04:47 -07:00 committed by Gerrit Code Review
commit 7073bfb3ee

View File

@ -21,8 +21,6 @@
#define VALUES_IN_BYTE 256
#define HASH_MULTIPLIER (0xc6a4a7935bd1e995ULL)
#define MIN_BLOCK_SIZE 256 // minimum block size for backward references
#define MAX_ENTROPY (1e30f)
@ -215,9 +213,14 @@ void VP8LHashChainClear(VP8LHashChain* const p) {
// -----------------------------------------------------------------------------
#define HASH_MULTIPLIER_HI (0xc6a4a793U)
#define HASH_MULTIPLIER_LO (0x5bd1e996U)
static WEBP_INLINE uint64_t GetPixPairHash64(const uint32_t* const argb) {
uint64_t key = ((uint64_t)argb[1] << 32) | argb[0];
key = (key * HASH_MULTIPLIER) >> (64 - HASH_BITS);
uint32_t key;
key = argb[1] * HASH_MULTIPLIER_HI;
key += argb[0] * HASH_MULTIPLIER_LO;
key = key >> (32 - HASH_BITS);
return key;
}