3 #ifndef __COMPRESS_ARJ_DECODER1_H
\r
4 #define __COMPRESS_ARJ_DECODER1_H
\r
6 #include "../../Common/MyCom.h"
\r
8 #include "../ICoder.h"
\r
10 #include "../Common/InBuffer.h"
\r
12 #include "BitmDecoder.h"
\r
13 #include "LzOutWindow.h"
\r
15 namespace NCompress {
\r
17 namespace NDecoder1 {
\r
22 #define DDICSIZ 26624
\r
23 #define MAXDICBIT 16
\r
25 #define MAXMATCH 256
\r
26 #define NC (0xFF + MAXMATCH + 2 - THRESHOLD)
\r
27 #define NP (MAXDICBIT + 1)
\r
29 #define NT (CODE_BIT + 3)
\r
39 #define CTABLESIZE 4096
\r
40 #define PTABLESIZE 256
\r
44 public ICompressCoder,
\r
45 public CMyUnknownImp
\r
47 CLzOutWindow m_OutWindowStream;
\r
48 NBitm::CDecoder<CInBuffer> m_InBitStream;
\r
50 UInt32 left[2 * NC - 1];
\r
51 UInt32 right[2 * NC - 1];
\r
55 UInt32 c_table[CTABLESIZE];
\r
56 UInt32 pt_table[PTABLESIZE];
\r
58 void ReleaseStreams()
\r
60 m_OutWindowStream.ReleaseStream();
\r
61 m_InBitStream.ReleaseStream();
\r
64 class CCoderReleaser
\r
69 CCoderReleaser(CCoder *coder): m_Coder(coder), NeedFlush(true) {}
\r
73 m_Coder->m_OutWindowStream.Flush();
\r
74 m_Coder->ReleaseStreams();
\r
77 friend class CCoderReleaser;
\r
79 void MakeTable(int nchar, Byte *bitlen, int tablebits, UInt32 *table, int tablesize);
\r
82 void read_pt_len(int nn, int nbit, int i_special);
\r
86 HRESULT CodeReal(ISequentialInStream *inStream, ISequentialOutStream *outStream,
\r
87 const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
\r
91 STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
\r
92 const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
\r