-/*
- * Builds a fast huffman decoding table from a canonical huffman code lengths
- * table. Based on code written by David Tritscher.
- *
- * @decode_table: The array in which to create the fast huffman decoding
- * table. It must have a length of at least
- * (2**num_bits) + 2 * num_syms to guarantee
- * that there is enough space.
- *
- * @num_syms: Total number of symbols in the Huffman tree.
- *
- * @num_bits: Any symbols with a code length of num_bits or less can be
- * decoded in one lookup of the table. 2**num_bits
- * must be greater than or equal to @num_syms if there are
- * any Huffman codes longer than @num_bits.
- *
- * @lens: An array of length @num_syms, indexable by symbol, that
- * gives the length of that symbol. Because the Huffman
- * tree is in canonical form, it can be reconstructed by
- * only knowing the length of the code for each symbol.
- *
- * @make_codeword_len: An integer that gives the longest possible codeword
- * length.
- *
- * Returns 0 on success; returns 1 if the length values do not correspond to a
- * valid Huffman tree, or if there are codes of length greater than @num_bits
- * but 2**num_bits < num_syms.
- *
- * What exactly is the format of the fast Huffman decoding table? The first
- * (1 << num_bits) entries of the table are indexed by chunks of the input of
- * size @num_bits. If the next Huffman code in the input happens to have a
- * length of exactly @num_bits, the symbol is simply read directly from the
- * decoding table. Alternatively, if the next Huffman code has length _less
- * than_ @num_bits, the symbol is also read directly from the decode table; this
- * is possible because every entry in the table that is indexed by an integer
- * that has the shorter code as a binary prefix is filled in with the
- * appropriate symbol. If a code has length n <= num_bits, it will have
- * 2**(num_bits - n) possible suffixes, and thus that many entries in the
- * decoding table.
- *
- * It's a bit more complicated if the next Huffman code has length of more than
- * @num_bits. The table entry indexed by the first @num_bits of that code
- * cannot give the appropriate symbol directly, because that entry is guaranteed
- * to be referenced by the Huffman codes for multiple symbols. And while the
- * LZX compression format does not allow codes longer than 16 bits, a table of
- * size (2 ** 16) = 65536 entries would be too slow to create.
- *
- * There are several different ways to make it possible to look up the symbols
- * for codes longer than @num_bits. A common way is to make the entries for the
- * prefixes of length @num_bits of those entries be pointers to additional
- * decoding tables that are indexed by some number of additional bits of the
- * code symbol. The technique used here is a bit simpler, however. We just
- * store the needed subtrees of the Huffman tree in the decoding table after the
- * lookup entries, beginning at index (2**num_bits). Real pointers are
- * replaced by indices into the decoding table, and we distinguish symbol
- * entries from pointers by the fact that values less than @num_syms must be
- * symbol values.
- */
-int make_huffman_decode_table(u16 decode_table[], unsigned num_syms,
- unsigned num_bits, const u8 lens[],
- unsigned max_code_len)