Lines Matching defs:length

156 /* number of length codes, not counting the special END_BLOCK code */
191 ush len; /* length of bit string */
239 * performed with a length multiple of the block size. Also, it limits
274 uInt match_length; /* length of best match */
288 * length. A higher limit improves compression ratio but degrades the
298 /* Insert new strings in the hash table only if the match length is not
299 * greater than this length. This saves time but degrades compression.
313 struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
319 struct tree_desc_s bl_desc; /* desc. for bit length tree */
322 /* number of codes at each bit length for an optimal tree */
365 ulg opt_len; /* bit length of current block with optimal trees */
366 ulg static_len; /* bit length of current block with static trees */
367 ulg compressed_len; /* total bit length of compressed file */
369 int last_eob_len; /* bit length of EOB code for last block */
372 ulg bits_sent; /* bit length of the compressed data */
484 /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */
498 ush good_length; /* reduce lazy search above this match length */
499 ush max_lazy; /* do not perform lazy search above this match length */
500 ush nice_length; /* quit search above this match length */
544 int length));
560 * the previous length of the hash chain.
650 * output size for (length,distance) codes is <= 32 bits (worst case
814 but not a zero length. */
829 * this ensures we don't output a second zero-length stored
929 * return its length. Matches shorter or equal to prev_length are discarded,
943 unsigned chain_length = s->max_chain_length;/* max hash chain length */
946 register int len; /* length of current match */
947 int best_len = s->prev_length; /* best match length so far */
984 /* Skip to next match if the match length cannot increase
985 * or if the match length is less than 2:
1075 local void check_match(s, start, match, length)
1078 int length;
1082 (charf *)s->window + start, length) != EQUAL) {
1084 " start %u, match %u, length %d\n",
1085 start, match, length);
1087 s->window[start++]); } while (--length != 0);
1091 fprintf(stderr,"\\[%d,%d]", start-match, length);
1092 do { putc(s->window[start++], stderr); } while (--length != 0);
1096 # define check_match(s, start, match, length)
1278 /* Insert new strings in the hash table only if the match length
1482 /* Bit length codes must not exceed MAX_BL_BITS bits */
1488 /* repeat previous bit length 3-6 times (2 bits of repeat count) */
1491 /* repeat a zero length 3-10 times (3 bits of repeat count) */
1494 /* repeat a zero length 11-138 times (7 bits of repeat count) */
1496 local int extra_lbits[LENGTH_CODES] /* extra bits for each length code */
1502 local int extra_blbits[BL_CODES]/* extra bits for each bit length code */
1507 /* The lengths of the bit length codes are sent in order of decreasing
1508 * probability, to avoid transmitting the lengths for unused bit length codes.
1540 /* length code for each normalized match length (0 == MIN_MATCH) */
1543 /* First normalized length for each code (0 = MIN_MATCH) */
1553 int max_length; /* max bit length for the codes */
1583 local unsigned bi_reverse OF((unsigned value, int length));
1617 * IN assertion: length <= 16 and value fits in length bits.
1620 local void send_bits OF((deflate_state *s, int value, int length));
1622 local void send_bits(s, value, length)
1625 int length; /* number of bits */
1627 Tracev((stderr," l %2d v %4x ", length, value));
1628 Assert(length > 0 && length <= 15, "invalid length");
1629 s->bits_sent += (ulg)length;
1635 if (s->bi_valid > (int)Buf_size - length) {
1639 s->bi_valid += length - Buf_size;
1642 s->bi_valid += length;
1647 #define send_bits(s, value, length) \
1648 { int len = length;\
1674 int length; /* length value */
1678 /* number of codes at each bit length for an optimal tree */
1680 /* Initialize the mapping length (0..255) -> length code (0..28) */
1681 length = 0;
1683 base_length[code] = length;
1685 length_code[length++] = (uch)code;
1688 Assert (length == 256, "ct_static_init: length != 256");
1689 /* Note that the length 255 (match length 258) can be represented
1693 length_code[length-1] = (uch)code;
1801 * the subtrees have equal frequency. This minimizes the worst case length.
1839 * Compute the optimal bit lengths for a tree and update the total bit length
1843 * OUT assertions: the field len is set to the optimal bit length, the
1844 * array bl_count contains the frequencies for each bit length.
1845 * The length opt_len is updated; static_len is also updated if stree is
1860 int bits; /* bit length */
1863 int overflow = 0; /* number of elements with bit length too large */
1868 * overflow in the case of the bit length tree).
1890 Trace((stderr,"\nbit length overflow\n"));
1893 /* Find the first bit length which could increase: */
1930 * IN assertion: the array bl_count contains the bit length statistics for
1933 * zero code length.
1938 ushf *bl_count; /* number of codes at each bit length */
1940 ush next_code[MAX_BITS+1]; /* next code value for each bit length */
1971 * Update the total bit length for the current block.
1973 * OUT assertions: the fields len and code are set to the optimal bit length
1974 * and corresponding code. The length opt_len is updated; static_len is
2062 * in the bit length tree.
2070 int prevlen = -1; /* last emitted length */
2071 int curlen; /* length of current code */
2072 int nextlen = tree[0].Len; /* length of next code */
2115 int prevlen = -1; /* last emitted length */
2116 int curlen; /* length of current code */
2117 int nextlen = tree[0].Len; /* length of next code */
2158 * bl_order of the last bit length code to send.
2163 int max_blindex; /* index of last bit length code of non zero freq */
2165 /* Determine the bit length frequencies for literal and distance trees */
2169 /* Build the bit length tree: */
2171 /* opt_len now includes the length of the tree representations, except
2175 /* Determine the number of bit length codes to send. The pkzip format
2176 * requires that at least 4 bit length codes be sent. (appnote.txt says
2182 /* Update opt_len to include the bit length tree and counts */
2192 * lengths of the bit length codes, the literal tree and the distance tree.
2227 ulg stored_len; /* length of input block */
2237 /* Send just the `stored block' type code without any length bytes or data.
2265 * block was thus its length plus what we have just sent.
2279 * returns the total compressed length for the file so far.
2284 ulg stored_len; /* length of input block */
2288 int max_blindex; /* index of last bit length code of non zero freq */
2308 /* Build the bit length tree for the above two trees, and get the index
2309 * in bl_order of the last bit length code to send.
2313 /* Determine the best encoding. Compute first the block length in bytes */
2406 int lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
2415 /* Here, lc is the match length - MIN_MATCH */
2427 /* Compute an upper bound for the compressed length */
2457 int lc; /* match length or unmatched char (if dist == 0) */
2469 /* Here, lc is the match length - MIN_MATCH */
2471 send_code(s, code+LITERALS+1, ltree); /* send the length code */
2475 send_bits(s, lc, extra); /* send the extra length bits */
2523 int len; /* its bit length */
2569 * Copy a stored block, storing first the length and its
2575 unsigned len; /* its length */
2664 uInt Base; /* literal, length base, or distance base */
2680 uInt, /* number of literal/length codes */
2685 inflate_huft * FAR *, /* literal/length tree result */
2692 inflate_huft * FAR *, /* literal/length tree result */
3057 DTREE, /* get length, distance trees for a dynamic block */
3071 uInt bb; /* bit length tree depth */
3072 inflate_huft *tb; /* bit length decoding tree */
3159 local uInt border[] = { /* Order of the bit length code lengths */
3168 3. There is an implied maximum of 7 bits for the bit length table and
3178 length.
3179 6. There are up to 286 literal/length codes. Code 256 represents the
3180 end-of-block. Note however that the static length tree defines
3182 cannot be used though, since there is no length base or extra bits
3190 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
3191 (1+6+6). Therefore, to output three times the length, you output
3192 three codes (1+1+1), whereas to output four times the same length,
3197 12. Note: length code 284 can represent 227-258, but length code 285
3198 really is 258. The last length deserves its own, short code
3199 since it gets used a lot in very redundant files. The length
3200 258 is special since 258 - 3 (the min match length) is 255.
3201 13. The literal/length and distance code bit lengths are read as a
3288 s->mode = LENS; /* get length of stored block */
3335 Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
3362 z->msg = "too many length or distance symbols";
3433 z->msg = "invalid bit length repeat";
3588 * a `stored' block type value but not the (zero) length bytes.
3664 length codes can decode in one step, and dbits is the same thing for
3667 codes are shorter than that, in which case the longest code length in
3669 table size, in which case the length of the shortest code in bits is
3673 different number of possibilities each. The literal/length table
3684 #define BMAX 15 /* maximum bit length of any code */
3703 case), Z_DATA_ERROR if the input is invalid (all zero length codes or an
3707 uInt a; /* counter for codes of length k */
3708 uInt c[BMAX+1]; /* bit length count table */
3710 int g; /* maximum code length */
3720 uInt v[N_MAX]; /* values in order of bit length */
3728 /* Generate counts for each bit length */
3738 if (c[0] == n) /* null input--all zero length codes */
3746 /* Find minimum and maximum length, bound *m by those */
3751 k = j; /* minimum code length */
3757 g = i; /* maximum code length */
3763 /* Adjust last length count to fill out codes, if needed */
3772 /* Generate starting offsets into the value table for each length */
3803 /* here i is the Huffman code of length k bits for value *p */
3916 uInt nl; /* number of literal/length codes */
3921 inflate_huft * FAR *tl; /* literal/length tree result */
3927 /* build literal/length tree */
3931 z->msg = "oversubscribed literal/length tree";
3935 z->msg = "incomplete literal/length tree";
3945 z->msg = "oversubscribed literal/length tree";
3952 z->msg = "incomplete literal/length tree";
4003 inflate_huft * FAR *tl; /* literal/length tree result */
4012 unsigned c[288]; /* length list for huft_build */
4071 /* infcodes.c -- process literals and length/distance pairs
4088 LEN, /* i: get length/literal/eob next */
4089 LENEXT, /* i: getting length extra (have base) */
4116 inflate_huft *ltree; /* literal/length/eob tree */
4183 case LEN: /* i: get length/literal/eob next */
4198 if (e & 16) /* length */
4218 z->msg = "invalid literal/length code";
4221 case LENEXT: /* i: getting length extra (have base) */
4228 Tracevv((stderr, "inflate: length %u\n", c->len));
4389 /* inffast.c -- process literals and length/distance pairs fast
4405 (the maximum string length) and number of input bytes available
4406 at least ten. The ten bytes are six bytes for the longest length/
4423 uInt ml; /* mask for literal/length tree */
4438 /* get literal/length code */
4439 GRABBITS(20) /* max bits for literal/length code */
4454 /* get extra bits for length */
4458 Tracevv((stderr, "inflate: * length %u\n", c));
4534 z->msg = "invalid literal/length code";