Lines Matching defs:bits

48     int bitcnt;                 /* number of bits in bit buffer */
50 /* input limit error return state for bits() and decode() */
62 * Return need bits from the input stream. This always leaves less than
63 * eight bits in the buffer. bits() works properly for need == 0.
68 * significant bit. Therefore bits are dropped from the bottom of the bit
72 local int bits(struct state *s, int need)
76 /* load at least need bits into val */
83 val |= (int)(*(s->in)++) << s->bitcnt; /* load eight bits */
88 /* drop need bits and update buffer, always zero to seven bits left */
92 /* return need bits, zeroing the bits above that */
112 * then -9 is returned after reading MAXBITS bits.
118 * bits are pulled from the compressed data one at a time and used to
126 * this ordering, the bits pulled during decoding are inverted to apply the
131 int len; /* current number of bits in code */
132 int code; /* len bits being decoded */
136 int bitbuf; /* bits from stream */
137 int left; /* bits left in next or left to process */
176 * count (high four bits + 1) and a code length (low four bits), generate the
187 * enough bits will resolve to a symbol. If the return value is positive, then
250 * byte is 4, 5, or 6 for the number of extra bits in the distance code.
262 * - If literals are uncoded, then the next eight bits are the literal, in the
264 * no bit reversal is needed for either the length extra bits or the distance
265 * extra bits.
286 int symbol; /* decoded symbol, extra bits for distance */
312 static const char extra[16] = { /* extra bits for length codes */
324 lit = bits(s, 8);
326 dict = bits(s, 8);
331 if (bits(s, 1)) {
334 len = base[symbol] + bits(s, extra[symbol]);
340 dist += bits(s, symbol);
370 symbol = lit ? decode(s, &litcode) : bits(s, 8);
407 /* return if bits() or decode() tries to read past available input */