Reduce kMaxAddr from 8 * 2^16 to 6 * 2^16 Reduce the number of hash table buckets in p_hash_table->p_lookup_table from 8 * 2^16 to 6 * 2^16. On 64-bit platforms (where pointers are 8 bytes), this saves 8 * 2 * 2^16 = 1 MB of memory. Change-Id: I08242b137cc1eeea470b10eb2b956be4a06d0a8d
diff --git a/av1/encoder/hash_motion.c b/av1/encoder/hash_motion.c index 3dfd0cf..c1b5ea6 100644 --- a/av1/encoder/hash_motion.c +++ b/av1/encoder/hash_motion.c
@@ -19,8 +19,12 @@ #include "av1/encoder/hash_motion.h" #define kSrcBits 16 -#define kBlockSizeBits 3 -#define kMaxAddr (1 << (kSrcBits + kBlockSizeBits)) +// kMaxAddr is the number of hash table buckets in p_hash_table->p_lookup_table. +// p_hash_table->p_lookup_table consists of 6 hash tables of 1 << kSrcBits +// buckets each. Each of the 6 supported block sizes (4, 8, 16, 32, 64, 128) has +// its own hash table, indexed by the return value of +// hash_block_size_to_index(). +#define kMaxAddr (6 << kSrcBits) #define kMaxCandidatesPerHashBucket 256 static void get_pixels_in_1D_char_array_by_block_2x2(const uint8_t *y_src,