]> wimlib.net Git - wimlib/blob - src/lzx-common.c
--disable-verify-compression by default
[wimlib] / src / lzx-common.c
1 #include "lzx.h"
2
3 #ifdef USE_LZX_EXTRA_BITS_ARRAY
4 /* LZX uses what it calls 'position slots' to represent match offsets.
5  * What this means is that a small 'position slot' number and a small
6  * offset from that slot are encoded instead of one large offset for
7  * every match.
8  * - lzx_position_base is an index to the position slot bases
9  * - lzx_extra_bits states how many bits of offset-from-base data is needed.
10  */
11 const u8 lzx_extra_bits[LZX_NUM_POSITION_SLOTS] = {
12         0 , 0 , 0 , 0 , 1 ,
13         1 , 2 , 2 , 3 , 3 ,
14         4 , 4 , 5 , 5 , 6 ,
15         6 , 7 , 7 , 8 , 8 ,
16         9 , 9 , 10, 10, 11,
17         11, 12, 12, 13, 13,
18         /*14, 14, 15, 15, 16,*/
19         /*16, 17, 17, 17, 17,*/
20         /*17, 17, 17, 17, 17,*/
21         /*17, 17, 17, 17, 17,*/
22         /*17*/
23 };
24 #endif
25
26 const u32 lzx_position_base[LZX_NUM_POSITION_SLOTS] = {
27         0      , 1      , 2      , 3      , 4      ,
28         6      , 8      , 12     , 16     , 24     ,
29         32     , 48     , 64     , 96     , 128    ,
30         192    , 256    , 384    , 512    , 768    ,
31         1024   , 1536   , 2048   , 3072   , 4096   ,
32         6144   , 8192   , 12288  , 16384  , 24576  ,
33         /*32768  , 49152  , 65536  , 98304  , 131072 ,*/
34         /*196608 , 262144 , 393216 , 524288 , 655360 ,*/
35         /*786432 , 917504 , 1048576, 1179648, 1310720,*/
36         /*1441792, 1572864, 1703936, 1835008, 1966080,*/
37         /*2097152*/
38 };
39