Differential D9642 Diff 31357 extern/draco/draco/src/draco/compression/bit_coders/folded_integer_bit_decoder.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/bit_coders/folded_integer_bit_decoder.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/bit_coders/folded_integer_bit_decoder.h.
| Show All 26 Lines | |||||
| class FoldedBit32Decoder { | class FoldedBit32Decoder { | ||||
| public: | public: | ||||
| FoldedBit32Decoder() {} | FoldedBit32Decoder() {} | ||||
| ~FoldedBit32Decoder() {} | ~FoldedBit32Decoder() {} | ||||
| // Sets |source_buffer| as the buffer to decode bits from. | // Sets |source_buffer| as the buffer to decode bits from. | ||||
| bool StartDecoding(DecoderBuffer *source_buffer) { | bool StartDecoding(DecoderBuffer *source_buffer) { | ||||
| for (int i = 0; i < 32; i++) { | for (int i = 0; i < 32; i++) { | ||||
| if (!folded_number_decoders_[i].StartDecoding(source_buffer)) | if (!folded_number_decoders_[i].StartDecoding(source_buffer)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | |||||
| return bit_decoder_.StartDecoding(source_buffer); | return bit_decoder_.StartDecoding(source_buffer); | ||||
| } | } | ||||
| // Decode one bit. Returns true if the bit is a 1, otherwise false. | // Decode one bit. Returns true if the bit is a 1, otherwise false. | ||||
| bool DecodeNextBit() { return bit_decoder_.DecodeNextBit(); } | bool DecodeNextBit() { return bit_decoder_.DecodeNextBit(); } | ||||
| // Decode the next |nbits| and return the sequence in |value|. |nbits| must be | // Decode the next |nbits| and return the sequence in |value|. |nbits| must be | ||||
| // > 0 and <= 32. | // > 0 and <= 32. | ||||
| Show All 31 Lines | |||||