aboutsummaryrefslogtreecommitdiff
path: root/src/zopfli/hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zopfli/hash.h')
-rw-r--r--src/zopfli/hash.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/zopfli/hash.h b/src/zopfli/hash.h
index 79c2479..e59c1d4 100644
--- a/src/zopfli/hash.h
+++ b/src/zopfli/hash.h
@@ -27,16 +27,16 @@ The hash for ZopfliFindLongestMatch of lz77.c.
#include "util.h"
typedef struct ZopfliHash {
- int* head; /* Hash value to index of its most recent occurance. */
- unsigned short* prev; /* Index to index of prev. occurance of same hash. */
+ int* head; /* Hash value to index of its most recent occurrence. */
+ unsigned short* prev; /* Index to index of prev. occurrence of same hash. */
int* hashval; /* Index to hash value at this index. */
int val; /* Current hash value. */
#ifdef ZOPFLI_HASH_SAME_HASH
/* Fields with similar purpose as the above hash, but for the second hash with
a value that is calculated differently. */
- int* head2; /* Hash value to index of its most recent occurance. */
- unsigned short* prev2; /* Index to index of prev. occurance of same hash. */
+ int* head2; /* Hash value to index of its most recent occurrence. */
+ unsigned short* prev2; /* Index to index of prev. occurrence of same hash. */
int* hashval2; /* Index to hash value at this index. */
int val2; /* Current hash value. */
#endif
@@ -46,10 +46,13 @@ typedef struct ZopfliHash {
#endif
} ZopfliHash;
-/* Allocates and initializes all fields of ZopfliHash. */
-void ZopfliInitHash(size_t window_size, ZopfliHash* h);
+/* Allocates ZopfliHash memory. */
+void ZopfliAllocHash(size_t window_size, ZopfliHash* h);
-/* Frees all fields of ZopfliHash. */
+/* Resets all fields of ZopfliHash. */
+void ZopfliResetHash(size_t window_size, ZopfliHash* h);
+
+/* Frees ZopfliHash memory. */
void ZopfliCleanHash(ZopfliHash* h);
/*