Lines Matching refs:br
135 BrotliBitReader* br) {
139 BrotliTakeBits(br, 1, &n);
144 BrotliTakeBits(br, 3, &n);
149 BrotliTakeBits(br, 3, &n);
152 BrotliTakeBits(br, 1, &n);
182 BrotliDecoderState* s, BrotliBitReader* br, uint32_t* value) {
186 if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, 1, &bits))) {
196 if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, 3, &bits))) {
210 if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, *value, &bits))) {
226 BrotliDecoderState* s, BrotliBitReader* br) {
232 if (!BrotliSafeReadBits(br, 1, &bits)) {
247 if (!BrotliSafeReadBits(br, 1, &bits)) {
258 if (!BrotliSafeReadBits(br, 2, &bits)) {
274 if (!BrotliSafeReadBits(br, 4, &bits)) {
290 if (!BrotliSafeReadBits(br, 1, &bits)) {
300 if (!BrotliSafeReadBits(br, 1, &bits)) {
310 if (!BrotliSafeReadBits(br, 2, &bits)) {
324 if (!BrotliSafeReadBits(br, 8, &bits)) {
352 BrotliBitReader* br) {
357 BrotliDropBits(br, HUFFMAN_TABLE_BITS);
362 BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(table));
369 BrotliBitReader* br) {
370 return DecodeSymbol(BrotliGet16BitsUnmasked(br), table, br);
376 const HuffmanCode* table, BrotliBitReader* br, uint32_t* result) {
378 uint32_t available_bits = BrotliGetAvailableBits(br);
387 val = (uint32_t)BrotliGetBitsUnmasked(br);
391 BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(table));
410 BrotliDropBits(br, HUFFMAN_TABLE_BITS + BROTLI_HC_FAST_LOAD_BITS(table));
416 const HuffmanCode* table, BrotliBitReader* br, uint32_t* result) {
418 if (BROTLI_PREDICT_TRUE(BrotliSafeGetBits(br, 15, &val))) {
419 *result = DecodeSymbol(val, table, br);
422 return SafeDecodeSymbol(table, br, result);
428 BrotliBitReader* br,
435 BROTLI_HC_ADJUST_TABLE_INDEX(table, BrotliGetBits(br, HUFFMAN_TABLE_BITS));
443 BrotliBitReader* br,
448 uint32_t val = BrotliGet16BitsUnmasked(br);
452 BrotliDropBits(br, HUFFMAN_TABLE_BITS);
454 BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(ext));
457 BrotliDropBits(br, *bits);
459 PreloadSymbol(0, table, br, bits, value);
479 BrotliBitReader* br = &s->br;
486 if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, max_bits, &v))) {
595 BrotliBitReader* br = &s->br;
605 if (!BrotliWarmupBitReader(br)) {
612 if (!BrotliCheckInputAmount(br, BROTLI_SHORT_FILL_BIT_WINDOW_READ)) {
620 BrotliFillBitWindow16(br);
621 BROTLI_HC_ADJUST_TABLE_INDEX(p, BrotliGetBitsUnmasked(br) &
623 BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p)); /* Use 1..5 bits. */
632 (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(extra_bits);
633 BrotliDropBits(br, extra_bits);
645 BrotliBitReader* br = &s->br;
654 if (get_byte && !BrotliPullByte(br)) return BROTLI_DECODER_NEEDS_MORE_INPUT;
656 available_bits = BrotliGetAvailableBits(br);
658 bits = (uint32_t)BrotliGetBitsUnmasked(br);
668 BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p));
680 BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p) + extra_bits);
693 BrotliBitReader* br = &s->br;
702 if (BROTLI_PREDICT_FALSE(!BrotliSafeGetBits(br, 4, &ix))) {
703 uint32_t available_bits = BrotliGetAvailableBits(br);
705 ix = BrotliGetBitsUnmasked(br) & 0xF;
718 BrotliDropBits(br, kCodeLengthPrefixLength[ix]);
753 BrotliBitReader* br = &s->br;
759 if (!BrotliSafeReadBits(br, 2, &h->sub_loop_counter)) {
780 if (!BrotliSafeReadBits(br, 2, &h->symbol)) { /* num_symbols */
800 if (!BrotliSafeReadBits(br, 1, &bits)) {
874 BrotliBitReader* br) {
877 code = ReadSymbol(table, br);
879 return _kBrotliPrefixCodeRanges[code].offset + BrotliReadBits24(br, nbits);
886 BrotliBitReader* br) {
889 if (!SafeReadSymbol(table, br, &index)) {
899 if (!BrotliSafeReadBits(br, nbits, &bits)) {
995 BrotliBitReader* br = &s->br;
1001 result = DecodeVarLenUint8(s, br, num_htrees);
1025 if (!BrotliSafeGetBits(br, 5, &bits)) {
1030 BrotliDropBits(br, 5);
1033 BrotliDropBits(br, 1);
1058 if (!SafeReadSymbol(h->context_map_table, br, &code)) {
1080 if (!BrotliSafeReadBits(br, code, &reps)) {
1101 if (!BrotliSafeReadBits(br, 1, &bits)) {
1127 BrotliBitReader* br = &s->br;
1136 block_type = ReadSymbol(type_tree, br);
1137 s->block_length[tree_type] = ReadBlockLength(len_tree, br);
1140 BrotliBitReaderSaveState(br, &memento);
1141 if (!SafeReadSymbol(type_tree, br, &block_type)) return BROTLI_FALSE;
1142 if (!SafeReadBlockLength(s, &s->block_length[tree_type], len_tree, br)) {
1144 BrotliBitReaderRestoreState(br, &memento);
1367 int nbytes = (int)BrotliGetRemainingBytes(&s->br);
1374 /* Copy remaining bytes from s->br.buf_ to ring-buffer. */
1375 BrotliCopyBytes(&s->ringbuffer[s->pos], &s->br, (size_t)nbytes);
1453 BrotliBitReader* br = &s->br;
1458 if (!BrotliSafeReadBits(br, 2, &bits)) {
1497 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
1499 return BrotliSafeReadBits(br, n_bits, val);
1507 BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
1509 return BrotliSafeReadBits32(br, n_bits, val);
1619 int safe, BrotliDecoderState* s, BrotliBitReader* br) {
1626 code = ReadSymbol(distance_tree, br);
1628 BrotliBitReaderSaveState(br, &memento);
1629 if (!SafeReadSymbol(distance_tree, br, &code)) {
1643 bits = BrotliReadBits32(br, b->dist_extra_bits[code]);
1645 if (!SafeReadBits32(br, b->dist_extra_bits[code], &bits)) {
1647 BrotliBitReaderRestoreState(br, &memento);
1657 BrotliDecoderState* s, BrotliBitReader* br) {
1658 ReadDistanceInternal(0, s, br);
1662 BrotliDecoderState* s, BrotliBitReader* br) {
1663 return ReadDistanceInternal(1, s, br);
1667 int safe, BrotliDecoderState* s, BrotliBitReader* br, int* insert_length) {
1674 cmd_code = ReadSymbol(s->htree_command, br);
1676 BrotliBitReaderSaveState(br, &memento);
1677 if (!SafeReadSymbol(s->htree_command, br, &cmd_code)) {
1688 insert_len_extra = BrotliReadBits24(br, v.insert_len_extra_bits);
1690 copy_length = BrotliReadBits24(br, v.copy_len_extra_bits);
1692 if (!SafeReadBits(br, v.insert_len_extra_bits, &insert_len_extra) ||
1693 !SafeReadBits(br, v.copy_len_extra_bits, ©_length)) {
1694 BrotliBitReaderRestoreState(br, &memento);
1705 BrotliDecoderState* s, BrotliBitReader* br, int* insert_length) {
1706 ReadCommandInternal(0, s, br, insert_length);
1710 BrotliDecoderState* s, BrotliBitReader* br, int* insert_length) {
1711 return ReadCommandInternal(1, s, br, insert_length);
1715 int safe, BrotliBitReader* const br, size_t num) {
1719 return BrotliCheckInputAmount(br, num);
1739 BrotliBitReader* br = &s->br;
1741 if (!CheckInputAmount(safe, br, 28)) {
1746 BROTLI_UNUSED(BrotliWarmupBitReader(br));
1766 if (!CheckInputAmount(safe, br, 28)) { /* 156 bits + 7 bytes */
1776 BROTLI_SAFE(ReadCommand(s, br, &i));
1792 PreloadSymbol(safe, s->literal_htree, br, &bits, &value);
1794 if (!CheckInputAmount(safe, br, 28)) { /* 162 bits + 7 bytes */
1801 PreloadSymbol(safe, s->literal_htree, br, &bits, &value);
1806 (uint8_t)ReadPreloadedSymbol(s->literal_htree, br, &bits, &value);
1809 if (!SafeReadSymbol(s->literal_htree, br, &literal)) {
1830 if (!CheckInputAmount(safe, br, 28)) { /* 162 bits + 7 bytes */
1844 p1 = (uint8_t)ReadSymbol(hc, br);
1847 if (!SafeReadSymbol(hc, br, &literal)) {
1885 BROTLI_SAFE(ReadDistance(s, br));
2073 BrotliBitReader* br = &s->br;
2088 br->avail_in = *available_in;
2089 br->next_in = *next_in;
2095 br->next_in = &s->buffer.u8[0];
2112 if (br->avail_in == 0) {
2119 br->avail_in = *available_in;
2120 br->next_in = *next_in;
2128 br->avail_in = s->buffer_length;
2138 *next_in = br->next_in;
2139 *available_in = br->avail_in;
2161 BrotliBitReaderUnload(br);
2162 *available_in = br->avail_in;
2163 *next_in = br->next_in;
2170 if (!BrotliWarmupBitReader(br)) {
2175 result = DecodeWindowBits(s, br); /* Reads 1..8 bits. */
2187 if (!BrotliSafeReadBits(br, 6, &s->window_bits)) {
2225 result = DecodeMetaBlockLength(s, br); /* Reads 2 - 31 bits. */
2234 if (!BrotliJumpToByteBoundary(br)) {
2276 result = DecodeVarLenUint8(s, br, &s->num_block_types[s->loop_counter]);
2312 &s->block_len_trees[tree_offset], br)) {
2336 if (!BrotliSafeReadBits(br, 8, &bits)) {
2348 if (!BrotliSafeReadBits(br, 6, &bits)) {
2516 if (!BrotliJumpToByteBoundary(br)) {
2521 BrotliBitReaderUnload(br);
2522 *available_in = br->avail_in;
2523 *next_in = br->next_in;
2578 BrotliGetAvailableBits(&s->br) != 0);