Home | History | Annotate | Download | only in puff

Lines Matching full:distance

63  * 1.8   9 Jan 2004     - Added some comments on no distance codes case
66 * 2.0 25 Jul 2008 - Add #define to permit distance too far back
93 #define MAXDCODES 30 /* maximum number of distance codes */
382 * Decode literal/length and distance codes until an end-of-block code.
387 * description if dynamic is a combination of literals and length/distance
389 * coded bytes. A length/distance pair is a coded length followed by a
390 * coded distance to represent a string that occurs earlier in the
411 * followed a distance code. There are up to 30 distance symbols. Again
418 * - Literal bytes are simply written to the output. A length/distance pair is
420 * copy is from distance bytes back in the output stream, copying for length
426 * - Overlapped copies, where the length is greater than the distance, are
427 * allowed and common. For example, a distance of one and a length of 258
428 * simply copies the last byte 258 times. A distance of four and a length of
430 * ignoring whether the length is greater than the distance or not implements
442 unsigned dist; /* distance for copy */
449 static const short dists[30] = { /* Offset base for distance codes 0..29 */
453 static const short dext[30] = { /* Extra bits for distance codes 0..29 */
458 /* decode literals and length/distance pairs */
479 /* get and check distance */
486 return -11; /* distance too far back */
489 /* copy length bytes from distance bytes back */
521 * codes and distance codes are fixed. The specific lengths for each symbol
531 * - The fixed distance codes also have two invalid symbols that should result
532 * in an error if received. Since all of the distance codes are the same
565 /* distance table */
584 * distance codes for that block. New dynamic blocks allow the compressor to
594 * distance symbols.
608 * only a single distance base symbol appears in a block, then it will be
611 * and should result in an error. So incomplete distance codes of one symbol
620 * - If there are only literal codes and no lengths, then there are no distance
621 * codes. This is represented by one distance code with zero bits.
623 * - The list of up to 286 length/literal lengths and up to 30 distance lengths
637 * the number of literal/length code lengths, the number of distance code
640 * distance codes, lengths after those provided are considered zero, i.e. no
647 * - Given the number of literal/length code lengths (nlen) and distance code
654 * the distance codes, and the code length codes. This is followed by the
657 * the literal/length code lengths and distance lengths are read as a single
673 struct huffman lencode, distcode; /* length and distance codes */
701 /* read length/literal and distance code length tables */
740 /* build huffman table for distance codes */
773 * -3: dynamic block code description: too many length or distance codes
778 * -8: dynamic block code description: invalid distance code lengths
780 * -10: invalid literal/length or distance code in fixed or dynamic block
781 * -11: distance is too far back in fixed or dynamic block