KASKADE 7 development version
|
Entropy coding with range encoder. More...
#include <rangecoder.hh>
Entropy coding with range encoder.
A range encoder. It encodes a sequence of symbols \( (s_i)_i \). See base class RangeCoder for a definition of symbols and alphabets.
Note that the encoding is completed only after destruction of the encoder, since the destructor writes the remaining characters to the output stream.
UInt | an unsigned integral type (usually 32 or 64 bit usigned integer). |
Definition at line 135 of file rangecoder.hh.
Public Member Functions | |
RangeEncoder (std::ostream &out_) | |
~RangeEncoder () | |
Destructor writes the remaining data to the output stream. More... | |
void | push (std::pair< UInt, UInt > s, UInt totalRange) |
Encodes one symbol. More... | |
size_t | size () const |
Number of processed encoded bytes. More... | |
Static Public Attributes | |
static UInt const | maxRange = RangeCoder<UInt>::maxRange |
Protected Attributes | |
UInt | low |
UInt | range |
size_t | count |
Related Functions | |
(Note that these are not member functions.) | |
template<class UInt , class Symbol > | |
void | encodeSymbol (RangeEncoder< UInt > &encoder, Alphabet< UInt > const &alphabet, Symbol const &s) |
A convenience function that encodes a symbol in a range encoder. More... | |
|
inline |
Definition at line 144 of file rangecoder.hh.
|
inline |
Destructor writes the remaining data to the output stream.
Definition at line 151 of file rangecoder.hh.
|
inline |
Encodes one symbol.
Encodes the symbol that covers the half-open range [s.first,s.second[ of the totalRange. totalRange must not exceed maxRange. Characters may be written to the output stream. If the write operation is not successful, this method throws an exception.
See also the convenience function encodeSymbol().
Definition at line 168 of file rangecoder.hh.
Referenced by RangeEncoder< UInt >::encodeSymbol().
|
inlineinherited |
Number of processed encoded bytes.
When encoding, this is the number of bytes already written to the output stream. When decoding, this is the number of bytes already read from the input stream.
Definition at line 100 of file rangecoder.hh.
|
protectedinherited |
Definition at line 114 of file rangecoder.hh.
Referenced by RangeDecoder< UInt >::pop(), RangeDecoder< UInt >::RangeDecoder(), and RangeCoder< UInt >::size().
|
protectedinherited |
Definition at line 113 of file rangecoder.hh.
Referenced by RangeDecoder< UInt >::front(), RangeDecoder< UInt >::pop(), and RangeEncoder< UInt >::push().
|
static |
Definition at line 142 of file rangecoder.hh.
Referenced by RangeEncoder< UInt >::push().
|
protectedinherited |
Definition at line 113 of file rangecoder.hh.
Referenced by RangeDecoder< UInt >::front(), RangeDecoder< UInt >::pop(), and RangeEncoder< UInt >::push().