Lines Matching refs:num_bits
82 /* Ensure the bit buffer variable for the bitstream contains at least @num_bits
84 * may be called on the bitstream to peek or remove up to @num_bits bits. Note
85 * that @num_bits must be <= 16.
88 u32 num_bits)
90 if (is->bitsleft < num_bits) {
100 /* Return the next @num_bits bits from the bitstream, without removing them.
101 * There must be at least @num_bits remaining in the buffer variable, from a
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);
110 /* Remove @num_bits from the bitstream. There must be at least @num_bits
115 bitstream_remove_bits(struct input_bitstream *is, u32 num_bits)
117 is->bitbuf <<= num_bits;
118 is->bitsleft -= num_bits;
121 /* Remove and return @num_bits bits from the bitstream. There must be at least
122 * @num_bits remaining in the buffer variable, from a previous call to
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);
134 /* Read and return the next @num_bits bits from the bitstream. */
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);
199 const u32 num_bits, const u8 lens[],