GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
symbol_bit_decoder.h
Go to the documentation of this file.
1#ifndef DRACO_COMPRESSION_BIT_CODERS_SYMBOL_BIT_DECODER_H_
2#define DRACO_COMPRESSION_BIT_CODERS_SYMBOL_BIT_DECODER_H_
3
4#include <algorithm>
5#include <vector>
6
8
9namespace draco {
10
11// Class for decoding bits using the symbol entropy encoding. Wraps
12// |DecodeSymbols|. Note that this uses a symbol-based encoding scheme for
13// encoding bits.
15 public:
16 // Sets |source_buffer| as the buffer to decode bits from.
17 bool StartDecoding(DecoderBuffer *source_buffer);
18
19 // Decode one bit. Returns true if the bit is a 1, otherwise false.
20 bool DecodeNextBit();
21
22 // Decode the next |nbits| and return the sequence in |value|. |nbits| must be
23 // > 0 and <= 32.
24 void DecodeLeastSignificantBits32(int nbits, uint32_t *value);
25
26 void EndDecoding() { Clear(); }
27
28 private:
29 void Clear();
30
31 std::vector<uint32_t> symbols_;
32};
33
34} // namespace draco
35
36#endif // DRACO_COMPRESSION_BIT_CODERS_SYMBOL_BIT_DECODER_H_
Definition decoder_buffer.h:30
Definition symbol_bit_decoder.h:14
bool DecodeNextBit()
Definition symbol_bit_decoder.cc:23
void DecodeLeastSignificantBits32(int nbits, uint32_t *value)
Definition symbol_bit_decoder.cc:30
void EndDecoding()
Definition symbol_bit_decoder.h:26
bool StartDecoding(DecoderBuffer *source_buffer)
Definition symbol_bit_decoder.cc:9
Definition attribute_octahedron_transform.cc:21