1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
// File: lzham_lzdecompbase.h
// See Copyright Notice and license at the end of include/lzham.h
#pragma once
//#define LZHAM_LZDEBUG
#define LZHAM_IS_MATCH_MODEL_INDEX(cur_state) (cur_state)
namespace lzham
{
struct table_update_settings
{
uint16 m_max_update_interval;
uint16 m_slow_rate;
};
extern table_update_settings g_table_update_settings[];
struct CLZDecompBase
{
enum
{
cMinMatchLen = 2U,
cMaxMatchLen = 257U,
cMaxHugeMatchLen = 65536,
cMinDictSizeLog2 = 15,
cMaxDictSizeLog2 = 29,
cMatchHistSize = 4,
cMaxLen2MatchDist = 2047
};
enum
{
cLZXNumSecondaryLengths = 249,
cNumHugeMatchCodes = 1,
cMaxHugeMatchCodeBits = 16,
cLZXNumSpecialLengths = 2,
cLZXLowestUsableMatchSlot = 1,
cLZXMaxPositionSlots = 128
};
enum
{
cLZXSpecialCodeEndOfBlockCode = 0,
cLZXSpecialCodePartialStateReset = 1
};
enum
{
cLZHAMDebugSyncMarkerValue = 666,
cLZHAMDebugSyncMarkerBits = 12
};
enum
{
cBlockHeaderBits = 2,
cBlockCheckBits = 4,
cBlockFlushTypeBits = 2,
cSyncBlock = 0,
cCompBlock = 1,
cRawBlock = 2,
cEOFBlock = 3
};
enum
{
cNumStates = 12,
cNumLitStates = 7,
};
uint m_dict_size_log2;
uint m_dict_size;
uint m_num_lzx_slots;
static uint m_lzx_position_base[cLZXMaxPositionSlots];
static uint m_lzx_position_extra_mask[cLZXMaxPositionSlots];
static uint8 m_lzx_position_extra_bits[cLZXMaxPositionSlots];
void init_position_slots(uint dict_size_log2);
};
} // namespace lzham
|