/* For each bit pattern b of peek_bits bits, prefix_len[b] is the length
* of the Huffman code starting with a prefix of b (upper bits), or 0
* if all codes of prefix b have more than peek_bits bits. It is not
/* For each bit pattern b of peek_bits bits, prefix_len[b] is the length
* of the Huffman code starting with a prefix of b (upper bits), or 0
* if all codes of prefix b have more than peek_bits bits. It is not
* codes encountered in the input stream are short codes (by construction).
* So for most codes a single lookup will be necessary.
*/
* codes encountered in the input stream are short codes (by construction).
* So for most codes a single lookup will be necessary.
*/
do {
len++, mask = (mask<<1)+1;
look_bits(peek, len, mask);
do {
len++, mask = (mask<<1)+1;
look_bits(peek, len, mask);
/* loop as long as peek is a parent node */
}
/* At this point, peek is the next complete code, of len bits */
/* loop as long as peek is a parent node */
}
/* At this point, peek is the next complete code, of len bits */