Lines Matching defs:bits
40 // necessary the first few bits of the compressed data is read from the file.
41 // inflate is initialized with those bits and the 32K of uncompressed data, and
80 static struct deflate_index *add_point(struct deflate_index *index, int bits,
118 next->bits = bits;
162 // in a false positive for zlib, but in practice the fill bits
250 // Append the low bits bits of value to in[] at bit position *have, updating
251 // *have. value must be zero above its low bits bits. bits must be positive.
252 // This assumes that any bits above the *have bits in the last byte are zeros.
253 // That assumption is preserved on return, as any bits above *have + bits in
255 static inline void append_bits(unsigned value, int bits,
257 in += *have >> 3; // where the first bits from value will go
258 int k = *have & 7; // the number of bits already there
259 *have += bits;
261 *in |= value << k; // write value above the low k bits
264 k = 8 - k; // the number of bits just appended
265 while (bits > k) {
266 value >>= k; // drop the bits appended
267 bits -= k;
273 // Insert enough bits in the form of empty deflate blocks in front of the
274 // low bits bits of value, in order to bring the sequence to a byte boundary.
276 // a negative value of bits is not supported. bits must be in 0..16. If the
279 static int inflatePreface(z_stream *strm, int bits, int value)
282 if (strm == Z_NULL || bits < 0 || bits > 16)
284 if (bits == 0)
286 value &= (2 << (bits - 1)) - 1;
288 // An empty dynamic block with an odd number of bits (95). The high bit of
293 const int dynlen = 95; // number of bits in the block
295 // Build an input buffer for inflate that is a multiple of eight bits in
296 // length, and that ends with the low bits bits of value.
299 if (bits & 1) {
300 // Insert an empty dynamic block to get to an odd number of bits, so
301 // when bits bits from value are appended, we are at an even number of
302 // bits.
306 while ((have + bits) & 7)
307 // Insert empty fixed blocks until appending bits bits would put us on
311 // Append the bits bits from value, which takes us to a byte boundary.
312 append_bits(value, bits, in, &have);
316 // provided input. The reason is that there will be at most 16 bits of
318 // generate no output). At least ten bits are needed to generate the first
320 // be ingested in order to get ten bits, which is the most that value can
358 int ret = fseeko(in, point->in - (point->bits ? 1 : 0), SEEK_SET);
362 if (point->bits && (ch = getc(in)) == EOF)
368 if (point->bits)
369 INFLATEPRIME(&strm, point->bits, ch >> (8 - point->bits));