Lines Matching full:bits
26 state->bits = 0; in inflateReset()
185 bits = state->bits; \
196 state->bits = bits; \
203 bits = 0; \
212 hold += (unsigned long)(*next++) << bits; \
213 bits += 8; \
216 /* Assure that there are at least n bits in the bit accumulator. If there is
220 while (bits < (unsigned)(n)) \
224 /* Return the low n bits of the bit accumulator (n < 16) */
225 #define BITS(n) \ macro
228 /* Remove n bits from the bit accumulator */
232 bits -= (unsigned)(n); \
235 /* Remove zero to seven bits as needed to go to a byte boundary */
238 hold >>= bits & 7; \
239 bits -= bits & 7; \
267 the requested bits are not available. The typical use of the BITS macros
271 ... do something with BITS(n) ...
275 input left to load n bits into the accumulator, or it continues. BITS(n)
276 gives the low n bits in the accumulator. When done, DROPBITS(n) drops
277 the low n bits off the accumulator. INITBITS() clears the accumulator
278 and sets the number of available bits to zero. BYTEBITS() discards just
279 enough bits to put the accumulator on a byte boundary. After BYTEBITS()
280 and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
296 keep[want++] = BITS(n);
335 unsigned bits; /* bits in bit buffer */ in inflate() local
341 unsigned len; /* length to copy for repeats, bits to drop */ in inflate()
382 ((BITS(8) << 8) + (hold >> 8)) % 31) { in inflate()
387 if (BITS(4) != Z_DEFLATED) { in inflate()
393 len = BITS(4) + 8; in inflate()
555 state->last = BITS(1); in inflate()
557 switch (BITS(2)) { in inflate()
612 state->nlen = BITS(5) + 257; in inflate()
614 state->ndist = BITS(5) + 1; in inflate()
616 state->ncode = BITS(4) + 4; in inflate()
631 state->lens[order[state->have++]] = (unsigned short)BITS(3); in inflate()
652 this = state->lencode[BITS(state->lenbits)]; in inflate()
653 if ((unsigned)(this.bits) <= bits) break; in inflate()
657 NEEDBITS(this.bits); in inflate()
658 DROPBITS(this.bits); in inflate()
663 NEEDBITS(this.bits + 2); in inflate()
664 DROPBITS(this.bits); in inflate()
671 copy = 3 + BITS(2); in inflate()
675 NEEDBITS(this.bits + 3); in inflate()
676 DROPBITS(this.bits); in inflate()
678 copy = 3 + BITS(3); in inflate()
682 NEEDBITS(this.bits + 7); in inflate()
683 DROPBITS(this.bits); in inflate()
685 copy = 11 + BITS(7); in inflate()
732 this = state->lencode[BITS(state->lenbits)]; in inflate()
733 if ((unsigned)(this.bits) <= bits) break; in inflate()
740 (BITS(last.bits + last.op) >> last.bits)]; in inflate()
741 if ((unsigned)(last.bits + this.bits) <= bits) break; in inflate()
744 DROPBITS(last.bits); in inflate()
746 DROPBITS(this.bits); in inflate()
770 state->length += BITS(state->extra); in inflate()
777 this = state->distcode[BITS(state->distbits)]; in inflate()
778 if ((unsigned)(this.bits) <= bits) break; in inflate()
785 (BITS(last.bits + last.op) >> last.bits)]; in inflate()
786 if ((unsigned)(last.bits + this.bits) <= bits) break; in inflate()
789 DROPBITS(last.bits); in inflate()
791 DROPBITS(this.bits); in inflate()
803 state->offset += BITS(state->extra); in inflate()
922 strm->data_type = state->bits + (state->last ? 64 : 0) + in inflate()