rlm@1: // ImplodeDecoder.h rlm@1: rlm@1: #ifndef __COMPRESS_IMPLODE_DECODER_H rlm@1: #define __COMPRESS_IMPLODE_DECODER_H rlm@1: rlm@1: #include "../../Common/MyCom.h" rlm@1: rlm@1: #include "../ICoder.h" rlm@1: rlm@1: #include "ImplodeHuffmanDecoder.h" rlm@1: #include "LzOutWindow.h" rlm@1: rlm@1: namespace NCompress { rlm@1: namespace NImplode { rlm@1: namespace NDecoder { rlm@1: rlm@1: class CCoder: rlm@1: public ICompressCoder, rlm@1: public ICompressSetDecoderProperties2, rlm@1: public CMyUnknownImp rlm@1: { rlm@1: CLzOutWindow m_OutWindowStream; rlm@1: NBitl::CDecoder m_InBitStream; rlm@1: rlm@1: NImplode::NHuffman::CDecoder m_LiteralDecoder; rlm@1: NImplode::NHuffman::CDecoder m_LengthDecoder; rlm@1: NImplode::NHuffman::CDecoder m_DistanceDecoder; rlm@1: rlm@1: bool m_BigDictionaryOn; rlm@1: bool m_LiteralsOn; rlm@1: rlm@1: int m_NumDistanceLowDirectBits; rlm@1: UInt32 m_MinMatchLength; rlm@1: rlm@1: bool ReadLevelItems(NImplode::NHuffman::CDecoder &table, Byte *levels, int numLevelItems); rlm@1: bool ReadTables(); rlm@1: void DeCodeLevelTable(Byte *newLevels, int numLevels); rlm@1: public: rlm@1: CCoder(); rlm@1: rlm@1: MY_UNKNOWN_IMP1(ICompressSetDecoderProperties2) rlm@1: rlm@1: void ReleaseStreams(); rlm@1: HRESULT Flush() { return m_OutWindowStream.Flush(); } rlm@1: rlm@1: HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream, rlm@1: const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); rlm@1: rlm@1: STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream, rlm@1: const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress); rlm@1: rlm@1: STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size); rlm@1: }; rlm@1: rlm@1: }}} rlm@1: rlm@1: #endif