DCCL v4
Loading...
Searching...
No Matches
dccl::arith::Model Class Reference

Public Types

enum  ModelState { ENCODER , DECODER }
 
typedef uint32 freq_type
 
using symbol_type = int
 
using value_type = double
 

Public Member Functions

 Model (protobuf::ArithmeticModel user)
 
symbol_type value_to_symbol (value_type value) const
 
value_type symbol_to_value (symbol_type symbol) const
 
symbol_type total_symbols ()
 
const protobuf::ArithmeticModeluser_model () const
 
symbol_type max_symbol () const
 
freq_type total_freq (ModelState state) const
 
void update_model (symbol_type symbol, ModelState state)
 
std::pair< freq_type, freq_type > symbol_to_cumulative_freq (symbol_type symbol, ModelState state) const
 
std::pair< symbol_type, symbol_type > cumulative_freq_to_symbol (std::pair< freq_type, freq_type > c_freq_pair, ModelState state) const
 

Static Public Attributes

static constexpr symbol_type OUT_OF_RANGE_SYMBOL = -1
 
static constexpr symbol_type EOF_SYMBOL = -2
 
static constexpr symbol_type MIN_SYMBOL = EOF_SYMBOL
 
static constexpr int CODE_VALUE_BITS = 32
 
static constexpr int FREQUENCY_BITS = CODE_VALUE_BITS - 2
 
static constexpr freq_type MAX_FREQUENCY = (1 << FREQUENCY_BITS) - 1
 
static std::map< std::string, std::map< std::string, Bitset > > last_bits_map
 

Friends

class ModelManager
 

Detailed Description

Definition at line 60 of file field_codec_arithmetic.h.

Member Typedef Documentation

◆ freq_type

typedef uint32 dccl::arith::Model::freq_type

Definition at line 63 of file field_codec_arithmetic.h.

◆ symbol_type

using dccl::arith::Model::symbol_type = int

Definition at line 64 of file field_codec_arithmetic.h.

◆ value_type

using dccl::arith::Model::value_type = double

Definition at line 65 of file field_codec_arithmetic.h.

Member Enumeration Documentation

◆ ModelState

enum dccl::arith::Model::ModelState

Definition at line 88 of file field_codec_arithmetic.h.

Constructor & Destructor Documentation

◆ Model()

dccl::arith::Model::Model ( protobuf::ArithmeticModel  user)
inline

Definition at line 86 of file field_codec_arithmetic.h.

Member Function Documentation

◆ cumulative_freq_to_symbol()

std::pair< dccl::arith::Model::symbol_type, dccl::arith::Model::symbol_type > dccl::arith::Model::cumulative_freq_to_symbol ( std::pair< freq_type, freq_type >  c_freq_pair,
ModelState  state 
) const

Definition at line 161 of file field_codec_arithmetic.cpp.

◆ max_symbol()

symbol_type dccl::arith::Model::max_symbol ( ) const
inline

Definition at line 103 of file field_codec_arithmetic.h.

◆ symbol_to_cumulative_freq()

std::pair< dccl::arith::Model::freq_type, dccl::arith::Model::freq_type > dccl::arith::Model::symbol_to_cumulative_freq ( symbol_type  symbol,
ModelState  state 
) const

Definition at line 140 of file field_codec_arithmetic.cpp.

◆ symbol_to_value()

dccl::arith::Model::value_type dccl::arith::Model::symbol_to_value ( symbol_type  symbol) const

Definition at line 127 of file field_codec_arithmetic.cpp.

◆ total_freq()

freq_type dccl::arith::Model::total_freq ( ModelState  state) const
inline

Definition at line 105 of file field_codec_arithmetic.h.

◆ total_symbols()

symbol_type dccl::arith::Model::total_symbols ( )
inline

Definition at line 96 of file field_codec_arithmetic.h.

◆ update_model()

void dccl::arith::Model::update_model ( symbol_type  symbol,
ModelState  state 
)

Definition at line 196 of file field_codec_arithmetic.cpp.

◆ user_model()

const protobuf::ArithmeticModel & dccl::arith::Model::user_model ( ) const
inline

Definition at line 101 of file field_codec_arithmetic.h.

◆ value_to_symbol()

dccl::arith::Model::symbol_type dccl::arith::Model::value_to_symbol ( value_type  value) const

Definition at line 102 of file field_codec_arithmetic.cpp.

Friends And Related Symbol Documentation

◆ ModelManager

friend class ModelManager
friend

Definition at line 120 of file field_codec_arithmetic.h.

Member Data Documentation

◆ CODE_VALUE_BITS

const int dccl::arith::Model::CODE_VALUE_BITS = 32
staticconstexpr

Definition at line 71 of file field_codec_arithmetic.h.

◆ EOF_SYMBOL

const dccl::arith::Model::symbol_type dccl::arith::Model::EOF_SYMBOL = -2
staticconstexpr

Definition at line 68 of file field_codec_arithmetic.h.

◆ FREQUENCY_BITS

const int dccl::arith::Model::FREQUENCY_BITS = CODE_VALUE_BITS - 2
staticconstexpr

Definition at line 72 of file field_codec_arithmetic.h.

◆ last_bits_map

std::map< std::string, std::map< std::string, dccl::Bitset > > dccl::arith::Model::last_bits_map
static

Definition at line 84 of file field_codec_arithmetic.h.

◆ MAX_FREQUENCY

const dccl::arith::Model::freq_type dccl::arith::Model::MAX_FREQUENCY = (1 << FREQUENCY_BITS) - 1
staticconstexpr

Definition at line 74 of file field_codec_arithmetic.h.

◆ MIN_SYMBOL

const dccl::arith::Model::symbol_type dccl::arith::Model::MIN_SYMBOL = EOF_SYMBOL
staticconstexpr

Definition at line 69 of file field_codec_arithmetic.h.

◆ OUT_OF_RANGE_SYMBOL

const dccl::arith::Model::symbol_type dccl::arith::Model::OUT_OF_RANGE_SYMBOL = -1
staticconstexpr

Definition at line 67 of file field_codec_arithmetic.h.


The documentation for this class was generated from the following files: