Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
#include <zeroorder_modeler.hpp>
Inheritance diagram for ZeroOrderModeler:
Definition at line 28 of file zeroorder_modeler.hpp.
Public Member Functions | |
ZeroOrderModeler () | |
constructor | |
virtual | ~ZeroOrderModeler () |
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 bool | CreateModelUsingStream (OctaneParser *parserp, bitreader &from) |
Build a model using a stream and a parser. |
|
provide a unique name for the coder, used in some cases to automatically register the object with a manager
Reimplemented from OctaneModeler_WeightVectored. Definition at line 38 of file zeroorder_modeler.hpp.
00038 {return "ZeroOrderModeler";} |
|
optionally provide a longer (maybe 20-60 characters) description
Reimplemented from OctaneModeler_WeightVectored. Definition at line 39 of file zeroorder_modeler.hpp.
00039 {return "Zero-order Modeler";} |
|
Build a model using a stream and a parser.
Reimplemented from OctaneModeler. Definition at line 19 of file zeroorder_modeler.cpp. References SymbolWeightVector::CountSymbolFrequencies(), SymbolWeightVector::EnforceZeroCountFloor(), SymbolWeightVector::NormalizeToProbabilityDistribution(), and OctaneModeler_WeightVectored::weightvector.
00020 { 00021 // build a model of frequencies 00022 bool bretv; 00023 00024 // calculate symbol frequencies, by asking the weightvector to do our dirty work in conjunction with the parser 00025 bretv=weightvector.CountSymbolFrequencies(parserp,from); 00026 00027 // make sure no symbol has freq count == 0 which would break huffman coder and others 00028 weightvector.EnforceZeroCountFloor(1); 00029 00030 // normalize to probability distribution 00031 weightvector.NormalizeToProbabilityDistribution(); 00032 00033 // success 00034 return bretv; 00035 } |