Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
#include <samplecoder.hpp>
Inheritance diagram for SampleCoder:
It simply outputs the symbol number as the binary contents of a c int type (4 byes), ignoring any information about modeler probabilities.
Definition at line 32 of file samplecoder.hpp.
Public Member Functions | |
SampleCoder () | |
constructor | |
virtual | ~SampleCoder () |
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 void | ShowDebuggingInfo () |
show any debugging info on request (used by various derived classes) [optional] | |
virtual unsigned int | GetMemoryUsed () |
Report actual current memory usage (in bytes). | |
virtual bool | WriteSymbolBits (int symbolnum, bitwriter &bw) |
write bits for symbol number | |
virtual bool | DecodeSymbolFromInput (int &symbolnum, bitreader &br) |
Decode the next symbol from the input. | |
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. |
|
provide a unique name for the coder, used in some cases to automatically register the object with a manager
Reimplemented from OctaneCoder. Definition at line 42 of file samplecoder.hpp.
00042 {return "SampleCoder";} |
|
optionally provide a longer (maybe 20-60 characters) description
Reimplemented from OctaneCoder. Definition at line 43 of file samplecoder.hpp.
00043 {return "Sample Coder";} |
|
optionally provide more information about the object on request for help
Reimplemented from OctaneCoder. Definition at line 44 of file samplecoder.hpp.
00044 { return ""; } |
|
write bits for symbol number
Implements OctaneCoder. Definition at line 19 of file samplecoder.cpp. References bitwriter::put().
00020 { 00021 // write compressed output for symbol specified 00022 // return true on success 00023 00024 // for our sample coder, we will just write the raw binary data in an int 00025 bw.put(symbolnum); 00026 00027 // return success 00028 return true; 00029 } |
|
Decode the next symbol from the input.
Implements OctaneCoder. Definition at line 31 of file samplecoder.cpp. References bitreader::empty(), and bitreader::get().
00032 { 00033 // decode a symbol from the input 00034 // return false on no symbols left in stream (or error) 00035 00036 // input is empty yet? 00037 if (br.empty()) 00038 return false; 00039 00040 // for our sample coder, we just read the binary data for an int 00041 br.get(symbolnum); 00042 00043 // return success 00044 return true; 00045 } |
|
Are we ready to actually code and decode?
Reimplemented from OctaneCoder. Definition at line 61 of file samplecoder.hpp.
00061 {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 from OctaneCoder. Definition at line 66 of file samplecoder.hpp.
00066 {;}; |