Home | History | Annotate | Download | only in examples

Lines Matching defs:bit

30    the bit values to the codes (i.e. only canonical codes are counted).
34 be coded, what the last code length used was, and how many bit patterns of
39 properties are: we cannot use more bit patterns than are available; and when
40 all the symbols are used, there are exactly zero possible bit patterns
51 that root-bit prefix. If that longest code has length len, then the table
53 codes. Each subsequent root-bit prefix then has its own sub-table. The
55 incrementally as the number of codes at each bit length is populated. When
74 Second, the intermediate states that lead to (root + 1) bit or longer codes
80 Beginning the code examination at (root + 1) bit codes, which is enabled by
86 for the default arguments of 286 symbols limited to 15-bit codes.
99 where the bit pattern counting takes place.
111 typedef unsigned long long code_t; /* type for bit pattern counting */
113 size_t len; /* length of bit vector in char's */
114 char *vec; /* allocated bit vector */
120 left: number of available bit patterns at length len
130 must be even, since it represents the number of available bit patterns at
144 For the deflate example of 286 symbols limited to 15-bit codes, the array
155 element is simply one bit indicating whether the state has been visited or
156 not. Since the ranges for mem and rem are not known a priori, each bit
162 calculations for offset and bit in beenhere() for the details.
164 For the deflate example of 286 symbols limited to 15-bit codes, the bit
170 local int max; /* maximum allowed bit length for the codes */
174 local int *code; /* number of symbols assigned to each bit length */
198 /* Return the number of possible Huffman codes using bit patterns of lengths
199 len through max inclusive, coding syms symbols, with left bit patterns of
209 int use; /* number of bit patterns to use in next call */
225 /* we need to use at least this many bit patterns so that the code won't be
226 incomplete at the next length (more bit patterns than symbols) */
231 /* we can use at most this many bit patterns, lest there not be enough
254 /* Return true if we've been here before, set to true if not. Set a bit in a
255 bit vector to indicate visiting this state. Each (syms,len,left) state
256 has a variable size bit vector indexed by (mem,rem). The bit vector is
257 lengthened if needed to allow setting the (mem,rem) bit. */
260 size_t index; /* index for this state's bit vector */
261 size_t offset; /* offset in this state's bit vector */
262 int bit; /* mask for this state's bit */
263 size_t length; /* length of the bit vector in bytes */
264 char *vector; /* new or enlarged bit vector */
266 /* point to vector for (syms,left,len), bit in vector for (mem,rem) */
271 bit = 1 << (mem & 7);
275 if (offset < length && (done[index].vec[offset] & bit) != 0)
278 /* we haven't been here before -- set the bit to show we have now */
280 /* see if we need to lengthen the vector in order to set the bit */
312 /* set the bit */
313 done[index].vec[offset] |= bit;
326 int use; /* number of bit patterns to use in next call */
361 /* we need to use at least this many bit patterns so that the code won't be
362 incomplete at the next length (more bit patterns than symbols) */
367 /* we can use at most this many bit patterns, lest there not be enough
406 int left; /* number of unused bit patterns at this length */
413 /* look at all (root + 1) bit and longer codes */
419 /* look at all reachable (root + 1) bit nodes, and the
425 /* also look at root bit codes with completions at root + 1
547 printf(" (%d-bit length limit)\n", max);