]> wimlib.net Git - wimlib/blob - include/wimlib/lzms_constants.h
aa22aaf297b946c41dcae148c9f76be042d1dbd8
[wimlib] / include / wimlib / lzms_constants.h
1 /*
2  * lzms_constants.h
3  *
4  * Constants for the LZMS compression format.
5  */
6
7 #ifndef _LZMS_CONSTANTS_H
8 #define _LZMS_CONSTANTS_H
9
10 #define LZMS_MIN_MATCH_LEN                      1
11 #define LZMS_MAX_MATCH_LEN                      1073809578
12 #define LZMS_MAX_MATCH_OFFSET                   1180427428
13 #define LZMS_MAX_BUFFER_SIZE                    (LZMS_MAX_MATCH_OFFSET + 1)
14
15 #define LZMS_NUM_RECENT_OFFSETS                 3
16 #define LZMS_MAX_INIT_RECENT_OFFSET             (LZMS_NUM_RECENT_OFFSETS + 1)
17 #define LZMS_OFFSET_OFFSET                      (LZMS_NUM_RECENT_OFFSETS - 1)
18
19 #define LZMS_PROBABILITY_BITS                   6
20 #define LZMS_PROBABILITY_MAX                    (1U << LZMS_PROBABILITY_BITS)
21 #define LZMS_INITIAL_PROBABILITY                48
22 #define LZMS_INITIAL_RECENT_BITS                0x0000000055555555ULL
23
24 #define LZMS_NUM_MAIN_STATES                    16
25 #define LZMS_NUM_MATCH_STATES                   32
26 #define LZMS_NUM_LZ_MATCH_STATES                64
27 #define LZMS_NUM_LZ_REPEAT_MATCH_STATES         64
28 #define LZMS_NUM_DELTA_MATCH_STATES             64
29 #define LZMS_NUM_DELTA_REPEAT_MATCH_STATES      64
30 #define LZMS_MAX_NUM_STATES                     64
31
32 #define LZMS_NUM_LITERAL_SYMS                   256
33 #define LZMS_NUM_LENGTH_SYMS                    54
34 #define LZMS_NUM_DELTA_POWER_SYMS               8
35 #define LZMS_MAX_NUM_OFFSET_SYMS                799
36 #define LZMS_MAX_NUM_SYMS                       799
37
38 #define LZMS_MAX_CODEWORD_LEN                   15
39
40 #define LZMS_LITERAL_CODE_REBUILD_FREQ          1024
41 #define LZMS_LZ_OFFSET_CODE_REBUILD_FREQ        1024
42 #define LZMS_LENGTH_CODE_REBUILD_FREQ           512
43 #define LZMS_DELTA_OFFSET_CODE_REBUILD_FREQ     1024
44 #define LZMS_DELTA_POWER_CODE_REBUILD_FREQ      512
45
46 #define LZMS_X86_ID_WINDOW_SIZE                 65535
47 #define LZMS_X86_MAX_TRANSLATION_OFFSET         1023
48
49 #endif /* _LZMS_CONSTANTS_H */