Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
00001 00002 00003 00004 00005 00006 00007 00008 00009 //--------------------------------------------------------------------------- 00010 00018 00019 //--------------------------------------------------------------------------- 00020 // forward declarations 00021 class OctaneCoder; 00022 //--------------------------------------------------------------------------- 00023 00024 //--------------------------------------------------------------------------- 00025 // recursive header protection 00026 #ifndef CoderH 00027 #define CoderH 00028 //--------------------------------------------------------------------------- 00029 00030 //--------------------------------------------------------------------------- 00031 // application includes 00032 #include "../bitio/bitio.hpp" 00033 #include "../core/octaneclass.hpp" 00034 #include "../modelers/modeler.hpp" 00035 // system includes 00036 //--------------------------------------------------------------------------- 00037 00038 00039 00040 00041 //--------------------------------------------------------------------------- 00050 class OctaneCoder : public OctaneClass 00051 { 00052 public: 00054 OctaneCoder() { ; } 00056 virtual ~OctaneCoder() { ; } 00057 public: 00058 //--------------------------------------------------------------------------- 00059 // OCTANE PUBLIC API - RTTI FUNCTIONS - these are supported by all derived classes 00060 virtual std::string GetName() {return "OctaneCoder";} 00061 virtual std::string GetDescription() {return "Base Coder";} 00062 virtual std::string GetHelpInformation() { return ""; } 00063 //--------------------------------------------------------------------------- 00064 public: 00065 //--------------------------------------------------------------------------- 00066 // CODER PUBLIC API - PARSING FUNCTIONS 00069 virtual bool WriteSymbolBits(int symbolnum, bitwriter &bw)=0; 00072 virtual bool DecodeSymbolFromInput(int &symbolnum, bitreader &br)=0; 00073 //--------------------------------------------------------------------------- 00074 public: 00075 //--------------------------------------------------------------------------- 00076 // CODER PUBLIC API - STATE PREPARATION 00077 virtual void ResetState() {;}; 00079 virtual void SynchronizeStateForNewStream() {;}; 00082 virtual bool PrepareForCoding(OctaneModeler *modelerp) {return true;}; 00085 virtual bool IsReadyToCode() {return true;}; 00086 //--------------------------------------------------------------------------- 00087 public: 00088 //--------------------------------------------------------------------------- 00089 // CODER PUBLIC API - MODEL CHANGE NOTIFICATION 00101 virtual void ReceiveNotification_ModelChange_AllSymbolWeights(OctaneModeler *modelerp) {;}; 00105 virtual void ReceiveNotification_ModelChange_SingleSymbolWeight(OctaneModeler *modelerp,int symbolnum) {ReceiveNotification_ModelChange_AllSymbolWeights(modelerp);}; 00106 //--------------------------------------------------------------------------- 00107 public: 00108 //--------------------------------------------------------------------------- 00113 void AlignOutputStreamToByteBoundry(bitwriter &bw) {bw.align_byte();}; 00118 void AlignInputStreamToByteBoundry(bitreader &br) {br.align_byte();}; 00119 //--------------------------------------------------------------------------- 00120 }; 00121 //--------------------------------------------------------------------------- 00122 00123 00124 00125 //--------------------------------------------------------------------------- 00126 #endif 00127 //--------------------------------------------------------------------------- 00128