1 // Lzx.h 2 3 #ifndef ZIP7_INC_COMPRESS_LZX_H 4 #define ZIP7_INC_COMPRESS_LZX_H 5 6 #include "../../Common/MyTypes.h" 7 8 namespace NCompress { 9 namespace NLzx { 10 11 const unsigned kBlockType_NumBits = 3; 12 const unsigned kBlockType_Verbatim = 1; 13 const unsigned kBlockType_Aligned = 2; 14 const unsigned kBlockType_Uncompressed = 3; 15 16 const unsigned kNumHuffmanBits = 16; 17 const unsigned kNumReps = 3; 18 19 const unsigned kNumLenSlots = 8; 20 const unsigned kMatchMinLen = 2; 21 const unsigned kNumLenSymbols = 249; 22 const unsigned kMatchMaxLen = kMatchMinLen + (kNumLenSlots - 1) + kNumLenSymbols - 1; 23 24 const unsigned kNumAlignLevelBits = 3; 25 const unsigned kNumAlignBits = 3; 26 const unsigned kAlignTableSize = 1 << kNumAlignBits; 27 28 const unsigned kNumPosSlots = 50; 29 const unsigned kNumPosLenSlots = kNumPosSlots * kNumLenSlots; 30 31 const unsigned kMainTableSize = 256 + kNumPosLenSlots; 32 const unsigned kLevelTableSize = 20; 33 const unsigned kMaxTableSize = kMainTableSize; 34 35 const unsigned kNumLevelBits = 4; 36 37 const unsigned kLevelSym_Zero1 = 17; 38 const unsigned kLevelSym_Zero2 = 18; 39 const unsigned kLevelSym_Same = 19; 40 41 const unsigned kLevelSym_Zero1_Start = 4; 42 const unsigned kLevelSym_Zero1_NumBits = 4; 43 44 const unsigned kLevelSym_Zero2_Start = kLevelSym_Zero1_Start + (1 << kLevelSym_Zero1_NumBits); 45 const unsigned kLevelSym_Zero2_NumBits = 5; 46 47 const unsigned kLevelSym_Same_NumBits = 1; 48 const unsigned kLevelSym_Same_Start = 4; 49 50 const unsigned kNumDictBits_Min = 15; 51 const unsigned kNumDictBits_Max = 21; 52 const UInt32 kDictSize_Max = (UInt32)1 << kNumDictBits_Max; 53 54 const unsigned kNumLinearPosSlotBits = 17; 55 // const unsigned kNumPowerPosSlots = 38; 56 // const unsigned kNumPowerPosSlots = (kNumLinearPosSlotBits + 1) * 2; // non-including two first linear slots. 57 const unsigned kNumPowerPosSlots = (kNumLinearPosSlotBits + 2) * 2; // including two first linear slots. 58 59 }} 60 61 #endif 62