Project Alice
Loading...
Searching...
No Matches
zstd_compress_internal.h File Reference
#include "../common/zstd_internal.h"
#include "zstd_cwksp.h"
#include "../common/bits.h"
Include dependency graph for zstd_compress_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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_CCtx_s
 
struct  repcodes_s
 

Macros

#define kSearchStrength   8
 
#define HASH_READ_SIZE   8
 
#define ZSTD_DUBT_UNSORTED_MARK
 
#define ZSTD_OPT_SIZE   (ZSTD_OPT_NUM+3)
 
#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)   (assert((r)>=1), assert((r)<=ZSTD_REP_NUM), (r)) /* accepts IDs 1,2,3 */
 
#define OFFSET_TO_OFFBASE(o)   (assert((o)>0), o + ZSTD_REP_NUM)
 
#define OFFBASE_IS_OFFSET(o)   ((o) > ZSTD_REP_NUM)
 
#define OFFBASE_IS_REPCODE(o)   ( 1 <= (o) && (o) <= ZSTD_REP_NUM)
 
#define OFFBASE_TO_OFFSET(o)   (assert(OFFBASE_IS_OFFSET(o)), (o) - ZSTD_REP_NUM)
 
#define OFFBASE_TO_REPCODE(o)   (assert(OFFBASE_IS_REPCODE(o)), (o)) /* returns ID 1,2,3 */
 
#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 struct ZSTD_matchState_t ZSTD_matchState_t
 
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 ZSTD_ALLOW_POINTER_OVERFLOW_ATTR 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 ZSTD_ALLOW_POINTER_OVERFLOW_ATTR 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)
 
void 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)
 
MEM_STATIC int ZSTD_hasExtSeqProd (const ZSTD_CCtx_params *params)
 
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))

Definition at line 371 of file zstd_compress_internal.h.

◆ ENTROPY_WORKSPACE_SIZE

#define ENTROPY_WORKSPACE_SIZE   (HUF_WORKSPACE_SIZE + COMPRESS_SEQUENCES_WORKSPACE_SIZE)

Definition at line 372 of file zstd_compress_internal.h.

◆ HASH_READ_SIZE

#define HASH_READ_SIZE   8

Definition at line 36 of file zstd_compress_internal.h.

◆ kSearchStrength

#define kSearchStrength   8

Definition at line 35 of file zstd_compress_internal.h.

◆ LDM_BATCH_SIZE

#define LDM_BATCH_SIZE   64

Definition at line 274 of file zstd_compress_internal.h.

◆ OFFBASE_IS_OFFSET

#define OFFBASE_IS_OFFSET (   o)    ((o) > ZSTD_REP_NUM)

Definition at line 631 of file zstd_compress_internal.h.

◆ OFFBASE_IS_REPCODE

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

Definition at line 632 of file zstd_compress_internal.h.

◆ OFFBASE_TO_OFFSET

#define OFFBASE_TO_OFFSET (   o)    (assert(OFFBASE_IS_OFFSET(o)), (o) - ZSTD_REP_NUM)

Definition at line 633 of file zstd_compress_internal.h.

◆ OFFBASE_TO_REPCODE

#define OFFBASE_TO_REPCODE (   o)    (assert(OFFBASE_IS_REPCODE(o)), (o)) /* returns ID 1,2,3 */

Definition at line 634 of file zstd_compress_internal.h.

◆ OFFSET_TO_OFFBASE

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

Definition at line 630 of file zstd_compress_internal.h.

◆ REPCODE1_TO_OFFBASE

#define REPCODE1_TO_OFFBASE   REPCODE_TO_OFFBASE(1)

Definition at line 626 of file zstd_compress_internal.h.

◆ REPCODE2_TO_OFFBASE

#define REPCODE2_TO_OFFBASE   REPCODE_TO_OFFBASE(2)

Definition at line 627 of file zstd_compress_internal.h.

◆ REPCODE3_TO_OFFBASE

#define REPCODE3_TO_OFFBASE   REPCODE_TO_OFFBASE(3)

Definition at line 628 of file zstd_compress_internal.h.

◆ REPCODE_TO_OFFBASE

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

Definition at line 629 of file zstd_compress_internal.h.

◆ ZSTD_CHUNKSIZE_MAX

#define ZSTD_CHUNKSIZE_MAX
Value:
( ((U32)-1) /* Maximum ending current index */ \
- ZSTD_CURRENT_MAX) /* Maximum beginning lowLimit */
unsigned int U32
Definition: mem.h:69
#define ZSTD_CURRENT_MAX

Definition at line 921 of file zstd_compress_internal.h.

◆ ZSTD_CURRENT_MAX

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

Definition at line 919 of file zstd_compress_internal.h.

◆ 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 reuse with a different strategy.
This constant is required by ZSTD_compressBlock_btlazy2() and ZSTD_reduceTable_internal() */

Definition at line 37 of file zstd_compress_internal.h.

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

Definition at line 388 of file zstd_compress_internal.h.

◆ ZSTD_OPT_SIZE

#define ZSTD_OPT_SIZE   (ZSTD_OPT_NUM+3)

Definition at line 165 of file zstd_compress_internal.h.

◆ ZSTD_ROLL_HASH_CHAR_OFFSET

#define ZSTD_ROLL_HASH_CHAR_OFFSET   10

Definition at line 868 of file zstd_compress_internal.h.

◆ ZSTD_ROW_HASH_CACHE_SIZE

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

Definition at line 209 of file zstd_compress_internal.h.

◆ ZSTD_SHORT_CACHE_TAG_BITS

#define ZSTD_SHORT_CACHE_TAG_BITS   8

Definition at line 1362 of file zstd_compress_internal.h.

◆ ZSTD_SHORT_CACHE_TAG_MASK

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

Definition at line 1363 of file zstd_compress_internal.h.

◆ ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY

#define ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY   0

Definition at line 976 of file zstd_compress_internal.h.

◆ ZSTD_WINDOW_START_INDEX

#define ZSTD_WINDOW_START_INDEX   2

Definition at line 205 of file zstd_compress_internal.h.

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)

Definition at line 505 of file zstd_compress_internal.h.

◆ ZSTD_matchState_t

Definition at line 207 of file zstd_compress_internal.h.

◆ 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 

Definition at line 379 of file zstd_compress_internal.h.

◆ ZSTD_compressionStage_e

Enumerator
ZSTDcs_created 
ZSTDcs_init 
ZSTDcs_ongoing 
ZSTDcs_ending 

Definition at line 43 of file zstd_compress_internal.h.

◆ ZSTD_cParamMode_e

Enumerator
ZSTD_cpm_noAttachDict 
ZSTD_cpm_attachDict 
ZSTD_cpm_createCDict 
ZSTD_cpm_unknown 

Definition at line 485 of file zstd_compress_internal.h.

◆ ZSTD_cStreamStage

Enumerator
zcss_init 
zcss_load 
zcss_flush 

Definition at line 44 of file zstd_compress_internal.h.

◆ ZSTD_dictMode_e

Enumerator
ZSTD_noDict 
ZSTD_extDict 
ZSTD_dictMatchState 
ZSTD_dedicatedDictSearch 

Definition at line 478 of file zstd_compress_internal.h.

◆ ZSTD_dictTableLoadMethod_e

Enumerator
ZSTD_dtlm_fast 
ZSTD_dtlm_full 

Definition at line 475 of file zstd_compress_internal.h.

◆ ZSTD_OptPrice_e

Enumerator
zop_dynamic 
zop_predef 

Definition at line 163 of file zstd_compress_internal.h.

◆ ZSTD_tableFillPurpose_e

Enumerator
ZSTD_tfp_forCCtx 
ZSTD_tfp_forCDict 

Definition at line 476 of file zstd_compress_internal.h.

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

Definition at line 3734 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTD_CCtx_trace()

void ZSTD_CCtx_trace ( ZSTD_CCtx cctx,
size_t  extraCSize 
)

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

Definition at line 5258 of file zstd_compress.c.

Here is the caller graph for this function:

◆ ZSTD_checkDictValidity()

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

Definition at line 1189 of file zstd_compress_internal.h.

◆ ZSTD_comparePackedTags()

MEM_STATIC int ZSTD_comparePackedTags ( size_t  packedTag1,
size_t  packedTag2 
)

Definition at line 1376 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 5333 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

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

Definition at line 5160 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTD_compressBegin_usingCDict_deprecated()

size_t ZSTD_compressBegin_usingCDict_deprecated ( ZSTD_CCtx cctx,
const ZSTD_CDict cdict 
)

Definition at line 5746 of file zstd_compress.c.

Here is the caller graph for this function:

◆ ZSTD_compressBlock_deprecated()

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

Definition at line 4761 of file zstd_compress.c.

Here is the caller graph for this function:

◆ ZSTD_compressContinue_public()

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

Definition at line 4731 of file zstd_compress.c.

Here is the caller graph for this function:

◆ ZSTD_compressEnd_public()

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

Definition at line 5282 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

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

Definition at line 6506 of file zstd_compress.c.

Here is the call graph for this function:

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

Definition at line 6592 of file zstd_compress.c.

Here is the call graph for this function:

◆ ZSTD_count()

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

Definition at line 743 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ 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

Definition at line 769 of file zstd_compress_internal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTD_cParam_withinBounds()

MEM_STATIC int ZSTD_cParam_withinBounds ( ZSTD_cParameter  cParam,
int  value 
)

Definition at line 545 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_cycleLog()

U32 ZSTD_cycleLog ( U32  hashLog,
ZSTD_strategy  strat 
)

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

Definition at line 1416 of file zstd_compress.c.

◆ ZSTD_getCParamsFromCCtxParams()

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

Definition at line 1628 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTD_getCParamsFromCDict()

ZSTD_compressionParameters ZSTD_getCParamsFromCDict ( const ZSTD_CDict cdict)

ZSTD_getCParamsFromCDict() : as the name implies

Definition at line 5677 of file zstd_compress.c.

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

Definition at line 1282 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 1299 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_hasExtSeqProd()

MEM_STATIC int ZSTD_hasExtSeqProd ( const ZSTD_CCtx_params *  params)

Definition at line 1505 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_hash3Ptr()

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

Definition at line 789 of file zstd_compress_internal.h.

◆ ZSTD_hash3PtrS()

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

Definition at line 790 of file zstd_compress_internal.h.

◆ ZSTD_hashPtr()

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

Definition at line 819 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_hashPtrSalted()

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

Definition at line 837 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ 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

Definition at line 5859 of file zstd_compress.c.

Here is the call graph for this function:

◆ ZSTD_literalsCompressionIsDisabled()

MEM_STATIC int ZSTD_literalsCompressionIsDisabled ( const ZSTD_CCtx_params *  cctxParams)

Definition at line 593 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_LLcode()

MEM_STATIC U32 ZSTD_LLcode ( U32  litLength)

Definition at line 511 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_loadCEntropy()

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

Definition at line 4936 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

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

Definition at line 959 of file zstd_compress_internal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTD_minGain()

MEM_STATIC size_t ZSTD_minGain ( size_t  srcSize,
ZSTD_strategy  strat 
)

Definition at line 585 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_MLcode()

MEM_STATIC U32 ZSTD_MLcode ( U32  mlBase)

Definition at line 528 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_newRep()

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

Definition at line 731 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_noCompressBlock()

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

Definition at line 558 of file zstd_compress_internal.h.

◆ ZSTD_referenceExternalSequences()

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

Definition at line 4658 of file zstd_compress.c.

◆ ZSTD_reset_compressedBlockState()

void ZSTD_reset_compressedBlockState ( ZSTD_compressedBlockState_t bs)

Definition at line 1908 of file zstd_compress.c.

Here is the caller graph for this function:

◆ ZSTD_resetSeqStore()

void ZSTD_resetSeqStore ( seqStore_t ssPtr)

Definition at line 3127 of file zstd_compress.c.

◆ ZSTD_rleCompressBlock()

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

Definition at line 570 of file zstd_compress_internal.h.

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

Definition at line 887 of file zstd_compress_internal.h.

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

Definition at line 896 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 904 of file zstd_compress_internal.h.

◆ ZSTD_selectBlockCompressor()

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

Definition at line 3035 of file zstd_compress.c.

Here is the call graph for this function:
Here is the caller graph for this function:

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

Definition at line 643 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_updateRep()

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

Definition at line 707 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 985 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 929 of file zstd_compress_internal.h.

◆ ZSTD_window_correctOverflow()

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

Definition at line 1047 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 1144 of file zstd_compress_internal.h.

Here is the caller graph for this function:

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

Definition at line 949 of file zstd_compress_internal.h.

Here is the caller graph for this function:

◆ ZSTD_window_init()

MEM_STATIC void ZSTD_window_init ( ZSTD_window_t window)

Definition at line 1222 of file zstd_compress_internal.h.

◆ ZSTD_window_isEmpty()

MEM_STATIC U32 ZSTD_window_isEmpty ( ZSTD_window_t const  window)

Definition at line 938 of file zstd_compress_internal.h.

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

Definition at line 1020 of file zstd_compress_internal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZSTD_window_update()

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

Definition at line 1242 of file zstd_compress_internal.h.

◆ ZSTD_writeLastEmptyBlock()

size_t ZSTD_writeLastEmptyBlock ( void *  dst,
size_t  dstCapacity 
)

Definition at line 4648 of file zstd_compress.c.

Here is the call graph for this function:

◆ ZSTD_writeTaggedIndex()

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

Definition at line 1367 of file zstd_compress_internal.h.