Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
zstd_compress_internal.h File Reference
#include "../common/zstd_internal.h"
#include "zstd_cwksp.h"
#include "../common/bits.h"

Go to the source code of this file.

Data Structures

struct  ZSTD_prefixDict_s
 
struct  ZSTD_localDict
 
struct  ZSTD_hufCTables_t
 
struct  ZSTD_fseCTables_t
 
struct  ZSTD_entropyCTables_t
 
struct  ZSTD_hufCTablesMetadata_t
 
struct  ZSTD_fseCTablesMetadata_t
 
struct  ZSTD_entropyCTablesMetadata_t
 
struct  ZSTD_match_t
 
struct  rawSeq
 
struct  rawSeqStore_t
 
struct  ZSTD_sequencePosition
 
struct  ZSTD_optimal_t
 
struct  optState_t
 
struct  ZSTD_compressedBlockState_t
 
struct  ZSTD_window_t
 
struct  ZSTD_matchState_t
 
struct  ZSTD_blockState_t
 
struct  ldmEntry_t
 
struct  ldmMatchCandidate_t
 
struct  ldmState_t
 
struct  ldmParams_t
 
struct  SeqCollector
 
struct  ZSTD_CCtx_params_s
 
struct  ZSTD_blockSplitCtx
 
struct  ZSTD_externalMatchCtx
 
struct  ZSTD_CCtx_s
 
struct  repcodes_s
 

Macros

#define kSearchStrength   8
 
#define HASH_READ_SIZE   8
 
#define ZSTD_DUBT_UNSORTED_MARK
 
#define ZSTD_WINDOW_START_INDEX   2
 
#define ZSTD_ROW_HASH_CACHE_SIZE   8 /* Size of prefetching hash cache for row-based matchfinder */
 
#define LDM_BATCH_SIZE   64
 
#define COMPRESS_SEQUENCES_WORKSPACE_SIZE   (sizeof(unsigned) * (MaxSeq + 2))
 
#define ENTROPY_WORKSPACE_SIZE   (HUF_WORKSPACE_SIZE + COMPRESS_SEQUENCES_WORKSPACE_SIZE)
 
#define ZSTD_MAX_NB_BLOCK_SPLITS   196
 
#define REPCODE1_TO_OFFBASE   REPCODE_TO_OFFBASE(1)
 
#define REPCODE2_TO_OFFBASE   REPCODE_TO_OFFBASE(2)
 
#define REPCODE3_TO_OFFBASE   REPCODE_TO_OFFBASE(3)
 
#define REPCODE_TO_OFFBASE(r)
 
#define OFFSET_TO_OFFBASE(o)
 
#define OFFBASE_IS_OFFSET(o)
 
#define OFFBASE_IS_REPCODE(o)
 
#define OFFBASE_TO_OFFSET(o)
 
#define OFFBASE_TO_REPCODE(o)
 
#define ZSTD_ROLL_HASH_CHAR_OFFSET   10
 
#define ZSTD_CURRENT_MAX   ((3U << 29) + (1U << ZSTD_WINDOWLOG_MAX))
 
#define ZSTD_CHUNKSIZE_MAX
 
#define ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY   0
 
#define ZSTD_SHORT_CACHE_TAG_BITS   8
 
#define ZSTD_SHORT_CACHE_TAG_MASK   ((1u << ZSTD_SHORT_CACHE_TAG_BITS) - 1)
 

Typedefs

typedef struct ZSTD_prefixDict_s ZSTD_prefixDict
 
typedef size_t(* ZSTD_blockCompressor) (ZSTD_matchState_t *bs, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
typedef struct repcodes_s repcodes_t
 

Enumerations

enum  ZSTD_compressionStage_e { ZSTDcs_created =0 , ZSTDcs_init , ZSTDcs_ongoing , ZSTDcs_ending }
 
enum  ZSTD_cStreamStage { zcss_init =0 , zcss_load , zcss_flush }
 
enum  ZSTD_OptPrice_e { zop_dynamic =0 , zop_predef }
 
enum  ZSTD_buffered_policy_e { ZSTDb_not_buffered , ZSTDb_buffered }
 
enum  ZSTD_dictTableLoadMethod_e { ZSTD_dtlm_fast , ZSTD_dtlm_full }
 
enum  ZSTD_tableFillPurpose_e { ZSTD_tfp_forCCtx , ZSTD_tfp_forCDict }
 
enum  ZSTD_dictMode_e { ZSTD_noDict = 0 , ZSTD_extDict = 1 , ZSTD_dictMatchState = 2 , ZSTD_dedicatedDictSearch = 3 }
 
enum  ZSTD_cParamMode_e { ZSTD_cpm_noAttachDict = 0 , ZSTD_cpm_attachDict = 1 , ZSTD_cpm_createCDict = 2 , ZSTD_cpm_unknown = 3 }
 

Functions

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_blockCompressor ZSTD_selectBlockCompressor (ZSTD_strategy strat, ZSTD_paramSwitch_e rowMatchfinderMode, ZSTD_dictMode_e dictMode)
 
MEM_STATIC U32 ZSTD_LLcode (U32 litLength)
 
MEM_STATIC U32 ZSTD_MLcode (U32 mlBase)
 
MEM_STATIC int ZSTD_cParam_withinBounds (ZSTD_cParameter cParam, int value)
 
MEM_STATIC size_t ZSTD_noCompressBlock (void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastBlock)
 
MEM_STATIC size_t ZSTD_rleCompressBlock (void *dst, size_t dstCapacity, BYTE src, size_t srcSize, U32 lastBlock)
 
MEM_STATIC size_t ZSTD_minGain (size_t srcSize, ZSTD_strategy strat)
 
MEM_STATIC int ZSTD_literalsCompressionIsDisabled (const ZSTD_CCtx_params *cctxParams)
 
HINT_INLINE UNUSED_ATTR void ZSTD_storeSeq (seqStore_t *seqStorePtr, size_t litLength, const BYTE *literals, const BYTE *litLimit, U32 offBase, size_t matchLength)
 
MEM_STATIC void ZSTD_updateRep (U32 rep[ZSTD_REP_NUM], U32 const offBase, U32 const ll0)
 
MEM_STATIC repcodes_t ZSTD_newRep (U32 const rep[ZSTD_REP_NUM], U32 const offBase, U32 const ll0)
 
MEM_STATIC size_t ZSTD_count (const BYTE *pIn, const BYTE *pMatch, const BYTE *const pInLimit)
 
MEM_STATIC size_t ZSTD_count_2segments (const BYTE *ip, const BYTE *match, const BYTE *iEnd, const BYTE *mEnd, const BYTE *iStart)
 
MEM_STATIC size_t ZSTD_hash3Ptr (const void *ptr, U32 h)
 
MEM_STATIC size_t ZSTD_hash3PtrS (const void *ptr, U32 h, U32 s)
 
MEM_STATIC FORCE_INLINE_ATTR size_t ZSTD_hashPtr (const void *p, U32 hBits, U32 mls)
 
MEM_STATIC FORCE_INLINE_ATTR size_t ZSTD_hashPtrSalted (const void *p, U32 hBits, U32 mls, const U64 hashSalt)
 
MEM_STATIC U64 ZSTD_rollingHash_compute (void const *buf, size_t size)
 
MEM_STATIC U64 ZSTD_rollingHash_primePower (U32 length)
 
MEM_STATIC U64 ZSTD_rollingHash_rotate (U64 hash, BYTE toRemove, BYTE toAdd, U64 primePower)
 
MEM_STATIC void ZSTD_window_clear (ZSTD_window_t *window)
 
MEM_STATIC U32 ZSTD_window_isEmpty (ZSTD_window_t const window)
 
MEM_STATIC U32 ZSTD_window_hasExtDict (ZSTD_window_t const window)
 
MEM_STATIC ZSTD_dictMode_e ZSTD_matchState_dictMode (const ZSTD_matchState_t *ms)
 
MEM_STATIC U32 ZSTD_window_canOverflowCorrect (ZSTD_window_t const window, U32 cycleLog, U32 maxDist, U32 loadedDictEnd, void const *src)
 
MEM_STATIC U32 ZSTD_window_needOverflowCorrection (ZSTD_window_t const window, U32 cycleLog, U32 maxDist, U32 loadedDictEnd, void const *src, void const *srcEnd)
 
MEM_STATIC U32 ZSTD_window_correctOverflow (ZSTD_window_t *window, U32 cycleLog, U32 maxDist, void const *src)
 
MEM_STATIC void ZSTD_window_enforceMaxDist (ZSTD_window_t *window, const void *blockEnd, U32 maxDist, U32 *loadedDictEndPtr, const ZSTD_matchState_t **dictMatchStatePtr)
 
MEM_STATIC void ZSTD_checkDictValidity (const ZSTD_window_t *window, const void *blockEnd, U32 maxDist, U32 *loadedDictEndPtr, const ZSTD_matchState_t **dictMatchStatePtr)
 
MEM_STATIC void ZSTD_window_init (ZSTD_window_t *window)
 
MEM_STATIC U32 ZSTD_window_update (ZSTD_window_t *window, void const *src, size_t srcSize, int forceNonContiguous)
 
MEM_STATIC U32 ZSTD_getLowestMatchIndex (const ZSTD_matchState_t *ms, U32 curr, unsigned windowLog)
 
MEM_STATIC U32 ZSTD_getLowestPrefixIndex (const ZSTD_matchState_t *ms, U32 curr, unsigned windowLog)
 
MEM_STATIC void ZSTD_writeTaggedIndex (U32 *const hashTable, size_t hashAndTag, U32 index)
 
MEM_STATIC int ZSTD_comparePackedTags (size_t packedTag1, size_t packedTag2)
 
size_t ZSTD_loadCEntropy (ZSTD_compressedBlockState_t *bs, void *workspace, const void *const dict, size_t dictSize)
 
void ZSTD_reset_compressedBlockState (ZSTD_compressedBlockState_t *bs)
 
ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams (const ZSTD_CCtx_params *CCtxParams, U64 srcSizeHint, size_t dictSize, ZSTD_cParamMode_e mode)
 
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)
 
void ZSTD_resetSeqStore (seqStore_t *ssPtr)
 
ZSTD_compressionParameters ZSTD_getCParamsFromCDict (const ZSTD_CDict *cdict)
 
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_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_writeLastEmptyBlock (void *dst, size_t dstCapacity)
 
size_t ZSTD_referenceExternalSequences (ZSTD_CCtx *cctx, rawSeq *seq, size_t nbSeq)
 
U32 ZSTD_cycleLog (U32 hashLog, ZSTD_strategy strat)
 
void ZSTD_CCtx_trace (ZSTD_CCtx *cctx, size_t extraCSize)
 
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_compressBegin_usingCDict_deprecated (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict)
 
size_t ZSTD_compressContinue_public (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressEnd_public (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressBlock_deprecated (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 

Macro Definition Documentation

◆ COMPRESS_SEQUENCES_WORKSPACE_SIZE

#define COMPRESS_SEQUENCES_WORKSPACE_SIZE   (sizeof(unsigned) * (MaxSeq + 2))

◆ ENTROPY_WORKSPACE_SIZE

#define ENTROPY_WORKSPACE_SIZE   (HUF_WORKSPACE_SIZE + COMPRESS_SEQUENCES_WORKSPACE_SIZE)

◆ HASH_READ_SIZE

#define HASH_READ_SIZE   8

◆ kSearchStrength

#define kSearchStrength   8

◆ LDM_BATCH_SIZE

#define LDM_BATCH_SIZE   64

◆ OFFBASE_IS_OFFSET

#define OFFBASE_IS_OFFSET ( o)
Value:
((o) > ZSTD_REP_NUM)
#define ZSTD_REP_NUM
Definition zstd_internal.h:69

◆ OFFBASE_IS_REPCODE

#define OFFBASE_IS_REPCODE ( o)
Value:
( 1 <= (o) && (o) <= ZSTD_REP_NUM)

◆ OFFBASE_TO_OFFSET

#define OFFBASE_TO_OFFSET ( o)
Value:
#define assert(condition)
Definition lz4.c:273
#define OFFBASE_IS_OFFSET(o)
Definition zstd_compress_internal.h:636

◆ OFFBASE_TO_REPCODE

#define OFFBASE_TO_REPCODE ( o)
Value:
(assert(OFFBASE_IS_REPCODE(o)), (o)) /* returns ID 1,2,3 */
#define OFFBASE_IS_REPCODE(o)
Definition zstd_compress_internal.h:637

◆ OFFSET_TO_OFFBASE

#define OFFSET_TO_OFFBASE ( o)
Value:
(assert((o)>0), o + ZSTD_REP_NUM)

◆ REPCODE1_TO_OFFBASE

#define REPCODE1_TO_OFFBASE   REPCODE_TO_OFFBASE(1)

◆ REPCODE2_TO_OFFBASE

#define REPCODE2_TO_OFFBASE   REPCODE_TO_OFFBASE(2)

◆ REPCODE3_TO_OFFBASE

#define REPCODE3_TO_OFFBASE   REPCODE_TO_OFFBASE(3)

◆ REPCODE_TO_OFFBASE

#define REPCODE_TO_OFFBASE ( r)
Value:
(assert((r)>=1), assert((r)<=ZSTD_REP_NUM), (r)) /* accepts IDs 1,2,3 */

◆ ZSTD_CHUNKSIZE_MAX

#define ZSTD_CHUNKSIZE_MAX
Value:
( ((U32)-1) /* Maximum ending current index */ \
- ZSTD_CURRENT_MAX) /* Maximum beginning lowLimit */
unsigned int U32
Definition lz4.c:316
#define ZSTD_CURRENT_MAX
Definition zstd_compress_internal.h:938

◆ ZSTD_CURRENT_MAX

#define ZSTD_CURRENT_MAX   ((3U << 29) + (1U << ZSTD_WINDOWLOG_MAX))

◆ ZSTD_DUBT_UNSORTED_MARK

#define ZSTD_DUBT_UNSORTED_MARK
Value:
1 /* For btlazy2 strategy, index ZSTD_DUBT_UNSORTED_MARK==1 means "unsorted".
It could be confused for a real successor at index "1", if sorted as larger than its predecessor.
It's not a big deal though : candidate will just be sorted again.
Additionally, candidate position 1 will be lost.
But candidate 1 cannot hide a large tree of candidates, so it's a minimal loss.
The benefit is that ZSTD_DUBT_UNSORTED_MARK cannot be mishandled after table re-use with a different strategy.
This constant is required by ZSTD_compressBlock_btlazy2() and ZSTD_reduceTable_internal() */

◆ ZSTD_MAX_NB_BLOCK_SPLITS

#define ZSTD_MAX_NB_BLOCK_SPLITS   196

Struct that contains all elements of block splitter that should be allocated in a wksp.

◆ ZSTD_ROLL_HASH_CHAR_OFFSET

#define ZSTD_ROLL_HASH_CHAR_OFFSET   10

◆ ZSTD_ROW_HASH_CACHE_SIZE

#define ZSTD_ROW_HASH_CACHE_SIZE   8 /* Size of prefetching hash cache for row-based matchfinder */

◆ ZSTD_SHORT_CACHE_TAG_BITS

#define ZSTD_SHORT_CACHE_TAG_BITS   8

◆ ZSTD_SHORT_CACHE_TAG_MASK

#define ZSTD_SHORT_CACHE_TAG_MASK   ((1u << ZSTD_SHORT_CACHE_TAG_BITS) - 1)

◆ ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY

#define ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY   0

◆ ZSTD_WINDOW_START_INDEX

#define ZSTD_WINDOW_START_INDEX   2

Typedef Documentation

◆ repcodes_t

typedef struct repcodes_s repcodes_t

◆ ZSTD_blockCompressor

typedef size_t(* ZSTD_blockCompressor) (ZSTD_matchState_t *bs, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)

◆ ZSTD_prefixDict

Enumeration Type Documentation

◆ ZSTD_buffered_policy_e

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 

◆ ZSTD_compressionStage_e

Enumerator
ZSTDcs_created 
ZSTDcs_init 
ZSTDcs_ongoing 
ZSTDcs_ending 

◆ ZSTD_cParamMode_e

Enumerator
ZSTD_cpm_noAttachDict 
ZSTD_cpm_attachDict 
ZSTD_cpm_createCDict 
ZSTD_cpm_unknown 

◆ ZSTD_cStreamStage

Enumerator
zcss_init 
zcss_load 
zcss_flush 

◆ ZSTD_dictMode_e

Enumerator
ZSTD_noDict 
ZSTD_extDict 
ZSTD_dictMatchState 
ZSTD_dedicatedDictSearch 

◆ ZSTD_dictTableLoadMethod_e

Enumerator
ZSTD_dtlm_fast 
ZSTD_dtlm_full 

◆ ZSTD_OptPrice_e

Enumerator
zop_dynamic 
zop_predef 

◆ ZSTD_tableFillPurpose_e

Enumerator
ZSTD_tfp_forCCtx 
ZSTD_tfp_forCDict 

Function Documentation

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

Returns
: 0 on success or error code

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

void ZSTD_CCtx_trace ( ZSTD_CCtx * cctx,
size_t extraCSize )

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

◆ ZSTD_checkDictValidity()

MEM_STATIC void ZSTD_checkDictValidity ( const ZSTD_window_t * window,
const void * blockEnd,
U32 maxDist,
U32 * loadedDictEndPtr,
const ZSTD_matchState_t ** dictMatchStatePtr )

◆ ZSTD_comparePackedTags()

MEM_STATIC int ZSTD_comparePackedTags ( size_t packedTag1,
size_t packedTag2 )

◆ 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_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_deprecated()

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

◆ ZSTD_compressBlock_deprecated()

size_t ZSTD_compressBlock_deprecated ( 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_public()

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

◆ 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_count()

MEM_STATIC size_t ZSTD_count ( const BYTE * pIn,
const BYTE * pMatch,
const BYTE *const pInLimit )

◆ ZSTD_count_2segments()

MEM_STATIC size_t ZSTD_count_2segments ( const BYTE * ip,
const BYTE * match,
const BYTE * iEnd,
const BYTE * mEnd,
const BYTE * iStart )

ZSTD_count_2segments() : can count match length with ip & match in 2 different segments. convention : on reaching mEnd, match count continue starting from iStart

◆ ZSTD_cParam_withinBounds()

MEM_STATIC int ZSTD_cParam_withinBounds ( ZSTD_cParameter cParam,
int value )

◆ ZSTD_cycleLog()

U32 ZSTD_cycleLog ( U32 hashLog,
ZSTD_strategy strat )

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

◆ 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_getLowestMatchIndex()

MEM_STATIC U32 ZSTD_getLowestMatchIndex ( const ZSTD_matchState_t * ms,
U32 curr,
unsigned windowLog )

Returns the lowest allowed match index. It may either be in the ext-dict or the prefix.

◆ ZSTD_getLowestPrefixIndex()

MEM_STATIC U32 ZSTD_getLowestPrefixIndex ( const ZSTD_matchState_t * ms,
U32 curr,
unsigned windowLog )

Returns the lowest allowed match index in the prefix.

◆ ZSTD_hash3Ptr()

MEM_STATIC size_t ZSTD_hash3Ptr ( const void * ptr,
U32 h )

◆ ZSTD_hash3PtrS()

MEM_STATIC size_t ZSTD_hash3PtrS ( const void * ptr,
U32 h,
U32 s )

◆ ZSTD_hashPtr()

MEM_STATIC FORCE_INLINE_ATTR size_t ZSTD_hashPtr ( const void * p,
U32 hBits,
U32 mls )

◆ ZSTD_hashPtrSalted()

MEM_STATIC FORCE_INLINE_ATTR size_t ZSTD_hashPtrSalted ( const void * p,
U32 hBits,
U32 mls,
const U64 hashSalt )

◆ 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() : Private use only. Init streaming operation. expects params to be valid. must receive dict, or cdict, or none, but not both.

Returns
: 0, or an error code

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

MEM_STATIC int ZSTD_literalsCompressionIsDisabled ( const ZSTD_CCtx_params * cctxParams)

◆ ZSTD_LLcode()

MEM_STATIC U32 ZSTD_LLcode ( U32 litLength)

◆ ZSTD_loadCEntropy()

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

◆ ZSTD_matchState_dictMode()

MEM_STATIC ZSTD_dictMode_e ZSTD_matchState_dictMode ( const ZSTD_matchState_t * ms)

ZSTD_matchState_dictMode(): Inspects the provided matchState and figures out what dictMode should be passed to the compressor.

◆ ZSTD_minGain()

MEM_STATIC size_t ZSTD_minGain ( size_t srcSize,
ZSTD_strategy strat )

◆ ZSTD_MLcode()

MEM_STATIC U32 ZSTD_MLcode ( U32 mlBase)

◆ ZSTD_newRep()

MEM_STATIC repcodes_t ZSTD_newRep ( U32 const rep[ZSTD_REP_NUM],
U32 const offBase,
U32 const ll0 )

◆ ZSTD_noCompressBlock()

MEM_STATIC size_t ZSTD_noCompressBlock ( void * dst,
size_t dstCapacity,
const void * src,
size_t srcSize,
U32 lastBlock )

◆ ZSTD_referenceExternalSequences()

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

◆ ZSTD_reset_compressedBlockState()

void ZSTD_reset_compressedBlockState ( ZSTD_compressedBlockState_t * bs)

◆ ZSTD_resetSeqStore()

void ZSTD_resetSeqStore ( seqStore_t * ssPtr)

◆ ZSTD_rleCompressBlock()

MEM_STATIC size_t ZSTD_rleCompressBlock ( void * dst,
size_t dstCapacity,
BYTE src,
size_t srcSize,
U32 lastBlock )

◆ ZSTD_rollingHash_compute()

MEM_STATIC U64 ZSTD_rollingHash_compute ( void const * buf,
size_t size )

ZSTD_rollingHash_compute() : Compute the rolling hash value of the buffer.

◆ ZSTD_rollingHash_primePower()

MEM_STATIC U64 ZSTD_rollingHash_primePower ( U32 length)

ZSTD_rollingHash_primePower() : Compute the primePower to be passed to ZSTD_rollingHash_rotate() for a hash over a window of length bytes.

◆ ZSTD_rollingHash_rotate()

MEM_STATIC U64 ZSTD_rollingHash_rotate ( U64 hash,
BYTE toRemove,
BYTE toAdd,
U64 primePower )

ZSTD_rollingHash_rotate() : Rotate the rolling hash by one byte.

◆ ZSTD_selectBlockCompressor()

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

◆ ZSTD_storeSeq()

HINT_INLINE UNUSED_ATTR void ZSTD_storeSeq ( seqStore_t * seqStorePtr,
size_t litLength,
const BYTE * literals,
const BYTE * litLimit,
U32 offBase,
size_t matchLength )

ZSTD_storeSeq() : Store a sequence (litlen, litPtr, offBase and matchLength) into seqStore_t. @offBase : Users should employ macros REPCODE_TO_OFFBASE() and OFFSET_TO_OFFBASE(). @matchLength : must be >= MINMATCH Allowed to over-read literals up to litLimit.

◆ ZSTD_updateRep()

MEM_STATIC void ZSTD_updateRep ( U32 rep[ZSTD_REP_NUM],
U32 const offBase,
U32 const ll0 )

◆ ZSTD_window_canOverflowCorrect()

MEM_STATIC U32 ZSTD_window_canOverflowCorrect ( ZSTD_window_t const window,
U32 cycleLog,
U32 maxDist,
U32 loadedDictEnd,
void const * src )

ZSTD_window_canOverflowCorrect(): Returns non-zero if the indices are large enough for overflow correction to work correctly without impacting compression ratio.

◆ ZSTD_window_clear()

MEM_STATIC void ZSTD_window_clear ( ZSTD_window_t * window)

ZSTD_window_clear(): Clears the window containing the history by simply setting it to empty.

◆ ZSTD_window_correctOverflow()

MEM_STATIC U32 ZSTD_window_correctOverflow ( ZSTD_window_t * window,
U32 cycleLog,
U32 maxDist,
void const * src )

ZSTD_window_correctOverflow(): Reduces the indices to protect from index overflow. Returns the correction made to the indices, which must be applied to every stored index.

The least significant cycleLog bits of the indices must remain the same, which may be 0. Every index up to maxDist in the past must be valid.

◆ ZSTD_window_enforceMaxDist()

MEM_STATIC void ZSTD_window_enforceMaxDist ( ZSTD_window_t * window,
const void * blockEnd,
U32 maxDist,
U32 * loadedDictEndPtr,
const ZSTD_matchState_t ** dictMatchStatePtr )

ZSTD_window_enforceMaxDist(): Updates lowLimit so that: (srcEnd - base) - lowLimit == maxDist + loadedDictEnd

It ensures index is valid as long as index >= lowLimit. This must be called before a block compression call.

loadedDictEnd is only defined if a dictionary is in use for current compression. As the name implies, loadedDictEnd represents the index at end of dictionary. The value lies within context's referential, it can be directly compared to blockEndIdx.

If loadedDictEndPtr is NULL, no dictionary is in use, and we use loadedDictEnd == 0. If loadedDictEndPtr is not NULL, we set it to zero after updating lowLimit. This is because dictionaries are allowed to be referenced fully as long as the last byte of the dictionary is in the window. Once input has progressed beyond window size, dictionary cannot be referenced anymore.

In normal dict mode, the dictionary lies between lowLimit and dictLimit. In dictMatchState mode, lowLimit and dictLimit are the same, and the dictionary is below them. forceWindow and dictMatchState are therefore incompatible.

◆ ZSTD_window_hasExtDict()

MEM_STATIC U32 ZSTD_window_hasExtDict ( ZSTD_window_t const window)

ZSTD_window_hasExtDict(): Returns non-zero if the window has a non-empty extDict.

◆ ZSTD_window_init()

MEM_STATIC void ZSTD_window_init ( ZSTD_window_t * window)

◆ ZSTD_window_isEmpty()

MEM_STATIC U32 ZSTD_window_isEmpty ( ZSTD_window_t const window)

◆ ZSTD_window_needOverflowCorrection()

MEM_STATIC U32 ZSTD_window_needOverflowCorrection ( ZSTD_window_t const window,
U32 cycleLog,
U32 maxDist,
U32 loadedDictEnd,
void const * src,
void const * srcEnd )

ZSTD_window_needOverflowCorrection(): Returns non-zero if the indices are getting too large and need overflow protection.

◆ ZSTD_window_update()

MEM_STATIC U32 ZSTD_window_update ( ZSTD_window_t * window,
void const * src,
size_t srcSize,
int forceNonContiguous )

ZSTD_window_update(): Updates the window by appending [src, src + srcSize) to the window. If it is not contiguous, the current prefix becomes the extDict, and we forget about the extDict. Handles overlap of the prefix and extDict. Returns non-zero if the segment is contiguous.

◆ ZSTD_writeLastEmptyBlock()

size_t ZSTD_writeLastEmptyBlock ( void * dst,
size_t dstCapacity )

◆ ZSTD_writeTaggedIndex()

MEM_STATIC void ZSTD_writeTaggedIndex ( U32 *const hashTable,
size_t hashAndTag,
U32 index )