• Home
  • Raw
  • Download

Lines Matching full:codes

23    matches (of at least length 3), it codes the next byte.  Otherwise, it
24 codes the length of the matched string and its distance backwards from
25 the current position. There is a single Huffman code that codes both
27 code codes the distance information, which follows a length code. Each
46 an encoding of the literal/length and distance Huffman codes that are
50 a predefined set of codes, called the fixed codes. The fixed method is
51 used if the block codes up smaller that way (usually for quite small
53 codes are customized to the probabilities in the current block, and so
54 can code it much better than the pre-determined fixed codes.
56 The Huffman codes themselves are decoded using a multi-level table
72 codes exist, they are coded using one bit each (0 and 1).
73 5. There is no way of sending zero distance codes--a dummy must be
75 store blocks with no distance codes, but this was discovered to be
77 zero distance codes, which is sent as one code of zero bits in
79 6. There are up to 286 literal/length codes. Code 256 represents the
81 288 codes just to fill out the Huffman codes. Codes 286 and 287
83 defined for them. Similarly, there are up to 30 distance codes.
84 However, static trees define 32 codes (all 5 bits) to fill out the
85 Huffman codes, but the last two had better not show up in the data.
89 literal codes sent minus 257.
90 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
92 three codes (1+1+1), whereas to output four times the same length,
93 you only need two codes (1+3). Hmm.
96 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
117 the next table, which codes e - 16 bits, and lastly e == 99 indicates
157 static const ush cplens[] = { /* Copy lengths for literal codes 257..285 */
163 static const ush cplext[] = { /* Extra bits for literal codes 257..285 */
168 static const ush cpdist[] = { /* Copy offsets for distance codes 0..29 */
174 static const ush cpdext[] = { /* Extra bits for distance codes */
200 is 7 bits, but the other literal/length codes can be 8 or 9 bits.
201 (The EOB code is shorter than other codes because fixed blocks are
203 literal/length codes have a significantly lower probability of
228 is not very long. The most common codes are necessarily the
229 shortest codes, so those codes dominate the decoding time, and hence
231 shorter, more probable codes, and then point to subsidiary tables for
232 the longer codes. The time it costs to decode the longer codes is
237 length codes can decode in one step, and dbits is the same thing for
238 the distance codes. Subsequent tables are also less than or equal to
240 codes are shorter than that, in which case the longest code length in
247 codes 286 possible values, or in a flat code, a little over eight
248 bits. The distance table codes 30 possible values, or a little less
260 #define N_MAX 288 /* maximum number of codes in any set */
266 unsigned n; /* number of codes (assumed <= N_MAX) */
267 unsigned s; /* number of simple-valued codes (0..s-1) */
268 const ush *d; /* list of base values for non-simple codes */
269 const ush *e; /* list of extra bits for non-simple codes */
273 tables to decode that set of codes. Return zero on success, one if
275 case), two if the input is invalid (all zero length codes or an
278 unsigned a; /* counter for codes of length k */
295 int y; /* number of dummy codes added */
312 if (c[0] == n) { /* null input--all zero length codes */
338 /* Adjust last length count to fill out codes, if needed */
341 return 2; /* bad input: more codes than bits */
368 /* Generate the Huffman codes and for each, make the table entries */
393 …if ((f = 1 << (j = k - w)) > a + 1) { /* try a k-w bit table *//* too few codes for k-w bit table …
395 f -= a + 1; /* deduct codes from patterns left */
399 break; /* enough codes to use up j bits */
400 f -= *xp; /* else deduct codes from patterns */
495 /* inflate (decompress) the codes in a deflated (compressed) block.
641 /* decompress an inflated type 1 (fixed Huffman codes) block. We should in inflate_fixed()
689 /* decompress an inflated type 2 (dynamic Huffman codes) block. */ in inflate_dynamic()
700 unsigned nb; /* number of bit length codes */ in inflate_dynamic()
701 unsigned nl; /* number of literal/length codes */ in inflate_dynamic()
702 unsigned nd; /* number of distance codes */ in inflate_dynamic()
719 nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ in inflate_dynamic()
722 nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ in inflate_dynamic()
725 nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ in inflate_dynamic()
776 } else if (j == 17) { /* 3 to 10 zero length codes */ in inflate_dynamic()
785 } else { /* j == 18: 11 to 138 zero length codes */ in inflate_dynamic()
811 /* build the decoding tables for literal/length and distance codes */ in inflate_dynamic()