Lines Matching defs:bits

44     int bitcnt;                 /* number of bits in bit buffer */
46 /* input limit error return state for bits() and decode() */
58 * Return need bits from the input stream. This always leaves less than
59 * eight bits in the buffer. bits() works properly for need == 0.
64 * significant bit. Therefore bits are dropped from the bottom of the bit
68 local int bits(struct state *s, int need)
72 /* load at least need bits into val */
79 val |= (int)(*(s->in)++) << s->bitcnt; /* load eight bits */
84 /* drop need bits and update buffer, always zero to seven bits left */
88 /* return need bits, zeroing the bits above that */
108 * then -9 is returned after reading MAXBITS bits.
114 * bits are pulled from the compressed data one at a time and used to
122 * this ordering, the bits pulled during decoding are inverted to apply the
127 int len; /* current number of bits in code */
128 int code; /* len bits being decoded */
132 int bitbuf; /* bits from stream */
133 int left; /* bits left in next or left to process */
172 * count (high four bits + 1) and a code length (low four bits), generate the
183 * enough bits will resolve to a symbol. If the return value is positive, then
246 * byte is 4, 5, or 6 for the number of extra bits in the distance code.
258 * - If literals are uncoded, then the next eight bits are the literal, in the
260 * no bit reversal is needed for either the length extra bits or the distance
261 * extra bits.
282 int symbol; /* decoded symbol, extra bits for distance */
308 static const char extra[16] = { /* extra bits for length codes */
320 lit = bits(s, 8);
322 dict = bits(s, 8);
327 if (bits(s, 1)) {
330 len = base[symbol] + bits(s, extra[symbol]);
336 dist += bits(s, symbol);
366 symbol = lit ? decode(s, &litcode) : bits(s, 8);
397 /* return if bits() or decode() tries to read past available input */