GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
adaptive_rans_bit_decoder.h
Go to the documentation of this file.
1// Copyright 2016 The Draco Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// File provides basic classes and functions for rANS bit decoding.
16#ifndef DRACO_COMPRESSION_BIT_CODERS_ADAPTIVE_RANS_BIT_DECODER_H_
17#define DRACO_COMPRESSION_BIT_CODERS_ADAPTIVE_RANS_BIT_DECODER_H_
18
19#include <vector>
20
23
24namespace draco {
25
26// Class for decoding a sequence of bits that were encoded with
27// AdaptiveRAnsBitEncoder.
29 public:
32
33 // Sets |source_buffer| as the buffer to decode bits from.
34 bool StartDecoding(DecoderBuffer *source_buffer);
35
36 // Decode one bit. Returns true if the bit is a 1, otherwise false.
37 bool DecodeNextBit();
38
39 // Decode the next |nbits| and return the sequence in |value|. |nbits| must be
40 // > 0 and <= 32.
41 void DecodeLeastSignificantBits32(int nbits, uint32_t *value);
42
43 void EndDecoding() {}
44
45 private:
46 void Clear();
47
48 AnsDecoder ans_decoder_;
49 double p0_f_;
50};
51
52} // namespace draco
53
54#endif // DRACO_COMPRESSION_BIT_CODERS_ADAPTIVE_RANS_BIT_DECODER_H_
bool StartDecoding(DecoderBuffer *source_buffer)
Definition adaptive_rans_bit_decoder.cc:27
void DecodeLeastSignificantBits32(int nbits, uint32_t *value)
Definition adaptive_rans_bit_decoder.cc:54
~AdaptiveRAnsBitDecoder()
Definition adaptive_rans_bit_decoder.cc:25
bool DecodeNextBit()
Definition adaptive_rans_bit_decoder.cc:47
AdaptiveRAnsBitDecoder()
Definition adaptive_rans_bit_decoder.cc:23
void EndDecoding()
Definition adaptive_rans_bit_decoder.h:43
Definition decoder_buffer.h:30
Definition attribute_octahedron_transform.cc:21
Definition ans.h:55