ReactOS 0.4.16-dev-340-g0540c21
|
#include <limits.h>
#include <string.h>
#include "cpu.h"
#include "mem.h"
#include "hist.h"
#include "fse.h"
#include "huf.h"
#include "zstd_compress_internal.h"
#include "zstd_compress_sequences.h"
#include "zstd_compress_literals.h"
#include "zstd_fast.h"
#include "zstd_double_fast.h"
#include "zstd_lazy.h"
#include "zstd_opt.h"
#include "zstd_ldm.h"
#include "zstd_compress_superblock.h"
Go to the source code of this file.
Classes | |
struct | ZSTD_CDict_s |
Macros | |
#define | FSE_STATIC_LINKING_ONLY /* FSE_encodeSymbol */ |
#define | HUF_STATIC_LINKING_ONLY |
#define | BOUNDCHECK(cParam, val) |
#define | CLAMP_TYPE(cParam, val, type) |
#define | CLAMP(cParam, val) CLAMP_TYPE(cParam, val, unsigned) |
#define | ZSTD_INDEXOVERFLOW_MARGIN (16 MB) |
#define | ZSTD_ROWSIZE 16 |
#define | ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF (128 KB) |
#define | ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER (6) |
#define | ZSTD_MAX_CLEVEL 22 |
Enumerations | |
enum | ZSTD_buffered_policy_e { ZSTDb_not_buffered , ZSTDb_buffered } |
enum | ZSTD_compResetPolicy_e { ZSTDcrp_makeClean , ZSTDcrp_leaveDirty } |
enum | ZSTD_indexResetPolicy_e { ZSTDirp_continue , ZSTDirp_reset } |
enum | ZSTD_resetTarget_e { ZSTD_resetTarget_CDict , ZSTD_resetTarget_CCtx } |
enum | ZSTD_buildSeqStore_e { ZSTDbss_compress , ZSTDbss_noCompress } |
Variables | |
static const size_t | attachDictSizeCutoffs [ZSTD_STRATEGY_MAX+1] |
static const ZSTD_compressionParameters | ZSTD_defaultCParameters [4][ZSTD_MAX_CLEVEL+1] |
Definition at line 439 of file zstd_compress.c.
#define CLAMP | ( | cParam, | |
val | |||
) | CLAMP_TYPE(cParam, val, unsigned) |
#define FSE_STATIC_LINKING_ONLY /* FSE_encodeSymbol */ |
Definition at line 19 of file zstd_compress.c.
#define HUF_STATIC_LINKING_ONLY |
Definition at line 21 of file zstd_compress.c.
Definition at line 1411 of file zstd_compress.c.
#define ZSTD_MAX_CLEVEL 22 |
Definition at line 4115 of file zstd_compress.c.
#define ZSTD_ROWSIZE 16 |
Definition at line 1848 of file zstd_compress.c.
#define ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER (6) |
Definition at line 3077 of file zstd_compress.c.
Definition at line 3076 of file zstd_compress.c.
Indicates whether this compression proceeds directly from user-provided source buffer to user-provided destination buffer (ZSTDb_not_buffered), or whether the context needs to buffer the input/output (ZSTDb_buffered).
Enumerator | |
---|---|
ZSTDb_not_buffered | |
ZSTDb_buffered |
Definition at line 1312 of file zstd_compress.c.
Controls, for this matchState reset, whether the tables need to be cleared / prepared for the coming compression (ZSTDcrp_makeClean), or whether the tables can be left unclean (ZSTDcrp_leaveDirty), because we know that a subsequent operation will overwrite the table space anyways (e.g., copying the matchState contents in from a CDict).
Enumerator | |
---|---|
ZSTDcrp_makeClean | |
ZSTDcrp_leaveDirty |
Definition at line 1324 of file zstd_compress.c.
Controls, for this matchState reset, whether indexing can continue where it left off (ZSTDirp_continue), or whether it needs to be restarted from zero (ZSTDirp_reset).
Enumerator | |
---|---|
ZSTDirp_continue | |
ZSTDirp_reset |
Definition at line 1334 of file zstd_compress.c.
Enumerator | |
---|---|
ZSTD_resetTarget_CDict | |
ZSTD_resetTarget_CCtx |
Definition at line 1339 of file zstd_compress.c.
ZSTD_compressionParameters ZSTD_adjustCParams | ( | ZSTD_compressionParameters | cPar, |
unsigned long long | srcSize, | ||
size_t | dictSize | ||
) |
Definition at line 1065 of file zstd_compress.c.
|
static |
ZSTD_adjustCParams_internal() : optimize cPar
for a specified input (srcSize
and dictSize
). mostly downsize to reduce memory consumption and initialization latency. srcSize
can be ZSTD_CONTENTSIZE_UNKNOWN when not known. note : srcSize==0
means 0! condition : cPar is presumed validated (can be checked using ZSTD_checkCParams()).
Definition at line 1032 of file zstd_compress.c.
Referenced by ZSTD_adjustCParams(), ZSTD_getCParams_internal(), ZSTD_getCParamsFromCCtxParams(), and ZSTD_resetCCtx_byAttachingCDict().
|
static |
Definition at line 1268 of file zstd_compress.c.
Referenced by ZSTD_buildSeqStore(), and ZSTD_loadDictionaryContent().
|
static |
Definition at line 257 of file zstd_compress.c.
Referenced by ZSTD_compress_internal(), ZSTD_compress_usingDict(), ZSTD_compressBegin_advanced(), ZSTD_compressBegin_usingDict(), and ZSTD_initCStream_advanced().
Definition at line 2242 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_internal(), and ZSTD_compressBlock_targetCBlockSize().
size_t ZSTD_CCtx_getParameter | ( | ZSTD_CCtx * | cctx, |
ZSTD_cParameter | param, | ||
int * | value | ||
) |
Definition at line 714 of file zstd_compress.c.
ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize | ||
) |
ZSTD_CCtx_loadDictionary() : Create an internal CDict from dict
buffer. Decompression will have to use same dictionary.
dict
content will be copied internally. Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. In such a case, dictionary buffer must outlive its users. Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() to precisely select how dictionary content must be interpreted. Definition at line 924 of file zstd_compress.c.
Referenced by ZSTD_initCStream_advanced(), ZSTD_initCStream_internal(), and ZSTD_initCStream_usingDict().
size_t ZSTD_CCtx_loadDictionary_advanced | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize, | ||
ZSTD_dictLoadMethod_e | dictLoadMethod, | ||
ZSTD_dictContentType_e | dictContentType | ||
) |
Definition at line 891 of file zstd_compress.c.
Referenced by ZSTD_CCtx_loadDictionary(), and ZSTD_CCtx_loadDictionary_byReference().
ZSTDLIB_API size_t ZSTD_CCtx_loadDictionary_byReference | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize | ||
) |
Definition at line 917 of file zstd_compress.c.
size_t ZSTD_CCtx_refCDict | ( | ZSTD_CCtx * | cctx, |
const ZSTD_CDict * | cdict | ||
) |
ZSTD_CCtx_refCDict() : Reference a prepared dictionary, to be used for all next compressed frames. Note that compression parameters are enforced from within CDict, and supersede any compression parameter previously set within CCtx. The parameters ignored are labled as "superseded-by-cdict" in the ZSTD_cParameter enum docs. The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. The dictionary will remain valid for future compressed frames using same CCtx.
Definition at line 931 of file zstd_compress.c.
Referenced by ZSTD_initCStream(), ZSTD_initCStream_internal(), ZSTD_initCStream_srcSize(), ZSTD_initCStream_usingCDict(), and ZSTD_initCStream_usingCDict_advanced().
ZSTD_CCtx_refPrefix() : Reference a prefix (single-usage dictionary) for next compressed frame. A prefix is only used once. Tables are discarded at end of frame (ZSTD_e_end). Decompression will need same prefix to properly regenerate data. Compressing with a prefix is similar in outcome as performing a diff and compressing it, but performs much faster, especially during decompression (compression speed is tunable with compression level).
Definition at line 941 of file zstd_compress.c.
size_t ZSTD_CCtx_refPrefix_advanced | ( | ZSTD_CCtx * | cctx, |
const void * | prefix, | ||
size_t | prefixSize, | ||
ZSTD_dictContentType_e | dictContentType | ||
) |
Definition at line 946 of file zstd_compress.c.
Referenced by ZSTD_CCtx_refPrefix().
size_t ZSTD_CCtx_reset | ( | ZSTD_CCtx * | cctx, |
ZSTD_ResetDirective | reset | ||
) |
ZSTD_CCtx_reset() : Also dumps dictionary
Definition at line 962 of file zstd_compress.c.
Referenced by ZSTD_compress2(), ZSTD_compressStream2(), ZSTD_compressStream_generic(), ZSTD_initCCtx(), ZSTD_initCStream(), ZSTD_initCStream_advanced(), ZSTD_initCStream_internal(), ZSTD_initCStream_srcSize(), ZSTD_initCStream_usingCDict(), ZSTD_initCStream_usingCDict_advanced(), ZSTD_initCStream_usingDict(), and ZSTD_resetCStream().
size_t ZSTD_CCtx_setParameter | ( | ZSTD_CCtx * | cctx, |
ZSTD_cParameter | param, | ||
int | value | ||
) |
ZSTD_CCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_cParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is generally only possible during frame initialization (before starting compression). Exception : when using multi-threading mode (nbWorkers >= 1), the following parameters can be updated during compression (within same frame): => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. new parameters will be active for next job only (after a flush()).
Definition at line 482 of file zstd_compress.c.
Referenced by ZSTD_initCStream(), ZSTD_initCStream_srcSize(), and ZSTD_initCStream_usingDict().
ZSTD_CCtx_setParametersUsingCCtxParams() : just applies params
into cctx
no action is performed, parameters are merely stored. If ZSTDMT is enabled, parameters are pushed to cctx->mtctx. This is possible even if a compression is ongoing. In which case, new parameters will be applied on the fly, starting with next compression job.
Definition at line 830 of file zstd_compress.c.
ZSTDLIB_API size_t ZSTD_CCtx_setPledgedSrcSize | ( | ZSTD_CCtx * | cctx, |
unsigned long long | pledgedSrcSize | ||
) |
ZSTD_CCtx_setPledgedSrcSize() : Total input data size to be compressed as a single frame. Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. This value will also be controlled at end of frame, and trigger an error if not respected.
Definition at line 844 of file zstd_compress.c.
Referenced by ZSTD_initCStream_advanced(), ZSTD_initCStream_internal(), ZSTD_initCStream_srcSize(), ZSTD_initCStream_usingCDict_advanced(), and ZSTD_resetCStream().
size_t ZSTD_CCtxParams_getParameter | ( | ZSTD_CCtx_params * | CCtxParams, |
ZSTD_cParameter | param, | ||
int * | value | ||
) |
Definition at line 719 of file zstd_compress.c.
Referenced by ZSTD_CCtx_getParameter().
Definition at line 235 of file zstd_compress.c.
Referenced by ZSTD_CCtxParams_reset().
size_t ZSTD_CCtxParams_init_advanced | ( | ZSTD_CCtx_params * | cctxParams, |
ZSTD_parameters | params | ||
) |
Definition at line 243 of file zstd_compress.c.
size_t ZSTD_CCtxParams_reset | ( | ZSTD_CCtx_params * | params | ) |
Definition at line 230 of file zstd_compress.c.
Referenced by ZSTD_CCtx_reset().
size_t ZSTD_CCtxParams_setParameter | ( | ZSTD_CCtx_params * | CCtxParams, |
ZSTD_cParameter | param, | ||
int | value | ||
) |
Definition at line 531 of file zstd_compress.c.
Referenced by ZSTD_CCtx_setParameter().
size_t ZSTD_checkCParams | ( | ZSTD_compressionParameters | cParams | ) |
ZSTD_checkCParams() : control CParam values remain within authorized range.
Definition at line 983 of file zstd_compress.c.
Referenced by ZSTD_adjustCParams_internal(), ZSTD_assignParamsToCCtxParams(), ZSTD_CCtxParams_init_advanced(), ZSTD_compress_advanced(), ZSTD_compressBegin_advanced_internal(), ZSTD_compressBegin_internal(), ZSTD_getBlockSize(), ZSTD_getCParamsFromCCtxParams(), ZSTD_initCDict_internal(), ZSTD_initCStream_advanced(), ZSTD_initCStream_internal(), ZSTD_makeCCtxParamsFromCParams(), ZSTD_resetCCtx_internal(), and ZSTD_resetCStream_internal().
|
static |
Definition at line 2893 of file zstd_compress.c.
Referenced by ZSTD_loadCEntropy(), and ZSTD_loadZstdDictionary().
|
static |
ZSTD_clampCParams() : make CParam values within valid range.
Definition at line 999 of file zstd_compress.c.
Referenced by ZSTD_adjustCParams().
Clears and frees all of the dictionaries in the CCtx.
Definition at line 120 of file zstd_compress.c.
Referenced by ZSTD_CCtx_loadDictionary_advanced(), ZSTD_CCtx_refCDict(), ZSTD_CCtx_refPrefix_advanced(), ZSTD_CCtx_reset(), and ZSTD_freeCCtxContent().
size_t ZSTD_compress | ( | void * | dst, |
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
int | compressionLevel | ||
) |
ZSTD_compress() : Compresses src
content as a single zstd compressed frame into already allocated dst
. Hint : compression runs faster if dstCapacity
>= ZSTD_compressBound(srcSize)
.
dst
(<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()). Definition at line 3307 of file zstd_compress.c.
size_t ZSTD_compress2 | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
ZSTD_compress2() : Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API. ZSTD_compress2() always starts a new frame. Should cctx hold data from a previously unfinished frame, everything about it is forgotten.
dstCapacity
>= ZSTD_compressBound(srcSize)
. dst
(<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()). Definition at line 4064 of file zstd_compress.c.
Referenced by ZSTD_getSequences().
size_t ZSTD_compress_advanced | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const void * | dict, | ||
size_t | dictSize, | ||
ZSTD_parameters | params | ||
) |
Definition at line 3254 of file zstd_compress.c.
size_t ZSTD_compress_advanced_internal | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const void * | dict, | ||
size_t | dictSize, | ||
const ZSTD_CCtx_params * | params | ||
) |
Definition at line 3270 of file zstd_compress.c.
Referenced by ZSTD_compress_internal(), and ZSTD_compress_usingDict().
|
static |
ZSTD_compress_frameChunk() : Compress a chunk of data into one or multiple blocks. All blocks will be terminated, all input will be consumed. Function will issue an error if there is not enough dstCapacity
to hold the compressed content. Frame is supposed already started (header already produced)
Definition at line 2582 of file zstd_compress.c.
Referenced by ZSTD_compressContinue_internal().
|
static |
ZSTD_compress_insertDictionary() :
Definition at line 3039 of file zstd_compress.c.
Referenced by ZSTD_compressBegin_internal(), and ZSTD_initCDict_internal().
|
static |
Definition at line 3238 of file zstd_compress.c.
Referenced by ZSTD_compress_advanced().
size_t ZSTD_compress_usingCDict | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const ZSTD_CDict * | cdict | ||
) |
ZSTD_compress_usingCDict() : Compression using a digested Dictionary. Faster startup than ZSTD_compress_usingDict(), recommended when same dictionary is used multiple times. Note that compression parameters are decided at CDict creation time while frame parameters are hardcoded
Definition at line 3596 of file zstd_compress.c.
size_t ZSTD_compress_usingCDict_advanced | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const ZSTD_CDict * | cdict, | ||
ZSTD_frameParameters | fParams | ||
) |
Definition at line 3582 of file zstd_compress.c.
Referenced by ZSTD_compress_usingCDict().
size_t ZSTD_compress_usingDict | ( | ZSTD_CCtx * | ctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const void * | dict, | ||
size_t | dictSize, | ||
int | compressionLevel | ||
) |
ZSTD_compress_usingDict() : Compression at an explicit compression level using a Dictionary. A dictionary can be any arbitrary data segment (also called a prefix), or a buffer with specified information (see dictBuilder/zdict.h). Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note 2 : When dict == NULL || dictSize < 8
no dictionary is used.
Definition at line 3284 of file zstd_compress.c.
Referenced by ZSTD_compressCCtx().
Definition at line 3164 of file zstd_compress.c.
size_t ZSTD_compressBegin_advanced | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize, | ||
ZSTD_parameters | params, | ||
unsigned long long | pledgedSrcSize | ||
) |
ZSTD_compressBegin_advanced() :
Definition at line 3142 of file zstd_compress.c.
size_t ZSTD_compressBegin_advanced_internal | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize, | ||
ZSTD_dictContentType_e | dictContentType, | ||
ZSTD_dictTableLoadMethod_e | dtlm, | ||
const ZSTD_CDict * | cdict, | ||
const ZSTD_CCtx_params * | params, | ||
unsigned long long | pledgedSrcSize | ||
) |
Definition at line 3122 of file zstd_compress.c.
Referenced by ZSTD_compressBegin_advanced().
|
static |
ZSTD_compressBegin_internal() :
Definition at line 3081 of file zstd_compress.c.
Referenced by ZSTD_compress_advanced_internal(), ZSTD_compressBegin_advanced_internal(), ZSTD_compressBegin_usingCDict_advanced(), ZSTD_compressBegin_usingDict(), and ZSTD_resetCStream_internal().
size_t ZSTD_compressBegin_usingCDict | ( | ZSTD_CCtx * | cctx, |
const ZSTD_CDict * | cdict | ||
) |
Definition at line 3575 of file zstd_compress.c.
size_t ZSTD_compressBegin_usingCDict_advanced | ( | ZSTD_CCtx *const | cctx, |
const ZSTD_CDict *const | cdict, | ||
ZSTD_frameParameters const | fParams, | ||
unsigned long long const | pledgedSrcSize | ||
) |
Definition at line 3538 of file zstd_compress.c.
Referenced by ZSTD_compress_usingCDict_advanced(), and ZSTD_compressBegin_usingCDict().
size_t ZSTD_compressBegin_usingDict | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize, | ||
int | compressionLevel | ||
) |
Definition at line 3154 of file zstd_compress.c.
Referenced by ZSTD_compressBegin().
size_t ZSTD_compressBlock | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
Definition at line 2808 of file zstd_compress.c.
|
static |
Definition at line 2414 of file zstd_compress.c.
Referenced by ZSTD_compress_frameChunk(), and ZSTD_compressContinue_internal().
|
static |
Definition at line 2531 of file zstd_compress.c.
Referenced by ZSTD_compress_frameChunk().
|
static |
Definition at line 2476 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_targetCBlockSize().
maximum compressed size in worst case single-pass scenario
Definition at line 44 of file zstd_compress.c.
Referenced by ZSTD_compressStream_generic(), ZSTD_CStreamOutSize(), ZSTD_estimateCStreamSize_usingCCtxParams(), ZSTD_getSequences(), and ZSTD_resetCCtx_internal().
size_t ZSTD_compressCCtx | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
int | compressionLevel | ||
) |
ZSTD_compressCCtx() : Same as ZSTD_compress(), using an explicit ZSTD_CCtx. Important : in order to behave similarly to ZSTD_compress()
, this function compresses at requested compression level, ignoring any other parameter . If any advanced parameter was set using the advanced API, they will all be reset. Only compressionLevel
remains.
Definition at line 3297 of file zstd_compress.c.
Referenced by ZSTD_compress().
size_t ZSTD_compressContinue | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
Definition at line 2792 of file zstd_compress.c.
Referenced by ZSTD_compressStream_generic().
|
static |
Definition at line 2732 of file zstd_compress.c.
Referenced by ZSTD_compressBlock(), ZSTD_compressContinue(), and ZSTD_compressEnd().
size_t ZSTD_compressEnd | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
Definition at line 3212 of file zstd_compress.c.
Referenced by ZSTD_compress_advanced_internal(), ZSTD_compress_usingCDict_advanced(), and ZSTD_compressStream_generic().
MEM_STATIC size_t ZSTD_compressSequences | ( | seqStore_t * | seqStorePtr, |
const ZSTD_entropyCTables_t * | prevEntropy, | ||
ZSTD_entropyCTables_t * | nextEntropy, | ||
const ZSTD_CCtx_params * | cctxParams, | ||
void * | dst, | ||
size_t | dstCapacity, | ||
size_t | srcSize, | ||
void * | entropyWorkspace, | ||
size_t | entropyWkspSize, | ||
int | bmi2 | ||
) |
Definition at line 2151 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_internal().
MEM_STATIC size_t ZSTD_compressSequences_internal | ( | seqStore_t * | seqStorePtr, |
const ZSTD_entropyCTables_t * | prevEntropy, | ||
ZSTD_entropyCTables_t * | nextEntropy, | ||
const ZSTD_CCtx_params * | cctxParams, | ||
void * | dst, | ||
size_t | dstCapacity, | ||
void * | entropyWorkspace, | ||
size_t | entropyWkspSize, | ||
const int | bmi2 | ||
) |
Definition at line 1964 of file zstd_compress.c.
Referenced by ZSTD_compressSequences().
size_t ZSTD_compressStream | ( | ZSTD_CStream * | zcs, |
ZSTD_outBuffer * | output, | ||
ZSTD_inBuffer * | input | ||
) |
Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). NOTE: The return value is different. ZSTD_compressStream() returns a hint for the next read size (if non-zero and not an error). ZSTD_compressStream2() returns the minimum nb of bytes left to flush (if non-zero and not an error).
Definition at line 3956 of file zstd_compress.c.
Referenced by zstd_compress().
size_t ZSTD_compressStream2 | ( | ZSTD_CCtx * | cctx, |
ZSTD_outBuffer * | output, | ||
ZSTD_inBuffer * | input, | ||
ZSTD_EndDirective | endOp | ||
) |
ZSTD_compressStream2() : Behaves about the same as ZSTD_compressStream, with additional control on end directive.
Definition at line 3963 of file zstd_compress.c.
Referenced by ZSTD_compressStream(), ZSTD_compressStream2_simpleArgs(), ZSTD_endStream(), and ZSTD_flushStream().
size_t ZSTD_compressStream2_simpleArgs | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
size_t * | dstPos, | ||
const void * | src, | ||
size_t | srcSize, | ||
size_t * | srcPos, | ||
ZSTD_EndDirective | endOp | ||
) |
Definition at line 4049 of file zstd_compress.c.
Referenced by ZSTD_compress2().
|
static |
ZSTD_compressStream_generic(): internal function for all compressStream() variants non-static, because can be called from zstdmt_compress.c
Definition at line 3803 of file zstd_compress.c.
Referenced by ZSTD_compressStream2().
Definition at line 2407 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_internal(), and ZSTD_compressBlock_targetCBlockSize_body().
Definition at line 2314 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_internal().
size_t ZSTD_copyCCtx | ( | ZSTD_CCtx * | dstCCtx, |
const ZSTD_CCtx * | srcCCtx, | ||
unsigned long long | pledgedSrcSize | ||
) |
ZSTD_copyCCtx() : Duplicate an existing context srcCCtx
into another one dstCCtx
. Only works during stage ZSTDcs_init (i.e. after creation, but before first call to ZSTD_compressContinue()). pledgedSrcSize==0 means "unknown".
Definition at line 1834 of file zstd_compress.c.
|
static |
ZSTD_copyCCtx_internal() : Duplicate an existing context srcCCtx
into another one dstCCtx
. Only works during stage ZSTDcs_init (i.e. after creation, but before first call to ZSTD_compressContinue()). The "context", in this case, refers to the hash and chain tables, entropy tables, and dictionary references. windowLog
value is enforced if != 0, otherwise value is copied from srcCCtx.
Definition at line 1768 of file zstd_compress.c.
Referenced by ZSTD_copyCCtx().
|
static |
Definition at line 430 of file zstd_compress.c.
Referenced by ZSTD_CCtxParams_setParameter().
ZSTD_bounds ZSTD_cParam_getBounds | ( | ZSTD_cParameter | cParam | ) |
ZSTD_cParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped.
Definition at line 268 of file zstd_compress.c.
Referenced by ZSTD_cParam_clampBounds().
Definition at line 64 of file zstd_compress.c.
ZSTD_CCtx * ZSTD_createCCtx_advanced | ( | ZSTD_customMem | customMem | ) |
Definition at line 81 of file zstd_compress.c.
Referenced by ZSTD_createCCtx(), and ZSTD_createCStream_advanced().
ZSTD_CCtx_params * ZSTD_createCCtxParams | ( | void | ) |
Definition at line 218 of file zstd_compress.c.
|
static |
Definition at line 204 of file zstd_compress.c.
Referenced by ZSTD_createCCtxParams().
ZSTD_CDict * ZSTD_createCDict | ( | const void * | dictBuffer, |
size_t | dictSize, | ||
int | compressionLevel | ||
) |
ZSTD_createCDict() : When compressing multiple messages or blocks using the same dictionary, it's recommended to digest the dictionary only once, since it's a costly operation. ZSTD_createCDict() will create a state from digesting a dictionary. The resulting state can be used for future compression operations with very limited startup cost. ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict. Note 1 : Consider experimental function ZSTD_createCDict_byReference()
if you prefer to not duplicate @dictBuffer content. Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, in which case the only thing that it transports is the @compressionLevel. This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, expecting a ZSTD_CDict parameter with any data, including those without a known dictionary.
Definition at line 3447 of file zstd_compress.c.
ZSTD_CDict * ZSTD_createCDict_advanced | ( | const void * | dictBuffer, |
size_t | dictSize, | ||
ZSTD_dictLoadMethod_e | dictLoadMethod, | ||
ZSTD_dictContentType_e | dictContentType, | ||
ZSTD_compressionParameters | cParams, | ||
ZSTD_customMem | customMem | ||
) |
Definition at line 3404 of file zstd_compress.c.
Referenced by ZSTD_createCDict(), ZSTD_createCDict_byReference(), and ZSTD_initLocalDict().
ZSTD_CDict * ZSTD_createCDict_byReference | ( | const void * | dict, |
size_t | dictSize, | ||
int | compressionLevel | ||
) |
Definition at line 3458 of file zstd_compress.c.
ZSTD_CStream * ZSTD_createCStream | ( | void | ) |
Definition at line 3611 of file zstd_compress.c.
ZSTD_CStream * ZSTD_createCStream_advanced | ( | ZSTD_customMem | customMem | ) |
Definition at line 3622 of file zstd_compress.c.
Referenced by zstd_compress(), and ZSTD_createCStream().
recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block.
Definition at line 3638 of file zstd_compress.c.
U32 ZSTD_cycleLog | ( | U32 | hashLog, |
ZSTD_strategy | strat | ||
) |
ZSTD_cycleLog() : condition for correct operation : hashLog > 1
Definition at line 1019 of file zstd_compress.c.
Referenced by ZSTD_adjustCParams_internal(), and ZSTD_overflowCorrectIfNeeded().
size_t ZSTD_endStream | ( | ZSTD_CStream * | zcs, |
ZSTD_outBuffer * | output | ||
) |
Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).
Definition at line 4097 of file zstd_compress.c.
Referenced by zstd_compress().
Definition at line 1179 of file zstd_compress.c.
Definition at line 1173 of file zstd_compress.c.
Referenced by ZSTD_estimateCCtxSize().
Definition at line 1126 of file zstd_compress.c.
Referenced by ZSTD_estimateCCtxSize_usingCParams(), and ZSTD_estimateCStreamSize_usingCCtxParams().
size_t ZSTD_estimateCCtxSize_usingCParams | ( | ZSTD_compressionParameters | cParams | ) |
Definition at line 1167 of file zstd_compress.c.
Referenced by ZSTD_estimateCCtxSize_internal().
Definition at line 3336 of file zstd_compress.c.
size_t ZSTD_estimateCDictSize_advanced | ( | size_t | dictSize, |
ZSTD_compressionParameters | cParams, | ||
ZSTD_dictLoadMethod_e | dictLoadMethod | ||
) |
ZSTD_estimateCDictSize_advanced() : Estimate amount of memory that will be needed to create a dictionary with following arguments
Definition at line 3324 of file zstd_compress.c.
Referenced by ZSTD_estimateCDictSize().
Definition at line 1218 of file zstd_compress.c.
Definition at line 1212 of file zstd_compress.c.
Referenced by ZSTD_estimateCStreamSize().
Definition at line 1190 of file zstd_compress.c.
Referenced by ZSTD_estimateCStreamSize_usingCParams().
size_t ZSTD_estimateCStreamSize_usingCParams | ( | ZSTD_compressionParameters | cParams | ) |
Definition at line 1206 of file zstd_compress.c.
Referenced by ZSTD_estimateCStreamSize_internal().
size_t ZSTD_flushStream | ( | ZSTD_CStream * | zcs, |
ZSTD_outBuffer * | output | ||
) |
Definition at line 4090 of file zstd_compress.c.
Definition at line 147 of file zstd_compress.c.
Referenced by ZSTD_freeCStream().
Definition at line 136 of file zstd_compress.c.
Referenced by ZSTD_compress(), and ZSTD_freeCCtx().
size_t ZSTD_freeCCtxParams | ( | ZSTD_CCtx_params * | params | ) |
size_t ZSTD_freeCDict | ( | ZSTD_CDict * | CDict | ) |
ZSTD_freeCDict() : Function frees memory allocated by ZSTD_createCDict().
Definition at line 3466 of file zstd_compress.c.
Referenced by ZSTD_clearAllDicts(), and ZSTD_createCDict_advanced().
size_t ZSTD_freeCStream | ( | ZSTD_CStream * | zcs | ) |
Definition at line 2801 of file zstd_compress.c.