KASKADE 7 development version
|
A simple alphabet of symbols with frequencies to be used with the range coder. More...
#include <rangecoder.hh>
A simple alphabet of symbols with frequencies to be used with the range coder.
The symbols are consecutive integers 0..(size()-1). The half-open ranges associated to the symbols are derived from given frequencies of the symbols.
Definition at line 342 of file rangecoder.hh.
Public Member Functions | |
template<class InIter > | |
Alphabet (InIter first, InIter last) | |
template<class InIter > | |
void | update (InIter first, InIter last) |
Modifies the symbols' half-open ranges to represent the symbols' frequencies given in the range [first,last[. More... | |
UInt | totalRange () const |
Returns the total range, i.e. the maximum upper range bound of any symbol in the alphabet. More... | |
UInt | size () const |
Returns the number of symbols in the alphabet. More... | |
UInt | symbol (UInt value) const |
Returns the symbol that contains the given value. More... | |
std::pair< UInt, UInt > | range (UInt symbol) const |
Returns the symbol's half-open cumulative frequency range. More... | |
|
inline |
Constructs an alphabet from a sequence of frequencies of symbols. Note that for each symbol the frequency must be larger than 0.
Definition at line 350 of file rangecoder.hh.
|
inline |
Returns the symbol's half-open cumulative frequency range.
Definition at line 403 of file rangecoder.hh.
Referenced by RangeDecoder< UInt >::decodeSymbol(), and RangeEncoder< UInt >::encodeSymbol().
|
inline |
Returns the number of symbols in the alphabet.
Definition at line 383 of file rangecoder.hh.
Referenced by LossyStorage< Grid, VariableSet, Space, QuantizationPolicy >::decode(), LossyStorage< Grid, VariableSet, Space, QuantizationPolicy >::encode(), Alphabet< UInt >::range(), and Alphabet< UInt >::update().
|
inline |
Returns the symbol that contains the given value.
Definition at line 391 of file rangecoder.hh.
Referenced by RangeDecoder< UInt >::decodeSymbol(), and Alphabet< UInt >::range().
|
inline |
Returns the total range, i.e. the maximum upper range bound of any symbol in the alphabet.
Definition at line 375 of file rangecoder.hh.
Referenced by RangeDecoder< UInt >::decodeSymbol(), and RangeEncoder< UInt >::encodeSymbol().
|
inline |
Modifies the symbols' half-open ranges to represent the symbols' frequencies given in the range [first,last[.
Note that for each symbol the frequency must be larger than 0. The length of the given sequence must match the size of the alphabet.
Definition at line 365 of file rangecoder.hh.
Referenced by LossyStorage< Grid, VariableSet, Space, QuantizationPolicy >::decode(), and LossyStorage< Grid, VariableSet, Space, QuantizationPolicy >::encode().