1 /* HuffEnc.h -- Huffman encoding 2 2023-03-05 : Igor Pavlov : Public domain */ 3 4 #ifndef ZIP7_INC_HUFF_ENC_H 5 #define ZIP7_INC_HUFF_ENC_H 6 7 #include "7zTypes.h" 8 9 EXTERN_C_BEGIN 10 11 /* 12 Conditions: 13 num <= 1024 = 2 ^ NUM_BITS 14 Sum(freqs) < 4M = 2 ^ (32 - NUM_BITS) 15 maxLen <= 16 = kMaxLen 16 Num_Items(p) >= HUFFMAN_TEMP_SIZE(num) 17 */ 18 19 void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, UInt32 num, UInt32 maxLen); 20 21 EXTERN_C_END 22 23 #endif 24