Home | History | Annotate | Download | only in zlib-1.2.3

Lines Matching refs:bits

30  * - Add comments on state->bits assertion in inffast.c
122 state->bits = 0;
128 int ZEXPORT inflatePrime(strm, bits, value)
130 int bits;
137 if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
138 value &= (1L << bits) - 1;
139 state->hold += value << state->bits;
140 state->bits += bits;
215 unsigned sym, bits;
226 bits = 9;
227 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
233 bits = 5;
234 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
289 printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
300 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
410 bits = state->bits; \
421 state->bits = bits; \
428 bits = 0; \
437 hold += (unsigned long)(*next++) << bits; \
438 bits += 8; \
441 /* Assure that there are at least n bits in the bit accumulator. If there is
445 while (bits < (unsigned)(n)) \
449 /* Return the low n bits of the bit accumulator (n < 16) */
450 #define BITS(n) \
453 /* Remove n bits from the bit accumulator */
457 bits -= (unsigned)(n); \
460 /* Remove zero to seven bits as needed to go to a byte boundary */
463 hold >>= bits & 7; \
464 bits -= bits & 7; \
492 the requested bits are not available. The typical use of the BITS macros
496 ... do something with BITS(n) ...
500 input left to load n bits into the accumulator, or it continues. BITS(n)
501 gives the low n bits in the accumulator. When done, DROPBITS(n) drops
502 the low n bits off the accumulator. INITBITS() clears the accumulator
503 and sets the number of available bits to zero. BYTEBITS() discards just
504 enough bits to put the accumulator on a byte boundary. After BYTEBITS()
505 and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
521 keep[want++] = BITS(n);
563 unsigned bits; /* bits in bit buffer */
569 unsigned len; /* length to copy for repeats, bits to drop */
610 ((BITS(8) << 8) + (hold >> 8)) % 31) {
615 if (BITS(4) != Z_DEFLATED) {
621 len = BITS(4) + 8;
782 state->last = BITS(1);
784 switch (BITS(2)) {
839 state->nlen = BITS(5) + 257;
841 state->ndist = BITS(5) + 1;
843 state->ncode = BITS(4) + 4;
858 state->lens[order[state->have++]] = (unsigned short)BITS(3);
879 this = state->lencode[BITS(state->lenbits)];
880 if ((unsigned)(this.bits) <= bits) break;
884 NEEDBITS(this.bits);
885 DROPBITS(this.bits);
890 NEEDBITS(this.bits + 2);
891 DROPBITS(this.bits);
898 BITS(2);
902 NEEDBITS(this.bits + 3);
903 DROPBITS(this.bits);
905 copy = 3 + BITS(3);
909 NEEDBITS(this.bits + 7);
910 DROPBITS(this.bits);
912 copy = 11 + BITS(7);
958 this = state->lencode[BITS(state->lenbits)];
959 if ((unsigned)(this.bits) <= bits) break;
966 (BITS(last.bits + last.op) >> last.bits)];
967 if ((unsigned)(last.bits + this.bits) <= bits) break;
970 DROPBITS(last.bits);
972 DROPBITS(this.bits);
996 state->length += BITS(state->extra);
1003 this = state->distcode[BITS(state->distbits)];
1004 if ((unsigned)(this.bits) <= bits) break;
1011 (BITS(last.bits + last.op) >> last.bits)];
1012 if ((unsigned)(last.bits + this.bits) <= bits) break;
1015 DROPBITS(last.bits);
1017 DROPBITS(this.bits);
1029 state->offset += BITS(state->extra);
1148 strm->data_type = state->bits + (state->last ? 64 : 0) +
1273 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1278 state->hold <<= state->bits & 7;
1279 state->bits -= state->bits & 7;
1281 while (state->bits >= 8) {
1284 state->bits -= 8;
1320 return state->mode == STORED && state->bits == 0;