zstdlib 0.13.0-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +6 -0
- data/CHANGES.md +107 -0
- data/Gemfile +3 -0
- data/README.md +107 -0
- data/Rakefile +59 -0
- data/ext/zstdlib_c/extconf.rb +59 -0
- data/ext/zstdlib_c/ruby/zlib-2.2/zstdlib.c +4675 -0
- data/ext/zstdlib_c/ruby/zlib-2.3/zstdlib.c +4702 -0
- data/ext/zstdlib_c/ruby/zlib-2.4/zstdlib.c +4859 -0
- data/ext/zstdlib_c/ruby/zlib-2.5/zstdlib.c +4864 -0
- data/ext/zstdlib_c/ruby/zlib-2.6/zstdlib.c +4906 -0
- data/ext/zstdlib_c/ruby/zlib-2.7/zstdlib.c +4895 -0
- data/ext/zstdlib_c/ruby/zlib-3.0/zstdlib.c +4994 -0
- data/ext/zstdlib_c/ruby/zlib-3.1/zstdlib.c +5076 -0
- data/ext/zstdlib_c/ruby/zlib-3.2/zstdlib.c +5090 -0
- data/ext/zstdlib_c/ruby/zlib-3.3/zstdlib.c +5090 -0
- data/ext/zstdlib_c/zlib-1.3.1/adler32.c +164 -0
- data/ext/zstdlib_c/zlib-1.3.1/compress.c +75 -0
- data/ext/zstdlib_c/zlib-1.3.1/crc32.c +1049 -0
- data/ext/zstdlib_c/zlib-1.3.1/crc32.h +9446 -0
- data/ext/zstdlib_c/zlib-1.3.1/deflate.c +2139 -0
- data/ext/zstdlib_c/zlib-1.3.1/deflate.h +377 -0
- data/ext/zstdlib_c/zlib-1.3.1/gzclose.c +23 -0
- data/ext/zstdlib_c/zlib-1.3.1/gzguts.h +214 -0
- data/ext/zstdlib_c/zlib-1.3.1/gzlib.c +582 -0
- data/ext/zstdlib_c/zlib-1.3.1/gzread.c +602 -0
- data/ext/zstdlib_c/zlib-1.3.1/gzwrite.c +631 -0
- data/ext/zstdlib_c/zlib-1.3.1/infback.c +628 -0
- data/ext/zstdlib_c/zlib-1.3.1/inffast.c +320 -0
- data/ext/zstdlib_c/zlib-1.3.1/inffast.h +11 -0
- data/ext/zstdlib_c/zlib-1.3.1/inffixed.h +94 -0
- data/ext/zstdlib_c/zlib-1.3.1/inflate.c +1526 -0
- data/ext/zstdlib_c/zlib-1.3.1/inflate.h +126 -0
- data/ext/zstdlib_c/zlib-1.3.1/inftrees.c +299 -0
- data/ext/zstdlib_c/zlib-1.3.1/inftrees.h +62 -0
- data/ext/zstdlib_c/zlib-1.3.1/trees.c +1117 -0
- data/ext/zstdlib_c/zlib-1.3.1/trees.h +128 -0
- data/ext/zstdlib_c/zlib-1.3.1/uncompr.c +85 -0
- data/ext/zstdlib_c/zlib-1.3.1/zconf.h +543 -0
- data/ext/zstdlib_c/zlib-1.3.1/zlib.h +1938 -0
- data/ext/zstdlib_c/zlib-1.3.1/zutil.c +299 -0
- data/ext/zstdlib_c/zlib-1.3.1/zutil.h +254 -0
- data/ext/zstdlib_c/zlib.mk +14 -0
- data/ext/zstdlib_c/zlibwrapper/zlibwrapper.c +10 -0
- data/ext/zstdlib_c/zlibwrapper.mk +14 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/allocations.h +55 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/bits.h +200 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/bitstream.h +457 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/compiler.h +450 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/cpu.h +249 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/debug.c +30 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/debug.h +116 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/entropy_common.c +340 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/error_private.c +63 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/error_private.h +168 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/fse.h +640 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/fse_decompress.c +313 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/huf.h +286 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/mem.h +426 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/pool.c +371 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/pool.h +90 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/portability_macros.h +158 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/threading.c +182 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/threading.h +150 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/xxhash.c +18 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/xxhash.h +7020 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/zstd_common.c +48 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/zstd_deps.h +111 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/zstd_internal.h +392 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/common/zstd_trace.h +163 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/clevels.h +134 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/fse_compress.c +625 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/hist.c +181 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/hist.h +75 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/huf_compress.c +1464 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress.c +7153 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_internal.h +1534 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_literals.c +235 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_literals.h +39 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_sequences.c +442 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_sequences.h +54 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_superblock.c +688 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_compress_superblock.h +32 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_cwksp.h +748 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_double_fast.c +770 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_double_fast.h +50 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_fast.c +968 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_fast.h +38 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_lazy.c +2199 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_lazy.h +202 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_ldm.c +730 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_ldm.h +117 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_ldm_geartab.h +106 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_opt.c +1576 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstd_opt.h +80 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstdmt_compress.c +1882 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/compress/zstdmt_compress.h +113 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/huf_decompress.c +1944 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/huf_decompress_amd64.S +595 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/zstd_ddict.c +244 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/zstd_ddict.h +44 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/zstd_decompress.c +2407 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/zstd_decompress_block.c +2215 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/zstd_decompress_block.h +73 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/decompress/zstd_decompress_internal.h +240 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/zdict.h +474 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/zstd.h +3089 -0
- data/ext/zstdlib_c/zstd-1.5.6/lib/zstd_errors.h +114 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/gzclose.c +26 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/gzcompatibility.h +68 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/gzguts.h +229 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/gzlib.c +587 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/gzread.c +637 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/gzwrite.c +631 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/zstd_zlibwrapper.c +1200 -0
- data/ext/zstdlib_c/zstd-1.5.6/zlibWrapper/zstd_zlibwrapper.h +91 -0
- data/ext/zstdlib_c/zstd.mk +15 -0
- data/lib/2.4/zstdlib_c.so +0 -0
- data/lib/2.5/zstdlib_c.so +0 -0
- data/lib/2.6/zstdlib_c.so +0 -0
- data/lib/2.7/zstdlib_c.so +0 -0
- data/lib/3.0/zstdlib_c.so +0 -0
- data/lib/3.1/zstdlib_c.so +0 -0
- data/lib/3.2/zstdlib_c.so +0 -0
- data/lib/3.3/zstdlib_c.so +0 -0
- data/lib/zstdlib.rb +6 -0
- data/test/zstdlib_test.rb +21 -0
- metadata +243 -0
@@ -0,0 +1,134 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* This source code is licensed under both the BSD-style license (found in the
|
6
|
+
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
|
7
|
+
* in the COPYING file in the root directory of this source tree).
|
8
|
+
* You may select, at your option, one of the above-listed licenses.
|
9
|
+
*/
|
10
|
+
|
11
|
+
#ifndef ZSTD_CLEVELS_H
|
12
|
+
#define ZSTD_CLEVELS_H
|
13
|
+
|
14
|
+
#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_compressionParameters */
|
15
|
+
#include "../zstd.h"
|
16
|
+
|
17
|
+
/*-===== Pre-defined compression levels =====-*/
|
18
|
+
|
19
|
+
#define ZSTD_MAX_CLEVEL 22
|
20
|
+
|
21
|
+
#ifdef __GNUC__
|
22
|
+
__attribute__((__unused__))
|
23
|
+
#endif
|
24
|
+
|
25
|
+
static const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEVEL+1] = {
|
26
|
+
{ /* "default" - for any srcSize > 256 KB */
|
27
|
+
/* W, C, H, S, L, TL, strat */
|
28
|
+
{ 19, 12, 13, 1, 6, 1, ZSTD_fast }, /* base for negative levels */
|
29
|
+
{ 19, 13, 14, 1, 7, 0, ZSTD_fast }, /* level 1 */
|
30
|
+
{ 20, 15, 16, 1, 6, 0, ZSTD_fast }, /* level 2 */
|
31
|
+
{ 21, 16, 17, 1, 5, 0, ZSTD_dfast }, /* level 3 */
|
32
|
+
{ 21, 18, 18, 1, 5, 0, ZSTD_dfast }, /* level 4 */
|
33
|
+
{ 21, 18, 19, 3, 5, 2, ZSTD_greedy }, /* level 5 */
|
34
|
+
{ 21, 18, 19, 3, 5, 4, ZSTD_lazy }, /* level 6 */
|
35
|
+
{ 21, 19, 20, 4, 5, 8, ZSTD_lazy }, /* level 7 */
|
36
|
+
{ 21, 19, 20, 4, 5, 16, ZSTD_lazy2 }, /* level 8 */
|
37
|
+
{ 22, 20, 21, 4, 5, 16, ZSTD_lazy2 }, /* level 9 */
|
38
|
+
{ 22, 21, 22, 5, 5, 16, ZSTD_lazy2 }, /* level 10 */
|
39
|
+
{ 22, 21, 22, 6, 5, 16, ZSTD_lazy2 }, /* level 11 */
|
40
|
+
{ 22, 22, 23, 6, 5, 32, ZSTD_lazy2 }, /* level 12 */
|
41
|
+
{ 22, 22, 22, 4, 5, 32, ZSTD_btlazy2 }, /* level 13 */
|
42
|
+
{ 22, 22, 23, 5, 5, 32, ZSTD_btlazy2 }, /* level 14 */
|
43
|
+
{ 22, 23, 23, 6, 5, 32, ZSTD_btlazy2 }, /* level 15 */
|
44
|
+
{ 22, 22, 22, 5, 5, 48, ZSTD_btopt }, /* level 16 */
|
45
|
+
{ 23, 23, 22, 5, 4, 64, ZSTD_btopt }, /* level 17 */
|
46
|
+
{ 23, 23, 22, 6, 3, 64, ZSTD_btultra }, /* level 18 */
|
47
|
+
{ 23, 24, 22, 7, 3,256, ZSTD_btultra2}, /* level 19 */
|
48
|
+
{ 25, 25, 23, 7, 3,256, ZSTD_btultra2}, /* level 20 */
|
49
|
+
{ 26, 26, 24, 7, 3,512, ZSTD_btultra2}, /* level 21 */
|
50
|
+
{ 27, 27, 25, 9, 3,999, ZSTD_btultra2}, /* level 22 */
|
51
|
+
},
|
52
|
+
{ /* for srcSize <= 256 KB */
|
53
|
+
/* W, C, H, S, L, T, strat */
|
54
|
+
{ 18, 12, 13, 1, 5, 1, ZSTD_fast }, /* base for negative levels */
|
55
|
+
{ 18, 13, 14, 1, 6, 0, ZSTD_fast }, /* level 1 */
|
56
|
+
{ 18, 14, 14, 1, 5, 0, ZSTD_dfast }, /* level 2 */
|
57
|
+
{ 18, 16, 16, 1, 4, 0, ZSTD_dfast }, /* level 3 */
|
58
|
+
{ 18, 16, 17, 3, 5, 2, ZSTD_greedy }, /* level 4.*/
|
59
|
+
{ 18, 17, 18, 5, 5, 2, ZSTD_greedy }, /* level 5.*/
|
60
|
+
{ 18, 18, 19, 3, 5, 4, ZSTD_lazy }, /* level 6.*/
|
61
|
+
{ 18, 18, 19, 4, 4, 4, ZSTD_lazy }, /* level 7 */
|
62
|
+
{ 18, 18, 19, 4, 4, 8, ZSTD_lazy2 }, /* level 8 */
|
63
|
+
{ 18, 18, 19, 5, 4, 8, ZSTD_lazy2 }, /* level 9 */
|
64
|
+
{ 18, 18, 19, 6, 4, 8, ZSTD_lazy2 }, /* level 10 */
|
65
|
+
{ 18, 18, 19, 5, 4, 12, ZSTD_btlazy2 }, /* level 11.*/
|
66
|
+
{ 18, 19, 19, 7, 4, 12, ZSTD_btlazy2 }, /* level 12.*/
|
67
|
+
{ 18, 18, 19, 4, 4, 16, ZSTD_btopt }, /* level 13 */
|
68
|
+
{ 18, 18, 19, 4, 3, 32, ZSTD_btopt }, /* level 14.*/
|
69
|
+
{ 18, 18, 19, 6, 3,128, ZSTD_btopt }, /* level 15.*/
|
70
|
+
{ 18, 19, 19, 6, 3,128, ZSTD_btultra }, /* level 16.*/
|
71
|
+
{ 18, 19, 19, 8, 3,256, ZSTD_btultra }, /* level 17.*/
|
72
|
+
{ 18, 19, 19, 6, 3,128, ZSTD_btultra2}, /* level 18.*/
|
73
|
+
{ 18, 19, 19, 8, 3,256, ZSTD_btultra2}, /* level 19.*/
|
74
|
+
{ 18, 19, 19, 10, 3,512, ZSTD_btultra2}, /* level 20.*/
|
75
|
+
{ 18, 19, 19, 12, 3,512, ZSTD_btultra2}, /* level 21.*/
|
76
|
+
{ 18, 19, 19, 13, 3,999, ZSTD_btultra2}, /* level 22.*/
|
77
|
+
},
|
78
|
+
{ /* for srcSize <= 128 KB */
|
79
|
+
/* W, C, H, S, L, T, strat */
|
80
|
+
{ 17, 12, 12, 1, 5, 1, ZSTD_fast }, /* base for negative levels */
|
81
|
+
{ 17, 12, 13, 1, 6, 0, ZSTD_fast }, /* level 1 */
|
82
|
+
{ 17, 13, 15, 1, 5, 0, ZSTD_fast }, /* level 2 */
|
83
|
+
{ 17, 15, 16, 2, 5, 0, ZSTD_dfast }, /* level 3 */
|
84
|
+
{ 17, 17, 17, 2, 4, 0, ZSTD_dfast }, /* level 4 */
|
85
|
+
{ 17, 16, 17, 3, 4, 2, ZSTD_greedy }, /* level 5 */
|
86
|
+
{ 17, 16, 17, 3, 4, 4, ZSTD_lazy }, /* level 6 */
|
87
|
+
{ 17, 16, 17, 3, 4, 8, ZSTD_lazy2 }, /* level 7 */
|
88
|
+
{ 17, 16, 17, 4, 4, 8, ZSTD_lazy2 }, /* level 8 */
|
89
|
+
{ 17, 16, 17, 5, 4, 8, ZSTD_lazy2 }, /* level 9 */
|
90
|
+
{ 17, 16, 17, 6, 4, 8, ZSTD_lazy2 }, /* level 10 */
|
91
|
+
{ 17, 17, 17, 5, 4, 8, ZSTD_btlazy2 }, /* level 11 */
|
92
|
+
{ 17, 18, 17, 7, 4, 12, ZSTD_btlazy2 }, /* level 12 */
|
93
|
+
{ 17, 18, 17, 3, 4, 12, ZSTD_btopt }, /* level 13.*/
|
94
|
+
{ 17, 18, 17, 4, 3, 32, ZSTD_btopt }, /* level 14.*/
|
95
|
+
{ 17, 18, 17, 6, 3,256, ZSTD_btopt }, /* level 15.*/
|
96
|
+
{ 17, 18, 17, 6, 3,128, ZSTD_btultra }, /* level 16.*/
|
97
|
+
{ 17, 18, 17, 8, 3,256, ZSTD_btultra }, /* level 17.*/
|
98
|
+
{ 17, 18, 17, 10, 3,512, ZSTD_btultra }, /* level 18.*/
|
99
|
+
{ 17, 18, 17, 5, 3,256, ZSTD_btultra2}, /* level 19.*/
|
100
|
+
{ 17, 18, 17, 7, 3,512, ZSTD_btultra2}, /* level 20.*/
|
101
|
+
{ 17, 18, 17, 9, 3,512, ZSTD_btultra2}, /* level 21.*/
|
102
|
+
{ 17, 18, 17, 11, 3,999, ZSTD_btultra2}, /* level 22.*/
|
103
|
+
},
|
104
|
+
{ /* for srcSize <= 16 KB */
|
105
|
+
/* W, C, H, S, L, T, strat */
|
106
|
+
{ 14, 12, 13, 1, 5, 1, ZSTD_fast }, /* base for negative levels */
|
107
|
+
{ 14, 14, 15, 1, 5, 0, ZSTD_fast }, /* level 1 */
|
108
|
+
{ 14, 14, 15, 1, 4, 0, ZSTD_fast }, /* level 2 */
|
109
|
+
{ 14, 14, 15, 2, 4, 0, ZSTD_dfast }, /* level 3 */
|
110
|
+
{ 14, 14, 14, 4, 4, 2, ZSTD_greedy }, /* level 4 */
|
111
|
+
{ 14, 14, 14, 3, 4, 4, ZSTD_lazy }, /* level 5.*/
|
112
|
+
{ 14, 14, 14, 4, 4, 8, ZSTD_lazy2 }, /* level 6 */
|
113
|
+
{ 14, 14, 14, 6, 4, 8, ZSTD_lazy2 }, /* level 7 */
|
114
|
+
{ 14, 14, 14, 8, 4, 8, ZSTD_lazy2 }, /* level 8.*/
|
115
|
+
{ 14, 15, 14, 5, 4, 8, ZSTD_btlazy2 }, /* level 9.*/
|
116
|
+
{ 14, 15, 14, 9, 4, 8, ZSTD_btlazy2 }, /* level 10.*/
|
117
|
+
{ 14, 15, 14, 3, 4, 12, ZSTD_btopt }, /* level 11.*/
|
118
|
+
{ 14, 15, 14, 4, 3, 24, ZSTD_btopt }, /* level 12.*/
|
119
|
+
{ 14, 15, 14, 5, 3, 32, ZSTD_btultra }, /* level 13.*/
|
120
|
+
{ 14, 15, 15, 6, 3, 64, ZSTD_btultra }, /* level 14.*/
|
121
|
+
{ 14, 15, 15, 7, 3,256, ZSTD_btultra }, /* level 15.*/
|
122
|
+
{ 14, 15, 15, 5, 3, 48, ZSTD_btultra2}, /* level 16.*/
|
123
|
+
{ 14, 15, 15, 6, 3,128, ZSTD_btultra2}, /* level 17.*/
|
124
|
+
{ 14, 15, 15, 7, 3,256, ZSTD_btultra2}, /* level 18.*/
|
125
|
+
{ 14, 15, 15, 8, 3,256, ZSTD_btultra2}, /* level 19.*/
|
126
|
+
{ 14, 15, 15, 8, 3,512, ZSTD_btultra2}, /* level 20.*/
|
127
|
+
{ 14, 15, 15, 9, 3,512, ZSTD_btultra2}, /* level 21.*/
|
128
|
+
{ 14, 15, 15, 10, 3,999, ZSTD_btultra2}, /* level 22.*/
|
129
|
+
},
|
130
|
+
};
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
#endif /* ZSTD_CLEVELS_H */
|