Lines Matching refs:is

58 	 * left-justified; the next bit is always bit 31.
73 static forceinline void init_input_bitstream(struct input_bitstream *is,
76 is->bitbuf = 0;
77 is->bitsleft = 0;
78 is->next = buffer;
79 is->end = is->next + size;
87 static forceinline void bitstream_ensure_bits(struct input_bitstream *is,
90 if (is->bitsleft < num_bits) {
91 if (is->end - is->next >= 2) {
92 is->bitbuf |= (u32)get_unaligned_le16(is->next)
93 << (16 - is->bitsleft);
94 is->next += 2;
96 is->bitsleft += 16;
105 bitstream_peek_bits(const struct input_bitstream *is, const u32 num_bits)
107 return (is->bitbuf >> 1) >> (sizeof(is->bitbuf) * 8 - num_bits - 1);
115 bitstream_remove_bits(struct input_bitstream *is, u32 num_bits)
117 is->bitbuf <<= num_bits;
118 is->bitsleft -= num_bits;
126 bitstream_pop_bits(struct input_bitstream *is, u32 num_bits)
128 u32 bits = bitstream_peek_bits(is, num_bits);
130 bitstream_remove_bits(is, num_bits);
136 bitstream_read_bits(struct input_bitstream *is, u32 num_bits)
138 bitstream_ensure_bits(is, num_bits);
139 return bitstream_pop_bits(is, num_bits);
144 bitstream_read_byte(struct input_bitstream *is)
146 if (unlikely(is->end == is->next))
148 return *is->next++;
153 bitstream_read_u16(struct input_bitstream *is)
157 if (unlikely(is->end - is->next < 2))
159 v = get_unaligned_le16(is->next);
160 is->next += 2;
166 bitstream_read_u32(struct input_bitstream *is)
170 if (unlikely(is->end - is->next < 4))
172 v = get_unaligned_le32(is->next);
173 is->next += 4;
181 static forceinline void *bitstream_read_bytes(struct input_bitstream *is,
184 if ((size_t)(is->end - is->next) < count)
186 memcpy(dst_buffer, is->next, count);
187 is->next += count;
192 static forceinline void bitstream_align(struct input_bitstream *is)
194 is->bitsleft = 0;
195 is->bitbuf = 0;
205 * input data is exhausted, the Huffman symbol is decoded as if the missing bits
229 /* Slow case: The codeword for the symbol is longer than
245 * The length and offset must be already validated --- that is, (dst - offset)
260 * Try to copy one machine word at a time. On i386 and x86_64 this is
261 * faster than copying one byte at a time, unless the data is
267 * example, if a word is 8 bytes and the match is of length 5, then
268 * we'll simply copy 8 bytes. This is okay as long as we don't write
281 * loop is unrolled. Most matches are short and will
283 * it becomes increasing likely that the match is long
302 * encoding of the previous byte. This case is common