Lines Matching refs:code

21    Build a set of tables to decode the provided canonical Huffman code.
22 The code lengths are lens[0..codes-1]. The result starts at *table,
24 lens shorts, which is used as a work area. type is the type of code
26 -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
30 longest code or if it is less than the shortest code.
36 code FAR * FAR *table;
40 unsigned len; /* a code's length in bits */
41 unsigned sym; /* index of code symbols */
42 unsigned min, max; /* minimum and maximum code lengths */
45 unsigned drop; /* code bits to drop for sub-table */
47 unsigned used; /* code entries in table used */
48 unsigned huff; /* Huffman code */
49 unsigned incr; /* for incrementing code, index */
53 code here; /* table entry for duplication */
54 code FAR *next; /* next available space in table */
76 Process a set of code lengths to create a canonical Huffman code. The
77 code lengths are lens[0..codes-1]. Each length corresponds to the
78 symbols 0..codes-1. The Huffman code is generated by first sorting the
80 for codes with equal lengths. Then the code starts with all zero bits
81 for the first code of the shortest length, and the codes are integer
90 1..MAXBITS is interpreted as that code length. zero means that that
91 symbol does not occur in this code.
112 /* bound code lengths, force root to be within code lengths */
117 if (max == 0) { /* no symbols to code at all */
118 here.op = (unsigned char)64; /* invalid code marker */
151 filled is at next and has curr index bits. The code being used is huff
152 with length len. That code is converted to an index by dropping drop
164 code lengths to determine what size sub-table is needed. The length
177 in the rest of the decoding tables with invalid code markers.
180 /* set up for code type */
200 huff = 0; /* starting code */
201 sym = 0; /* starting code symbol */
202 len = min; /* starting code length */
205 drop = 0; /* current bits to drop from code for index */
241 /* backwards increment the len-bit code huff */
292 /* fill in remaining table entry if code is incomplete (guaranteed to have
293 at most one remaining entry, since if the code is incomplete, the
294 maximum code length that was allowed to get this far is one bit) */
296 here.op = (unsigned char)64; /* invalid code marker */