summaryrefslogtreecommitdiff
path: root/deflate.h
diff options
context:
space:
mode:
authorHans Kristian Rosbach <hk-git@circlestorm.org>2020-08-21 16:17:55 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-08-23 09:57:45 +0200
commitcbc3962b937315ccfb0108a6a96ee005328f467c (patch)
treebdd963f2a79d509a0f80ffa42e29807857de0de5 /deflate.h
parente7bb6db09a183807a8f94a8bdcf156a765402d9f (diff)
Increase hash table size from 15 to 16 bits.
This gives a good performance increase, and usually also improves compression. Make separate define HASH_SLIDE for fallback version of UPDATE_HASH.
Diffstat (limited to 'deflate.h')
-rw-r--r--deflate.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/deflate.h b/deflate.h
index f9db02b..ef84bde 100644
--- a/deflate.h
+++ b/deflate.h
@@ -68,9 +68,9 @@
#define FINISH_STATE 666 /* stream complete */
/* Stream status */
-#define HASH_BITS 15 /* log2(HASH_SIZE) */
-#define HASH_SIZE 32768 /* number of elements in hash table */
-#define HASH_MASK 0x7FFF /* HASH_SIZE-1 */
+#define HASH_BITS 16u /* log2(HASH_SIZE) */
+#define HASH_SIZE 65536u /* number of elements in hash table */
+#define HASH_MASK (HASH_SIZE - 1u) /* HASH_SIZE-1 */
/* Data structure describing a single value and its code string. */