Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
zstd_compress.c File Reference
#include "../common/allocations.h"
#include "../common/zstd_deps.h"
#include "../common/mem.h"
#include "hist.h"
#include "../common/fse.h"
#include "../common/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"
#include "../common/bits.h"
#include "clevels.h"

Data Structures

struct  ZSTD_CDict_s
 
struct  ZSTD_symbolEncodingTypeStats_t
 
struct  seqStoreSplits
 

Macros

#define FSE_STATIC_LINKING_ONLY   /* FSE_encodeSymbol */
 
#define ZSTD_COMPRESS_HEAPMODE   0
 
#define ZSTD_HASHLOG3_MAX   17
 
#define ZSTD_NO_CLEVEL   0
 
#define BOUNDCHECK(cParam, val)
 
#define CLAMP_TYPE(cParam, val, type)
 
#define CLAMP(cParam, val)
 
#define ZSTD_INDEXOVERFLOW_MARGIN   (16 MB)
 
#define ZSTD_ROWSIZE   16
 
#define SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO   20
 
#define COMPRESS_LITERALS_SIZE_MIN   63 /* heuristic */
 
#define MIN_SEQUENCES_BLOCK_SPLITTING   300
 
#define ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF   (128 KB)
 
#define ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER   (6ULL)
 

Typedefs

typedef size_t(* ZSTD_sequenceCopier) (ZSTD_CCtx *cctx, ZSTD_sequencePosition *seqPos, const ZSTD_Sequence *const inSeqs, size_t inSeqsSize, const void *src, size_t blockSize, ZSTD_paramSwitch_e externalRepSearch)
 

Enumerations

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 }
 

Functions

size_t ZSTD_compressBound (size_t srcSize)
 
ZSTD_CCtxZSTD_createCCtx (void)
 
ZSTD_CCtxZSTD_createCCtx_advanced (ZSTD_customMem customMem)
 
ZSTD_CCtxZSTD_initStaticCCtx (void *workspace, size_t workspaceSize)
 
size_t ZSTD_freeCCtx (ZSTD_CCtx *cctx)
 
size_t ZSTD_sizeof_CCtx (const ZSTD_CCtx *cctx)
 
size_t ZSTD_sizeof_CStream (const ZSTD_CStream *zcs)
 
const seqStore_tZSTD_getSeqStore (const ZSTD_CCtx *ctx)
 
ZSTD_CCtx_params * ZSTD_createCCtxParams (void)
 
size_t ZSTD_freeCCtxParams (ZSTD_CCtx_params *params)
 
size_t ZSTD_CCtxParams_reset (ZSTD_CCtx_params *params)
 
size_t ZSTD_CCtxParams_init (ZSTD_CCtx_params *cctxParams, int compressionLevel)
 
size_t ZSTD_CCtxParams_init_advanced (ZSTD_CCtx_params *cctxParams, ZSTD_parameters params)
 
ZSTD_bounds ZSTD_cParam_getBounds (ZSTD_cParameter param)
 
size_t ZSTD_CCtx_setParameter (ZSTD_CCtx *cctx, ZSTD_cParameter param, int value)
 
size_t ZSTD_CCtxParams_setParameter (ZSTD_CCtx_params *CCtxParams, ZSTD_cParameter param, int value)
 
size_t ZSTD_CCtx_getParameter (ZSTD_CCtx const *cctx, ZSTD_cParameter param, int *value)
 
size_t ZSTD_CCtxParams_getParameter (ZSTD_CCtx_params const *CCtxParams, ZSTD_cParameter param, int *value)
 
size_t ZSTD_CCtx_setParametersUsingCCtxParams (ZSTD_CCtx *cctx, const ZSTD_CCtx_params *params)
 
size_t ZSTD_CCtx_setCParams (ZSTD_CCtx *cctx, ZSTD_compressionParameters cparams)
 
size_t ZSTD_CCtx_setFParams (ZSTD_CCtx *cctx, ZSTD_frameParameters fparams)
 
size_t ZSTD_CCtx_setParams (ZSTD_CCtx *cctx, ZSTD_parameters params)
 
size_t ZSTD_CCtx_setPledgedSrcSize (ZSTD_CCtx *cctx, unsigned long long pledgedSrcSize)
 
size_t ZSTD_CCtx_loadDictionary_advanced (ZSTD_CCtx *cctx, const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_CCtx_loadDictionary_byReference (ZSTD_CCtx *cctx, const void *dict, size_t dictSize)
 
size_t ZSTD_CCtx_loadDictionary (ZSTD_CCtx *cctx, const void *dict, size_t dictSize)
 
size_t ZSTD_CCtx_refCDict (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict)
 
size_t ZSTD_CCtx_refThreadPool (ZSTD_CCtx *cctx, ZSTD_threadPool *pool)
 
size_t ZSTD_CCtx_refPrefix (ZSTD_CCtx *cctx, const void *prefix, size_t prefixSize)
 
size_t ZSTD_CCtx_refPrefix_advanced (ZSTD_CCtx *cctx, const void *prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_CCtx_reset (ZSTD_CCtx *cctx, ZSTD_ResetDirective reset)
 
size_t ZSTD_checkCParams (ZSTD_compressionParameters cParams)
 
U32 ZSTD_cycleLog (U32 hashLog, ZSTD_strategy strat)
 
ZSTD_compressionParameters ZSTD_adjustCParams (ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize)
 
ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams (const ZSTD_CCtx_params *CCtxParams, U64 srcSizeHint, size_t dictSize, ZSTD_cParamMode_e mode)
 
size_t ZSTD_estimateCCtxSize_usingCCtxParams (const ZSTD_CCtx_params *params)
 
size_t ZSTD_estimateCCtxSize_usingCParams (ZSTD_compressionParameters cParams)
 
size_t ZSTD_estimateCCtxSize (int compressionLevel)
 
size_t ZSTD_estimateCStreamSize_usingCCtxParams (const ZSTD_CCtx_params *params)
 
size_t ZSTD_estimateCStreamSize_usingCParams (ZSTD_compressionParameters cParams)
 
size_t ZSTD_estimateCStreamSize (int compressionLevel)
 
ZSTD_frameProgression ZSTD_getFrameProgression (const ZSTD_CCtx *cctx)
 
size_t ZSTD_toFlushNow (ZSTD_CCtx *cctx)
 
void ZSTD_reset_compressedBlockState (ZSTD_compressedBlockState_t *bs)
 
void ZSTD_invalidateRepCodes (ZSTD_CCtx *cctx)
 
size_t ZSTD_copyCCtx (ZSTD_CCtx *dstCCtx, const ZSTD_CCtx *srcCCtx, unsigned long long pledgedSrcSize)
 
FORCE_INLINE_TEMPLATE void ZSTD_reduceTable_internal (U32 *const table, U32 const size, U32 const reducerValue, int const preserveMark)
 
int ZSTD_seqToCodes (const seqStore_t *seqStorePtr)
 
MEM_STATIC size_t ZSTD_entropyCompressSeqStore_internal (const 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)
 
MEM_STATIC size_t ZSTD_entropyCompressSeqStore (const 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)
 
ZSTD_blockCompressor ZSTD_selectBlockCompressor (ZSTD_strategy strat, ZSTD_paramSwitch_e useRowMatchFinder, ZSTD_dictMode_e dictMode)
 
void ZSTD_resetSeqStore (seqStore_t *ssPtr)
 
size_t ZSTD_sequenceBound (size_t srcSize)
 
size_t ZSTD_generateSequences (ZSTD_CCtx *zc, ZSTD_Sequence *outSeqs, size_t outSeqsSize, const void *src, size_t srcSize)
 
size_t ZSTD_mergeBlockDelimiters (ZSTD_Sequence *sequences, size_t seqsSize)
 
size_t ZSTD_buildBlockEntropyStats (const seqStore_t *seqStorePtr, const ZSTD_entropyCTables_t *prevEntropy, ZSTD_entropyCTables_t *nextEntropy, const ZSTD_CCtx_params *cctxParams, ZSTD_entropyCTablesMetadata_t *entropyMetadata, void *workspace, size_t wkspSize)
 
size_t ZSTD_writeSkippableFrame (void *dst, size_t dstCapacity, const void *src, size_t srcSize, unsigned magicVariant)
 
size_t ZSTD_writeLastEmptyBlock (void *dst, size_t dstCapacity)
 
size_t ZSTD_referenceExternalSequences (ZSTD_CCtx *cctx, rawSeq *seq, size_t nbSeq)
 
size_t ZSTD_compressContinue_public (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressContinue (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_getBlockSize (const ZSTD_CCtx *cctx)
 
size_t ZSTD_compressBlock_deprecated (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressBlock (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_loadCEntropy (ZSTD_compressedBlockState_t *bs, void *workspace, const void *const dict, size_t dictSize)
 
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)
 
size_t ZSTD_compressBegin_advanced (ZSTD_CCtx *cctx, const void *dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize)
 
size_t ZSTD_compressBegin_usingDict (ZSTD_CCtx *cctx, const void *dict, size_t dictSize, int compressionLevel)
 
size_t ZSTD_compressBegin (ZSTD_CCtx *cctx, int compressionLevel)
 
void ZSTD_CCtx_trace (ZSTD_CCtx *cctx, size_t extraCSize)
 
size_t ZSTD_compressEnd_public (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressEnd (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
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)
 
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)
 
size_t ZSTD_compress_usingDict (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const void *dict, size_t dictSize, int compressionLevel)
 
size_t ZSTD_compressCCtx (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, int compressionLevel)
 
size_t ZSTD_compress (void *dst, size_t dstCapacity, const void *src, size_t srcSize, int compressionLevel)
 
size_t ZSTD_estimateCDictSize_advanced (size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod)
 
size_t ZSTD_estimateCDictSize (size_t dictSize, int compressionLevel)
 
size_t ZSTD_sizeof_CDict (const ZSTD_CDict *cdict)
 
ZSTD_CDictZSTD_createCDict_advanced (const void *dictBuffer, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType, ZSTD_compressionParameters cParams, ZSTD_customMem customMem)
 
ZSTD_CDictZSTD_createCDict_advanced2 (const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType, const ZSTD_CCtx_params *originalCctxParams, ZSTD_customMem customMem)
 
ZSTD_CDictZSTD_createCDict (const void *dict, size_t dictSize, int compressionLevel)
 
ZSTD_CDictZSTD_createCDict_byReference (const void *dict, size_t dictSize, int compressionLevel)
 
size_t ZSTD_freeCDict (ZSTD_CDict *cdict)
 
const ZSTD_CDictZSTD_initStaticCDict (void *workspace, size_t workspaceSize, const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType, ZSTD_compressionParameters cParams)
 
ZSTD_compressionParameters ZSTD_getCParamsFromCDict (const ZSTD_CDict *cdict)
 
unsigned ZSTD_getDictID_fromCDict (const ZSTD_CDict *cdict)
 
size_t ZSTD_compressBegin_usingCDict_advanced (ZSTD_CCtx *const cctx, const ZSTD_CDict *const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize)
 
size_t ZSTD_compressBegin_usingCDict_deprecated (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict)
 
size_t ZSTD_compressBegin_usingCDict (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict)
 
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)
 
size_t ZSTD_compress_usingCDict (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const ZSTD_CDict *cdict)
 
ZSTD_CStreamZSTD_createCStream (void)
 
ZSTD_CStreamZSTD_initStaticCStream (void *workspace, size_t workspaceSize)
 
ZSTD_CStreamZSTD_createCStream_advanced (ZSTD_customMem customMem)
 
size_t ZSTD_freeCStream (ZSTD_CStream *zcs)
 
size_t ZSTD_CStreamInSize (void)
 
size_t ZSTD_CStreamOutSize (void)
 
size_t ZSTD_resetCStream (ZSTD_CStream *zcs, unsigned long long pss)
 
size_t ZSTD_initCStream_internal (ZSTD_CStream *zcs, const void *dict, size_t dictSize, const ZSTD_CDict *cdict, const ZSTD_CCtx_params *params, unsigned long long pledgedSrcSize)
 
size_t ZSTD_initCStream_usingCDict_advanced (ZSTD_CStream *zcs, const ZSTD_CDict *cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize)
 
size_t ZSTD_initCStream_usingCDict (ZSTD_CStream *zcs, const ZSTD_CDict *cdict)
 
size_t ZSTD_initCStream_advanced (ZSTD_CStream *zcs, const void *dict, size_t dictSize, ZSTD_parameters params, unsigned long long pss)
 
size_t ZSTD_initCStream_usingDict (ZSTD_CStream *zcs, const void *dict, size_t dictSize, int compressionLevel)
 
size_t ZSTD_initCStream_srcSize (ZSTD_CStream *zcs, int compressionLevel, unsigned long long pss)
 
size_t ZSTD_initCStream (ZSTD_CStream *zcs, int compressionLevel)
 
size_t ZSTD_compressStream (ZSTD_CStream *zcs, ZSTD_outBuffer *output, ZSTD_inBuffer *input)
 
size_t ZSTD_compressStream2 (ZSTD_CCtx *cctx, ZSTD_outBuffer *output, ZSTD_inBuffer *input, ZSTD_EndDirective endOp)
 
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)
 
size_t ZSTD_compress2 (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_copySequencesToSeqStoreExplicitBlockDelim (ZSTD_CCtx *cctx, ZSTD_sequencePosition *seqPos, const ZSTD_Sequence *const inSeqs, size_t inSeqsSize, const void *src, size_t blockSize, ZSTD_paramSwitch_e externalRepSearch)
 
size_t ZSTD_copySequencesToSeqStoreNoBlockDelim (ZSTD_CCtx *cctx, ZSTD_sequencePosition *seqPos, const ZSTD_Sequence *const inSeqs, size_t inSeqsSize, const void *src, size_t blockSize, ZSTD_paramSwitch_e externalRepSearch)
 
size_t ZSTD_compressSequences (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const ZSTD_Sequence *inSeqs, size_t inSeqsSize, const void *src, size_t srcSize)
 
size_t ZSTD_flushStream (ZSTD_CStream *zcs, ZSTD_outBuffer *output)
 
size_t ZSTD_endStream (ZSTD_CStream *zcs, ZSTD_outBuffer *output)
 
int ZSTD_maxCLevel (void)
 
int ZSTD_minCLevel (void)
 
int ZSTD_defaultCLevel (void)
 
ZSTD_compressionParameters ZSTD_getCParams (int compressionLevel, unsigned long long srcSizeHint, size_t dictSize)
 
ZSTD_parameters ZSTD_getParams (int compressionLevel, unsigned long long srcSizeHint, size_t dictSize)
 
void ZSTD_registerSequenceProducer (ZSTD_CCtx *zc, void *mState, ZSTD_sequenceProducer_F *mFinder)
 

Macro Definition Documentation

◆ BOUNDCHECK

#define BOUNDCHECK ( cParam,
val )
Value:
{ \
RETURN_ERROR_IF(!ZSTD_cParam_withinBounds(cParam,val), \
parameter_outOfBound, "Param out of bounds"); \
}
MEM_STATIC int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value)
Definition zstd_compress_internal.h:497

◆ CLAMP

#define CLAMP ( cParam,
val )
Value:
CLAMP_TYPE(cParam, val, unsigned)
#define CLAMP_TYPE(cParam, val, type)

◆ CLAMP_TYPE

#define CLAMP_TYPE ( cParam,
val,
type )
Value:
{ \
ZSTD_bounds const bounds = ZSTD_cParam_getBounds(cParam); \
if ((int)val<bounds.lowerBound) val=(type)bounds.lowerBound; \
else if ((int)val>bounds.upperBound) val=(type)bounds.upperBound; \
}
Definition zstd.h:445
int lowerBound
Definition zstd.h:447
if(BZ_OK !=ret)
Definition zlib_interface.c:31
ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
Definition zstd_compress.c:386

◆ COMPRESS_LITERALS_SIZE_MIN

#define COMPRESS_LITERALS_SIZE_MIN   63 /* heuristic */

◆ FSE_STATIC_LINKING_ONLY

#define FSE_STATIC_LINKING_ONLY   /* FSE_encodeSymbol */

◆ MIN_SEQUENCES_BLOCK_SPLITTING

#define MIN_SEQUENCES_BLOCK_SPLITTING   300

◆ SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO

#define SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO   20

◆ ZSTD_COMPRESS_HEAPMODE

#define ZSTD_COMPRESS_HEAPMODE   0

COMPRESS_HEAPMODE : Select how default decompression function ZSTD_compress() allocates its context, on stack (0, default), or into heap (1). Note that functions with explicit context such as ZSTD_compressCCtx() are unaffected.

◆ ZSTD_HASHLOG3_MAX

#define ZSTD_HASHLOG3_MAX   17

ZSTD_HASHLOG3_MAX : Maximum size of the hash table dedicated to find 3-bytes matches, in log format, aka 17 => 1 << 17 == 128Ki positions. This structure is only used in zstd_opt. Since allocation is centralized for all strategies, it has to be known here. The actual (selected) size of the hash table is then stored in ZSTD_matchState_t.hashLog3, so that zstd_opt.c doesn't need to know about this constant.

◆ ZSTD_INDEXOVERFLOW_MARGIN

#define ZSTD_INDEXOVERFLOW_MARGIN   (16 MB)

◆ ZSTD_NO_CLEVEL

#define ZSTD_NO_CLEVEL   0

◆ ZSTD_ROWSIZE

#define ZSTD_ROWSIZE   16

◆ ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER

#define ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER   (6ULL)

◆ ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF

#define ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF   (128 KB)

Typedef Documentation

◆ ZSTD_sequenceCopier

typedef size_t(* ZSTD_sequenceCopier) (ZSTD_CCtx *cctx, ZSTD_sequencePosition *seqPos, const ZSTD_Sequence *const inSeqs, size_t inSeqsSize, const void *src, size_t blockSize, ZSTD_paramSwitch_e externalRepSearch)

Enumeration Type Documentation

◆ ZSTD_buildSeqStore_e

Enumerator
ZSTDbss_compress 
ZSTDbss_noCompress 

◆ ZSTD_compResetPolicy_e

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 

◆ ZSTD_indexResetPolicy_e

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 

◆ ZSTD_resetTarget_e

Enumerator
ZSTD_resetTarget_CDict 
ZSTD_resetTarget_CCtx 

Function Documentation

◆ ZSTD_adjustCParams()

ZSTD_compressionParameters ZSTD_adjustCParams ( ZSTD_compressionParameters cPar,
unsigned long long srcSize,
size_t dictSize )

◆ ZSTD_buildBlockEntropyStats()

size_t ZSTD_buildBlockEntropyStats ( const seqStore_t * seqStorePtr,
const ZSTD_entropyCTables_t * prevEntropy,
ZSTD_entropyCTables_t * nextEntropy,
const ZSTD_CCtx_params * cctxParams,
ZSTD_entropyCTablesMetadata_t * entropyMetadata,
void * workspace,
size_t wkspSize )

ZSTD_buildBlockEntropyStats() : Builds entropy for the block. Requires workspace size ENTROPY_WORKSPACE_SIZE

Returns
: 0 on success, or an error code Note : also employed in superblock

◆ ZSTD_CCtx_getParameter()

size_t ZSTD_CCtx_getParameter ( ZSTD_CCtx const * cctx,
ZSTD_cParameter param,
int * value )

◆ ZSTD_CCtx_loadDictionary()

size_t ZSTD_CCtx_loadDictionary ( ZSTD_CCtx * cctx,
const void * dict,
size_t dictSize )

ZSTD_CCtx_loadDictionary() : Requires v1.4.0+ Create an internal CDict from dict buffer. Decompression will have to use same dictionary.

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, meaning "return to no-dictionary mode". Note 1 : Dictionary is sticky, it will be used for all future compressed frames. To return to "no-dictionary" situation, load a NULL dictionary (or reset parameters). Note 2 : Loading a dictionary involves building tables. It's also a CPU consuming operation, with non-negligible impact on latency. Tables are dependent on compression parameters, and for this reason, compression parameters can no longer be changed after loading a dictionary. Note 3 :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.

◆ ZSTD_CCtx_loadDictionary_advanced()

size_t ZSTD_CCtx_loadDictionary_advanced ( ZSTD_CCtx * cctx,
const void * dict,
size_t dictSize,
ZSTD_dictLoadMethod_e dictLoadMethod,
ZSTD_dictContentType_e dictContentType )

◆ ZSTD_CCtx_loadDictionary_byReference()

size_t ZSTD_CCtx_loadDictionary_byReference ( ZSTD_CCtx * cctx,
const void * dict,
size_t dictSize )

◆ ZSTD_CCtx_refCDict()

size_t ZSTD_CCtx_refCDict ( ZSTD_CCtx * cctx,
const ZSTD_CDict * cdict )

ZSTD_CCtx_refCDict() : Requires v1.4.0+ 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 labelled 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.

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Special : Referencing a NULL CDict means "return to no-dictionary mode". Note 1 : Currently, only one dictionary can be managed. Referencing a new dictionary effectively "discards" any previous one. Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx.

◆ ZSTD_CCtx_refPrefix()

size_t ZSTD_CCtx_refPrefix ( ZSTD_CCtx * cctx,
const void * prefix,
size_t prefixSize )

ZSTD_CCtx_refPrefix() : Requires v1.4.0+ 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).

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary Note 1 : Prefix buffer is referenced. It must outlive compression. Its content must remain unmodified during compression. Note 2 : If the intention is to diff some large src data blob with some prior version of itself, ensure that the window size is large enough to contain the entire source. See ZSTD_c_windowLog. Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. It's a CPU consuming operation, with non-negligible impact on latency. If there is a need to use the same prefix multiple times, consider loadDictionary instead. Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation.

◆ ZSTD_CCtx_refPrefix_advanced()

size_t ZSTD_CCtx_refPrefix_advanced ( ZSTD_CCtx * cctx,
const void * prefix,
size_t prefixSize,
ZSTD_dictContentType_e dictContentType )

◆ ZSTD_CCtx_refThreadPool()

size_t ZSTD_CCtx_refThreadPool ( ZSTD_CCtx * cctx,
ZSTD_threadPool * pool )

◆ ZSTD_CCtx_reset()

size_t ZSTD_CCtx_reset ( ZSTD_CCtx * cctx,
ZSTD_ResetDirective reset )

ZSTD_CCtx_reset() : Also dumps dictionary

◆ ZSTD_CCtx_setCParams()

size_t ZSTD_CCtx_setCParams ( ZSTD_CCtx * cctx,
ZSTD_compressionParameters cparams )

◆ ZSTD_CCtx_setFParams()

size_t ZSTD_CCtx_setFParams ( ZSTD_CCtx * cctx,
ZSTD_frameParameters fparams )

◆ ZSTD_CCtx_setParameter()

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()).

Returns
: an error code (which can be tested using ZSTD_isError()).

◆ ZSTD_CCtx_setParametersUsingCCtxParams()

size_t ZSTD_CCtx_setParametersUsingCCtxParams ( ZSTD_CCtx * cctx,
const ZSTD_CCtx_params * params )

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.

◆ ZSTD_CCtx_setParams()

size_t ZSTD_CCtx_setParams ( ZSTD_CCtx * cctx,
ZSTD_parameters params )

◆ ZSTD_CCtx_setPledgedSrcSize()

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.

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN. ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. Note 2 : pledgedSrcSize is only valid once, for the next frame. It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. Note 3 : Whenever all input data is provided and consumed in a single round, for example with ZSTD_compress2(), or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), this value is automatically overridden by srcSize instead.

◆ ZSTD_CCtx_trace()

void ZSTD_CCtx_trace ( ZSTD_CCtx * cctx,
size_t extraCSize )

ZSTD_CCtx_trace() : Trace the end of a compression call.

◆ ZSTD_CCtxParams_getParameter()

size_t ZSTD_CCtxParams_getParameter ( ZSTD_CCtx_params const * CCtxParams,
ZSTD_cParameter param,
int * value )

◆ ZSTD_CCtxParams_init()

size_t ZSTD_CCtxParams_init ( ZSTD_CCtx_params * cctxParams,
int compressionLevel )

◆ ZSTD_CCtxParams_init_advanced()

size_t ZSTD_CCtxParams_init_advanced ( ZSTD_CCtx_params * cctxParams,
ZSTD_parameters params )

◆ ZSTD_CCtxParams_reset()

size_t ZSTD_CCtxParams_reset ( ZSTD_CCtx_params * params)

◆ ZSTD_CCtxParams_setParameter()

size_t ZSTD_CCtxParams_setParameter ( ZSTD_CCtx_params * CCtxParams,
ZSTD_cParameter param,
int value )

◆ ZSTD_checkCParams()

size_t ZSTD_checkCParams ( ZSTD_compressionParameters cParams)

ZSTD_checkCParams() : control CParam values remain within authorized range.

Returns
: 0, or an error code if one value is beyond authorized range

◆ ZSTD_compress()

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).

Returns
: compressed size written into dst (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).

◆ ZSTD_compress2()

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.

  • Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()
  • The function is always blocking, returns when compression is completed. Hint : compression runs faster if dstCapacity >= ZSTD_compressBound(srcSize).
    Returns
    : compressed size written into dst (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).

◆ ZSTD_compress_advanced()

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 )

◆ ZSTD_compress_advanced_internal()

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 )

◆ ZSTD_compress_usingCDict()

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

◆ ZSTD_compress_usingCDict_advanced()

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 )

ZSTD_compress_usingCDict_advanced(): This function is DEPRECATED.

◆ ZSTD_compress_usingDict()

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 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.

◆ ZSTD_compressBegin()

size_t ZSTD_compressBegin ( ZSTD_CCtx * cctx,
int compressionLevel )

◆ ZSTD_compressBegin_advanced()

size_t ZSTD_compressBegin_advanced ( ZSTD_CCtx * cctx,
const void * dict,
size_t dictSize,
ZSTD_parameters params,
unsigned long long pledgedSrcSize )

ZSTD_compressBegin_advanced() :

Returns
: 0, or an error code

◆ ZSTD_compressBegin_advanced_internal()

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 )

◆ ZSTD_compressBegin_usingCDict()

size_t ZSTD_compressBegin_usingCDict ( ZSTD_CCtx * cctx,
const ZSTD_CDict * cdict )

◆ ZSTD_compressBegin_usingCDict_advanced()

size_t ZSTD_compressBegin_usingCDict_advanced ( ZSTD_CCtx *const cctx,
const ZSTD_CDict *const cdict,
ZSTD_frameParameters const fParams,
unsigned long long const pledgedSrcSize )

◆ ZSTD_compressBegin_usingCDict_deprecated()

size_t ZSTD_compressBegin_usingCDict_deprecated ( ZSTD_CCtx * cctx,
const ZSTD_CDict * cdict )

◆ ZSTD_compressBegin_usingDict()

size_t ZSTD_compressBegin_usingDict ( ZSTD_CCtx * cctx,
const void * dict,
size_t dictSize,
int compressionLevel )

◆ ZSTD_compressBlock()

size_t ZSTD_compressBlock ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

◆ ZSTD_compressBlock_deprecated()

size_t ZSTD_compressBlock_deprecated ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

◆ ZSTD_compressBound()

size_t ZSTD_compressBound ( size_t srcSize)

maximum compressed size in worst case single-pass scenario

◆ ZSTD_compressCCtx()

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.

◆ ZSTD_compressContinue()

size_t ZSTD_compressContinue ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

◆ ZSTD_compressContinue_public()

size_t ZSTD_compressContinue_public ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

◆ ZSTD_compressEnd()

size_t ZSTD_compressEnd ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

◆ ZSTD_compressEnd_public()

size_t ZSTD_compressEnd_public ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize )

◆ ZSTD_compressSequences()

size_t ZSTD_compressSequences ( ZSTD_CCtx * cctx,
void * dst,
size_t dstCapacity,
const ZSTD_Sequence * inSeqs,
size_t inSeqsSize,
const void * src,
size_t srcSize )

◆ ZSTD_compressStream()

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).

◆ ZSTD_compressStream2()

size_t ZSTD_compressStream2 ( ZSTD_CCtx * cctx,
ZSTD_outBuffer * output,
ZSTD_inBuffer * input,
ZSTD_EndDirective endOp )

ZSTD_compressStream2() : Requires v1.4.0+ Behaves about the same as ZSTD_compressStream, with additional control on end directive.

  • Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()
  • Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)
  • output->pos must be <= dstCapacity, input->pos must be <= srcSize
  • output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.
  • endOp must be a valid directive
  • When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller.
  • When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available, and then immediately returns, just indicating that there is some data remaining to be flushed. The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.
  • Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking.
  • Returns
    provides a minimum amount of data remaining to be flushed from internal buffers or an error code, which can be tested using ZSTD_isError(). if
    != 0, flush is not fully completed, there is still some data left within internal buffers. This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers. For ZSTD_e_end,
    == 0 when internal buffers are fully flushed and frame is completed.
  • after a ZSTD_e_end directive, if internal buffer is not fully flushed (
    Returns
    != 0), only ZSTD_e_end or ZSTD_e_flush operations are allowed. Before starting a new compression job, or changing compression parameters, it is required to fully flush internal buffers.

◆ ZSTD_compressStream2_simpleArgs()

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 )

◆ ZSTD_copyCCtx()

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".

Returns
: 0, or an error code

◆ ZSTD_copySequencesToSeqStoreExplicitBlockDelim()

size_t ZSTD_copySequencesToSeqStoreExplicitBlockDelim ( ZSTD_CCtx * cctx,
ZSTD_sequencePosition * seqPos,
const ZSTD_Sequence *const inSeqs,
size_t inSeqsSize,
const void * src,
size_t blockSize,
ZSTD_paramSwitch_e externalRepSearch )

◆ ZSTD_copySequencesToSeqStoreNoBlockDelim()

size_t ZSTD_copySequencesToSeqStoreNoBlockDelim ( ZSTD_CCtx * cctx,
ZSTD_sequencePosition * seqPos,
const ZSTD_Sequence *const inSeqs,
size_t inSeqsSize,
const void * src,
size_t blockSize,
ZSTD_paramSwitch_e externalRepSearch )

◆ ZSTD_cParam_getBounds()

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.

Returns
: a structure, ZSTD_bounds, which contains
  • an error status field, which must be tested using ZSTD_isError()
  • lower and upper bounds, both inclusive

◆ ZSTD_createCCtx()

ZSTD_CCtx * ZSTD_createCCtx ( void )

◆ ZSTD_createCCtx_advanced()

ZSTD_CCtx * ZSTD_createCCtx_advanced ( ZSTD_customMem customMem)

◆ ZSTD_createCCtxParams()

ZSTD_CCtx_params * ZSTD_createCCtxParams ( void )

◆ ZSTD_createCDict()

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.

◆ ZSTD_createCDict_advanced()

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 )

◆ ZSTD_createCDict_advanced2()

ZSTD_CDict * ZSTD_createCDict_advanced2 ( const void * dict,
size_t dictSize,
ZSTD_dictLoadMethod_e dictLoadMethod,
ZSTD_dictContentType_e dictContentType,
const ZSTD_CCtx_params * originalCctxParams,
ZSTD_customMem customMem )

◆ ZSTD_createCDict_byReference()

ZSTD_CDict * ZSTD_createCDict_byReference ( const void * dict,
size_t dictSize,
int compressionLevel )

◆ ZSTD_createCStream()

ZSTD_CStream * ZSTD_createCStream ( void )

◆ ZSTD_createCStream_advanced()

ZSTD_CStream * ZSTD_createCStream_advanced ( ZSTD_customMem customMem)

◆ ZSTD_CStreamInSize()

size_t ZSTD_CStreamInSize ( void )

recommended size for input buffer

◆ ZSTD_CStreamOutSize()

size_t ZSTD_CStreamOutSize ( void )

recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block.

◆ ZSTD_cycleLog()

U32 ZSTD_cycleLog ( U32 hashLog,
ZSTD_strategy strat )

ZSTD_cycleLog() : condition for correct operation : hashLog > 1

◆ ZSTD_defaultCLevel()

int ZSTD_defaultCLevel ( void )

default compression level, specified by ZSTD_CLEVEL_DEFAULT, requires v1.5.0+

◆ ZSTD_endStream()

size_t ZSTD_endStream ( ZSTD_CStream * zcs,
ZSTD_outBuffer * output )

Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).

◆ ZSTD_entropyCompressSeqStore()

MEM_STATIC size_t ZSTD_entropyCompressSeqStore ( const 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 )

◆ ZSTD_entropyCompressSeqStore_internal()

MEM_STATIC size_t ZSTD_entropyCompressSeqStore_internal ( const 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 )

◆ ZSTD_estimateCCtxSize()

size_t ZSTD_estimateCCtxSize ( int compressionLevel)

◆ ZSTD_estimateCCtxSize_usingCCtxParams()

size_t ZSTD_estimateCCtxSize_usingCCtxParams ( const ZSTD_CCtx_params * params)

◆ ZSTD_estimateCCtxSize_usingCParams()

size_t ZSTD_estimateCCtxSize_usingCParams ( ZSTD_compressionParameters cParams)

◆ ZSTD_estimateCDictSize()

size_t ZSTD_estimateCDictSize ( size_t dictSize,
int compressionLevel )

◆ ZSTD_estimateCDictSize_advanced()

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

◆ ZSTD_estimateCStreamSize()

size_t ZSTD_estimateCStreamSize ( int compressionLevel)

◆ ZSTD_estimateCStreamSize_usingCCtxParams()

size_t ZSTD_estimateCStreamSize_usingCCtxParams ( const ZSTD_CCtx_params * params)

◆ ZSTD_estimateCStreamSize_usingCParams()

size_t ZSTD_estimateCStreamSize_usingCParams ( ZSTD_compressionParameters cParams)

◆ ZSTD_flushStream()

size_t ZSTD_flushStream ( ZSTD_CStream * zcs,
ZSTD_outBuffer * output )

ZSTD_flushStream() :

Returns
: amount of data remaining to flush

◆ ZSTD_freeCCtx()

size_t ZSTD_freeCCtx ( ZSTD_CCtx * cctx)

◆ ZSTD_freeCCtxParams()

size_t ZSTD_freeCCtxParams ( ZSTD_CCtx_params * params)

◆ ZSTD_freeCDict()

size_t ZSTD_freeCDict ( ZSTD_CDict * CDict)

ZSTD_freeCDict() : Function frees memory allocated by ZSTD_createCDict(). If a NULL pointer is passed, no operation is performed.

◆ ZSTD_freeCStream()

size_t ZSTD_freeCStream ( ZSTD_CStream * zcs)

◆ ZSTD_generateSequences()

size_t ZSTD_generateSequences ( ZSTD_CCtx * zc,
ZSTD_Sequence * outSeqs,
size_t outSeqsSize,
const void * src,
size_t srcSize )

◆ ZSTD_getBlockSize()

size_t ZSTD_getBlockSize ( const ZSTD_CCtx * cctx)

◆ ZSTD_getCParams()

ZSTD_compressionParameters ZSTD_getCParams ( int compressionLevel,
unsigned long long srcSizeHint,
size_t dictSize )

ZSTD_getCParams() :

Returns
ZSTD_compressionParameters structure for a selected compression level, srcSize and dictSize. Size values are optional, provide 0 if not known or unused

◆ ZSTD_getCParamsFromCCtxParams()

ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams ( const ZSTD_CCtx_params * CCtxParams,
U64 srcSizeHint,
size_t dictSize,
ZSTD_cParamMode_e mode )

◆ ZSTD_getCParamsFromCDict()

ZSTD_compressionParameters ZSTD_getCParamsFromCDict ( const ZSTD_CDict * cdict)

ZSTD_getCParamsFromCDict() : as the name implies

◆ ZSTD_getDictID_fromCDict()

unsigned ZSTD_getDictID_fromCDict ( const ZSTD_CDict * cdict)

ZSTD_getDictID_fromCDict() : Provides the dictID of the dictionary loaded into cdict. If

Returns
== 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries.

◆ ZSTD_getFrameProgression()

ZSTD_frameProgression ZSTD_getFrameProgression ( const ZSTD_CCtx * cctx)

◆ ZSTD_getParams()

ZSTD_parameters ZSTD_getParams ( int compressionLevel,
unsigned long long srcSizeHint,
size_t dictSize )

ZSTD_getParams() : same idea as ZSTD_getCParams()

Returns
a ZSTD_parameters structure (instead of ZSTD_compressionParameters). Fields of ZSTD_frameParameters are set to default values

◆ ZSTD_getSeqStore()

const seqStore_t * ZSTD_getSeqStore ( const ZSTD_CCtx * ctx)

◆ ZSTD_initCStream()

size_t ZSTD_initCStream ( ZSTD_CStream * zcs,
int compressionLevel )

Equivalent to:

ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);
ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)
ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);

◆ ZSTD_initCStream_advanced()

size_t ZSTD_initCStream_advanced ( ZSTD_CStream * zcs,
const void * dict,
size_t dictSize,
ZSTD_parameters params,
unsigned long long pss )

◆ ZSTD_initCStream_internal()

size_t ZSTD_initCStream_internal ( ZSTD_CStream * zcs,
const void * dict,
size_t dictSize,
const ZSTD_CDict * cdict,
const ZSTD_CCtx_params * params,
unsigned long long pledgedSrcSize )

ZSTD_initCStream_internal() : Note : for lib/compress only. Used by zstdmt_compress.c. Assumption 1 : params are valid Assumption 2 : either dict, or cdict, is defined, not both

◆ ZSTD_initCStream_srcSize()

size_t ZSTD_initCStream_srcSize ( ZSTD_CStream * zcs,
int compressionLevel,
unsigned long long pss )

◆ ZSTD_initCStream_usingCDict()

size_t ZSTD_initCStream_usingCDict ( ZSTD_CStream * zcs,
const ZSTD_CDict * cdict )

◆ ZSTD_initCStream_usingCDict_advanced()

size_t ZSTD_initCStream_usingCDict_advanced ( ZSTD_CStream * zcs,
const ZSTD_CDict * cdict,
ZSTD_frameParameters fParams,
unsigned long long pledgedSrcSize )

◆ ZSTD_initCStream_usingDict()

size_t ZSTD_initCStream_usingDict ( ZSTD_CStream * zcs,
const void * dict,
size_t dictSize,
int compressionLevel )

◆ ZSTD_initStaticCCtx()

ZSTD_CCtx * ZSTD_initStaticCCtx ( void * workspace,
size_t workspaceSize )

◆ ZSTD_initStaticCDict()

const ZSTD_CDict * ZSTD_initStaticCDict ( void * workspace,
size_t workspaceSize,
const void * dict,
size_t dictSize,
ZSTD_dictLoadMethod_e dictLoadMethod,
ZSTD_dictContentType_e dictContentType,
ZSTD_compressionParameters cParams )

ZSTD_initStaticCDict_advanced() : Generate a digested dictionary in provided memory area. workspace: The memory area to emplace the dictionary into. Provided pointer must 8-bytes aligned. It must outlive dictionary usage. workspaceSize: Use ZSTD_estimateCDictSize() to determine how large workspace must be. cParams : use ZSTD_getCParams() to transform a compression level into its relevants cParams.

Returns
: pointer to ZSTD_CDict*, or NULL if error (size too small) Note : there is no corresponding "free" function. Since workspace was allocated externally, it must be freed externally.

◆ ZSTD_initStaticCStream()

ZSTD_CStream * ZSTD_initStaticCStream ( void * workspace,
size_t workspaceSize )

◆ ZSTD_invalidateRepCodes()

void ZSTD_invalidateRepCodes ( ZSTD_CCtx * cctx)

◆ ZSTD_loadCEntropy()

size_t ZSTD_loadCEntropy ( ZSTD_compressedBlockState_t * bs,
void * workspace,
const void *const dict,
size_t dictSize )

◆ ZSTD_maxCLevel()

int ZSTD_maxCLevel ( void )

maximum compression level available

◆ ZSTD_mergeBlockDelimiters()

size_t ZSTD_mergeBlockDelimiters ( ZSTD_Sequence * sequences,
size_t seqsSize )

◆ ZSTD_minCLevel()

int ZSTD_minCLevel ( void )

minimum negative compression level allowed, requires v1.4.0+

◆ ZSTD_reduceTable_internal()

FORCE_INLINE_TEMPLATE void ZSTD_reduceTable_internal ( U32 *const table,
U32 const size,
U32 const reducerValue,
int const preserveMark )

ZSTD_reduceTable() : reduce table indexes by reducerValue, or squash to zero. PreserveMark preserves "unsorted mark" for btlazy2 strategy. It must be set to a clear 0/1 value, to remove branch during inlining. Presume table size is a multiple of ZSTD_ROWSIZE to help auto-vectorization

◆ ZSTD_referenceExternalSequences()

size_t ZSTD_referenceExternalSequences ( ZSTD_CCtx * cctx,
rawSeq * seq,
size_t nbSeq )

◆ ZSTD_registerSequenceProducer()

void ZSTD_registerSequenceProducer ( ZSTD_CCtx * zc,
void * mState,
ZSTD_sequenceProducer_F * mFinder )

◆ ZSTD_reset_compressedBlockState()

void ZSTD_reset_compressedBlockState ( ZSTD_compressedBlockState_t * bs)

◆ ZSTD_resetCStream()

size_t ZSTD_resetCStream ( ZSTD_CStream * zcs,
unsigned long long pss )

◆ ZSTD_resetSeqStore()

void ZSTD_resetSeqStore ( seqStore_t * ssPtr)

◆ ZSTD_selectBlockCompressor()

ZSTD_blockCompressor ZSTD_selectBlockCompressor ( ZSTD_strategy strat,
ZSTD_paramSwitch_e useRowMatchFinder,
ZSTD_dictMode_e dictMode )

◆ ZSTD_seqToCodes()

int ZSTD_seqToCodes ( const seqStore_t * seqStorePtr)

◆ ZSTD_sequenceBound()

size_t ZSTD_sequenceBound ( size_t srcSize)

◆ ZSTD_sizeof_CCtx()

size_t ZSTD_sizeof_CCtx ( const ZSTD_CCtx * cctx)

ZSTD_sizeof_*() : Requires v1.4.0+ These functions give the current memory usage of selected object. Note that object memory usage can evolve (increase or decrease) over time.

◆ ZSTD_sizeof_CDict()

size_t ZSTD_sizeof_CDict ( const ZSTD_CDict * cdict)

◆ ZSTD_sizeof_CStream()

size_t ZSTD_sizeof_CStream ( const ZSTD_CStream * zcs)

◆ ZSTD_toFlushNow()

size_t ZSTD_toFlushNow ( ZSTD_CCtx * cctx)

ZSTD_toFlushNow() Only useful for multithreading scenarios currently (nbWorkers >= 1).

◆ ZSTD_writeLastEmptyBlock()

size_t ZSTD_writeLastEmptyBlock ( void * dst,
size_t dstCapacity )

◆ ZSTD_writeSkippableFrame()

size_t ZSTD_writeSkippableFrame ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
unsigned magicVariant )