Imported Upstream version 9.20
[platform/upstream/7zip.git] / CPP / 7zip / Compress / Lzx.h
1 // Lzx.h\r
2 \r
3 #ifndef __COMPRESS_LZX_H\r
4 #define __COMPRESS_LZX_H\r
5 \r
6 namespace NCompress {\r
7 namespace NLzx {\r
8 \r
9 const unsigned kNumHuffmanBits = 16;\r
10 const UInt32 kNumRepDistances = 3;\r
11 \r
12 const UInt32 kNumLenSlots = 8;\r
13 const UInt32 kMatchMinLen = 2;\r
14 const UInt32 kNumLenSymbols = 249;\r
15 const UInt32 kMatchMaxLen = kMatchMinLen + (kNumLenSlots - 1) + kNumLenSymbols - 1;\r
16 \r
17 const unsigned kNumAlignBits = 3;\r
18 const UInt32 kAlignTableSize = 1 << kNumAlignBits;\r
19 \r
20 const UInt32 kNumPosSlots = 50;\r
21 const UInt32 kNumPosLenSlots = kNumPosSlots * kNumLenSlots;\r
22 \r
23 const UInt32 kMainTableSize = 256 + kNumPosLenSlots;\r
24 const UInt32 kLevelTableSize = 20;\r
25 const UInt32 kMaxTableSize = kMainTableSize;\r
26 \r
27 const unsigned kNumBlockTypeBits = 3;\r
28 const unsigned kBlockTypeVerbatim = 1;\r
29 const unsigned kBlockTypeAligned = 2;\r
30 const unsigned kBlockTypeUncompressed = 3;\r
31 \r
32 const unsigned kUncompressedBlockSizeNumBits = 24;\r
33 \r
34 const unsigned kNumBitsForPreTreeLevel = 4;\r
35 \r
36 const unsigned kLevelSymbolZeros = 17;\r
37 const unsigned kLevelSymbolZerosBig = 18;\r
38 const unsigned kLevelSymbolSame = 19;\r
39 \r
40 const unsigned kLevelSymbolZerosStartValue = 4;\r
41 const unsigned kLevelSymbolZerosNumBits = 4;\r
42 \r
43 const unsigned kLevelSymbolZerosBigStartValue = kLevelSymbolZerosStartValue +\r
44     (1 << kLevelSymbolZerosNumBits);\r
45 const unsigned kLevelSymbolZerosBigNumBits = 5;\r
46 \r
47 const unsigned kLevelSymbolSameNumBits = 1;\r
48 const unsigned kLevelSymbolSameStartValue = 4;\r
49 \r
50 const unsigned kNumBitsForAlignLevel = 3;\r
51   \r
52 const unsigned kNumDictionaryBitsMin = 15;\r
53 const unsigned kNumDictionaryBitsMax = 21;\r
54 const UInt32 kDictionarySizeMax = (1 << kNumDictionaryBitsMax);\r
55 \r
56 const unsigned kNumLinearPosSlotBits = 17;\r
57 const UInt32 kNumPowerPosSlots = 0x26;\r
58 \r
59 }}\r
60 \r
61 #endif\r