Home | History | Annotate | Download | only in zlib

Lines Matching refs:bits

30  * - Add comments on state->bits assertion in inffast.c
122 state->bits = 0;
154 /* set number of window bits, free window if different */
209 int ZEXPORT inflatePrime(strm, bits, value)
211 int bits;
218 if (bits < 0) {
220 state->bits = 0;
223 if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;
224 value &= (1L << bits) - 1;
225 state->hold += value << state->bits;
226 state->bits += bits;
250 unsigned sym, bits;
261 bits = 9;
262 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
268 bits = 5;
269 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
324 printf("{%u,%u,%d}", state.lencode[low].op, state.lencode[low].bits,
335 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
445 bits = state->bits; \
456 state->bits = bits; \
463 bits = 0; \
472 hold += (unsigned long)(*next++) << bits; \
473 bits += 8; \
476 /* Assure that there are at least n bits in the bit accumulator. If there is
480 while (bits < (unsigned)(n)) \
484 /* Return the low n bits of the bit accumulator (n < 16) */
485 #define BITS(n) \
488 /* Remove n bits from the bit accumulator */
492 bits -= (unsigned)(n); \
495 /* Remove zero to seven bits as needed to go to a byte boundary */
498 hold >>= bits & 7; \
499 bits -= bits & 7; \
527 the requested bits are not available. The typical use of the BITS macros
531 ... do something with BITS(n) ...
535 input left to load n bits into the accumulator, or it continues. BITS(n)
536 gives the low n bits in the accumulator. When done, DROPBITS(n) drops
537 the low n bits off the accumulator. INITBITS() clears the accumulator
538 and sets the number of available bits to zero. BYTEBITS() discards just
539 enough bits to put the accumulator on a byte boundary. After BYTEBITS()
540 and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
556 keep[want++] = BITS(n);
598 unsigned bits; /* bits in bit buffer */
604 unsigned len; /* length to copy for repeats, bits to drop */
645 ((BITS(8) << 8) + (hold >> 8)) % 31) {
650 if (BITS(4) != Z_DEFLATED) {
656 len = BITS(4) + 8;
819 state->last = BITS(1);
821 switch (BITS(2)) {
883 state->nlen = BITS(5) + 257;
885 state->ndist = BITS(5) + 1;
887 state->ncode = BITS(4) + 4;
902 state->lens[order[state->have++]] = (unsigned short)BITS(3);
923 here = state->lencode[BITS(state->lenbits)];
924 if ((unsigned)(here.bits) <= bits) break;
928 NEEDBITS(here.bits);
929 DROPBITS(here.bits);
934 NEEDBITS(here.bits + 2);
935 DROPBITS(here.bits);
942 copy = 3 + BITS(2);
946 NEEDBITS(here.bits + 3);
947 DROPBITS(here.bits);
949 copy = 3 + BITS(3);
953 NEEDBITS(here.bits + 7);
954 DROPBITS(here.bits);
956 copy = 11 + BITS(7);
1017 here = state->lencode[BITS(state->lenbits)];
1018 if ((unsigned)(here.bits) <= bits) break;
1025 (BITS(last.bits + last.op) >> last.bits)];
1026 if ((unsigned)(last.bits + here.bits) <= bits) break;
1029 DROPBITS(last.bits);
1030 state->back += last.bits;
1032 DROPBITS(here.bits);
1033 state->back += here.bits;
1058 state->length += BITS(state->extra);
1067 here = state->distcode[BITS(state->distbits)];
1068 if ((unsigned)(here.bits) <= bits) break;
1075 (BITS(last.bits + last.op) >> last.bits)];
1076 if ((unsigned)(last.bits + here.bits) <= bits) break;
1079 DROPBITS(last.bits);
1080 state->back += last.bits;
1082 DROPBITS(here.bits);
1083 state->back += here.bits;
1095 state->offset += BITS(state->extra);
1230 strm->data_type = state->bits + (state->last ? 64 : 0) +
1356 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1361 state->hold <<= state->bits & 7;
1362 state->bits -= state->bits & 7;
1364 while (state->bits >= 8) {
1367 state->bits -= 8;
1403 return state->mode == STORED && state->bits == 0;