Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
#include <coder.hpp>
Inheritance diagram for OctaneCoder:
During decompression, the coder is responsible for reading bitcodes from the input and providing a stream of symbol numbers to the compressor.
Definition at line 50 of file coder.hpp.
Public Member Functions | |
OctaneCoder () | |
constructor | |
virtual | ~OctaneCoder () |
destructor | |
virtual std::string | GetName () |
provide a unique name for the coder, used in some cases to automatically register the object with a manager | |
virtual std::string | GetDescription () |
optionally provide a longer (maybe 20-60 characters) description | |
virtual std::string | GetHelpInformation () |
optionally provide more information about the object on request for help | |
virtual bool | WriteSymbolBits (int symbolnum, bitwriter &bw)=0 |
write bits for symbol number | |
virtual bool | DecodeSymbolFromInput (int &symbolnum, bitreader &br)=0 |
Decode the next symbol from the input. | |
virtual void | ResetState () |
virtual void | SynchronizeStateForNewStream () |
Synchronize state for a new stream - this *MUST* be called before beginning a new parsing stream. | |
virtual bool | PrepareForCoding (OctaneModeler *modelerp) |
Prepare for coding mode; returns true on success. | |
virtual bool | IsReadyToCode () |
Are we ready to actually code and decode? | |
virtual void | ReceiveNotification_ModelChange_AllSymbolWeights (OctaneModeler *modelerp) |
Notify coder that all probabilities are being updated. | |
virtual void | ReceiveNotification_ModelChange_SingleSymbolWeight (OctaneModeler *modelerp, int symbolnum) |
notify that a single symbol probability has changed (by default just calls AllSymbolWeights change above) | |
void | AlignOutputStreamToByteBoundry (bitwriter &bw) |
Align output stream - called after writing an End-of-stream symbol This throws away any spare bits in the output which are not aligned on a byte boundary. | |
void | AlignInputStreamToByteBoundry (bitreader &br) |
Align input stream - called after reading an End-of-stream symbol This throws away any spare bits in the output which are not aligned on a byte boundary. |
|
provide a unique name for the coder, used in some cases to automatically register the object with a manager
Reimplemented from OctaneClass. Reimplemented in HuffmanCoder, and SampleCoder. Definition at line 60 of file coder.hpp.
00060 {return "OctaneCoder";} |
|
optionally provide a longer (maybe 20-60 characters) description
Reimplemented from OctaneClass. Reimplemented in HuffmanCoder, and SampleCoder. Definition at line 61 of file coder.hpp.
00061 {return "Base Coder";} |
|
optionally provide more information about the object on request for help
Reimplemented from OctaneClass. Reimplemented in HuffmanCoder, and SampleCoder. Definition at line 62 of file coder.hpp. Referenced by OctaneCompressor_Statistical::GetHelpInformation().
00062 { return ""; } |
|
write bits for symbol number
Implemented in HuffmanCoder, and SampleCoder. Referenced by OctaneCompressor_Statistical::DoProtectedCompress(). |
|
Decode the next symbol from the input.
Implemented in HuffmanCoder, and SampleCoder. Referenced by OctaneCompressor_Statistical::DoProtectedDecompress(). |
|
Prepare for coding mode; returns true on success.
Definition at line 82 of file coder.hpp. Referenced by OctaneCompressor_Statistical::PrepareForCompression().
00082 {return true;}; |
|
Are we ready to actually code and decode?
Reimplemented in HuffmanCoder, and SampleCoder. Definition at line 85 of file coder.hpp. Referenced by OctaneCompressor_Statistical::IsReadyToCompress().
00085 {return true;}; |
|
Notify coder that all probabilities are being updated. We can be informed by a model when the underlying probabilities are changing this part of the API exists so that we can flexibly and efficiently handle different kinds of situations where the coder needs to be synchronized with the model probabilities. in some cases, a coder may ignore these messages and simply rebuild its internal datastructure on each coding event in other cases, it will want to incrementally update as model changes. Two kinds of notifications are supported, depending on how the model updates itself during processing, whether it updates one symbol per iteration, or modifies all symbols at once. Reimplemented in HuffmanCoder, and SampleCoder. Definition at line 101 of file coder.hpp. Referenced by OctaneCompressor_Statistical::DoProtectedCreateSymbolsAndModelsUsingStream(), OctaneCompressor_Statistical::DoProtectedLoadState(), ReceiveNotification_ModelChange_SingleSymbolWeight(), and OctaneCompressor_Statistical::SetupAnyDefaultParser().
00101 {;}; |
|
notify that a single symbol probability has changed (by default just calls AllSymbolWeights change above)
Reimplemented in HuffmanCoder. Definition at line 105 of file coder.hpp. References ReceiveNotification_ModelChange_AllSymbolWeights().
00105 {ReceiveNotification_ModelChange_AllSymbolWeights(modelerp);}; |
|
Align output stream - called after writing an End-of-stream symbol This throws away any spare bits in the output which are not aligned on a byte boundary. This is required when we hit and end of stream symbol, to avoid treating leftover bits as meaningful symbols.
Definition at line 113 of file coder.hpp. References bitwriter::align_byte(). Referenced by OctaneCompressor_Statistical::DoProtectedCompress().
00113 {bw.align_byte();}; |
|
Align input stream - called after reading an End-of-stream symbol This throws away any spare bits in the output which are not aligned on a byte boundary. This is required when we hit and end of stream symbol, to avoid treating leftover bits as meaningful symbols.
Definition at line 118 of file coder.hpp. References bitreader::align_byte(). Referenced by OctaneCompressor_Statistical::DoProtectedDecompress().
00118 {br.align_byte();}; |