Lines Matching defs:n_bits
64 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val);
103 /* Guarantees that there are at least |n_bits| + 1 bits in accumulator.
105 |n_bits| should be in the range [1..24] for regular build. For portable
108 BrotliBitReader* const br, uint32_t n_bits) {
110 if (!BROTLI_ALIGNED_READ && BROTLI_IS_CONSTANT(n_bits) && (n_bits <= 8)) {
119 !BROTLI_ALIGNED_READ && BROTLI_IS_CONSTANT(n_bits) && (n_bits <= 16)) {
137 if (!BROTLI_ALIGNED_READ && BROTLI_IS_CONSTANT(n_bits) && (n_bits <= 8)) {
199 BrotliBitReader* const br, uint32_t n_bits) {
200 BrotliFillBitWindow(br, n_bits);
201 return (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits);
207 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
208 while (BrotliGetAvailableBits(br) < n_bits) {
213 *val = (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits);
217 /* Advances the bit pos by |n_bits|. */
219 BrotliBitReader* const br, uint32_t n_bits) {
220 br->bit_pos_ += n_bits;
237 Precondition: accumulator MUST contain at least |n_bits|. */
239 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
240 *val = (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits);
242 (int)br->avail_in, (int)br->bit_pos_, (int)n_bits, (int)*val));
243 BrotliDropBits(br, n_bits);
250 BrotliBitReader* const br, uint32_t n_bits) {
251 BROTLI_DCHECK(n_bits <= 24);
252 if (BROTLI_64_BITS || (n_bits <= 16)) {
254 BrotliFillBitWindow(br, n_bits);
255 BrotliTakeBits(br, n_bits, &val);
263 BrotliTakeBits(br, n_bits - 16, &high_val);
270 BrotliBitReader* const br, uint32_t n_bits) {
271 BROTLI_DCHECK(n_bits <= 32);
272 if (BROTLI_64_BITS || (n_bits <= 16)) {
274 BrotliFillBitWindow(br, n_bits);
275 BrotliTakeBits(br, n_bits, &val);
283 BrotliTakeBits(br, n_bits - 16, &high_val);
289 is not enough input. |n_bits| MUST be positive.
292 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
293 BROTLI_DCHECK(n_bits <= 24);
294 while (BrotliGetAvailableBits(br) < n_bits) {
299 BrotliTakeBits(br, n_bits, val);
305 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
306 BROTLI_DCHECK(n_bits <= 32);
307 if (BROTLI_64_BITS || (n_bits <= 24)) {
308 while (BrotliGetAvailableBits(br) < n_bits) {
313 BrotliTakeBits(br, n_bits, val);
316 return BrotliSafeReadBits32Slow(br, n_bits, val);