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 inflate_table(codetype type, unsigned short FAR *lens, unsigned codes, in inflate_table() argument
42 int left; /* number of prefix codes available */ in inflate_table()
54 unsigned short count[MAXBITS+1]; /* number of codes of each length */ in inflate_table()
56 static const unsigned short lbase[31] = { /* Length codes 257..285 base */ in inflate_table()
59 static const unsigned short lext[31] = { /* Length codes 257..285 extra */ in inflate_table()
62 static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ in inflate_table()
66 static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ in inflate_table()
73 code lengths are lens[0..codes-1]. Each length corresponds to the in inflate_table()
74 symbols 0..codes-1. The Huffman code is generated by first sorting the in inflate_table()
76 for codes with equal lengths. Then the code starts with all zero bits in inflate_table()
77 for the first code of the shortest length, and the codes are integer in inflate_table()
81 decoding tables are built in the large loop below, the integer codes in inflate_table()
89 The codes are sorted by computing a count of codes for each length, in inflate_table()
96 the minimum and maximum length codes, determining if there are any in inflate_table()
97 codes at all, checking for a valid set of lengths, and looking ahead in inflate_table()
102 /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ in inflate_table()
105 for (sym = 0; sym < codes; sym++) in inflate_table()
133 if (left > 0 && (type == CODES || max != 1)) in inflate_table()
142 for (sym = 0; sym < codes; sym++) in inflate_table()
149 bits off of the bottom. For codes where len is less than drop + curr, in inflate_table()
161 counts are used for this, and so count[] is decremented as codes are in inflate_table()
172 all codes of length max, i.e. all codes, have been processed. This in inflate_table()
173 routine permits incomplete codes, so another loop after this one fills in inflate_table()
179 case CODES: in inflate_table()
211 /* process all codes and make table entries */ in inflate_table()
288 Fill in rest of table for incomplete codes. This loop is similar to the in inflate_table()