extzstd 0.1.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/HISTORY.ja.md +18 -0
- data/README.md +15 -50
- data/contrib/zstd/CONTRIBUTING.md +1 -1
- data/contrib/zstd/COPYING +339 -0
- data/contrib/zstd/Makefile +82 -51
- data/contrib/zstd/NEWS +92 -5
- data/contrib/zstd/README.md +50 -41
- data/contrib/zstd/appveyor.yml +164 -102
- data/contrib/zstd/circle.yml +10 -22
- data/contrib/zstd/lib/BUCK +31 -10
- data/contrib/zstd/lib/Makefile +57 -31
- data/contrib/zstd/lib/README.md +68 -37
- data/contrib/zstd/lib/common/bitstream.h +130 -76
- data/contrib/zstd/lib/common/compiler.h +86 -0
- data/contrib/zstd/lib/common/error_private.c +15 -11
- data/contrib/zstd/lib/common/error_private.h +8 -8
- data/contrib/zstd/lib/common/fse.h +19 -9
- data/contrib/zstd/lib/common/fse_decompress.c +3 -22
- data/contrib/zstd/lib/common/huf.h +68 -26
- data/contrib/zstd/lib/common/mem.h +23 -35
- data/contrib/zstd/lib/common/pool.c +123 -63
- data/contrib/zstd/lib/common/pool.h +19 -10
- data/contrib/zstd/lib/common/threading.c +11 -16
- data/contrib/zstd/lib/common/threading.h +52 -33
- data/contrib/zstd/lib/common/xxhash.c +28 -22
- data/contrib/zstd/lib/common/zstd_common.c +40 -27
- data/contrib/zstd/lib/common/zstd_errors.h +43 -34
- data/contrib/zstd/lib/common/zstd_internal.h +131 -123
- data/contrib/zstd/lib/compress/fse_compress.c +17 -33
- data/contrib/zstd/lib/compress/huf_compress.c +15 -9
- data/contrib/zstd/lib/compress/zstd_compress.c +2096 -2363
- data/contrib/zstd/lib/compress/zstd_compress_internal.h +462 -0
- data/contrib/zstd/lib/compress/zstd_double_fast.c +309 -0
- data/contrib/zstd/lib/compress/zstd_double_fast.h +29 -0
- data/contrib/zstd/lib/compress/zstd_fast.c +243 -0
- data/contrib/zstd/lib/compress/zstd_fast.h +31 -0
- data/contrib/zstd/lib/compress/zstd_lazy.c +765 -0
- data/contrib/zstd/lib/compress/zstd_lazy.h +39 -0
- data/contrib/zstd/lib/compress/zstd_ldm.c +707 -0
- data/contrib/zstd/lib/compress/zstd_ldm.h +68 -0
- data/contrib/zstd/lib/compress/zstd_opt.c +785 -0
- data/contrib/zstd/lib/compress/zstd_opt.h +19 -908
- data/contrib/zstd/lib/compress/zstdmt_compress.c +737 -327
- data/contrib/zstd/lib/compress/zstdmt_compress.h +88 -26
- data/contrib/zstd/lib/decompress/huf_decompress.c +158 -50
- data/contrib/zstd/lib/decompress/zstd_decompress.c +884 -699
- data/contrib/zstd/lib/deprecated/zbuff.h +5 -4
- data/contrib/zstd/lib/deprecated/zbuff_common.c +5 -5
- data/contrib/zstd/lib/deprecated/zbuff_compress.c +6 -4
- data/contrib/zstd/lib/deprecated/zbuff_decompress.c +5 -4
- data/contrib/zstd/lib/dictBuilder/cover.c +93 -77
- data/contrib/zstd/lib/dictBuilder/zdict.c +107 -92
- data/contrib/zstd/lib/dictBuilder/zdict.h +112 -102
- data/contrib/zstd/lib/legacy/zstd_legacy.h +9 -4
- data/contrib/zstd/lib/legacy/zstd_v01.c +7 -6
- data/contrib/zstd/lib/legacy/zstd_v01.h +5 -4
- data/contrib/zstd/lib/legacy/zstd_v02.c +27 -99
- data/contrib/zstd/lib/legacy/zstd_v02.h +5 -4
- data/contrib/zstd/lib/legacy/zstd_v03.c +26 -98
- data/contrib/zstd/lib/legacy/zstd_v03.h +5 -4
- data/contrib/zstd/lib/legacy/zstd_v04.c +22 -91
- data/contrib/zstd/lib/legacy/zstd_v04.h +5 -4
- data/contrib/zstd/lib/legacy/zstd_v05.c +23 -99
- data/contrib/zstd/lib/legacy/zstd_v05.h +5 -4
- data/contrib/zstd/lib/legacy/zstd_v06.c +22 -96
- data/contrib/zstd/lib/legacy/zstd_v06.h +5 -4
- data/contrib/zstd/lib/legacy/zstd_v07.c +19 -95
- data/contrib/zstd/lib/legacy/zstd_v07.h +5 -4
- data/contrib/zstd/lib/zstd.h +895 -271
- data/ext/extconf.rb +11 -2
- data/ext/extzstd.c +45 -128
- data/ext/extzstd.h +74 -31
- data/ext/extzstd_stream.c +401 -142
- data/ext/zstd_common.c +5 -0
- data/ext/zstd_compress.c +8 -0
- data/ext/zstd_decompress.c +1 -0
- data/ext/zstd_dictbuilder.c +2 -0
- data/lib/extzstd/version.rb +1 -1
- data/lib/extzstd.rb +48 -1
- data/test/test_basic.rb +9 -1
- metadata +17 -7
- data/HISTORY.ja +0 -10
- data/contrib/zstd/LICENSE-examples +0 -11
- data/contrib/zstd/PATENTS +0 -33
@@ -0,0 +1,68 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
|
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
|
+
*/
|
9
|
+
|
10
|
+
#ifndef ZSTD_LDM_H
|
11
|
+
#define ZSTD_LDM_H
|
12
|
+
|
13
|
+
#if defined (__cplusplus)
|
14
|
+
extern "C" {
|
15
|
+
#endif
|
16
|
+
|
17
|
+
#include "zstd_compress_internal.h" /* ldmParams_t, U32 */
|
18
|
+
#include "zstd.h" /* ZSTD_CCtx, size_t */
|
19
|
+
|
20
|
+
/*-*************************************
|
21
|
+
* Long distance matching
|
22
|
+
***************************************/
|
23
|
+
|
24
|
+
#define ZSTD_LDM_DEFAULT_WINDOW_LOG ZSTD_WINDOWLOG_DEFAULTMAX
|
25
|
+
#define ZSTD_LDM_HASHEVERYLOG_NOTSET 9999
|
26
|
+
|
27
|
+
/** ZSTD_compressBlock_ldm_generic() :
|
28
|
+
*
|
29
|
+
* This is a block compressor intended for long distance matching.
|
30
|
+
*
|
31
|
+
* The function searches for matches of length at least
|
32
|
+
* ldmParams.minMatchLength using a hash table in cctx->ldmState.
|
33
|
+
* Matches can be at a distance of up to cParams.windowLog.
|
34
|
+
*
|
35
|
+
* Upon finding a match, the unmatched literals are compressed using a
|
36
|
+
* ZSTD_blockCompressor (depending on the strategy in the compression
|
37
|
+
* parameters), which stores the matched sequences. The "long distance"
|
38
|
+
* match is then stored with the remaining literals from the
|
39
|
+
* ZSTD_blockCompressor. */
|
40
|
+
size_t ZSTD_compressBlock_ldm(ZSTD_CCtx* cctx, const void* src, size_t srcSize);
|
41
|
+
size_t ZSTD_compressBlock_ldm_extDict(ZSTD_CCtx* ctx,
|
42
|
+
const void* src, size_t srcSize);
|
43
|
+
|
44
|
+
/** ZSTD_ldm_initializeParameters() :
|
45
|
+
* Initialize the long distance matching parameters to their default values. */
|
46
|
+
size_t ZSTD_ldm_initializeParameters(ldmParams_t* params, U32 enableLdm);
|
47
|
+
|
48
|
+
/** ZSTD_ldm_getTableSize() :
|
49
|
+
* Estimate the space needed for long distance matching tables. */
|
50
|
+
size_t ZSTD_ldm_getTableSize(U32 hashLog, U32 bucketSizeLog);
|
51
|
+
|
52
|
+
/** ZSTD_ldm_getTableSize() :
|
53
|
+
* Return prime8bytes^(minMatchLength-1) */
|
54
|
+
U64 ZSTD_ldm_getHashPower(U32 minMatchLength);
|
55
|
+
|
56
|
+
/** ZSTD_ldm_adjustParameters() :
|
57
|
+
* If the params->hashEveryLog is not set, set it to its default value based on
|
58
|
+
* windowLog and params->hashLog.
|
59
|
+
*
|
60
|
+
* Ensures that params->bucketSizeLog is <= params->hashLog (setting it to
|
61
|
+
* params->hashLog if it is not). */
|
62
|
+
void ZSTD_ldm_adjustParameters(ldmParams_t* params, U32 windowLog);
|
63
|
+
|
64
|
+
#if defined (__cplusplus)
|
65
|
+
}
|
66
|
+
#endif
|
67
|
+
|
68
|
+
#endif /* ZSTD_FAST_H */
|