Lines Matching refs:is

73 static forceinline void init_input_bitstream(struct input_bitstream *is,  in init_input_bitstream()  argument
76 is->bitbuf = 0; in init_input_bitstream()
77 is->bitsleft = 0; in init_input_bitstream()
78 is->next = buffer; in init_input_bitstream()
79 is->end = is->next + size; in init_input_bitstream()
87 static forceinline void bitstream_ensure_bits(struct input_bitstream *is, in bitstream_ensure_bits() argument
90 if (is->bitsleft < num_bits) { in bitstream_ensure_bits()
91 if (is->end - is->next >= 2) { in bitstream_ensure_bits()
92 is->bitbuf |= (u32)get_unaligned_le16(is->next) in bitstream_ensure_bits()
93 << (16 - is->bitsleft); in bitstream_ensure_bits()
94 is->next += 2; in bitstream_ensure_bits()
96 is->bitsleft += 16; in bitstream_ensure_bits()
105 bitstream_peek_bits(const struct input_bitstream *is, const u32 num_bits) in bitstream_peek_bits() argument
107 return (is->bitbuf >> 1) >> (sizeof(is->bitbuf) * 8 - num_bits - 1); in bitstream_peek_bits()
115 bitstream_remove_bits(struct input_bitstream *is, u32 num_bits) in bitstream_remove_bits() argument
117 is->bitbuf <<= num_bits; in bitstream_remove_bits()
118 is->bitsleft -= num_bits; in bitstream_remove_bits()
126 bitstream_pop_bits(struct input_bitstream *is, u32 num_bits) in bitstream_pop_bits() argument
128 u32 bits = bitstream_peek_bits(is, num_bits); in bitstream_pop_bits()
130 bitstream_remove_bits(is, num_bits); in bitstream_pop_bits()
136 bitstream_read_bits(struct input_bitstream *is, u32 num_bits) in bitstream_read_bits() argument
138 bitstream_ensure_bits(is, num_bits); in bitstream_read_bits()
139 return bitstream_pop_bits(is, num_bits); in bitstream_read_bits()
144 bitstream_read_byte(struct input_bitstream *is) in bitstream_read_byte() argument
146 if (unlikely(is->end == is->next)) in bitstream_read_byte()
148 return *is->next++; in bitstream_read_byte()
153 bitstream_read_u16(struct input_bitstream *is) in bitstream_read_u16() argument
157 if (unlikely(is->end - is->next < 2)) in bitstream_read_u16()
159 v = get_unaligned_le16(is->next); in bitstream_read_u16()
160 is->next += 2; in bitstream_read_u16()
166 bitstream_read_u32(struct input_bitstream *is) in bitstream_read_u32() argument
170 if (unlikely(is->end - is->next < 4)) in bitstream_read_u32()
172 v = get_unaligned_le32(is->next); in bitstream_read_u32()
173 is->next += 4; in bitstream_read_u32()
181 static forceinline void *bitstream_read_bytes(struct input_bitstream *is, in bitstream_read_bytes() argument
184 if ((size_t)(is->end - is->next) < count) in bitstream_read_bytes()
186 memcpy(dst_buffer, is->next, count); in bitstream_read_bytes()
187 is->next += count; in bitstream_read_bytes()
192 static forceinline void bitstream_align(struct input_bitstream *is) in bitstream_align() argument
194 is->bitsleft = 0; in bitstream_align()
195 is->bitbuf = 0; in bitstream_align()