Lines Matching full:codes
22 The code lengths are lens[0..codes-1]. The result starts at *table,
25 to be generated, CODES, LENS, or DISTS. On return, zero is success,
32 int Z_INTERNAL zng_inflate_table(codetype type, uint16_t *lens, unsigned codes, in zng_inflate_table() argument
40 int left; /* number of prefix codes available */ in zng_inflate_table()
52 uint16_t count[MAXBITS+1]; /* number of codes of each length */ in zng_inflate_table()
54 static const uint16_t lbase[31] = { /* Length codes 257..285 base */ in zng_inflate_table()
57 static const uint16_t lext[31] = { /* Length codes 257..285 extra */ in zng_inflate_table()
60 static const uint16_t dbase[32] = { /* Distance codes 0..29 base */ in zng_inflate_table()
64 static const uint16_t dext[32] = { /* Distance codes 0..29 extra */ in zng_inflate_table()
71 code lengths are lens[0..codes-1]. Each length corresponds to the in zng_inflate_table()
72 symbols 0..codes-1. The Huffman code is generated by first sorting the in zng_inflate_table()
74 for codes with equal lengths. Then the code starts with all zero bits in zng_inflate_table()
75 for the first code of the shortest length, and the codes are integer in zng_inflate_table()
79 decoding tables are built in the large loop below, the integer codes in zng_inflate_table()
87 The codes are sorted by computing a count of codes for each length, in zng_inflate_table()
94 the minimum and maximum length codes, determining if there are any in zng_inflate_table()
95 codes at all, checking for a valid set of lengths, and looking ahead in zng_inflate_table()
100 /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ in zng_inflate_table()
103 for (sym = 0; sym < codes; sym++) in zng_inflate_table()
131 if (left > 0 && (type == CODES || max != 1)) in zng_inflate_table()
140 for (sym = 0; sym < codes; sym++) in zng_inflate_table()
147 bits off of the bottom. For codes where len is less than drop + curr, in zng_inflate_table()
159 counts are used for this, and so count[] is decremented as codes are in zng_inflate_table()
169 all codes of length max, i.e. all codes, have been processed. This in zng_inflate_table()
170 routine permits incomplete codes, so another loop after this one fills in zng_inflate_table()
176 case CODES: in zng_inflate_table()
207 /* process all codes and make table entries */ in zng_inflate_table()