Lines Matching +full:many +full:- +full:to +full:- +full:one
4 LZ77 (Lempel-Ziv 1977, see reference below). It finds duplicated strings in
6 pointer to the previous string, in the form of a pair (distance,
7 length). Distances are limited to 32K bytes, and lengths are limited
8 to 258 bytes. When a string does not occur anywhere in the previous
11 and is not restricted to printable characters.)
13 Literals or match lengths are compressed with one Huffman tree, and
16 size (except that the compressed data for one block must fit in
18 it would be useful to start another block with fresh trees. (This is
19 somewhat similar to the behavior of LZW-based _compress_.)
27 The hash chains are searched starting with the most recent strings, to
32 To avoid a worst-case situation, very long hash chains are arbitrarily
40 previous match is truncated to a length of one (thus producing a single
45 The lazy match evaluation is also subject to a runtime parameter. If
52 modes (level parameter 1 to 3). For these fast modes, new strings
62 The key question is how to represent a Huffman code (or any prefix code) so
64 codes are much more common than longer codes, so pay attention to decoding the
65 short codes fast, and let the long codes take longer to decode.
68 input less than the length of longest code. It gets that many bits from the
70 code is that many bits or less and how many, and if it is, it will tell
71 the value, else it will point to the next level table for which inflate()
72 grabs more bits and tries to decode a longer code.
74 How many bits to make the first lookup is a tradeoff between the time it
75 takes to decode and the time it takes to build the table. If building the
77 be a first level table to cover all the way to the longest code. However,
79 codes are replicated many times in such a table. What inflate() does is
80 simply to make the number of bits in the first table a variable, and then
81 to set that variable for the maximum speed.
86 those cases, the table ended up one bit longer than the ``average'' code
94 Ok, you want to know what this cleverly obfuscated inflate tree actually
97 symbol could be as short as one bit or as long as 15 bits. If a particular
100 symbol is four bits, then it's duplicated 32 times in a nine-bit table. If a
104 to another similar table for the remaining bits. Again, there are duplicated
106 and there will only be one table look up. (That's whole idea behind data
109 symbols, you could have as many levels of lookups as is efficient. For
112 So a table entry either points to another table (in which case nine bits in
114 and the number of bits to gobble. Then you start again with the next
117 You may wonder: why not just have one lookup table for how ever many bits the
121 kbytes. You can imagine that filling in a 2^15 entry table for a 15-bit code
127 So the number of bits for the first lookup table is a trade of the time to
133 The code being decoded, with 10 symbols, from 1 to 6 bits long:
154 110: -> table X (gobble 3 bits)
155 111: -> table Y (gobble 3 bits)
157 Each entry is what the bits decode as and how many bits that is, i.e. how
158 many bits to gobble. Or the entry points to another table, with the number of
159 bits to gobble implicit in the size of the table.
181 So what we have here are three tables with a total of 20 entries that had to
182 be constructed. That's compared to 64 entries for a single table. Or
183 compared to 16 entries for a Huffman tree (six two entry tables and one four
186 to one lookup for the single table, or 1.66 lookups per symbol for the
192 indicates a base value and a number of bits to fetch after the code that is
193 added to the base value. Or it might be the special end-of-block code. The
194 data structures created in inftrees.c try to encode all that information
198 Jean-loup Gailly Mark Adler
206 pp. 337-343.