]> wimlib.net Git - wimlib/blobdiff - src/compress.h
Use only 16 bits for symbol frequencies
[wimlib] / src / compress.h
index 37ab23d315763b471ca7c442cf4ac39ba05bf1e6..88c55f26b3fa9a2afad9b74e6ff2f40b9d5eaff6 100644 (file)
 
 typedef u16 output_bitbuf_t;
 
+/* Assuming that WIM chunks are at most 32768 bytes, 16 bits is enough for any
+ * symbol frequency. */
+typedef u16 freq_t;
+
 /* Structure to keep track of the current position in the compressed output. */
 struct output_bitstream {
 
@@ -88,7 +92,7 @@ extern int flush_output_bitstream(struct output_bitstream *ostream);
 
 extern void make_canonical_huffman_code(unsigned num_syms,
                                        unsigned max_codeword_len,
-                                       const u32 freq_tab[],
+                                       const freq_t freq_tab[],
                                        u8 lens[],
                                        u16 codewords[]);