Lines Matching refs:BITS
30 * - Add comments on state->bits assertion in inffast.c
120 state->bits = 0;
165 /* set number of window bits, free window if different */
229 int ZEXPORT inflatePrime(strm, bits, value)
231 int bits;
238 if (bits < 0) {
240 state->bits = 0;
243 if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
244 value &= (1L << bits) - 1;
245 state->hold += value << state->bits;
246 state->bits += bits;
270 unsigned sym, bits;
281 bits = 9;
282 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
288 bits = 5;
289 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
345 state.lencode[low].bits, state.lencode[low].val);
355 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
465 bits = state->bits; \
476 state->bits = bits; \
483 bits = 0; \
492 hold += (unsigned long)(*next++) << bits; \
493 bits += 8; \
496 /* Assure that there are at least n bits in the bit accumulator. If there is
500 while (bits < (unsigned)(n)) \
504 bits of the bit accumulator (n < 16) */
505 #define BITS(n) \
508 /* Remove n bits from the bit accumulator */
512 bits -= (unsigned)(n); \
515 /* Remove zero to seven bits as needed to go to a byte boundary */
518 hold >>= bits & 7; \
519 bits -= bits & 7; \
542 the requested bits are not available. The typical use of the BITS macros
546 ... do something with BITS(n) ...
550 input left to load n bits into the accumulator, or it continues. BITS(n)
551 gives the low n bits in the accumulator. When done, DROPBITS(n) drops
552 the low n bits off the accumulator. INITBITS() clears the accumulator
553 and sets the number of available bits to zero. BYTEBITS() discards just
554 enough bits to put the accumulator on a byte boundary. After BYTEBITS()
555 and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
571 keep[want++] = BITS(n);
613 unsigned bits; /* bits in bit buffer */
619 unsigned len; /* length to copy for repeats, bits to drop */
660 ((BITS(8) << 8) + (hold >> 8)) % 31) {
665 if (BITS(4) != Z_DEFLATED) {
671 len = BITS(4) + 8;
834 state->last = BITS(1);
836 switch (BITS(2)) {
898 state->nlen = BITS(5) + 257;
900 state->ndist = BITS(5) + 1;
902 state->ncode = BITS(4) + 4;
917 state->lens[order[state->have++]] = (unsigned short)BITS(3);
938 here = state->lencode[BITS(state->lenbits)];
939 if ((unsigned)(here.bits) <= bits) break;
943 DROPBITS(here.bits);
948 NEEDBITS(here.bits + 2);
949 DROPBITS(here.bits);
956 copy = 3 + BITS(2);
960 NEEDBITS(here.bits + 3);
961 DROPBITS(here.bits);
963 copy = 3 + BITS(3);
967 NEEDBITS(here.bits + 7);
968 DROPBITS(here.bits);
970 copy = 11 + BITS(7);
1031 here = state->lencode[BITS(state->lenbits)];
1032 if ((unsigned)(here.bits) <= bits) break;
1039 (BITS(last.bits + last.op) >> last.bits)];
1040 if ((unsigned)(last.bits + here.bits) <= bits) break;
1043 DROPBITS(last.bits);
1044 state->back += last.bits;
1046 DROPBITS(here.bits);
1047 state->back += here.bits;
1072 state->length += BITS(state->extra);
1081 here = state->distcode[BITS(state->distbits)];
1082 if ((unsigned)(here.bits) <= bits) break;
1089 (BITS(last.bits + last.op) >> last.bits)];
1090 if ((unsigned)(last.bits + here.bits) <= bits) break;
1093 DROPBITS(last.bits);
1094 state->back += last.bits;
1096 DROPBITS(here.bits);
1097 state->back += here.bits;
1109 state->offset += BITS(state->extra);
1245 strm->data_type = state->bits + (state->last ? 64 : 0) +
1372 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1377 state->hold <<= state->bits & 7;
1378 state->bits -= state->bits & 7;
1380 while (state->bits >= 8) {
1383 state->bits -= 8;
1419 return state->mode == STORED && state->bits == 0;