Classes | Macros | Typedefs | Enumerations | Functions | Variables
zstd.c File Reference
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
#include "../zstd.h"
#include <stdio.h>
#include <time.h>
#include <assert.h>
Include dependency graph for zstd.c:

Go to the source code of this file.

Classes

struct  _trbudget_t
 
struct  algo_time_t
 
struct  BIT_CStream_t
 
struct  BIT_DStream_t
 
struct  blockProperties_t
 
struct  buffer_s
 
struct  COVER_best_s
 
struct  COVER_ctx_t
 
struct  COVER_dictSelection
 
struct  COVER_epoch_info_t
 
struct  COVER_map_pair_t_s
 
struct  COVER_map_s
 
struct  COVER_segment_t
 
struct  COVER_tryParameters_data_s
 
struct  dictItem
 
struct  DTableDesc
 
struct  EStats_ress_t
 
struct  FASTCOVER_accel_t
 
struct  FASTCOVER_ctx_t
 
struct  FASTCOVER_tryParameters_data_s
 
struct  FSE_CState_t
 
struct  FSE_decode_t
 
struct  FSE_DecompressWksp
 
struct  FSE_DState_t
 
struct  FSE_DTableHeader
 
struct  FSE_symbolCompressionTransform
 
struct  HUF_buildCTable_wksp_tables
 
struct  HUF_compress_tables_t
 
struct  HUF_CompressWeightsWksp
 
struct  HUF_CStream_t
 
struct  HUF_DecompressFastArgs
 
struct  HUF_DEltX1
 
struct  HUF_DEltX2
 
struct  HUF_ReadDTableX1_Workspace
 
struct  HUF_ReadDTableX2_Workspace
 
struct  HUF_WriteCTableWksp
 
struct  inBuff_t
 
struct  ldmEntry_t
 
struct  ldmMatchCandidate_t
 
struct  ldmParams_t
 
struct  ldmRollingHashState_t
 
struct  ldmState_t
 
struct  nodeElt_s
 
struct  offsetCount_t
 
struct  optState_t
 
struct  POOL_ctx_s
 
struct  POOL_job_s
 
struct  range_t
 
struct  rankPos
 
struct  rawSeq
 
struct  rawSeqStore_t
 
struct  repcodes_s
 
struct  roundBuff_t
 
struct  rsyncState_t
 
struct  seq_t
 
struct  SeqCollector
 
struct  seqDef_s
 
struct  seqState_t
 
struct  seqStore_t
 
struct  seqStoreSplits
 
struct  serialState_t
 
struct  sortedSymbol_t
 
struct  syncPoint_t
 
struct  XXH32_canonical_t
 Canonical (big endian) representation of XXH32_hash_t. More...
 
struct  XXH32_state_s
 
struct  XXH64_canonical_t
 
struct  XXH64_state_s
 
struct  ZDICT_cover_params_t
 
struct  ZDICT_fastCover_params_t
 
struct  ZDICT_legacy_params_t
 
struct  ZDICT_params_t
 
struct  ZSTD_blockSplitCtx
 
struct  ZSTD_blockState_t
 
struct  ZSTD_BuildCTableWksp
 
struct  ZSTD_CCtx_params_s
 
struct  ZSTD_CCtx_s
 
struct  ZSTD_CDict_s
 
struct  ZSTD_compressedBlockState_t
 
struct  ZSTD_cpuid_t
 
struct  ZSTD_cwksp
 
struct  ZSTD_DCtx_s
 
struct  ZSTD_DDict_s
 
struct  ZSTD_DDictHashSet
 
struct  ZSTD_entropyCTables_t
 
struct  ZSTD_entropyCTablesMetadata_t
 
struct  ZSTD_entropyDTables_t
 
struct  ZSTD_externalMatchCtx
 
struct  ZSTD_frameSizeInfo
 
struct  ZSTD_fseCTables_t
 
struct  ZSTD_fseCTablesMetadata_t
 
struct  ZSTD_fseState
 
struct  ZSTD_hufCTables_t
 
struct  ZSTD_hufCTablesMetadata_t
 
struct  ZSTD_localDict
 
struct  ZSTD_match_t
 
struct  ZSTD_matchState_t
 
struct  ZSTD_OffsetInfo
 
struct  ZSTD_optimal_t
 
struct  ZSTD_optLdm_t
 
struct  ZSTD_prefixDict_s
 
struct  ZSTD_seqSymbol
 
struct  ZSTD_seqSymbol_header
 
struct  ZSTD_sequenceLength
 
struct  ZSTD_sequencePosition
 
struct  ZSTD_symbolEncodingTypeStats_t
 
struct  ZSTD_window_t
 
struct  ZSTDMT_bufferPool_s
 
struct  ZSTDMT_CCtx_s
 
struct  ZSTDMT_CCtxPool
 
struct  ZSTDMT_jobDescription
 

Macros

#define __has_attribute(x)   0
 
#define __has_builtin(x)   0
 
#define __has_feature(x)   0
 
#define _DIVSUFSORT_H   1
 
#define _FILE_OFFSET_BITS   64
 
#define _FORCE_HAS_FORMAT_STRING(...)
 
#define _LARGEFILE64_SOURCE
 
#define ADVANCED_SEQS   STORED_SEQS
 
#define ALPHABET_SIZE   (256)
 
#define assert(condition)   ((void)0) /* disable assert (default) */
 
#define B(name, bit)   X(name, f7b, bit)
 
#define BIT0   1
 
#define BIT1   2
 
#define BIT4   16
 
#define BIT5   32
 
#define BIT6   64
 
#define BIT7   128
 
#define BIT_MASK_SIZE   (sizeof(BIT_mask) / sizeof(BIT_mask[0]))
 
#define BITCOST_ACCURACY   8
 
#define BITCOST_MULTIPLIER   (1 << BITCOST_ACCURACY)
 
#define BITSTREAM_H_MODULE
 
#define BMI2_TARGET_ATTRIBUTE   TARGET_ATTRIBUTE("lzcnt,bmi,bmi2")
 
#define BOUNDCHECK(cParam, val)
 
#define BOUNDED(min, val, max)   (MAX(min,MIN(val,max)))
 
#define BUCKET_A(_c0)   bucket_A[(_c0)]
 
#define BUCKET_A_SIZE   (ALPHABET_SIZE)
 
#define BUCKET_B(_c0, _c1)   (bucket_B[((_c1) << 8) | (_c0)])
 
#define BUCKET_B_SIZE   (ALPHABET_SIZE * ALPHABET_SIZE)
 
#define BUCKET_BSTAR(_c0, _c1)   (bucket_B[((_c0) << 8) | (_c1)])
 
#define BUF_POOL_MAX_NB_BUFFERS(nbWorkers)   (2*(nbWorkers) + 3)
 
#define C(name, bit)   X(name, f1c, bit)
 
#define C(name, bit)   X(name, f7c, bit)
 
#define CACHELINE_SIZE   64
 
#define CHECK_DBOUNDS(p, v)
 
#define CHECK_F(f)   { CHECK_V_F(_var_err__, f); }
 
#define CHECK_V_F(e, f)   size_t const e = f; if (ERR_isError(e)) return e
 
#define CLAMP(cParam, val)   CLAMP_TYPE(cParam, val, unsigned)
 
#define CLAMP_TYPE(cParam, val, type)
 
#define COMPRESS_LITERALS_SIZE_MIN   63 /* heuristic */
 
#define COMPRESS_SEQUENCES_WORKSPACE_SIZE   (sizeof(unsigned) * (MaxSeq + 2))
 
#define COPY16(d, s)   { ZSTD_copy16(d,s); d+=16; s+=16; }
 
#define COPY8(d, s)   { ZSTD_copy8(d,s); d+=8; s+=8; }
 
#define COVER_DEFAULT_SPLITPOINT   1.0
 
#define COVER_MAX_SAMPLES_SIZE   (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB))
 
#define D(name, bit)   X(name, f1d, bit)
 
#define DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT   4
 
#define DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT
 
#define DDICT_HASHSET_RESIZE_FACTOR   2
 
#define DDICT_HASHSET_TABLE_BASE_SIZE   64
 
#define DEBUG_H_12987983217
 
#define DEBUG_PRINTHEX(l, p, n)   {}
 
#define DEBUG_STATIC_ASSERT(c)   (void)sizeof(char[(c) ? 1 : -1])
 
#define DEBUGLEVEL   0
 
#define DEBUGLOG(l, ...)   {} /* disabled */
 
#define DEFAULT_ACCEL   1
 
#define DEFAULT_F   20
 
#define DefaultMaxOff   28
 
#define DICTLISTSIZE_DEFAULT   10000
 
#define DISPLAY(...)
 
#define DISPLAY(...)
 
#define DISPLAY(...)   { fprintf(stderr, __VA_ARGS__); fflush( stderr ); }
 
#define DISPLAYLEVEL(l, ...)   LOCALDISPLAYLEVEL(g_displayLevel, l, __VA_ARGS__)
 
#define DISPLAYLEVEL(l, ...)   LOCALDISPLAYLEVEL(g_displayLevel, l, __VA_ARGS__)
 
#define DISPLAYLEVEL(l, ...)   if (notificationLevel>=l) { DISPLAY(__VA_ARGS__); } /* 0 : no display; 1: errors; 2: default; 3: details; 4: debug */
 
#define DISPLAYUPDATE(l, ...)   LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__)
 
#define DISPLAYUPDATE(l, ...)   LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__)
 
#define DISPLAYUPDATE(l, ...)
 
#define DONT_VECTORIZE
 
#define DYNAMIC_BMI2   0
 
#define ENTROPY_WORKSPACE_SIZE   (HUF_WORKSPACE_SIZE + COMPRESS_SEQUENCES_WORKSPACE_SIZE)
 
#define ERR_QUOTE(str)   #str
 
#define ERR_STATIC   static /* this version may generate warnings for unused static functions; disable the relevant warning */
 
#define ERROR(name)   ZSTD_ERROR(name)
 
#define ERROR_H_MODULE
 
#define FASTCOVER_DEFAULT_SPLITPOINT   0.75
 
#define FASTCOVER_MAX_ACCEL   10
 
#define FASTCOVER_MAX_F   31
 
#define FASTCOVER_MAX_SAMPLES_SIZE   (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB))
 
#define FORCE_INLINE_ATTR
 
#define FORCE_INLINE_TEMPLATE   static INLINE_KEYWORD FORCE_INLINE_ATTR
 
#define FORCE_NOINLINE   static
 
#define FORWARD_IF_ERROR(err, ...)
 
#define FSE_BLOCKBOUND(size)   ((size) + ((size)>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */)
 
#define FSE_BUILD_CTABLE_WORKSPACE_SIZE(maxSymbolValue, tableLog)   (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog))
 
#define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog)   (((maxSymbolValue + 2) + (1ull << (tableLog)))/2 + sizeof(U64)/sizeof(U32) /* additional 8 bytes for potential table overwrite */)
 
#define FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue)   (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)
 
#define FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue)   ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))
 
#define FSE_CAT(X, Y)   X##Y
 
#define FSE_CAT(X, Y)   X##Y
 
#define FSE_COMPRESSBOUND(size)   (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */
 
#define FSE_CTABLE_SIZE(maxTableLog, maxSymbolValue)   (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))
 
#define FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue)   (1 + (1<<((maxTableLog)-1)) + (((maxSymbolValue)+1)*2))
 
#define FSE_DECODE_TYPE   FSE_decode_t
 
#define FSE_DECOMPRESS_WKSP_SIZE(maxTableLog, maxSymbolValue)   (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))
 
#define FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue)   (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)
 
#define FSE_DEFAULT_MEMORY_USAGE   13
 
#define FSE_DEFAULT_TABLELOG   (FSE_DEFAULT_MEMORY_USAGE-2)
 
#define FSE_DTABLE_SIZE(maxTableLog)   (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))
 
#define FSE_DTABLE_SIZE_U32(maxTableLog)   (1 + (1<<(maxTableLog)))
 
#define FSE_EXPAND_AND_QUOTE(str)   FSE_QUOTE(str)
 
#define FSE_FLUSHBITS(s)   (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s))
 
#define FSE_FUNCTION_EXTENSION
 
#define FSE_FUNCTION_NAME(X, Y)   FSE_CAT(X,Y)
 
#define FSE_FUNCTION_NAME(X, Y)   FSE_CAT(X,Y)
 
#define FSE_FUNCTION_TYPE   BYTE
 
#define FSE_GETSYMBOL(statePtr)   fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)
 
#define FSE_H
 
#define FSE_H_FSE_STATIC_LINKING_ONLY
 
#define FSE_isError   ERR_isError
 
#define FSE_isError   ERR_isError
 
#define FSE_isError   ERR_isError
 
#define FSE_LIB_VERSION   FSE_VERSION_MAJOR.FSE_VERSION_MINOR.FSE_VERSION_RELEASE
 
#define FSE_MAX_MEMORY_USAGE   14
 
#define FSE_MAX_SYMBOL_VALUE   255
 
#define FSE_MAX_TABLELOG   (FSE_MAX_MEMORY_USAGE-2)
 
#define FSE_MAX_TABLESIZE   (1U<<FSE_MAX_TABLELOG)
 
#define FSE_MAXTABLESIZE_MASK   (FSE_MAX_TABLESIZE-1)
 
#define FSE_MIN_TABLELOG   5
 
#define FSE_NCOUNTBOUND   512
 
#define FSE_PUBLIC_API
 
#define FSE_QUOTE(str)   #str
 
#define FSE_STATIC_ASSERT(c)   DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */
 
#define FSE_STATIC_LINKING_ONLY   /* FSE_MIN_TABLELOG */
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_STATIC_LINKING_ONLY   /* FSE_optimalTableLog_internal */
 
#define FSE_STATIC_LINKING_ONLY   /* FSE_encodeSymbol */
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_STATIC_LINKING_ONLY
 
#define FSE_TABLELOG_ABSOLUTE_MAX   15
 
#define FSE_TABLESTEP(tableSize)   (((tableSize)>>1) + ((tableSize)>>3) + 3)
 
#define FSE_TYPE_NAME(X, Y)   FSE_CAT(X,Y)
 
#define FSE_TYPE_NAME(X, Y)   FSE_CAT(X,Y)
 
#define FSE_VERSION_MAJOR   0
 
#define FSE_VERSION_MINOR   9
 
#define FSE_VERSION_NUMBER   (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)
 
#define FSE_VERSION_RELEASE   0
 
#define FSE_VERSION_STRING   FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION)
 
#define GB   *(1U<<30)
 
#define GB   *(1U<<30)
 
#define GEAR_ITER_ONCE()
 
#define GEAR_ITER_ONCE()
 
#define GEN_ZSTD_BT_GET_ALL_MATCHES(dictMode)
 
#define GEN_ZSTD_BT_GET_ALL_MATCHES_(dictMode, mls)
 
#define GEN_ZSTD_BT_SEARCH_FN(dictMode, mls)
 
#define GEN_ZSTD_CALL_BT_SEARCH_FN(dictMode, mls)
 
#define GEN_ZSTD_CALL_HC_SEARCH_FN(dictMode, mls)
 
#define GEN_ZSTD_CALL_ROW_SEARCH_FN(dictMode, mls, rowLog)
 
#define GEN_ZSTD_HC_SEARCH_FN(dictMode, mls)
 
#define GEN_ZSTD_ROW_SEARCH_FN(dictMode, mls, rowLog)
 
#define GETIDX(a)   ((0 <= (a)) ? (a) : (~(a)))
 
#define HASH_READ_SIZE   8
 
#define HBUFFSIZE   256 /* should prove large enough for all entropy headers */
 
#define HINT_INLINE   static INLINE_KEYWORD FORCE_INLINE_ATTR
 
#define HIST_WKSP_SIZE   (HIST_WKSP_SIZE_U32 * sizeof(unsigned))
 
#define HIST_WKSP_SIZE_U32   1024
 
#define HUF_ALIGN(x, a)   HUF_ALIGN_MASK((x), (a) - 1)
 
#define HUF_ALIGN_MASK(x, mask)   (((x) + (mask)) & ~(mask))
 
#define HUF_ASM_DECL   HUF_EXTERN_C
 
#define HUF_BITS_IN_CONTAINER   (sizeof(size_t) * 8)
 
#define HUF_BLOCKBOUND(size)   (size + (size>>8) + 8) /* only true when incompressible is pre-filtered with fast heuristic */
 
#define HUF_BLOCKSIZE_MAX   (128 * 1024)
 
#define HUF_COMPRESSBOUND(size)   (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size)) /* Macro version, useful for static allocation */
 
#define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue)   HUF_CElt name[HUF_CTABLE_SIZE_ST(maxSymbolValue)] /* no final ; */
 
#define HUF_CREATE_STATIC_DTABLEX1(DTable, maxTableLog)   HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) }
 
#define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog)   HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) }
 
#define HUF_CTABLE_SIZE(maxSymbolValue)   (HUF_CTABLE_SIZE_ST(maxSymbolValue) * sizeof(size_t))
 
#define HUF_CTABLE_SIZE_ST(maxSymbolValue)   ((maxSymbolValue)+2) /* Use tables of size_t, for proper alignment */
 
#define HUF_CTABLE_WORKSPACE_SIZE   (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned))
 
#define HUF_CTABLE_WORKSPACE_SIZE_U32   ((4 * (HUF_SYMBOLVALUE_MAX + 1)) + 192)
 
#define HUF_CTABLEBOUND   129
 
#define HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr)   *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog)
 
#define HUF_DECODE_SYMBOLX1_1(ptr, DStreamPtr)
 
#define HUF_DECODE_SYMBOLX1_2(ptr, DStreamPtr)
 
#define HUF_DECODE_SYMBOLX2_0(ptr, DStreamPtr)   ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)
 
#define HUF_DECODE_SYMBOLX2_1(ptr, DStreamPtr)
 
#define HUF_DECODE_SYMBOLX2_2(ptr, DStreamPtr)
 
#define HUF_DECODER_FAST_TABLELOG   11
 
#define HUF_DECOMPRESS_WORKSPACE_SIZE   ((2 << 10) + (1 << 9))
 
#define HUF_DECOMPRESS_WORKSPACE_SIZE_U32   (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32))
 
#define HUF_DGEN(fn)
 
#define HUF_DTABLE_SIZE(maxTableLog)   (1 + (1<<(maxTableLog)))
 
#define HUF_EXTERN_C
 
#define HUF_FAST_BMI2_ATTRS
 
#define HUF_H_298734234
 
#define HUF_isError   ERR_isError
 
#define HUF_isError   ERR_isError
 
#define HUF_isError   ERR_isError
 
#define HUF_NEED_BMI2_FUNCTION   0
 
#define HUF_OPTIMAL_DEPTH_THRESHOLD   ZSTD_btultra
 
#define HUF_READ_STATS_WORKSPACE_SIZE   (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned))
 
#define HUF_READ_STATS_WORKSPACE_SIZE_U32   FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1)
 
#define HUF_STATIC_ASSERT(c)   DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */
 
#define HUF_SYMBOLVALUE_MAX   255
 
#define HUF_TABLELOG_ABSOLUTEMAX   12 /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */
 
#define HUF_TABLELOG_DEFAULT   11 /* default tableLog value when none specified */
 
#define HUF_TABLELOG_MAX   12 /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */
 
#define HUF_WORKSPACE_MAX_ALIGNMENT   8
 
#define HUF_WORKSPACE_SIZE   ((8 << 10) + 512 /* sorting scratch space */)
 
#define HUF_WORKSPACE_SIZE_U64   (HUF_WORKSPACE_SIZE / sizeof(U64))
 
#define INLINE   __inline
 
#define INLINE_KEYWORD
 
#define JOB_ERROR(e)
 
#define KB   *(1 <<10)
 
#define KB   *(1 <<10)
 
#define kLazySkippingStep   8
 
#define kSearchStrength   8
 
#define LDM_BATCH_SIZE   64
 
#define LDM_BUCKET_SIZE_LOG   3
 
#define LDM_HASH_RLOG   7
 
#define LDM_MIN_MATCH_LENGTH   64
 
#define LIKELY(x)   (x)
 
#define Litbits   8
 
#define LitHufLog   11
 
#define LL_DEFAULTNORMLOG   6 /* for static allocation */
 
#define LLFSELog   9
 
#define LLIMIT   64 /* heuristic determined experimentally */
 
#define LOCALDISPLAYLEVEL(displayLevel, l, ...)
 
#define LOCALDISPLAYLEVEL(displayLevel, l, ...)
 
#define LOCALDISPLAYUPDATE(displayLevel, l, ...)
 
#define LOCALDISPLAYUPDATE(displayLevel, l, ...)
 
#define LONG_OFFSETS_MAX_EXTRA_BITS_32
 
#define LONGNBSEQ   0x7F00
 
#define MAP_EMPTY_VALUE   ((U32)-1)
 
#define MAX(a, b)   ((a)>(b) ? (a) : (b))
 
#define MAX_FSE_TABLELOG_FOR_HUFF_HEADER   6
 
#define MaxFSELog   MAX(MAX(MLFSELog, LLFSELog), OffFSELog)
 
#define MaxLit   ((1<<Litbits) - 1)
 
#define MaxLL   35
 
#define MaxLLBits   16
 
#define MaxML   52
 
#define MaxMLBits   16
 
#define MaxOff   31
 
#define MAXREPOFFSET   1024
 
#define MaxSeq   MAX(MaxLL, MaxML) /* Assumption : MaxOff < MaxLL,MaxML */
 
#define MB   *(1 <<20)
 
#define MB   *(1 <<20)
 
#define MEM_H_MODULE
 
#define MEM_MODULE
 
#define MEM_STATIC   static /* this version may generate warnings for unused static functions; disable the relevant warning */
 
#define MERGE_CHECK(a, b, c)
 
#define MIN(a, b)   ((a)<(b) ? (a) : (b))
 
#define MIN_CBLOCK_SIZE   (1 /*litCSize*/ + 1 /* RLE or RAW */) /* for a non-null block */
 
#define MIN_LITERALS_FOR_4_STREAMS   6
 
#define MIN_SEQUENCES_BLOCK_SPLITTING   300
 
#define MIN_SEQUENCES_SIZE   1 /* nbSeq==0 */
 
#define MINMATCH   3
 
#define MINMATCHLENGTH   7 /* heuristic determined experimentally */
 
#define MINRATIO   4 /* minimum nb of apparition to be selected in dictionary */
 
#define ML_DEFAULTNORMLOG   6 /* for static allocation */
 
#define MLFSELog   9
 
#define NEXT_IN_CHAIN(d, mask)   chainTable[(d) & (mask)]
 
#define NOISELENGTH   32
 
#define OF_DEFAULTNORMLOG   5 /* for static allocation */
 
#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 OFFCODE_MAX   30 /* only applicable to first block */
 
#define OffFSELog   8
 
#define OFFSET_TO_OFFBASE(o)   (assert((o)>0), o + ZSTD_REP_NUM)
 
#define POOL_H
 
#define PREFETCH_AREA(p, s)
 
#define PREFETCH_L1(ptr)   (void)(ptr) /* disabled */
 
#define PREFETCH_L2(ptr)   (void)(ptr) /* disabled */
 
#define PREFIX(name)   ZSTD_error_##name
 
#define RANK_POSITION_DISTINCT_COUNT_CUTOFF   (RANK_POSITION_LOG_BUCKETS_BEGIN + ZSTD_highbit32(RANK_POSITION_LOG_BUCKETS_BEGIN) /* == 166 */)
 
#define RANK_POSITION_LOG_BUCKETS_BEGIN   ((RANK_POSITION_TABLE_SIZE - 1) - RANK_POSITION_MAX_COUNT_LOG - 1 /* == 158 */)
 
#define RANK_POSITION_MAX_COUNT_LOG   32
 
#define RANK_POSITION_TABLE_SIZE   192
 
#define RAWLOG(l, ...)   {} /* disabled */
 
#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 RETURN_ERROR(err, ...)
 
#define RETURN_ERROR_IF(cond, err, ...)
 
#define RSYNC_LENGTH   32
 
#define RSYNC_MIN_BLOCK_LOG   ZSTD_BLOCKSIZELOG_MAX
 
#define RSYNC_MIN_BLOCK_SIZE   (1<<RSYNC_MIN_BLOCK_LOG)
 
#define SEQ_POOL_MAX_NB_BUFFERS(nbWorkers)   (nbWorkers)
 
#define SEQSYMBOL_TABLE_SIZE(log)   (1 + (1 << (log)))
 
#define SS_BLOCKSIZE   (1024)
 
#define SS_INSERTIONSORT_THRESHOLD   (8)
 
#define SS_MISORT_STACKSIZE   (16)
 
#define SS_SMERGE_STACKSIZE   (32)
 
#define STACK_POP(_a, _b, _c, _d)
 
#define STACK_POP5(_a, _b, _c, _d, _e)
 
#define STACK_PUSH(_a, _b, _c, _d)
 
#define STACK_PUSH5(_a, _b, _c, _d, _e)
 
#define STACK_SIZE   SS_SMERGE_STACKSIZE
 
#define STACK_SIZE   TR_STACKSIZE
 
#define STARTNODE   (HUF_SYMBOLVALUE_MAX+1)
 
#define STATIC_BMI2   0
 
#define STORED_SEQS   8
 
#define STORED_SEQS_MASK   (STORED_SEQS-1)
 
#define STREAM_ACCUMULATOR_MIN   ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))
 
#define STREAM_ACCUMULATOR_MIN_32   25
 
#define STREAM_ACCUMULATOR_MIN_64   57
 
#define SUSPECT_INCOMPRESSIBLE_SAMPLE_RATIO   10 /* Must be >= 2 */
 
#define SUSPECT_INCOMPRESSIBLE_SAMPLE_SIZE   4096
 
#define SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO   20
 
#define SWAP(_a, _b)   do { t = (_a); (_a) = (_b); (_b) = t; } while(0)
 
#define TARGET_ATTRIBUTE(target)
 
#define THREADING_H_938743
 
#define TR_INSERTIONSORT_THRESHOLD   (8)
 
#define TR_STACKSIZE   (64)
 
#define UNLIKELY(x)   (x)
 
#define UNUSED_ATTR
 
#define WEIGHT(stat, opt)   ((opt) ? ZSTD_fracWeight(stat) : ZSTD_bitWeight(stat))
 
#define WILDCOPY_OVERLENGTH   32
 
#define WILDCOPY_VECLEN   16
 
#define WIN_CDECL
 
#define X(name, r, bit)
 
#define XXH128   XXH_NAME2(XXH_NAMESPACE, XXH128)
 
#define XXH128_canonical_t   XXH_IPREF(XXH128_canonical_t)
 
#define XXH128_canonicalFromHash   XXH_NAME2(XXH_NAMESPACE, XXH128_canonicalFromHash)
 
#define XXH128_cmp   XXH_NAME2(XXH_NAMESPACE, XXH128_cmp)
 
#define XXH128_hash_t   XXH_IPREF(XXH128_hash_t)
 
#define XXH128_hashFromCanonical   XXH_NAME2(XXH_NAMESPACE, XXH128_hashFromCanonical)
 
#define XXH128_isEqual   XXH_NAME2(XXH_NAMESPACE, XXH128_isEqual)
 
#define XXH32   XXH_NAME2(XXH_NAMESPACE, XXH32)
 
#define XXH32_canonical_t   XXH_IPREF(XXH32_canonical_t)
 
#define XXH32_canonicalFromHash   XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash)
 
#define XXH32_copyState   XXH_NAME2(XXH_NAMESPACE, XXH32_copyState)
 
#define XXH32_createState(void)   XXH_NAME2(XXH_NAMESPACE, XXH32_createState)
 Allocates an XXH32_state_t. More...
 
#define XXH32_digest   XXH_NAME2(XXH_NAMESPACE, XXH32_digest)
 
#define XXH32_ENDJMP   0
 
#define XXH32_freeState   XXH_NAME2(XXH_NAMESPACE, XXH32_freeState)
 
#define XXH32_hashFromCanonical   XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical)
 
#define XXH32_reset   XXH_NAME2(XXH_NAMESPACE, XXH32_reset)
 
#define XXH32_state_s   XXH_IPREF(XXH32_state_s)
 
#define XXH32_state_t   XXH_IPREF(XXH32_state_t)
 The opaque state struct for the XXH32 streaming API. More...
 
#define XXH32_update   XXH_NAME2(XXH_NAMESPACE, XXH32_update)
 
#define XXH3_128bits   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits)
 
#define XXH3_128bits_digest   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_digest)
 
#define XXH3_128bits_reset   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset)
 
#define XXH3_128bits_reset_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecret)
 
#define XXH3_128bits_reset_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecretandSeed)
 
#define XXH3_128bits_reset_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSeed)
 
#define XXH3_128bits_update   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_update)
 
#define XXH3_128bits_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecret)
 
#define XXH3_128bits_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecretandSeed)
 
#define XXH3_128bits_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed)
 
#define XXH3_64bits   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits)
 
#define XXH3_64bits_digest   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest)
 
#define XXH3_64bits_reset   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset)
 
#define XXH3_64bits_reset_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret)
 
#define XXH3_64bits_reset_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecretandSeed)
 
#define XXH3_64bits_reset_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed)
 
#define XXH3_64bits_update   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update)
 
#define XXH3_64bits_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret)
 
#define XXH3_64bits_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecretandSeed)
 
#define XXH3_64bits_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed)
 
#define XXH3_copyState   XXH_NAME2(XXH_NAMESPACE, XXH3_copyState)
 
#define XXH3_createState   XXH_NAME2(XXH_NAMESPACE, XXH3_createState)
 
#define XXH3_freeState   XXH_NAME2(XXH_NAMESPACE, XXH3_freeState)
 
#define XXH3_generateSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret)
 
#define XXH3_generateSecret_fromSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret_fromSeed)
 
#define XXH3_state_s   XXH_IPREF(XXH3_state_s)
 
#define XXH3_state_t   XXH_IPREF(XXH3_state_t)
 
#define XXH64   XXH_NAME2(XXH_NAMESPACE, XXH64)
 
#define XXH64_canonical_t   XXH_IPREF(XXH64_canonical_t)
 
#define XXH64_canonicalFromHash   XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash)
 
#define XXH64_copyState   XXH_NAME2(XXH_NAMESPACE, XXH64_copyState)
 
#define XXH64_createState   XXH_NAME2(XXH_NAMESPACE, XXH64_createState)
 
#define XXH64_digest   XXH_NAME2(XXH_NAMESPACE, XXH64_digest)
 
#define XXH64_freeState   XXH_NAME2(XXH_NAMESPACE, XXH64_freeState)
 
#define XXH64_hashFromCanonical   XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical)
 
#define XXH64_reset   XXH_NAME2(XXH_NAMESPACE, XXH64_reset)
 
#define XXH64_state_s   XXH_IPREF(XXH64_state_s)
 
#define XXH64_state_t   XXH_IPREF(XXH64_state_t)
 
#define XXH64_update   XXH_NAME2(XXH_NAMESPACE, XXH64_update)
 
#define XXH_ASSERT(c)   ((void)0)
 
#define XXH_CAT(A, B)   A##B
 
#define XXH_COMPILER_GUARD(var)   ((void)0)
 
#define XXH_CPU_LITTLE_ENDIAN   XXH_isLittleEndian()
 Whether the target is little endian. More...
 
#define XXH_DEBUGLEVEL   DEBUGLEVEL
 Sets the debugging level. More...
 
#define XXH_ERROR   XXH_IPREF(XXH_ERROR)
 
#define XXH_errorcode   XXH_IPREF(XXH_errorcode)
 
#define XXH_FALLTHROUGH
 
#define XXH_FORCE_ALIGN_CHECK   1
 
#define XXH_FORCE_INLINE   static
 
#define XXH_GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)
 
#define XXH_get32bits(p)   XXH_readLE32_align(p, align)
 
#define XXH_get64bits(p)   XXH_readLE64_align(p, align)
 
#define XXH_HAS_ATTRIBUTE(x)   __has_attribute(x)
 
#define XXH_HAS_BUILTIN(x)   __has_builtin(x)
 
#define XXH_HAS_C_ATTRIBUTE(x)   0
 
#define XXH_HAS_CPP_ATTRIBUTE(x)   0
 
#define XXH_IMPLEM_13a8737387
 
#define XXH_IMPLEMENTATION
 
#define XXH_INLINE_ALL
 
#define XXH_INLINE_ALL_31684351384
 
#define XXH_IPREF(Id)   XXH_NAMESPACE ## Id
 
#define XXH_NAME2(A, B)   XXH_CAT(A,B)
 
#define XXH_NAMESPACE   ZSTD_
 
#define XXH_NAMESPACE   XXH_INLINE_
 
#define XXH_NO_INLINE   static
 
#define XXH_NO_INLINE_HINTS   0
 
#define XXH_NO_XXH3
 
#define XXH_OK   XXH_IPREF(XXH_OK)
 
#define XXH_PRIME32_1   0x9E3779B1U
 
#define XXH_PRIME32_2   0x85EBCA77U
 
#define XXH_PRIME32_3   0xC2B2AE3DU
 
#define XXH_PRIME32_4   0x27D4EB2FU
 
#define XXH_PRIME32_5   0x165667B1U
 
#define XXH_PRIME64_1   0x9E3779B185EBCA87ULL
 
#define XXH_PRIME64_2   0xC2B2AE3D27D4EB4FULL
 
#define XXH_PRIME64_3   0x165667B19E3779F9ULL
 
#define XXH_PRIME64_4   0x85EBCA77C2B2AE63ULL
 
#define XXH_PRIME64_5   0x27D4EB2F165667C5ULL
 
#define XXH_PRIVATE_API
 
#define XXH_PROCESS1
 
#define XXH_PROCESS4
 
#define XXH_PUBLIC_API   static
 
#define XXH_rotl32(x, r)   (((x) << (r)) | ((x) >> (32 - (r))))
 
#define XXH_rotl64(x, r)   (((x) << (r)) | ((x) >> (64 - (r))))
 
#define XXH_STATIC_ASSERT(c)   XXH_STATIC_ASSERT_WITH_MESSAGE((c),#c)
 
#define XXH_STATIC_ASSERT_WITH_MESSAGE(c, m)   do { struct xxh_sa { char x[(c) ? 1 : -1]; }; } while(0)
 
#define XXH_STATIC_LINKING_ONLY   /* XXH64_state_t */
 
#define XXH_STATIC_LINKING_ONLY
 
#define XXH_VERSION_MAJOR   0
 
#define XXH_VERSION_MINOR   8
 
#define XXH_VERSION_NUMBER   (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)
 
#define XXH_VERSION_RELEASE   1
 
#define XXH_versionNumber   XXH_NAME2(XXH_NAMESPACE, XXH_versionNumber)
 
#define XXHASH_H_5627135585666179   1
 
#define XXHASH_H_STATIC_13879238742
 
#define ZDICT_CONTENTSIZE_MIN   128
 
#define ZDICT_DEPRECATED(message)
 
#define ZDICT_DICTSIZE_MIN   256
 
#define ZDICT_GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)
 
#define ZDICT_MAX_SAMPLES_SIZE   (2000U << 20)
 
#define ZDICT_MIN_SAMPLES_SIZE   (ZDICT_CONTENTSIZE_MIN * MINRATIO)
 
#define ZDICT_STATIC_LINKING_ONLY
 
#define ZDICTLIB_API   ZDICTLIB_VISIBLE
 
#define ZDICTLIB_HIDDEN
 
#define ZDICTLIB_STATIC_API   ZDICTLIB_VISIBLE
 
#define ZDICTLIB_VISIBLE
 
#define ZSTD_ADDRESS_SANITIZER   0
 
#define ZSTD_ALIGNOF(T)   (sizeof(void*) < sizeof(T) ? sizeof(void*) : sizeof(T))
 
#define ZSTD_ALLOCATIONS_H
 
#define ZSTD_ASM_SUPPORTED   0
 
#define ZSTD_BITS_H
 
#define ZSTD_BLOCKHEADERSIZE   3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */
 
#define ZSTD_BT_GET_ALL_MATCHES_ARRAY(dictMode)
 
#define ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, mls)   ZSTD_btGetAllMatches_##dictMode##_##mls
 
#define ZSTD_BT_SEARCH_FN(dictMode, mls)   ZSTD_BtFindBestMatch_##dictMode##_##mls
 
#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE   (sizeof(S16) * (MaxSeq + 1) + (1u << MaxFSELog) + sizeof(U64))
 
#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32   ((ZSTD_BUILD_FSE_TABLE_WKSP_SIZE + sizeof(U32) - 1) / sizeof(U32))
 
#define ZSTD_calloc(n, s)   calloc((n), (s))
 
#define ZSTD_CCOMMON_H_MODULE
 
#define ZSTD_CET_ENDBRANCH
 
#define ZSTD_CHUNKSIZE_MAX
 
#define ZSTD_CLEVELS_H
 
#define ZSTD_COMMON_CPU_H
 
#define ZSTD_COMPILER_H
 
#define ZSTD_COMPRESS_ADVANCED_H
 
#define ZSTD_COMPRESS_H
 
#define ZSTD_COMPRESS_HEAPMODE   0
 
#define ZSTD_COMPRESS_LITERALS_H
 
#define ZSTD_COMPRESS_SEQUENCES_H
 
#define ZSTD_CURRENT_MAX   ((3U << 29) + (1U << ZSTD_WINDOWLOG_MAX))
 
#define ZSTD_CWKSP_ALIGNMENT_BYTES   64
 
#define ZSTD_CWKSP_ASAN_REDZONE_SIZE   128
 
#define ZSTD_CWKSP_H
 
#define ZSTD_DATAFLOW_SANITIZER   0
 
#define ZSTD_DDICT_H
 
#define ZSTD_DEC_BLOCK_H
 
#define ZSTD_DECODER_INTERNAL_BUFFER   (1 << 16)
 
#define ZSTD_DECOMPRESS_INTERNAL_H
 
#define ZSTD_DEPS_COMMON
 
#define ZSTD_DEPS_MALLOC
 
#define ZSTD_DEPS_MATH64
 
#define ZSTD_DEPS_NEED_MALLOC
 
#define ZSTD_DEPS_NEED_MALLOC
 
#define ZSTD_DEPS_NEED_MALLOC
 
#define ZSTD_DEPS_NEED_MALLOC
 
#define ZSTD_DEPS_NEED_MALLOC
 
#define ZSTD_DEPS_NEED_MALLOC
 
#define ZSTD_DEPS_NEED_MATH64
 
#define ZSTD_DEPS_NEED_MATH64
 
#define ZSTD_DISABLE_ASM   1
 
#define ZSTD_div64(dividend, divisor)   ((dividend) / (divisor))
 
#define ZSTD_DOUBLE_FAST_H
 
#define ZSTD_DUBT_UNSORTED_MARK
 
#define ZSTD_ENABLE_ASM_X86_64_BMI2   0
 
#define ZSTD_ERROR(name)   ((size_t)-PREFIX(name))
 
#define ZSTD_ERRORS_H_398273423
 
#define ZSTD_FALLTHROUGH
 
#define ZSTD_FAST_H
 
#define ZSTD_FOR_EACH_DICT_MODE(X, ...)
 
#define ZSTD_FOR_EACH_MLS(X, dictMode)
 
#define ZSTD_FOR_EACH_MLS_ROWLOG(X, dictMode)
 
#define ZSTD_FOR_EACH_ROWLOG(X, dictMode, mls)
 
#define ZSTD_FRAMECHECKSUMSIZE   4
 
#define ZSTD_FRAMEIDSIZE   4 /* magic number size */
 
#define ZSTD_free(p)   free((p))
 
#define ZSTD_GEN_DFAST_FN(dictMode, mls)
 
#define ZSTD_GEN_FAST_FN(dictMode, mls, step)
 
#define ZSTD_HAS_C_ATTRIBUTE(x)   0
 
#define ZSTD_HAS_CPP_ATTRIBUTE(x)   0
 
#define ZSTD_HASHLOG3_MAX   17
 
#define ZSTD_HAVE_WEAK_SYMBOLS   0
 
#define ZSTD_HC_SEARCH_FN(dictMode, mls)   ZSTD_HcFindBestMatch_##dictMode##_##mls
 
#define ZSTD_HEAPMODE   1
 
#define ZSTD_HIDE_ASM_FUNCTION(func)
 
#define ZSTD_HUFFDTABLE_CAPACITY_LOG   12
 
#define ZSTD_INDEXOVERFLOW_MARGIN   (16 MB)
 
#define ZSTD_isError   ERR_isError /* for inlining */
 
#define ZSTD_LAZY_DDSS_BUCKET_LOG   2
 
#define ZSTD_LAZY_H
 
#define ZSTD_LBMAX   (128 << 10)
 
#define ZSTD_LBMIN   64
 
#define ZSTD_LDM_DEFAULT_WINDOW_LOG   ZSTD_WINDOWLOG_LIMIT_DEFAULT
 
#define ZSTD_LDM_GEARTAB_H
 
#define ZSTD_LDM_H
 
#define ZSTD_LEGACY_SUPPORT   0
 
#define ZSTD_LITBUFFEREXTRASIZE   BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)
 
#define ZSTD_LITFREQ_ADD   2 /* scaling factor for litFreq, so that frequencies adapt faster to new stats */
 
#define ZSTD_malloc(s)   malloc(s)
 
#define ZSTD_MAX_CLEVEL   22
 
#define ZSTD_MAX_FSE_HEADERS_SIZE   (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8)
 
#define ZSTD_MAX_HUF_HEADER_SIZE   128 /* header + <= 127 byte tree description */
 
#define ZSTD_MAX_NB_BLOCK_SPLITS   196
 
#define ZSTD_MAX_PRICE   (1<<30)
 
#define ZSTD_MAXWINDOWSIZE_DEFAULT   (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)
 
#define ZSTD_memcpy(d, s, l)   memcpy((d),(s),(l))
 
#define ZSTD_memmove(d, s, l)   memmove((d),(s),(l))
 
#define ZSTD_MEMORY_SANITIZER   0
 
#define ZSTD_memset(p, v, l)   memset((p),(v),(l))
 
#define ZSTD_MULTITHREAD
 
#define ZSTD_NO_CLEVEL   0
 
#define ZSTD_NO_FORWARD_PROGRESS_MAX   16
 
#define ZSTD_OPT_H
 
#define ZSTD_OPT_NUM   (1<<12)
 
#define ZSTD_PORTABILITY_MACROS_H
 
#define ZSTD_PREDEF_THRESHOLD   8 /* if srcSize < ZSTD_PREDEF_THRESHOLD, symbols' cost is assumed static, directly determined by pre-defined distributions */
 
#define ZSTD_pthread_cond_broadcast(a)   pthread_cond_broadcast((a))
 
#define ZSTD_pthread_cond_destroy(a)   pthread_cond_destroy((a))
 
#define ZSTD_pthread_cond_init(a, b)   pthread_cond_init((a), (b))
 
#define ZSTD_pthread_cond_signal(a)   pthread_cond_signal((a))
 
#define ZSTD_pthread_cond_t   pthread_cond_t
 
#define ZSTD_pthread_cond_wait(a, b)   pthread_cond_wait((a), (b))
 
#define ZSTD_pthread_create(a, b, c, d)   pthread_create((a), (b), (c), (d))
 
#define ZSTD_pthread_join(a)   pthread_join((a),NULL)
 
#define ZSTD_pthread_mutex_destroy(a)   pthread_mutex_destroy((a))
 
#define ZSTD_pthread_mutex_init(a, b)   pthread_mutex_init((a), (b))
 
#define ZSTD_pthread_mutex_lock(a)   pthread_mutex_lock((a))
 
#define ZSTD_PTHREAD_MUTEX_LOCK(m)   ZSTD_pthread_mutex_lock(m)
 
#define ZSTD_pthread_mutex_t   pthread_mutex_t
 
#define ZSTD_pthread_mutex_unlock(a)   pthread_mutex_unlock((a))
 
#define ZSTD_pthread_t   pthread_t
 
#define ZSTD_REP_NUM   3 /* number of repcodes */
 
#define ZSTD_RESIZE_SEQPOOL   0
 
#define ZSTD_ROLL_HASH_CHAR_OFFSET   10
 
#define ZSTD_ROW_HASH_CACHE_MASK   (ZSTD_ROW_HASH_CACHE_SIZE - 1)
 
#define ZSTD_ROW_HASH_CACHE_SIZE   8 /* Size of prefetching hash cache for row-based matchfinder */
 
#define ZSTD_ROW_HASH_MAX_ENTRIES   64 /* absolute maximum number of entries per row, for all configurations */
 
#define ZSTD_ROW_HASH_TAG_BITS   8 /* nb bits to use for the tag */
 
#define ZSTD_ROW_HASH_TAG_MASK   ((1u << ZSTD_ROW_HASH_TAG_BITS) - 1)
 
#define ZSTD_ROW_SEARCH_FN(dictMode, mls, rowLog)   ZSTD_RowFindBestMatch_##dictMode##_##mls##_##rowLog
 
#define ZSTD_ROWSIZE   16
 
#define ZSTD_SEARCH_FN_ATTRS   FORCE_NOINLINE
 
#define ZSTD_SHORT_CACHE_TAG_BITS   8
 
#define ZSTD_SHORT_CACHE_TAG_MASK   ((1u << ZSTD_SHORT_CACHE_TAG_BITS) - 1)
 
#define ZSTD_STATIC_ASSERT(c)   DEBUG_STATIC_ASSERT(c)
 
#define ZSTD_STATIC_LINKING_ONLY
 
#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_customMem */
 
#define ZSTD_STATIC_LINKING_ONLY
 
#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_parameters */
 
#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_compressionParameters */
 
#define ZSTD_SWITCH_MLS(X, dictMode)
 
#define ZSTD_SWITCH_ROWLOG(dictMode, mls)
 
#define ZSTD_SWITCH_SEARCH_METHOD(dictMode)
 
#define ZSTD_TRACE   0
 
#define ZSTD_TRACE_H
 
#define ZSTD_UNREACHABLE   { assert(0); }
 
#define ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER   (6ULL)
 
#define ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF   (128 KB)
 
#define ZSTD_WEAK_ATTR
 
#define ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY   0
 
#define ZSTD_WINDOW_START_INDEX   2
 
#define ZSTD_WINDOWLOG_ABSOLUTEMIN   10
 
#define ZSTD_WORKSPACETOOLARGE_FACTOR   3
 
#define ZSTD_WORKSPACETOOLARGE_MAXDURATION   128
 
#define ZSTD_ZDICT_H
 
#define ZSTD_ZDICT_H_STATIC
 
#define ZSTDERRORLIB_API   ZSTDERRORLIB_VISIBLE
 
#define ZSTDERRORLIB_HIDDEN
 
#define ZSTDERRORLIB_VISIBLE
 
#define ZSTDMT_COMPRESS_H
 
#define ZSTDMT_JOBLOG_MAX   (MEM_32bits() ? 29 : 30)
 
#define ZSTDMT_JOBSIZE_MAX   (MEM_32bits() ? (512 MB) : (1024 MB))
 
#define ZSTDMT_JOBSIZE_MIN   (512 KB)
 
#define ZSTDMT_NBWORKERS_MAX   ((sizeof(void*)==4) /*32-bit*/ ? 64 : 256)
 
#define ZSTDMT_OVERLAPLOG_DEFAULT   0
 

Typedefs

typedef struct buffer_s buffer_t
 
typedef unsigned char BYTE
 
typedef struct COVER_best_s COVER_best_t
 
typedef struct COVER_dictSelection COVER_dictSelection_t
 
typedef struct COVER_map_pair_t_s COVER_map_pair_t
 
typedef struct COVER_map_s COVER_map_t
 
typedef struct COVER_tryParameters_data_s COVER_tryParameters_data_t
 
typedef ZSTD_ErrorCode ERR_enum
 
typedef struct FASTCOVER_tryParameters_data_s FASTCOVER_tryParameters_data_t
 
typedef unsigned FSE_CTable
 
typedef unsigned FSE_DTable
 
typedef size_t HUF_CElt
 
typedef void(* HUF_DecompressFastLoopFn) (HUF_DecompressFastArgs *)
 
typedef size_t(* HUF_DecompressUsingDTableFn) (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable)
 
typedef U32 HUF_DTable
 
typedef nodeElt huffNodeTable[2 *(HUF_SYMBOLVALUE_MAX+1)]
 
typedef struct nodeElt_s nodeElt
 
typedef struct POOL_ctx_s POOL_ctx
 
typedef void(* POOL_function) (void *)
 
typedef struct POOL_job_s POOL_job
 
typedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX]
 
typedef U32 rankValCol_t[HUF_TABLELOG_MAX+1]
 
typedef struct repcodes_s repcodes_t
 
typedef signed short S16
 
typedef signed int S32
 
typedef signed long long S64
 
typedef signed char S8
 
typedef struct seqDef_s seqDef
 
typedef struct _trbudget_t trbudget_t
 
typedef unsigned short U16
 
typedef unsigned int U32
 
typedef unsigned long long U64
 
typedef unsigned char U8
 
typedef struct XXH32_state_s XXH32_state_t
 
typedef struct XXH64_state_s XXH64_state_t
 The opaque state struct for the XXH64 streaming API. More...
 
typedef XXH32_hash_t xxh_u32
 
typedef unsigned char xxh_u8
 
typedef size_t(* ZSTD_blockCompressor) (ZSTD_matchState_t *bs, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
typedef size_t(* ZSTD_decompressSequences_t) (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
typedef U32(* ZSTD_getAllMatchesFn) (ZSTD_match_t *, ZSTD_matchState_t *, U32 *, const BYTE *, const BYTE *, const U32 rep[ZSTD_REP_NUM], U32 const ll0, U32 const lengthToBeat)
 
typedef struct ZSTD_matchState_t ZSTD_matchState_t
 
typedef struct ZSTD_prefixDict_s ZSTD_prefixDict
 
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)
 
typedef U64 ZSTD_VecMask
 
typedef struct ZSTDMT_bufferPool_s ZSTDMT_bufferPool
 
typedef struct ZSTDMT_CCtx_s ZSTDMT_CCtx
 
typedef ZSTDMT_bufferPool ZSTDMT_seqPool
 
typedef unsigned long long XXH64_hash_t
 

Enumerations

enum  base_directive_e { base_0possible =0, base_1guaranteed =1 }
 
enum  BIT_DStream_status { BIT_DStream_unfinished = 0, BIT_DStream_endOfBuffer = 1, BIT_DStream_completed = 2, BIT_DStream_overflow = 3 }
 
enum  blockType_e { bt_raw, bt_rle, bt_compressed, bt_reserved }
 
enum  FSE_repeat { FSE_repeat_none, FSE_repeat_check, FSE_repeat_valid }
 
enum  HIST_checkInput_e { trustInput, checkMaxSymbolValue }
 
enum  HUF_flags_e {
  HUF_flags_bmi2 = (1 << 0), HUF_flags_optimalDepth = (1 << 1), HUF_flags_preferRepeat = (1 << 2), HUF_flags_suspectUncompressible = (1 << 3),
  HUF_flags_disableAsm = (1 << 4), HUF_flags_disableFast = (1 << 5)
}
 
enum  HUF_nbStreams_e { HUF_singleStream, HUF_fourStreams }
 
enum  HUF_repeat { HUF_repeat_none, HUF_repeat_check, HUF_repeat_valid }
 
enum  searchMethod_e { search_hashChain =0, search_binaryTree =1, search_rowHash =2 }
 
enum  streaming_operation { not_streaming = 0, is_streaming = 1 }
 
enum  symbolEncodingType_e { set_basic, set_rle, set_compressed, set_repeat }
 
enum  XXH_alignment { XXH_aligned, XXH_unaligned, XXH_aligned, XXH_unaligned }
 
enum  ZSTD_buffered_policy_e { ZSTDb_not_buffered, ZSTDb_buffered }
 
enum  ZSTD_bufferMode_e { ZSTD_bm_buffered = 0, ZSTD_bm_stable = 1 }
 
enum  ZSTD_buildSeqStore_e { ZSTDbss_compress, ZSTDbss_noCompress }
 
enum  ZSTD_compResetPolicy_e { ZSTDcrp_makeClean, ZSTDcrp_leaveDirty }
 
enum  ZSTD_compressionStage_e { ZSTDcs_created =0, ZSTDcs_init, ZSTDcs_ongoing, ZSTDcs_ending }
 
enum  ZSTD_cParamMode_e { ZSTD_cpm_noAttachDict = 0, ZSTD_cpm_attachDict = 1, ZSTD_cpm_createCDict = 2, ZSTD_cpm_unknown = 3 }
 
enum  ZSTD_cStreamStage { zcss_init =0, zcss_load, zcss_flush }
 
enum  ZSTD_cwksp_alloc_phase_e { ZSTD_cwksp_alloc_objects, ZSTD_cwksp_alloc_aligned_init_once, ZSTD_cwksp_alloc_aligned, ZSTD_cwksp_alloc_buffers }
 
enum  ZSTD_cwksp_static_alloc_e { ZSTD_cwksp_dynamic_alloc, ZSTD_cwksp_static_alloc }
 
enum  ZSTD_defaultPolicy_e { ZSTD_defaultDisallowed = 0, ZSTD_defaultAllowed = 1 }
 
enum  ZSTD_dictMode_e { ZSTD_noDict = 0, ZSTD_extDict = 1, ZSTD_dictMatchState = 2, ZSTD_dedicatedDictSearch = 3 }
 
enum  ZSTD_dictTableLoadMethod_e { ZSTD_dtlm_fast, ZSTD_dtlm_full }
 
enum  ZSTD_dictUses_e { ZSTD_use_indefinitely = -1, ZSTD_dont_use = 0, ZSTD_use_once = 1 }
 
enum  ZSTD_dStage {
  ZSTDds_getFrameHeaderSize, ZSTDds_decodeFrameHeader, ZSTDds_decodeBlockHeader, ZSTDds_decompressBlock,
  ZSTDds_decompressLastBlock, ZSTDds_checkChecksum, ZSTDds_decodeSkippableHeader, ZSTDds_skipFrame
}
 
enum  ZSTD_dStreamStage {
  zdss_init =0, zdss_loadHeader, zdss_read, zdss_load,
  zdss_flush
}
 
enum  ZSTD_ErrorCode {
  ZSTD_error_no_error = 0, ZSTD_error_GENERIC = 1, ZSTD_error_prefix_unknown = 10, ZSTD_error_version_unsupported = 12,
  ZSTD_error_frameParameter_unsupported = 14, ZSTD_error_frameParameter_windowTooLarge = 16, ZSTD_error_corruption_detected = 20, ZSTD_error_checksum_wrong = 22,
  ZSTD_error_literals_headerWrong = 24, ZSTD_error_dictionary_corrupted = 30, ZSTD_error_dictionary_wrong = 32, ZSTD_error_dictionaryCreation_failed = 34,
  ZSTD_error_parameter_unsupported = 40, ZSTD_error_parameter_combination_unsupported = 41, ZSTD_error_parameter_outOfBound = 42, ZSTD_error_tableLog_tooLarge = 44,
  ZSTD_error_maxSymbolValue_tooLarge = 46, ZSTD_error_maxSymbolValue_tooSmall = 48, ZSTD_error_stabilityCondition_notRespected = 50, ZSTD_error_stage_wrong = 60,
  ZSTD_error_init_missing = 62, ZSTD_error_memory_allocation = 64, ZSTD_error_workSpace_tooSmall = 66, ZSTD_error_dstSize_tooSmall = 70,
  ZSTD_error_srcSize_wrong = 72, ZSTD_error_dstBuffer_null = 74, ZSTD_error_noForwardProgress_destFull = 80, ZSTD_error_noForwardProgress_inputEmpty = 82,
  ZSTD_error_frameIndex_tooLarge = 100, ZSTD_error_seekableIO = 102, ZSTD_error_dstBuffer_wrong = 104, ZSTD_error_srcBuffer_wrong = 105,
  ZSTD_error_sequenceProducer_failed = 106, ZSTD_error_externalSequences_invalid = 107, ZSTD_error_maxCode = 120, ZSTD_error_no_error = 0,
  ZSTD_error_GENERIC = 1, ZSTD_error_prefix_unknown = 10, ZSTD_error_version_unsupported = 12, ZSTD_error_frameParameter_unsupported = 14,
  ZSTD_error_frameParameter_windowTooLarge = 16, ZSTD_error_corruption_detected = 20, ZSTD_error_checksum_wrong = 22, ZSTD_error_literals_headerWrong = 24,
  ZSTD_error_dictionary_corrupted = 30, ZSTD_error_dictionary_wrong = 32, ZSTD_error_dictionaryCreation_failed = 34, ZSTD_error_parameter_unsupported = 40,
  ZSTD_error_parameter_combination_unsupported = 41, ZSTD_error_parameter_outOfBound = 42, ZSTD_error_tableLog_tooLarge = 44, ZSTD_error_maxSymbolValue_tooLarge = 46,
  ZSTD_error_maxSymbolValue_tooSmall = 48, ZSTD_error_stabilityCondition_notRespected = 50, ZSTD_error_stage_wrong = 60, ZSTD_error_init_missing = 62,
  ZSTD_error_memory_allocation = 64, ZSTD_error_workSpace_tooSmall = 66, ZSTD_error_dstSize_tooSmall = 70, ZSTD_error_srcSize_wrong = 72,
  ZSTD_error_dstBuffer_null = 74, ZSTD_error_noForwardProgress_destFull = 80, ZSTD_error_noForwardProgress_inputEmpty = 82, ZSTD_error_frameIndex_tooLarge = 100,
  ZSTD_error_seekableIO = 102, ZSTD_error_dstBuffer_wrong = 104, ZSTD_error_srcBuffer_wrong = 105, ZSTD_error_sequenceProducer_failed = 106,
  ZSTD_error_externalSequences_invalid = 107, ZSTD_error_maxCode = 120
}
 
enum  ZSTD_indexResetPolicy_e { ZSTDirp_continue, ZSTDirp_reset }
 
enum  ZSTD_litLocation_e { ZSTD_not_in_dst = 0, ZSTD_in_dst = 1, ZSTD_split = 2 }
 
enum  ZSTD_longLengthType_e { ZSTD_llt_none = 0, ZSTD_llt_literalLength = 1, ZSTD_llt_matchLength = 2 }
 
enum  ZSTD_longOffset_e { ZSTD_lo_isRegularOffset, ZSTD_lo_isLongOffset =1 }
 
enum  ZSTD_OptPrice_e { zop_dynamic =0, zop_predef }
 
enum  ZSTD_overlap_e { ZSTD_no_overlap, ZSTD_overlap_src_before_dst }
 
enum  ZSTD_resetTarget_e { ZSTD_resetTarget_CDict, ZSTD_resetTarget_CCtx }
 
enum  ZSTD_tableFillPurpose_e { ZSTD_tfp_forCCtx, ZSTD_tfp_forCDict }
 

Functions

static INLINE_KEYWORD UNUSED_ATTR void _force_has_format_string (const char *format,...)
 
static int allBytesIdentical (const void *src, size_t srcSize)
 
MEM_STATIC void BIT_addBits (BIT_CStream_t *bitC, size_t value, unsigned nbBits)
 
MEM_STATIC void BIT_addBitsFast (BIT_CStream_t *bitC, size_t value, unsigned nbBits)
 
MEM_STATIC size_t BIT_closeCStream (BIT_CStream_t *bitC)
 
MEM_STATIC unsigned BIT_endOfDStream (const BIT_DStream_t *bitD)
 
MEM_STATIC void BIT_flushBits (BIT_CStream_t *bitC)
 
MEM_STATIC void BIT_flushBitsFast (BIT_CStream_t *bitC)
 
MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits (size_t bitContainer, U32 const nbBits)
 
MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits (size_t bitContainer, U32 const start, U32 const nbBits)
 
MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits (size_t bitContainer, U32 const start)
 
MEM_STATIC size_t BIT_initCStream (BIT_CStream_t *bitC, void *dstBuffer, size_t dstCapacity)
 
MEM_STATIC size_t BIT_initDStream (BIT_DStream_t *bitD, const void *srcBuffer, size_t srcSize)
 
MEM_STATIC FORCE_INLINE_ATTR size_t BIT_lookBits (const BIT_DStream_t *bitD, U32 nbBits)
 
MEM_STATIC size_t BIT_lookBitsFast (const BIT_DStream_t *bitD, U32 nbBits)
 
MEM_STATIC size_t BIT_readBits (BIT_DStream_t *bitD, unsigned nbBits)
 
MEM_STATIC size_t BIT_readBitsFast (BIT_DStream_t *bitD, unsigned nbBits)
 
MEM_STATIC BIT_DStream_status BIT_reloadDStream (BIT_DStream_t *bitD)
 
MEM_STATIC BIT_DStream_status BIT_reloadDStreamFast (BIT_DStream_t *bitD)
 
MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits (BIT_DStream_t *bitD, U32 nbBits)
 
static size_t blockSize_explicitDelimiter (const ZSTD_Sequence *inSeqs, size_t inSeqsSize, ZSTD_sequencePosition seqPos)
 
static size_t blockSize_noDelimiter (size_t blockSize, size_t remaining)
 
static rawSeqStore_t bufferToSeq (buffer_t buffer)
 
static int construct_BWT (const unsigned char *T, int *SA, int *bucket_A, int *bucket_B, int n, int m)
 
static int construct_BWT_indexes (const unsigned char *T, int *SA, int *bucket_A, int *bucket_B, int n, int m, unsigned char *num_indexes, int *indexes)
 
static void construct_SA (const unsigned char *T, int *SA, int *bucket_A, int *bucket_B, int n, int m)
 
void COVER_best_destroy (COVER_best_t *best)
 
void COVER_best_finish (COVER_best_t *best, ZDICT_cover_params_t parameters, COVER_dictSelection_t selection)
 
void COVER_best_init (COVER_best_t *best)
 
void COVER_best_start (COVER_best_t *best)
 
void COVER_best_wait (COVER_best_t *best)
 
static size_t COVER_buildDictionary (const COVER_ctx_t *ctx, U32 *freqs, COVER_map_t *activeDmers, void *dictBuffer, size_t dictBufferCapacity, ZDICT_cover_params_t parameters)
 
static int COVER_checkParameters (ZDICT_cover_params_t parameters, size_t maxDictSize)
 
size_t COVER_checkTotalCompressedSize (const ZDICT_cover_params_t parameters, const size_t *samplesSizes, const BYTE *samples, size_t *offsets, size_t nbTrainSamples, size_t nbSamples, BYTE *const dict, size_t dictBufferCapacity)
 
static int COVER_cmp (COVER_ctx_t *ctx, const void *lp, const void *rp)
 
static int COVER_cmp8 (COVER_ctx_t *ctx, const void *lp, const void *rp)
 
COVER_epoch_info_t COVER_computeEpochs (U32 maxDictSize, U32 nbDmers, U32 k, U32 passes)
 
static void COVER_ctx_destroy (COVER_ctx_t *ctx)
 
static size_t COVER_ctx_init (COVER_ctx_t *ctx, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, unsigned d, double splitPoint)
 
COVER_dictSelection_t COVER_dictSelectionError (size_t error)
 
void COVER_dictSelectionFree (COVER_dictSelection_t selection)
 
unsigned COVER_dictSelectionIsError (COVER_dictSelection_t selection)
 
static void COVER_group (COVER_ctx_t *ctx, const void *group, const void *groupEnd)
 
static void COVER_groupBy (const void *data, size_t count, size_t size, COVER_ctx_t *ctx, int(*cmp)(COVER_ctx_t *, const void *, const void *), void(*grp)(COVER_ctx_t *, const void *, const void *))
 
static const size_t * COVER_lower_bound (const size_t *first, const size_t *last, size_t value)
 
static U32COVER_map_at (COVER_map_t *map, U32 key)
 
static void COVER_map_clear (COVER_map_t *map)
 
static void COVER_map_destroy (COVER_map_t *map)
 
static U32 COVER_map_hash (COVER_map_t *map, U32 key)
 
static U32 COVER_map_index (COVER_map_t *map, U32 key)
 
static int COVER_map_init (COVER_map_t *map, U32 size)
 
static void COVER_map_remove (COVER_map_t *map, U32 key)
 
COVER_dictSelection_t COVER_selectDict (BYTE *customDictContent, size_t dictBufferCapacity, size_t dictContentSize, const BYTE *samplesBuffer, const size_t *samplesSizes, unsigned nbFinalizeSamples, size_t nbCheckSamples, size_t nbSamples, ZDICT_cover_params_t params, size_t *offsets, size_t totalCompressedSize)
 
static COVER_segment_t COVER_selectSegment (const COVER_ctx_t *ctx, U32 *freqs, COVER_map_t *activeDmers, U32 begin, U32 end, ZDICT_cover_params_t parameters)
 
static int WIN_CDECL COVER_strict_cmp (const void *lp, const void *rp)
 
static int WIN_CDECL COVER_strict_cmp8 (const void *lp, const void *rp)
 
size_t COVER_sum (const size_t *samplesSizes, unsigned nbSamples)
 
static void COVER_tryParameters (void *opaque)
 
void COVER_warnOnSmallCorpus (size_t maxDictSize, size_t nbDmers, int displayLevel)
 
static size_t determine_blockSize (ZSTD_sequenceFormat_e mode, size_t blockSize, size_t remaining, const ZSTD_Sequence *inSeqs, size_t inSeqsSize, ZSTD_sequencePosition seqPos)
 
int divbwt (const unsigned char *T, unsigned char *U, int *A, int n, unsigned char *num_indexes, int *indexes, int openMP)
 
int divsufsort (const unsigned char *T, int *SA, int n, int openMP)
 
ERR_STATIC ERR_enum ERR_getErrorCode (size_t code)
 
const ERR_STATIC char * ERR_getErrorName (size_t code)
 
const char * ERR_getErrorString (ERR_enum code)
 
ERR_STATIC unsigned ERR_isError (size_t code)
 
static size_t FASTCOVER_buildDictionary (const FASTCOVER_ctx_t *ctx, U32 *freqs, void *dictBuffer, size_t dictBufferCapacity, ZDICT_cover_params_t parameters, U16 *segmentFreqs)
 
static int FASTCOVER_checkParameters (ZDICT_cover_params_t parameters, size_t maxDictSize, unsigned f, unsigned accel)
 
static void FASTCOVER_computeFrequency (U32 *freqs, const FASTCOVER_ctx_t *ctx)
 
static void FASTCOVER_convertToCoverParams (ZDICT_fastCover_params_t fastCoverParams, ZDICT_cover_params_t *coverParams)
 
static void FASTCOVER_convertToFastCoverParams (ZDICT_cover_params_t coverParams, ZDICT_fastCover_params_t *fastCoverParams, unsigned f, unsigned accel)
 
static void FASTCOVER_ctx_destroy (FASTCOVER_ctx_t *ctx)
 
static size_t FASTCOVER_ctx_init (FASTCOVER_ctx_t *ctx, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, unsigned d, double splitPoint, unsigned f, FASTCOVER_accel_t accelParams)
 
static size_t FASTCOVER_hashPtrToIndex (const void *p, U32 f, unsigned d)
 
static COVER_segment_t FASTCOVER_selectSegment (const FASTCOVER_ctx_t *ctx, U32 *freqs, U32 begin, U32 end, ZDICT_cover_params_t parameters, U16 *segmentFreqs)
 
static void FASTCOVER_tryParameters (void *opaque)
 
static syncPoint_t findSynchronizationPoint (ZSTDMT_CCtx const *mtctx, ZSTD_inBuffer const input)
 
MEM_STATIC U32 FSE_bitCost (const void *symbolTTPtr, U32 tableLog, U32 symbolValue, U32 accuracyLog)
 
FSE_PUBLIC_API size_t FSE_buildCTable (FSE_CTable *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
 
size_t FSE_buildCTable_rle (FSE_CTable *ct, unsigned char symbolValue)
 
size_t FSE_buildCTable_wksp (FSE_CTable *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workSpace, size_t wkspSize)
 
static size_t FSE_buildDTable_internal (FSE_DTable *dt, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workSpace, size_t wkspSize)
 
FSE_PUBLIC_API size_t FSE_buildDTable_wksp (FSE_DTable *dt, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workSpace, size_t wkspSize)
 
FSE_PUBLIC_API size_t FSE_compress_usingCTable (void *dst, size_t dstCapacity, const void *src, size_t srcSize, const FSE_CTable *ct)
 
static size_t FSE_compress_usingCTable_generic (void *dst, size_t dstSize, const void *src, size_t srcSize, const FSE_CTable *ct, const unsigned fast)
 
FSE_PUBLIC_API size_t FSE_compressBound (size_t size)
 
static unsigned char FSE_decodeSymbol (FSE_DState_t *DStatePtr, BIT_DStream_t *bitD)
 
static unsigned char FSE_decodeSymbolFast (FSE_DState_t *DStatePtr, BIT_DStream_t *bitD)
 
FORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic (void *dst, size_t maxDstSize, const void *cSrc, size_t cSrcSize, const FSE_DTable *dt, const unsigned fast)
 
size_t FSE_decompress_wksp_bmi2 (void *dst, size_t dstCapacity, const void *cSrc, size_t cSrcSize, unsigned maxLog, void *workSpace, size_t wkspSize, int bmi2)
 
FORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body (void *dst, size_t dstCapacity, const void *cSrc, size_t cSrcSize, unsigned maxLog, void *workSpace, size_t wkspSize, int bmi2)
 
static size_t FSE_decompress_wksp_body_default (void *dst, size_t dstCapacity, const void *cSrc, size_t cSrcSize, unsigned maxLog, void *workSpace, size_t wkspSize)
 
static void FSE_encodeSymbol (BIT_CStream_t *bitC, FSE_CState_t *CStatePtr, unsigned symbol)
 
static unsigned FSE_endOfDState (const FSE_DState_t *DStatePtr)
 
static void FSE_flushCState (BIT_CStream_t *bitC, const FSE_CState_t *CStatePtr)
 
const FSE_PUBLIC_API char * FSE_getErrorName (size_t code)
 
MEM_STATIC U32 FSE_getMaxNbBits (const void *symbolTTPtr, U32 symbolValue)
 
static void FSE_initCState (FSE_CState_t *CStatePtr, const FSE_CTable *ct)
 
MEM_STATIC void FSE_initCState2 (FSE_CState_t *statePtr, const FSE_CTable *ct, U32 symbol)
 
static void FSE_initDState (FSE_DState_t *DStatePtr, BIT_DStream_t *bitD, const FSE_DTable *dt)
 
FSE_PUBLIC_API unsigned FSE_isError (size_t code)
 
static unsigned FSE_minTableLog (size_t srcSize, unsigned maxSymbolValue)
 
FSE_PUBLIC_API size_t FSE_NCountWriteBound (unsigned maxSymbolValue, unsigned tableLog)
 
FSE_PUBLIC_API size_t FSE_normalizeCount (short *normalizedCounter, unsigned tableLog, const unsigned *count, size_t srcSize, unsigned maxSymbolValue, unsigned useLowProbCount)
 
static size_t FSE_normalizeM2 (short *norm, U32 tableLog, const unsigned *count, size_t total, U32 maxSymbolValue, short lowProbCount)
 
FSE_PUBLIC_API unsigned FSE_optimalTableLog (unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue)
 
unsigned FSE_optimalTableLog_internal (unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, unsigned minus)
 
MEM_STATIC BYTE FSE_peekSymbol (const FSE_DState_t *DStatePtr)
 
FSE_PUBLIC_API size_t FSE_readNCount (short *normalizedCounter, unsigned *maxSymbolValuePtr, unsigned *tableLogPtr, const void *rBuffer, size_t rBuffSize)
 
FSE_PUBLIC_API size_t FSE_readNCount_bmi2 (short *normalizedCounter, unsigned *maxSymbolValuePtr, unsigned *tableLogPtr, const void *rBuffer, size_t rBuffSize, int bmi2)
 
FORCE_INLINE_TEMPLATE size_t FSE_readNCount_body (short *normalizedCounter, unsigned *maxSVPtr, unsigned *tableLogPtr, const void *headerBuffer, size_t hbSize)
 
static size_t FSE_readNCount_body_default (short *normalizedCounter, unsigned *maxSVPtr, unsigned *tableLogPtr, const void *headerBuffer, size_t hbSize)
 
MEM_STATIC void FSE_updateState (FSE_DState_t *DStatePtr, BIT_DStream_t *bitD)
 
FSE_PUBLIC_API unsigned FSE_versionNumber (void)
 
FSE_PUBLIC_API size_t FSE_writeNCount (void *buffer, size_t bufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog)
 
static size_t FSE_writeNCount_generic (void *header, size_t headerBufferSize, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, unsigned writeIsSafe)
 
size_t HIST_count (unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize)
 
static size_t HIST_count_parallel_wksp (unsigned *count, unsigned *maxSymbolValuePtr, const void *source, size_t sourceSize, HIST_checkInput_e check, U32 *const workSpace)
 
unsigned HIST_count_simple (unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize)
 
size_t HIST_count_wksp (unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize, void *workSpace, size_t workSpaceSize)
 
size_t HIST_countFast (unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize)
 
size_t HIST_countFast_wksp (unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize, void *workSpace, size_t workSpaceSize)
 
unsigned HIST_isError (size_t code)
 
FORCE_INLINE_TEMPLATE void HUF_addBits (HUF_CStream_t *bitC, HUF_CElt elt, int idx, int kFast)
 
static void * HUF_alignUpWorkspace (void *workspace, size_t *workspaceSizePtr, size_t align)
 
size_t HUF_buildCTable_wksp (HUF_CElt *tree, const unsigned *count, U32 maxSymbolValue, U32 maxNbBits, void *workSpace, size_t wkspSize)
 
static void HUF_buildCTableFromTree (HUF_CElt *CTable, nodeElt const *huffNode, int nonNullRank, U32 maxSymbolValue, U32 maxNbBits)
 
static HUF_DEltX2 HUF_buildDEltX2 (U32 symbol, U32 nbBits, U32 baseSeq, int level)
 
static U32 HUF_buildDEltX2U32 (U32 symbol, U32 nbBits, U32 baseSeq, int level)
 
static U64 HUF_buildDEltX2U64 (U32 symbol, U32 nbBits, U16 baseSeq, int level)
 
static int HUF_buildTree (nodeElt *huffNode, U32 maxSymbolValue)
 
unsigned HUF_cardinality (const unsigned *count, unsigned maxSymbolValue)
 
static size_t HUF_closeCStream (HUF_CStream_t *bitC)
 
size_t HUF_compress1X_repeat (void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void *workSpace, size_t wkspSize, HUF_CElt *hufTable, HUF_repeat *repeat, int flags)
 
size_t HUF_compress1X_usingCTable (void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable, int flags)
 
static size_t HUF_compress1X_usingCTable_internal (void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable, const int flags)
 
FORCE_INLINE_TEMPLATE size_t HUF_compress1X_usingCTable_internal_body (void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable)
 
FORCE_INLINE_TEMPLATE void HUF_compress1X_usingCTable_internal_body_loop (HUF_CStream_t *bitC, const BYTE *ip, size_t srcSize, const HUF_CElt *ct, int kUnroll, int kFastFlush, int kLastFast)
 
size_t HUF_compress4X_repeat (void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void *workSpace, size_t wkspSize, HUF_CElt *hufTable, HUF_repeat *repeat, int flags)
 
size_t HUF_compress4X_usingCTable (void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable, int flags)
 
static size_t HUF_compress4X_usingCTable_internal (void *dst, size_t dstSize, const void *src, size_t srcSize, const HUF_CElt *CTable, int flags)
 
static size_t HUF_compress_internal (void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog, HUF_nbStreams_e nbStreams, void *workSpace, size_t wkspSize, HUF_CElt *oldHufTable, HUF_repeat *repeat, int flags)
 
size_t HUF_compressBound (size_t size)
 
static size_t HUF_compressCTable_internal (BYTE *const ostart, BYTE *op, BYTE *const oend, const void *src, size_t srcSize, HUF_nbStreams_e nbStreams, const HUF_CElt *CTable, const int flags)
 
static size_t HUF_compressWeights (void *dst, size_t dstSize, const void *weightTable, size_t wtSize, void *workspace, size_t workspaceSize)
 
FORCE_INLINE_TEMPLATE U32 HUF_decodeLastSymbolX2 (void *op, BIT_DStream_t *DStream, const HUF_DEltX2 *dt, const U32 dtLog)
 
HINT_INLINE size_t HUF_decodeStreamX1 (BYTE *p, BIT_DStream_t *const bitDPtr, BYTE *const pEnd, const HUF_DEltX1 *const dt, const U32 dtLog)
 
HINT_INLINE size_t HUF_decodeStreamX2 (BYTE *p, BIT_DStream_t *bitDPtr, BYTE *const pEnd, const HUF_DEltX2 *const dt, const U32 dtLog)
 
FORCE_INLINE_TEMPLATE BYTE HUF_decodeSymbolX1 (BIT_DStream_t *Dstream, const HUF_DEltX1 *dt, const U32 dtLog)
 
FORCE_INLINE_TEMPLATE U32 HUF_decodeSymbolX2 (void *op, BIT_DStream_t *DStream, const HUF_DEltX2 *dt, const U32 dtLog)
 
size_t HUF_decompress1X1_DCtx_wksp (HUF_DTable *dctx, void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, void *workSpace, size_t wkspSize, int flags)
 
FORCE_INLINE_TEMPLATE size_t HUF_decompress1X1_usingDTable_internal_body (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable)
 
size_t HUF_decompress1X2_DCtx_wksp (HUF_DTable *dctx, void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, void *workSpace, size_t wkspSize, int flags)
 
FORCE_INLINE_TEMPLATE size_t HUF_decompress1X2_usingDTable_internal_body (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable)
 
size_t HUF_decompress1X_DCtx_wksp (HUF_DTable *dctx, void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, void *workSpace, size_t wkspSize, int flags)
 
size_t HUF_decompress1X_usingDTable (void *dst, size_t maxDstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable, int flags)
 
static size_t HUF_decompress4X1_DCtx_wksp (HUF_DTable *dctx, void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, void *workSpace, size_t wkspSize, int flags)
 
static size_t HUF_decompress4X1_usingDTable_internal (void *dst, size_t dstSize, void const *cSrc, size_t cSrcSize, HUF_DTable const *DTable, int flags)
 
FORCE_INLINE_TEMPLATE size_t HUF_decompress4X1_usingDTable_internal_body (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable)
 
static size_t HUF_decompress4X1_usingDTable_internal_default (void *dst, size_t dstSize, void const *cSrc, size_t cSrcSize, HUF_DTable const *DTable)
 
static HUF_FAST_BMI2_ATTRS size_t HUF_decompress4X1_usingDTable_internal_fast (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable, HUF_DecompressFastLoopFn loopFn)
 
static HUF_FAST_BMI2_ATTRS void HUF_decompress4X1_usingDTable_internal_fast_c_loop (HUF_DecompressFastArgs *args)
 
static size_t HUF_decompress4X2_DCtx_wksp (HUF_DTable *dctx, void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, void *workSpace, size_t wkspSize, int flags)
 
static size_t HUF_decompress4X2_usingDTable_internal (void *dst, size_t dstSize, void const *cSrc, size_t cSrcSize, HUF_DTable const *DTable, int flags)
 
FORCE_INLINE_TEMPLATE size_t HUF_decompress4X2_usingDTable_internal_body (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable)
 
static size_t HUF_decompress4X2_usingDTable_internal_default (void *dst, size_t dstSize, void const *cSrc, size_t cSrcSize, HUF_DTable const *DTable)
 
static HUF_FAST_BMI2_ATTRS size_t HUF_decompress4X2_usingDTable_internal_fast (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable, HUF_DecompressFastLoopFn loopFn)
 
static HUF_FAST_BMI2_ATTRS void HUF_decompress4X2_usingDTable_internal_fast_c_loop (HUF_DecompressFastArgs *args)
 
size_t HUF_decompress4X_hufOnly_wksp (HUF_DTable *dctx, void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, void *workSpace, size_t wkspSize, int flags)
 
size_t HUF_decompress4X_usingDTable (void *dst, size_t maxDstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable, int flags)
 
static size_t HUF_DecompressFastArgs_init (HUF_DecompressFastArgs *args, void *dst, size_t dstSize, void const *src, size_t srcSize, const HUF_DTable *DTable)
 
static U64 HUF_DEltX1_set4 (BYTE symbol, BYTE nbBits)
 
FORCE_INLINE_TEMPLATE void HUF_encodeSymbol (HUF_CStream_t *bitCPtr, U32 symbol, const HUF_CElt *CTable, int idx, int fast)
 
static HUF_CElt HUF_endMark (void)
 
size_t HUF_estimateCompressedSize (const HUF_CElt *CTable, const unsigned *count, unsigned maxSymbolValue)
 
static void HUF_fillDTableX2 (HUF_DEltX2 *DTable, const U32 targetLog, const sortedSymbol_t *sortedList, const U32 *rankStart, rankValCol_t *rankValOrigin, const U32 maxWeight, const U32 nbBitsBaseline)
 
static void HUF_fillDTableX2ForWeight (HUF_DEltX2 *DTableRank, sortedSymbol_t const *begin, sortedSymbol_t const *end, U32 nbBits, U32 tableLog, U16 baseSeq, int const level)
 
static void HUF_fillDTableX2Level2 (HUF_DEltX2 *DTable, U32 targetLog, const U32 consumedBits, const U32 *rankVal, const int minWeight, const int maxWeight1, const sortedSymbol_t *sortedSymbols, U32 const *rankStart, U32 nbBitsBaseline, U16 baseSeq)
 
FORCE_INLINE_TEMPLATE void HUF_flushBits (HUF_CStream_t *bitC, int kFast)
 
static DTableDesc HUF_getDTableDesc (const HUF_DTable *table)
 
const char * HUF_getErrorName (size_t code)
 
static U32 HUF_getIndex (U32 const count)
 
static size_t HUF_getNbBits (HUF_CElt elt)
 
static size_t HUF_getNbBitsFast (HUF_CElt elt)
 
U32 HUF_getNbBitsFromCTable (const HUF_CElt *symbolTable, U32 symbolValue)
 
static size_t HUF_getValue (HUF_CElt elt)
 
static size_t HUF_getValueFast (HUF_CElt elt)
 
static size_t HUF_initCStream (HUF_CStream_t *bitC, void *startPtr, size_t dstCapacity)
 
static size_t HUF_initFastDStream (BYTE const *ip)
 
static size_t HUF_initRemainingDStream (BIT_DStream_t *bit, HUF_DecompressFastArgs const *args, int stream, BYTE *segmentEnd)
 
HINT_INLINE void HUF_insertionSort (nodeElt huffNode[], int const low, int const high)
 
unsigned HUF_isError (size_t code)
 
MEM_STATIC int HUF_isSorted (nodeElt huffNode[], U32 const maxSymbolValue1)
 
FORCE_INLINE_TEMPLATE void HUF_mergeIndex1 (HUF_CStream_t *bitC)
 
unsigned HUF_minTableLog (unsigned symbolCardinality)
 
unsigned HUF_optimalTableLog (unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue, void *workSpace, size_t wkspSize, HUF_CElt *table, const unsigned *count, int flags)
 
static int HUF_quickSortPartition (nodeElt arr[], int const low, int const high)
 
size_t HUF_readCTable (HUF_CElt *CTable, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize, unsigned *hasZeroWeights)
 
size_t HUF_readDTableX1_wksp (HUF_DTable *DTable, const void *src, size_t srcSize, void *workSpace, size_t wkspSize, int flags)
 
size_t HUF_readDTableX2_wksp (HUF_DTable *DTable, const void *src, size_t srcSize, void *workSpace, size_t wkspSize, int flags)
 
size_t HUF_readStats (BYTE *huffWeight, size_t hwSize, U32 *rankStats, U32 *nbSymbolsPtr, U32 *tableLogPtr, const void *src, size_t srcSize)
 
FORCE_INLINE_TEMPLATE size_t HUF_readStats_body (BYTE *huffWeight, size_t hwSize, U32 *rankStats, U32 *nbSymbolsPtr, U32 *tableLogPtr, const void *src, size_t srcSize, void *workSpace, size_t wkspSize, int bmi2)
 
static size_t HUF_readStats_body_default (BYTE *huffWeight, size_t hwSize, U32 *rankStats, U32 *nbSymbolsPtr, U32 *tableLogPtr, const void *src, size_t srcSize, void *workSpace, size_t wkspSize)
 
size_t HUF_readStats_wksp (BYTE *huffWeight, size_t hwSize, U32 *rankStats, U32 *nbSymbolsPtr, U32 *tableLogPtr, const void *src, size_t srcSize, void *workspace, size_t wkspSize, int flags)
 
static U32 HUF_rescaleStats (BYTE *huffWeight, U32 *rankVal, U32 nbSymbols, U32 tableLog, U32 targetTableLog)
 
U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize)
 
static U32 HUF_setMaxHeight (nodeElt *huffNode, U32 lastNonNull, U32 targetNbBits)
 
static void HUF_setNbBits (HUF_CElt *elt, size_t nbBits)
 
static void HUF_setValue (HUF_CElt *elt, size_t value)
 
static void HUF_simpleQuickSort (nodeElt arr[], int low, int high)
 
static void HUF_sort (nodeElt huffNode[], const unsigned count[], U32 const maxSymbolValue, rankPos rankPosition[])
 
static void HUF_swapNodes (nodeElt *a, nodeElt *b)
 
static size_t HUF_tightCompressBound (size_t srcSize, size_t tableLog)
 
int HUF_validateCTable (const HUF_CElt *CTable, const unsigned *count, unsigned maxSymbolValue)
 
size_t HUF_writeCTable_wksp (void *dst, size_t maxDstSize, const HUF_CElt *CTable, unsigned maxSymbolValue, unsigned huffLog, void *workspace, size_t workspaceSize)
 
FORCE_INLINE_TEMPLATE void HUF_zeroIndex1 (HUF_CStream_t *bitC)
 
static ZSTD_inBuffer inBuffer_forEndFlush (const ZSTD_CStream *zcs)
 
static int isIncluded (const void *in, const void *container, size_t length)
 
static int isQueueFull (POOL_ctx const *ctx)
 
static rawSeq maybeSplitSequence (rawSeqStore_t *rawSeqStore, U32 const remaining, U32 const minMatch)
 
MEM_STATIC unsigned MEM_32bits (void)
 
MEM_STATIC unsigned MEM_64bits (void)
 
MEM_STATIC void MEM_check (void)
 
MEM_STATIC unsigned MEM_isLittleEndian (void)
 
MEM_STATIC U16 MEM_read16 (const void *memPtr)
 
MEM_STATIC U32 MEM_read32 (const void *memPtr)
 
MEM_STATIC U64 MEM_read64 (const void *memPtr)
 
MEM_STATIC U32 MEM_readBE32 (const void *memPtr)
 
MEM_STATIC U64 MEM_readBE64 (const void *memPtr)
 
MEM_STATIC size_t MEM_readBEST (const void *memPtr)
 
MEM_STATIC U16 MEM_readLE16 (const void *memPtr)
 
MEM_STATIC U32 MEM_readLE24 (const void *memPtr)
 
MEM_STATIC U32 MEM_readLE32 (const void *memPtr)
 
MEM_STATIC U64 MEM_readLE64 (const void *memPtr)
 
MEM_STATIC size_t MEM_readLEST (const void *memPtr)
 
MEM_STATIC size_t MEM_readST (const void *memPtr)
 
MEM_STATIC U32 MEM_swap32 (U32 in)
 
MEM_STATIC U32 MEM_swap32_fallback (U32 in)
 
MEM_STATIC U64 MEM_swap64 (U64 in)
 
MEM_STATIC U64 MEM_swap64_fallback (U64 in)
 
MEM_STATIC size_t MEM_swapST (size_t in)
 
MEM_STATIC void MEM_write16 (void *memPtr, U16 value)
 
MEM_STATIC void MEM_write32 (void *memPtr, U32 value)
 
MEM_STATIC void MEM_write64 (void *memPtr, U64 value)
 
MEM_STATIC void MEM_writeBE32 (void *memPtr, U32 val32)
 
MEM_STATIC void MEM_writeBE64 (void *memPtr, U64 val64)
 
MEM_STATIC void MEM_writeBEST (void *memPtr, size_t val)
 
MEM_STATIC void MEM_writeLE16 (void *memPtr, U16 val)
 
MEM_STATIC void MEM_writeLE24 (void *memPtr, U32 val)
 
MEM_STATIC void MEM_writeLE32 (void *memPtr, U32 val32)
 
MEM_STATIC void MEM_writeLE64 (void *memPtr, U64 val64)
 
MEM_STATIC void MEM_writeLEST (void *memPtr, size_t val)
 
void POOL_add (POOL_ctx *ctx, POOL_function function, void *opaque)
 
static void POOL_add_internal (POOL_ctx *ctx, POOL_function function, void *opaque)
 
POOL_ctxPOOL_create (size_t numThreads, size_t queueSize)
 
POOL_ctxPOOL_create_advanced (size_t numThreads, size_t queueSize, ZSTD_customMem customMem)
 
void POOL_free (POOL_ctx *ctx)
 
static void POOL_join (POOL_ctx *ctx)
 
void POOL_joinJobs (POOL_ctx *ctx)
 
int POOL_resize (POOL_ctx *ctx, size_t numThreads)
 
static int POOL_resize_internal (POOL_ctx *ctx, size_t numThreads)
 
size_t POOL_sizeof (const POOL_ctx *ctx)
 
static void * POOL_thread (void *opaque)
 
int POOL_tryAdd (POOL_ctx *ctx, POOL_function function, void *opaque)
 
static size_t readSkippableFrameSize (void const *src, size_t srcSize)
 
static buffer_t seqToBuffer (rawSeqStore_t seq)
 
static COVER_dictSelection_t setDictSelection (BYTE *buf, size_t s, size_t csz)
 
static int sort_typeBstar (const unsigned char *T, int *SA, int *bucket_A, int *bucket_B, int n, int openMP)
 
static INLINE void ss_blockswap (int *a, int *b, int n)
 
static INLINE int ss_compare (const unsigned char *T, const int *p1, const int *p2, int depth)
 
static void ss_inplacemerge (const unsigned char *T, const int *PA, int *first, int *middle, int *last, int depth)
 
static void ss_insertionsort (const unsigned char *T, const int *PA, int *first, int *last, int depth)
 
static INLINE int ss_isqrt (int x)
 
static void ss_mergebackward (const unsigned char *T, const int *PA, int *first, int *middle, int *last, int *buf, int depth)
 
static void ss_mergeforward (const unsigned char *T, const int *PA, int *first, int *middle, int *last, int *buf, int depth)
 
static INLINE void ss_rotate (int *first, int *middle, int *last)
 
static void ss_swapmerge (const unsigned char *T, const int *PA, int *first, int *middle, int *last, int *buf, int bufsize, int depth)
 
static void sssort (const unsigned char *T, const int *PA, int *first, int *last, int *buf, int bufsize, int depth, int n, int lastsuffix)
 
static U32 sum_u32 (const unsigned table[], size_t nbElts)
 
static void tr_copy (int *ISA, const int *SA, int *first, int *a, int *b, int *last, int depth)
 
static INLINE void tr_fixdown (const int *ISAd, int *SA, int i, int size)
 
static void tr_heapsort (const int *ISAd, int *SA, int size)
 
static INLINE int tr_ilg (int n)
 
static void tr_insertionsort (const int *ISAd, int *first, int *last)
 
static void tr_introsort (int *ISA, const int *ISAd, int *SA, int *first, int *last, trbudget_t *budget)
 
static INLINE int * tr_median3 (const int *ISAd, int *v1, int *v2, int *v3)
 
static INLINE int * tr_median5 (const int *ISAd, int *v1, int *v2, int *v3, int *v4, int *v5)
 
static void tr_partialcopy (int *ISA, const int *SA, int *first, int *a, int *b, int *last, int depth)
 
static INLINE void tr_partition (const int *ISAd, int *first, int *middle, int *last, int **pa, int **pb, int v)
 
static INLINE int * tr_pivot (const int *ISAd, int *first, int *last)
 
static INLINE int trbudget_check (trbudget_t *budget, int size)
 
static INLINE void trbudget_init (trbudget_t *budget, int chance, int incval)
 
static void trsort (int *ISA, int *SA, int n, int depth)
 
static void writeBlockHeader (void *op, size_t cSize, size_t blockSize, U32 lastBlock)
 
XXH_PUBLIC_API XXH32_hash_t XXH32 (const void *input, size_t length, XXH32_hash_t seed)
 Calculates the 32-bit hash of input using xxHash32. More...
 
static xxh_u32 XXH32_avalanche (xxh_u32 h32)
 
XXH_PUBLIC_API void XXH32_canonicalFromHash (XXH32_canonical_t *dst, XXH32_hash_t hash)
 Converts an XXH32_hash_t to a big endian XXH32_canonical_t. More...
 
XXH_PUBLIC_API void XXH32_copyState (XXH32_state_t *dst_state, const XXH32_state_t *src_state)
 Copies one XXH32_state_t to another. More...
 
XXH_PUBLIC_API XXH32_hash_t XXH32_digest (const XXH32_state_t *statePtr)
 Returns the calculated hash value from an XXH32_state_t. More...
 
XXH_FORCE_INLINE xxh_u32 XXH32_endian_align (const xxh_u8 *input, size_t len, xxh_u32 seed, XXH_alignment align)
 
static xxh_u32 XXH32_finalize (xxh_u32 h32, const xxh_u8 *ptr, size_t len, XXH_alignment align)
 
XXH_PUBLIC_API XXH_errorcode XXH32_freeState (XXH32_state_t *statePtr)
 Frees an XXH32_state_t. More...
 
XXH_PUBLIC_API XXH32_hash_t XXH32_hashFromCanonical (const XXH32_canonical_t *src)
 Converts an XXH32_canonical_t to a native XXH32_hash_t. More...
 
XXH_PUBLIC_API XXH_errorcode XXH32_reset (XXH32_state_t *statePtr, XXH32_hash_t seed)
 Resets an XXH32_state_t to begin a new hash. More...
 
static xxh_u32 XXH32_round (xxh_u32 acc, xxh_u32 input)
 
XXH_PUBLIC_API XXH_errorcode XXH32_update (XXH32_state_t *statePtr, const void *input, size_t length)
 Consumes a block of input to an XXH32_state_t. More...
 
XXH_PUBLIC_API XXH64_hash_t XXH64 (const void *input, size_t length, XXH64_hash_t seed)
 Calculates the 64-bit hash of input using xxHash64. More...
 
static xxh_u64 XXH64_avalanche (xxh_u64 h64)
 
XXH_PUBLIC_API void XXH64_canonicalFromHash (XXH64_canonical_t *dst, XXH64_hash_t hash)
 
XXH_PUBLIC_API void XXH64_copyState (XXH64_state_t *dst_state, const XXH64_state_t *src_state)
 
XXH_PUBLIC_API XXH64_hash_t XXH64_digest (const XXH64_state_t *statePtr)
 
XXH_FORCE_INLINE xxh_u64 XXH64_endian_align (const xxh_u8 *input, size_t len, xxh_u64 seed, XXH_alignment align)
 
static xxh_u64 XXH64_finalize (xxh_u64 h64, const xxh_u8 *ptr, size_t len, XXH_alignment align)
 
XXH_PUBLIC_API XXH_errorcode XXH64_freeState (XXH64_state_t *statePtr)
 
XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical (const XXH64_canonical_t *src)
 
static xxh_u64 XXH64_mergeRound (xxh_u64 acc, xxh_u64 val)
 
XXH_PUBLIC_API XXH_errorcode XXH64_reset (XXH64_state_t *statePtr, XXH64_hash_t seed)
 
static xxh_u64 XXH64_round (xxh_u64 acc, xxh_u64 input)
 
XXH_PUBLIC_API XXH_errorcode XXH64_update (XXH64_state_t *statePtr, const void *input, size_t length)
 
static void XXH_free (void *p)
 
static int XXH_isLittleEndian (void)
 
static void * XXH_malloc (size_t s)
 
static void * XXH_memcpy (void *dest, const void *src, size_t size)
 
static xxh_u32 XXH_read32 (const void *memPtr)
 
static xxh_u32 XXH_readBE32 (const void *ptr)
 
XXH_FORCE_INLINE xxh_u32 XXH_readLE32 (const void *ptr)
 
XXH_FORCE_INLINE xxh_u32 XXH_readLE32_align (const void *ptr, XXH_alignment align)
 
static xxh_u32 XXH_swap32 (xxh_u32 x)
 
ZDICTLIB_STATIC_API size_t ZDICT_addEntropyTablesFromBuffer (void *dictBuffer, size_t dictContentSize, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples)
 
static size_t ZDICT_addEntropyTablesFromBuffer_advanced (void *dictBuffer, size_t dictContentSize, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_params_t params)
 
static size_t ZDICT_analyzeEntropy (void *dstBuffer, size_t maxDstSize, int compressionLevel, const void *srcBuffer, const size_t *fileSizes, unsigned nbFiles, const void *dictBuffer, size_t dictBufferSize, unsigned notificationLevel)
 
static dictItem ZDICT_analyzePos (BYTE *doneMarks, const int *suffix, U32 start, const void *buffer, U32 minRatio, U32 notificationLevel)
 
static clock_t ZDICT_clockSpan (clock_t nPrevious)
 
static size_t ZDICT_count (const void *pIn, const void *pMatch)
 
static void ZDICT_countEStats (EStats_ress_t esr, const ZSTD_parameters *params, unsigned *countLit, unsigned *offsetcodeCount, unsigned *matchlengthCount, unsigned *litlengthCount, U32 *repOffsets, const void *src, size_t srcSize, U32 notificationLevel)
 
static U32 ZDICT_dictSize (const dictItem *dictList)
 
static void ZDICT_fillNoise (void *buffer, size_t length)
 
ZDICTLIB_API size_t ZDICT_finalizeDictionary (void *dstDictBuffer, size_t maxDictSize, const void *dictContent, size_t dictContentSize, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_params_t parameters)
 
static void ZDICT_flatLit (unsigned *countLit)
 
ZDICTLIB_API size_t ZDICT_getDictHeaderSize (const void *dictBuffer, size_t dictSize)
 
ZDICTLIB_API unsigned ZDICT_getDictID (const void *dictBuffer, size_t dictSize)
 
const ZDICTLIB_API char * ZDICT_getErrorName (size_t errorCode)
 
static void ZDICT_initDictItem (dictItem *d)
 
static void ZDICT_insertDictItem (dictItem *table, U32 maxSize, dictItem elt, const void *buffer)
 
static void ZDICT_insertSortCount (offsetCount_t table[ZSTD_REP_NUM+1], U32 val, U32 count)
 
ZDICTLIB_API unsigned ZDICT_isError (size_t errorCode)
 
static U32 ZDICT_maxRep (U32 const reps[ZSTD_REP_NUM])
 
ZDICTLIB_STATIC_API size_t ZDICT_optimizeTrainFromBuffer_cover (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_cover_params_t *parameters)
 
ZDICTLIB_STATIC_API size_t ZDICT_optimizeTrainFromBuffer_fastCover (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_fastCover_params_t *parameters)
 
static void ZDICT_printHex (const void *ptr, size_t length)
 
static void ZDICT_removeDictItem (dictItem *table, U32 id)
 
static size_t ZDICT_totalSampleSize (const size_t *fileSizes, unsigned nbFiles)
 
static size_t ZDICT_trainBuffer_legacy (dictItem *dictList, U32 dictListSize, const void *const buffer, size_t bufferSize, const size_t *fileSizes, unsigned nbFiles, unsigned minRatio, U32 notificationLevel)
 
ZDICTLIB_API size_t ZDICT_trainFromBuffer (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples)
 
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_cover (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_cover_params_t parameters)
 
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_fastCover (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_fastCover_params_t parameters)
 
ZDICTLIB_STATIC_API size_t ZDICT_trainFromBuffer_legacy (void *dictBuffer, size_t dictBufferCapacity, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_legacy_params_t parameters)
 
static size_t ZDICT_trainFromBuffer_unsafe_legacy (void *dictBuffer, size_t maxDictSize, const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples, ZDICT_legacy_params_t params)
 
static U32 ZDICT_tryMerge (dictItem *table, dictItem elt, U32 eltNbToSkip, const void *buffer)
 
ZSTD_compressionParameters ZSTD_adjustCParams (ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize)
 
static ZSTD_compressionParameters ZSTD_adjustCParams_internal (ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize, ZSTD_cParamMode_e mode, ZSTD_paramSwitch_e useRowMatchFinder)
 
static void ZSTD_advanceHashSalt (ZSTD_matchState_t *ms)
 
static int ZSTD_allocateChainTable (const ZSTD_strategy strategy, const ZSTD_paramSwitch_e useRowMatchFinder, const U32 forDDSDict)
 
static void ZSTD_allocateLiteralsBuffer (ZSTD_DCtx *dctx, void *const dst, const size_t dstCapacity, const size_t litSize, const streaming_operation streaming, const size_t expectedWriteSize, const unsigned splitImmediately)
 
static void ZSTD_assertEqualCParams (ZSTD_compressionParameters cParams1, ZSTD_compressionParameters cParams2)
 
static U64 ZSTD_bitmix (U64 val, U64 len)
 
MEM_STATIC U32 ZSTD_bitWeight (U32 stat)
 
static int ZSTD_blockSplitterEnabled (ZSTD_CCtx_params *cctxParams)
 
static void ZSTD_blockState_confirmRepcodesAndEntropyTables (ZSTD_blockState_t *const bs)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_BtFindBestMatch (ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iLimit, size_t *offBasePtr, const U32 mls, const ZSTD_dictMode_e dictMode)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_btGetAllMatches_internal (ZSTD_match_t *matches, ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *ip, const BYTE *const iHighLimit, const U32 rep[ZSTD_REP_NUM], U32 const ll0, U32 const lengthToBeat, const ZSTD_dictMode_e dictMode, const U32 mls)
 
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)
 
static size_t ZSTD_buildBlockEntropyStats_literals (void *const src, size_t srcSize, const ZSTD_hufCTables_t *prevHuf, ZSTD_hufCTables_t *nextHuf, ZSTD_hufCTablesMetadata_t *hufMetadata, const int literalsCompressionIsDisabled, void *workspace, size_t wkspSize, int hufFlags)
 
static size_t ZSTD_buildBlockEntropyStats_sequences (const seqStore_t *seqStorePtr, const ZSTD_fseCTables_t *prevEntropy, ZSTD_fseCTables_t *nextEntropy, const ZSTD_CCtx_params *cctxParams, ZSTD_fseCTablesMetadata_t *fseMetadata, void *workspace, size_t wkspSize)
 
size_t ZSTD_buildCTable (void *dst, size_t dstCapacity, FSE_CTable *nextCTable, U32 FSELog, symbolEncodingType_e type, unsigned *count, U32 max, const BYTE *codeTable, size_t nbSeq, const S16 *defaultNorm, U32 defaultNormLog, U32 defaultMax, const FSE_CTable *prevCTable, size_t prevCTableSize, void *entropyWorkspace, size_t entropyWorkspaceSize)
 
static ZSTD_symbolEncodingTypeStats_t ZSTD_buildDummySequencesStatistics (ZSTD_fseCTables_t *nextEntropy)
 
static size_t ZSTD_buildEntropyStatisticsAndEstimateSubBlockSize (seqStore_t *seqStore, ZSTD_CCtx *zc)
 
void ZSTD_buildFSETable (ZSTD_seqSymbol *dt, const short *normalizedCounter, unsigned maxSymbolValue, const U32 *baseValue, const U8 *nbAdditionalBits, unsigned tableLog, void *wksp, size_t wkspSize, int bmi2)
 
FORCE_INLINE_TEMPLATE void ZSTD_buildFSETable_body (ZSTD_seqSymbol *dt, const short *normalizedCounter, unsigned maxSymbolValue, const U32 *baseValue, const U8 *nbAdditionalBits, unsigned tableLog, void *wksp, size_t wkspSize)
 
static void ZSTD_buildFSETable_body_default (ZSTD_seqSymbol *dt, const short *normalizedCounter, unsigned maxSymbolValue, const U32 *baseValue, const U8 *nbAdditionalBits, unsigned tableLog, void *wksp, size_t wkspSize)
 
static size_t ZSTD_buildSeqStore (ZSTD_CCtx *zc, const void *src, size_t srcSize)
 
static size_t ZSTD_buildSeqTable (ZSTD_seqSymbol *DTableSpace, const ZSTD_seqSymbol **DTablePtr, symbolEncodingType_e type, unsigned max, U32 maxLog, const void *src, size_t srcSize, const U32 *baseValue, const U8 *nbAdditionalBits, const ZSTD_seqSymbol *defaultTable, U32 flagRepeatTable, int ddictIsCold, int nbSeq, U32 *wksp, size_t wkspSize, int bmi2)
 
static void ZSTD_buildSeqTable_rle (ZSTD_seqSymbol *dt, U32 baseValue, U8 nbAddBits)
 
static ZSTD_symbolEncodingTypeStats_t ZSTD_buildSequencesStatistics (const seqStore_t *seqStorePtr, size_t nbSeq, const ZSTD_fseCTables_t *prevEntropy, ZSTD_fseCTables_t *nextEntropy, BYTE *dst, const BYTE *const dstEnd, ZSTD_strategy strategy, unsigned *countWorkspace, void *entropyWorkspace, size_t entropyWkspSize)
 
size_t ZSTD_CCtx_getParameter (ZSTD_CCtx const *cctx, ZSTD_cParameter param, int *value)
 
static size_t ZSTD_CCtx_init_compressStream2 (ZSTD_CCtx *cctx, ZSTD_EndDirective endOp, size_t inSize)
 
size_t ZSTD_CCtx_loadDictionary (ZSTD_CCtx *cctx, const void *dict, size_t dictSize)
 
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_refCDict (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict)
 
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_refThreadPool (ZSTD_CCtx *cctx, ZSTD_threadPool *pool)
 
size_t ZSTD_CCtx_reset (ZSTD_CCtx *cctx, ZSTD_ResetDirective reset)
 
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_setParameter (ZSTD_CCtx *cctx, ZSTD_cParameter param, int value)
 
size_t ZSTD_CCtx_setParametersUsingCCtxParams (ZSTD_CCtx *cctx, const ZSTD_CCtx_params *params)
 
size_t ZSTD_CCtx_setParams (ZSTD_CCtx *cctx, ZSTD_parameters params)
 
size_t ZSTD_CCtx_setPledgedSrcSize (ZSTD_CCtx *cctx, unsigned long long pledgedSrcSize)
 
void ZSTD_CCtx_trace (ZSTD_CCtx *cctx, size_t extraCSize)
 
size_t ZSTD_CCtxParams_getParameter (ZSTD_CCtx_params const *CCtxParams, ZSTD_cParameter param, int *value)
 
size_t ZSTD_CCtxParams_init (ZSTD_CCtx_params *cctxParams, int compressionLevel)
 
size_t ZSTD_CCtxParams_init_advanced (ZSTD_CCtx_params *cctxParams, ZSTD_parameters params)
 
static void ZSTD_CCtxParams_init_internal (ZSTD_CCtx_params *cctxParams, const ZSTD_parameters *params, int compressionLevel)
 
size_t ZSTD_CCtxParams_reset (ZSTD_CCtx_params *params)
 
size_t ZSTD_CCtxParams_setParameter (ZSTD_CCtx_params *CCtxParams, ZSTD_cParameter param, int value)
 
static void ZSTD_CCtxParams_setZstdParams (ZSTD_CCtx_params *cctxParams, const ZSTD_parameters *params)
 
static int ZSTD_CDictIndicesAreTagged (const ZSTD_compressionParameters *const cParams)
 
static size_t ZSTD_checkBufferStability (ZSTD_CCtx const *cctx, ZSTD_outBuffer const *output, ZSTD_inBuffer const *input, ZSTD_EndDirective endOp)
 
void ZSTD_checkContinuity (ZSTD_DCtx *dctx, const void *dst, size_t dstSize)
 
size_t ZSTD_checkCParams (ZSTD_compressionParameters cParams)
 
MEM_STATIC void ZSTD_checkDictValidity (const ZSTD_window_t *window, const void *blockEnd, U32 maxDist, U32 *loadedDictEndPtr, const ZSTD_matchState_t **dictMatchStatePtr)
 
static size_t ZSTD_checkOutBuffer (ZSTD_DStream const *zds, ZSTD_outBuffer const *output)
 
static ZSTD_compressionParameters ZSTD_clampCParams (ZSTD_compressionParameters cParams)
 
static void ZSTD_clearAllDicts (ZSTD_CCtx *cctx)
 
static void ZSTD_clearDict (ZSTD_DCtx *dctx)
 
MEM_STATIC int ZSTD_comparePackedTags (size_t packedTag1, size_t packedTag2)
 
size_t ZSTD_compress (void *dst, size_t dstCapacity, const void *src, size_t srcSize, int compressionLevel)
 
size_t ZSTD_compress2 (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)
 
static size_t ZSTD_compress_frameChunk (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastFrameChunk)
 
static size_t ZSTD_compress_insertDictionary (ZSTD_compressedBlockState_t *bs, ZSTD_matchState_t *ms, ldmState_t *ls, ZSTD_cwksp *ws, const ZSTD_CCtx_params *params, const void *dict, size_t dictSize, ZSTD_dictContentType_e dictContentType, ZSTD_dictTableLoadMethod_e dtlm, ZSTD_tableFillPurpose_e tfp, void *workspace)
 
size_t ZSTD_compress_usingCDict (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, 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)
 
static size_t ZSTD_compress_usingCDict_internal (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_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_compressBegin (ZSTD_CCtx *cctx, int compressionLevel)
 
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_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)
 
static size_t ZSTD_compressBegin_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, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff)
 
size_t ZSTD_compressBegin_usingCDict (ZSTD_CCtx *cctx, 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)
 
static size_t ZSTD_compressBegin_usingCDict_internal (ZSTD_CCtx *const cctx, const ZSTD_CDict *const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize)
 
size_t ZSTD_compressBegin_usingDict (ZSTD_CCtx *cctx, const void *dict, size_t dictSize, int compressionLevel)
 
static size_t ZSTD_compressBegin_usingDict_deprecated (ZSTD_CCtx *cctx, const void *dict, size_t dictSize, int compressionLevel)
 
size_t ZSTD_compressBlock (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btlazy2 (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btlazy2_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btlazy2_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btopt (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btopt_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btopt_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btultra (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btultra2 (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btultra_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_btultra_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_deprecated (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_compressBlock_doubleFast (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_doubleFast_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_doubleFast_dictMatchState_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
 
size_t ZSTD_compressBlock_doubleFast_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
static size_t ZSTD_compressBlock_doubleFast_extDict_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_doubleFast_noDict_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
 
size_t ZSTD_compressBlock_fast (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_fast_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_dictMatchState_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls, U32 const hasStep)
 
size_t ZSTD_compressBlock_fast_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
static size_t ZSTD_compressBlock_fast_extDict_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls, U32 const hasStep)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_noDict_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls, U32 const hasStep)
 
size_t ZSTD_compressBlock_greedy (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_dedicatedDictSearch (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_dedicatedDictSearch_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_dictMatchState_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_extDict_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_greedy_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
static size_t ZSTD_compressBlock_internal (ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 frame)
 
size_t ZSTD_compressBlock_lazy (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2 (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_dictMatchState_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_extDict_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy2_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy_dedicatedDictSearch (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy_dedicatedDictSearch_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy_dictMatchState (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy_dictMatchState_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
size_t ZSTD_compressBlock_lazy_extDict (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_lazy_extDict_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize, const searchMethod_e searchMethod, const U32 depth)
 
size_t ZSTD_compressBlock_lazy_extDict_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_lazy_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize, const searchMethod_e searchMethod, const U32 depth, ZSTD_dictMode_e const dictMode)
 
size_t ZSTD_compressBlock_lazy_row (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
 
static size_t ZSTD_compressBlock_opt0 (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize, const ZSTD_dictMode_e dictMode)
 
static size_t ZSTD_compressBlock_opt2 (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize, const ZSTD_dictMode_e dictMode)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_opt_generic (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize, const int optLevel, const ZSTD_dictMode_e dictMode)
 
static size_t ZSTD_compressBlock_splitBlock (ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastBlock)
 
static size_t ZSTD_compressBlock_splitBlock_internal (ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t blockSize, U32 lastBlock, U32 nbSeq)
 
static size_t ZSTD_compressBlock_targetCBlockSize (ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastBlock)
 
static size_t ZSTD_compressBlock_targetCBlockSize_body (ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const size_t bss, U32 lastBlock)
 
size_t ZSTD_compressBound (size_t srcSize)
 
size_t ZSTD_compressCCtx (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, int compressionLevel)
 
size_t ZSTD_compressContinue (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static size_t ZSTD_compressContinue_internal (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 frame, U32 lastFrameChunk)
 
size_t ZSTD_compressContinue_public (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static int ZSTD_compressedLiterals (optState_t const *const optPtr)
 
size_t ZSTD_compressEnd (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_compressLiterals (void *dst, size_t dstCapacity, const void *src, size_t srcSize, void *entropyWorkspace, size_t entropyWorkspaceSize, const ZSTD_hufCTables_t *prevHuf, ZSTD_hufCTables_t *nextHuf, ZSTD_strategy strategy, int disableLiteralCompression, int suspectUncompressible, int bmi2)
 
size_t ZSTD_compressRleLiteralsBlock (void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static size_t ZSTD_compressSeqStore_singleBlock (ZSTD_CCtx *zc, const seqStore_t *const seqStore, repcodes_t *const dRep, repcodes_t *const cRep, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastBlock, U32 isPartition)
 
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)
 
static size_t ZSTD_compressSequences_internal (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const ZSTD_Sequence *inSeqs, size_t inSeqsSize, const void *src, size_t srcSize)
 
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)
 
static size_t ZSTD_compressStream_generic (ZSTD_CStream *zcs, ZSTD_outBuffer *output, ZSTD_inBuffer *input, ZSTD_EndDirective const flushMode)
 
static size_t ZSTD_compressSubBlock (const ZSTD_entropyCTables_t *entropy, const ZSTD_entropyCTablesMetadata_t *entropyMetadata, const seqDef *sequences, size_t nbSeq, const BYTE *literals, size_t litSize, const BYTE *llCode, const BYTE *mlCode, const BYTE *ofCode, const ZSTD_CCtx_params *cctxParams, void *dst, size_t dstCapacity, const int bmi2, int writeLitEntropy, int writeSeqEntropy, int *litEntropyWritten, int *seqEntropyWritten, U32 lastBlock)
 
static size_t ZSTD_compressSubBlock_literal (const HUF_CElt *hufTable, const ZSTD_hufCTablesMetadata_t *hufMetadata, const BYTE *literals, size_t litSize, void *dst, size_t dstSize, const int bmi2, int writeEntropy, int *entropyWritten)
 
static size_t ZSTD_compressSubBlock_multi (const seqStore_t *seqStorePtr, const ZSTD_compressedBlockState_t *prevCBlock, ZSTD_compressedBlockState_t *nextCBlock, const ZSTD_entropyCTablesMetadata_t *entropyMetadata, const ZSTD_CCtx_params *cctxParams, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const int bmi2, U32 lastBlock, void *workspace, size_t wkspSize)
 
static size_t ZSTD_compressSubBlock_sequences (const ZSTD_fseCTables_t *fseTables, const ZSTD_fseCTablesMetadata_t *fseMetadata, const seqDef *sequences, size_t nbSeq, const BYTE *llCode, const BYTE *mlCode, const BYTE *ofCode, const ZSTD_CCtx_params *cctxParams, void *dst, size_t dstCapacity, const int bmi2, int writeEntropy, int *entropyWritten)
 
size_t ZSTD_compressSuperBlock (ZSTD_CCtx *zc, void *dst, size_t dstCapacity, void const *src, size_t srcSize, unsigned lastBlock)
 
static void ZSTD_copy16 (void *dst, const void *src)
 
static void ZSTD_copy4 (void *dst, const void *src)
 
static void ZSTD_copy8 (void *dst, const void *src)
 
static void ZSTD_copyBlockSequences (ZSTD_CCtx *zc)
 
size_t ZSTD_copyCCtx (ZSTD_CCtx *dstCCtx, const ZSTD_CCtx *srcCCtx, unsigned long long pledgedSrcSize)
 
static size_t ZSTD_copyCCtx_internal (ZSTD_CCtx *dstCCtx, const ZSTD_CCtx *srcCCtx, ZSTD_frameParameters fParams, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff)
 
static void ZSTD_copyCDictTableIntoCCtx (U32 *dst, U32 const *src, size_t tableSize, ZSTD_compressionParameters const *cParams)
 
void ZSTD_copyDCtx (ZSTD_DCtx *dstDCtx, const ZSTD_DCtx *srcDCtx)
 
void ZSTD_copyDDictParameters (ZSTD_DCtx *dctx, const ZSTD_DDict *ddict)
 
static size_t ZSTD_copyRawBlock (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)
 
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 unsigned ZSTD_countLeadingZeros32 (U32 val)
 
MEM_STATIC unsigned ZSTD_countLeadingZeros32_fallback (U32 val)
 
MEM_STATIC unsigned ZSTD_countLeadingZeros64 (U64 val)
 
static size_t ZSTD_countSeqStoreLiteralsBytes (const seqStore_t *const seqStore)
 
static size_t ZSTD_countSeqStoreMatchBytes (const seqStore_t *const seqStore)
 
MEM_STATIC unsigned ZSTD_countTrailingZeros32 (U32 val)
 
MEM_STATIC unsigned ZSTD_countTrailingZeros32_fallback (U32 val)
 
MEM_STATIC unsigned ZSTD_countTrailingZeros64 (U64 val)
 
static size_t ZSTD_cParam_clampBounds (ZSTD_cParameter cParam, int *value)
 
ZSTD_bounds ZSTD_cParam_getBounds (ZSTD_cParameter param)
 
MEM_STATIC int ZSTD_cParam_withinBounds (ZSTD_cParameter cParam, int value)
 
MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid (void)
 
MEM_STATIC int ZSTD_cpuSupportsBmi2 (void)
 
ZSTD_CCtxZSTD_createCCtx (void)
 
ZSTD_CCtxZSTD_createCCtx_advanced (ZSTD_customMem customMem)
 
ZSTD_CCtx_params * ZSTD_createCCtxParams (void)
 
static ZSTD_CCtx_params * ZSTD_createCCtxParams_advanced (ZSTD_customMem customMem)
 
ZSTD_CDictZSTD_createCDict (const void *dict, size_t dictSize, int compressionLevel)
 
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)
 
static ZSTD_CDictZSTD_createCDict_advanced_internal (size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_compressionParameters cParams, ZSTD_paramSwitch_e useRowMatchFinder, U32 enableDedicatedDictSearch, ZSTD_customMem customMem)
 
ZSTD_CDictZSTD_createCDict_byReference (const void *dict, size_t dictSize, int compressionLevel)
 
ZSTD_CStreamZSTD_createCStream (void)
 
ZSTD_CStreamZSTD_createCStream_advanced (ZSTD_customMem customMem)
 
ZSTD_DCtxZSTD_createDCtx (void)
 
ZSTD_DCtxZSTD_createDCtx_advanced (ZSTD_customMem customMem)
 
static ZSTD_DCtxZSTD_createDCtx_internal (ZSTD_customMem customMem)
 
ZSTD_DDictZSTD_createDDict (const void *dict, size_t dictSize)
 
ZSTD_DDictZSTD_createDDict_advanced (const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType, ZSTD_customMem customMem)
 
ZSTD_DDictZSTD_createDDict_byReference (const void *dictBuffer, size_t dictSize)
 
static ZSTD_DDictHashSetZSTD_createDDictHashSet (ZSTD_customMem customMem)
 
ZSTD_DStreamZSTD_createDStream (void)
 
ZSTD_DStreamZSTD_createDStream_advanced (ZSTD_customMem customMem)
 
POOL_ctxZSTD_createThreadPool (size_t numThreads)
 
size_t ZSTD_crossEntropyCost (short const *norm, unsigned accuracyLog, unsigned const *count, unsigned const max)
 
size_t ZSTD_CStreamInSize (void)
 
size_t ZSTD_CStreamOutSize (void)
 
MEM_STATIC void * ZSTD_customCalloc (size_t size, ZSTD_customMem customMem)
 
MEM_STATIC void ZSTD_customFree (void *ptr, ZSTD_customMem customMem)
 
MEM_STATIC void * ZSTD_customMalloc (size_t size, ZSTD_customMem customMem)
 
MEM_STATIC size_t ZSTD_cwksp_align (size_t size, size_t const align)
 
MEM_STATIC size_t ZSTD_cwksp_aligned_alloc_size (size_t size)
 
MEM_STATIC size_t ZSTD_cwksp_alloc_size (size_t size)
 
MEM_STATIC void ZSTD_cwksp_assert_internal_consistency (ZSTD_cwksp *ws)
 
MEM_STATIC size_t ZSTD_cwksp_available_space (ZSTD_cwksp *ws)
 
MEM_STATIC void ZSTD_cwksp_bump_oversized_duration (ZSTD_cwksp *ws, size_t additionalNeededSpace)
 
MEM_STATIC size_t ZSTD_cwksp_bytes_to_align_ptr (void *ptr, const size_t alignBytes)
 
MEM_STATIC int ZSTD_cwksp_check_available (ZSTD_cwksp *ws, size_t additionalNeededSpace)
 
MEM_STATIC int ZSTD_cwksp_check_too_large (ZSTD_cwksp *ws, size_t additionalNeededSpace)
 
MEM_STATIC int ZSTD_cwksp_check_wasteful (ZSTD_cwksp *ws, size_t additionalNeededSpace)
 
MEM_STATIC void ZSTD_cwksp_clean_tables (ZSTD_cwksp *ws)
 
MEM_STATIC void ZSTD_cwksp_clear (ZSTD_cwksp *ws)
 
MEM_STATIC void ZSTD_cwksp_clear_tables (ZSTD_cwksp *ws)
 
MEM_STATIC size_t ZSTD_cwksp_create (ZSTD_cwksp *ws, size_t size, ZSTD_customMem customMem)
 
MEM_STATIC int ZSTD_cwksp_estimated_space_within_bounds (const ZSTD_cwksp *const ws, size_t const estimatedSpace)
 
MEM_STATIC void ZSTD_cwksp_free (ZSTD_cwksp *ws, ZSTD_customMem customMem)
 
MEM_STATIC void ZSTD_cwksp_init (ZSTD_cwksp *ws, void *start, size_t size, ZSTD_cwksp_static_alloc_e isStatic)
 
MEM_STATIC void * ZSTD_cwksp_initialAllocStart (ZSTD_cwksp *ws)
 
MEM_STATIC size_t ZSTD_cwksp_internal_advance_phase (ZSTD_cwksp *ws, ZSTD_cwksp_alloc_phase_e phase)
 
MEM_STATIC void ZSTD_cwksp_mark_tables_clean (ZSTD_cwksp *ws)
 
MEM_STATIC void ZSTD_cwksp_mark_tables_dirty (ZSTD_cwksp *ws)
 
MEM_STATIC void ZSTD_cwksp_move (ZSTD_cwksp *dst, ZSTD_cwksp *src)
 
MEM_STATIC int ZSTD_cwksp_owns_buffer (const ZSTD_cwksp *ws, const void *ptr)
 
MEM_STATIC void * ZSTD_cwksp_reserve_aligned (ZSTD_cwksp *ws, size_t bytes)
 
MEM_STATIC void * ZSTD_cwksp_reserve_aligned_init_once (ZSTD_cwksp *ws, size_t bytes)
 
MEM_STATIC BYTEZSTD_cwksp_reserve_buffer (ZSTD_cwksp *ws, size_t bytes)
 
MEM_STATIC int ZSTD_cwksp_reserve_failed (const ZSTD_cwksp *ws)
 
MEM_STATIC void * ZSTD_cwksp_reserve_internal (ZSTD_cwksp *ws, size_t bytes, ZSTD_cwksp_alloc_phase_e phase)
 
MEM_STATIC void * ZSTD_cwksp_reserve_internal_buffer_space (ZSTD_cwksp *ws, size_t const bytes)
 
MEM_STATIC void * ZSTD_cwksp_reserve_object (ZSTD_cwksp *ws, size_t bytes)
 
MEM_STATIC void * ZSTD_cwksp_reserve_table (ZSTD_cwksp *ws, size_t bytes)
 
MEM_STATIC size_t ZSTD_cwksp_sizeof (const ZSTD_cwksp *ws)
 
MEM_STATIC size_t ZSTD_cwksp_slack_space_required (void)
 
MEM_STATIC size_t ZSTD_cwksp_used (const ZSTD_cwksp *ws)
 
U32 ZSTD_cycleLog (U32 hashLog, ZSTD_strategy strat)
 
MEM_STATIC int ZSTD_DCtx_get_bmi2 (const struct ZSTD_DCtx_s *dctx)
 
size_t ZSTD_DCtx_getParameter (ZSTD_DCtx *dctx, ZSTD_dParameter param, int *value)
 
static int ZSTD_DCtx_isOverflow (ZSTD_DStream *zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)
 
static int ZSTD_DCtx_isOversizedTooLong (ZSTD_DStream *zds)
 
size_t ZSTD_DCtx_loadDictionary (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_DCtx_loadDictionary_advanced (ZSTD_DCtx *dctx, const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_DCtx_loadDictionary_byReference (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_DCtx_refDDict (ZSTD_DCtx *dctx, const ZSTD_DDict *ddict)
 
size_t ZSTD_DCtx_refPrefix (ZSTD_DCtx *dctx, const void *prefix, size_t prefixSize)
 
size_t ZSTD_DCtx_refPrefix_advanced (ZSTD_DCtx *dctx, const void *prefix, size_t prefixSize, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_DCtx_reset (ZSTD_DCtx *dctx, ZSTD_ResetDirective reset)
 
static void ZSTD_DCtx_resetParameters (ZSTD_DCtx *dctx)
 
static void ZSTD_DCtx_selectFrameDDict (ZSTD_DCtx *dctx)
 
size_t ZSTD_DCtx_setFormat (ZSTD_DCtx *dctx, ZSTD_format_e format)
 
size_t ZSTD_DCtx_setMaxWindowSize (ZSTD_DCtx *dctx, size_t maxWindowSize)
 
size_t ZSTD_DCtx_setParameter (ZSTD_DCtx *dctx, ZSTD_dParameter dParam, int value)
 
static void ZSTD_DCtx_trace_end (ZSTD_DCtx const *dctx, U64 uncompressedSize, U64 compressedSize, unsigned streaming)
 
static void ZSTD_DCtx_updateOversizedDuration (ZSTD_DStream *zds, size_t const neededInBuffSize, size_t const neededOutBuffSize)
 
const void * ZSTD_DDict_dictContent (const ZSTD_DDict *ddict)
 
size_t ZSTD_DDict_dictSize (const ZSTD_DDict *ddict)
 
static size_t ZSTD_DDictHashSet_addDDict (ZSTD_DDictHashSet *hashSet, const ZSTD_DDict *ddict, ZSTD_customMem customMem)
 
static size_t ZSTD_DDictHashSet_emplaceDDict (ZSTD_DDictHashSet *hashSet, const ZSTD_DDict *ddict)
 
static size_t ZSTD_DDictHashSet_expand (ZSTD_DDictHashSet *hashSet, ZSTD_customMem customMem)
 
static const ZSTD_DDictZSTD_DDictHashSet_getDDict (ZSTD_DDictHashSet *hashSet, U32 dictID)
 
static size_t ZSTD_DDictHashSet_getIndex (const ZSTD_DDictHashSet *hashSet, U32 dictID)
 
static size_t ZSTD_decodeFrameHeader (ZSTD_DCtx *dctx, const void *src, size_t headerSize)
 
size_t ZSTD_decodeLiteralsBlock (ZSTD_DCtx *dctx, const void *src, size_t srcSize, void *dst, size_t dstCapacity, const streaming_operation streaming)
 
size_t ZSTD_decodeSeqHeaders (ZSTD_DCtx *dctx, int *nbSeqPtr, const void *src, size_t srcSize)
 
FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequence (seqState_t *seqState, const ZSTD_longOffset_e longOffsets)
 
size_t ZSTD_decodingBufferSize_min (unsigned long long windowSize, unsigned long long frameContentSize)
 
size_t ZSTD_decompress (void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static size_t ZSTD_decompress_insertDictionary (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_decompress_usingDDict (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const ZSTD_DDict *ddict)
 
size_t ZSTD_decompress_usingDict (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const void *dict, size_t dictSize)
 
size_t ZSTD_decompressBegin (ZSTD_DCtx *dctx)
 
size_t ZSTD_decompressBegin_usingDDict (ZSTD_DCtx *dctx, const ZSTD_DDict *ddict)
 
size_t ZSTD_decompressBegin_usingDict (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_decompressBlock (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_decompressBlock_deprecated (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
size_t ZSTD_decompressBlock_internal (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const int frame, const streaming_operation streaming)
 
unsigned long long ZSTD_decompressBound (const void *src, size_t srcSize)
 
size_t ZSTD_decompressContinue (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static size_t ZSTD_decompressContinueStream (ZSTD_DStream *zds, char **op, char *oend, void const *src, size_t srcSize)
 
size_t ZSTD_decompressDCtx (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static size_t ZSTD_decompressFrame (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void **srcPtr, size_t *srcSizePtr)
 
size_t ZSTD_decompressionMargin (void const *src, size_t srcSize)
 
static size_t ZSTD_decompressMultiFrame (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const void *dict, size_t dictSize, const ZSTD_DDict *ddict)
 
static size_t ZSTD_decompressSequences (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE ZSTD_decompressSequences_body (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE ZSTD_decompressSequences_bodySplitLitBuffer (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
static size_t ZSTD_decompressSequences_default (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
static size_t ZSTD_decompressSequencesLong (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_decompressSequencesLong_body (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
static size_t ZSTD_decompressSequencesLong_default (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
static size_t ZSTD_decompressSequencesSplitLitBuffer (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
static size_t ZSTD_decompressSequencesSplitLitBuffer_default (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)
 
size_t ZSTD_decompressStream (ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inBuffer *input)
 
size_t ZSTD_decompressStream_simpleArgs (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, size_t *dstPos, const void *src, size_t srcSize, size_t *srcPos)
 
static ZSTD_compressionParameters ZSTD_dedicatedDictSearch_getCParams (int const compressionLevel, size_t const dictSize)
 
static int ZSTD_dedicatedDictSearch_isSupported (const ZSTD_compressionParameters *cParams)
 
void ZSTD_dedicatedDictSearch_lazy_loadDictionary (ZSTD_matchState_t *ms, const BYTE *const ip)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_dedicatedDictSearch_lazy_search (size_t *offsetPtr, size_t ml, U32 nbAttempts, const ZSTD_matchState_t *const dms, const BYTE *const ip, const BYTE *const iLimit, const BYTE *const prefixStart, const U32 curr, const U32 dictLimit, const size_t ddsIdx)
 
static void ZSTD_dedicatedDictSearch_revertCParams (ZSTD_compressionParameters *cParams)
 
int ZSTD_defaultCLevel (void)
 
static size_t ZSTD_deriveBlockSplits (ZSTD_CCtx *zc, U32 partitions[], U32 nbSeq)
 
static void ZSTD_deriveBlockSplitsHelper (seqStoreSplits *splits, size_t startIdx, size_t endIdx, ZSTD_CCtx *zc, const seqStore_t *origSeqStore)
 
static void ZSTD_deriveSeqStoreChunk (seqStore_t *resultSeqStore, const seqStore_t *originalSeqStore, size_t startIdx, size_t endIdx)
 
static U32 ZSTD_dictAndWindowLog (U32 windowLog, U64 srcSize, U64 dictSize)
 
static FSE_repeat ZSTD_dictNCountRepeat (short *normalizedCounter, unsigned dictMaxSymbolValue, unsigned maxSymbolValue)
 
static int ZSTD_dictTooBig (size_t const loadedDictSize)
 
static U32 ZSTD_downscaleStats (unsigned *table, U32 lastEltIndex, U32 shift, base_directive_e base1)
 
ZSTD_bounds ZSTD_dParam_getBounds (ZSTD_dParameter dParam)
 
static int ZSTD_dParam_withinBounds (ZSTD_dParameter dParam, int value)
 
size_t ZSTD_DStreamInSize (void)
 
size_t ZSTD_DStreamOutSize (void)
 
static size_t ZSTD_DUBT_findBestMatch (ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iend, size_t *offBasePtr, U32 const mls, const ZSTD_dictMode_e dictMode)
 
static size_t ZSTD_DUBT_findBetterDictMatch (const ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iend, size_t *offsetPtr, size_t bestLength, U32 nbCompares, U32 const mls, const ZSTD_dictMode_e dictMode)
 
size_t ZSTD_encodeSequences (void *dst, size_t dstCapacity, FSE_CTable const *CTable_MatchLength, BYTE const *mlCodeTable, FSE_CTable const *CTable_OffsetBits, BYTE const *ofCodeTable, FSE_CTable const *CTable_LitLength, BYTE const *llCodeTable, seqDef const *sequences, size_t nbSeq, int longOffsets, int bmi2)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_encodeSequences_body (void *dst, size_t dstCapacity, FSE_CTable const *CTable_MatchLength, BYTE const *mlCodeTable, FSE_CTable const *CTable_OffsetBits, BYTE const *ofCodeTable, FSE_CTable const *CTable_LitLength, BYTE const *llCodeTable, seqDef const *sequences, size_t nbSeq, int longOffsets)
 
static size_t ZSTD_encodeSequences_default (void *dst, size_t dstCapacity, FSE_CTable const *CTable_MatchLength, BYTE const *mlCodeTable, FSE_CTable const *CTable_OffsetBits, BYTE const *ofCodeTable, FSE_CTable const *CTable_LitLength, BYTE const *llCodeTable, seqDef const *sequences, size_t nbSeq, int longOffsets)
 
size_t ZSTD_endStream (ZSTD_CStream *zcs, ZSTD_outBuffer *output)
 
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)
 
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)
 
static size_t ZSTD_entropyCost (unsigned const *count, unsigned const max, size_t const total)
 
static ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo (size_t ret)
 
static size_t ZSTD_estimateBlockSize (const BYTE *literals, size_t litSize, const BYTE *ofCodeTable, const BYTE *llCodeTable, const BYTE *mlCodeTable, size_t nbSeq, const ZSTD_entropyCTables_t *entropy, const ZSTD_entropyCTablesMetadata_t *entropyMetadata, void *workspace, size_t wkspSize, int writeLitEntropy, int writeSeqEntropy)
 
static size_t ZSTD_estimateBlockSize_literal (const BYTE *literals, size_t litSize, const ZSTD_hufCTables_t *huf, const ZSTD_hufCTablesMetadata_t *hufMetadata, void *workspace, size_t wkspSize, int writeEntropy)
 
static size_t ZSTD_estimateBlockSize_sequences (const BYTE *ofCodeTable, const BYTE *llCodeTable, const BYTE *mlCodeTable, size_t nbSeq, const ZSTD_fseCTables_t *fseTables, const ZSTD_fseCTablesMetadata_t *fseMetadata, void *workspace, size_t wkspSize, int writeEntropy)
 
static size_t ZSTD_estimateBlockSize_symbolType (symbolEncodingType_e type, const BYTE *codeTable, size_t nbSeq, unsigned maxCode, const FSE_CTable *fseCTable, const U8 *additionalBits, short const *defaultNorm, U32 defaultNormLog, U32 defaultMax, void *workspace, size_t wkspSize)
 
size_t ZSTD_estimateCCtxSize (int compressionLevel)
 
static size_t ZSTD_estimateCCtxSize_internal (int compressionLevel)
 
size_t ZSTD_estimateCCtxSize_usingCCtxParams (const ZSTD_CCtx_params *params)
 
static size_t ZSTD_estimateCCtxSize_usingCCtxParams_internal (const ZSTD_compressionParameters *cParams, const ldmParams_t *ldmParams, const int isStatic, const ZSTD_paramSwitch_e useRowMatchFinder, const size_t buffInSize, const size_t buffOutSize, const U64 pledgedSrcSize, int useSequenceProducer, size_t maxBlockSize)
 
size_t ZSTD_estimateCCtxSize_usingCParams (ZSTD_compressionParameters cParams)
 
size_t ZSTD_estimateCDictSize (size_t dictSize, int compressionLevel)
 
size_t ZSTD_estimateCDictSize_advanced (size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod)
 
size_t ZSTD_estimateCStreamSize (int compressionLevel)
 
static size_t ZSTD_estimateCStreamSize_internal (int compressionLevel)
 
size_t ZSTD_estimateCStreamSize_usingCCtxParams (const ZSTD_CCtx_params *params)
 
size_t ZSTD_estimateCStreamSize_usingCParams (ZSTD_compressionParameters cParams)
 
size_t ZSTD_estimateDCtxSize (void)
 
size_t ZSTD_estimateDDictSize (size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod)
 
size_t ZSTD_estimateDStreamSize (size_t windowSize)
 
size_t ZSTD_estimateDStreamSize_fromFrame (const void *src, size_t srcSize)
 
static size_t ZSTD_estimateSubBlockSize (const BYTE *literals, size_t litSize, const BYTE *ofCodeTable, const BYTE *llCodeTable, const BYTE *mlCodeTable, size_t nbSeq, const ZSTD_entropyCTables_t *entropy, const ZSTD_entropyCTablesMetadata_t *entropyMetadata, void *workspace, size_t wkspSize, int writeLitEntropy, int writeSeqEntropy)
 
static size_t ZSTD_estimateSubBlockSize_literal (const BYTE *literals, size_t litSize, const ZSTD_hufCTables_t *huf, const ZSTD_hufCTablesMetadata_t *hufMetadata, void *workspace, size_t wkspSize, int writeEntropy)
 
static size_t ZSTD_estimateSubBlockSize_sequences (const BYTE *ofCodeTable, const BYTE *llCodeTable, const BYTE *mlCodeTable, size_t nbSeq, const ZSTD_fseCTables_t *fseTables, const ZSTD_fseCTablesMetadata_t *fseMetadata, void *workspace, size_t wkspSize, int writeEntropy)
 
static size_t ZSTD_estimateSubBlockSize_symbolType (symbolEncodingType_e type, const BYTE *codeTable, unsigned maxCode, size_t nbSeq, const FSE_CTable *fseCTable, const U8 *additionalBits, short const *defaultNorm, U32 defaultNormLog, U32 defaultMax, void *workspace, size_t wkspSize)
 
HINT_INLINE size_t ZSTD_execSequence (BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd)
 
FORCE_NOINLINE size_t ZSTD_execSequenceEnd (BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd)
 
FORCE_NOINLINE size_t ZSTD_execSequenceEndSplitLitBuffer (BYTE *op, BYTE *const oend, const BYTE *const oend_w, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd)
 
HINT_INLINE size_t ZSTD_execSequenceSplitLitBuffer (BYTE *op, BYTE *const oend, const BYTE *const oend_w, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd)
 
static size_t ZSTD_fastSequenceLengthSum (ZSTD_Sequence const *seqBuf, size_t seqBufSize)
 
void ZSTD_fillDoubleHashTable (ZSTD_matchState_t *ms, void const *end, ZSTD_dictTableLoadMethod_e dtlm, ZSTD_tableFillPurpose_e tfp)
 
static void ZSTD_fillDoubleHashTableForCCtx (ZSTD_matchState_t *ms, void const *end, ZSTD_dictTableLoadMethod_e dtlm)
 
static void ZSTD_fillDoubleHashTableForCDict (ZSTD_matchState_t *ms, void const *end, ZSTD_dictTableLoadMethod_e dtlm)
 
void ZSTD_fillHashTable (ZSTD_matchState_t *ms, void const *end, ZSTD_dictTableLoadMethod_e dtlm, ZSTD_tableFillPurpose_e tfp)
 
static void ZSTD_fillHashTableForCCtx (ZSTD_matchState_t *ms, const void *const end, ZSTD_dictTableLoadMethod_e dtlm)
 
static void ZSTD_fillHashTableForCDict (ZSTD_matchState_t *ms, const void *const end, ZSTD_dictTableLoadMethod_e dtlm)
 
static U32 ZSTD_finalizeOffBase (U32 rawOffset, const U32 rep[ZSTD_REP_NUM], U32 ll0)
 
unsigned long long ZSTD_findDecompressedSize (const void *src, size_t srcSize)
 
size_t ZSTD_findFrameCompressedSize (const void *src, size_t srcSize)
 
static ZSTD_frameSizeInfo ZSTD_findFrameSizeInfo (const void *src, size_t srcSize)
 
size_t ZSTD_flushStream (ZSTD_CStream *zcs, ZSTD_outBuffer *output)
 
MEM_STATIC U32 ZSTD_fracWeight (U32 rawStat)
 
size_t ZSTD_frameHeaderSize (const void *src, size_t srcSize)
 
static size_t ZSTD_frameHeaderSize_internal (const void *src, size_t srcSize, ZSTD_format_e format)
 
size_t ZSTD_freeCCtx (ZSTD_CCtx *cctx)
 
static void ZSTD_freeCCtxContent (ZSTD_CCtx *cctx)
 
size_t ZSTD_freeCCtxParams (ZSTD_CCtx_params *params)
 
size_t ZSTD_freeCDict (ZSTD_CDict *cdict)
 
size_t ZSTD_freeCStream (ZSTD_CStream *zcs)
 
size_t ZSTD_freeDCtx (ZSTD_DCtx *dctx)
 
size_t ZSTD_freeDDict (ZSTD_DDict *ddict)
 
static void ZSTD_freeDDictHashSet (ZSTD_DDictHashSet *hashSet, ZSTD_customMem customMem)
 
size_t ZSTD_freeDStream (ZSTD_DStream *zds)
 
void ZSTD_freeThreadPool (ZSTD_threadPool *pool)
 
size_t ZSTD_fseBitCost (FSE_CTable const *ctable, unsigned const *count, unsigned const max)
 
size_t ZSTD_generateSequences (ZSTD_CCtx *zc, ZSTD_Sequence *outSeqs, size_t outSeqsSize, const void *src, size_t srcSize)
 
size_t ZSTD_getBlockSize (const ZSTD_CCtx *cctx)
 
static size_t ZSTD_getBlockSize_deprecated (const ZSTD_CCtx *cctx)
 
size_t ZSTD_getcBlockSize (const void *src, size_t srcSize, blockProperties_t *bpPtr)
 
static ZSTD_cParamMode_e ZSTD_getCParamMode (ZSTD_CDict const *cdict, ZSTD_CCtx_params const *params, U64 pledgedSrcSize)
 
static U64 ZSTD_getCParamRowSize (U64 srcSizeHint, size_t dictSize, ZSTD_cParamMode_e mode)
 
ZSTD_compressionParameters ZSTD_getCParams (int compressionLevel, unsigned long long srcSizeHint, size_t dictSize)
 
static ZSTD_compressionParameters ZSTD_getCParams_internal (int compressionLevel, unsigned long long srcSizeHint, size_t dictSize, ZSTD_cParamMode_e mode)
 
ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams (const ZSTD_CCtx_params *CCtxParams, U64 srcSizeHint, size_t dictSize, ZSTD_cParamMode_e mode)
 
ZSTD_compressionParameters ZSTD_getCParamsFromCDict (const ZSTD_CDict *cdict)
 
static ZSTD_DDict const * ZSTD_getDDict (ZSTD_DCtx *dctx)
 
unsigned long long ZSTD_getDecompressedSize (const void *src, size_t srcSize)
 
unsigned ZSTD_getDictID_fromCDict (const ZSTD_CDict *cdict)
 
unsigned ZSTD_getDictID_fromDDict (const ZSTD_DDict *ddict)
 
unsigned ZSTD_getDictID_fromDict (const void *dict, size_t dictSize)
 
unsigned ZSTD_getDictID_fromFrame (const void *src, size_t srcSize)
 
ZSTDERRORLIB_API ZSTD_ErrorCode ZSTD_getErrorCode (size_t functionResult)
 
const char * ZSTD_getErrorName (size_t code)
 
const ZSTDERRORLIB_API char * ZSTD_getErrorString (ZSTD_ErrorCode code)
 
unsigned long long ZSTD_getFrameContentSize (const void *src, size_t srcSize)
 
size_t ZSTD_getFrameHeader (ZSTD_frameHeader *zfhPtr, const void *src, size_t srcSize)
 
size_t ZSTD_getFrameHeader_advanced (ZSTD_frameHeader *zfhPtr, const void *src, size_t srcSize, ZSTD_format_e format)
 
ZSTD_frameProgression ZSTD_getFrameProgression (const ZSTD_CCtx *cctx)
 
static unsigned ZSTD_getFSEMaxSymbolValue (FSE_CTable const *ctable)
 
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)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_getMatchPrice (U32 const offBase, U32 const matchLength, const optState_t *const optPtr, int const optLevel)
 
static ZSTD_OffsetInfo ZSTD_getOffsetInfo (const ZSTD_seqSymbol *offTable, int nbSeq)
 
ZSTD_parameters ZSTD_getParams (int compressionLevel, unsigned long long srcSizeHint, size_t dictSize)
 
static ZSTD_parameters ZSTD_getParams_internal (int compressionLevel, unsigned long long srcSizeHint, size_t dictSize, ZSTD_cParamMode_e mode)
 
const seqStore_tZSTD_getSeqStore (const ZSTD_CCtx *ctx)
 
MEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength (seqStore_t const *seqStore, seqDef const *seq)
 
static U32 ZSTD_hash3 (U32 u, U32 h, U32 s)
 
MEM_STATIC size_t ZSTD_hash3Ptr (const void *ptr, U32 h)
 
MEM_STATIC size_t ZSTD_hash3PtrS (const void *ptr, U32 h, U32 s)
 
static U32 ZSTD_hash4 (U32 u, U32 h, U32 s)
 
static size_t ZSTD_hash4Ptr (const void *ptr, U32 h)
 
static size_t ZSTD_hash4PtrS (const void *ptr, U32 h, U32 s)
 
static size_t ZSTD_hash5 (U64 u, U32 h, U64 s)
 
static size_t ZSTD_hash5Ptr (const void *p, U32 h)
 
static size_t ZSTD_hash5PtrS (const void *p, U32 h, U64 s)
 
static size_t ZSTD_hash6 (U64 u, U32 h, U64 s)
 
static size_t ZSTD_hash6Ptr (const void *p, U32 h)
 
static size_t ZSTD_hash6PtrS (const void *p, U32 h, U64 s)
 
static size_t ZSTD_hash7 (U64 u, U32 h, U64 s)
 
static size_t ZSTD_hash7Ptr (const void *p, U32 h)
 
static size_t ZSTD_hash7PtrS (const void *p, U32 h, U64 s)
 
static size_t ZSTD_hash8 (U64 u, U32 h, U64 s)
 
static size_t ZSTD_hash8Ptr (const void *p, U32 h)
 
static size_t ZSTD_hash8PtrS (const void *p, U32 h, U64 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)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch (ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iLimit, size_t *offsetPtr, const U32 mls, const ZSTD_dictMode_e dictMode)
 
MEM_STATIC unsigned ZSTD_highbit32 (U32 val)
 
static int ZSTD_indexTooCloseToMax (ZSTD_window_t w)
 
static void ZSTD_initCCtx (ZSTD_CCtx *cctx, ZSTD_customMem memManager)
 
static size_t ZSTD_initCDict_internal (ZSTD_CDict *cdict, const void *dictBuffer, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType, ZSTD_CCtx_params params)
 
size_t ZSTD_initCStream (ZSTD_CStream *zcs, int compressionLevel)
 
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_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_srcSize (ZSTD_CStream *zcs, int compressionLevel, unsigned long long pss)
 
size_t ZSTD_initCStream_usingCDict (ZSTD_CStream *zcs, const ZSTD_CDict *cdict)
 
size_t ZSTD_initCStream_usingCDict_advanced (ZSTD_CStream *zcs, const ZSTD_CDict *cdict, ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize)
 
size_t ZSTD_initCStream_usingDict (ZSTD_CStream *zcs, const void *dict, size_t dictSize, int compressionLevel)
 
static void ZSTD_initDCtx_internal (ZSTD_DCtx *dctx)
 
static size_t ZSTD_initDDict_internal (ZSTD_DDict *ddict, const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType)
 
size_t ZSTD_initDStream (ZSTD_DStream *zds)
 
size_t ZSTD_initDStream_usingDDict (ZSTD_DStream *dctx, const ZSTD_DDict *ddict)
 
size_t ZSTD_initDStream_usingDict (ZSTD_DStream *zds, const void *dict, size_t dictSize)
 
static void ZSTD_initFseState (ZSTD_fseState *DStatePtr, BIT_DStream_t *bitD, const ZSTD_seqSymbol *dt)
 
static size_t ZSTD_initLocalDict (ZSTD_CCtx *cctx)
 
ZSTD_CCtxZSTD_initStaticCCtx (void *workspace, size_t workspaceSize)
 
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_CStreamZSTD_initStaticCStream (void *workspace, size_t workspaceSize)
 
ZSTD_DCtxZSTD_initStaticDCtx (void *workspace, size_t workspaceSize)
 
const ZSTD_DDictZSTD_initStaticDDict (void *sBuffer, size_t sBufferSize, const void *dict, size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictContentType_e dictContentType)
 
ZSTD_DStreamZSTD_initStaticDStream (void *workspace, size_t workspaceSize)
 
static void ZSTD_initStats_ultra (ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
 
U32 ZSTD_insertAndFindFirstIndex (ZSTD_matchState_t *ms, const BYTE *ip)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_insertAndFindFirstIndex_internal (ZSTD_matchState_t *ms, const ZSTD_compressionParameters *const cParams, const BYTE *ip, U32 const mls, U32 const lazySkipping)
 
static U32 ZSTD_insertAndFindFirstIndexHash3 (const ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *const ip)
 
size_t ZSTD_insertBlock (ZSTD_DCtx *dctx, const void *blockStart, size_t blockSize)
 
static U32 ZSTD_insertBt1 (const ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iend, U32 const target, U32 const mls, const int extDict)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_insertBtAndGetAllMatches (ZSTD_match_t *matches, ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *const ip, const BYTE *const iLimit, const ZSTD_dictMode_e dictMode, const U32 rep[ZSTD_REP_NUM], const U32 ll0, const U32 lengthToBeat, const U32 mls)
 
static void ZSTD_insertDUBT1 (const ZSTD_matchState_t *ms, U32 curr, const BYTE *inputEnd, U32 nbCompares, U32 btLow, const ZSTD_dictMode_e dictMode)
 
static void ZSTD_invalidateMatchState (ZSTD_matchState_t *ms)
 
void ZSTD_invalidateRepCodes (ZSTD_CCtx *cctx)
 
static U64 ZSTD_ipow (U64 base, U64 exponent)
 
MEM_STATIC int ZSTD_isAligned (void const *ptr, size_t align)
 
unsigned ZSTD_isError (size_t code)
 
unsigned ZSTD_isFrame (const void *buffer, size_t size)
 
static int ZSTD_isRLE (const BYTE *src, size_t length)
 
static int ZSTD_isSkipFrame (ZSTD_DCtx *dctx)
 
unsigned ZSTD_isSkippableFrame (const void *buffer, size_t size)
 
static int ZSTD_isUpdateAuthorized (ZSTD_cParameter param)
 
void ZSTD_ldm_adjustParameters (ldmParams_t *params, ZSTD_compressionParameters const *cParams)
 
size_t ZSTD_ldm_blockCompress (rawSeqStore_t *rawSeqStore, ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], ZSTD_paramSwitch_e useRowMatchFinder, void const *src, size_t srcSize)
 
static size_t ZSTD_ldm_countBackwardsMatch (const BYTE *pIn, const BYTE *pAnchor, const BYTE *pMatch, const BYTE *pMatchBase)
 
static size_t ZSTD_ldm_countBackwardsMatch_2segments (const BYTE *pIn, const BYTE *pAnchor, const BYTE *pMatch, const BYTE *pMatchBase, const BYTE *pExtDictStart, const BYTE *pExtDictEnd)
 
static size_t ZSTD_ldm_fillFastTables (ZSTD_matchState_t *ms, void const *end)
 
void ZSTD_ldm_fillHashTable (ldmState_t *state, const BYTE *ip, const BYTE *iend, ldmParams_t const *params)
 
static size_t ZSTD_ldm_gear_feed (ldmRollingHashState_t *state, BYTE const *data, size_t size, size_t *splits, unsigned *numSplits)
 
static void ZSTD_ldm_gear_init (ldmRollingHashState_t *state, ldmParams_t const *params)
 
static void ZSTD_ldm_gear_reset (ldmRollingHashState_t *state, BYTE const *data, size_t minMatchLength)
 
size_t ZSTD_ldm_generateSequences (ldmState_t *ldms, rawSeqStore_t *sequences, ldmParams_t const *params, void const *src, size_t srcSize)
 
static size_t ZSTD_ldm_generateSequences_internal (ldmState_t *ldmState, rawSeqStore_t *rawSeqStore, ldmParams_t const *params, void const *src, size_t srcSize)
 
static ldmEntry_tZSTD_ldm_getBucket (ldmState_t *ldmState, size_t hash, ldmParams_t const ldmParams)
 
size_t ZSTD_ldm_getMaxNbSeq (ldmParams_t params, size_t maxChunkSize)
 
size_t ZSTD_ldm_getTableSize (ldmParams_t params)
 
static void ZSTD_ldm_insertEntry (ldmState_t *ldmState, size_t const hash, const ldmEntry_t entry, ldmParams_t const ldmParams)
 
static void ZSTD_ldm_limitTableUpdate (ZSTD_matchState_t *ms, const BYTE *anchor)
 
static void ZSTD_ldm_reduceTable (ldmEntry_t *const table, U32 const size, U32 const reducerValue)
 
void ZSTD_ldm_skipRawSeqStoreBytes (rawSeqStore_t *rawSeqStore, size_t nbBytes)
 
void ZSTD_ldm_skipSequences (rawSeqStore_t *rawSeqStore, size_t srcSize, U32 const minMatch)
 
MEM_STATIC size_t ZSTD_limitCopy (void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
MEM_STATIC int ZSTD_literalsCompressionIsDisabled (const ZSTD_CCtx_params *cctxParams)
 
static U32 ZSTD_litLengthPrice (U32 const litLength, const optState_t *const optPtr, int optLevel)
 
MEM_STATIC U32 ZSTD_LLcode (U32 litLength)
 
size_t ZSTD_loadCEntropy (ZSTD_compressedBlockState_t *bs, void *workspace, const void *const dict, size_t dictSize)
 
size_t ZSTD_loadDEntropy (ZSTD_entropyDTables_t *entropy, const void *const dict, size_t const dictSize)
 
static size_t ZSTD_loadDictionaryContent (ZSTD_matchState_t *ms, ldmState_t *ls, ZSTD_cwksp *ws, ZSTD_CCtx_params const *params, const void *src, size_t srcSize, ZSTD_dictTableLoadMethod_e dtlm, ZSTD_tableFillPurpose_e tfp)
 
static size_t ZSTD_loadEntropy_intoDDict (ZSTD_DDict *ddict, ZSTD_dictContentType_e dictContentType)
 
static size_t ZSTD_loadZstdDictionary (ZSTD_compressedBlockState_t *bs, ZSTD_matchState_t *ms, ZSTD_cwksp *ws, ZSTD_CCtx_params const *params, const void *dict, size_t dictSize, ZSTD_dictTableLoadMethod_e dtlm, ZSTD_tableFillPurpose_e tfp, void *workspace)
 
static ZSTD_CCtx_params ZSTD_makeCCtxParamsFromCParams (ZSTD_compressionParameters cParams)
 
MEM_STATIC ZSTD_dictMode_e ZSTD_matchState_dictMode (const ZSTD_matchState_t *ms)
 
int ZSTD_maxCLevel (void)
 
static size_t ZSTD_maxNbSeq (size_t blockSize, unsigned minMatch, int useSequenceProducer)
 
static size_t ZSTD_maxShortOffset (void)
 
static int ZSTD_maybeRLE (seqStore_t const *seqStore)
 
size_t ZSTD_mergeBlockDelimiters (ZSTD_Sequence *sequences, size_t seqsSize)
 
int ZSTD_minCLevel (void)
 
MEM_STATIC size_t ZSTD_minGain (size_t srcSize, ZSTD_strategy strat)
 
static size_t ZSTD_minLiteralsToCompress (ZSTD_strategy strategy, HUF_repeat huf_repeat)
 
MEM_STATIC U32 ZSTD_MLcode (U32 mlBase)
 
MEM_STATIC unsigned ZSTD_NbCommonBytes (size_t val)
 
static size_t ZSTD_NCountCost (unsigned const *count, unsigned const max, size_t const nbSeq, unsigned const FSELog)
 
static int ZSTD_needSequenceEntropyTables (ZSTD_fseCTablesMetadata_t const *fseMetadata)
 
MEM_STATIC repcodes_t ZSTD_newRep (U32 const rep[ZSTD_REP_NUM], U32 const offBase, U32 const ll0)
 
static size_t ZSTD_nextInputSizeHint (const ZSTD_CCtx *cctx)
 
static size_t ZSTD_nextInputSizeHint_MTorST (const ZSTD_CCtx *cctx)
 
ZSTD_nextInputType_e ZSTD_nextInputType (ZSTD_DCtx *dctx)
 
size_t ZSTD_nextSrcSizeToDecompress (ZSTD_DCtx *dctx)
 
static size_t ZSTD_nextSrcSizeToDecompressWithInputSize (ZSTD_DCtx *dctx, size_t inputSize)
 
MEM_STATIC size_t ZSTD_noCompressBlock (void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastBlock)
 
size_t ZSTD_noCompressLiterals (void *dst, size_t dstCapacity, const void *src, size_t srcSize)
 
static void ZSTD_opt_getNextMatchAndUpdateSeqStore (ZSTD_optLdm_t *optLdm, U32 currPosInBlock, U32 blockBytesRemaining)
 
static void ZSTD_optLdm_maybeAddMatch (ZSTD_match_t *matches, U32 *nbMatches, const ZSTD_optLdm_t *optLdm, U32 currPosInBlock)
 
static void ZSTD_optLdm_processMatchCandidate (ZSTD_optLdm_t *optLdm, ZSTD_match_t *matches, U32 *nbMatches, U32 currPosInBlock, U32 remainingBytes)
 
static void ZSTD_optLdm_skipRawSeqStoreBytes (rawSeqStore_t *rawSeqStore, size_t nbBytes)
 
static void ZSTD_overflowCorrectIfNeeded (ZSTD_matchState_t *ms, ZSTD_cwksp *ws, ZSTD_CCtx_params const *params, void const *ip, void const *iend)
 
HINT_INLINE void ZSTD_overlapCopy8 (BYTE **op, BYTE const **ip, size_t offset)
 
static void ZSTD_overrideCParams (ZSTD_compressionParameters *cParams, const ZSTD_compressionParameters *overrides)
 
static size_t ZSTD_postProcessSequenceProducerResult (ZSTD_Sequence *outSeqs, size_t nbExternalSeqs, size_t outSeqsCapacity, size_t srcSize)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_prefetchMatch (size_t prefetchPos, seq_t const sequence, const BYTE *const prefixStart, const BYTE *const dictEnd)
 
void ZSTD_preserveUnsortedMark (U32 *const table, U32 const size, U32 const reducerValue)
 
static U32 ZSTD_rawLiteralsCost (const BYTE *const literals, U32 const litLength, const optState_t *const optPtr, int optLevel)
 
MEM_STATIC U32 ZSTD_readMINMATCH (const void *memPtr, U32 length)
 
size_t ZSTD_readSkippableFrame (void *dst, size_t dstCapacity, unsigned *magicVariant, const void *src, size_t srcSize)
 
static void ZSTD_reduceIndex (ZSTD_matchState_t *ms, ZSTD_CCtx_params const *params, const U32 reducerValue)
 
static void ZSTD_reduceTable (U32 *const table, U32 const size, U32 const reducerValue)
 
static void ZSTD_reduceTable_btlazy2 (U32 *const table, U32 const size, U32 const reducerValue)
 
FORCE_INLINE_TEMPLATE void ZSTD_reduceTable_internal (U32 *const table, U32 const size, U32 const reducerValue, int const preserveMark)
 
static size_t ZSTD_refDictContent (ZSTD_DCtx *dctx, const void *dict, size_t dictSize)
 
size_t ZSTD_referenceExternalSequences (ZSTD_CCtx *cctx, rawSeq *seq, size_t nbSeq)
 
void ZSTD_registerSequenceProducer (ZSTD_CCtx *zc, void *mState, ZSTD_sequenceProducer_F *mFinder)
 
static void ZSTD_rescaleFreqs (optState_t *const optPtr, const BYTE *const src, size_t const srcSize, int const optLevel)
 
void ZSTD_reset_compressedBlockState (ZSTD_compressedBlockState_t *bs)
 
static size_t ZSTD_reset_matchState (ZSTD_matchState_t *ms, ZSTD_cwksp *ws, const ZSTD_compressionParameters *cParams, const ZSTD_paramSwitch_e useRowMatchFinder, const ZSTD_compResetPolicy_e crp, const ZSTD_indexResetPolicy_e forceResetIndex, const ZSTD_resetTarget_e forWho)
 
static size_t ZSTD_resetCCtx_byAttachingCDict (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict, ZSTD_CCtx_params params, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff)
 
static size_t ZSTD_resetCCtx_byCopyingCDict (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict, ZSTD_CCtx_params params, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff)
 
static size_t ZSTD_resetCCtx_internal (ZSTD_CCtx *zc, ZSTD_CCtx_params const *params, U64 const pledgedSrcSize, size_t const loadedDictSize, ZSTD_compResetPolicy_e const crp, ZSTD_buffered_policy_e const zbuff)
 
static size_t ZSTD_resetCCtx_usingCDict (ZSTD_CCtx *cctx, const ZSTD_CDict *cdict, const ZSTD_CCtx_params *params, U64 pledgedSrcSize, ZSTD_buffered_policy_e zbuff)
 
size_t ZSTD_resetCStream (ZSTD_CStream *zcs, unsigned long long pss)
 
size_t ZSTD_resetDStream (ZSTD_DStream *dctx)
 
void ZSTD_resetSeqStore (seqStore_t *ssPtr)
 
static ZSTD_paramSwitch_e ZSTD_resolveBlockSplitterMode (ZSTD_paramSwitch_e mode, const ZSTD_compressionParameters *const cParams)
 
static ZSTD_paramSwitch_e ZSTD_resolveEnableLdm (ZSTD_paramSwitch_e mode, const ZSTD_compressionParameters *const cParams)
 
static ZSTD_paramSwitch_e ZSTD_resolveExternalRepcodeSearch (ZSTD_paramSwitch_e value, int cLevel)
 
static int ZSTD_resolveExternalSequenceValidation (int mode)
 
static size_t ZSTD_resolveMaxBlockSize (size_t maxBlockSize)
 
static U32 ZSTD_resolveRepcodeToRawOffset (const U32 rep[ZSTD_REP_NUM], const U32 offBase, const U32 ll0)
 
static ZSTD_paramSwitch_e ZSTD_resolveRowMatchFinderMode (ZSTD_paramSwitch_e mode, const ZSTD_compressionParameters *const cParams)
 
MEM_STATIC size_t ZSTD_rleCompressBlock (void *dst, size_t dstCapacity, BYTE src, size_t srcSize, U32 lastBlock)
 
static U64 ZSTD_rollingHash_append (U64 hash, void const *buf, size_t size)
 
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 U16 ZSTD_rotateRight_U16 (U16 const value, U32 count)
 
MEM_STATIC U32 ZSTD_rotateRight_U32 (U32 const value, U32 count)
 
MEM_STATIC U64 ZSTD_rotateRight_U64 (U64 const value, U32 count)
 
FORCE_INLINE_TEMPLATE void ZSTD_row_fillHashCache (ZSTD_matchState_t *ms, const BYTE *base, U32 const rowLog, U32 const mls, U32 idx, const BYTE *const iLimit)
 
FORCE_INLINE_TEMPLATE ZSTD_VecMask ZSTD_row_getMatchMask (const BYTE *const tagRow, const BYTE tag, const U32 headGrouped, const U32 rowEntries)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_row_matchMaskGroupWidth (const U32 rowEntries)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_row_nextCachedHash (U32 *cache, U32 const *hashTable, BYTE const *tagTable, BYTE const *base, U32 idx, U32 const hashLog, U32 const rowLog, U32 const mls, U64 const hashSalt)
 
FORCE_INLINE_TEMPLATE U32 ZSTD_row_nextIndex (BYTE *const tagRow, U32 const rowMask)
 
FORCE_INLINE_TEMPLATE void ZSTD_row_prefetch (U32 const *hashTable, BYTE const *tagTable, U32 const relRow, U32 const rowLog)
 
void ZSTD_row_update (ZSTD_matchState_t *const ms, const BYTE *ip)
 
FORCE_INLINE_TEMPLATE void ZSTD_row_update_internal (ZSTD_matchState_t *ms, const BYTE *ip, U32 const mls, U32 const rowLog, U32 const rowMask, U32 const useCache)
 
FORCE_INLINE_TEMPLATE void ZSTD_row_update_internalImpl (ZSTD_matchState_t *ms, U32 updateStartIdx, U32 const updateEndIdx, U32 const mls, U32 const rowLog, U32 const rowMask, U32 const useCache)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_RowFindBestMatch (ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iLimit, size_t *offsetPtr, const U32 mls, const ZSTD_dictMode_e dictMode, const U32 rowLog)
 
static int ZSTD_rowMatchFinderSupported (const ZSTD_strategy strategy)
 
static int ZSTD_rowMatchFinderUsed (const ZSTD_strategy strategy, const ZSTD_paramSwitch_e mode)
 
static void ZSTD_safecopy (BYTE *op, const BYTE *const oend_w, BYTE const *ip, ptrdiff_t length, ZSTD_overlap_e ovtype)
 
static void ZSTD_safecopyDstBeforeSrc (BYTE *op, BYTE const *ip, ptrdiff_t length)
 
static void ZSTD_safecopyLiterals (BYTE *op, BYTE const *ip, BYTE const *const iend, BYTE const *ilimit_w)
 
static U32 ZSTD_scaleStats (unsigned *table, U32 lastEltIndex, U32 logTarget)
 
FORCE_INLINE_TEMPLATE size_t ZSTD_searchMax (ZSTD_matchState_t *ms, const BYTE *ip, const BYTE *iend, size_t *offsetPtr, U32 const mls, U32 const rowLog, searchMethod_e const searchMethod, ZSTD_dictMode_e const dictMode)
 
ZSTD_blockCompressor ZSTD_selectBlockCompressor (ZSTD_strategy strat, ZSTD_paramSwitch_e rowMatchfinderMode, ZSTD_dictMode_e dictMode)
 
static ZSTD_getAllMatchesFn ZSTD_selectBtGetAllMatches (ZSTD_matchState_t const *ms, ZSTD_dictMode_e const dictMode)
 
symbolEncodingType_e ZSTD_selectEncodingType (FSE_repeat *repeatMode, unsigned const *count, unsigned const max, size_t const mostFrequent, size_t nbSeq, unsigned const FSELog, FSE_CTable const *prevCTable, short const *defaultNorm, U32 defaultNormLog, ZSTD_defaultPolicy_e const isDefaultAllowed, ZSTD_strategy const strategy)
 
static ZSTD_sequenceCopier ZSTD_selectSequenceCopier (ZSTD_sequenceFormat_e mode)
 
static size_t ZSTD_seqDecompressedSize (seqStore_t const *seqStore, const seqDef *sequences, size_t nbSeq, size_t litSize, int lastSequence)
 
static void ZSTD_seqStore_resolveOffCodes (repcodes_t *const dRepcodes, repcodes_t *const cRepcodes, const seqStore_t *const seqStore, U32 const nbSeq)
 
int ZSTD_seqToCodes (const seqStore_t *seqStorePtr)
 
size_t ZSTD_sequenceBound (size_t srcSize)
 
static void ZSTD_setBasePrices (optState_t *optPtr, int optLevel)
 
static void ZSTD_setBufferExpectations (ZSTD_CCtx *cctx, const ZSTD_outBuffer *output, const ZSTD_inBuffer *input)
 
static size_t ZSTD_setRleBlock (void *dst, size_t dstCapacity, BYTE b, size_t regenSize)
 
static int ZSTD_shouldAttachDict (const ZSTD_CDict *cdict, const ZSTD_CCtx_params *params, U64 pledgedSrcSize)
 
size_t ZSTD_sizeof_CCtx (const ZSTD_CCtx *cctx)
 
size_t ZSTD_sizeof_CDict (const ZSTD_CDict *cdict)
 
size_t ZSTD_sizeof_CStream (const ZSTD_CStream *zcs)
 
size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx *dctx)
 
size_t ZSTD_sizeof_DDict (const ZSTD_DDict *ddict)
 
size_t ZSTD_sizeof_DStream (const ZSTD_DStream *dctx)
 
static size_t ZSTD_sizeof_localDict (ZSTD_localDict dict)
 
static size_t ZSTD_sizeof_matchState (const ZSTD_compressionParameters *const cParams, const ZSTD_paramSwitch_e useRowMatchFinder, const U32 enableDedicatedDictSearch, const U32 forCCtx)
 
static size_t ZSTD_sizeof_mtctx (const ZSTD_CCtx *cctx)
 
static size_t ZSTD_startingInputLength (ZSTD_format_e format)
 
static void ZSTD_storeLastLiterals (seqStore_t *seqStorePtr, const BYTE *anchor, size_t lastLLSize)
 
HINT_INLINE UNUSED_ATTR void ZSTD_storeSeq (seqStore_t *seqStorePtr, size_t litLength, const BYTE *literals, const BYTE *litLimit, U32 offBase, size_t matchLength)
 
size_t ZSTD_toFlushNow (ZSTD_CCtx *cctx)
 
static size_t ZSTD_totalHistorySize (BYTE *op, BYTE const *virtualStart)
 
static U32 ZSTD_totalLen (ZSTD_optimal_t sol)
 
static void ZSTD_updateDUBT (ZSTD_matchState_t *ms, const BYTE *ip, const BYTE *iend, U32 mls)
 
FORCE_INLINE_TEMPLATE void ZSTD_updateFseStateWithDInfo (ZSTD_fseState *DStatePtr, BIT_DStream_t *bitD, U16 nextState, U32 nbBits)
 
MEM_STATIC void ZSTD_updateRep (U32 rep[ZSTD_REP_NUM], U32 const offBase, U32 const ll0)
 
static void ZSTD_updateStats (optState_t *const optPtr, U32 litLength, const BYTE *literals, U32 offBase, U32 matchLength)
 
void ZSTD_updateTree (ZSTD_matchState_t *ms, const BYTE *ip, const BYTE *iend)
 
FORCE_INLINE_TEMPLATE void ZSTD_updateTree_internal (ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iend, const U32 mls, const ZSTD_dictMode_e dictMode)
 
static unsigned ZSTD_useLowProbCount (size_t const nbSeq)
 
static int ZSTD_useTargetCBlockSize (const ZSTD_CCtx_params *cctxParams)
 
static size_t ZSTD_validateSequence (U32 offCode, U32 matchLength, U32 minMatch, size_t posInSrc, U32 windowLog, size_t dictSize, int useSequenceProducer)
 
MEM_STATIC U32 ZSTD_VecMask_next (ZSTD_VecMask val)
 
unsigned ZSTD_versionNumber (void)
 
const char * ZSTD_versionString (void)
 
MEM_STATIC FORCE_INLINE_ATTR void ZSTD_wildcopy (void *dst, const void *src, ptrdiff_t length, ZSTD_overlap_e const ovtype)
 
MEM_STATIC U32 ZSTD_window_canOverflowCorrect (ZSTD_window_t const window, U32 cycleLog, U32 maxDist, U32 loadedDictEnd, void const *src)
 
MEM_STATIC void ZSTD_window_clear (ZSTD_window_t *window)
 
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 U32 ZSTD_window_hasExtDict (ZSTD_window_t const window)
 
MEM_STATIC void ZSTD_window_init (ZSTD_window_t *window)
 
MEM_STATIC U32 ZSTD_window_isEmpty (ZSTD_window_t const window)
 
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_update (ZSTD_window_t *window, void const *src, size_t srcSize, int forceNonContiguous)
 
static size_t ZSTD_writeEpilogue (ZSTD_CCtx *cctx, void *dst, size_t dstCapacity)
 
static size_t ZSTD_writeFrameHeader (void *dst, size_t dstCapacity, const ZSTD_CCtx_params *params, U64 pledgedSrcSize, U32 dictID)
 
size_t ZSTD_writeLastEmptyBlock (void *dst, size_t dstCapacity)
 
size_t ZSTD_writeSkippableFrame (void *dst, size_t dstCapacity, const void *src, size_t srcSize, unsigned magicVariant)
 
MEM_STATIC void ZSTD_writeTaggedIndex (U32 *const hashTable, size_t hashAndTag, U32 index)
 
static size_t ZSTDMT_CCtxParam_setNbWorkers (ZSTD_CCtx_params *params, unsigned nbWorkers)
 
static void ZSTDMT_compressionJob (void *jobDescription)
 
size_t ZSTDMT_compressStream_generic (ZSTDMT_CCtx *mtctx, ZSTD_outBuffer *output, ZSTD_inBuffer *input, ZSTD_EndDirective endOp)
 
static size_t ZSTDMT_computeOverlapSize (const ZSTD_CCtx_params *params)
 
static unsigned ZSTDMT_computeTargetJobLog (const ZSTD_CCtx_params *params)
 
static ZSTDMT_bufferPoolZSTDMT_createBufferPool (unsigned maxNbBuffers, ZSTD_customMem cMem)
 
ZSTDMT_CCtxZSTDMT_createCCtx_advanced (unsigned nbWorkers, ZSTD_customMem cMem, ZSTD_threadPool *pool)
 
MEM_STATIC ZSTDMT_CCtxZSTDMT_createCCtx_advanced_internal (unsigned nbWorkers, ZSTD_customMem cMem, ZSTD_threadPool *pool)
 
static ZSTDMT_CCtxPoolZSTDMT_createCCtxPool (int nbWorkers, ZSTD_customMem cMem)
 
static size_t ZSTDMT_createCompressionJob (ZSTDMT_CCtx *mtctx, size_t srcSize, ZSTD_EndDirective endOp)
 
static ZSTDMT_jobDescriptionZSTDMT_createJobsTable (U32 *nbJobsPtr, ZSTD_customMem cMem)
 
static ZSTDMT_seqPoolZSTDMT_createSeqPool (unsigned nbWorkers, ZSTD_customMem cMem)
 
static int ZSTDMT_doesOverlapWindow (buffer_t buffer, ZSTD_window_t window)
 
static ZSTDMT_bufferPoolZSTDMT_expandBufferPool (ZSTDMT_bufferPool *srcBufPool, unsigned maxNbBuffers)
 
static ZSTDMT_CCtxPoolZSTDMT_expandCCtxPool (ZSTDMT_CCtxPool *srcPool, int nbWorkers)
 
static size_t ZSTDMT_expandJobsTable (ZSTDMT_CCtx *mtctx, U32 nbWorkers)
 
static ZSTDMT_seqPoolZSTDMT_expandSeqPool (ZSTDMT_seqPool *pool, U32 nbWorkers)
 
static size_t ZSTDMT_flushProduced (ZSTDMT_CCtx *mtctx, ZSTD_outBuffer *output, unsigned blockToFlush, ZSTD_EndDirective end)
 
static void ZSTDMT_freeBufferPool (ZSTDMT_bufferPool *bufPool)
 
size_t ZSTDMT_freeCCtx (ZSTDMT_CCtx *mtctx)
 
static void ZSTDMT_freeCCtxPool (ZSTDMT_CCtxPool *pool)
 
static void ZSTDMT_freeJobsTable (ZSTDMT_jobDescription *jobTable, U32 nbJobs, ZSTD_customMem cMem)
 
static void ZSTDMT_freeSeqPool (ZSTDMT_seqPool *seqPool)
 
static buffer_t ZSTDMT_getBuffer (ZSTDMT_bufferPool *bufPool)
 
static ZSTD_CCtxZSTDMT_getCCtx (ZSTDMT_CCtxPool *cctxPool)
 
ZSTD_frameProgression ZSTDMT_getFrameProgression (ZSTDMT_CCtx *mtctx)
 
static range_t ZSTDMT_getInputDataInUse (ZSTDMT_CCtx *mtctx)
 
static rawSeqStore_t ZSTDMT_getSeq (ZSTDMT_seqPool *seqPool)
 
size_t ZSTDMT_initCStream_internal (ZSTDMT_CCtx *mtctx, const void *dict, size_t dictSize, ZSTD_dictContentType_e dictContentType, const ZSTD_CDict *cdict, ZSTD_CCtx_params params, unsigned long long pledgedSrcSize)
 
static int ZSTDMT_isOverlapped (buffer_t buffer, range_t range)
 
size_t ZSTDMT_nextInputSizeHint (const ZSTDMT_CCtx *mtctx)
 
static int ZSTDMT_overlapLog (int ovlog, ZSTD_strategy strat)
 
static int ZSTDMT_overlapLog_default (ZSTD_strategy strat)
 
static void ZSTDMT_releaseAllJobResources (ZSTDMT_CCtx *mtctx)
 
static void ZSTDMT_releaseBuffer (ZSTDMT_bufferPool *bufPool, buffer_t buf)
 
static void ZSTDMT_releaseCCtx (ZSTDMT_CCtxPool *pool, ZSTD_CCtx *cctx)
 
static void ZSTDMT_releaseSeq (ZSTDMT_seqPool *seqPool, rawSeqStore_t seq)
 
static size_t ZSTDMT_resize (ZSTDMT_CCtx *mtctx, unsigned nbWorkers)
 
static void ZSTDMT_serialState_ensureFinished (serialState_t *serialState, unsigned jobID, size_t cSize)
 
static void ZSTDMT_serialState_free (serialState_t *serialState)
 
static int ZSTDMT_serialState_init (serialState_t *serialState)
 
static int ZSTDMT_serialState_reset (serialState_t *serialState, ZSTDMT_seqPool *seqPool, ZSTD_CCtx_params params, size_t jobSize, const void *dict, size_t const dictSize, ZSTD_dictContentType_e dictContentType)
 
static void ZSTDMT_serialState_update (serialState_t *serialState, ZSTD_CCtx *jobCCtx, rawSeqStore_t seqStore, range_t src, unsigned jobID)
 
static void ZSTDMT_setBufferSize (ZSTDMT_bufferPool *const bufPool, size_t const bSize)
 
static void ZSTDMT_setNbSeq (ZSTDMT_seqPool *const seqPool, size_t const nbSeq)
 
static size_t ZSTDMT_sizeof_bufferPool (ZSTDMT_bufferPool *bufPool)
 
size_t ZSTDMT_sizeof_CCtx (ZSTDMT_CCtx *mtctx)
 
static size_t ZSTDMT_sizeof_CCtxPool (ZSTDMT_CCtxPool *cctxPool)
 
static size_t ZSTDMT_sizeof_seqPool (ZSTDMT_seqPool *seqPool)
 
size_t ZSTDMT_toFlushNow (ZSTDMT_CCtx *mtctx)
 
static int ZSTDMT_tryGetInputRange (ZSTDMT_CCtx *mtctx)
 
void ZSTDMT_updateCParams_whileCompressing (ZSTDMT_CCtx *mtctx, const ZSTD_CCtx_params *cctxParams)
 
static void ZSTDMT_waitForAllJobsCompleted (ZSTDMT_CCtx *mtctx)
 
static void ZSTDMT_waitForLdmComplete (ZSTDMT_CCtx *mtctx, buffer_t buffer)
 
static void ZSTDMT_writeLastEmptyBlock (ZSTDMT_jobDescription *job)
 

Variables

static const algo_time_t algoTime [16][2]
 
static const size_t attachDictSizeCutoffs [ZSTD_STRATEGY_MAX+1]
 
static const unsigned BIT_mask []
 
static const U32 COVER_prime4bytes = 2654435761U
 
static const FASTCOVER_accel_t FASTCOVER_defaultAccelParameters [FASTCOVER_MAX_ACCEL+1]
 
static COVER_ctx_tg_coverCtx = NULL
 
int g_debuglevel = DEBUGLEVEL
 
static int g_displayLevel = 0
 
static const buffer_t g_nullBuffer = { NULL, 0 }
 
static const clock_t g_refreshRate = CLOCKS_PER_SEC * 15 / 100
 
static const U32 g_selectivity_default = 9
 
static clock_t g_time = 0
 
int g_ZSTD_threading_useless_symbol
 
static const unsigned kInverseProbabilityLog256 [256]
 
static const range_t kNullRange = { NULL, 0 }
 
static const UNUSED_ATTR rawSeqStore_t kNullRawSeqStore = {NULL, 0, 0, 0, 0}
 
static const roundBuff_t kNullRoundBuff = {NULL, 0, 0}
 
static const int lg_table [256]
 
static const UNUSED_ATTR U32 LL_base [MaxLL+1]
 
static const UNUSED_ATTR U8 LL_bits [MaxLL+1]
 
static const ZSTD_seqSymbol LL_defaultDTable [(1<< LL_DEFAULTNORMLOG)+1]
 
static const UNUSED_ATTR S16 LL_defaultNorm [MaxLL+1]
 
static const UNUSED_ATTR U32 LL_defaultNormLog = LL_DEFAULTNORMLOG
 
static const UNUSED_ATTR U32 ML_base [MaxML+1]
 
static const UNUSED_ATTR U8 ML_bits [MaxML+1]
 
static const ZSTD_seqSymbol ML_defaultDTable [(1<< ML_DEFAULTNORMLOG)+1]
 
static const UNUSED_ATTR S16 ML_defaultNorm [MaxML+1]
 
static const UNUSED_ATTR U32 ML_defaultNormLog = ML_DEFAULTNORMLOG
 
static const UNUSED_ATTR U32 OF_base [MaxOff+1]
 
static const UNUSED_ATTR U8 OF_bits [MaxOff+1]
 
static const ZSTD_seqSymbol OF_defaultDTable [(1<< OF_DEFAULTNORMLOG)+1]
 
static const UNUSED_ATTR S16 OF_defaultNorm [DefaultMaxOff+1]
 
static const UNUSED_ATTR U32 OF_defaultNormLog = OF_DEFAULTNORMLOG
 
static const U32 prime3bytes = 506832829U
 
static const U32 prime4bytes = 2654435761U
 
static const U64 prime5bytes = 889523592379ULL
 
static const U64 prime6bytes = 227718039650203ULL
 
static const U64 prime7bytes = 58295818150454627ULL
 
static const U64 prime8bytes = 0xCF1BBCDCB7A56463ULL
 
static const UNUSED_ATTR U32 repStartValue [ZSTD_REP_NUM] = { 1, 4, 8 }
 
static const int sqq_table [256]
 
 XXH_errorcode
 
static const UNUSED_ATTR size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE
 
static const ZSTD_compressionParameters ZSTD_defaultCParameters [4][ZSTD_MAX_CLEVEL+1]
 
static const UNUSED_ATTR size_t ZSTD_did_fieldSize [4] = { 0, 1, 2, 4 }
 
static const UNUSED_ATTR size_t ZSTD_fcs_fieldSize [4] = { 0, 2, 4, 8 }
 
static const UNUSED_ATTR U64 ZSTD_ldm_gearTab [256]
 
static xxh_u64 XXH_read64 (const void *memPtr)
 
static xxh_u64 XXH_readBE64 (const void *ptr)
 
XXH_FORCE_INLINE xxh_u64 XXH_readLE64 (const void *ptr)
 
XXH_FORCE_INLINE xxh_u64 XXH_readLE64_align (const void *ptr, XXH_alignment align)
 
static xxh_u64 XXH_swap64 (xxh_u64 x)
 
typedef XXH64_hash_t xxh_u64
 

Detailed Description

Single-file Zstandard library.

Generate using:

python combine.py -r ../../lib -x legacy/zstd_legacy.h -o zstd.c zstd-in.c

Definition in file zstd.c.

Macro Definition Documentation

◆ __has_attribute

#define __has_attribute (   x)    0

This header file contains macro definitions to support portability. This header is shared between C and ASM code, so it MUST only contain macro definitions. It MUST not contain any C code.

This header ONLY defines macros to detect platforms/feature support.

Definition at line 384 of file zstd.c.

◆ __has_builtin

#define __has_builtin (   x)    0

Definition at line 389 of file zstd.c.

◆ __has_feature

#define __has_feature (   x)    0

Definition at line 394 of file zstd.c.

◆ _DIVSUFSORT_H

#define _DIVSUFSORT_H   1

Definition at line 41868 of file zstd.c.

◆ _FILE_OFFSET_BITS

#define _FILE_OFFSET_BITS   64

Definition at line 44572 of file zstd.c.

◆ _FORCE_HAS_FORMAT_STRING

#define _FORCE_HAS_FORMAT_STRING (   ...)
Value:
if (0) { \
_force_has_format_string(__VA_ARGS__); \
}

Ignore: this is an internal helper.

We want to force this function invocation to be syntactically correct, but we don't want to force runtime evaluation of its arguments.

Definition at line 1488 of file zstd.c.

◆ _LARGEFILE64_SOURCE

#define _LARGEFILE64_SOURCE

Definition at line 44579 of file zstd.c.

◆ ADVANCED_SEQS

#define ADVANCED_SEQS   STORED_SEQS

◆ ALPHABET_SIZE

#define ALPHABET_SIZE   (256)

Definition at line 41921 of file zstd.c.

◆ assert

#define assert (   condition)    ((void)0) /* disable assert (default) */

Definition at line 266 of file zstd.c.

◆ B

#define B (   name,
  bit 
)    X(name, f7b, bit)

◆ BIT0

#define BIT0   1

Definition at line 10817 of file zstd.c.

◆ BIT1

#define BIT1   2

Definition at line 10816 of file zstd.c.

◆ BIT4

#define BIT4   16

Definition at line 10815 of file zstd.c.

◆ BIT5

#define BIT5   32

Definition at line 10814 of file zstd.c.

◆ BIT6

#define BIT6   64

Definition at line 10813 of file zstd.c.

◆ BIT7

#define BIT7   128

Definition at line 10812 of file zstd.c.

◆ BIT_MASK_SIZE

#define BIT_MASK_SIZE   (sizeof(BIT_mask) / sizeof(BIT_mask[0]))

Definition at line 2133 of file zstd.c.

◆ BITCOST_ACCURACY

#define BITCOST_ACCURACY   8

Definition at line 29557 of file zstd.c.

◆ BITCOST_MULTIPLIER

#define BITCOST_MULTIPLIER   (1 << BITCOST_ACCURACY)

Definition at line 29558 of file zstd.c.

◆ BITSTREAM_H_MODULE

#define BITSTREAM_H_MODULE

Definition at line 1803 of file zstd.c.

◆ BMI2_TARGET_ATTRIBUTE

#define BMI2_TARGET_ATTRIBUTE   TARGET_ATTRIBUTE("lzcnt,bmi,bmi2")

Definition at line 608 of file zstd.c.

◆ BOUNDCHECK

#define BOUNDCHECK (   cParam,
  val 
)
Value:
{ \
RETURN_ERROR_IF(!ZSTD_cParam_withinBounds(cParam,val), \
parameter_outOfBound, "Param out of bounds"); \
}

Definition at line 18291 of file zstd.c.

◆ BOUNDED

#define BOUNDED (   min,
  val,
  max 
)    (MAX(min,MIN(val,max)))

Definition at line 10797 of file zstd.c.

◆ BUCKET_A

#define BUCKET_A (   _c0)    bucket_A[(_c0)]

Definition at line 41993 of file zstd.c.

◆ BUCKET_A_SIZE

#define BUCKET_A_SIZE   (ALPHABET_SIZE)

Definition at line 41923 of file zstd.c.

◆ BUCKET_B

#define BUCKET_B (   _c0,
  _c1 
)    (bucket_B[((_c1) << 8) | (_c0)])

Definition at line 41995 of file zstd.c.

◆ BUCKET_B_SIZE

#define BUCKET_B_SIZE   (ALPHABET_SIZE * ALPHABET_SIZE)

Definition at line 41924 of file zstd.c.

◆ BUCKET_BSTAR

#define BUCKET_BSTAR (   _c0,
  _c1 
)    (bucket_B[((_c0) << 8) | (_c1)])

Definition at line 41996 of file zstd.c.

◆ BUF_POOL_MAX_NB_BUFFERS

#define BUF_POOL_MAX_NB_BUFFERS (   nbWorkers)    (2*(nbWorkers) + 3)

Definition at line 31267 of file zstd.c.

◆ C [1/2]

#define C (   name,
  bit 
)    X(name, f1c, bit)

Definition at line 4811 of file zstd.c.

◆ C [2/2]

#define C (   name,
  bit 
)    X(name, f7c, bit)

Definition at line 4811 of file zstd.c.

◆ CACHELINE_SIZE

#define CACHELINE_SIZE   64

Definition at line 632 of file zstd.c.

◆ CHECK_DBOUNDS

#define CHECK_DBOUNDS (   p,
 
)
Value:
{ \
RETURN_ERROR_IF(!ZSTD_dParam_withinBounds(p, v), parameter_outOfBound, ""); \
}

Definition at line 37193 of file zstd.c.

◆ CHECK_F

#define CHECK_F (   f)    { CHECK_V_F(_var_err__, f); }

Definition at line 1454 of file zstd.c.

◆ CHECK_V_F

#define CHECK_V_F (   e,
  f 
)    size_t const e = f; if (ERR_isError(e)) return e

Definition at line 1453 of file zstd.c.

◆ CLAMP

#define CLAMP (   cParam,
  val 
)    CLAMP_TYPE(cParam, val, unsigned)

◆ 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; \
}

◆ COMPRESS_LITERALS_SIZE_MIN

#define COMPRESS_LITERALS_SIZE_MIN   63 /* heuristic */

◆ COMPRESS_SEQUENCES_WORKSPACE_SIZE

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

Definition at line 14739 of file zstd.c.

◆ COPY16

#define COPY16 (   d,
  s 
)    { ZSTD_copy16(d,s); d+=16; s+=16; }

Definition at line 10938 of file zstd.c.

◆ COPY8

#define COPY8 (   d,
  s 
)    { ZSTD_copy8(d,s); d+=8; s+=8; }

Definition at line 10918 of file zstd.c.

◆ COVER_DEFAULT_SPLITPOINT

#define COVER_DEFAULT_SPLITPOINT   1.0

Definition at line 40590 of file zstd.c.

◆ COVER_MAX_SAMPLES_SIZE

#define COVER_MAX_SAMPLES_SIZE   (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB))

There are 32bit indexes used to ref samples, so limit samples size to 4GB on 64bit builds. For 32bit builds we choose 1 GB. Most 32bit platforms have 2GB user-mode addressable space and we allocate a large contiguous buffer, so 1GB is already a high limit.

Definition at line 40589 of file zstd.c.

◆ D

#define D (   name,
  bit 
)    X(name, f1d, bit)

◆ DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT

#define DDICT_HASHSET_MAX_LOAD_FACTOR_COUNT_MULT   4

Definition at line 35437 of file zstd.c.

◆ DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT

#define DDICT_HASHSET_MAX_LOAD_FACTOR_SIZE_MULT
Value:
3 /* These two constants represent SIZE_MULT/COUNT_MULT load factor without using a float.
* Currently, that means a 0.75 load factor.
* So, if count * COUNT_MULT / size * SIZE_MULT != 0, then we've exceeded
* the load factor of the ddict hash set.
*/

Definition at line 35438 of file zstd.c.

◆ DDICT_HASHSET_RESIZE_FACTOR

#define DDICT_HASHSET_RESIZE_FACTOR   2

Definition at line 35441 of file zstd.c.

◆ DDICT_HASHSET_TABLE_BASE_SIZE

#define DDICT_HASHSET_TABLE_BASE_SIZE   64

Definition at line 35440 of file zstd.c.

◆ DEBUG_H_12987983217

#define DEBUG_H_12987983217

Definition at line 225 of file zstd.c.

◆ DEBUG_PRINTHEX

#define DEBUG_PRINTHEX (   l,
  p,
 
)    {}

Definition at line 31079 of file zstd.c.

◆ DEBUG_STATIC_ASSERT

#define DEBUG_STATIC_ASSERT (   c)    (void)sizeof(char[(c) ? 1 : -1])

Definition at line 235 of file zstd.c.

◆ DEBUGLEVEL

#define DEBUGLEVEL   0

Definition at line 37 of file zstd.c.

◆ DEBUGLOG

#define DEBUGLOG (   l,
  ... 
)    {} /* disabled */

Definition at line 291 of file zstd.c.

◆ DEFAULT_ACCEL

#define DEFAULT_ACCEL   1

Definition at line 43827 of file zstd.c.

◆ DEFAULT_F

#define DEFAULT_F   20

Definition at line 43826 of file zstd.c.

◆ DefaultMaxOff

#define DefaultMaxOff   28

Definition at line 10846 of file zstd.c.

◆ DICTLISTSIZE_DEFAULT

#define DICTLISTSIZE_DEFAULT   10000

Definition at line 44614 of file zstd.c.

◆ DISPLAY [1/3]

#define DISPLAY (   ...)
Value:
{ \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
}

Definition at line 44625 of file zstd.c.

◆ DISPLAY [2/3]

#define DISPLAY (   ...)
Value:
{ \
fprintf(stderr, __VA_ARGS__); \
fflush(stderr); \
}

Definition at line 44625 of file zstd.c.

◆ DISPLAY [3/3]

#define DISPLAY (   ...)    { fprintf(stderr, __VA_ARGS__); fflush( stderr ); }

Definition at line 44625 of file zstd.c.

◆ DISPLAYLEVEL [1/3]

#define DISPLAYLEVEL (   l,
  ... 
)    LOCALDISPLAYLEVEL(g_displayLevel, l, __VA_ARGS__)

Definition at line 44627 of file zstd.c.

◆ DISPLAYLEVEL [2/3]

#define DISPLAYLEVEL (   l,
  ... 
)    LOCALDISPLAYLEVEL(g_displayLevel, l, __VA_ARGS__)

Definition at line 44627 of file zstd.c.

◆ DISPLAYLEVEL [3/3]

#define DISPLAYLEVEL (   l,
  ... 
)    if (notificationLevel>=l) { DISPLAY(__VA_ARGS__); } /* 0 : no display; 1: errors; 2: default; 3: details; 4: debug */

Definition at line 44627 of file zstd.c.

◆ DISPLAYUPDATE [1/3]

#define DISPLAYUPDATE (   l,
  ... 
)    LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__)

Definition at line 43863 of file zstd.c.

◆ DISPLAYUPDATE [2/3]

#define DISPLAYUPDATE (   l,
  ... 
)    LOCALDISPLAYUPDATE(g_displayLevel, l, __VA_ARGS__)

Definition at line 43863 of file zstd.c.

◆ DISPLAYUPDATE [3/3]

#define DISPLAYUPDATE (   l,
  ... 
)
Value:
if (notificationLevel>=l) { \
if (ZDICT_clockSpan(displayClock) > refreshRate) \
{ displayClock = clock(); DISPLAY(__VA_ARGS__); \
if (notificationLevel>=4) fflush(stderr); } }

Definition at line 43863 of file zstd.c.

◆ DONT_VECTORIZE

#define DONT_VECTORIZE

Definition at line 653 of file zstd.c.

◆ DYNAMIC_BMI2

#define DYNAMIC_BMI2   0

Definition at line 444 of file zstd.c.

◆ ENTROPY_WORKSPACE_SIZE

#define ENTROPY_WORKSPACE_SIZE   (HUF_WORKSPACE_SIZE + COMPRESS_SEQUENCES_WORKSPACE_SIZE)

Definition at line 14740 of file zstd.c.

◆ ERR_QUOTE

#define ERR_QUOTE (   str)    #str

Definition at line 1493 of file zstd.c.

◆ ERR_STATIC

#define ERR_STATIC   static /* this version may generate warnings for unused static functions; disable the relevant warning */

Definition at line 1430 of file zstd.c.

◆ ERROR

#define ERROR (   name)    ZSTD_ERROR(name)

Definition at line 1445 of file zstd.c.

◆ ERROR_H_MODULE

#define ERROR_H_MODULE

Definition at line 1289 of file zstd.c.

◆ FASTCOVER_DEFAULT_SPLITPOINT

#define FASTCOVER_DEFAULT_SPLITPOINT   0.75

Definition at line 43825 of file zstd.c.

◆ FASTCOVER_MAX_ACCEL

#define FASTCOVER_MAX_ACCEL   10

Definition at line 43824 of file zstd.c.

◆ FASTCOVER_MAX_F

#define FASTCOVER_MAX_F   31

Definition at line 43823 of file zstd.c.

◆ FASTCOVER_MAX_SAMPLES_SIZE

#define FASTCOVER_MAX_SAMPLES_SIZE   (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB))

There are 32bit indexes used to ref samples, so limit samples size to 4GB on 64bit builds. For 32bit builds we choose 1 GB. Most 32bit platforms have 2GB user-mode addressable space and we allocate a large contiguous buffer, so 1GB is already a high limit.

Definition at line 43822 of file zstd.c.

◆ FORCE_INLINE_ATTR

#define FORCE_INLINE_ATTR

Definition at line 534 of file zstd.c.

◆ FORCE_INLINE_TEMPLATE

#define FORCE_INLINE_TEMPLATE   static INLINE_KEYWORD FORCE_INLINE_ATTR

FORCE_INLINE_TEMPLATE is used to define C "templates", which take constant parameters. They must be inlined for the compiler to eliminate the constant branches.

Definition at line 560 of file zstd.c.

◆ FORCE_NOINLINE

#define FORCE_NOINLINE   static

Definition at line 592 of file zstd.c.

◆ FORWARD_IF_ERROR

#define FORWARD_IF_ERROR (   err,
  ... 
)
Value:
do { \
size_t const err_code = (err); \
if (ERR_isError(err_code)) { \
RAWLOG(3, "%s:%d: ERROR!: forwarding error in %s: %s", \
__FILE__, __LINE__, ERR_QUOTE(err), ERR_getErrorName(err_code)); \
_FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \
RAWLOG(3, ": " __VA_ARGS__); \
RAWLOG(3, "\n"); \
return err_code; \
} \
} while(0);

If the provided expression evaluates to an error code, returns that error code.

In debug modes, prints additional information.

Definition at line 1532 of file zstd.c.

◆ FSE_BLOCKBOUND

#define FSE_BLOCKBOUND (   size)    ((size) + ((size)>>7) + 4 /* fse states */ + sizeof(size_t) /* bitContainer */)

Definition at line 2435 of file zstd.c.

◆ FSE_BUILD_CTABLE_WORKSPACE_SIZE

#define FSE_BUILD_CTABLE_WORKSPACE_SIZE (   maxSymbolValue,
  tableLog 
)    (sizeof(unsigned) * FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32(maxSymbolValue, tableLog))

Definition at line 2463 of file zstd.c.

◆ FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32

#define FSE_BUILD_CTABLE_WORKSPACE_SIZE_U32 (   maxSymbolValue,
  tableLog 
)    (((maxSymbolValue + 2) + (1ull << (tableLog)))/2 + sizeof(U64)/sizeof(U32) /* additional 8 bytes for potential table overwrite */)

Definition at line 2462 of file zstd.c.

◆ FSE_BUILD_DTABLE_WKSP_SIZE

#define FSE_BUILD_DTABLE_WKSP_SIZE (   maxTableLog,
  maxSymbolValue 
)    (sizeof(short) * (maxSymbolValue + 1) + (1ULL << maxTableLog) + 8)

Definition at line 2466 of file zstd.c.

◆ FSE_BUILD_DTABLE_WKSP_SIZE_U32

#define FSE_BUILD_DTABLE_WKSP_SIZE_U32 (   maxTableLog,
  maxSymbolValue 
)    ((FSE_BUILD_DTABLE_WKSP_SIZE(maxTableLog, maxSymbolValue) + sizeof(unsigned) - 1) / sizeof(unsigned))

Definition at line 2467 of file zstd.c.

◆ FSE_CAT [1/2]

#define FSE_CAT (   X,
 
)    X##Y

Definition at line 11295 of file zstd.c.

◆ FSE_CAT [2/2]

#define FSE_CAT (   X,
 
)    X##Y

Definition at line 11295 of file zstd.c.

◆ FSE_COMPRESSBOUND

#define FSE_COMPRESSBOUND (   size)    (FSE_NCOUNTBOUND + FSE_BLOCKBOUND(size)) /* Macro version, useful for static allocation */

Definition at line 2436 of file zstd.c.

◆ FSE_CTABLE_SIZE

#define FSE_CTABLE_SIZE (   maxTableLog,
  maxSymbolValue 
)    (FSE_CTABLE_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(FSE_CTable))

Definition at line 2443 of file zstd.c.

◆ FSE_CTABLE_SIZE_U32

#define FSE_CTABLE_SIZE_U32 (   maxTableLog,
  maxSymbolValue 
)    (1 + (1<<((maxTableLog)-1)) + (((maxSymbolValue)+1)*2))

Definition at line 2439 of file zstd.c.

◆ FSE_DECODE_TYPE

#define FSE_DECODE_TYPE   FSE_decode_t

Definition at line 2802 of file zstd.c.

◆ FSE_DECOMPRESS_WKSP_SIZE

#define FSE_DECOMPRESS_WKSP_SIZE (   maxTableLog,
  maxSymbolValue 
)    (FSE_DECOMPRESS_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) * sizeof(unsigned))

Definition at line 2472 of file zstd.c.

◆ FSE_DECOMPRESS_WKSP_SIZE_U32

#define FSE_DECOMPRESS_WKSP_SIZE_U32 (   maxTableLog,
  maxSymbolValue 
)    (FSE_DTABLE_SIZE_U32(maxTableLog) + 1 + FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxTableLog, maxSymbolValue) + (FSE_MAX_SYMBOL_VALUE + 1) / 2 + 1)

Definition at line 2471 of file zstd.c.

◆ FSE_DEFAULT_MEMORY_USAGE

#define FSE_DEFAULT_MEMORY_USAGE   13

Definition at line 2784 of file zstd.c.

◆ FSE_DEFAULT_TABLELOG

#define FSE_DEFAULT_TABLELOG   (FSE_DEFAULT_MEMORY_USAGE-2)

Definition at line 2814 of file zstd.c.

◆ FSE_DTABLE_SIZE

#define FSE_DTABLE_SIZE (   maxTableLog)    (FSE_DTABLE_SIZE_U32(maxTableLog) * sizeof(FSE_DTable))

Definition at line 2444 of file zstd.c.

◆ FSE_DTABLE_SIZE_U32

#define FSE_DTABLE_SIZE_U32 (   maxTableLog)    (1 + (1<<(maxTableLog)))

Definition at line 2440 of file zstd.c.

◆ FSE_EXPAND_AND_QUOTE

#define FSE_EXPAND_AND_QUOTE (   str)    FSE_QUOTE(str)

Definition at line 1601 of file zstd.c.

◆ FSE_FLUSHBITS

#define FSE_FLUSHBITS (   s)    (fast ? BIT_flushBitsFast(s) : BIT_flushBits(s))

◆ FSE_FUNCTION_EXTENSION

#define FSE_FUNCTION_EXTENSION

Definition at line 2801 of file zstd.c.

◆ FSE_FUNCTION_NAME [1/2]

#define FSE_FUNCTION_NAME (   X,
 
)    FSE_CAT(X,Y)

Definition at line 11296 of file zstd.c.

◆ FSE_FUNCTION_NAME [2/2]

#define FSE_FUNCTION_NAME (   X,
 
)    FSE_CAT(X,Y)

Definition at line 11296 of file zstd.c.

◆ FSE_FUNCTION_TYPE

#define FSE_FUNCTION_TYPE   BYTE

Definition at line 2800 of file zstd.c.

◆ FSE_GETSYMBOL

#define FSE_GETSYMBOL (   statePtr)    fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD)

◆ FSE_H

#define FSE_H

Definition at line 1572 of file zstd.c.

◆ FSE_H_FSE_STATIC_LINKING_ONLY

#define FSE_H_FSE_STATIC_LINKING_ONLY

Tutorial :

(Note : these functions only decompress FSE-compressed blocks. If block is uncompressed, use memcpy() instead If block is a single repeated byte, use memset() instead )

The first step is to obtain the normalized frequencies of symbols. This can be performed by FSE_readNCount() if it was saved using FSE_writeNCount(). 'normalizedCounter' must be already allocated, and have at least 'maxSymbolValuePtr[0]+1' cells of signed short. In practice, that means it's necessary to know 'maxSymbolValue' beforehand, or size the table to handle worst case situations (typically 256). FSE_readNCount() will provide 'tableLog' and 'maxSymbolValue'. The result of FSE_readNCount() is the number of bytes read from 'rBuffer'. Note that 'rBufferSize' must be at least 4 bytes, even if useful information is less than that. If there is an error, the function will return an error code, which can be tested using FSE_isError().

The next step is to build the decompression tables 'FSE_DTable' from 'normalizedCounter'. This is performed by the function FSE_buildDTable(). The space required by 'FSE_DTable' must be already allocated using FSE_createDTable(). If there is an error, the function will return an error code, which can be tested using FSE_isError().

FSE_DTable can then be used to decompress cSrc, with FSE_decompress_usingDTable(). cSrcSize must be strictly correct, otherwise decompression will fail. FSE_decompress_usingDTable() result will tell how many bytes were regenerated (<=dstCapacity). If there is an error, the function will return an error code, which can be tested using FSE_isError(). (ex: dst buffer too small)

Definition at line 1785 of file zstd.c.

◆ FSE_isError [1/3]

#define FSE_isError   ERR_isError

Definition at line 11274 of file zstd.c.

◆ FSE_isError [2/3]

#define FSE_isError   ERR_isError

Definition at line 11274 of file zstd.c.

◆ FSE_isError [3/3]

#define FSE_isError   ERR_isError

Definition at line 11274 of file zstd.c.

◆ FSE_LIB_VERSION

Definition at line 1599 of file zstd.c.

◆ FSE_MAX_MEMORY_USAGE

#define FSE_MAX_MEMORY_USAGE   14

MEMORY_USAGE : Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) Increasing memory usage improves compression ratio Reduced memory usage can improve speed, due to cache effect Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache

Definition at line 2781 of file zstd.c.

◆ FSE_MAX_SYMBOL_VALUE

#define FSE_MAX_SYMBOL_VALUE   255

FSE_MAX_SYMBOL_VALUE : Maximum symbol value authorized. Required for proper stack allocation

Definition at line 2794 of file zstd.c.

◆ FSE_MAX_TABLELOG

#define FSE_MAX_TABLELOG   (FSE_MAX_MEMORY_USAGE-2)

Definition at line 2811 of file zstd.c.

◆ FSE_MAX_TABLESIZE

#define FSE_MAX_TABLESIZE   (1U<<FSE_MAX_TABLELOG)

Definition at line 2812 of file zstd.c.

◆ FSE_MAXTABLESIZE_MASK

#define FSE_MAXTABLESIZE_MASK   (FSE_MAX_TABLESIZE-1)

Definition at line 2813 of file zstd.c.

◆ FSE_MIN_TABLELOG

#define FSE_MIN_TABLELOG   5

Definition at line 2815 of file zstd.c.

◆ FSE_NCOUNTBOUND

#define FSE_NCOUNTBOUND   512

Definition at line 2434 of file zstd.c.

◆ FSE_PUBLIC_API

#define FSE_PUBLIC_API

Definition at line 1591 of file zstd.c.

◆ FSE_QUOTE

#define FSE_QUOTE (   str)    #str

Definition at line 1600 of file zstd.c.

◆ FSE_STATIC_ASSERT

#define FSE_STATIC_ASSERT (   c)    DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */

Definition at line 3525 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [1/10]

#define FSE_STATIC_LINKING_ONLY   /* FSE_MIN_TABLELOG */

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [2/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [3/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [4/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [5/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [6/10]

#define FSE_STATIC_LINKING_ONLY   /* FSE_optimalTableLog_internal */

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [7/10]

#define FSE_STATIC_LINKING_ONLY   /* FSE_encodeSymbol */

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [8/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [9/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_STATIC_LINKING_ONLY [10/10]

#define FSE_STATIC_LINKING_ONLY

Definition at line 37730 of file zstd.c.

◆ FSE_TABLELOG_ABSOLUTE_MAX

#define FSE_TABLELOG_ABSOLUTE_MAX   15

Definition at line 2817 of file zstd.c.

◆ FSE_TABLESTEP

#define FSE_TABLESTEP (   tableSize)    (((tableSize)>>1) + ((tableSize)>>3) + 3)

Definition at line 2822 of file zstd.c.

◆ FSE_TYPE_NAME [1/2]

#define FSE_TYPE_NAME (   X,
 
)    FSE_CAT(X,Y)

Definition at line 11297 of file zstd.c.

◆ FSE_TYPE_NAME [2/2]

#define FSE_TYPE_NAME (   X,
 
)    FSE_CAT(X,Y)

Definition at line 11297 of file zstd.c.

◆ FSE_VERSION_MAJOR

#define FSE_VERSION_MAJOR   0

Definition at line 1595 of file zstd.c.

◆ FSE_VERSION_MINOR

#define FSE_VERSION_MINOR   9

Definition at line 1596 of file zstd.c.

◆ FSE_VERSION_NUMBER

#define FSE_VERSION_NUMBER   (FSE_VERSION_MAJOR *100*100 + FSE_VERSION_MINOR *100 + FSE_VERSION_RELEASE)

Definition at line 1604 of file zstd.c.

◆ FSE_VERSION_RELEASE

#define FSE_VERSION_RELEASE   0

Definition at line 1597 of file zstd.c.

◆ FSE_VERSION_STRING

#define FSE_VERSION_STRING   FSE_EXPAND_AND_QUOTE(FSE_LIB_VERSION)

Definition at line 1602 of file zstd.c.

◆ GB [1/2]

#define GB   *(1U<<30)

Definition at line 44612 of file zstd.c.

◆ GB [2/2]

#define GB   *(1U<<30)

Definition at line 44612 of file zstd.c.

◆ GEAR_ITER_ONCE [1/2]

#define GEAR_ITER_ONCE ( )
Value:
do { \
hash = (hash << 1) + ZSTD_ldm_gearTab[data[n] & 0xff]; \
n += 1; \
} while (0)

◆ GEAR_ITER_ONCE [2/2]

#define GEAR_ITER_ONCE ( )
Value:
do { \
hash = (hash << 1) + ZSTD_ldm_gearTab[data[n] & 0xff]; \
n += 1; \
if (UNLIKELY((hash & mask) == 0)) { \
splits[*numSplits] = n; \
*numSplits += 1; \
if (*numSplits == LDM_BATCH_SIZE) \
goto done; \
} \
} while (0)

◆ GEN_ZSTD_BT_GET_ALL_MATCHES

#define GEN_ZSTD_BT_GET_ALL_MATCHES (   dictMode)
Value:
GEN_ZSTD_BT_GET_ALL_MATCHES_(dictMode, 4) \
GEN_ZSTD_BT_GET_ALL_MATCHES_(dictMode, 5) \
GEN_ZSTD_BT_GET_ALL_MATCHES_(dictMode, 6)

Definition at line 30379 of file zstd.c.

◆ GEN_ZSTD_BT_GET_ALL_MATCHES_

#define GEN_ZSTD_BT_GET_ALL_MATCHES_ (   dictMode,
  mls 
)
Value:
static U32 ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, mls)( \
ZSTD_match_t* matches, \
ZSTD_matchState_t* ms, \
U32* nextToUpdate3, \
const BYTE* ip, \
const BYTE* const iHighLimit, \
const U32 rep[ZSTD_REP_NUM], \
U32 const ll0, \
U32 const lengthToBeat) \
{ \
matches, ms, nextToUpdate3, ip, iHighLimit, \
rep, ll0, lengthToBeat, ZSTD_##dictMode, mls); \
}

Definition at line 30363 of file zstd.c.

◆ GEN_ZSTD_BT_SEARCH_FN

#define GEN_ZSTD_BT_SEARCH_FN (   dictMode,
  mls 
)
Value:
ZSTD_SEARCH_FN_ATTRS size_t ZSTD_BT_SEARCH_FN(dictMode, mls)( \
ZSTD_matchState_t* ms, \
const BYTE* ip, const BYTE* const iLimit, \
size_t* offBasePtr) \
{ \
assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
return ZSTD_BtFindBestMatch(ms, ip, iLimit, offBasePtr, mls, ZSTD_##dictMode); \
} \

Definition at line 27873 of file zstd.c.

◆ GEN_ZSTD_CALL_BT_SEARCH_FN

#define GEN_ZSTD_CALL_BT_SEARCH_FN (   dictMode,
  mls 
)
Value:
case mls: \
return ZSTD_BT_SEARCH_FN(dictMode, mls)(ms, ip, iend, offsetPtr);

Definition at line 27934 of file zstd.c.

◆ GEN_ZSTD_CALL_HC_SEARCH_FN

#define GEN_ZSTD_CALL_HC_SEARCH_FN (   dictMode,
  mls 
)
Value:
case mls: \
return ZSTD_HC_SEARCH_FN(dictMode, mls)(ms, ip, iend, offsetPtr);

Definition at line 27937 of file zstd.c.

◆ GEN_ZSTD_CALL_ROW_SEARCH_FN

#define GEN_ZSTD_CALL_ROW_SEARCH_FN (   dictMode,
  mls,
  rowLog 
)
Value:
case rowLog: \
return ZSTD_ROW_SEARCH_FN(dictMode, mls, rowLog)(ms, ip, iend, offsetPtr);

Definition at line 27940 of file zstd.c.

◆ GEN_ZSTD_HC_SEARCH_FN

#define GEN_ZSTD_HC_SEARCH_FN (   dictMode,
  mls 
)
Value:
ZSTD_SEARCH_FN_ATTRS size_t ZSTD_HC_SEARCH_FN(dictMode, mls)( \
ZSTD_matchState_t* ms, \
const BYTE* ip, const BYTE* const iLimit, \
size_t* offsetPtr) \
{ \
assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
return ZSTD_HcFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode); \
} \

Definition at line 27883 of file zstd.c.

◆ GEN_ZSTD_ROW_SEARCH_FN

#define GEN_ZSTD_ROW_SEARCH_FN (   dictMode,
  mls,
  rowLog 
)
Value:
ZSTD_SEARCH_FN_ATTRS size_t ZSTD_ROW_SEARCH_FN(dictMode, mls, rowLog)( \
ZSTD_matchState_t* ms, \
const BYTE* ip, const BYTE* const iLimit, \
size_t* offsetPtr) \
{ \
assert(MAX(4, MIN(6, ms->cParams.minMatch)) == mls); \
assert(MAX(4, MIN(6, ms->cParams.searchLog)) == rowLog); \
return ZSTD_RowFindBestMatch(ms, ip, iLimit, offsetPtr, mls, ZSTD_##dictMode, rowLog); \
} \

Definition at line 27893 of file zstd.c.

◆ GETIDX

#define GETIDX (   a)    ((0 <= (a)) ? (a) : (~(a)))

◆ HASH_READ_SIZE

#define HASH_READ_SIZE   8

Definition at line 14406 of file zstd.c.

◆ HBUFFSIZE

#define HBUFFSIZE   256 /* should prove large enough for all entropy headers */

◆ HINT_INLINE

#define HINT_INLINE   static INLINE_KEYWORD FORCE_INLINE_ATTR

HINT_INLINE is used to help the compiler generate better code. It is not used for "templates", so it can be tweaked based on the compilers performance.

gcc-4.8 and gcc-4.9 have been shown to benefit from leaving off the always_inline attribute.

clang up to 5.0.0 (trunk) benefit tremendously from the always_inline attribute.

Definition at line 575 of file zstd.c.

◆ HIST_WKSP_SIZE

#define HIST_WKSP_SIZE   (HIST_WKSP_SIZE_U32 * sizeof(unsigned))

Definition at line 11223 of file zstd.c.

◆ HIST_WKSP_SIZE_U32

#define HIST_WKSP_SIZE_U32   1024

Definition at line 11222 of file zstd.c.

◆ HUF_ALIGN

#define HUF_ALIGN (   x,
 
)    HUF_ALIGN_MASK((x), (a) - 1)

Definition at line 32946 of file zstd.c.

◆ HUF_ALIGN_MASK

#define HUF_ALIGN_MASK (   x,
  mask 
)    (((x) + (mask)) & ~(mask))

Definition at line 32947 of file zstd.c.

◆ HUF_ASM_DECL

#define HUF_ASM_DECL   HUF_EXTERN_C

Definition at line 32929 of file zstd.c.

◆ HUF_BITS_IN_CONTAINER

#define HUF_BITS_IN_CONTAINER   (sizeof(size_t) * 8)

HUF_CStream_t: Huffman uses its own BIT_CStream_t implementation. There are three major differences from BIT_CStream_t:

  1. HUF_addBits() takes a HUF_CElt (size_t) which is the pair (nbBits, value) in the format: format:
    • Bits [0, 4) = nbBits
    • Bits [4, 64 - nbBits) = 0
    • Bits [64 - nbBits, 64) = value
  2. The bitContainer is built from the upper bits and right shifted. E.g. to add a new value of N bits you right shift the bitContainer by N, then or in the new value into the N upper bits.
  3. The bitstream has two bit containers. You can add bits to the second container and merge them into the first container.

Definition at line 12856 of file zstd.c.

◆ HUF_BLOCKBOUND

#define HUF_BLOCKBOUND (   size)    (size + (size>>8) + 8) /* only true when incompressible is pre-filtered with fast heuristic */

Definition at line 2889 of file zstd.c.

◆ HUF_BLOCKSIZE_MAX

#define HUF_BLOCKSIZE_MAX   (128 * 1024)

maximum input size for a single block compressed with HUF_compress

Definition at line 2862 of file zstd.c.

◆ HUF_COMPRESSBOUND

#define HUF_COMPRESSBOUND (   size)    (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size)) /* Macro version, useful for static allocation */

Definition at line 2890 of file zstd.c.

◆ HUF_CREATE_STATIC_CTABLE

#define HUF_CREATE_STATIC_CTABLE (   name,
  maxSymbolValue 
)    HUF_CElt name[HUF_CTABLE_SIZE_ST(maxSymbolValue)] /* no final ; */

Definition at line 2897 of file zstd.c.

◆ HUF_CREATE_STATIC_DTABLEX1

#define HUF_CREATE_STATIC_DTABLEX1 (   DTable,
  maxTableLog 
)    HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) }

Definition at line 2903 of file zstd.c.

◆ HUF_CREATE_STATIC_DTABLEX2

#define HUF_CREATE_STATIC_DTABLEX2 (   DTable,
  maxTableLog 
)    HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) }

Definition at line 2905 of file zstd.c.

◆ HUF_CTABLE_SIZE

#define HUF_CTABLE_SIZE (   maxSymbolValue)    (HUF_CTABLE_SIZE_ST(maxSymbolValue) * sizeof(size_t))

Definition at line 2896 of file zstd.c.

◆ HUF_CTABLE_SIZE_ST

#define HUF_CTABLE_SIZE_ST (   maxSymbolValue)    ((maxSymbolValue)+2) /* Use tables of size_t, for proper alignment */

Definition at line 2895 of file zstd.c.

◆ HUF_CTABLE_WORKSPACE_SIZE

#define HUF_CTABLE_WORKSPACE_SIZE   (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned))

Definition at line 2999 of file zstd.c.

◆ HUF_CTABLE_WORKSPACE_SIZE_U32

#define HUF_CTABLE_WORKSPACE_SIZE_U32   ((4 * (HUF_SYMBOLVALUE_MAX + 1)) + 192)

HUF_buildCTable_wksp() : Same as HUF_buildCTable(), but using externally allocated scratch buffer. workSpace must be aligned on 4-bytes boundaries, and its size must be >= HUF_CTABLE_WORKSPACE_SIZE.

Definition at line 2998 of file zstd.c.

◆ HUF_CTABLEBOUND

#define HUF_CTABLEBOUND   129

Definition at line 2888 of file zstd.c.

◆ HUF_DECODE_SYMBOLX1_0

#define HUF_DECODE_SYMBOLX1_0 (   ptr,
  DStreamPtr 
)    *ptr++ = HUF_decodeSymbolX1(DStreamPtr, dt, dtLog)

Definition at line 33370 of file zstd.c.

◆ HUF_DECODE_SYMBOLX1_1

#define HUF_DECODE_SYMBOLX1_1 (   ptr,
  DStreamPtr 
)
Value:
if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr)

Definition at line 33373 of file zstd.c.

◆ HUF_DECODE_SYMBOLX1_2

#define HUF_DECODE_SYMBOLX1_2 (   ptr,
  DStreamPtr 
)
Value:
if (MEM_64bits()) \
HUF_DECODE_SYMBOLX1_0(ptr, DStreamPtr)

Definition at line 33377 of file zstd.c.

◆ HUF_DECODE_SYMBOLX2_0

#define HUF_DECODE_SYMBOLX2_0 (   ptr,
  DStreamPtr 
)    ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)

Definition at line 34109 of file zstd.c.

◆ HUF_DECODE_SYMBOLX2_1

#define HUF_DECODE_SYMBOLX2_1 (   ptr,
  DStreamPtr 
)
Value:
if (MEM_64bits() || (HUF_TABLELOG_MAX<=12)) \
ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)

Definition at line 34112 of file zstd.c.

◆ HUF_DECODE_SYMBOLX2_2

#define HUF_DECODE_SYMBOLX2_2 (   ptr,
  DStreamPtr 
)
Value:
if (MEM_64bits()) \
ptr += HUF_decodeSymbolX2(ptr, DStreamPtr, dt, dtLog)

Definition at line 34116 of file zstd.c.

◆ HUF_DECODER_FAST_TABLELOG

#define HUF_DECODER_FAST_TABLELOG   11

Definition at line 32899 of file zstd.c.

◆ HUF_DECOMPRESS_WORKSPACE_SIZE

#define HUF_DECOMPRESS_WORKSPACE_SIZE   ((2 << 10) + (1 << 9))

The minimum workspace size for the workSpace used in HUF_readDTableX1_wksp() and HUF_readDTableX2_wksp().

The space used depends on HUF_TABLELOG_MAX, ranging from ~1500 bytes when HUF_TABLE_LOG_MAX=12 to ~1850 bytes when HUF_TABLE_LOG_MAX=15. Buffer overflow errors may potentially occur if code modifications result in a required workspace size greater than that specified in the following macro.

Definition at line 3059 of file zstd.c.

◆ HUF_DECOMPRESS_WORKSPACE_SIZE_U32

#define HUF_DECOMPRESS_WORKSPACE_SIZE_U32   (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32))

Definition at line 3060 of file zstd.c.

◆ HUF_DGEN

#define HUF_DGEN (   fn)
Value:
static size_t fn(void* dst, size_t dstSize, void const* cSrc, \
size_t cSrcSize, HUF_DTable const* DTable, int flags) \
{ \
(void)flags; \
return fn##_body(dst, dstSize, cSrc, cSrcSize, DTable); \
}

Definition at line 32989 of file zstd.c.

◆ HUF_DTABLE_SIZE

#define HUF_DTABLE_SIZE (   maxTableLog)    (1 + (1<<(maxTableLog)))

Definition at line 2902 of file zstd.c.

◆ HUF_EXTERN_C

#define HUF_EXTERN_C

Definition at line 32927 of file zstd.c.

◆ HUF_FAST_BMI2_ATTRS

#define HUF_FAST_BMI2_ATTRS

Definition at line 32921 of file zstd.c.

◆ HUF_H_298734234

#define HUF_H_298734234

Definition at line 2852 of file zstd.c.

◆ HUF_isError [1/3]

#define HUF_isError   ERR_isError

Definition at line 32940 of file zstd.c.

◆ HUF_isError [2/3]

#define HUF_isError   ERR_isError

Definition at line 32940 of file zstd.c.

◆ HUF_isError [3/3]

#define HUF_isError   ERR_isError

Definition at line 32940 of file zstd.c.

◆ HUF_NEED_BMI2_FUNCTION

#define HUF_NEED_BMI2_FUNCTION   0

Definition at line 32934 of file zstd.c.

◆ HUF_OPTIMAL_DEPTH_THRESHOLD

#define HUF_OPTIMAL_DEPTH_THRESHOLD   ZSTD_btultra

Definition at line 2954 of file zstd.c.

◆ HUF_READ_STATS_WORKSPACE_SIZE

#define HUF_READ_STATS_WORKSPACE_SIZE   (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned))

Definition at line 3019 of file zstd.c.

◆ HUF_READ_STATS_WORKSPACE_SIZE_U32

#define HUF_READ_STATS_WORKSPACE_SIZE_U32   FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1)

HUF_readStats_wksp() : Same as HUF_readStats() but takes an external workspace which must be 4-byte aligned and its size must be >= HUF_READ_STATS_WORKSPACE_SIZE. If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0.

Definition at line 3018 of file zstd.c.

◆ HUF_STATIC_ASSERT

#define HUF_STATIC_ASSERT (   c)    DEBUG_STATIC_ASSERT(c) /* use only *after* variable declarations */

Definition at line 12089 of file zstd.c.

◆ HUF_SYMBOLVALUE_MAX

#define HUF_SYMBOLVALUE_MAX   255

Definition at line 2876 of file zstd.c.

◆ HUF_TABLELOG_ABSOLUTEMAX

#define HUF_TABLELOG_ABSOLUTEMAX   12 /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */

Definition at line 2878 of file zstd.c.

◆ HUF_TABLELOG_DEFAULT

#define HUF_TABLELOG_DEFAULT   11 /* default tableLog value when none specified */

Definition at line 2875 of file zstd.c.

◆ HUF_TABLELOG_MAX

#define HUF_TABLELOG_MAX   12 /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */

Definition at line 2874 of file zstd.c.

◆ HUF_WORKSPACE_MAX_ALIGNMENT

#define HUF_WORKSPACE_MAX_ALIGNMENT   8

Definition at line 12158 of file zstd.c.

◆ HUF_WORKSPACE_SIZE

#define HUF_WORKSPACE_SIZE   ((8 << 10) + 512 /* sorting scratch space */)

Definition at line 2870 of file zstd.c.

◆ HUF_WORKSPACE_SIZE_U64

#define HUF_WORKSPACE_SIZE_U64   (HUF_WORKSPACE_SIZE / sizeof(U64))

Definition at line 2871 of file zstd.c.

◆ INLINE

#define INLINE   __inline

Definition at line 41915 of file zstd.c.

◆ INLINE_KEYWORD

#define INLINE_KEYWORD

Definition at line 526 of file zstd.c.

◆ JOB_ERROR

#define JOB_ERROR (   e)
Value:
{ \
ZSTD_PTHREAD_MUTEX_LOCK(&job->job_mutex); \
job->cSize = e; \
ZSTD_pthread_mutex_unlock(&job->job_mutex); \
goto _endJob; \
}

Definition at line 31657 of file zstd.c.

◆ KB [1/2]

#define KB   *(1 <<10)

Definition at line 44610 of file zstd.c.

◆ KB [2/2]

#define KB   *(1 <<10)

Definition at line 44610 of file zstd.c.

◆ kLazySkippingStep

#define kLazySkippingStep   8

Definition at line 26545 of file zstd.c.

◆ kSearchStrength

#define kSearchStrength   8

Definition at line 14405 of file zstd.c.

◆ LDM_BATCH_SIZE

#define LDM_BATCH_SIZE   64

Definition at line 14643 of file zstd.c.

◆ LDM_BUCKET_SIZE_LOG

#define LDM_BUCKET_SIZE_LOG   3

Definition at line 28815 of file zstd.c.

◆ LDM_HASH_RLOG

#define LDM_HASH_RLOG   7

Definition at line 28817 of file zstd.c.

◆ LDM_MIN_MATCH_LENGTH

#define LDM_MIN_MATCH_LENGTH   64

Definition at line 28816 of file zstd.c.

◆ LIKELY

#define LIKELY (   x)    (x)

Definition at line 665 of file zstd.c.

◆ Litbits

#define Litbits   8

Definition at line 10841 of file zstd.c.

◆ LitHufLog

#define LitHufLog   11

Definition at line 10842 of file zstd.c.

◆ LL_DEFAULTNORMLOG

#define LL_DEFAULTNORMLOG   6 /* for static allocation */

Definition at line 10874 of file zstd.c.

◆ LLFSELog

#define LLFSELog   9

Definition at line 10850 of file zstd.c.

◆ LLIMIT

#define LLIMIT   64 /* heuristic determined experimentally */

Definition at line 44715 of file zstd.c.

◆ LOCALDISPLAYLEVEL [1/2]

#define LOCALDISPLAYLEVEL (   displayLevel,
  l,
  ... 
)
Value:
if (displayLevel >= l) { \
DISPLAY(__VA_ARGS__); \
} /* 0 : no display; 1: errors; 2: default; 3: details; 4: debug */

Definition at line 43843 of file zstd.c.

◆ LOCALDISPLAYLEVEL [2/2]

#define LOCALDISPLAYLEVEL (   displayLevel,
  l,
  ... 
)
Value:
if (displayLevel >= l) { \
DISPLAY(__VA_ARGS__); \
} /* 0 : no display; 1: errors; 2: default; 3: details; 4: debug */

Definition at line 43843 of file zstd.c.

◆ LOCALDISPLAYUPDATE [1/2]

#define LOCALDISPLAYUPDATE (   displayLevel,
  l,
  ... 
)
Value:
if (displayLevel >= l) { \
if ((clock() - g_time > g_refreshRate) || (displayLevel >= 4)) { \
g_time = clock(); \
DISPLAY(__VA_ARGS__); \
} \
}

Definition at line 43855 of file zstd.c.

◆ LOCALDISPLAYUPDATE [2/2]

#define LOCALDISPLAYUPDATE (   displayLevel,
  l,
  ... 
)
Value:
if (displayLevel >= l) { \
if ((clock() - g_time > g_refreshRate) || (displayLevel >= 4)) { \
g_time = clock(); \
DISPLAY(__VA_ARGS__); \
} \
}

Definition at line 43855 of file zstd.c.

◆ LONG_OFFSETS_MAX_EXTRA_BITS_32

#define LONG_OFFSETS_MAX_EXTRA_BITS_32
Value:
(ZSTD_WINDOWLOG_MAX_32 > STREAM_ACCUMULATOR_MIN_32 \
? ZSTD_WINDOWLOG_MAX_32 - STREAM_ACCUMULATOR_MIN_32 \
: 0)

Definition at line 38886 of file zstd.c.

◆ LONGNBSEQ

#define LONGNBSEQ   0x7F00

Definition at line 10837 of file zstd.c.

◆ MAP_EMPTY_VALUE

#define MAP_EMPTY_VALUE   ((U32)-1)

Definition at line 40636 of file zstd.c.

◆ MAX

#define MAX (   a,
 
)    ((a)>(b) ? (a) : (b))

Definition at line 10796 of file zstd.c.

◆ MAX_FSE_TABLELOG_FOR_HUFF_HEADER

#define MAX_FSE_TABLELOG_FOR_HUFF_HEADER   6

Definition at line 12185 of file zstd.c.

◆ MaxFSELog

#define MaxFSELog   MAX(MAX(MLFSELog, LLFSELog), OffFSELog)

Definition at line 10852 of file zstd.c.

◆ MaxLit

#define MaxLit   ((1<<Litbits) - 1)

Definition at line 10843 of file zstd.c.

◆ MaxLL

#define MaxLL   35

Definition at line 10845 of file zstd.c.

◆ MaxLLBits

#define MaxLLBits   16

Definition at line 10854 of file zstd.c.

◆ MaxML

#define MaxML   52

Definition at line 10844 of file zstd.c.

◆ MaxMLBits

#define MaxMLBits   16

Definition at line 10853 of file zstd.c.

◆ MaxOff

#define MaxOff   31

Definition at line 10847 of file zstd.c.

◆ MAXREPOFFSET

#define MAXREPOFFSET   1024

Definition at line 45106 of file zstd.c.

◆ MaxSeq

#define MaxSeq   MAX(MaxLL, MaxML) /* Assumption : MaxOff < MaxLL,MaxML */

Definition at line 10848 of file zstd.c.

◆ MB [1/2]

#define MB   *(1 <<20)

Definition at line 44611 of file zstd.c.

◆ MB [2/2]

#define MB   *(1 <<20)

Definition at line 44611 of file zstd.c.

◆ MEM_H_MODULE

#define MEM_H_MODULE

Definition at line 334 of file zstd.c.

◆ MEM_MODULE

#define MEM_MODULE

Definition at line 38 of file zstd.c.

◆ MEM_STATIC

#define MEM_STATIC   static /* this version may generate warnings for unused static functions; disable the relevant warning */

Definition at line 879 of file zstd.c.

◆ MERGE_CHECK

#define MERGE_CHECK (   a,
  b,
 
)
Value:
do {\
if(((c) & 1) ||\
(((c) & 2) && (ss_compare(T, PA + GETIDX(*((a) - 1)), PA + *(a), depth) == 0))) {\
*(a) = ~*(a);\
}\
if(((c) & 4) && ((ss_compare(T, PA + GETIDX(*((b) - 1)), PA + *(b), depth) == 0))) {\
*(b) = ~*(b);\
}\
} while(0)

◆ MIN

#define MIN (   a,
 
)    ((a)<(b) ? (a) : (b))

Definition at line 10795 of file zstd.c.

◆ MIN_CBLOCK_SIZE

#define MIN_CBLOCK_SIZE   (1 /*litCSize*/ + 1 /* RLE or RAW */) /* for a non-null block */

Definition at line 10832 of file zstd.c.

◆ MIN_LITERALS_FOR_4_STREAMS

#define MIN_LITERALS_FOR_4_STREAMS   6

Definition at line 10833 of file zstd.c.

◆ MIN_SEQUENCES_BLOCK_SPLITTING

#define MIN_SEQUENCES_BLOCK_SPLITTING   300

Definition at line 21658 of file zstd.c.

◆ MIN_SEQUENCES_SIZE

#define MIN_SEQUENCES_SIZE   1 /* nbSeq==0 */

Definition at line 10831 of file zstd.c.

◆ MINMATCH

#define MINMATCH   3

Definition at line 10839 of file zstd.c.

◆ MINMATCHLENGTH

#define MINMATCHLENGTH   7 /* heuristic determined experimentally */

Definition at line 44716 of file zstd.c.

◆ MINRATIO

#define MINRATIO   4 /* minimum nb of apparition to be selected in dictionary */

Definition at line 44563 of file zstd.c.

◆ ML_DEFAULTNORMLOG

#define ML_DEFAULTNORMLOG   6 /* for static allocation */

Definition at line 10895 of file zstd.c.

◆ MLFSELog

#define MLFSELog   9

Definition at line 10849 of file zstd.c.

◆ NEXT_IN_CHAIN

#define NEXT_IN_CHAIN (   d,
  mask 
)    chainTable[(d) & (mask)]

Definition at line 27146 of file zstd.c.

◆ NOISELENGTH

#define NOISELENGTH   32

Definition at line 44616 of file zstd.c.

◆ OF_DEFAULTNORMLOG

#define OF_DEFAULTNORMLOG   5 /* for static allocation */

Definition at line 10904 of file zstd.c.

◆ OFFBASE_IS_OFFSET

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

Definition at line 15006 of file zstd.c.

◆ OFFBASE_IS_REPCODE

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

Definition at line 15007 of file zstd.c.

◆ OFFBASE_TO_OFFSET

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

Definition at line 15008 of file zstd.c.

◆ OFFBASE_TO_REPCODE

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

Definition at line 15009 of file zstd.c.

◆ OFFCODE_MAX

#define OFFCODE_MAX   30 /* only applicable to first block */

Definition at line 45200 of file zstd.c.

◆ OffFSELog

#define OffFSELog   8

Definition at line 10851 of file zstd.c.

◆ OFFSET_TO_OFFBASE

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

Definition at line 15005 of file zstd.c.

◆ POOL_H

#define POOL_H

Definition at line 4218 of file zstd.c.

◆ PREFETCH_AREA

#define PREFETCH_AREA (   p,
  s 
)
Value:
{ \
const char* const _ptr = (const char*)(p); \
size_t const _size = (size_t)(s); \
size_t _pos; \
for (_pos=0; _pos<_size; _pos+=CACHELINE_SIZE) { \
PREFETCH_L2(_ptr + _pos); \
} \
}

Definition at line 634 of file zstd.c.

◆ PREFETCH_L1

#define PREFETCH_L1 (   ptr)    (void)(ptr) /* disabled */

Definition at line 627 of file zstd.c.

◆ PREFETCH_L2

#define PREFETCH_L2 (   ptr)    (void)(ptr) /* disabled */

Definition at line 628 of file zstd.c.

◆ PREFIX

#define PREFIX (   name)    ZSTD_error_##name

Definition at line 1438 of file zstd.c.

◆ RANK_POSITION_DISTINCT_COUNT_CUTOFF

#define RANK_POSITION_DISTINCT_COUNT_CUTOFF   (RANK_POSITION_LOG_BUCKETS_BEGIN + ZSTD_highbit32(RANK_POSITION_LOG_BUCKETS_BEGIN) /* == 166 */)

Definition at line 12548 of file zstd.c.

◆ RANK_POSITION_LOG_BUCKETS_BEGIN

#define RANK_POSITION_LOG_BUCKETS_BEGIN   ((RANK_POSITION_TABLE_SIZE - 1) - RANK_POSITION_MAX_COUNT_LOG - 1 /* == 158 */)

Definition at line 12547 of file zstd.c.

◆ RANK_POSITION_MAX_COUNT_LOG

#define RANK_POSITION_MAX_COUNT_LOG   32

Definition at line 12546 of file zstd.c.

◆ RANK_POSITION_TABLE_SIZE

#define RANK_POSITION_TABLE_SIZE   192

Definition at line 12531 of file zstd.c.

◆ RAWLOG

#define RAWLOG (   l,
  ... 
)    {} /* disabled */

Definition at line 290 of file zstd.c.

◆ REPCODE1_TO_OFFBASE

#define REPCODE1_TO_OFFBASE   REPCODE_TO_OFFBASE(1)

Definition at line 15001 of file zstd.c.

◆ REPCODE2_TO_OFFBASE

#define REPCODE2_TO_OFFBASE   REPCODE_TO_OFFBASE(2)

Definition at line 15002 of file zstd.c.

◆ REPCODE3_TO_OFFBASE

#define REPCODE3_TO_OFFBASE   REPCODE_TO_OFFBASE(3)

Definition at line 15003 of file zstd.c.

◆ 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 15004 of file zstd.c.

◆ RETURN_ERROR

#define RETURN_ERROR (   err,
  ... 
)
Value:
do { \
RAWLOG(3, "%s:%d: ERROR!: unconditional check failed, returning %s", \
__FILE__, __LINE__, ERR_QUOTE(ERROR(err))); \
_FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \
RAWLOG(3, ": " __VA_ARGS__); \
RAWLOG(3, "\n"); \
return ERROR(err); \
} while(0);

Unconditionally return the specified error.

In debug modes, prints additional information.

Definition at line 1517 of file zstd.c.

◆ RETURN_ERROR_IF

#define RETURN_ERROR_IF (   cond,
  err,
  ... 
)
Value:
if (cond) { \
RAWLOG(3, "%s:%d: ERROR!: check %s failed, returning %s", \
__FILE__, __LINE__, ERR_QUOTE(cond), ERR_QUOTE(ERROR(err))); \
_FORCE_HAS_FORMAT_STRING(__VA_ARGS__); \
RAWLOG(3, ": " __VA_ARGS__); \
RAWLOG(3, "\n"); \
return ERROR(err); \
}

Return the specified error if the condition evaluates to true.

In debug modes, prints additional information. In order to do that (particularly, printing the conditional that failed), this can't just wrap RETURN_ERROR().

Definition at line 1502 of file zstd.c.

◆ RSYNC_LENGTH

#define RSYNC_LENGTH   32

Definition at line 31815 of file zstd.c.

◆ RSYNC_MIN_BLOCK_LOG

#define RSYNC_MIN_BLOCK_LOG   ZSTD_BLOCKSIZELOG_MAX

Definition at line 31823 of file zstd.c.

◆ RSYNC_MIN_BLOCK_SIZE

#define RSYNC_MIN_BLOCK_SIZE   (1<<RSYNC_MIN_BLOCK_LOG)

Definition at line 31824 of file zstd.c.

◆ SEQ_POOL_MAX_NB_BUFFERS

#define SEQ_POOL_MAX_NB_BUFFERS (   nbWorkers)    (nbWorkers)

Definition at line 31271 of file zstd.c.

◆ SEQSYMBOL_TABLE_SIZE

#define SEQSYMBOL_TABLE_SIZE (   log)    (1 + (1 << (log)))

Definition at line 34850 of file zstd.c.

◆ SS_BLOCKSIZE

#define SS_BLOCKSIZE   (1024)

Definition at line 41942 of file zstd.c.

◆ SS_INSERTIONSORT_THRESHOLD

#define SS_INSERTIONSORT_THRESHOLD   (8)

Definition at line 41931 of file zstd.c.

◆ SS_MISORT_STACKSIZE

#define SS_MISORT_STACKSIZE   (16)

Definition at line 41948 of file zstd.c.

◆ SS_SMERGE_STACKSIZE

#define SS_SMERGE_STACKSIZE   (32)

Definition at line 41952 of file zstd.c.

◆ STACK_POP

#define STACK_POP (   _a,
  _b,
  _c,
  _d 
)
Value:
do {\
assert(0 <= ssize);\
if(ssize == 0) { return; }\
(_a) = stack[--ssize].a, (_b) = stack[ssize].b,\
(_c) = stack[ssize].c, (_d) = stack[ssize].d;\
} while(0)

Definition at line 41979 of file zstd.c.

◆ STACK_POP5

#define STACK_POP5 (   _a,
  _b,
  _c,
  _d,
  _e 
)
Value:
do {\
assert(0 <= ssize);\
if(ssize == 0) { return; }\
(_a) = stack[--ssize].a, (_b) = stack[ssize].b,\
(_c) = stack[ssize].c, (_d) = stack[ssize].d, (_e) = stack[ssize].e;\
} while(0)

Definition at line 41986 of file zstd.c.

◆ STACK_PUSH

#define STACK_PUSH (   _a,
  _b,
  _c,
  _d 
)
Value:
do {\
assert(ssize < STACK_SIZE);\
stack[ssize].a = (_a), stack[ssize].b = (_b),\
stack[ssize].c = (_c), stack[ssize++].d = (_d);\
} while(0)

Definition at line 41967 of file zstd.c.

◆ STACK_PUSH5

#define STACK_PUSH5 (   _a,
  _b,
  _c,
  _d,
  _e 
)
Value:
do {\
assert(ssize < STACK_SIZE);\
stack[ssize].a = (_a), stack[ssize].b = (_b),\
stack[ssize].c = (_c), stack[ssize].d = (_d), stack[ssize++].e = (_e);\
} while(0)

Definition at line 41973 of file zstd.c.

◆ STACK_SIZE [1/2]

#define STACK_SIZE   SS_SMERGE_STACKSIZE

◆ STACK_SIZE [2/2]

#define STACK_SIZE   TR_STACKSIZE

◆ STARTNODE

#define STARTNODE   (HUF_SYMBOLVALUE_MAX+1)

HUF_buildCTable_wksp() : Same as HUF_buildCTable(), but using externally allocated scratch buffer. workSpace must be aligned on 4-bytes boundaries, and be at least as large as sizeof(HUF_buildCTable_wksp_tables).

Definition at line 12695 of file zstd.c.

◆ STATIC_BMI2

#define STATIC_BMI2   0

Definition at line 697 of file zstd.c.

◆ STORED_SEQS

#define STORED_SEQS   8

◆ STORED_SEQS_MASK

#define STORED_SEQS_MASK   (STORED_SEQS-1)

◆ STREAM_ACCUMULATOR_MIN

#define STREAM_ACCUMULATOR_MIN   ((U32)(MEM_32bits() ? STREAM_ACCUMULATOR_MIN_32 : STREAM_ACCUMULATOR_MIN_64))

Definition at line 2038 of file zstd.c.

◆ STREAM_ACCUMULATOR_MIN_32

#define STREAM_ACCUMULATOR_MIN_32   25

Definition at line 2036 of file zstd.c.

◆ STREAM_ACCUMULATOR_MIN_64

#define STREAM_ACCUMULATOR_MIN_64   57

Definition at line 2037 of file zstd.c.

◆ SUSPECT_INCOMPRESSIBLE_SAMPLE_RATIO

#define SUSPECT_INCOMPRESSIBLE_SAMPLE_RATIO   10 /* Must be >= 2 */

Definition at line 13267 of file zstd.c.

◆ SUSPECT_INCOMPRESSIBLE_SAMPLE_SIZE

#define SUSPECT_INCOMPRESSIBLE_SAMPLE_SIZE   4096

Definition at line 13266 of file zstd.c.

◆ SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO

#define SUSPECT_UNCOMPRESSIBLE_LITERAL_RATIO   20

Definition at line 20468 of file zstd.c.

◆ SWAP

#define SWAP (   _a,
  _b 
)    do { t = (_a); (_a) = (_b); (_b) = t; } while(0)

Definition at line 41959 of file zstd.c.

◆ TARGET_ATTRIBUTE

#define TARGET_ATTRIBUTE (   target)

Definition at line 601 of file zstd.c.

◆ THREADING_H_938743

#define THREADING_H_938743

Copyright (c) 2016 Tino Reichardt All rights reserved.

You can contact the author at:

This source code is licensed under both the BSD-style license (found in the LICENSE file in the root directory of this source tree) and the GPLv2 (found in the COPYING file in the root directory of this source tree). You may select, at your option, one of the above-listed licenses. This file will hold wrapper for systems, which do not support pthreads Copyright (c) 2016 Tino Reichardt All rights reserved.

You can contact the author at:

This source code is licensed under both the BSD-style license (found in the LICENSE file in the root directory of this source tree) and the GPLv2 (found in the COPYING file in the root directory of this source tree). You may select, at your option, one of the above-listed licenses.

Definition at line 3837 of file zstd.c.

◆ TR_INSERTIONSORT_THRESHOLD

#define TR_INSERTIONSORT_THRESHOLD   (8)

Definition at line 41953 of file zstd.c.

◆ TR_STACKSIZE

#define TR_STACKSIZE   (64)

Definition at line 41954 of file zstd.c.

◆ UNLIKELY

#define UNLIKELY (   x)    (x)

Definition at line 666 of file zstd.c.

◆ UNUSED_ATTR

#define UNUSED_ATTR

Definition at line 582 of file zstd.c.

◆ WEIGHT

#define WEIGHT (   stat,
  opt 
)    ((opt) ? ZSTD_fracWeight(stat) : ZSTD_bitWeight(stat))

Definition at line 29559 of file zstd.c.

◆ WILDCOPY_OVERLENGTH

#define WILDCOPY_OVERLENGTH   32

Definition at line 10940 of file zstd.c.

◆ WILDCOPY_VECLEN

#define WILDCOPY_VECLEN   16

Definition at line 10941 of file zstd.c.

◆ WIN_CDECL

#define WIN_CDECL

On MSVC qsort requires that functions passed into it use the __cdecl calling conversion(CC). This explicitly marks such functions as __cdecl so that the code will still compile if a CC other than __cdecl has been made the default.

Definition at line 552 of file zstd.c.

◆ X

#define X (   name,
  r,
  bit 
)
Value:
MEM_STATIC int ZSTD_cpuid_##name(ZSTD_cpuid_t const cpuid) { \
return ((cpuid.r) & (1U << bit)) != 0; \
}

Definition at line 4805 of file zstd.c.

◆ XXH128

#define XXH128   XXH_NAME2(XXH_NAMESPACE, XXH128)

◆ XXH128_canonical_t

#define XXH128_canonical_t   XXH_IPREF(XXH128_canonical_t)

◆ XXH128_canonicalFromHash

#define XXH128_canonicalFromHash   XXH_NAME2(XXH_NAMESPACE, XXH128_canonicalFromHash)

◆ XXH128_cmp

#define XXH128_cmp   XXH_NAME2(XXH_NAMESPACE, XXH128_cmp)

◆ XXH128_hash_t

#define XXH128_hash_t   XXH_IPREF(XXH128_hash_t)

◆ XXH128_hashFromCanonical

#define XXH128_hashFromCanonical   XXH_NAME2(XXH_NAMESPACE, XXH128_hashFromCanonical)

◆ XXH128_isEqual

#define XXH128_isEqual   XXH_NAME2(XXH_NAMESPACE, XXH128_isEqual)

◆ XXH32

#define XXH32   XXH_NAME2(XXH_NAMESPACE, XXH32)

◆ XXH32_canonical_t

◆ XXH32_canonicalFromHash

#define XXH32_canonicalFromHash   XXH_NAME2(XXH_NAMESPACE, XXH32_canonicalFromHash)

◆ XXH32_copyState

#define XXH32_copyState   XXH_NAME2(XXH_NAMESPACE, XXH32_copyState)

◆ XXH32_digest

#define XXH32_digest   XXH_NAME2(XXH_NAMESPACE, XXH32_digest)

◆ XXH32_ENDJMP

#define XXH32_ENDJMP   0

Definition at line 6360 of file zstd.c.

◆ XXH32_freeState

#define XXH32_freeState   XXH_NAME2(XXH_NAMESPACE, XXH32_freeState)

◆ XXH32_hashFromCanonical

#define XXH32_hashFromCanonical   XXH_NAME2(XXH_NAMESPACE, XXH32_hashFromCanonical)

◆ XXH32_reset

#define XXH32_reset   XXH_NAME2(XXH_NAMESPACE, XXH32_reset)

◆ XXH32_state_s

◆ XXH32_update

#define XXH32_update   XXH_NAME2(XXH_NAMESPACE, XXH32_update)

◆ XXH3_128bits

#define XXH3_128bits   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits)

◆ XXH3_128bits_digest

#define XXH3_128bits_digest   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_digest)

◆ XXH3_128bits_reset

#define XXH3_128bits_reset   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset)

◆ XXH3_128bits_reset_withSecret

#define XXH3_128bits_reset_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecret)

◆ XXH3_128bits_reset_withSecretandSeed

#define XXH3_128bits_reset_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSecretandSeed)

◆ XXH3_128bits_reset_withSeed

#define XXH3_128bits_reset_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_reset_withSeed)

◆ XXH3_128bits_update

#define XXH3_128bits_update   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_update)

◆ XXH3_128bits_withSecret

#define XXH3_128bits_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecret)

◆ XXH3_128bits_withSecretandSeed

#define XXH3_128bits_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSecretandSeed)

◆ XXH3_128bits_withSeed

#define XXH3_128bits_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_128bits_withSeed)

◆ XXH3_64bits

#define XXH3_64bits   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits)

◆ XXH3_64bits_digest

#define XXH3_64bits_digest   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_digest)

◆ XXH3_64bits_reset

#define XXH3_64bits_reset   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset)

◆ XXH3_64bits_reset_withSecret

#define XXH3_64bits_reset_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecret)

◆ XXH3_64bits_reset_withSecretandSeed

#define XXH3_64bits_reset_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSecretandSeed)

◆ XXH3_64bits_reset_withSeed

#define XXH3_64bits_reset_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_reset_withSeed)

◆ XXH3_64bits_update

#define XXH3_64bits_update   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_update)

◆ XXH3_64bits_withSecret

#define XXH3_64bits_withSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecret)

◆ XXH3_64bits_withSecretandSeed

#define XXH3_64bits_withSecretandSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSecretandSeed)

◆ XXH3_64bits_withSeed

#define XXH3_64bits_withSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_64bits_withSeed)

◆ XXH3_copyState

#define XXH3_copyState   XXH_NAME2(XXH_NAMESPACE, XXH3_copyState)

◆ XXH3_createState

#define XXH3_createState   XXH_NAME2(XXH_NAMESPACE, XXH3_createState)

◆ XXH3_freeState

#define XXH3_freeState   XXH_NAME2(XXH_NAMESPACE, XXH3_freeState)

◆ XXH3_generateSecret

#define XXH3_generateSecret   XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret)

◆ XXH3_generateSecret_fromSeed

#define XXH3_generateSecret_fromSeed   XXH_NAME2(XXH_NAMESPACE, XXH3_generateSecret_fromSeed)

◆ XXH3_state_s

#define XXH3_state_s   XXH_IPREF(XXH3_state_s)

◆ XXH3_state_t

#define XXH3_state_t   XXH_IPREF(XXH3_state_t)

◆ XXH64

#define XXH64   XXH_NAME2(XXH_NAMESPACE, XXH64)

◆ XXH64_canonical_t

◆ XXH64_canonicalFromHash

#define XXH64_canonicalFromHash   XXH_NAME2(XXH_NAMESPACE, XXH64_canonicalFromHash)

◆ XXH64_copyState

#define XXH64_copyState   XXH_NAME2(XXH_NAMESPACE, XXH64_copyState)

◆ XXH64_digest

#define XXH64_digest   XXH_NAME2(XXH_NAMESPACE, XXH64_digest)

◆ XXH64_freeState

#define XXH64_freeState   XXH_NAME2(XXH_NAMESPACE, XXH64_freeState)

◆ XXH64_hashFromCanonical

#define XXH64_hashFromCanonical   XXH_NAME2(XXH_NAMESPACE, XXH64_hashFromCanonical)

◆ XXH64_reset

#define XXH64_reset   XXH_NAME2(XXH_NAMESPACE, XXH64_reset)

◆ XXH64_state_s

◆ XXH64_state_t

◆ XXH64_update

#define XXH64_update   XXH_NAME2(XXH_NAMESPACE, XXH64_update)

◆ XXH_CAT

#define XXH_CAT (   A,
  B 
)    A##B

◆ XXH_ERROR

#define XXH_ERROR   XXH_IPREF(XXH_ERROR)

◆ XXH_errorcode

◆ XXH_FORCE_ALIGN_CHECK

#define XXH_FORCE_ALIGN_CHECK   1

Definition at line 6345 of file zstd.c.

◆ XXH_IMPLEM_13a8737387

#define XXH_IMPLEM_13a8737387

Definition at line 6172 of file zstd.c.

◆ XXH_IMPLEMENTATION

#define XXH_IMPLEMENTATION

Definition at line 6137 of file zstd.c.

◆ XXH_INLINE_ALL

#define XXH_INLINE_ALL

Definition at line 44 of file zstd.c.

◆ XXH_INLINE_ALL_31684351384

#define XXH_INLINE_ALL_31684351384

◆ XXH_IPREF

#define XXH_IPREF (   Id)    XXH_NAMESPACE ## Id

◆ XXH_NAME2

#define XXH_NAME2 (   A,
  B 
)    XXH_CAT(A,B)

◆ XXH_NAMESPACE [1/2]

#define XXH_NAMESPACE   ZSTD_

Definition at line 40 of file zstd.c.

◆ XXH_NAMESPACE [2/2]

#define XXH_NAMESPACE   XXH_INLINE_

Definition at line 40 of file zstd.c.

◆ XXH_NO_INLINE_HINTS

#define XXH_NO_INLINE_HINTS   0

Definition at line 6354 of file zstd.c.

◆ XXH_NO_XXH3

#define XXH_NO_XXH3

◆ XXH_OK

#define XXH_OK   XXH_IPREF(XXH_OK)

◆ XXH_PRIVATE_API

#define XXH_PRIVATE_API

Definition at line 42 of file zstd.c.

◆ XXH_PROCESS1

#define XXH_PROCESS1
Value:
do { \
h32 += (*ptr++) * XXH_PRIME32_5; \
h32 = XXH_rotl32(h32, 11) * XXH_PRIME32_1; \
} while (0)

◆ XXH_PROCESS4

#define XXH_PROCESS4
Value:
do { \
ptr += 4; \
h32 = XXH_rotl32(h32, 17) * XXH_PRIME32_4; \
} while (0)

◆ XXH_PUBLIC_API

#define XXH_PUBLIC_API   static

◆ XXH_STATIC_LINKING_ONLY [1/2]

#define XXH_STATIC_LINKING_ONLY   /* XXH64_state_t */

◆ XXH_STATIC_LINKING_ONLY [2/2]

#define XXH_STATIC_LINKING_ONLY

◆ XXH_VERSION_MAJOR

#define XXH_VERSION_MAJOR   0

◆ XXH_VERSION_MINOR

#define XXH_VERSION_MINOR   8

◆ XXH_VERSION_NUMBER

#define XXH_VERSION_NUMBER   (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE)

◆ XXH_VERSION_RELEASE

#define XXH_VERSION_RELEASE   1

◆ XXHASH_H_5627135585666179

#define XXHASH_H_5627135585666179   1

◆ XXHASH_H_STATIC_13879238742

#define XXHASH_H_STATIC_13879238742

Definition at line 5860 of file zstd.c.

◆ ZDICT_CONTENTSIZE_MIN

#define ZDICT_CONTENTSIZE_MIN   128

Definition at line 40241 of file zstd.c.

◆ ZDICT_DEPRECATED

#define ZDICT_DEPRECATED (   message)

Definition at line 40402 of file zstd.c.

◆ ZDICT_DICTSIZE_MIN

#define ZDICT_DICTSIZE_MIN   256

Definition at line 40239 of file zstd.c.

◆ ZDICT_GCC_VERSION

#define ZDICT_GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)

Definition at line 40391 of file zstd.c.

◆ ZDICT_MAX_SAMPLES_SIZE

#define ZDICT_MAX_SAMPLES_SIZE   (2000U << 20)

Definition at line 44564 of file zstd.c.

◆ ZDICT_MIN_SAMPLES_SIZE

#define ZDICT_MIN_SAMPLES_SIZE   (ZDICT_CONTENTSIZE_MIN * MINRATIO)

Definition at line 44565 of file zstd.c.

◆ ZDICT_STATIC_LINKING_ONLY

#define ZDICT_STATIC_LINKING_ONLY

Definition at line 39934 of file zstd.c.

◆ ZDICTLIB_API

#define ZDICTLIB_API   ZDICTLIB_VISIBLE

Definition at line 39989 of file zstd.c.

◆ ZDICTLIB_HIDDEN

#define ZDICTLIB_HIDDEN

Definition at line 39980 of file zstd.c.

◆ ZDICTLIB_STATIC_API

#define ZDICTLIB_STATIC_API   ZDICTLIB_VISIBLE

Definition at line 40228 of file zstd.c.

◆ ZDICTLIB_VISIBLE

#define ZDICTLIB_VISIBLE

Definition at line 39972 of file zstd.c.

◆ ZSTD_ADDRESS_SANITIZER

#define ZSTD_ADDRESS_SANITIZER   0

Definition at line 413 of file zstd.c.

◆ ZSTD_ALIGNOF

#define ZSTD_ALIGNOF (   T)    (sizeof(void*) < sizeof(T) ? sizeof(void*) : sizeof(T))

Definition at line 776 of file zstd.c.

◆ ZSTD_ALLOCATIONS_H

#define ZSTD_ALLOCATIONS_H

Definition at line 4169 of file zstd.c.

◆ ZSTD_ASM_SUPPORTED

#define ZSTD_ASM_SUPPORTED   0

Only enable assembly for GNUC compatible compilers, because other platforms may not support GAS assembly syntax.

Only enable assembly for Linux / MacOS, other platforms may work, but they haven't been tested. This could likely be extended to BSD systems.

Disable assembly when MSAN is enabled, because MSAN requires 100% of code to be instrumented to work.

Definition at line 472 of file zstd.c.

◆ ZSTD_BITS_H

#define ZSTD_BITS_H

Definition at line 1833 of file zstd.c.

◆ ZSTD_BLOCKHEADERSIZE

#define ZSTD_BLOCKHEADERSIZE   3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */

Definition at line 10825 of file zstd.c.

◆ ZSTD_BT_GET_ALL_MATCHES_ARRAY

#define ZSTD_BT_GET_ALL_MATCHES_ARRAY (   dictMode)
Value:
{ \
ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, 3), \
ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, 4), \
ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, 5), \
ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, 6) \
}

Definition at line 30389 of file zstd.c.

◆ ZSTD_BT_GET_ALL_MATCHES_FN

#define ZSTD_BT_GET_ALL_MATCHES_FN (   dictMode,
  mls 
)    ZSTD_btGetAllMatches_##dictMode##_##mls

Definition at line 30361 of file zstd.c.

◆ ZSTD_BT_SEARCH_FN

#define ZSTD_BT_SEARCH_FN (   dictMode,
  mls 
)    ZSTD_BtFindBestMatch_##dictMode##_##mls

Generate search functions templated on (dictMode, mls, rowLog). These functions are outlined for code size & compilation time. ZSTD_searchMax() dispatches to the correct implementation function.

TODO: The start of the search function involves loading and calculating a bunch of constants from the ZSTD_matchState_t. These computations could be done in an initialization function, and saved somewhere in the match state. Then we could pass a pointer to the saved state instead of the match state, and avoid duplicate computations.

TODO: Move the match re-winding into searchMax. This improves compression ratio, and unlocks further simplifications with the next TODO.

TODO: Try moving the repcode search into searchMax. After the re-winding and repcode search are in searchMax, there is no more logic in the match finder loop that requires knowledge about the dictMode. So we should be able to avoid force inlining it, and we can join the extDict loop with the single segment loop. It should go in searchMax instead of its own function to avoid having multiple virtual function calls per search.

Definition at line 27867 of file zstd.c.

◆ ZSTD_BUILD_FSE_TABLE_WKSP_SIZE

#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE   (sizeof(S16) * (MaxSeq + 1) + (1u << MaxFSELog) + sizeof(U64))

Definition at line 34852 of file zstd.c.

◆ ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32

#define ZSTD_BUILD_FSE_TABLE_WKSP_SIZE_U32   ((ZSTD_BUILD_FSE_TABLE_WKSP_SIZE + sizeof(U32) - 1) / sizeof(U32))

Definition at line 34853 of file zstd.c.

◆ ZSTD_calloc

#define ZSTD_calloc (   n,
  s 
)    calloc((n), (s))

Definition at line 111 of file zstd.c.

◆ ZSTD_CCOMMON_H_MODULE

#define ZSTD_CCOMMON_H_MODULE

Definition at line 4684 of file zstd.c.

◆ ZSTD_CET_ENDBRANCH

#define ZSTD_CET_ENDBRANCH

Definition at line 511 of file zstd.c.

◆ ZSTD_CHUNKSIZE_MAX

#define ZSTD_CHUNKSIZE_MAX
Value:
( ((U32)-1) /* Maximum ending current index */ \
- ZSTD_CURRENT_MAX) /* Maximum beginning lowLimit */

Definition at line 15296 of file zstd.c.

◆ ZSTD_CLEVELS_H

#define ZSTD_CLEVELS_H

Definition at line 24522 of file zstd.c.

◆ ZSTD_COMMON_CPU_H

#define ZSTD_COMMON_CPU_H

Definition at line 4707 of file zstd.c.

◆ ZSTD_COMPILER_H

#define ZSTD_COMPILER_H

Definition at line 356 of file zstd.c.

◆ ZSTD_COMPRESS_ADVANCED_H

#define ZSTD_COMPRESS_ADVANCED_H

Definition at line 16671 of file zstd.c.

◆ ZSTD_COMPRESS_H

#define ZSTD_COMPRESS_H

Definition at line 13529 of file zstd.c.

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

Definition at line 17681 of file zstd.c.

◆ ZSTD_COMPRESS_LITERALS_H

#define ZSTD_COMPRESS_LITERALS_H

Definition at line 13511 of file zstd.c.

◆ ZSTD_COMPRESS_SEQUENCES_H

#define ZSTD_COMPRESS_SEQUENCES_H

Definition at line 16172 of file zstd.c.

◆ ZSTD_CURRENT_MAX

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

Definition at line 15294 of file zstd.c.

◆ ZSTD_CWKSP_ALIGNMENT_BYTES

#define ZSTD_CWKSP_ALIGNMENT_BYTES   64

Definition at line 13577 of file zstd.c.

◆ ZSTD_CWKSP_ASAN_REDZONE_SIZE

#define ZSTD_CWKSP_ASAN_REDZONE_SIZE   128

Definition at line 13572 of file zstd.c.

◆ ZSTD_CWKSP_H

#define ZSTD_CWKSP_H

Definition at line 13547 of file zstd.c.

◆ ZSTD_DATAFLOW_SANITIZER

#define ZSTD_DATAFLOW_SANITIZER   0

Definition at line 422 of file zstd.c.

◆ ZSTD_DDICT_H

#define ZSTD_DDICT_H

Definition at line 35029 of file zstd.c.

◆ ZSTD_DEC_BLOCK_H

#define ZSTD_DEC_BLOCK_H

Definition at line 35363 of file zstd.c.

◆ ZSTD_DECODER_INTERNAL_BUFFER

#define ZSTD_DECODER_INTERNAL_BUFFER   (1 << 16)

Definition at line 34887 of file zstd.c.

◆ ZSTD_DECOMPRESS_INTERNAL_H

#define ZSTD_DECOMPRESS_INTERNAL_H

Definition at line 34792 of file zstd.c.

◆ ZSTD_DEPS_COMMON

#define ZSTD_DEPS_COMMON

Definition at line 81 of file zstd.c.

◆ ZSTD_DEPS_MALLOC

#define ZSTD_DEPS_MALLOC

Definition at line 106 of file zstd.c.

◆ ZSTD_DEPS_MATH64

#define ZSTD_DEPS_MATH64

Definition at line 124 of file zstd.c.

◆ ZSTD_DEPS_NEED_MATH64 [1/2]

#define ZSTD_DEPS_NEED_MATH64

Definition at line 11266 of file zstd.c.

◆ ZSTD_DEPS_NEED_MATH64 [2/2]

#define ZSTD_DEPS_NEED_MATH64

Definition at line 11266 of file zstd.c.

◆ ZSTD_DISABLE_ASM

#define ZSTD_DISABLE_ASM   1

Definition at line 51 of file zstd.c.

◆ ZSTD_div64

#define ZSTD_div64 (   dividend,
  divisor 
)    ((dividend) / (divisor))

Definition at line 126 of file zstd.c.

◆ ZSTD_DOUBLE_FAST_H

#define ZSTD_DOUBLE_FAST_H

Definition at line 17333 of file zstd.c.

◆ 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() */

Definition at line 14407 of file zstd.c.

◆ ZSTD_ENABLE_ASM_X86_64_BMI2

#define ZSTD_ENABLE_ASM_X86_64_BMI2   0

Determines whether we should enable assembly for x86-64 with BMI2.

Enable if all of the following conditions hold:

  • ASM hasn't been explicitly disabled by defining ZSTD_DISABLE_ASM
  • Assembly is supported
  • We are compiling for x86-64 and either:
    • DYNAMIC_BMI2 is enabled
    • BMI2 is supported at compile time

Definition at line 492 of file zstd.c.

◆ ZSTD_ERROR

#define ZSTD_ERROR (   name)    ((size_t)-PREFIX(name))

Definition at line 1446 of file zstd.c.

◆ ZSTD_ERRORS_H_398273423

#define ZSTD_ERRORS_H_398273423

Definition at line 1311 of file zstd.c.

◆ ZSTD_FALLTHROUGH

#define ZSTD_FALLTHROUGH

Definition at line 748 of file zstd.c.

◆ ZSTD_FAST_H

#define ZSTD_FAST_H

Definition at line 17293 of file zstd.c.

◆ ZSTD_FOR_EACH_DICT_MODE

#define ZSTD_FOR_EACH_DICT_MODE (   X,
  ... 
)
Value:
X(__VA_ARGS__, noDict) \
X(__VA_ARGS__, extDict) \
X(__VA_ARGS__, dictMatchState) \
X(__VA_ARGS__, dedicatedDictSearch)

Definition at line 27919 of file zstd.c.

◆ ZSTD_FOR_EACH_MLS

#define ZSTD_FOR_EACH_MLS (   X,
  dictMode 
)
Value:
X(dictMode, 4) \
X(dictMode, 5) \
X(dictMode, 6)

Definition at line 27914 of file zstd.c.

◆ ZSTD_FOR_EACH_MLS_ROWLOG

#define ZSTD_FOR_EACH_MLS_ROWLOG (   X,
  dictMode 
)
Value:
ZSTD_FOR_EACH_ROWLOG(X, dictMode, 4) \
ZSTD_FOR_EACH_ROWLOG(X, dictMode, 5) \
ZSTD_FOR_EACH_ROWLOG(X, dictMode, 6)

Definition at line 27909 of file zstd.c.

◆ ZSTD_FOR_EACH_ROWLOG

#define ZSTD_FOR_EACH_ROWLOG (   X,
  dictMode,
  mls 
)
Value:
X(dictMode, mls, 4) \
X(dictMode, mls, 5) \
X(dictMode, mls, 6)

Definition at line 27904 of file zstd.c.

◆ ZSTD_FRAMECHECKSUMSIZE

#define ZSTD_FRAMECHECKSUMSIZE   4

Definition at line 10829 of file zstd.c.

◆ ZSTD_FRAMEIDSIZE

#define ZSTD_FRAMEIDSIZE   4 /* magic number size */

Definition at line 10823 of file zstd.c.

◆ ZSTD_free

#define ZSTD_free (   p)    free((p))

Definition at line 112 of file zstd.c.

◆ ZSTD_GEN_DFAST_FN

#define ZSTD_GEN_DFAST_FN (   dictMode,
  mls 
)
Value:
static size_t ZSTD_compressBlock_doubleFast_##dictMode##_##mls( \
ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], \
void const* src, size_t srcSize) \
{ \
return ZSTD_compressBlock_doubleFast_##dictMode##_generic(ms, seqStore, rep, src, srcSize, mls); \
}

Definition at line 25341 of file zstd.c.

◆ ZSTD_GEN_FAST_FN

#define ZSTD_GEN_FAST_FN (   dictMode,
  mls,
  step 
)
Value:
static size_t ZSTD_compressBlock_fast_##dictMode##_##mls##_##step( \
ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], \
void const* src, size_t srcSize) \
{ \
return ZSTD_compressBlock_fast_##dictMode##_generic(ms, seqStore, rep, src, srcSize, mls, step); \
}

Definition at line 25972 of file zstd.c.

◆ ZSTD_HAS_C_ATTRIBUTE

#define ZSTD_HAS_C_ATTRIBUTE (   x)    0

Definition at line 720 of file zstd.c.

◆ ZSTD_HAS_CPP_ATTRIBUTE

#define ZSTD_HAS_CPP_ATTRIBUTE (   x)    0

Definition at line 729 of file zstd.c.

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

Definition at line 17694 of file zstd.c.

◆ ZSTD_HAVE_WEAK_SYMBOLS

#define ZSTD_HAVE_WEAK_SYMBOLS   0

Definition at line 10645 of file zstd.c.

◆ ZSTD_HC_SEARCH_FN

#define ZSTD_HC_SEARCH_FN (   dictMode,
  mls 
)    ZSTD_HcFindBestMatch_##dictMode##_##mls

Definition at line 27868 of file zstd.c.

◆ ZSTD_HEAPMODE

#define ZSTD_HEAPMODE   1

HEAPMODE : Select how default decompression function ZSTD_decompress() allocates its context, on stack (0), or into heap (1, default; requires malloc()). Note that functions with explicit context such as ZSTD_decompressDCtx() are unaffected.

Definition at line 35304 of file zstd.c.

◆ ZSTD_HIDE_ASM_FUNCTION

#define ZSTD_HIDE_ASM_FUNCTION (   func)

Definition at line 430 of file zstd.c.

◆ ZSTD_HUFFDTABLE_CAPACITY_LOG

#define ZSTD_HUFFDTABLE_CAPACITY_LOG   12

Definition at line 34854 of file zstd.c.

◆ ZSTD_INDEXOVERFLOW_MARGIN

#define ZSTD_INDEXOVERFLOW_MARGIN   (16 MB)

Definition at line 19661 of file zstd.c.

◆ ZSTD_isError

#define ZSTD_isError   ERR_isError /* for inlining */

Definition at line 10785 of file zstd.c.

◆ ZSTD_LAZY_DDSS_BUCKET_LOG

#define ZSTD_LAZY_DDSS_BUCKET_LOG   2

Dedicated Dictionary Search Structure bucket log. In the ZSTD_dedicatedDictSearch mode, the hashTable has 2 ** ZSTD_LAZY_DDSS_BUCKET_LOG entries in each bucket, rather than just one.

Definition at line 17388 of file zstd.c.

◆ ZSTD_LAZY_H

#define ZSTD_LAZY_H

Definition at line 17374 of file zstd.c.

◆ ZSTD_LBMAX

#define ZSTD_LBMAX   (128 << 10)

Definition at line 34891 of file zstd.c.

◆ ZSTD_LBMIN

#define ZSTD_LBMIN   64

Definition at line 34890 of file zstd.c.

◆ ZSTD_LDM_DEFAULT_WINDOW_LOG

#define ZSTD_LDM_DEFAULT_WINDOW_LOG   ZSTD_WINDOWLOG_LIMIT_DEFAULT

Definition at line 17574 of file zstd.c.

◆ ZSTD_LDM_GEARTAB_H

#define ZSTD_LDM_GEARTAB_H

Definition at line 28718 of file zstd.c.

◆ ZSTD_LDM_H

#define ZSTD_LDM_H

Definition at line 17561 of file zstd.c.

◆ ZSTD_LEGACY_SUPPORT

#define ZSTD_LEGACY_SUPPORT   0

Definition at line 45 of file zstd.c.

◆ ZSTD_LITBUFFEREXTRASIZE

#define ZSTD_LITBUFFEREXTRASIZE   BOUNDED(ZSTD_LBMIN, ZSTD_DECODER_INTERNAL_BUFFER, ZSTD_LBMAX)

Definition at line 34894 of file zstd.c.

◆ ZSTD_LITFREQ_ADD

#define ZSTD_LITFREQ_ADD   2 /* scaling factor for litFreq, so that frequencies adapt faster to new stats */

Definition at line 29538 of file zstd.c.

◆ ZSTD_malloc

#define ZSTD_malloc (   s)    malloc(s)

Definition at line 110 of file zstd.c.

◆ ZSTD_MAX_CLEVEL

#define ZSTD_MAX_CLEVEL   22

Definition at line 24529 of file zstd.c.

◆ ZSTD_MAX_FSE_HEADERS_SIZE

#define ZSTD_MAX_FSE_HEADERS_SIZE   (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8)

Definition at line 10858 of file zstd.c.

◆ ZSTD_MAX_HUF_HEADER_SIZE

#define ZSTD_MAX_HUF_HEADER_SIZE   128 /* header + <= 127 byte tree description */

Definition at line 10856 of file zstd.c.

◆ 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 14756 of file zstd.c.

◆ ZSTD_MAX_PRICE

#define ZSTD_MAX_PRICE   (1<<30)

Definition at line 29539 of file zstd.c.

◆ ZSTD_MAXWINDOWSIZE_DEFAULT

#define ZSTD_MAXWINDOWSIZE_DEFAULT   (((U32)1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT) + 1)

LEGACY_SUPPORT : if set to 1+, ZSTD_decompress() can decode older formats (v0.1+)

MAXWINDOWSIZE_DEFAULT : maximum window size accepted by DStream by default. Frames requiring more memory will be rejected. It's possible to set a different limit using ZSTD_DCtx_setMaxWindowSize().

Definition at line 35322 of file zstd.c.

◆ ZSTD_memcpy

#define ZSTD_memcpy (   d,
  s,
 
)    memcpy((d),(s),(l))

Definition at line 92 of file zstd.c.

◆ ZSTD_memmove

#define ZSTD_memmove (   d,
  s,
 
)    memmove((d),(s),(l))

Definition at line 93 of file zstd.c.

◆ ZSTD_MEMORY_SANITIZER

#define ZSTD_MEMORY_SANITIZER   0

Definition at line 402 of file zstd.c.

◆ ZSTD_memset

#define ZSTD_memset (   p,
  v,
 
)    memset((p),(v),(l))

Definition at line 94 of file zstd.c.

◆ ZSTD_MULTITHREAD

#define ZSTD_MULTITHREAD

Definition at line 47 of file zstd.c.

◆ ZSTD_NO_CLEVEL

#define ZSTD_NO_CLEVEL   0

Definition at line 18011 of file zstd.c.

◆ ZSTD_NO_FORWARD_PROGRESS_MAX

#define ZSTD_NO_FORWARD_PROGRESS_MAX   16

NO_FORWARD_PROGRESS_MAX : maximum allowed nb of calls to ZSTD_decompressStream() without any forward progress (defined as: no byte read from input, and no byte flushed to output) before triggering an error.

Definition at line 35333 of file zstd.c.

◆ ZSTD_OPT_H

#define ZSTD_OPT_H

Definition at line 17503 of file zstd.c.

◆ ZSTD_OPT_NUM

#define ZSTD_OPT_NUM   (1<<12)

Definition at line 10803 of file zstd.c.

◆ ZSTD_PORTABILITY_MACROS_H

#define ZSTD_PORTABILITY_MACROS_H

Definition at line 370 of file zstd.c.

◆ ZSTD_PREDEF_THRESHOLD

#define ZSTD_PREDEF_THRESHOLD   8 /* if srcSize < ZSTD_PREDEF_THRESHOLD, symbols' cost is assumed static, directly determined by pre-defined distributions */

Definition at line 29541 of file zstd.c.

◆ ZSTD_pthread_cond_broadcast

#define ZSTD_pthread_cond_broadcast (   a)    pthread_cond_broadcast((a))

Definition at line 3915 of file zstd.c.

◆ ZSTD_pthread_cond_destroy

#define ZSTD_pthread_cond_destroy (   a)    pthread_cond_destroy((a))

Definition at line 3912 of file zstd.c.

◆ ZSTD_pthread_cond_init

#define ZSTD_pthread_cond_init (   a,
 
)    pthread_cond_init((a), (b))

Definition at line 3911 of file zstd.c.

◆ ZSTD_pthread_cond_signal

#define ZSTD_pthread_cond_signal (   a)    pthread_cond_signal((a))

Definition at line 3914 of file zstd.c.

◆ ZSTD_pthread_cond_t

#define ZSTD_pthread_cond_t   pthread_cond_t

Definition at line 3910 of file zstd.c.

◆ ZSTD_pthread_cond_wait

#define ZSTD_pthread_cond_wait (   a,
 
)    pthread_cond_wait((a), (b))

Definition at line 3913 of file zstd.c.

◆ ZSTD_pthread_create

#define ZSTD_pthread_create (   a,
  b,
  c,
  d 
)    pthread_create((a), (b), (c), (d))

Definition at line 3918 of file zstd.c.

◆ ZSTD_pthread_join

#define ZSTD_pthread_join (   a)    pthread_join((a),NULL)

Definition at line 3919 of file zstd.c.

◆ ZSTD_pthread_mutex_destroy

#define ZSTD_pthread_mutex_destroy (   a)    pthread_mutex_destroy((a))

Definition at line 3906 of file zstd.c.

◆ ZSTD_pthread_mutex_init

#define ZSTD_pthread_mutex_init (   a,
 
)    pthread_mutex_init((a), (b))

Definition at line 3905 of file zstd.c.

◆ ZSTD_pthread_mutex_lock

#define ZSTD_pthread_mutex_lock (   a)    pthread_mutex_lock((a))

Definition at line 3907 of file zstd.c.

◆ ZSTD_PTHREAD_MUTEX_LOCK

#define ZSTD_PTHREAD_MUTEX_LOCK (   m)    ZSTD_pthread_mutex_lock(m)

Definition at line 31078 of file zstd.c.

◆ ZSTD_pthread_mutex_t

#define ZSTD_pthread_mutex_t   pthread_mutex_t

Definition at line 3904 of file zstd.c.

◆ ZSTD_pthread_mutex_unlock

#define ZSTD_pthread_mutex_unlock (   a)    pthread_mutex_unlock((a))

Definition at line 3908 of file zstd.c.

◆ ZSTD_pthread_t

#define ZSTD_pthread_t   pthread_t

Definition at line 3917 of file zstd.c.

◆ ZSTD_REP_NUM

#define ZSTD_REP_NUM   3 /* number of repcodes */

Definition at line 10805 of file zstd.c.

◆ ZSTD_RESIZE_SEQPOOL

#define ZSTD_RESIZE_SEQPOOL   0

Definition at line 31033 of file zstd.c.

◆ ZSTD_ROLL_HASH_CHAR_OFFSET

#define ZSTD_ROLL_HASH_CHAR_OFFSET   10

Definition at line 15243 of file zstd.c.

◆ ZSTD_ROW_HASH_CACHE_MASK

#define ZSTD_ROW_HASH_CACHE_MASK   (ZSTD_ROW_HASH_CACHE_SIZE - 1)

Definition at line 27299 of file zstd.c.

◆ ZSTD_ROW_HASH_CACHE_SIZE

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

Definition at line 14578 of file zstd.c.

◆ ZSTD_ROW_HASH_MAX_ENTRIES

#define ZSTD_ROW_HASH_MAX_ENTRIES   64 /* absolute maximum number of entries per row, for all configurations */

Definition at line 27297 of file zstd.c.

◆ ZSTD_ROW_HASH_TAG_BITS

#define ZSTD_ROW_HASH_TAG_BITS   8 /* nb bits to use for the tag */

Definition at line 17390 of file zstd.c.

◆ ZSTD_ROW_HASH_TAG_MASK

#define ZSTD_ROW_HASH_TAG_MASK   ((1u << ZSTD_ROW_HASH_TAG_BITS) - 1)

Definition at line 27296 of file zstd.c.

◆ ZSTD_ROW_SEARCH_FN

#define ZSTD_ROW_SEARCH_FN (   dictMode,
  mls,
  rowLog 
)    ZSTD_RowFindBestMatch_##dictMode##_##mls##_##rowLog

Definition at line 27869 of file zstd.c.

◆ ZSTD_ROWSIZE

#define ZSTD_ROWSIZE   16

Definition at line 20187 of file zstd.c.

◆ ZSTD_SEARCH_FN_ATTRS

#define ZSTD_SEARCH_FN_ATTRS   FORCE_NOINLINE

Definition at line 27871 of file zstd.c.

◆ ZSTD_SHORT_CACHE_TAG_BITS

#define ZSTD_SHORT_CACHE_TAG_BITS   8

Definition at line 15733 of file zstd.c.

◆ ZSTD_SHORT_CACHE_TAG_MASK

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

Definition at line 15734 of file zstd.c.

◆ ZSTD_STATIC_ASSERT

#define ZSTD_STATIC_ASSERT (   c)    DEBUG_STATIC_ASSERT(c)

Definition at line 10784 of file zstd.c.

◆ ZSTD_STATIC_LINKING_ONLY [1/5]

#define ZSTD_STATIC_LINKING_ONLY

Definition at line 24524 of file zstd.c.

◆ ZSTD_STATIC_LINKING_ONLY [2/5]

#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_customMem */

Definition at line 24524 of file zstd.c.

◆ ZSTD_STATIC_LINKING_ONLY [3/5]

#define ZSTD_STATIC_LINKING_ONLY

Definition at line 24524 of file zstd.c.

◆ ZSTD_STATIC_LINKING_ONLY [4/5]

#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_parameters */

Definition at line 24524 of file zstd.c.

◆ ZSTD_STATIC_LINKING_ONLY [5/5]

#define ZSTD_STATIC_LINKING_ONLY   /* ZSTD_compressionParameters */

Definition at line 24524 of file zstd.c.

◆ ZSTD_SWITCH_MLS

#define ZSTD_SWITCH_MLS (   X,
  dictMode 
)
Value:
switch (mls) { \
ZSTD_FOR_EACH_MLS(X, dictMode) \
}

Definition at line 27944 of file zstd.c.

◆ ZSTD_SWITCH_ROWLOG

#define ZSTD_SWITCH_ROWLOG (   dictMode,
  mls 
)
Value:
case mls: \
switch (rowLog) { \
ZSTD_FOR_EACH_ROWLOG(GEN_ZSTD_CALL_ROW_SEARCH_FN, dictMode, mls) \
} \
ZSTD_UNREACHABLE; \
break;

Definition at line 27949 of file zstd.c.

◆ ZSTD_SWITCH_SEARCH_METHOD

#define ZSTD_SWITCH_SEARCH_METHOD (   dictMode)
Value:
switch (searchMethod) { \
ZSTD_SWITCH_MLS(GEN_ZSTD_CALL_HC_SEARCH_FN, dictMode) \
break; \
ZSTD_SWITCH_MLS(GEN_ZSTD_CALL_BT_SEARCH_FN, dictMode) \
break; \
ZSTD_SWITCH_MLS(ZSTD_SWITCH_ROWLOG, dictMode) \
break; \
} \
ZSTD_UNREACHABLE;

Definition at line 27957 of file zstd.c.

◆ ZSTD_TRACE

#define ZSTD_TRACE   0

Definition at line 49 of file zstd.c.

◆ ZSTD_TRACE_H

#define ZSTD_TRACE_H

Definition at line 10622 of file zstd.c.

◆ ZSTD_UNREACHABLE

#define ZSTD_UNREACHABLE   { assert(0); }

Definition at line 672 of file zstd.c.

◆ ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER

#define ZSTD_USE_CDICT_PARAMS_DICTSIZE_MULTIPLIER   (6ULL)

Definition at line 22634 of file zstd.c.

◆ ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF

#define ZSTD_USE_CDICT_PARAMS_SRCSIZE_CUTOFF   (128 KB)

Definition at line 22633 of file zstd.c.

◆ ZSTD_WEAK_ATTR

#define ZSTD_WEAK_ATTR

Definition at line 10650 of file zstd.c.

◆ ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY

#define ZSTD_WINDOW_OVERFLOW_CORRECT_FREQUENTLY   0

Definition at line 15351 of file zstd.c.

◆ ZSTD_WINDOW_START_INDEX

#define ZSTD_WINDOW_START_INDEX   2

Definition at line 14574 of file zstd.c.

◆ ZSTD_WINDOWLOG_ABSOLUTEMIN

#define ZSTD_WINDOWLOG_ABSOLUTEMIN   10

Definition at line 10819 of file zstd.c.

◆ ZSTD_WORKSPACETOOLARGE_FACTOR

#define ZSTD_WORKSPACETOOLARGE_FACTOR   3

Definition at line 10999 of file zstd.c.

◆ ZSTD_WORKSPACETOOLARGE_MAXDURATION

#define ZSTD_WORKSPACETOOLARGE_MAXDURATION   128

Definition at line 11006 of file zstd.c.

◆ ZSTD_ZDICT_H

#define ZSTD_ZDICT_H

Definition at line 39958 of file zstd.c.

◆ ZSTD_ZDICT_H_STATIC

#define ZSTD_ZDICT_H_STATIC

Definition at line 40219 of file zstd.c.

◆ ZSTDERRORLIB_API

#define ZSTDERRORLIB_API   ZSTDERRORLIB_VISIBLE

Definition at line 1346 of file zstd.c.

◆ ZSTDERRORLIB_HIDDEN

#define ZSTDERRORLIB_HIDDEN

Definition at line 1337 of file zstd.c.

◆ ZSTDERRORLIB_VISIBLE

#define ZSTDERRORLIB_VISIBLE

Definition at line 1329 of file zstd.c.

◆ ZSTDMT_COMPRESS_H

#define ZSTDMT_COMPRESS_H

Definition at line 14292 of file zstd.c.

◆ ZSTDMT_JOBLOG_MAX

#define ZSTDMT_JOBLOG_MAX   (MEM_32bits() ? 29 : 30)

Definition at line 14321 of file zstd.c.

◆ ZSTDMT_JOBSIZE_MAX

#define ZSTDMT_JOBSIZE_MAX   (MEM_32bits() ? (512 MB) : (1024 MB))

Definition at line 14322 of file zstd.c.

◆ ZSTDMT_JOBSIZE_MIN

#define ZSTDMT_JOBSIZE_MIN   (512 KB)

Definition at line 14319 of file zstd.c.

◆ ZSTDMT_NBWORKERS_MAX

#define ZSTDMT_NBWORKERS_MAX   ((sizeof(void*)==4) /*32-bit*/ ? 64 : 256)

Definition at line 14316 of file zstd.c.

◆ ZSTDMT_OVERLAPLOG_DEFAULT

#define ZSTDMT_OVERLAPLOG_DEFAULT   0

Definition at line 31016 of file zstd.c.

Typedef Documentation

◆ buffer_t

typedef struct buffer_s buffer_t

◆ BYTE

typedef unsigned char BYTE

Definition at line 905 of file zstd.c.

◆ COVER_best_t

typedef struct COVER_best_s COVER_best_t

COVER_best_t is used for two purposes:

  1. Synchronizing threads.
  2. Saving the best parameters and dictionary.

All of the methods except COVER_best_init() are thread safe if zstd is compiled with multithreaded support.

◆ COVER_dictSelection_t

Struct used for the dictionary selection function.

◆ COVER_map_pair_t

◆ COVER_map_t

typedef struct COVER_map_s COVER_map_t

◆ COVER_tryParameters_data_t

Parameters for COVER_tryParameters().

◆ ERR_enum

Definition at line 1437 of file zstd.c.

◆ FASTCOVER_tryParameters_data_t

Parameters for FASTCOVER_tryParameters().

◆ FSE_CTable

typedef unsigned FSE_CTable

Constructor and Destructor of FSE_CTable. Note that FSE_CTable size depends on 'tableLog' and 'maxSymbolValue'

Definition at line 1676 of file zstd.c.

◆ FSE_DTable

typedef unsigned FSE_DTable

Definition at line 1752 of file zstd.c.

◆ HUF_CElt

typedef size_t HUF_CElt

Definition at line 2894 of file zstd.c.

◆ HUF_DecompressFastLoopFn

typedef void(* HUF_DecompressFastLoopFn) (HUF_DecompressFastArgs *)

Definition at line 33044 of file zstd.c.

◆ HUF_DecompressUsingDTableFn

typedef size_t(* HUF_DecompressUsingDTableFn) (void *dst, size_t dstSize, const void *cSrc, size_t cSrcSize, const HUF_DTable *DTable)

Definition at line 32953 of file zstd.c.

◆ HUF_DTable

typedef U32 HUF_DTable

Definition at line 2901 of file zstd.c.

◆ huffNodeTable

typedef nodeElt huffNodeTable[2 *(HUF_SYMBOLVALUE_MAX+1)]

Definition at line 12528 of file zstd.c.

◆ nodeElt

typedef struct nodeElt_s nodeElt

◆ POOL_ctx

typedef struct POOL_ctx_s POOL_ctx

Definition at line 4229 of file zstd.c.

◆ POOL_function

typedef void(* POOL_function) (void *)

POOL_function : The function type that can be added to a thread pool.

Definition at line 4273 of file zstd.c.

◆ POOL_job

typedef struct POOL_job_s POOL_job

◆ rankVal_t

typedef rankValCol_t rankVal_t[HUF_TABLELOG_MAX]

Definition at line 33773 of file zstd.c.

◆ rankValCol_t

typedef U32 rankValCol_t[HUF_TABLELOG_MAX+1]

Definition at line 33772 of file zstd.c.

◆ repcodes_t

typedef struct repcodes_s repcodes_t

◆ S16

typedef signed short S16

Definition at line 912 of file zstd.c.

◆ S32

typedef signed int S32

Definition at line 917 of file zstd.c.

◆ S64

typedef signed long long S64

Definition at line 921 of file zstd.c.

◆ S8

typedef signed char S8

Definition at line 907 of file zstd.c.

◆ seqDef

typedef struct seqDef_s seqDef

◆ trbudget_t

typedef struct _trbudget_t trbudget_t

Definition at line 42905 of file zstd.c.

◆ U16

typedef unsigned short U16

Definition at line 911 of file zstd.c.

◆ U32

typedef unsigned int U32

Definition at line 916 of file zstd.c.

◆ U64

typedef unsigned long long U64

Definition at line 920 of file zstd.c.

◆ U8

typedef unsigned char U8

Definition at line 906 of file zstd.c.

◆ 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 14880 of file zstd.c.

◆ ZSTD_decompressSequences_t

typedef size_t(* ZSTD_decompressSequences_t) (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset, const int frame)

Definition at line 39623 of file zstd.c.

◆ ZSTD_getAllMatchesFn

typedef U32(* ZSTD_getAllMatchesFn) (ZSTD_match_t *, ZSTD_matchState_t *, U32 *, const BYTE *, const BYTE *, const U32 rep[ZSTD_REP_NUM], U32 const ll0, U32 const lengthToBeat)

Definition at line 30331 of file zstd.c.

◆ ZSTD_matchState_t

Definition at line 14576 of file zstd.c.

◆ ZSTD_prefixDict

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

Definition at line 24240 of file zstd.c.

◆ ZSTD_VecMask

typedef U64 ZSTD_VecMask

Definition at line 27301 of file zstd.c.

◆ ZSTDMT_bufferPool

◆ ZSTDMT_CCtx

typedef struct ZSTDMT_CCtx_s ZSTDMT_CCtx

Definition at line 14331 of file zstd.c.

◆ ZSTDMT_seqPool

Definition at line 31275 of file zstd.c.

Enumeration Type Documentation

◆ base_directive_e

Enumerator
base_0possible 
base_1guaranteed 

Definition at line 29621 of file zstd.c.

◆ BIT_DStream_status

Enumerator
BIT_DStream_unfinished 
BIT_DStream_endOfBuffer 
BIT_DStream_completed 
BIT_DStream_overflow 

Definition at line 2090 of file zstd.c.

◆ blockType_e

Enumerator
bt_raw 
bt_rle 
bt_compressed 
bt_reserved 

Definition at line 10827 of file zstd.c.

◆ FSE_repeat

enum FSE_repeat
Enumerator
FSE_repeat_none 

Cannot use the previous table

FSE_repeat_check 

Can use the previous table but it must be checked

FSE_repeat_valid 

Can use the previous table and it is assumed to be valid

Definition at line 2477 of file zstd.c.

◆ HIST_checkInput_e

Enumerator
trustInput 
checkMaxSymbolValue 

Definition at line 11921 of file zstd.c.

◆ HUF_flags_e

Huffman flags bitset. For all flags, 0 is the default value.

Enumerator
HUF_flags_bmi2 

If compiled with DYNAMIC_BMI2: Set flag only if the CPU supports BMI2 at runtime. Otherwise: Ignored.

HUF_flags_optimalDepth 

If set: Test possible table depths to find the one that produces the smallest header + encoded size. If unset: Use heuristic to find the table depth.

HUF_flags_preferRepeat 

If set: If the previous table can encode the input, always reuse the previous table. If unset: If the previous table can encode the input, reuse the previous table if it results in a smaller output.

HUF_flags_suspectUncompressible 

If set: Sample the input and check if the sample is uncompressible, if it is then don't attempt to compress. If unset: Always histogram the entire input.

HUF_flags_disableAsm 

If set: Don't use assembly implementations If unset: Allow using assembly implementations

HUF_flags_disableFast 

If set: Don't use the fast decoding loop, always use the fallback decoding loop. If unset: Use the fast decoding loop when possible.

Definition at line 2917 of file zstd.c.

◆ HUF_nbStreams_e

Enumerator
HUF_singleStream 
HUF_fourStreams 

Definition at line 13237 of file zstd.c.

◆ HUF_repeat

enum HUF_repeat
Enumerator
HUF_repeat_none 

Cannot use the previous table

HUF_repeat_check 

Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat

HUF_repeat_valid 

Can use the previous table and it is assumed to be valid

Definition at line 2976 of file zstd.c.

◆ searchMethod_e

Enumerator
search_hashChain 
search_binaryTree 
search_rowHash 

Definition at line 27932 of file zstd.c.

◆ streaming_operation

Enumerator
not_streaming 
is_streaming 

Definition at line 35387 of file zstd.c.

◆ symbolEncodingType_e

Enumerator
set_basic 
set_rle 
set_compressed 
set_repeat 

Definition at line 10835 of file zstd.c.

◆ 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 14747 of file zstd.c.

◆ ZSTD_bufferMode_e

Enumerator
ZSTD_bm_buffered 
ZSTD_bm_stable 

Definition at line 11009 of file zstd.c.

◆ ZSTD_buildSeqStore_e

Enumerator
ZSTDbss_compress 
ZSTDbss_noCompress 

Definition at line 20783 of file zstd.c.

◆ 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 

Definition at line 19533 of file zstd.c.

◆ ZSTD_compressionStage_e

Enumerator
ZSTDcs_created 
ZSTDcs_init 
ZSTDcs_ongoing 
ZSTDcs_ending 

Definition at line 14413 of file zstd.c.

◆ ZSTD_cParamMode_e

Enumerator
ZSTD_cpm_noAttachDict 
ZSTD_cpm_attachDict 
ZSTD_cpm_createCDict 
ZSTD_cpm_unknown 

Definition at line 14860 of file zstd.c.

◆ ZSTD_cStreamStage

Enumerator
zcss_init 
zcss_load 
zcss_flush 

Definition at line 14414 of file zstd.c.

◆ ZSTD_cwksp_alloc_phase_e

Enumerator
ZSTD_cwksp_alloc_objects 
ZSTD_cwksp_alloc_aligned_init_once 
ZSTD_cwksp_alloc_aligned 
ZSTD_cwksp_alloc_buffers 

Definition at line 13582 of file zstd.c.

◆ ZSTD_cwksp_static_alloc_e

Used to describe whether the workspace is statically allocated (and will not necessarily ever be freed), or if it's dynamically allocated and we can expect a well-formed caller to free this.

Enumerator
ZSTD_cwksp_dynamic_alloc 
ZSTD_cwksp_static_alloc 

Definition at line 13594 of file zstd.c.

◆ ZSTD_defaultPolicy_e

Enumerator
ZSTD_defaultDisallowed 
ZSTD_defaultAllowed 

Definition at line 16177 of file zstd.c.

◆ ZSTD_dictMode_e

Enumerator
ZSTD_noDict 
ZSTD_extDict 
ZSTD_dictMatchState 
ZSTD_dedicatedDictSearch 

Definition at line 14853 of file zstd.c.

◆ ZSTD_dictTableLoadMethod_e

Enumerator
ZSTD_dtlm_fast 
ZSTD_dtlm_full 

Definition at line 14850 of file zstd.c.

◆ ZSTD_dictUses_e

Enumerator
ZSTD_use_indefinitely 
ZSTD_dont_use 
ZSTD_use_once 

Definition at line 34873 of file zstd.c.

◆ ZSTD_dStage

Enumerator
ZSTDds_getFrameHeaderSize 
ZSTDds_decodeFrameHeader 
ZSTDds_decodeBlockHeader 
ZSTDds_decompressBlock 
ZSTDds_decompressLastBlock 
ZSTDds_checkChecksum 
ZSTDds_decodeSkippableHeader 
ZSTDds_skipFrame 

Definition at line 34865 of file zstd.c.

◆ ZSTD_dStreamStage

Enumerator
zdss_init 
zdss_loadHeader 
zdss_read 
zdss_load 
zdss_flush 

Definition at line 34870 of file zstd.c.

◆ ZSTD_ErrorCode

Enumerator
ZSTD_error_no_error 
ZSTD_error_GENERIC 
ZSTD_error_prefix_unknown 
ZSTD_error_version_unsupported 
ZSTD_error_frameParameter_unsupported 
ZSTD_error_frameParameter_windowTooLarge 
ZSTD_error_corruption_detected 
ZSTD_error_checksum_wrong 
ZSTD_error_literals_headerWrong 
ZSTD_error_dictionary_corrupted 
ZSTD_error_dictionary_wrong 
ZSTD_error_dictionaryCreation_failed 
ZSTD_error_parameter_unsupported 
ZSTD_error_parameter_combination_unsupported 
ZSTD_error_parameter_outOfBound 
ZSTD_error_tableLog_tooLarge 
ZSTD_error_maxSymbolValue_tooLarge 
ZSTD_error_maxSymbolValue_tooSmall 
ZSTD_error_stabilityCondition_notRespected 
ZSTD_error_stage_wrong 
ZSTD_error_init_missing 
ZSTD_error_memory_allocation 
ZSTD_error_workSpace_tooSmall 
ZSTD_error_dstSize_tooSmall 
ZSTD_error_srcSize_wrong 
ZSTD_error_dstBuffer_null 
ZSTD_error_noForwardProgress_destFull 
ZSTD_error_noForwardProgress_inputEmpty 
ZSTD_error_frameIndex_tooLarge 
ZSTD_error_seekableIO 
ZSTD_error_dstBuffer_wrong 
ZSTD_error_srcBuffer_wrong 
ZSTD_error_sequenceProducer_failed 
ZSTD_error_externalSequences_invalid 
ZSTD_error_maxCode 
ZSTD_error_no_error 
ZSTD_error_GENERIC 
ZSTD_error_prefix_unknown 
ZSTD_error_version_unsupported 
ZSTD_error_frameParameter_unsupported 
ZSTD_error_frameParameter_windowTooLarge 
ZSTD_error_corruption_detected 
ZSTD_error_checksum_wrong 
ZSTD_error_literals_headerWrong 
ZSTD_error_dictionary_corrupted 
ZSTD_error_dictionary_wrong 
ZSTD_error_dictionaryCreation_failed 
ZSTD_error_parameter_unsupported 
ZSTD_error_parameter_combination_unsupported 
ZSTD_error_parameter_outOfBound 
ZSTD_error_tableLog_tooLarge 
ZSTD_error_maxSymbolValue_tooLarge 
ZSTD_error_maxSymbolValue_tooSmall 
ZSTD_error_stabilityCondition_notRespected 
ZSTD_error_stage_wrong 
ZSTD_error_init_missing 
ZSTD_error_memory_allocation 
ZSTD_error_workSpace_tooSmall 
ZSTD_error_dstSize_tooSmall 
ZSTD_error_srcSize_wrong 
ZSTD_error_dstBuffer_null 
ZSTD_error_noForwardProgress_destFull 
ZSTD_error_noForwardProgress_inputEmpty 
ZSTD_error_frameIndex_tooLarge 
ZSTD_error_seekableIO 
ZSTD_error_dstBuffer_wrong 
ZSTD_error_srcBuffer_wrong 
ZSTD_error_sequenceProducer_failed 
ZSTD_error_externalSequences_invalid 
ZSTD_error_maxCode 

Definition at line 1363 of file zstd.c.

◆ 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 

Definition at line 19543 of file zstd.c.

◆ ZSTD_litLocation_e

Enumerator
ZSTD_not_in_dst 
ZSTD_in_dst 
ZSTD_split 

Definition at line 34896 of file zstd.c.

◆ ZSTD_longLengthType_e

Enumerator
ZSTD_llt_none 
ZSTD_llt_literalLength 
ZSTD_llt_matchLength 

Definition at line 11025 of file zstd.c.

◆ ZSTD_longOffset_e

Enumerator
ZSTD_lo_isRegularOffset 
ZSTD_lo_isLongOffset 

Definition at line 38891 of file zstd.c.

◆ ZSTD_OptPrice_e

Enumerator
zop_dynamic 
zop_predef 

Definition at line 14533 of file zstd.c.

◆ ZSTD_overlap_e

Enumerator
ZSTD_no_overlap 
ZSTD_overlap_src_before_dst 

Definition at line 10943 of file zstd.c.

◆ ZSTD_resetTarget_e

Enumerator
ZSTD_resetTarget_CDict 
ZSTD_resetTarget_CCtx 

Definition at line 19548 of file zstd.c.

◆ ZSTD_tableFillPurpose_e

Enumerator
ZSTD_tfp_forCCtx 
ZSTD_tfp_forCDict 

Definition at line 14851 of file zstd.c.

Function Documentation

◆ _force_has_format_string()

static INLINE_KEYWORD UNUSED_ATTR void _force_has_format_string ( const char *  format,
  ... 
)
static

Ignore: this is an internal helper.

This is a helper function to help force C99-correctness during compilation. Under strict compilation modes, variadic macro arguments can't be empty. However, variadic function arguments can be. Using a function therefore lets us statically check that at least one (string) argument was passed, independent of the compilation flags.

Definition at line 1478 of file zstd.c.

◆ allBytesIdentical()

static int allBytesIdentical ( const void *  src,
size_t  srcSize 
)
static

Definition at line 15977 of file zstd.c.

◆ BIT_addBits()

MEM_STATIC void BIT_addBits ( BIT_CStream_t bitC,
size_t  value,
unsigned  nbBits 
)

BIT_addBits() : can add up to 31 bits into bitC. Note : does not check for register overflow !

Definition at line 2167 of file zstd.c.

◆ BIT_addBitsFast()

MEM_STATIC void BIT_addBitsFast ( BIT_CStream_t bitC,
size_t  value,
unsigned  nbBits 
)

BIT_addBitsFast() : works only if value is clean, meaning all high bits above nbBits are 0

Definition at line 2180 of file zstd.c.

◆ BIT_closeCStream()

MEM_STATIC size_t BIT_closeCStream ( BIT_CStream_t bitC)

BIT_closeCStream() :

Returns
: size of CStream, in bytes, or 0 if it could not fit into dstBuffer

Definition at line 2223 of file zstd.c.

◆ BIT_endOfDStream()

MEM_STATIC unsigned BIT_endOfDStream ( const BIT_DStream_t DStream)

BIT_endOfDStream() :

Returns
: 1 if DStream has exactly reached its end (all bits consumed).

Definition at line 2417 of file zstd.c.

◆ BIT_flushBits()

MEM_STATIC void BIT_flushBits ( BIT_CStream_t bitC)

BIT_flushBits() : assumption : bitContainer has not overflowed safe version; check for buffer overflow, and prevents it. note : does not signal buffer overflow. overflow will be revealed later on using BIT_closeCStream()

Definition at line 2208 of file zstd.c.

◆ BIT_flushBitsFast()

MEM_STATIC void BIT_flushBitsFast ( BIT_CStream_t bitC)

BIT_flushBitsFast() : assumption : bitContainer has not overflowed unsafe version; does not check buffer overflow

Definition at line 2192 of file zstd.c.

◆ BIT_getLowerBits()

MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits ( size_t  bitContainer,
U32 const  nbBits 
)

Definition at line 2154 of file zstd.c.

◆ BIT_getMiddleBits()

MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits ( size_t  bitContainer,
U32 const  start,
U32 const  nbBits 
)

Definition at line 2294 of file zstd.c.

◆ BIT_getUpperBits()

MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits ( size_t  bitContainer,
U32 const  start 
)

Definition at line 2289 of file zstd.c.

◆ BIT_initCStream()

MEM_STATIC size_t BIT_initCStream ( BIT_CStream_t bitC,
void *  startPtr,
size_t  dstCapacity 
)

BIT_initCStream() : dstCapacity must be > sizeof(size_t)

Returns
: 0 if success, otherwise an error code (can be tested using ERR_isError())

Definition at line 2142 of file zstd.c.

◆ BIT_initDStream()

MEM_STATIC size_t BIT_initDStream ( BIT_DStream_t bitD,
const void *  srcBuffer,
size_t  srcSize 
)

BIT_initDStream() : Initialize a BIT_DStream_t. bitD : a pointer to an already allocated BIT_DStream_t structure. srcSize must be the exact size of the bitStream, in bytes.

Returns
: size of stream (== srcSize), or an errorCode if a problem is detected

Definition at line 2241 of file zstd.c.

◆ BIT_lookBits()

MEM_STATIC FORCE_INLINE_ATTR size_t BIT_lookBits ( const BIT_DStream_t bitD,
U32  nbBits 
)

BIT_lookBits() : Provides next n bits from local register. local register is not modified. On 32-bits, maxNbBits==24. On 64-bits, maxNbBits==56.

Returns
: value extracted

Definition at line 2317 of file zstd.c.

◆ BIT_lookBitsFast()

MEM_STATIC size_t BIT_lookBitsFast ( const BIT_DStream_t bitD,
U32  nbBits 
)

BIT_lookBitsFast() : unsafe version; only works if nbBits >= 1

Definition at line 2333 of file zstd.c.

◆ BIT_readBits()

MEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits ( BIT_DStream_t bitD,
unsigned  nbBits 
)

BIT_readBits() : Read (consume) next n bits from local register and update. Pay attention to not read more than nbBits contained into local register.

Returns
: extracted value.

Definition at line 2349 of file zstd.c.

◆ BIT_readBitsFast()

MEM_STATIC size_t BIT_readBitsFast ( BIT_DStream_t bitD,
unsigned  nbBits 
)

BIT_readBitsFast() : unsafe version; only works if nbBits >= 1

Definition at line 2358 of file zstd.c.

◆ BIT_reloadDStream()

BIT_reloadDStream() : Refill bitD from buffer previously set in BIT_initDStream() . This function is safe, it guarantees it will not read beyond src buffer.

Returns
: status of BIT_DStream_t internal register. when status == BIT_DStream_unfinished, internal register is filled with at least 25 or 57 bits

Definition at line 2388 of file zstd.c.

◆ BIT_reloadDStreamFast()

MEM_STATIC BIT_DStream_status BIT_reloadDStreamFast ( BIT_DStream_t bitD)

BIT_reloadDStreamFast() : Similar to BIT_reloadDStream(), but with two differences:

  1. bitsConsumed <= sizeof(bitD->bitContainer)*8 must hold!
  2. Returns BIT_DStream_overflow when bitD->ptr < bitD->limitPtr, at this point you must use BIT_reloadDStream() to reload.

Definition at line 2372 of file zstd.c.

◆ BIT_skipBits()

MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits ( BIT_DStream_t bitD,
U32  nbBits 
)

Definition at line 2340 of file zstd.c.

◆ blockSize_explicitDelimiter()

static size_t blockSize_explicitDelimiter ( const ZSTD_Sequence *  inSeqs,
size_t  inSeqsSize,
ZSTD_sequencePosition  seqPos 
)
static

Definition at line 24261 of file zstd.c.

◆ blockSize_noDelimiter()

static size_t blockSize_noDelimiter ( size_t  blockSize,
size_t  remaining 
)
static

Definition at line 24284 of file zstd.c.

◆ bufferToSeq()

static rawSeqStore_t bufferToSeq ( buffer_t  buffer)
static

Definition at line 31282 of file zstd.c.

◆ construct_BWT()

static int construct_BWT ( const unsigned char *  T,
int *  SA,
int *  bucket_A,
int *  bucket_B,
int  n,
int  m 
)
static

Definition at line 43542 of file zstd.c.

◆ construct_BWT_indexes()

static int construct_BWT_indexes ( const unsigned char *  T,
int *  SA,
int *  bucket_A,
int *  bucket_B,
int  n,
int  m,
unsigned char *  num_indexes,
int *  indexes 
)
static

Definition at line 43613 of file zstd.c.

◆ construct_SA()

static void construct_SA ( const unsigned char *  T,
int *  SA,
int *  bucket_A,
int *  bucket_B,
int  n,
int  m 
)
static

Definition at line 43478 of file zstd.c.

◆ COVER_best_destroy()

void COVER_best_destroy ( COVER_best_t best)

Call COVER_best_wait() and then destroy the COVER_best_t.

Definition at line 41418 of file zstd.c.

◆ COVER_best_finish()

void COVER_best_finish ( COVER_best_t best,
ZDICT_cover_params_t  parameters,
COVER_dictSelection_t  selection 
)

Called when a thread finishes executing, both on error or success. Decrements liveJobs and signals any waiting threads if liveJobs == 0. If this dictionary is the best so far save it and its parameters.

Definition at line 41448 of file zstd.c.

◆ COVER_best_init()

void COVER_best_init ( COVER_best_t best)

Initialize the COVER_best_t.

Definition at line 41390 of file zstd.c.

◆ COVER_best_start()

void COVER_best_start ( COVER_best_t best)

Called when a thread is about to be launched. Increments liveJobs.

Definition at line 41434 of file zstd.c.

◆ COVER_best_wait()

void COVER_best_wait ( COVER_best_t best)

Wait until liveJobs == 0.

Definition at line 41404 of file zstd.c.

◆ COVER_buildDictionary()

static size_t COVER_buildDictionary ( const COVER_ctx_t ctx,
U32 freqs,
COVER_map_t activeDmers,
void *  dictBuffer,
size_t  dictBufferCapacity,
ZDICT_cover_params_t  parameters 
)
static

Given the prepared context build the dictionary.

Definition at line 41222 of file zstd.c.

◆ COVER_checkParameters()

static int COVER_checkParameters ( ZDICT_cover_params_t  parameters,
size_t  maxDictSize 
)
static

Check the validity of the parameters. Returns non-zero if the parameters are valid and 0 otherwise.

Definition at line 41035 of file zstd.c.

◆ COVER_checkTotalCompressedSize()

size_t COVER_checkTotalCompressedSize ( const ZDICT_cover_params_t  parameters,
const size_t *  samplesSizes,
const BYTE samples,
size_t *  offsets,
size_t  nbTrainSamples,
size_t  nbSamples,
BYTE *const  dict,
size_t  dictBufferCapacity 
)

Checks total compressed size of a dictionary

Definition at line 41334 of file zstd.c.

◆ COVER_cmp()

static int COVER_cmp ( COVER_ctx_t ctx,
const void *  lp,
const void *  rp 
)
static

Returns -1 if the dmer at lp is less than the dmer at rp. Return 0 if the dmers at lp and rp are equal. Returns 1 if the dmer at lp is greater than the dmer at rp.

Definition at line 40797 of file zstd.c.

◆ COVER_cmp8()

static int COVER_cmp8 ( COVER_ctx_t ctx,
const void *  lp,
const void *  rp 
)
static

Faster version for d <= 8.

Definition at line 40805 of file zstd.c.

◆ COVER_computeEpochs()

COVER_epoch_info_t COVER_computeEpochs ( U32  maxDictSize,
U32  nbDmers,
U32  k,
U32  passes 
)

Computes the number of epochs and the size of each epoch. We will make sure that each epoch gets at least 10 * k bytes.

The COVER algorithms divide the data up into epochs of equal size and select one segment from each epoch.

Parameters
maxDictSizeThe maximum allowed dictionary size.
nbDmersThe number of dmers we are training on.
kThe parameter k (segment size).
passesThe target number of passes over the dmer corpus. More passes means a better dictionary.

Definition at line 41202 of file zstd.c.

◆ COVER_ctx_destroy()

static void COVER_ctx_destroy ( COVER_ctx_t ctx)
static

Clean up a context initialized with COVER_ctx_init().

Definition at line 41059 of file zstd.c.

◆ COVER_ctx_init()

static size_t COVER_ctx_init ( COVER_ctx_t ctx,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
unsigned  d,
double  splitPoint 
)
static

Prepare a context for dictionary building. The context is only dependent on the parameter d and can be used multiple times. Returns 0 on success or error code on error. The context must be destroyed with COVER_ctx_destroy().

Definition at line 41088 of file zstd.c.

◆ COVER_dictSelectionError()

COVER_dictSelection_t COVER_dictSelectionError ( size_t  error)

Error function for COVER_selectDict function. Returns a struct where return.totalCompressedSize is a ZSTD error.

Definition at line 41501 of file zstd.c.

◆ COVER_dictSelectionFree()

void COVER_dictSelectionFree ( COVER_dictSelection_t  selection)

Always call after selectDict is called to free up used memory from newly created dictionary.

Definition at line 41509 of file zstd.c.

◆ COVER_dictSelectionIsError()

unsigned COVER_dictSelectionIsError ( COVER_dictSelection_t  selection)

Error function for COVER_selectDict function. Checks if the return value is an error.

Definition at line 41505 of file zstd.c.

◆ COVER_group()

static void COVER_group ( COVER_ctx_t ctx,
const void *  group,
const void *  groupEnd 
)
static

Called on each group of positions with the same dmer. Counts the frequency of each dmer and saves it in the suffix array. Fills ctx->dmerAt.

Definition at line 40891 of file zstd.c.

◆ COVER_groupBy()

static void COVER_groupBy ( const void *  data,
size_t  count,
size_t  size,
COVER_ctx_t ctx,
int(*)(COVER_ctx_t *, const void *, const void *)  cmp,
void(*)(COVER_ctx_t *, const void *, const void *)  grp 
)
static

Generic groupBy function. Groups an array sorted by cmp into groups with equivalent values. Calls grp for each group.

Definition at line 40865 of file zstd.c.

◆ COVER_lower_bound()

static const size_t* COVER_lower_bound ( const size_t *  first,
const size_t *  last,
size_t  value 
)
static

Returns the first pointer in [first, last) whose element does not compare less than value. If no such element exists it returns last.

Definition at line 40842 of file zstd.c.

◆ COVER_map_at()

static U32* COVER_map_at ( COVER_map_t map,
U32  key 
)
static

Returns the pointer to the value for key. If key is not in the map, it is inserted and the value is set to 0. The map must not be full.

Definition at line 40706 of file zstd.c.

◆ COVER_map_clear()

static void COVER_map_clear ( COVER_map_t map)
static

Clear the map.

Definition at line 40652 of file zstd.c.

◆ COVER_map_destroy()

static void COVER_map_destroy ( COVER_map_t map)
static

Destroys a map that is inited with COVER_map_init().

Definition at line 40747 of file zstd.c.

◆ COVER_map_hash()

static U32 COVER_map_hash ( COVER_map_t map,
U32  key 
)
static

Definition at line 40680 of file zstd.c.

◆ COVER_map_index()

static U32 COVER_map_index ( COVER_map_t map,
U32  key 
)
static

Helper function that returns the index that a key should be placed into.

Definition at line 40687 of file zstd.c.

◆ COVER_map_init()

static int COVER_map_init ( COVER_map_t map,
U32  size 
)
static

Initializes a map of the given size. Returns 1 on success and 0 on failure. The map must be destroyed with COVER_map_destroy(). The map is only guaranteed to be large enough to hold size elements.

Definition at line 40662 of file zstd.c.

◆ COVER_map_remove()

static void COVER_map_remove ( COVER_map_t map,
U32  key 
)
static

Deletes key from the map if present.

Definition at line 40718 of file zstd.c.

◆ COVER_selectDict()

COVER_dictSelection_t COVER_selectDict ( BYTE customDictContent,
size_t  dictBufferCapacity,
size_t  dictContentSize,
const BYTE samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbFinalizeSamples,
size_t  nbCheckSamples,
size_t  nbSamples,
ZDICT_cover_params_t  params,
size_t *  offsets,
size_t  totalCompressedSize 
)

Called to finalize the dictionary and select one based on whether or not the shrink-dict flag was enabled. If enabled the dictionary used is the smallest dictionary within a specified regression of the compressed size from the largest dictionary.

Definition at line 41513 of file zstd.c.

◆ COVER_selectSegment()

static COVER_segment_t COVER_selectSegment ( const COVER_ctx_t ctx,
U32 freqs,
COVER_map_t activeDmers,
U32  begin,
U32  end,
ZDICT_cover_params_t  parameters 
)
static

Selects the best segment in an epoch. Segments of are scored according to the function:

Let F(d) be the frequency of dmer d. Let S_i be the dmer at position i of segment S which has length k.

Score(S) = F(S_1) + F(S_2) + ... + F(S_{k-d+1})

Once the dmer d is in the dictionary we set F(d) = 0.

Definition at line 40952 of file zstd.c.

◆ COVER_strict_cmp()

static int WIN_CDECL COVER_strict_cmp ( const void *  lp,
const void *  rp 
)
static

Same as COVER_cmp() except ties are broken by pointer value NOTE: g_coverCtx must be set to call this function. A global is required because qsort doesn't take an opaque pointer.

Definition at line 40820 of file zstd.c.

◆ COVER_strict_cmp8()

static int WIN_CDECL COVER_strict_cmp8 ( const void *  lp,
const void *  rp 
)
static

Faster version for d <= 8.

Definition at line 40830 of file zstd.c.

◆ COVER_sum()

size_t COVER_sum ( const size_t *  samplesSizes,
unsigned  nbSamples 
)

Returns the sum of the sample sizes.

Definition at line 40783 of file zstd.c.

◆ COVER_tryParameters()

static void COVER_tryParameters ( void *  opaque)
static

Tries a set of parameters and updates the COVER_best_t with the results. This function is thread safe if zstd is compiled with multithreaded support. It takes its parameters as an OWNING opaque pointer to support threading.

Definition at line 41615 of file zstd.c.

◆ COVER_warnOnSmallCorpus()

void COVER_warnOnSmallCorpus ( size_t  maxDictSize,
size_t  nbDmers,
int  displayLevel 
)

Warns the user when their corpus is too small.

Definition at line 41186 of file zstd.c.

◆ determine_blockSize()

static size_t determine_blockSize ( ZSTD_sequenceFormat_e  mode,
size_t  blockSize,
size_t  remaining,
const ZSTD_Sequence *  inSeqs,
size_t  inSeqsSize,
ZSTD_sequencePosition  seqPos 
)
static

Definition at line 24290 of file zstd.c.

◆ divbwt()

int divbwt ( const unsigned char *  T,
unsigned char *  U,
int *  A,
int  n,
unsigned char *  num_indexes,
int *  indexes,
int  openMP 
)

Constructs the burrows-wheeler transformed string of a given string.

Parameters
T[0..n-1] The input string.
U[0..n-1] The output string. (can be T)
A[0..n-1] The temporary array. (can be NULL)
nThe length of the given string.
num_indexesThe length of secondary indexes array. (can be NULL)
indexesThe secondary indexes array. (can be NULL)
openMPenables OpenMP optimization.
Returns
The primary index if no error occurred, -1 or -2 otherwise.

Definition at line 43741 of file zstd.c.

◆ divsufsort()

int divsufsort ( const unsigned char *  T,
int *  SA,
int  n,
int  openMP 
)

Constructs the suffix array of a given string.

Parameters
T[0..n-1] The input string.
SA[0..n-1] The output array of suffixes.
nThe length of the given string.
openMPenables OpenMP optimization.
Returns
0 if no error occurred, -1 or -2 otherwise.

Definition at line 43712 of file zstd.c.

◆ ERR_getErrorCode()

ERR_STATIC ERR_enum ERR_getErrorCode ( size_t  code)

Definition at line 1450 of file zstd.c.

◆ ERR_getErrorName()

const ERR_STATIC char* ERR_getErrorName ( size_t  code)

Definition at line 1463 of file zstd.c.

◆ ERR_getErrorString()

const char * ERR_getErrorString ( ERR_enum  code)

Definition at line 3441 of file zstd.c.

◆ ERR_isError()

ERR_STATIC unsigned ERR_isError ( size_t  code)

Definition at line 1448 of file zstd.c.

◆ FASTCOVER_buildDictionary()

static size_t FASTCOVER_buildDictionary ( const FASTCOVER_ctx_t ctx,
U32 freqs,
void *  dictBuffer,
size_t  dictBufferCapacity,
ZDICT_cover_params_t  parameters,
U16 segmentFreqs 
)
static

Given the prepared context build the dictionary.

Definition at line 44180 of file zstd.c.

◆ FASTCOVER_checkParameters()

static int FASTCOVER_checkParameters ( ZDICT_cover_params_t  parameters,
size_t  maxDictSize,
unsigned  f,
unsigned  accel 
)
static

Definition at line 44009 of file zstd.c.

◆ FASTCOVER_computeFrequency()

static void FASTCOVER_computeFrequency ( U32 freqs,
const FASTCOVER_ctx_t ctx 
)
static

Calculate for frequency of hash value of each dmer in ctx->samples

Definition at line 44064 of file zstd.c.

◆ FASTCOVER_convertToCoverParams()

static void FASTCOVER_convertToCoverParams ( ZDICT_fastCover_params_t  fastCoverParams,
ZDICT_cover_params_t coverParams 
)
static

Definition at line 44298 of file zstd.c.

◆ FASTCOVER_convertToFastCoverParams()

static void FASTCOVER_convertToFastCoverParams ( ZDICT_cover_params_t  coverParams,
ZDICT_fastCover_params_t fastCoverParams,
unsigned  f,
unsigned  accel 
)
static

Definition at line 44312 of file zstd.c.

◆ FASTCOVER_ctx_destroy()

static void FASTCOVER_ctx_destroy ( FASTCOVER_ctx_t ctx)
static

Clean up a context initialized with FASTCOVER_ctx_init().

Definition at line 44048 of file zstd.c.

◆ FASTCOVER_ctx_init()

static size_t FASTCOVER_ctx_init ( FASTCOVER_ctx_t ctx,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
unsigned  d,
double  splitPoint,
unsigned  f,
FASTCOVER_accel_t  accelParams 
)
static

Prepare a context for dictionary building. The context is only dependent on the parameter d and can be used multiple times. Returns 0 on success or error code on error. The context must be destroyed with FASTCOVER_ctx_destroy().

Definition at line 44093 of file zstd.c.

◆ FASTCOVER_hashPtrToIndex()

static size_t FASTCOVER_hashPtrToIndex ( const void *  p,
U32  f,
unsigned  d 
)
static

Hash the d-byte value pointed to by p and mod 2^f into the frequency vector

Definition at line 43872 of file zstd.c.

◆ FASTCOVER_selectSegment()

static COVER_segment_t FASTCOVER_selectSegment ( const FASTCOVER_ctx_t ctx,
U32 freqs,
U32  begin,
U32  end,
ZDICT_cover_params_t  parameters,
U16 segmentFreqs 
)
static

Selects the best segment in an epoch. Segments of are scored according to the function:

Let F(d) be the frequency of all dmers with hash value d. Let S_i be hash value of the dmer at position i of segment S which has length k.

Score(S) = F(S_1) + F(S_2) + ... + F(S_{k-d+1})

Once the dmer with hash value d is in the dictionary we set F(d) = 0.

Definition at line 43936 of file zstd.c.

◆ FASTCOVER_tryParameters()

static void FASTCOVER_tryParameters ( void *  opaque)
static

Tries a set of parameters and updates the COVER_best_t with the results. This function is thread safe if zstd is compiled with multithreaded support. It takes its parameters as an OWNING opaque pointer to support threading.

Definition at line 44253 of file zstd.c.

◆ findSynchronizationPoint()

static syncPoint_t findSynchronizationPoint ( ZSTDMT_CCtx const *  mtctx,
ZSTD_inBuffer const  input 
)
static

Searches through the input for a synchronization point. If one is found, we will instruct the caller to flush, and return the number of bytes to load. Otherwise, we will load as many bytes as possible and instruct the caller to continue as normal.

Definition at line 32687 of file zstd.c.

◆ FSE_bitCost()

MEM_STATIC U32 FSE_bitCost ( const void *  symbolTTPtr,
U32  tableLog,
U32  symbolValue,
U32  accuracyLog 
)

Definition at line 2684 of file zstd.c.

◆ FSE_buildCTable()

FSE_PUBLIC_API size_t FSE_buildCTable ( FSE_CTable ct,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
unsigned  tableLog 
)

FSE_buildCTable(): Builds ct, which must be already allocated, using FSE_createCTable().

Returns
: 0, or an errorCode, which can be tested using FSE_isError()

◆ FSE_buildCTable_rle()

size_t FSE_buildCTable_rle ( FSE_CTable ct,
unsigned char  symbolValue 
)

build a fake FSE_CTable, designed to compress always the same symbolValue

Definition at line 11766 of file zstd.c.

◆ FSE_buildCTable_wksp()

size_t FSE_buildCTable_wksp ( FSE_CTable ct,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
unsigned  tableLog,
void *  workSpace,
size_t  wkspSize 
)

Definition at line 11307 of file zstd.c.

◆ FSE_buildDTable_internal()

static size_t FSE_buildDTable_internal ( FSE_DTable dt,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
unsigned  tableLog,
void *  workSpace,
size_t  wkspSize 
)
static

Definition at line 3550 of file zstd.c.

◆ FSE_buildDTable_wksp()

size_t FSE_buildDTable_wksp ( FSE_DTable dt,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
unsigned  tableLog,
void *  workSpace,
size_t  wkspSize 
)

Same as FSE_buildDTable(), using an externally allocated workspace produced with FSE_BUILD_DTABLE_WKSP_SIZE_U32(maxSymbolValue)

Definition at line 3655 of file zstd.c.

◆ FSE_compress_usingCTable()

size_t FSE_compress_usingCTable ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const FSE_CTable ct 
)

FSE_compress_usingCTable(): Compress src using ct into dst which must be already allocated.

Returns
: size of compressed data (<= dstCapacity), or 0 if compressed data could not fit into dst, or an errorCode, which can be tested using FSE_isError()

Definition at line 11848 of file zstd.c.

◆ FSE_compress_usingCTable_generic()

static size_t FSE_compress_usingCTable_generic ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
const FSE_CTable ct,
const unsigned  fast 
)
static

Definition at line 11789 of file zstd.c.

◆ FSE_compressBound()

size_t FSE_compressBound ( size_t  size)

Definition at line 11861 of file zstd.c.

◆ FSE_decodeSymbol()

MEM_STATIC BYTE FSE_decodeSymbol ( FSE_DState_t DStatePtr,
BIT_DStream_t bitD 
)
static

Definition at line 2739 of file zstd.c.

◆ FSE_decodeSymbolFast()

MEM_STATIC BYTE FSE_decodeSymbolFast ( FSE_DState_t DStatePtr,
BIT_DStream_t bitD 
)
static

FSE_decodeSymbolFast() : unsafe, only works if no symbol has a probability > 50%

Definition at line 2752 of file zstd.c.

◆ FSE_decompress_usingDTable_generic()

FORCE_INLINE_TEMPLATE size_t FSE_decompress_usingDTable_generic ( void *  dst,
size_t  maxDstSize,
const void *  cSrc,
size_t  cSrcSize,
const FSE_DTable dt,
const unsigned  fast 
)

Definition at line 3667 of file zstd.c.

◆ FSE_decompress_wksp_bmi2()

size_t FSE_decompress_wksp_bmi2 ( void *  dst,
size_t  dstCapacity,
const void *  cSrc,
size_t  cSrcSize,
unsigned  maxLog,
void *  workSpace,
size_t  wkspSize,
int  bmi2 
)

same as FSE_decompress(), using an externally allocated workSpace produced with FSE_DECOMPRESS_WKSP_SIZE_U32(maxLog, maxSymbolValue). Set bmi2 to 1 if your CPU supports BMI2 or 0 if it doesn't

Definition at line 3791 of file zstd.c.

◆ FSE_decompress_wksp_body()

FORCE_INLINE_TEMPLATE size_t FSE_decompress_wksp_body ( void *  dst,
size_t  dstCapacity,
const void *  cSrc,
size_t  cSrcSize,
unsigned  maxLog,
void *  workSpace,
size_t  wkspSize,
int  bmi2 
)

Definition at line 3735 of file zstd.c.

◆ FSE_decompress_wksp_body_default()

static size_t FSE_decompress_wksp_body_default ( void *  dst,
size_t  dstCapacity,
const void *  cSrc,
size_t  cSrcSize,
unsigned  maxLog,
void *  workSpace,
size_t  wkspSize 
)
static

Definition at line 3779 of file zstd.c.

◆ FSE_encodeSymbol()

MEM_STATIC void FSE_encodeSymbol ( BIT_CStream_t bitC,
FSE_CState_t CStatePtr,
unsigned  symbol 
)
static

Definition at line 2653 of file zstd.c.

◆ FSE_endOfDState()

MEM_STATIC unsigned FSE_endOfDState ( const FSE_DState_t DStatePtr)
static

Let's now decompose FSE_decompress_usingDTable() into its unitary components. You will decode FSE-encoded symbols from the bitStream, and also any other bitFields you put in, in reverse order.

You will need a few variables to track your bitStream. They are :

BIT_DStream_t DStream; // Stream context FSE_DState_t DState; // State context. Multiple ones are possible FSE_DTable* DTablePtr; // Decoding table, provided by FSE_buildDTable()

The first thing to do is to init the bitStream. errorCode = BIT_initDStream(&DStream, srcBuffer, srcSize);

You should then retrieve your initial state(s) (in reverse flushing order if you have several ones) : errorCode = FSE_initDState(&DState, &DStream, DTablePtr);

You can then decode your data, symbol after symbol. For information the maximum number of bits read by FSE_decodeSymbol() is 'tableLog'. Keep in mind that symbols are decoded in reverse order, like a LIFO stack (last in, first out). unsigned char symbol = FSE_decodeSymbol(&DState, &DStream);

You can retrieve any bitfield you eventually stored into the bitStream (in reverse order) Note : maximum allowed nbBits is 25, for 32-bits compatibility size_t bitField = BIT_readBits(&DStream, nbBits);

All above operations only read from local register (which size depends on size_t). Refueling the register from memory is manually performed by the reload method. endSignal = FSE_reloadDStream(&DStream);

BIT_reloadDStream() result tells if there is still some more data to read from DStream. BIT_DStream_unfinished : there is still some data left into the DStream. BIT_DStream_endOfBuffer : Dstream reached end of buffer. Its container may no longer be completely filled. BIT_DStream_completed : Dstream reached its exact end, corresponding in general to decompression completed. BIT_DStream_tooFar : Dstream went too far. Decompression result is corrupted.

When reaching end of buffer (BIT_DStream_endOfBuffer), progress slowly, notably if you decode multiple symbols per loop, to properly detect the exact end of stream. After each decoded symbol, check if DStream is fully consumed using this simple test : BIT_reloadDStream(&DStream) >= BIT_DStream_completed

When it's done, verify decompression is fully completed, by checking both DStream and the relevant states. Checking if DStream has reached its end is performed by : BIT_endOfDStream(&DStream); Check also the states. There might be some symbols left there, if some high probability ones (>50%) are possible. FSE_endOfDState(&DState);

Definition at line 2763 of file zstd.c.

◆ FSE_flushCState()

MEM_STATIC void FSE_flushCState ( BIT_CStream_t bitC,
const FSE_CState_t CStatePtr 
)
static

These functions are inner components of FSE_compress_usingCTable(). They allow the creation of custom streams, mixing multiple tables and bit sources.

A key property to keep in mind is that encoding and decoding are done in reverse direction. So the first symbol you will encode is the last you will decode, like a LIFO stack.

You will need a few variables to track your CStream. They are :

FSE_CTable ct; // Provided by FSE_buildCTable() BIT_CStream_t bitStream; // bitStream tracking structure FSE_CState_t state; // State tracking structure (can have several)

The first thing to do is to init bitStream and state. size_t errorCode = BIT_initCStream(&bitStream, dstBuffer, maxDstSize); FSE_initCState(&state, ct);

Note that BIT_initCStream() can produce an error code, so its result should be tested, using FSE_isError(); You can then encode your input data, byte after byte. FSE_encodeSymbol() outputs a maximum of 'tableLog' bits at a time. Remember decoding will be done in reverse direction. FSE_encodeByte(&bitStream, &state, symbol);

At any time, you can also add any bit sequence. Note : maximum allowed nbBits is 25, for compatibility with 32-bits decoders BIT_addBits(&bitStream, bitField, nbBits);

The above methods don't commit data to memory, they just store it into local register, for speed. Local register size is 64-bits on 64-bits systems, 32-bits on 32-bits systems (size_t). Writing data to memory is a manual operation, performed by the flushBits function. BIT_flushBits(&bitStream);

Your last FSE encoding operation shall be to flush your last state value(s). FSE_flushState(&bitStream, &state);

Finally, you must close the bitStream. The function returns the size of CStream in bytes. If data couldn't fit into dstBuffer, it will return a 0 ( == not compressible) If there is an error, it returns an errorCode (which can be tested using FSE_isError()). size_t size = BIT_closeCStream(&bitStream);

Definition at line 2662 of file zstd.c.

◆ FSE_getErrorName()

const char * FSE_getErrorName ( size_t  code)

Definition at line 3116 of file zstd.c.

◆ FSE_getMaxNbBits()

MEM_STATIC U32 FSE_getMaxNbBits ( const void *  symbolTTPtr,
U32  symbolValue 
)

Definition at line 2674 of file zstd.c.

◆ FSE_initCState()

MEM_STATIC void FSE_initCState ( FSE_CState_t CStatePtr,
const FSE_CTable ct 
)
static

Definition at line 2627 of file zstd.c.

◆ FSE_initCState2()

MEM_STATIC void FSE_initCState2 ( FSE_CState_t statePtr,
const FSE_CTable ct,
U32  symbol 
)

FSE_initCState2() : Same as FSE_initCState(), but the first symbol to include (which will be the last to be read) uses the smallest state value possible, saving the cost of this symbol

Definition at line 2642 of file zstd.c.

◆ FSE_initDState()

MEM_STATIC void FSE_initDState ( FSE_DState_t DStatePtr,
BIT_DStream_t bitD,
const FSE_DTable dt 
)
static

Definition at line 2716 of file zstd.c.

◆ FSE_isError()

unsigned FSE_isError ( size_t  code)

Definition at line 3115 of file zstd.c.

◆ FSE_minTableLog()

static unsigned FSE_minTableLog ( size_t  srcSize,
unsigned  maxSymbolValue 
)
static

Definition at line 11586 of file zstd.c.

◆ FSE_NCountWriteBound()

size_t FSE_NCountWriteBound ( unsigned  maxSymbolValue,
unsigned  tableLog 
)

FSE_NCountWriteBound(): Provides the maximum possible size of an FSE normalized table, given 'maxSymbolValue' and 'tableLog'. Typically useful for allocation purpose.

Definition at line 11462 of file zstd.c.

◆ FSE_normalizeCount()

size_t FSE_normalizeCount ( short *  normalizedCounter,
unsigned  tableLog,
const unsigned *  count,
size_t  srcSize,
unsigned  maxSymbolValue,
unsigned  useLowProbCount 
)

FSE_normalizeCount(): normalize counts so that sum(count[]) == Power_of_2 (2^tableLog) 'normalizedCounter' is a table of short, of minimum size (maxSymbolValue+1). useLowProbCount is a boolean parameter which trades off compressed size for faster header decoding. When it is set to 1, the compressed data will be slightly smaller. And when it is set to 0, FSE_readNCount() and FSE_buildDTable() will be faster. If you are compressing a small amount of data (< 2 KB) then useLowProbCount=0 is a good default, since header deserialization makes a big speed difference. Otherwise, useLowProbCount=1 is a good default, since the speed difference is small.

Returns
: tableLog, or an errorCode, which can be tested using FSE_isError()

Definition at line 11703 of file zstd.c.

◆ FSE_normalizeM2()

static size_t FSE_normalizeM2 ( short *  norm,
U32  tableLog,
const unsigned *  count,
size_t  total,
U32  maxSymbolValue,
short  lowProbCount 
)
static

Definition at line 11617 of file zstd.c.

◆ FSE_optimalTableLog()

unsigned FSE_optimalTableLog ( unsigned  maxTableLog,
size_t  srcSize,
unsigned  maxSymbolValue 
)

FSE_compress() does the following:

  1. count symbol occurrence from source[] into table count[] (see hist.h)
  2. normalize counters so that sum(count[]) == Power_of_2 (2^tableLog)
  3. save normalized counters to memory buffer using writeNCount()
  4. build encoding table 'CTable' from normalized counters
  5. encode the data stream using encoding table 'CTable'

FSE_decompress() does the following:

  1. read normalized counters with readNCount()
  2. build decoding table 'DTable' from normalized counters
  3. decode the data stream using decoding table 'DTable'

The following API allows targeting specific sub-functions for advanced tasks. For example, it's possible to compress several blocks using the same 'CTable', or to save and provide normalized distribution using external method.

FSE_optimalTableLog(): dynamically downsize 'tableLog' when conditions are met. It saves CPU time, by using smaller tables, while preserving or even improving compression ratio.

Returns
: recommended tableLog (necessarily <= 'maxTableLog')

Definition at line 11609 of file zstd.c.

◆ FSE_optimalTableLog_internal()

unsigned FSE_optimalTableLog_internal ( unsigned  maxTableLog,
size_t  srcSize,
unsigned  maxSymbolValue,
unsigned  minus 
)

same as FSE_optimalTableLog(), which used minus==2

Definition at line 11595 of file zstd.c.

◆ FSE_peekSymbol()

MEM_STATIC BYTE FSE_peekSymbol ( const FSE_DState_t DStatePtr)

Definition at line 2725 of file zstd.c.

◆ FSE_readNCount()

size_t FSE_readNCount ( short *  normalizedCounter,
unsigned *  maxSymbolValuePtr,
unsigned *  tableLogPtr,
const void *  rBuffer,
size_t  rBuffSize 
)

Tutorial :

The first step is to count all symbols. FSE_count() does this job very fast. Result will be saved into 'count', a table of unsigned int, which must be already allocated, and have 'maxSymbolValuePtr[0]+1' cells. 'src' is a table of bytes of size 'srcSize'. All values within 'src' MUST be <= maxSymbolValuePtr[0] maxSymbolValuePtr[0] will be updated, with its real value (necessarily <= original value) FSE_count() will return the number of occurrence of the most frequent symbol. This can be used to know if there is a single symbol within 'src', and to quickly evaluate its compressibility. If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).

The next step is to normalize the frequencies. FSE_normalizeCount() will ensure that sum of frequencies is == 2 ^'tableLog'. It also guarantees a minimum of 1 to any Symbol with frequency >= 1. You can use 'tableLog'==0 to mean "use default tableLog value". If you are unsure of which tableLog value to use, you can ask FSE_optimalTableLog(), which will provide the optimal valid tableLog given sourceSize, maxSymbolValue, and a user-defined maximum (0 means "default").

The result of FSE_normalizeCount() will be saved into a table, called 'normalizedCounter', which is a table of signed short. 'normalizedCounter' must be already allocated, and have at least 'maxSymbolValue+1' cells. The return value is tableLog if everything proceeded as expected. It is 0 if there is a single symbol within distribution. If there is an error (ex: invalid tableLog value), the function will return an ErrorCode (which can be tested using FSE_isError()).

'normalizedCounter' can be saved in a compact manner to a memory area using FSE_writeNCount(). 'buffer' must be already allocated. For guaranteed success, buffer size must be at least FSE_headerBound(). The result of the function is the number of bytes written into 'buffer'. If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError(); ex : buffer size too small).

'normalizedCounter' can then be used to create the compression table 'CTable'. The space required by 'CTable' must be already allocated, using FSE_createCTable(). You can then use FSE_buildCTable() to fill 'CTable'. If there is an error, both functions will return an ErrorCode (which can be tested using FSE_isError()).

'CTable' can then be used to compress 'src', with FSE_compress_usingCTable(). Similar to FSE_count(), the convention is that 'src' is assumed to be a table of char of size 'srcSize' The function returns the size of compressed data (without header), necessarily <= dstCapacity. If it returns '0', compressed data could not fit into 'dst'. If there is an error, the function will return an ErrorCode (which can be tested using FSE_isError()).

FSE_readNCount(): Read compactly saved 'normalizedCounter' from 'rBuffer'.

Returns
: size read from 'rBuffer', or an errorCode, which can be tested using FSE_isError(). maxSymbolValuePtr[0] and tableLogPtr[0] will also be updated with their respective values

Definition at line 3303 of file zstd.c.

◆ FSE_readNCount_bmi2()

size_t FSE_readNCount_bmi2 ( short *  normalizedCounter,
unsigned *  maxSymbolValuePtr,
unsigned *  tableLogPtr,
const void *  rBuffer,
size_t  rBuffSize,
int  bmi2 
)

FSE_readNCount_bmi2(): Same as FSE_readNCount() but pass bmi2=1 when your CPU supports BMI2 and 0 otherwise.

Definition at line 3290 of file zstd.c.

◆ FSE_readNCount_body()

FORCE_INLINE_TEMPLATE size_t FSE_readNCount_body ( short *  normalizedCounter,
unsigned *  maxSVPtr,
unsigned *  tableLogPtr,
const void *  headerBuffer,
size_t  hbSize 
)

Definition at line 3126 of file zstd.c.

◆ FSE_readNCount_body_default()

static size_t FSE_readNCount_body_default ( short *  normalizedCounter,
unsigned *  maxSVPtr,
unsigned *  tableLogPtr,
const void *  headerBuffer,
size_t  hbSize 
)
static

Definition at line 3274 of file zstd.c.

◆ FSE_updateState()

MEM_STATIC void FSE_updateState ( FSE_DState_t DStatePtr,
BIT_DStream_t bitD 
)

Definition at line 2731 of file zstd.c.

◆ FSE_versionNumber()

unsigned FSE_versionNumber ( void  )

library version number; to be used when checking dll version

Definition at line 3111 of file zstd.c.

◆ FSE_writeNCount()

size_t FSE_writeNCount ( void *  buffer,
size_t  bufferSize,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
unsigned  tableLog 
)

FSE_writeNCount(): Compactly save 'normalizedCounter' into 'buffer'.

Returns
: size of the compressed table, or an errorCode, which can be tested using FSE_isError().

Definition at line 11568 of file zstd.c.

◆ FSE_writeNCount_generic()

static size_t FSE_writeNCount_generic ( void *  header,
size_t  headerBufferSize,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
unsigned  tableLog,
unsigned  writeIsSafe 
)
static

Definition at line 11473 of file zstd.c.

◆ HIST_count()

size_t HIST_count ( unsigned *  count,
unsigned *  maxSymbolValuePtr,
const void *  src,
size_t  srcSize 
)

HIST_count(): Provides the precise count of each byte within a table 'count'. 'count' is a table of unsigned int, of minimum size (*maxSymbolValuePtr+1). Updates *maxSymbolValuePtr with actual largest symbol value detected.

Returns
: count of the most frequent symbol (which isn't identified). or an error code, which can be tested using HIST_isError(). note : if return == srcSize, there is only one symbol.

Definition at line 12040 of file zstd.c.

◆ HIST_count_parallel_wksp()

static size_t HIST_count_parallel_wksp ( unsigned *  count,
unsigned *  maxSymbolValuePtr,
const void *  source,
size_t  sourceSize,
HIST_checkInput_e  check,
U32 *const  workSpace 
)
static

Definition at line 11931 of file zstd.c.

◆ HIST_count_simple()

unsigned HIST_count_simple ( unsigned *  count,
unsigned *  maxSymbolValuePtr,
const void *  src,
size_t  srcSize 
)

HIST_count_simple() : Same as HIST_countFast(), this function is unsafe, and will segfault if any value within src is > *maxSymbolValuePtr. It is also a bit slower for large inputs. However, it does not need any additional memory (not even on stack).

Returns
: count of the most frequent symbol. Note this function doesn't produce any error (i.e. it must succeed).

Definition at line 11894 of file zstd.c.

◆ HIST_count_wksp()

size_t HIST_count_wksp ( unsigned *  count,
unsigned *  maxSymbolValuePtr,
const void *  src,
size_t  srcSize,
void *  workSpace,
size_t  workSpaceSize 
)

HIST_count_wksp() : Same as HIST_count(), but using an externally provided scratch buffer. Benefit is this function will use very little stack space. workSpace is a writable buffer which must be 4-bytes aligned, workSpaceSize must be >= HIST_WKSP_SIZE

Definition at line 12019 of file zstd.c.

◆ HIST_countFast()

size_t HIST_countFast ( unsigned *  count,
unsigned *  maxSymbolValuePtr,
const void *  src,
size_t  srcSize 
)

HIST_countFast() : same as HIST_count(), but blindly trusts that all byte values within src are <= *maxSymbolValuePtr. This function is unsafe, and will segfault if any value within src is > *maxSymbolValuePtr

Definition at line 12033 of file zstd.c.

◆ HIST_countFast_wksp()

size_t HIST_countFast_wksp ( unsigned *  count,
unsigned *  maxSymbolValuePtr,
const void *  src,
size_t  srcSize,
void *  workSpace,
size_t  workSpaceSize 
)

HIST_countFast_wksp() : Same as HIST_countFast(), but using an externally provided scratch buffer. workSpace is a writable buffer which must be 4-bytes aligned, workSpaceSize must be >= HIST_WKSP_SIZE

Definition at line 12005 of file zstd.c.

◆ HIST_isError()

unsigned HIST_isError ( size_t  code)

tells if a return value is an error code

Definition at line 11889 of file zstd.c.

◆ HUF_addBits()

FORCE_INLINE_TEMPLATE void HUF_addBits ( HUF_CStream_t bitC,
HUF_CElt  elt,
int  idx,
int  kFast 
)

HUF_addBits(): Adds the symbol stored in HUF_CElt elt to the bitstream.

Parameters
eltThe element we're adding. This is a (nbBits, value) pair. See the HUF_CStream_t docs for the format.
idxInsert into the bitstream at this idx.
kFastThis is a template parameter. If the bitstream is guaranteed to have at least 4 unused bits after this call it may be 1, otherwise it must be 0. HUF_addBits() is faster when fast is set.

Definition at line 12892 of file zstd.c.

◆ HUF_alignUpWorkspace()

static void* HUF_alignUpWorkspace ( void *  workspace,
size_t *  workspaceSizePtr,
size_t  align 
)
static

Definition at line 12160 of file zstd.c.

◆ HUF_buildCTable_wksp()

size_t HUF_buildCTable_wksp ( HUF_CElt tree,
const unsigned *  count,
U32  maxSymbolValue,
U32  maxNbBits,
void *  workSpace,
size_t  wkspSize 
)

Definition at line 12778 of file zstd.c.

◆ HUF_buildCTableFromTree()

static void HUF_buildCTableFromTree ( HUF_CElt CTable,
nodeElt const *  huffNode,
int  nonNullRank,
U32  maxSymbolValue,
U32  maxNbBits 
)
static

HUF_buildCTableFromTree(): Build the CTable given the Huffman tree in huffNode.

Parameters
[out]CTableThe output Huffman CTable.
huffNodeThe Huffman tree.
nonNullRankThe last and smallest node in the Huffman tree.
maxSymbolValueThe maximum symbol value.
maxNbBitsThe exact maximum number of bits used in the Huffman tree.

Definition at line 12753 of file zstd.c.

◆ HUF_buildDEltX2()

static HUF_DEltX2 HUF_buildDEltX2 ( U32  symbol,
U32  nbBits,
U32  baseSeq,
int  level 
)
static

Constructs a HUF_DEltX2.

Definition at line 33797 of file zstd.c.

◆ HUF_buildDEltX2U32()

static U32 HUF_buildDEltX2U32 ( U32  symbol,
U32  nbBits,
U32  baseSeq,
int  level 
)
static

Constructs a HUF_DEltX2 in a U32.

Definition at line 33778 of file zstd.c.

◆ HUF_buildDEltX2U64()

static U64 HUF_buildDEltX2U64 ( U32  symbol,
U32  nbBits,
U16  baseSeq,
int  level 
)
static

Constructs 2 HUF_DEltX2s and packs them into a U64.

Definition at line 33809 of file zstd.c.

◆ HUF_buildTree()

static int HUF_buildTree ( nodeElt huffNode,
U32  maxSymbolValue 
)
static

Definition at line 12704 of file zstd.c.

◆ HUF_cardinality()

unsigned HUF_cardinality ( const unsigned *  count,
unsigned  maxSymbolValue 
)

Definition at line 13269 of file zstd.c.

◆ HUF_closeCStream()

static size_t HUF_closeCStream ( HUF_CStream_t bitC)
static

HUF_closeCStream() :

Returns
Size of CStream, in bytes, or 0 if it could not fit into dstBuffer

Definition at line 12988 of file zstd.c.

◆ HUF_compress1X_repeat()

size_t HUF_compress1X_repeat ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
unsigned  maxSymbolValue,
unsigned  tableLog,
void *  workSpace,
size_t  wkspSize,
HUF_CElt hufTable,
HUF_repeat repeat,
int  flags 
)

HUF_compress1X_repeat() : Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. If it uses hufTable it does not modify hufTable or repeat. If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. If preferRepeat then the old table will always be used if valid. If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding

Parameters
wkspSize`workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE

Definition at line 13455 of file zstd.c.

◆ HUF_compress1X_usingCTable()

size_t HUF_compress1X_usingCTable ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
const HUF_CElt CTable,
int  flags 
)

Definition at line 13177 of file zstd.c.

◆ HUF_compress1X_usingCTable_internal()

static size_t HUF_compress1X_usingCTable_internal ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
const HUF_CElt CTable,
const int  flags 
)
static

Definition at line 13167 of file zstd.c.

◆ HUF_compress1X_usingCTable_internal_body()

FORCE_INLINE_TEMPLATE size_t HUF_compress1X_usingCTable_internal_body ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
const HUF_CElt CTable 
)

Definition at line 13071 of file zstd.c.

◆ HUF_compress1X_usingCTable_internal_body_loop()

FORCE_INLINE_TEMPLATE void HUF_compress1X_usingCTable_internal_body_loop ( HUF_CStream_t bitC,
const BYTE ip,
size_t  srcSize,
const HUF_CElt ct,
int  kUnroll,
int  kFastFlush,
int  kLastFast 
)

Definition at line 13006 of file zstd.c.

◆ HUF_compress4X_repeat()

size_t HUF_compress4X_repeat ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
unsigned  maxSymbolValue,
unsigned  tableLog,
void *  workSpace,
size_t  wkspSize,
HUF_CElt hufTable,
HUF_repeat repeat,
int  flags 
)

HUF_compress4X_repeat() : Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. If it uses hufTable it does not modify hufTable or repeat. If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. If preferRepeat then the old table will always be used if valid. If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding

Parameters
wkspSize`workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE

Definition at line 13472 of file zstd.c.

◆ HUF_compress4X_usingCTable()

size_t HUF_compress4X_usingCTable ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
const HUF_CElt CTable,
int  flags 
)

Definition at line 13232 of file zstd.c.

◆ HUF_compress4X_usingCTable_internal()

static size_t HUF_compress4X_usingCTable_internal ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
const HUF_CElt CTable,
int  flags 
)
static

Definition at line 13183 of file zstd.c.

◆ HUF_compress_internal()

static size_t HUF_compress_internal ( void *  dst,
size_t  dstSize,
const void *  src,
size_t  srcSize,
unsigned  maxSymbolValue,
unsigned  huffLog,
HUF_nbStreams_e  nbStreams,
void *  workSpace,
size_t  wkspSize,
HUF_CElt oldHufTable,
HUF_repeat repeat,
int  flags 
)
static

Definition at line 13346 of file zstd.c.

◆ HUF_compressBound()

size_t HUF_compressBound ( size_t  size)

maximum compressed size (worst case)

Definition at line 12836 of file zstd.c.

◆ HUF_compressCTable_internal()

static size_t HUF_compressCTable_internal ( BYTE *const  ostart,
BYTE op,
BYTE *const  oend,
const void *  src,
size_t  srcSize,
HUF_nbStreams_e  nbStreams,
const HUF_CElt CTable,
const int  flags 
)
static

Definition at line 13239 of file zstd.c.

◆ HUF_compressWeights()

static size_t HUF_compressWeights ( void *  dst,
size_t  dstSize,
const void *  weightTable,
size_t  wtSize,
void *  workspace,
size_t  workspaceSize 
)
static

Definition at line 12195 of file zstd.c.

◆ HUF_decodeLastSymbolX2()

FORCE_INLINE_TEMPLATE U32 HUF_decodeLastSymbolX2 ( void *  op,
BIT_DStream_t DStream,
const HUF_DEltX2 dt,
const U32  dtLog 
)

Definition at line 34092 of file zstd.c.

◆ HUF_decodeStreamX1()

HINT_INLINE size_t HUF_decodeStreamX1 ( BYTE p,
BIT_DStream_t *const  bitDPtr,
BYTE *const  pEnd,
const HUF_DEltX1 *const  dt,
const U32  dtLog 
)

Definition at line 33382 of file zstd.c.

◆ HUF_decodeStreamX2()

HINT_INLINE size_t HUF_decodeStreamX2 ( BYTE p,
BIT_DStream_t bitDPtr,
BYTE *const  pEnd,
const HUF_DEltX2 *const  dt,
const U32  dtLog 
)

Definition at line 34121 of file zstd.c.

◆ HUF_decodeSymbolX1()

FORCE_INLINE_TEMPLATE BYTE HUF_decodeSymbolX1 ( BIT_DStream_t Dstream,
const HUF_DEltX1 dt,
const U32  dtLog 
)

Definition at line 33362 of file zstd.c.

◆ HUF_decodeSymbolX2()

FORCE_INLINE_TEMPLATE U32 HUF_decodeSymbolX2 ( void *  op,
BIT_DStream_t DStream,
const HUF_DEltX2 dt,
const U32  dtLog 
)

Definition at line 34083 of file zstd.c.

◆ HUF_decompress1X1_DCtx_wksp()

size_t HUF_decompress1X1_DCtx_wksp ( HUF_DTable dctx,
void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)

Definition at line 34700 of file zstd.c.

◆ HUF_decompress1X1_usingDTable_internal_body()

FORCE_INLINE_TEMPLATE size_t HUF_decompress1X1_usingDTable_internal_body ( void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable 
)

Definition at line 33411 of file zstd.c.

◆ HUF_decompress1X2_DCtx_wksp()

size_t HUF_decompress1X2_DCtx_wksp ( HUF_DTable dctx,
void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)

double-symbols decoder

Definition at line 34560 of file zstd.c.

◆ HUF_decompress1X2_usingDTable_internal_body()

FORCE_INLINE_TEMPLATE size_t HUF_decompress1X2_usingDTable_internal_body ( void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable 
)

Definition at line 34166 of file zstd.c.

◆ HUF_decompress1X_DCtx_wksp()

size_t HUF_decompress1X_DCtx_wksp ( HUF_DTable dctx,
void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)

Definition at line 34651 of file zstd.c.

◆ HUF_decompress1X_usingDTable()

size_t HUF_decompress1X_usingDTable ( void *  dst,
size_t  maxDstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable,
int  flags 
)

Definition at line 34682 of file zstd.c.

◆ HUF_decompress4X1_DCtx_wksp()

static size_t HUF_decompress4X1_DCtx_wksp ( HUF_DTable dctx,
void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)
static

Definition at line 33747 of file zstd.c.

◆ HUF_decompress4X1_usingDTable_internal()

static size_t HUF_decompress4X1_usingDTable_internal ( void *  dst,
size_t  dstSize,
void const *  cSrc,
size_t  cSrcSize,
HUF_DTable const *  DTable,
int  flags 
)
static

Definition at line 33714 of file zstd.c.

◆ HUF_decompress4X1_usingDTable_internal_body()

FORCE_INLINE_TEMPLATE size_t HUF_decompress4X1_usingDTable_internal_body ( void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable 
)

Definition at line 33438 of file zstd.c.

◆ HUF_decompress4X1_usingDTable_internal_default()

static size_t HUF_decompress4X1_usingDTable_internal_default ( void *  dst,
size_t  dstSize,
void const *  cSrc,
size_t  cSrcSize,
HUF_DTable const *  DTable 
)
static

Definition at line 33544 of file zstd.c.

◆ HUF_decompress4X1_usingDTable_internal_fast()

static HUF_FAST_BMI2_ATTRS size_t HUF_decompress4X1_usingDTable_internal_fast ( void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable,
HUF_DecompressFastLoopFn  loopFn 
)
static
Returns
dstSize on success (>= 6) 0 if the fallback implementation should be used An error if an error occurred

Definition at line 33661 of file zstd.c.

◆ HUF_decompress4X1_usingDTable_internal_fast_c_loop()

static HUF_FAST_BMI2_ATTRS void HUF_decompress4X1_usingDTable_internal_fast_c_loop ( HUF_DecompressFastArgs args)
static

Definition at line 33556 of file zstd.c.

◆ HUF_decompress4X2_DCtx_wksp()

static size_t HUF_decompress4X2_DCtx_wksp ( HUF_DTable dctx,
void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)
static

Definition at line 34575 of file zstd.c.

◆ HUF_decompress4X2_usingDTable_internal()

static size_t HUF_decompress4X2_usingDTable_internal ( void *  dst,
size_t  dstSize,
void const *  cSrc,
size_t  cSrcSize,
HUF_DTable const *  DTable,
int  flags 
)
static

Definition at line 34525 of file zstd.c.

◆ HUF_decompress4X2_usingDTable_internal_body()

FORCE_INLINE_TEMPLATE size_t HUF_decompress4X2_usingDTable_internal_body ( void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable 
)

Definition at line 34197 of file zstd.c.

◆ HUF_decompress4X2_usingDTable_internal_default()

static size_t HUF_decompress4X2_usingDTable_internal_default ( void *  dst,
size_t  dstSize,
void const *  cSrc,
size_t  cSrcSize,
HUF_DTable const *  DTable 
)
static

Definition at line 34324 of file zstd.c.

◆ HUF_decompress4X2_usingDTable_internal_fast()

static HUF_FAST_BMI2_ATTRS size_t HUF_decompress4X2_usingDTable_internal_fast ( void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable,
HUF_DecompressFastLoopFn  loopFn 
)
static

Definition at line 34476 of file zstd.c.

◆ HUF_decompress4X2_usingDTable_internal_fast_c_loop()

static HUF_FAST_BMI2_ATTRS void HUF_decompress4X2_usingDTable_internal_fast_c_loop ( HUF_DecompressFastArgs args)
static

Definition at line 34336 of file zstd.c.

◆ HUF_decompress4X_hufOnly_wksp()

size_t HUF_decompress4X_hufOnly_wksp ( HUF_DTable dctx,
void *  dst,
size_t  dstSize,
const void *  cSrc,
size_t  cSrcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)

Definition at line 34730 of file zstd.c.

◆ HUF_decompress4X_usingDTable()

size_t HUF_decompress4X_usingDTable ( void *  dst,
size_t  maxDstSize,
const void *  cSrc,
size_t  cSrcSize,
const HUF_DTable DTable,
int  flags 
)

Definition at line 34713 of file zstd.c.

◆ HUF_DecompressFastArgs_init()

static size_t HUF_DecompressFastArgs_init ( HUF_DecompressFastArgs args,
void *  dst,
size_t  dstSize,
void const *  src,
size_t  srcSize,
const HUF_DTable DTable 
)
static

Initializes args for the fast decoding loop.

Returns
1 on success 0 if the fallback implementation should be used. Or an error code on failure.

Definition at line 33052 of file zstd.c.

◆ HUF_DEltX1_set4()

static U64 HUF_DEltX1_set4 ( BYTE  symbol,
BYTE  nbBits 
)
static

Packs 4 HUF_DEltX1 structs into a U64. This is used to lay down 4 entries at a time.

Definition at line 33175 of file zstd.c.

◆ HUF_encodeSymbol()

FORCE_INLINE_TEMPLATE void HUF_encodeSymbol ( HUF_CStream_t bitCPtr,
U32  symbol,
const HUF_CElt CTable,
int  idx,
int  fast 
)

Definition at line 13000 of file zstd.c.

◆ HUF_endMark()

static HUF_CElt HUF_endMark ( void  )
static

HUF_endMark()

Returns
The Huffman stream end mark: A 1-bit value = 1.

Definition at line 12977 of file zstd.c.

◆ HUF_estimateCompressedSize()

size_t HUF_estimateCompressedSize ( const HUF_CElt CTable,
const unsigned *  count,
unsigned  maxSymbolValue 
)

Definition at line 12815 of file zstd.c.

◆ HUF_fillDTableX2()

static void HUF_fillDTableX2 ( HUF_DEltX2 DTable,
const U32  targetLog,
const sortedSymbol_t sortedList,
const U32 rankStart,
rankValCol_t rankValOrigin,
const U32  maxWeight,
const U32  nbBitsBaseline 
)
static

Definition at line 33941 of file zstd.c.

◆ HUF_fillDTableX2ForWeight()

static void HUF_fillDTableX2ForWeight ( HUF_DEltX2 DTableRank,
sortedSymbol_t const *  begin,
sortedSymbol_t const *  end,
U32  nbBits,
U32  tableLog,
U16  baseSeq,
int const  level 
)
static

Fills the DTable rank with all the symbols from [begin, end) that are each nbBits long.

Parameters
DTableRankThe start of the rank in the DTable.
beginThe first symbol to fill (inclusive).
endThe last symbol to fill (exclusive).
nbBitsEach symbol is nbBits long.
tableLogThe table log.
baseSeqIf level == 1 { 0 } else { the first level symbol }
levelThe level in the table. Must be 1 or 2.

Definition at line 33827 of file zstd.c.

◆ HUF_fillDTableX2Level2()

static void HUF_fillDTableX2Level2 ( HUF_DEltX2 DTable,
U32  targetLog,
const U32  consumedBits,
const U32 rankVal,
const int  minWeight,
const int  maxWeight1,
const sortedSymbol_t sortedSymbols,
U32 const *  rankStart,
U32  nbBitsBaseline,
U16  baseSeq 
)
static

Definition at line 33886 of file zstd.c.

◆ HUF_flushBits()

FORCE_INLINE_TEMPLATE void HUF_flushBits ( HUF_CStream_t bitC,
int  kFast 
)

HUF_flushBits() : Flushes the bits in the bit container @ index 0.

Postcondition
bitPos will be < 8.
Parameters
kFastIf kFast is set then we must know a-priori that the bit container will not overflow.

Definition at line 12952 of file zstd.c.

◆ HUF_getDTableDesc()

static DTableDesc HUF_getDTableDesc ( const HUF_DTable table)
static

Definition at line 33005 of file zstd.c.

◆ HUF_getErrorName()

const char * HUF_getErrorName ( size_t  code)

provides error code string (useful for debugging)

Definition at line 3119 of file zstd.c.

◆ HUF_getIndex()

static U32 HUF_getIndex ( U32 const  count)
static

Definition at line 12553 of file zstd.c.

◆ HUF_getNbBits()

static size_t HUF_getNbBits ( HUF_CElt  elt)
static

Definition at line 12236 of file zstd.c.

◆ HUF_getNbBitsFast()

static size_t HUF_getNbBitsFast ( HUF_CElt  elt)
static

Definition at line 12241 of file zstd.c.

◆ HUF_getNbBitsFromCTable()

U32 HUF_getNbBitsFromCTable ( const HUF_CElt symbolTable,
U32  symbolValue 
)

HUF_getNbBitsFromCTable() : Read nbBits from CTable symbolTable, for symbol symbolValue presumed <= HUF_SYMBOLVALUE_MAX Note 1 : is not inlined, as HUF_CElt definition is private

Definition at line 12370 of file zstd.c.

◆ HUF_getValue()

static size_t HUF_getValue ( HUF_CElt  elt)
static

Definition at line 12246 of file zstd.c.

◆ HUF_getValueFast()

static size_t HUF_getValueFast ( HUF_CElt  elt)
static

Definition at line 12251 of file zstd.c.

◆ HUF_initCStream()

static size_t HUF_initCStream ( HUF_CStream_t bitC,
void *  startPtr,
size_t  dstCapacity 
)
static

! HUF_initCStream(): Initializes the bitstream.

Returns
0 or an error code.

Definition at line 12871 of file zstd.c.

◆ HUF_initFastDStream()

static size_t HUF_initFastDStream ( BYTE const *  ip)
static

Definition at line 33012 of file zstd.c.

◆ HUF_initRemainingDStream()

static size_t HUF_initRemainingDStream ( BIT_DStream_t bit,
HUF_DecompressFastArgs const *  args,
int  stream,
BYTE segmentEnd 
)
static

Definition at line 33139 of file zstd.c.

◆ HUF_insertionSort()

HINT_INLINE void HUF_insertionSort ( nodeElt  huffNode[],
int const  low,
int const  high 
)

Definition at line 12578 of file zstd.c.

◆ HUF_isError()

unsigned HUF_isError ( size_t  code)

tells if a return value is an error code

Definition at line 3118 of file zstd.c.

◆ HUF_isSorted()

MEM_STATIC int HUF_isSorted ( nodeElt  huffNode[],
U32 const  maxSymbolValue1 
)

Definition at line 12567 of file zstd.c.

◆ HUF_mergeIndex1()

FORCE_INLINE_TEMPLATE void HUF_mergeIndex1 ( HUF_CStream_t bitC)

HUF_mergeIndex1() : Merges the bit container @ index 1 into the bit container @ index 0 and zeros the bit container @ index 1.

Definition at line 12936 of file zstd.c.

◆ HUF_minTableLog()

unsigned HUF_minTableLog ( unsigned  symbolCardinality)

HUF_compress() does the following:

  1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within "fse.h")
  2. (optional) refine tableLog using HUF_optimalTableLog()
  3. build Huffman table from count using HUF_buildCTable()
  4. save Huffman table to memory buffer using HUF_writeCTable()
  5. encode the data stream using HUF_compress4X_usingCTable()

The following API allows targeting specific sub-functions for advanced tasks. For example, it's possible to compress several blocks using the same 'CTable', or to save and regenerate 'CTable' using external methods.

Definition at line 13281 of file zstd.c.

◆ HUF_optimalTableLog()

unsigned HUF_optimalTableLog ( unsigned  maxTableLog,
size_t  srcSize,
unsigned  maxSymbolValue,
void *  workSpace,
size_t  wkspSize,
HUF_CElt table,
const unsigned *  count,
int  flags 
)

Definition at line 13287 of file zstd.c.

◆ HUF_quickSortPartition()

static int HUF_quickSortPartition ( nodeElt  arr[],
int const  low,
int const  high 
)
static

Definition at line 12594 of file zstd.c.

◆ HUF_readCTable()

size_t HUF_readCTable ( HUF_CElt CTable,
unsigned *  maxSymbolValuePtr,
const void *  src,
size_t  srcSize,
unsigned *  hasZeroWeights 
)

HUF_readCTable() : Loading a CTable saved with HUF_writeCTable()

Definition at line 12318 of file zstd.c.

◆ HUF_readDTableX1_wksp()

size_t HUF_readDTableX1_wksp ( HUF_DTable DTable,
const void *  src,
size_t  srcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)

Definition at line 33225 of file zstd.c.

◆ HUF_readDTableX2_wksp()

size_t HUF_readDTableX2_wksp ( HUF_DTable DTable,
const void *  src,
size_t  srcSize,
void *  workSpace,
size_t  wkspSize,
int  flags 
)

Definition at line 33996 of file zstd.c.

◆ HUF_readStats()

size_t HUF_readStats ( BYTE huffWeight,
size_t  hwSize,
U32 rankStats,
U32 nbSymbolsPtr,
U32 tableLogPtr,
const void *  src,
size_t  srcSize 
)

HUF_readStats() : Read compact Huffman tree, saved by HUF_writeCTable(). huffWeight is destination buffer.

Returns
: size read from src , or an error Code . Note : Needed by HUF_readCTable() and HUF_readDTableXn() .

HUF_readStats() : Read compact Huffman tree, saved by HUF_writeCTable(). huffWeight is destination buffer. rankStats is assumed to be a table of at least HUF_TABLELOG_MAX U32.

Returns
: size read from src , or an error Code . Note : Needed by HUF_readCTable() and HUF_readDTableX?() .

Definition at line 3318 of file zstd.c.

◆ HUF_readStats_body()

FORCE_INLINE_TEMPLATE size_t HUF_readStats_body ( BYTE huffWeight,
size_t  hwSize,
U32 rankStats,
U32 nbSymbolsPtr,
U32 tableLogPtr,
const void *  src,
size_t  srcSize,
void *  workSpace,
size_t  wkspSize,
int  bmi2 
)

Definition at line 3327 of file zstd.c.

◆ HUF_readStats_body_default()

static size_t HUF_readStats_body_default ( BYTE huffWeight,
size_t  hwSize,
U32 rankStats,
U32 nbSymbolsPtr,
U32 tableLogPtr,
const void *  src,
size_t  srcSize,
void *  workSpace,
size_t  wkspSize 
)
static

Definition at line 3393 of file zstd.c.

◆ HUF_readStats_wksp()

size_t HUF_readStats_wksp ( BYTE huffWeight,
size_t  hwSize,
U32 rankStats,
U32 nbSymbolsPtr,
U32 tableLogPtr,
const void *  src,
size_t  srcSize,
void *  workspace,
size_t  wkspSize,
int  flags 
)

Definition at line 3411 of file zstd.c.

◆ HUF_rescaleStats()

static U32 HUF_rescaleStats ( BYTE huffWeight,
U32 rankVal,
U32  nbSymbols,
U32  tableLog,
U32  targetTableLog 
)
static

Increase the tableLog to targetTableLog and rescales the stats. If tableLog > targetTableLog this is a no-op.

Returns
New tableLog

Definition at line 33192 of file zstd.c.

◆ HUF_selectDecoder()

U32 HUF_selectDecoder ( size_t  dstSize,
size_t  cSrcSize 
)

HUF_selectDecoder() : Tells which decoder is likely to decode faster, based on a set of pre-computed metrics.

Returns
: 0==HUF_decompress4X1, 1==HUF_decompress4X2 . Assumption : 0 < dstSize <= 128 KB

Definition at line 34627 of file zstd.c.

◆ HUF_setMaxHeight()

static U32 HUF_setMaxHeight ( nodeElt huffNode,
U32  lastNonNull,
U32  targetNbBits 
)
static

HUF_setMaxHeight(): Try to enforce @targetNbBits on the Huffman tree described in @huffNode.

It attempts to convert all nodes with nbBits > @targetNbBits to employ @targetNbBits instead. Then it adjusts the tree so that it remains a valid canonical Huffman tree.

Precondition
The sum of the ranks of each symbol == 2^largestBits, where largestBits == huffNode[lastNonNull].nbBits.
Postcondition
The sum of the ranks of each symbol == 2^largestBits, where largestBits is the return value (expected <= targetNbBits).
Parameters
huffNodeThe Huffman tree modified in place to enforce targetNbBits. It's presumed sorted, from most frequent to rarest symbol.
lastNonNullThe symbol with the lowest count in the Huffman tree.
targetNbBitsThe allowed number of bits, which the Huffman tree may not respect. After this function the Huffman tree will respect targetNbBits.
Returns
The maximum number of bits of the Huffman tree after adjustment.

Definition at line 12399 of file zstd.c.

◆ HUF_setNbBits()

static void HUF_setNbBits ( HUF_CElt elt,
size_t  nbBits 
)
static

Definition at line 12256 of file zstd.c.

◆ HUF_setValue()

static void HUF_setValue ( HUF_CElt elt,
size_t  value 
)
static

Definition at line 12262 of file zstd.c.

◆ HUF_simpleQuickSort()

static void HUF_simpleQuickSort ( nodeElt  arr[],
int  low,
int  high 
)
static

Definition at line 12614 of file zstd.c.

◆ HUF_sort()

static void HUF_sort ( nodeElt  huffNode[],
const unsigned  count[],
U32 const  maxSymbolValue,
rankPos  rankPosition[] 
)
static

HUF_sort(): Sorts the symbols [0, maxSymbolValue] by count[symbol] in decreasing order. This is a typical bucket sorting strategy that uses either quicksort or insertion sort to sort each bucket.

Parameters
[out]huffNodeSorted symbols by decreasing count. Only members .count and .byte are filled. Must have (maxSymbolValue + 1) entries.
[in]countHistogram of the symbols.
[in]maxSymbolValueMaximum symbol value.
rankPositionThis is a scratch workspace. Must have RANK_POSITION_TABLE_SIZE entries.

Definition at line 12643 of file zstd.c.

◆ HUF_swapNodes()

static void HUF_swapNodes ( nodeElt a,
nodeElt b 
)
static

Definition at line 12560 of file zstd.c.

◆ HUF_tightCompressBound()

static size_t HUF_tightCompressBound ( size_t  srcSize,
size_t  tableLog 
)
static

Returns a tight upper bound on the output space needed by Huffman with 8 bytes buffer to handle over-writes. If the output is at least this large we don't need to do bounds checks during Huffman encoding.

Definition at line 13064 of file zstd.c.

◆ HUF_validateCTable()

int HUF_validateCTable ( const HUF_CElt CTable,
const unsigned *  count,
unsigned  maxSymbolValue 
)

Definition at line 12826 of file zstd.c.

◆ HUF_writeCTable_wksp()

size_t HUF_writeCTable_wksp ( void *  dst,
size_t  maxDstSize,
const HUF_CElt CTable,
unsigned  maxSymbolValue,
unsigned  huffLog,
void *  workspace,
size_t  workspaceSize 
)

Definition at line 12277 of file zstd.c.

◆ HUF_zeroIndex1()

FORCE_INLINE_TEMPLATE void HUF_zeroIndex1 ( HUF_CStream_t bitC)

Definition at line 12926 of file zstd.c.

◆ inBuffer_forEndFlush()

static ZSTD_inBuffer inBuffer_forEndFlush ( const ZSTD_CStream zcs)
static

Definition at line 24476 of file zstd.c.

◆ isIncluded()

static int isIncluded ( const void *  in,
const void *  container,
size_t  length 
)
static

Definition at line 44887 of file zstd.c.

◆ isQueueFull()

static int isQueueFull ( POOL_ctx const *  ctx)
static

Returns 1 if the queue is full and 0 otherwise.

When queueSize is 1 (pool was created with an intended queueSize of 0), then a queue is empty if there is a thread free and no job is waiting.

Definition at line 4542 of file zstd.c.

◆ maybeSplitSequence()

static rawSeq maybeSplitSequence ( rawSeqStore_t rawSeqStore,
U32 const  remaining,
U32 const  minMatch 
)
static

If the sequence length is longer than remaining then the sequence is split between this block and the next.

Returns the current sequence to handle, or if the rest of the block should be literals, it returns a sequence with offset == 0.

Definition at line 29415 of file zstd.c.

◆ MEM_32bits()

MEM_STATIC unsigned MEM_32bits ( void  )

Definition at line 987 of file zstd.c.

◆ MEM_64bits()

MEM_STATIC unsigned MEM_64bits ( void  )

Definition at line 988 of file zstd.c.

◆ MEM_check()

MEM_STATIC void MEM_check ( void  )

Definition at line 1266 of file zstd.c.

◆ MEM_isLittleEndian()

MEM_STATIC unsigned MEM_isLittleEndian ( void  )

Definition at line 990 of file zstd.c.

◆ MEM_read16()

MEM_STATIC U16 MEM_read16 ( const void *  memPtr)

Definition at line 1044 of file zstd.c.

◆ MEM_read32()

MEM_STATIC U32 MEM_read32 ( const void *  memPtr)

Definition at line 1049 of file zstd.c.

◆ MEM_read64()

MEM_STATIC U64 MEM_read64 ( const void *  memPtr)

Definition at line 1054 of file zstd.c.

◆ MEM_readBE32()

MEM_STATIC U32 MEM_readBE32 ( const void *  memPtr)

Definition at line 1217 of file zstd.c.

◆ MEM_readBE64()

MEM_STATIC U64 MEM_readBE64 ( const void *  memPtr)

Definition at line 1233 of file zstd.c.

◆ MEM_readBEST()

MEM_STATIC size_t MEM_readBEST ( const void *  memPtr)

Definition at line 1249 of file zstd.c.

◆ MEM_readLE16()

MEM_STATIC U16 MEM_readLE16 ( const void *  memPtr)

Definition at line 1135 of file zstd.c.

◆ MEM_readLE24()

MEM_STATIC U32 MEM_readLE24 ( const void *  memPtr)

Definition at line 1156 of file zstd.c.

◆ MEM_readLE32()

MEM_STATIC U32 MEM_readLE32 ( const void *  memPtr)

Definition at line 1167 of file zstd.c.

◆ MEM_readLE64()

MEM_STATIC U64 MEM_readLE64 ( const void *  memPtr)

Definition at line 1183 of file zstd.c.

◆ MEM_readLEST()

MEM_STATIC size_t MEM_readLEST ( const void *  memPtr)

Definition at line 1199 of file zstd.c.

◆ MEM_readST()

MEM_STATIC size_t MEM_readST ( const void *  memPtr)

Definition at line 1059 of file zstd.c.

◆ MEM_swap32()

MEM_STATIC U32 MEM_swap32 ( U32  in)

Definition at line 1089 of file zstd.c.

◆ MEM_swap32_fallback()

MEM_STATIC U32 MEM_swap32_fallback ( U32  in)

Definition at line 1081 of file zstd.c.

◆ MEM_swap64()

MEM_STATIC U64 MEM_swap64 ( U64  in)

Definition at line 1113 of file zstd.c.

◆ MEM_swap64_fallback()

MEM_STATIC U64 MEM_swap64_fallback ( U64  in)

Definition at line 1101 of file zstd.c.

◆ MEM_swapST()

MEM_STATIC size_t MEM_swapST ( size_t  in)

Definition at line 1125 of file zstd.c.

◆ MEM_write16()

MEM_STATIC void MEM_write16 ( void *  memPtr,
U16  value 
)

Definition at line 1064 of file zstd.c.

◆ MEM_write32()

MEM_STATIC void MEM_write32 ( void *  memPtr,
U32  value 
)

Definition at line 1069 of file zstd.c.

◆ MEM_write64()

MEM_STATIC void MEM_write64 ( void *  memPtr,
U64  value 
)

Definition at line 1074 of file zstd.c.

◆ MEM_writeBE32()

MEM_STATIC void MEM_writeBE32 ( void *  memPtr,
U32  val32 
)

Definition at line 1225 of file zstd.c.

◆ MEM_writeBE64()

MEM_STATIC void MEM_writeBE64 ( void *  memPtr,
U64  val64 
)

Definition at line 1241 of file zstd.c.

◆ MEM_writeBEST()

MEM_STATIC void MEM_writeBEST ( void *  memPtr,
size_t  val 
)

Definition at line 1257 of file zstd.c.

◆ MEM_writeLE16()

MEM_STATIC void MEM_writeLE16 ( void *  memPtr,
U16  val 
)

Definition at line 1145 of file zstd.c.

◆ MEM_writeLE24()

MEM_STATIC void MEM_writeLE24 ( void *  memPtr,
U32  val 
)

Definition at line 1161 of file zstd.c.

◆ MEM_writeLE32()

MEM_STATIC void MEM_writeLE32 ( void *  memPtr,
U32  val32 
)

Definition at line 1175 of file zstd.c.

◆ MEM_writeLE64()

MEM_STATIC void MEM_writeLE64 ( void *  memPtr,
U64  val64 
)

Definition at line 1191 of file zstd.c.

◆ MEM_writeLEST()

MEM_STATIC void MEM_writeLEST ( void *  memPtr,
size_t  val 
)

Definition at line 1207 of file zstd.c.

◆ POOL_add()

void POOL_add ( POOL_ctx ctx,
POOL_function  function,
void *  opaque 
)

POOL_add() : Add the job function(opaque) to the thread pool. ctx must be valid. Possibly blocks until there is room in the queue. Note : The function may be executed asynchronously, therefore, opaque must live until function has been completed.

Definition at line 4567 of file zstd.c.

◆ POOL_add_internal()

static void POOL_add_internal ( POOL_ctx ctx,
POOL_function  function,
void *  opaque 
)
static

Definition at line 4553 of file zstd.c.

◆ POOL_create()

POOL_ctx * POOL_create ( size_t  numThreads,
size_t  queueSize 
)

POOL_create() : Create a thread pool with at most numThreads threads. numThreads must be at least 1. The maximum number of queued jobs before blocking is queueSize.

Returns
: POOL_ctx pointer on success, else NULL.

Definition at line 4392 of file zstd.c.

◆ POOL_create_advanced()

POOL_ctx * POOL_create_advanced ( size_t  numThreads,
size_t  queueSize,
ZSTD_customMem  customMem 
)

Definition at line 4396 of file zstd.c.

◆ POOL_free()

void POOL_free ( POOL_ctx ctx)

POOL_free() : Free a thread pool returned by POOL_create().

Definition at line 4461 of file zstd.c.

◆ POOL_join()

static void POOL_join ( POOL_ctx ctx)
static

POOL_join() : Shutdown the queue, wake any sleeping threads, and join all of the threads.

Definition at line 4446 of file zstd.c.

◆ POOL_joinJobs()

void POOL_joinJobs ( POOL_ctx ctx)

POOL_joinJobs() : Waits for all queued jobs to finish executing.

Definition at line 4475 of file zstd.c.

◆ POOL_resize()

int POOL_resize ( POOL_ctx ctx,
size_t  numThreads 
)

POOL_resize() : Expands or shrinks pool's number of threads. This is more efficient than releasing + creating a new context, since it tries to preserve and re-use existing threads. numThreads must be at least 1.

Returns
: 0 when resize was successful, !0 (typically 1) if there is an error. note : only numThreads can be resized, queueSize remains unchanged.

Definition at line 4525 of file zstd.c.

◆ POOL_resize_internal()

static int POOL_resize_internal ( POOL_ctx ctx,
size_t  numThreads 
)
static

Definition at line 4496 of file zstd.c.

◆ POOL_sizeof()

size_t POOL_sizeof ( const POOL_ctx ctx)

POOL_sizeof() :

Returns
threadpool memory usage note : compatible with NULL (returns 0 in this case)

Definition at line 4487 of file zstd.c.

◆ POOL_thread()

static void* POOL_thread ( void *  opaque)
static

Definition at line 4348 of file zstd.c.

◆ POOL_tryAdd()

int POOL_tryAdd ( POOL_ctx ctx,
POOL_function  function,
void *  opaque 
)

POOL_tryAdd() : Add the job function(opaque) to thread pool if a queue slot is available. Returns immediately even if not (does not block).

Returns
: 1 if successful, 0 if not.

Definition at line 4580 of file zstd.c.

◆ readSkippableFrameSize()

static size_t readSkippableFrameSize ( void const *  src,
size_t  srcSize 
)
static

Definition at line 35934 of file zstd.c.

◆ seqToBuffer()

static buffer_t seqToBuffer ( rawSeqStore_t  seq)
static

Definition at line 31290 of file zstd.c.

◆ setDictSelection()

static COVER_dictSelection_t setDictSelection ( BYTE buf,
size_t  s,
size_t  csz 
)
static

Definition at line 41492 of file zstd.c.

◆ sort_typeBstar()

static int sort_typeBstar ( const unsigned char *  T,
int *  SA,
int *  bucket_A,
int *  bucket_B,
int  n,
int  openMP 
)
static

Definition at line 43306 of file zstd.c.

◆ ss_blockswap()

static INLINE void ss_blockswap ( int *  a,
int *  b,
int  n 
)
static

Definition at line 42407 of file zstd.c.

◆ ss_compare()

static INLINE int ss_compare ( const unsigned char *  T,
const int *  p1,
const int *  p2,
int  depth 
)
static

Definition at line 42096 of file zstd.c.

◆ ss_inplacemerge()

static void ss_inplacemerge ( const unsigned char *  T,
const int *  PA,
int *  first,
int *  middle,
int *  last,
int  depth 
)
static

Definition at line 42457 of file zstd.c.

◆ ss_insertionsort()

static void ss_insertionsort ( const unsigned char *  T,
const int *  PA,
int *  first,
int *  last,
int  depth 
)
static

Definition at line 42122 of file zstd.c.

◆ ss_isqrt()

static INLINE int ss_isqrt ( int  x)
static

Definition at line 42063 of file zstd.c.

◆ ss_mergebackward()

static void ss_mergebackward ( const unsigned char *  T,
const int *  PA,
int *  first,
int *  middle,
int *  last,
int *  buf,
int  depth 
)
static

Definition at line 42550 of file zstd.c.

◆ ss_mergeforward()

static void ss_mergeforward ( const unsigned char *  T,
const int *  PA,
int *  first,
int *  middle,
int *  last,
int *  buf,
int  depth 
)
static

Definition at line 42500 of file zstd.c.

◆ ss_rotate()

static INLINE void ss_rotate ( int *  first,
int *  middle,
int *  last 
)
static

Definition at line 42416 of file zstd.c.

◆ ss_swapmerge()

static void ss_swapmerge ( const unsigned char *  T,
const int *  PA,
int *  first,
int *  middle,
int *  last,
int *  buf,
int  bufsize,
int  depth 
)
static

Definition at line 42609 of file zstd.c.

◆ sssort()

static void sssort ( const unsigned char *  T,
const int *  PA,
int *  first,
int *  last,
int *  buf,
int  bufsize,
int  depth,
int  n,
int  lastsuffix 
)
static

Definition at line 42701 of file zstd.c.

◆ sum_u32()

static U32 sum_u32 ( const unsigned  table[],
size_t  nbElts 
)
static

Definition at line 29611 of file zstd.c.

◆ tr_copy()

static void tr_copy ( int *  ISA,
const int *  SA,
int *  first,
int *  a,
int *  b,
int *  last,
int  depth 
)
static

Definition at line 42977 of file zstd.c.

◆ tr_fixdown()

static INLINE void tr_fixdown ( const int *  ISAd,
int *  SA,
int  i,
int  size 
)
static

Definition at line 42811 of file zstd.c.

◆ tr_heapsort()

static void tr_heapsort ( const int *  ISAd,
int *  SA,
int  size 
)
static

Definition at line 42827 of file zstd.c.

◆ tr_ilg()

static INLINE int tr_ilg ( int  n)
static

Definition at line 42776 of file zstd.c.

◆ tr_insertionsort()

static void tr_insertionsort ( const int *  ISAd,
int *  first,
int *  last 
)
static

Definition at line 42792 of file zstd.c.

◆ tr_introsort()

static void tr_introsort ( int *  ISA,
const int *  ISAd,
int *  SA,
int *  first,
int *  last,
trbudget_t budget 
)
static

Definition at line 43040 of file zstd.c.

◆ tr_median3()

static INLINE int* tr_median3 ( const int *  ISAd,
int *  v1,
int *  v2,
int *  v3 
)
static

Definition at line 42852 of file zstd.c.

◆ tr_median5()

static INLINE int* tr_median5 ( const int *  ISAd,
int *  v1,
int *  v2,
int *  v3,
int *  v4,
int *  v5 
)
static

Definition at line 42865 of file zstd.c.

◆ tr_partialcopy()

static void tr_partialcopy ( int *  ISA,
const int *  SA,
int *  first,
int *  a,
int *  b,
int *  last,
int  depth 
)
static

Definition at line 43002 of file zstd.c.

◆ tr_partition()

static INLINE void tr_partition ( const int *  ISAd,
int *  first,
int *  middle,
int *  last,
int **  pa,
int **  pb,
int  v 
)
static

Definition at line 42935 of file zstd.c.

◆ tr_pivot()

static INLINE int* tr_pivot ( const int *  ISAd,
int *  first,
int *  last 
)
static

Definition at line 42880 of file zstd.c.

◆ trbudget_check()

static INLINE int trbudget_check ( trbudget_t budget,
int  size 
)
static

Definition at line 42922 of file zstd.c.

◆ trbudget_init()

static INLINE void trbudget_init ( trbudget_t budget,
int  chance,
int  incval 
)
static

Definition at line 42915 of file zstd.c.

◆ trsort()

static void trsort ( int *  ISA,
int *  SA,
int  n,
int  depth 
)
static

Definition at line 43267 of file zstd.c.

◆ writeBlockHeader()

static void writeBlockHeader ( void *  op,
size_t  cSize,
size_t  blockSize,
U32  lastBlock 
)
static

Definition at line 21095 of file zstd.c.

◆ ZDICT_addEntropyTablesFromBuffer()

size_t ZDICT_addEntropyTablesFromBuffer ( void *  dictBuffer,
size_t  dictContentSize,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples 
)

Definition at line 45667 of file zstd.c.

◆ ZDICT_addEntropyTablesFromBuffer_advanced()

static size_t ZDICT_addEntropyTablesFromBuffer_advanced ( void *  dictBuffer,
size_t  dictContentSize,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_params_t  params 
)
static

Definition at line 45482 of file zstd.c.

◆ ZDICT_analyzeEntropy()

static size_t ZDICT_analyzeEntropy ( void *  dstBuffer,
size_t  maxDstSize,
int  compressionLevel,
const void *  srcBuffer,
const size_t *  fileSizes,
unsigned  nbFiles,
const void *  dictBuffer,
size_t  dictBufferSize,
unsigned  notificationLevel 
)
static

Definition at line 45201 of file zstd.c.

◆ ZDICT_analyzePos()

static dictItem ZDICT_analyzePos ( BYTE doneMarks,
const int *  suffix,
U32  start,
const void *  buffer,
U32  minRatio,
U32  notificationLevel 
)
static

Definition at line 44717 of file zstd.c.

◆ ZDICT_clockSpan()

static clock_t ZDICT_clockSpan ( clock_t  nPrevious)
static

Definition at line 44629 of file zstd.c.

◆ ZDICT_count()

static size_t ZDICT_count ( const void *  pIn,
const void *  pMatch 
)
static

ZDICT_count() : Count the nb of common bytes between 2 pointers. Note : this function presumes end of buffer followed by noisy guard band.

Definition at line 44685 of file zstd.c.

◆ ZDICT_countEStats()

static void ZDICT_countEStats ( EStats_ress_t  esr,
const ZSTD_parameters *  params,
unsigned *  countLit,
unsigned *  offsetcodeCount,
unsigned *  matchlengthCount,
unsigned *  litlengthCount,
U32 repOffsets,
const void *  src,
size_t  srcSize,
U32  notificationLevel 
)
static

Definition at line 45108 of file zstd.c.

◆ ZDICT_dictSize()

static U32 ZDICT_dictSize ( const dictItem dictList)
static

Definition at line 45004 of file zstd.c.

◆ ZDICT_fillNoise()

static void ZDICT_fillNoise ( void *  buffer,
size_t  length 
)
static

Definition at line 45086 of file zstd.c.

◆ ZDICT_finalizeDictionary()

size_t ZDICT_finalizeDictionary ( void *  dstDictBuffer,
size_t  maxDictSize,
const void *  dictContent,
size_t  dictContentSize,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_params_t  parameters 
)

ZDICT_finalizeDictionary(): Given a custom content as a basis for dictionary, and a set of samples, finalize dictionary by adding headers and statistics according to the zstd dictionary format.

Samples must be stored concatenated in a flat buffer samplesBuffer, supplied with an array of sizes samplesSizes, providing the size of each sample in order. The samples are used to construct the statistics, so they should be representative of what you will compress with this dictionary.

The compression level can be set in parameters. You should pass the compression level you expect to use in production. The statistics for each compression level differ, so tuning the dictionary for the compression level can help quite a bit.

You can set an explicit dictionary ID in parameters, or allow us to pick a random dictionary ID for you, but we can't guarantee no collisions.

The dstDictBuffer and the dictContent may overlap, and the content will be appended to the end of the header. If the header + the content doesn't fit in maxDictSize the beginning of the content is truncated to make room, since it is presumed that the most profitable content is at the end of the dictionary, since that is the cheapest to reference.

maxDictSize must be >= max(dictContentSize, ZSTD_DICTSIZE_MIN).

Returns
: size of dictionary stored into dstDictBuffer (<= maxDictSize), or an error code, which can be tested by ZDICT_isError(). Note: ZDICT_finalizeDictionary() will push notifications into stderr if instructed to, using notificationLevel>0. NOTE: This function currently may fail in several edge cases including:
  • Not enough samples
  • Samples are uncompressible
  • Samples are all exactly the same

Definition at line 45400 of file zstd.c.

◆ ZDICT_flatLit()

static void ZDICT_flatLit ( unsigned *  countLit)
static

Definition at line 45191 of file zstd.c.

◆ ZDICT_getDictHeaderSize()

size_t ZDICT_getDictHeaderSize ( const void *  dictBuffer,
size_t  dictSize 
)

Definition at line 44657 of file zstd.c.

◆ ZDICT_getDictID()

unsigned ZDICT_getDictID ( const void *  dictBuffer,
size_t  dictSize 
)

extracts dictID;

Returns
zero if error (not a valid dictionary)

Definition at line 44650 of file zstd.c.

◆ ZDICT_getErrorName()

const char * ZDICT_getErrorName ( size_t  errorCode)

Definition at line 44648 of file zstd.c.

◆ ZDICT_initDictItem()

static void ZDICT_initDictItem ( dictItem d)
static

Definition at line 44707 of file zstd.c.

◆ ZDICT_insertDictItem()

static void ZDICT_insertDictItem ( dictItem table,
U32  maxSize,
dictItem  elt,
const void *  buffer 
)
static

Definition at line 44975 of file zstd.c.

◆ ZDICT_insertSortCount()

static void ZDICT_insertSortCount ( offsetCount_t  table[ZSTD_REP_NUM+1],
U32  val,
U32  count 
)
static

Definition at line 45173 of file zstd.c.

◆ ZDICT_isError()

unsigned ZDICT_isError ( size_t  errorCode)

Definition at line 44646 of file zstd.c.

◆ ZDICT_maxRep()

static U32 ZDICT_maxRep ( U32 const  reps[ZSTD_REP_NUM])
static
Returns
the maximum repcode value

Definition at line 45391 of file zstd.c.

◆ ZDICT_optimizeTrainFromBuffer_cover()

ZDICTLIB_API size_t ZDICT_optimizeTrainFromBuffer_cover ( void *  dictBuffer,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_cover_params_t parameters 
)

ZDICT_optimizeTrainFromBuffer_cover(): The same requirements as above hold for all the parameters except parameters. This function tries many parameter combinations and picks the best parameters. *parameters is filled with the best parameters found, dictionary constructed with those parameters is stored in dictBuffer.

All of the parameters d, k, steps are optional. If d is non-zero then we don't check multiple values of d, otherwise we check d = {6, 8}. if steps is zero it defaults to its default value. If k is non-zero then we don't check multiple values of k, otherwise we check steps values in [50, 2000].

Returns
: size of dictionary stored into dictBuffer (<= dictBufferCapacity) or an error code, which can be tested with ZDICT_isError(). On success *parameters contains the parameters selected. See ZDICT_trainFromBuffer() for details on failure modes. Note: ZDICT_optimizeTrainFromBuffer_cover() requires about 8 bytes of memory for each input byte and additionally another 5 bytes of memory for each byte of memory for each thread.

Definition at line 41660 of file zstd.c.

◆ ZDICT_optimizeTrainFromBuffer_fastCover()

ZDICTLIB_API size_t ZDICT_optimizeTrainFromBuffer_fastCover ( void *  dictBuffer,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_fastCover_params_t parameters 
)

ZDICT_optimizeTrainFromBuffer_fastCover(): The same requirements as above hold for all the parameters except parameters. This function tries many parameter combinations (specifically, k and d combinations) and picks the best parameters. *parameters is filled with the best parameters found, dictionary constructed with those parameters is stored in dictBuffer. All of the parameters d, k, steps, f, and accel are optional. If d is non-zero then we don't check multiple values of d, otherwise we check d = {6, 8}. if steps is zero it defaults to its default value. If k is non-zero then we don't check multiple values of k, otherwise we check steps values in [50, 2000]. If f is zero, default value of 20 is used. If accel is zero, default value of 1 is used.

Returns
: size of dictionary stored into dictBuffer (<= dictBufferCapacity) or an error code, which can be tested with ZDICT_isError(). On success *parameters contains the parameters selected. See ZDICT_trainFromBuffer() for details on failure modes. Note: ZDICT_optimizeTrainFromBuffer_fastCover() requires about 6 * 2^f bytes of memory for each thread.

Definition at line 44398 of file zstd.c.

◆ ZDICT_printHex()

static void ZDICT_printHex ( const void *  ptr,
size_t  length 
)
static

Definition at line 44631 of file zstd.c.

◆ ZDICT_removeDictItem()

static void ZDICT_removeDictItem ( dictItem table,
U32  id 
)
static

Definition at line 44963 of file zstd.c.

◆ ZDICT_totalSampleSize()

static size_t ZDICT_totalSampleSize ( const size_t *  fileSizes,
unsigned  nbFiles 
)
static

Definition at line 45163 of file zstd.c.

◆ ZDICT_trainBuffer_legacy()

static size_t ZDICT_trainBuffer_legacy ( dictItem dictList,
U32  dictListSize,
const void *const  buffer,
size_t  bufferSize,
const size_t *  fileSizes,
unsigned  nbFiles,
unsigned  minRatio,
U32  notificationLevel 
)
static

Definition at line 45013 of file zstd.c.

◆ ZDICT_trainFromBuffer()

size_t ZDICT_trainFromBuffer ( void *  dictBuffer,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples 
)

ZDICT_trainFromBuffer(): Train a dictionary from an array of samples. Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4, f=20, and accel=1. Samples must be stored concatenated in a single flat buffer samplesBuffer, supplied with an array of sizes samplesSizes, providing the size of each sample, in order. The resulting dictionary will be saved into dictBuffer.

Returns
: size of dictionary stored into dictBuffer (<= dictBufferCapacity) or an error code, which can be tested with ZDICT_isError(). Note: Dictionary training will fail if there are not enough samples to construct a dictionary, or if most of the samples are too small (< 8 bytes being the lower limit). If dictionary training fails, you should use zstd without a dictionary, as the dictionary would've been ineffective anyways. If you believe your samples would benefit from a dictionary please open an issue with details, and we can look into it. Note: ZDICT_trainFromBuffer()'s memory usage is about 6 MB. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It's possible to select smaller or larger size, just by specifying dictBufferCapacity. In general, it's recommended to provide a few thousands samples, though this can vary a lot. It's recommended that total size of all samples be about ~x100 times the target size of dictionary.

Definition at line 45649 of file zstd.c.

◆ ZDICT_trainFromBuffer_cover()

ZDICTLIB_API size_t ZDICT_trainFromBuffer_cover ( void *  dictBuffer,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_cover_params_t  parameters 
)

ZDICT_trainFromBuffer_cover(): Train a dictionary from an array of samples using the COVER algorithm. Samples must be stored concatenated in a single flat buffer samplesBuffer, supplied with an array of sizes samplesSizes, providing the size of each sample, in order. The resulting dictionary will be saved into dictBuffer.

Returns
: size of dictionary stored into dictBuffer (<= dictBufferCapacity) or an error code, which can be tested with ZDICT_isError(). See ZDICT_trainFromBuffer() for details on failure modes. Note: ZDICT_trainFromBuffer_cover() requires about 9 bytes of memory for each input byte. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It's possible to select smaller or larger size, just by specifying dictBufferCapacity. In general, it's recommended to provide a few thousands samples, though this can vary a lot. It's recommended that total size of all samples be about ~x100 times the target size of dictionary.

Definition at line 41274 of file zstd.c.

◆ ZDICT_trainFromBuffer_fastCover()

ZDICTLIB_API size_t ZDICT_trainFromBuffer_fastCover ( void *  dictBuffer,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_fastCover_params_t  parameters 
)

ZDICT_trainFromBuffer_fastCover(): Train a dictionary from an array of samples using a modified version of COVER algorithm. Samples must be stored concatenated in a single flat buffer samplesBuffer, supplied with an array of sizes samplesSizes, providing the size of each sample, in order. d and k are required. All other parameters are optional, will use default values if not provided The resulting dictionary will be saved into dictBuffer.

Returns
: size of dictionary stored into dictBuffer (<= dictBufferCapacity) or an error code, which can be tested with ZDICT_isError(). See ZDICT_trainFromBuffer() for details on failure modes. Note: ZDICT_trainFromBuffer_fastCover() requires 6 * 2^f bytes of memory. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It's possible to select smaller or larger size, just by specifying dictBufferCapacity. In general, it's recommended to provide a few thousands samples, though this can vary a lot. It's recommended that total size of all samples be about ~x100 times the target size of dictionary.

Definition at line 44329 of file zstd.c.

◆ ZDICT_trainFromBuffer_legacy()

size_t ZDICT_trainFromBuffer_legacy ( void *  dictBuffer,
size_t  dictBufferCapacity,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_legacy_params_t  parameters 
)

ZDICT_trainFromBuffer_legacy(): Train a dictionary from an array of samples. Samples must be stored concatenated in a single flat buffer samplesBuffer, supplied with an array of sizes samplesSizes, providing the size of each sample, in order. The resulting dictionary will be saved into dictBuffer. parameters is optional and can be provided with values set to 0 to mean "default".

Returns
: size of dictionary stored into dictBuffer (<= dictBufferCapacity) or an error code, which can be tested with ZDICT_isError(). See ZDICT_trainFromBuffer() for details on failure modes. Tips: In general, a reasonable dictionary has a size of ~ 100 KB. It's possible to select smaller or larger size, just by specifying dictBufferCapacity. In general, it's recommended to provide a few thousands samples, though this can vary a lot. It's recommended that total size of all samples be about ~x100 times the target size of dictionary. Note: ZDICT_trainFromBuffer_legacy() will send notifications into stderr if instructed to, using notificationLevel>0.

Definition at line 45626 of file zstd.c.

◆ ZDICT_trainFromBuffer_unsafe_legacy()

static size_t ZDICT_trainFromBuffer_unsafe_legacy ( void *  dictBuffer,
size_t  maxDictSize,
const void *  samplesBuffer,
const size_t *  samplesSizes,
unsigned  nbSamples,
ZDICT_legacy_params_t  params 
)
static

ZDICT_trainFromBuffer_unsafe_legacy() : Warning : samplesBuffer must be followed by noisy guard band !!!

Returns
: size of dictionary, or an error code which can be tested with ZDICT_isError()

Definition at line 45520 of file zstd.c.

◆ ZDICT_tryMerge()

static U32 ZDICT_tryMerge ( dictItem table,
dictItem  elt,
U32  eltNbToSkip,
const void *  buffer 
)
static

ZDICT_tryMerge() : check if dictItem can be merged, do it if possible

Returns
: id of destination elt, 0 if not merged

Definition at line 44904 of file zstd.c.

◆ ZSTD_adjustCParams()

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

Definition at line 19196 of file zstd.c.

◆ ZSTD_adjustCParams_internal()

static ZSTD_compressionParameters ZSTD_adjustCParams_internal ( ZSTD_compressionParameters  cPar,
unsigned long long  srcSize,
size_t  dictSize,
ZSTD_cParamMode_e  mode,
ZSTD_paramSwitch_e  useRowMatchFinder 
)
static

ZSTD_adjustCParams_internal() : optimize cPar for a specified input (srcSize and dictSize). mostly downsize to reduce memory consumption and initialization latency. srcSize can be ZSTD_CONTENTSIZE_UNKNOWN when not known. mode is the mode for parameter adjustment. See docs for ZSTD_cParamMode_e. note : srcSize==0 means 0! condition : cPar is presumed validated (can be checked using ZSTD_checkCParams()).

Definition at line 19099 of file zstd.c.

◆ ZSTD_advanceHashSalt()

static void ZSTD_advanceHashSalt ( ZSTD_matchState_t ms)
static

Definition at line 19563 of file zstd.c.

◆ ZSTD_allocateChainTable()

static int ZSTD_allocateChainTable ( const ZSTD_strategy  strategy,
const ZSTD_paramSwitch_e  useRowMatchFinder,
const U32  forDDSDict 
)
static

Definition at line 17900 of file zstd.c.

◆ ZSTD_allocateLiteralsBuffer()

static void ZSTD_allocateLiteralsBuffer ( ZSTD_DCtx dctx,
void *const  dst,
const size_t  dstCapacity,
const size_t  litSize,
const streaming_operation  streaming,
const size_t  expectedWriteSize,
const unsigned  splitImmediately 
)
static

Definition at line 37782 of file zstd.c.

◆ ZSTD_assertEqualCParams()

static void ZSTD_assertEqualCParams ( ZSTD_compressionParameters  cParams1,
ZSTD_compressionParameters  cParams2 
)
static

Definition at line 19487 of file zstd.c.

◆ ZSTD_bitmix()

static U64 ZSTD_bitmix ( U64  val,
U64  len 
)
static

Definition at line 19554 of file zstd.c.

◆ ZSTD_bitWeight()

MEM_STATIC U32 ZSTD_bitWeight ( U32  stat)

Definition at line 29564 of file zstd.c.

◆ ZSTD_blockSplitterEnabled()

static int ZSTD_blockSplitterEnabled ( ZSTD_CCtx_params *  cctxParams)
static

Definition at line 20318 of file zstd.c.

◆ ZSTD_blockState_confirmRepcodesAndEntropyTables()

static void ZSTD_blockState_confirmRepcodesAndEntropyTables ( ZSTD_blockState_t *const  bs)
static

Definition at line 21086 of file zstd.c.

◆ ZSTD_BtFindBestMatch()

FORCE_INLINE_TEMPLATE size_t ZSTD_BtFindBestMatch ( ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iLimit,
size_t *  offBasePtr,
const U32  mls,
const ZSTD_dictMode_e  dictMode 
)

ZSTD_BtFindBestMatch() : Tree updater, providing best match

Definition at line 26915 of file zstd.c.

◆ ZSTD_btGetAllMatches_internal()

FORCE_INLINE_TEMPLATE U32 ZSTD_btGetAllMatches_internal ( ZSTD_match_t matches,
ZSTD_matchState_t ms,
U32 nextToUpdate3,
const BYTE ip,
const BYTE *const  iHighLimit,
const U32  rep[ZSTD_REP_NUM],
U32 const  ll0,
U32 const  lengthToBeat,
const ZSTD_dictMode_e  dictMode,
const U32  mls 
)

Definition at line 30341 of file zstd.c.

◆ 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 21277 of file zstd.c.

◆ ZSTD_buildBlockEntropyStats_literals()

static size_t ZSTD_buildBlockEntropyStats_literals ( void *const  src,
size_t  srcSize,
const ZSTD_hufCTables_t prevHuf,
ZSTD_hufCTables_t nextHuf,
ZSTD_hufCTablesMetadata_t hufMetadata,
const int  literalsCompressionIsDisabled,
void *  workspace,
size_t  wkspSize,
int  hufFlags 
)
static

ZSTD_buildBlockEntropyStats_literals() : Builds entropy for the literals. Stores literals block type (raw, rle, compressed, repeat) and huffman description table to hufMetadata. Requires ENTROPY_WORKSPACE_SIZE workspace

Returns
: size of huffman description table, or an error code

Definition at line 21112 of file zstd.c.

◆ ZSTD_buildBlockEntropyStats_sequences()

static size_t ZSTD_buildBlockEntropyStats_sequences ( const seqStore_t seqStorePtr,
const ZSTD_fseCTables_t prevEntropy,
ZSTD_fseCTables_t nextEntropy,
const ZSTD_CCtx_params *  cctxParams,
ZSTD_fseCTablesMetadata_t fseMetadata,
void *  workspace,
size_t  wkspSize 
)
static

ZSTD_buildBlockEntropyStats_sequences() : Builds entropy for the sequences. Stores symbol compression modes and fse table to fseMetadata. Requires ENTROPY_WORKSPACE_SIZE wksp.

Returns
: size of fse tables or error code

Definition at line 21238 of file zstd.c.

◆ ZSTD_buildCTable()

size_t ZSTD_buildCTable ( void *  dst,
size_t  dstCapacity,
FSE_CTable nextCTable,
U32  FSELog,
symbolEncodingType_e  type,
unsigned *  count,
U32  max,
const BYTE codeTable,
size_t  nbSeq,
const S16 defaultNorm,
U32  defaultNormLog,
U32  defaultMax,
const FSE_CTable prevCTable,
size_t  prevCTableSize,
void *  entropyWorkspace,
size_t  entropyWorkspaceSize 
)

Definition at line 16444 of file zstd.c.

◆ ZSTD_buildDummySequencesStatistics()

static ZSTD_symbolEncodingTypeStats_t ZSTD_buildDummySequencesStatistics ( ZSTD_fseCTables_t nextEntropy)
static

Definition at line 21223 of file zstd.c.

◆ ZSTD_buildEntropyStatisticsAndEstimateSubBlockSize()

static size_t ZSTD_buildEntropyStatisticsAndEstimateSubBlockSize ( seqStore_t seqStore,
ZSTD_CCtx zc 
)
static

Definition at line 21427 of file zstd.c.

◆ ZSTD_buildFSETable()

void ZSTD_buildFSETable ( ZSTD_seqSymbol dt,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
const U32 baseValue,
const U8 nbAdditionalBits,
unsigned  tableLog,
void *  wksp,
size_t  wkspSize,
int  bmi2 
)

Definition at line 38304 of file zstd.c.

◆ ZSTD_buildFSETable_body()

FORCE_INLINE_TEMPLATE void ZSTD_buildFSETable_body ( ZSTD_seqSymbol dt,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
const U32 baseValue,
const U8 nbAdditionalBits,
unsigned  tableLog,
void *  wksp,
size_t  wkspSize 
)

Definition at line 38163 of file zstd.c.

◆ ZSTD_buildFSETable_body_default()

static void ZSTD_buildFSETable_body_default ( ZSTD_seqSymbol dt,
const short *  normalizedCounter,
unsigned  maxSymbolValue,
const U32 baseValue,
const U8 nbAdditionalBits,
unsigned  tableLog,
void *  wksp,
size_t  wkspSize 
)
static

Definition at line 38284 of file zstd.c.

◆ ZSTD_buildSeqStore()

static size_t ZSTD_buildSeqStore ( ZSTD_CCtx zc,
const void *  src,
size_t  srcSize 
)
static

Definition at line 20785 of file zstd.c.

◆ ZSTD_buildSeqTable()

static size_t ZSTD_buildSeqTable ( ZSTD_seqSymbol DTableSpace,
const ZSTD_seqSymbol **  DTablePtr,
symbolEncodingType_e  type,
unsigned  max,
U32  maxLog,
const void *  src,
size_t  srcSize,
const U32 baseValue,
const U8 nbAdditionalBits,
const ZSTD_seqSymbol defaultTable,
U32  flagRepeatTable,
int  ddictIsCold,
int  nbSeq,
U32 wksp,
size_t  wkspSize,
int  bmi2 
)
static

ZSTD_buildSeqTable() :

Returns
: nb bytes read from src, or an error code if it fails

Definition at line 38325 of file zstd.c.

◆ ZSTD_buildSeqTable_rle()

static void ZSTD_buildSeqTable_rle ( ZSTD_seqSymbol dt,
U32  baseValue,
U8  nbAddBits 
)
static

Definition at line 38141 of file zstd.c.

◆ ZSTD_buildSequencesStatistics()

static ZSTD_symbolEncodingTypeStats_t ZSTD_buildSequencesStatistics ( const seqStore_t seqStorePtr,
size_t  nbSeq,
const ZSTD_fseCTables_t prevEntropy,
ZSTD_fseCTables_t nextEntropy,
BYTE dst,
const BYTE *const  dstEnd,
ZSTD_strategy  strategy,
unsigned *  countWorkspace,
void *  entropyWorkspace,
size_t  entropyWkspSize 
)
static

Definition at line 20345 of file zstd.c.

◆ ZSTD_CCtx_getParameter()

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

Definition at line 18652 of file zstd.c.

◆ ZSTD_CCtx_init_compressStream2()

static size_t ZSTD_CCtx_init_compressStream2 ( ZSTD_CCtx cctx,
ZSTD_EndDirective  endOp,
size_t  inSize 
)
static

Definition at line 23742 of file zstd.c.

◆ 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, until parameters are reset, a new dictionary is loaded, or the dictionary is explicitly invalidated by loading a NULL dictionary. 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. Note 5 : This method does not benefit from LDM (long distance mode). If you want to employ LDM on some large dictionary content, prefer employing ZSTD_CCtx_refPrefix() described below.

Definition at line 18947 of file zstd.c.

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

Definition at line 18909 of file zstd.c.

◆ ZSTD_CCtx_loadDictionary_byReference()

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

Definition at line 18940 of file zstd.c.

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

Definition at line 18954 of file zstd.c.

◆ 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). This method is compatible with LDM (long distance mode).

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.

Definition at line 18972 of file zstd.c.

◆ ZSTD_CCtx_refPrefix_advanced()

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

Definition at line 18977 of file zstd.c.

◆ ZSTD_CCtx_refThreadPool()

size_t ZSTD_CCtx_refThreadPool ( ZSTD_CCtx cctx,
ZSTD_threadPool *  pool 
)

Definition at line 18964 of file zstd.c.

◆ ZSTD_CCtx_reset()

size_t ZSTD_CCtx_reset ( ZSTD_CCtx cctx,
ZSTD_ResetDirective  reset 
)

ZSTD_CCtx_reset() : Also dumps dictionary

Definition at line 18993 of file zstd.c.

◆ ZSTD_CCtx_setCParams()

size_t ZSTD_CCtx_setCParams ( ZSTD_CCtx cctx,
ZSTD_compressionParameters  cparams 
)

Definition at line 18818 of file zstd.c.

◆ ZSTD_CCtx_setFParams()

size_t ZSTD_CCtx_setFParams ( ZSTD_CCtx cctx,
ZSTD_frameParameters  fparams 
)

Definition at line 18834 of file zstd.c.

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

Definition at line 18346 of file zstd.c.

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

Definition at line 18804 of file zstd.c.

◆ ZSTD_CCtx_setParams()

size_t ZSTD_CCtx_setParams ( ZSTD_CCtx cctx,
ZSTD_parameters  params 
)

Definition at line 18844 of file zstd.c.

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

Definition at line 18856 of file zstd.c.

◆ 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 22784 of file zstd.c.

◆ ZSTD_CCtxParams_getParameter()

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

Definition at line 18657 of file zstd.c.

◆ ZSTD_CCtxParams_init()

size_t ZSTD_CCtxParams_init ( ZSTD_CCtx_params *  cctxParams,
int  compressionLevel 
)

Definition at line 18003 of file zstd.c.

◆ ZSTD_CCtxParams_init_advanced()

size_t ZSTD_CCtxParams_init_advanced ( ZSTD_CCtx_params *  cctxParams,
ZSTD_parameters  params 
)

Definition at line 18040 of file zstd.c.

◆ ZSTD_CCtxParams_init_internal()

static void ZSTD_CCtxParams_init_internal ( ZSTD_CCtx_params *  cctxParams,
const ZSTD_parameters *  params,
int  compressionLevel 
)
static

Initializes cctxParams from params and compressionLevel.

Parameters
compressionLevelIf params are derived from a compression level then that compression level, otherwise ZSTD_NO_CLEVEL.

Definition at line 18018 of file zstd.c.

◆ ZSTD_CCtxParams_reset()

size_t ZSTD_CCtxParams_reset ( ZSTD_CCtx_params *  params)

Definition at line 17998 of file zstd.c.

◆ ZSTD_CCtxParams_setParameter()

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

Definition at line 18407 of file zstd.c.

◆ ZSTD_CCtxParams_setZstdParams()

static void ZSTD_CCtxParams_setZstdParams ( ZSTD_CCtx_params *  cctxParams,
const ZSTD_parameters *  params 
)
static

Sets cctxParams' cParams and fParams from params, but otherwise leaves them alone.

Parameters
paramsValidated zstd parameters.

Definition at line 18052 of file zstd.c.

◆ ZSTD_CDictIndicesAreTagged()

static int ZSTD_CDictIndicesAreTagged ( const ZSTD_compressionParameters *const  cParams)
static

Definition at line 17944 of file zstd.c.

◆ ZSTD_checkBufferStability()

static size_t ZSTD_checkBufferStability ( ZSTD_CCtx const *  cctx,
ZSTD_outBuffer const *  output,
ZSTD_inBuffer const *  input,
ZSTD_EndDirective  endOp 
)
static

Definition at line 23723 of file zstd.c.

◆ ZSTD_checkContinuity()

void ZSTD_checkContinuity ( ZSTD_DCtx dctx,
const void *  dst,
size_t  dstSize 
)

ZSTD_checkContinuity() : check if next dst follows previous position, where decompression ended. If yes, do nothing (continue on current segment). If not, classify previous segment as "external dictionary", and start a new segment. This function cannot fail.

Definition at line 39872 of file zstd.c.

◆ 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

Definition at line 19015 of file zstd.c.

◆ 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 15562 of file zstd.c.

◆ ZSTD_checkOutBuffer()

static size_t ZSTD_checkOutBuffer ( ZSTD_DStream const *  zds,
ZSTD_outBuffer const *  output 
)
static

Definition at line 37336 of file zstd.c.

◆ ZSTD_clampCParams()

static ZSTD_compressionParameters ZSTD_clampCParams ( ZSTD_compressionParameters  cParams)
static

ZSTD_clampCParams() : make CParam values within valid range.

Returns
: valid CParams

Definition at line 19031 of file zstd.c.

◆ ZSTD_clearAllDicts()

static void ZSTD_clearAllDicts ( ZSTD_CCtx cctx)
static

Clears and frees all of the dictionaries in the CCtx.

Definition at line 17791 of file zstd.c.

◆ ZSTD_clearDict()

static void ZSTD_clearDict ( ZSTD_DCtx dctx)
static

Definition at line 35665 of file zstd.c.

◆ ZSTD_comparePackedTags()

MEM_STATIC int ZSTD_comparePackedTags ( size_t  packedTag1,
size_t  packedTag2 
)

Definition at line 15747 of file zstd.c.

◆ 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. NOTE: Providing dstCapacity >= ZSTD_compressBound(srcSize) guarantees that zstd will have enough space to successfully compress the data.

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

Definition at line 22898 of file zstd.c.

◆ 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. NOTE: Providing dstCapacity >= ZSTD_compressBound(srcSize) guarantees that zstd will have enough space to successfully compress the data, though it is possible it fails for other reasons.
    Returns
    : compressed size written into dst (<= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).

Definition at line 23961 of file zstd.c.

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

Definition at line 22842 of file zstd.c.

◆ 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 22859 of file zstd.c.

◆ ZSTD_compress_frameChunk()

static size_t ZSTD_compress_frameChunk ( ZSTD_CCtx cctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
U32  lastFrameChunk 
)
static

ZSTD_compress_frameChunk() : Compress a chunk of data into one or multiple blocks. All blocks will be terminated, all input will be consumed. Function will issue an error if there is not enough dstCapacity to hold the compressed content. Frame is supposed already started (header already produced)

Returns
: compressed size, or an error code

Definition at line 22030 of file zstd.c.

◆ ZSTD_compress_insertDictionary()

static size_t ZSTD_compress_insertDictionary ( ZSTD_compressedBlockState_t bs,
ZSTD_matchState_t ms,
ldmState_t ls,
ZSTD_cwksp ws,
const ZSTD_CCtx_params *  params,
const void *  dict,
size_t  dictSize,
ZSTD_dictContentType_e  dictContentType,
ZSTD_dictTableLoadMethod_e  dtlm,
ZSTD_tableFillPurpose_e  tfp,
void *  workspace 
)
static

ZSTD_compress_insertDictionary() :

Returns
: dictID, or an error code

Definition at line 22595 of file zstd.c.

◆ 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

Definition at line 23311 of file zstd.c.

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

Definition at line 23298 of file zstd.c.

◆ ZSTD_compress_usingCDict_internal()

static size_t ZSTD_compress_usingCDict_internal ( ZSTD_CCtx cctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const ZSTD_CDict cdict,
ZSTD_frameParameters  fParams 
)
static

ZSTD_compress_usingCDict_internal(): Implementation of various ZSTD_compress_usingCDict* functions.

Definition at line 23286 of file zstd.c.

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

Definition at line 22873 of file zstd.c.

◆ ZSTD_compressBegin()

size_t ZSTD_compressBegin ( ZSTD_CCtx cctx,
int  compressionLevel 
)

Definition at line 22736 of file zstd.c.

◆ 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

Definition at line 22706 of file zstd.c.

◆ 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 22686 of file zstd.c.

◆ ZSTD_compressBegin_internal()

static size_t ZSTD_compressBegin_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,
U64  pledgedSrcSize,
ZSTD_buffered_policy_e  zbuff 
)
static

ZSTD_compressBegin_internal() : Assumption : either @dict OR @cdict (or none) is non-NULL, never both

Returns
: 0, or an error code

Definition at line 22639 of file zstd.c.

◆ ZSTD_compressBegin_usingCDict()

size_t ZSTD_compressBegin_usingCDict ( ZSTD_CCtx cctx,
const ZSTD_CDict cdict 
)

Definition at line 23278 of file zstd.c.

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

Definition at line 23263 of file zstd.c.

◆ ZSTD_compressBegin_usingCDict_deprecated()

size_t ZSTD_compressBegin_usingCDict_deprecated ( ZSTD_CCtx cctx,
const ZSTD_CDict cdict 
)

Definition at line 23272 of file zstd.c.

◆ ZSTD_compressBegin_usingCDict_internal()

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

Definition at line 23222 of file zstd.c.

◆ ZSTD_compressBegin_usingDict()

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

Definition at line 22731 of file zstd.c.

◆ ZSTD_compressBegin_usingDict_deprecated()

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

Definition at line 22719 of file zstd.c.

◆ ZSTD_compressBlock()

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

Definition at line 22312 of file zstd.c.

◆ ZSTD_compressBlock_btlazy2()

size_t ZSTD_compressBlock_btlazy2 ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

used in ZSTD_reduceIndex(). preemptively increase value of ZSTD_DUBT_UNSORTED_MARK

Definition at line 28289 of file zstd.c.

◆ ZSTD_compressBlock_btlazy2_dictMatchState()

size_t ZSTD_compressBlock_btlazy2_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28317 of file zstd.c.

◆ ZSTD_compressBlock_btlazy2_extDict()

size_t ZSTD_compressBlock_btlazy2_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28659 of file zstd.c.

◆ ZSTD_compressBlock_btopt()

size_t ZSTD_compressBlock_btopt ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30886 of file zstd.c.

◆ ZSTD_compressBlock_btopt_dictMatchState()

size_t ZSTD_compressBlock_btopt_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30964 of file zstd.c.

◆ ZSTD_compressBlock_btopt_extDict()

size_t ZSTD_compressBlock_btopt_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30978 of file zstd.c.

◆ ZSTD_compressBlock_btultra()

size_t ZSTD_compressBlock_btultra ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30928 of file zstd.c.

◆ ZSTD_compressBlock_btultra2()

size_t ZSTD_compressBlock_btultra2 ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30936 of file zstd.c.

◆ ZSTD_compressBlock_btultra_dictMatchState()

size_t ZSTD_compressBlock_btultra_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30971 of file zstd.c.

◆ ZSTD_compressBlock_btultra_extDict()

size_t ZSTD_compressBlock_btultra_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 30985 of file zstd.c.

◆ 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 22302 of file zstd.c.

◆ ZSTD_compressBlock_doubleFast()

size_t ZSTD_compressBlock_doubleFast ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 25360 of file zstd.c.

◆ ZSTD_compressBlock_doubleFast_dictMatchState()

size_t ZSTD_compressBlock_doubleFast_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 25380 of file zstd.c.

◆ ZSTD_compressBlock_doubleFast_dictMatchState_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_doubleFast_dictMatchState_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize,
U32 const  mls 
)

Definition at line 25116 of file zstd.c.

◆ ZSTD_compressBlock_doubleFast_extDict()

size_t ZSTD_compressBlock_doubleFast_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 25549 of file zstd.c.

◆ ZSTD_compressBlock_doubleFast_extDict_generic()

static size_t ZSTD_compressBlock_doubleFast_extDict_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize,
U32 const  mls 
)
static

Definition at line 25400 of file zstd.c.

◆ ZSTD_compressBlock_doubleFast_noDict_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_doubleFast_noDict_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize,
U32 const  mls 
)

Definition at line 24906 of file zstd.c.

◆ ZSTD_compressBlock_fast()

size_t ZSTD_compressBlock_fast ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 25990 of file zstd.c.

◆ ZSTD_compressBlock_fast_dictMatchState()

size_t ZSTD_compressBlock_fast_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 26231 of file zstd.c.

◆ ZSTD_compressBlock_fast_dictMatchState_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_dictMatchState_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize,
U32 const  mls,
U32 const  hasStep 
)

Definition at line 26027 of file zstd.c.

◆ ZSTD_compressBlock_fast_extDict()

size_t ZSTD_compressBlock_fast_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 26510 of file zstd.c.

◆ ZSTD_compressBlock_fast_extDict_generic()

static size_t ZSTD_compressBlock_fast_extDict_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize,
U32 const  mls,
U32 const  hasStep 
)
static

Definition at line 26252 of file zstd.c.

◆ ZSTD_compressBlock_fast_noDict_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_fast_noDict_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize,
U32 const  mls,
U32 const  hasStep 
)

If you squint hard enough (and ignore repcodes), the search operation at any given position is broken into 4 stages:

  1. Hash (map position to hash value via input read)
  2. Lookup (map hash val to index via hashtable read)
  3. Load (map index to value at that position via input read)
  4. Compare

Each of these steps involves a memory read at an address which is computed from the previous step. This means these steps must be sequenced and their latencies are cumulative.

Rather than do 1->2->3->4 sequentially for a single position before moving onto the next, this implementation interleaves these operations across the next few positions:

R = Repcode Read & Compare H = Hash T = Table Lookup M = Match Read & Compare

Pos | Time --> -—+----------------— N | ... M N+1 | ... TM N+2 | R H T M N+3 | H TM N+4 | R H T M N+5 | H ... N+6 | R ...

This is very much analogous to the pipelining of execution in a CPU. And just like a CPU, we have to dump the pipeline when we find a match (i.e., take a branch).

When this happens, we throw away our current state, and do the following prep to re-enter the loop:

Pos | Time --> -—+----------------— N | H T N+1 | H

This is also the work we do at the beginning to enter the loop initially.

Definition at line 25711 of file zstd.c.

◆ ZSTD_compressBlock_greedy()

size_t ZSTD_compressBlock_greedy ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28310 of file zstd.c.

◆ ZSTD_compressBlock_greedy_dedicatedDictSearch()

size_t ZSTD_compressBlock_greedy_dedicatedDictSearch ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28360 of file zstd.c.

◆ ZSTD_compressBlock_greedy_dedicatedDictSearch_row()

size_t ZSTD_compressBlock_greedy_dedicatedDictSearch_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28425 of file zstd.c.

◆ ZSTD_compressBlock_greedy_dictMatchState()

size_t ZSTD_compressBlock_greedy_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28338 of file zstd.c.

◆ ZSTD_compressBlock_greedy_dictMatchState_row()

size_t ZSTD_compressBlock_greedy_dictMatchState_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28403 of file zstd.c.

◆ ZSTD_compressBlock_greedy_extDict()

size_t ZSTD_compressBlock_greedy_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28636 of file zstd.c.

◆ ZSTD_compressBlock_greedy_extDict_row()

size_t ZSTD_compressBlock_greedy_extDict_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28667 of file zstd.c.

◆ ZSTD_compressBlock_greedy_row()

size_t ZSTD_compressBlock_greedy_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28382 of file zstd.c.

◆ ZSTD_compressBlock_internal()

static size_t ZSTD_compressBlock_internal ( ZSTD_CCtx zc,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
U32  frame 
)
static

Definition at line 21860 of file zstd.c.

◆ ZSTD_compressBlock_lazy()

size_t ZSTD_compressBlock_lazy ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28303 of file zstd.c.

◆ ZSTD_compressBlock_lazy2()

size_t ZSTD_compressBlock_lazy2 ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28296 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_dedicatedDictSearch()

size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28346 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_dedicatedDictSearch_row()

size_t ZSTD_compressBlock_lazy2_dedicatedDictSearch_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28411 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_dictMatchState()

size_t ZSTD_compressBlock_lazy2_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28324 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_dictMatchState_row()

size_t ZSTD_compressBlock_lazy2_dictMatchState_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28389 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_extDict()

size_t ZSTD_compressBlock_lazy2_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28651 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_extDict_row()

size_t ZSTD_compressBlock_lazy2_extDict_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28682 of file zstd.c.

◆ ZSTD_compressBlock_lazy2_row()

size_t ZSTD_compressBlock_lazy2_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28368 of file zstd.c.

◆ ZSTD_compressBlock_lazy_dedicatedDictSearch()

size_t ZSTD_compressBlock_lazy_dedicatedDictSearch ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28353 of file zstd.c.

◆ ZSTD_compressBlock_lazy_dedicatedDictSearch_row()

size_t ZSTD_compressBlock_lazy_dedicatedDictSearch_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28418 of file zstd.c.

◆ ZSTD_compressBlock_lazy_dictMatchState()

size_t ZSTD_compressBlock_lazy_dictMatchState ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28331 of file zstd.c.

◆ ZSTD_compressBlock_lazy_dictMatchState_row()

size_t ZSTD_compressBlock_lazy_dictMatchState_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28396 of file zstd.c.

◆ ZSTD_compressBlock_lazy_extDict()

size_t ZSTD_compressBlock_lazy_extDict ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28643 of file zstd.c.

◆ ZSTD_compressBlock_lazy_extDict_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_lazy_extDict_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
const void *  src,
size_t  srcSize,
const searchMethod_e  searchMethod,
const U32  depth 
)

Definition at line 28433 of file zstd.c.

◆ ZSTD_compressBlock_lazy_extDict_row()

size_t ZSTD_compressBlock_lazy_extDict_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28674 of file zstd.c.

◆ ZSTD_compressBlock_lazy_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_lazy_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
const void *  src,
size_t  srcSize,
const searchMethod_e  searchMethod,
const U32  depth,
ZSTD_dictMode_e const  dictMode 
)

Definition at line 28023 of file zstd.c.

◆ ZSTD_compressBlock_lazy_row()

size_t ZSTD_compressBlock_lazy_row ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
void const *  src,
size_t  srcSize 
)

Definition at line 28375 of file zstd.c.

◆ ZSTD_compressBlock_opt0()

static size_t ZSTD_compressBlock_opt0 ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
const void *  src,
size_t  srcSize,
const ZSTD_dictMode_e  dictMode 
)
static

Definition at line 30872 of file zstd.c.

◆ ZSTD_compressBlock_opt2()

static size_t ZSTD_compressBlock_opt2 ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
const void *  src,
size_t  srcSize,
const ZSTD_dictMode_e  dictMode 
)
static

Definition at line 30879 of file zstd.c.

◆ ZSTD_compressBlock_opt_generic()

FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_opt_generic ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
const void *  src,
size_t  srcSize,
const int  optLevel,
const ZSTD_dictMode_e  dictMode 
)

Definition at line 30583 of file zstd.c.

◆ ZSTD_compressBlock_splitBlock()

static size_t ZSTD_compressBlock_splitBlock ( ZSTD_CCtx zc,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
U32  lastBlock 
)
static

Definition at line 21832 of file zstd.c.

◆ ZSTD_compressBlock_splitBlock_internal()

static size_t ZSTD_compressBlock_splitBlock_internal ( ZSTD_CCtx zc,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  blockSize,
U32  lastBlock,
U32  nbSeq 
)
static

Definition at line 21739 of file zstd.c.

◆ ZSTD_compressBlock_targetCBlockSize()

static size_t ZSTD_compressBlock_targetCBlockSize ( ZSTD_CCtx zc,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
U32  lastBlock 
)
static

Definition at line 21979 of file zstd.c.

◆ ZSTD_compressBlock_targetCBlockSize_body()

static size_t ZSTD_compressBlock_targetCBlockSize_body ( ZSTD_CCtx zc,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const size_t  bss,
U32  lastBlock 
)
static

Definition at line 21923 of file zstd.c.

◆ ZSTD_compressBound()

size_t ZSTD_compressBound ( size_t  srcSize)

maximum compressed size in worst case single-pass scenario

Definition at line 17708 of file zstd.c.

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

Definition at line 22888 of file zstd.c.

◆ ZSTD_compressContinue()

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

Definition at line 22281 of file zstd.c.

◆ ZSTD_compressContinue_internal()

static size_t ZSTD_compressContinue_internal ( ZSTD_CCtx cctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
U32  frame,
U32  lastFrameChunk 
)
static

Definition at line 22211 of file zstd.c.

◆ 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 22272 of file zstd.c.

◆ ZSTD_compressedLiterals()

static int ZSTD_compressedLiterals ( optState_t const *const  optPtr)
static

Definition at line 29596 of file zstd.c.

◆ ZSTD_compressEnd()

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

Definition at line 22835 of file zstd.c.

◆ 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 22808 of file zstd.c.

◆ ZSTD_compressLiterals()

size_t ZSTD_compressLiterals ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
void *  entropyWorkspace,
size_t  entropyWorkspaceSize,
const ZSTD_hufCTables_t prevHuf,
ZSTD_hufCTables_t nextHuf,
ZSTD_strategy  strategy,
int  disableLiteralCompression,
int  suspectUncompressible,
int  bmi2 
)

Definition at line 16038 of file zstd.c.

◆ ZSTD_compressRleLiteralsBlock()

size_t ZSTD_compressRleLiteralsBlock ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

Definition at line 15990 of file zstd.c.

◆ ZSTD_compressSeqStore_singleBlock()

static size_t ZSTD_compressSeqStore_singleBlock ( ZSTD_CCtx zc,
const seqStore_t *const  seqStore,
repcodes_t *const  dRep,
repcodes_t *const  cRep,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
U32  lastBlock,
U32  isPartition 
)
static

Definition at line 21584 of file zstd.c.

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

Definition at line 24431 of file zstd.c.

◆ ZSTD_compressSequences_internal()

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

Definition at line 24313 of file zstd.c.

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

Definition at line 23699 of file zstd.c.

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

Definition at line 23840 of file zstd.c.

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

Definition at line 23939 of file zstd.c.

◆ ZSTD_compressStream_generic()

static size_t ZSTD_compressStream_generic ( ZSTD_CStream zcs,
ZSTD_outBuffer output,
ZSTD_inBuffer input,
ZSTD_EndDirective const  flushMode 
)
static

ZSTD_compressStream_generic(): internal function for all compressStream() variants

Returns
: hint size for next input to complete ongoing block

Definition at line 23502 of file zstd.c.

◆ ZSTD_compressSubBlock()

static size_t ZSTD_compressSubBlock ( const ZSTD_entropyCTables_t entropy,
const ZSTD_entropyCTablesMetadata_t entropyMetadata,
const seqDef sequences,
size_t  nbSeq,
const BYTE literals,
size_t  litSize,
const BYTE llCode,
const BYTE mlCode,
const BYTE ofCode,
const ZSTD_CCtx_params *  cctxParams,
void *  dst,
size_t  dstCapacity,
const int  bmi2,
int  writeLitEntropy,
int  writeSeqEntropy,
int *  litEntropyWritten,
int *  seqEntropyWritten,
U32  lastBlock 
)
static

ZSTD_compressSubBlock() : Compresses a single sub-block.

Returns
: compressed size of the sub-block Or 0 if it failed to compress.

Definition at line 16941 of file zstd.c.

◆ ZSTD_compressSubBlock_literal()

static size_t ZSTD_compressSubBlock_literal ( const HUF_CElt hufTable,
const ZSTD_hufCTablesMetadata_t hufMetadata,
const BYTE literals,
size_t  litSize,
void *  dst,
size_t  dstSize,
const int  bmi2,
int  writeEntropy,
int *  entropyWritten 
)
static

ZSTD_compressSubBlock_literal() : Compresses literals section for a sub-block. When we have to write the Huffman table we will sometimes choose a header size larger than necessary. This is because we have to pick the header size before we know the table size + compressed size, so we have a bound on the table size. If we guessed incorrectly, we fall back to uncompressed literals.

We write the header when writeEntropy=1 and set entropyWritten=1 when we succeeded in writing the header, otherwise it is set to 0.

hufMetadata->hType has literals block type info. If it is set_basic, all sub-blocks literals section will be Raw_Literals_Block. If it is set_rle, all sub-blocks literals section will be RLE_Literals_Block. If it is set_compressed, first sub-block's literals section will be Compressed_Literals_Block If it is set_compressed, first sub-block's literals section will be Treeless_Literals_Block and the following sub-blocks' literals sections will be Treeless_Literals_Block.

Returns
: compressed size of literals section of a sub-block Or 0 if unable to compress. Or error code

Definition at line 16720 of file zstd.c.

◆ ZSTD_compressSubBlock_multi()

static size_t ZSTD_compressSubBlock_multi ( const seqStore_t seqStorePtr,
const ZSTD_compressedBlockState_t prevCBlock,
ZSTD_compressedBlockState_t nextCBlock,
const ZSTD_entropyCTablesMetadata_t entropyMetadata,
const ZSTD_CCtx_params *  cctxParams,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const int  bmi2,
U32  lastBlock,
void *  workspace,
size_t  wkspSize 
)
static

ZSTD_compressSubBlock_multi() : Breaks super-block into multiple sub-blocks and compresses them. Entropy will be written to the first block. The following blocks will use repeat mode to compress. All sub-blocks are compressed blocks (no raw or rle blocks).

Returns
: compressed size of the super block (which is multiple ZSTD blocks) Or 0 if it failed to compress.

Definition at line 17107 of file zstd.c.

◆ ZSTD_compressSubBlock_sequences()

static size_t ZSTD_compressSubBlock_sequences ( const ZSTD_fseCTables_t fseTables,
const ZSTD_fseCTablesMetadata_t fseMetadata,
const seqDef sequences,
size_t  nbSeq,
const BYTE llCode,
const BYTE mlCode,
const BYTE ofCode,
const ZSTD_CCtx_params *  cctxParams,
void *  dst,
size_t  dstCapacity,
const int  bmi2,
int  writeEntropy,
int *  entropyWritten 
)
static

ZSTD_compressSubBlock_sequences() : Compresses sequences section for a sub-block. fseMetadata->llType, fseMetadata->ofType, and fseMetadata->mlType have symbol compression modes for the super-block. The first successfully compressed block will have these in its header. We set entropyWritten=1 when we succeed in compressing the sequences. The following sub-blocks will always have repeat mode.

Returns
: compressed size of sequences section of a sub-block Or 0 if it is unable to compress Or error code.

Definition at line 16841 of file zstd.c.

◆ ZSTD_compressSuperBlock()

size_t ZSTD_compressSuperBlock ( ZSTD_CCtx zc,
void *  dst,
size_t  dstCapacity,
void const *  src,
size_t  srcSize,
unsigned  lastBlock 
)

Definition at line 17233 of file zstd.c.

◆ ZSTD_copy16()

static void ZSTD_copy16 ( void *  dst,
const void *  src 
)
static

Definition at line 10924 of file zstd.c.

◆ ZSTD_copy4()

static void ZSTD_copy4 ( void *  dst,
const void *  src 
)
static

Definition at line 37756 of file zstd.c.

◆ ZSTD_copy8()

static void ZSTD_copy8 ( void *  dst,
const void *  src 
)
static

Definition at line 10911 of file zstd.c.

◆ ZSTD_copyBlockSequences()

static void ZSTD_copyBlockSequences ( ZSTD_CCtx zc)
static

Definition at line 20946 of file zstd.c.

◆ 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

Definition at line 20173 of file zstd.c.

◆ ZSTD_copyCCtx_internal()

static size_t ZSTD_copyCCtx_internal ( ZSTD_CCtx dstCCtx,
const ZSTD_CCtx srcCCtx,
ZSTD_frameParameters  fParams,
U64  pledgedSrcSize,
ZSTD_buffered_policy_e  zbuff 
)
static

ZSTD_copyCCtx_internal() : Duplicate an existing context srcCCtx into another one dstCCtx. Only works during stage ZSTDcs_init (i.e. after creation, but before first call to ZSTD_compressContinue()). The "context", in this case, refers to the hash and chain tables, entropy tables, and dictionary references. windowLog value is enforced if != 0, otherwise value is copied from srcCCtx.

Returns
: 0, or an error code

Definition at line 20095 of file zstd.c.

◆ ZSTD_copyCDictTableIntoCCtx()

static void ZSTD_copyCDictTableIntoCCtx ( U32 dst,
U32 const *  src,
size_t  tableSize,
ZSTD_compressionParameters const *  cParams 
)
static

Definition at line 19969 of file zstd.c.

◆ ZSTD_copyDCtx()

void ZSTD_copyDCtx ( ZSTD_DCtx dstDCtx,
const ZSTD_DCtx srcDCtx 
)

Definition at line 35695 of file zstd.c.

◆ ZSTD_copyDDictParameters()

void ZSTD_copyDDictParameters ( ZSTD_DCtx dctx,
const ZSTD_DDict ddict 
)

Definition at line 35094 of file zstd.c.

◆ ZSTD_copyRawBlock()

static size_t ZSTD_copyRawBlock ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)
static

Definition at line 36241 of file zstd.c.

◆ 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 24032 of file zstd.c.

◆ 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 24118 of file zstd.c.

◆ ZSTD_count()

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

Definition at line 15118 of file zstd.c.

◆ 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 15144 of file zstd.c.

◆ ZSTD_countLeadingZeros32()

MEM_STATIC unsigned ZSTD_countLeadingZeros32 ( U32  val)

Definition at line 1888 of file zstd.c.

◆ ZSTD_countLeadingZeros32_fallback()

MEM_STATIC unsigned ZSTD_countLeadingZeros32_fallback ( U32  val)

Definition at line 1872 of file zstd.c.

◆ ZSTD_countLeadingZeros64()

MEM_STATIC unsigned ZSTD_countLeadingZeros64 ( U64  val)

Definition at line 1942 of file zstd.c.

◆ ZSTD_countSeqStoreLiteralsBytes()

static size_t ZSTD_countSeqStoreLiteralsBytes ( const seqStore_t *const  seqStore)
static

Definition at line 21448 of file zstd.c.

◆ ZSTD_countSeqStoreMatchBytes()

static size_t ZSTD_countSeqStoreMatchBytes ( const seqStore_t *const  seqStore)
static

Definition at line 21463 of file zstd.c.

◆ ZSTD_countTrailingZeros32()

MEM_STATIC unsigned ZSTD_countTrailingZeros32 ( U32  val)

Definition at line 1849 of file zstd.c.

◆ ZSTD_countTrailingZeros32_fallback()

MEM_STATIC unsigned ZSTD_countTrailingZeros32_fallback ( U32  val)

Definition at line 1837 of file zstd.c.

◆ ZSTD_countTrailingZeros64()

MEM_STATIC unsigned ZSTD_countTrailingZeros64 ( U64  val)

Definition at line 1911 of file zstd.c.

◆ ZSTD_cParam_clampBounds()

static size_t ZSTD_cParam_clampBounds ( ZSTD_cParameter  cParam,
int *  value 
)
static

Definition at line 18282 of file zstd.c.

◆ 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

Definition at line 18064 of file zstd.c.

◆ ZSTD_cParam_withinBounds()

MEM_STATIC int ZSTD_cParam_withinBounds ( ZSTD_cParameter  cParam,
int  value 
)

Definition at line 14920 of file zstd.c.

◆ ZSTD_cpuid()

MEM_STATIC ZSTD_cpuid_t ZSTD_cpuid ( void  )

Definition at line 4727 of file zstd.c.

◆ ZSTD_cpuSupportsBmi2()

MEM_STATIC int ZSTD_cpuSupportsBmi2 ( void  )
Returns
true iff the CPU supports dynamic BMI2 dispatch.

Definition at line 11119 of file zstd.c.

◆ ZSTD_createCCtx()

ZSTD_CCtx* ZSTD_createCCtx ( void  )

Definition at line 17735 of file zstd.c.

◆ ZSTD_createCCtx_advanced()

ZSTD_CCtx* ZSTD_createCCtx_advanced ( ZSTD_customMem  customMem)

Definition at line 17752 of file zstd.c.

◆ ZSTD_createCCtxParams()

ZSTD_CCtx_params* ZSTD_createCCtxParams ( void  )

Definition at line 17986 of file zstd.c.

◆ ZSTD_createCCtxParams_advanced()

static ZSTD_CCtx_params* ZSTD_createCCtxParams_advanced ( ZSTD_customMem  customMem)
static

Definition at line 17973 of file zstd.c.

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

Definition at line 23108 of file zstd.c.

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

Definition at line 23041 of file zstd.c.

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

Definition at line 23058 of file zstd.c.

◆ ZSTD_createCDict_advanced_internal()

static ZSTD_CDict* ZSTD_createCDict_advanced_internal ( size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod,
ZSTD_compressionParameters  cParams,
ZSTD_paramSwitch_e  useRowMatchFinder,
U32  enableDedicatedDictSearch,
ZSTD_customMem  customMem 
)
static

Definition at line 23005 of file zstd.c.

◆ ZSTD_createCDict_byReference()

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

Definition at line 23119 of file zstd.c.

◆ ZSTD_createCStream()

ZSTD_CStream* ZSTD_createCStream ( void  )

Definition at line 23326 of file zstd.c.

◆ ZSTD_createCStream_advanced()

ZSTD_CStream* ZSTD_createCStream_advanced ( ZSTD_customMem  customMem)

Definition at line 23337 of file zstd.c.

◆ ZSTD_createDCtx()

ZSTD_DCtx* ZSTD_createDCtx ( void  )

Definition at line 35659 of file zstd.c.

◆ ZSTD_createDCtx_advanced()

ZSTD_DCtx* ZSTD_createDCtx_advanced ( ZSTD_customMem  customMem)

Definition at line 35654 of file zstd.c.

◆ ZSTD_createDCtx_internal()

static ZSTD_DCtx* ZSTD_createDCtx_internal ( ZSTD_customMem  customMem)
static

Definition at line 35643 of file zstd.c.

◆ ZSTD_createDDict()

ZSTD_DDict* ZSTD_createDDict ( const void *  dict,
size_t  dictSize 
)

ZSTD_createDDict() : Create a digested dictionary, to start decompression without startup delay. dict content is copied inside DDict. Consequently, dict can be released after ZSTD_DDict creation

Definition at line 35206 of file zstd.c.

◆ ZSTD_createDDict_advanced()

ZSTD_DDict* ZSTD_createDDict_advanced ( const void *  dict,
size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod,
ZSTD_dictContentType_e  dictContentType,
ZSTD_customMem  customMem 
)

Definition at line 35181 of file zstd.c.

◆ ZSTD_createDDict_byReference()

ZSTD_DDict* ZSTD_createDDict_byReference ( const void *  dictBuffer,
size_t  dictSize 
)

ZSTD_createDDict_byReference() : Create a digested dictionary, to start decompression without startup delay. Dictionary content is simply referenced, it will be accessed during decompression. Warning : dictBuffer must outlive DDict (DDict must be freed before dictBuffer)

Definition at line 35216 of file zstd.c.

◆ ZSTD_createDDictHashSet()

static ZSTD_DDictHashSet* ZSTD_createDDictHashSet ( ZSTD_customMem  customMem)
static

Definition at line 35529 of file zstd.c.

◆ ZSTD_createDStream()

ZSTD_DStream* ZSTD_createDStream ( void  )

Definition at line 36996 of file zstd.c.

◆ ZSTD_createDStream_advanced()

ZSTD_DStream* ZSTD_createDStream_advanced ( ZSTD_customMem  customMem)

Definition at line 37007 of file zstd.c.

◆ ZSTD_createThreadPool()

POOL_ctx* ZSTD_createThreadPool ( size_t  numThreads)

Definition at line 4388 of file zstd.c.

◆ ZSTD_crossEntropyCost()

size_t ZSTD_crossEntropyCost ( short const *  norm,
unsigned  accuracyLog,
unsigned const *  count,
unsigned const  max 
)

Returns the cost in bits of encoding the distribution in count using the table described by norm. The max symbol support by norm is assumed >= max. norm must be valid for every symbol with non-zero probability in count.

Definition at line 16340 of file zstd.c.

◆ ZSTD_CStreamInSize()

size_t ZSTD_CStreamInSize ( void  )

recommended size for input buffer

Definition at line 23351 of file zstd.c.

◆ ZSTD_CStreamOutSize()

size_t ZSTD_CStreamOutSize ( void  )

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

Definition at line 23353 of file zstd.c.

◆ ZSTD_customCalloc()

MEM_STATIC void* ZSTD_customCalloc ( size_t  size,
ZSTD_customMem  customMem 
)

Definition at line 4180 of file zstd.c.

◆ ZSTD_customFree()

MEM_STATIC void ZSTD_customFree ( void *  ptr,
ZSTD_customMem  customMem 
)

Definition at line 4192 of file zstd.c.

◆ ZSTD_customMalloc()

MEM_STATIC void* ZSTD_customMalloc ( size_t  size,
ZSTD_customMem  customMem 
)

Definition at line 4173 of file zstd.c.

◆ ZSTD_cwksp_align()

MEM_STATIC size_t ZSTD_cwksp_align ( size_t  size,
size_t const  align 
)

Align must be a power of 2.

Definition at line 13743 of file zstd.c.

◆ ZSTD_cwksp_aligned_alloc_size()

MEM_STATIC size_t ZSTD_cwksp_aligned_alloc_size ( size_t  size)

Returns an adjusted alloc size that is the nearest larger multiple of 64 bytes. Used to determine the number of bytes required for a given "aligned".

Definition at line 13775 of file zstd.c.

◆ ZSTD_cwksp_alloc_size()

MEM_STATIC size_t ZSTD_cwksp_alloc_size ( size_t  size)

Use this to determine how much space in the workspace we will consume to allocate this object. (Normally it should be exactly the size of the object, but under special conditions, like ASAN, where we pad each object, it might be larger.)

Since tables aren't currently redzoned, you don't need to call through this to figure out how much space you need for the matchState tables. Everything else is though.

Do not use for sizing aligned buffers. Instead, use ZSTD_cwksp_aligned_alloc_size().

Definition at line 13761 of file zstd.c.

◆ ZSTD_cwksp_assert_internal_consistency()

MEM_STATIC void ZSTD_cwksp_assert_internal_consistency ( ZSTD_cwksp ws)

Definition at line 13716 of file zstd.c.

◆ ZSTD_cwksp_available_space()

MEM_STATIC size_t ZSTD_cwksp_available_space ( ZSTD_cwksp ws)

Definition at line 14246 of file zstd.c.

◆ ZSTD_cwksp_bump_oversized_duration()

MEM_STATIC void ZSTD_cwksp_bump_oversized_duration ( ZSTD_cwksp ws,
size_t  additionalNeededSpace 
)

Definition at line 14264 of file zstd.c.

◆ ZSTD_cwksp_bytes_to_align_ptr()

MEM_STATIC size_t ZSTD_cwksp_bytes_to_align_ptr ( void *  ptr,
const size_t  alignBytes 
)

Return the number of additional bytes required to align a pointer to the given number of bytes. alignBytes must be a power of two.

Definition at line 13796 of file zstd.c.

◆ ZSTD_cwksp_check_available()

MEM_STATIC int ZSTD_cwksp_check_available ( ZSTD_cwksp ws,
size_t  additionalNeededSpace 
)

Definition at line 14250 of file zstd.c.

◆ ZSTD_cwksp_check_too_large()

MEM_STATIC int ZSTD_cwksp_check_too_large ( ZSTD_cwksp ws,
size_t  additionalNeededSpace 
)

Definition at line 14254 of file zstd.c.

◆ ZSTD_cwksp_check_wasteful()

MEM_STATIC int ZSTD_cwksp_check_wasteful ( ZSTD_cwksp ws,
size_t  additionalNeededSpace 
)

Definition at line 14259 of file zstd.c.

◆ ZSTD_cwksp_clean_tables()

MEM_STATIC void ZSTD_cwksp_clean_tables ( ZSTD_cwksp ws)

Zero the part of the allocated tables not already marked clean.

Definition at line 14100 of file zstd.c.

◆ ZSTD_cwksp_clear()

MEM_STATIC void ZSTD_cwksp_clear ( ZSTD_cwksp ws)

Invalidates all buffer, aligned, and table allocations. Object allocations remain valid.

Definition at line 14136 of file zstd.c.

◆ ZSTD_cwksp_clear_tables()

MEM_STATIC void ZSTD_cwksp_clear_tables ( ZSTD_cwksp ws)

Invalidates table allocations. All other allocations remain valid.

Definition at line 14114 of file zstd.c.

◆ ZSTD_cwksp_create()

MEM_STATIC size_t ZSTD_cwksp_create ( ZSTD_cwksp ws,
size_t  size,
ZSTD_customMem  customMem 
)

Definition at line 14193 of file zstd.c.

◆ ZSTD_cwksp_estimated_space_within_bounds()

MEM_STATIC int ZSTD_cwksp_estimated_space_within_bounds ( const ZSTD_cwksp *const  ws,
size_t const  estimatedSpace 
)

Definition at line 14238 of file zstd.c.

◆ ZSTD_cwksp_free()

MEM_STATIC void ZSTD_cwksp_free ( ZSTD_cwksp ws,
ZSTD_customMem  customMem 
)

Definition at line 14201 of file zstd.c.

◆ ZSTD_cwksp_init()

MEM_STATIC void ZSTD_cwksp_init ( ZSTD_cwksp ws,
void *  start,
size_t  size,
ZSTD_cwksp_static_alloc_e  isStatic 
)

The provided workspace takes ownership of the buffer [start, start+size). Any existing values in the workspace are ignored (the previously managed buffer, if present, must be separately freed).

Definition at line 14178 of file zstd.c.

◆ ZSTD_cwksp_initialAllocStart()

MEM_STATIC void * ZSTD_cwksp_initialAllocStart ( ZSTD_cwksp ws)

Returns the initial value for allocStart which is used to determine the position from which we can allocate from the end of the workspace.

Definition at line 13808 of file zstd.c.

◆ ZSTD_cwksp_internal_advance_phase()

MEM_STATIC size_t ZSTD_cwksp_internal_advance_phase ( ZSTD_cwksp ws,
ZSTD_cwksp_alloc_phase_e  phase 
)

Moves the cwksp to the next phase, and does any necessary allocations. cwksp initialization must necessarily go through each phase in order. Returns a 0 on success, or zstd error

Definition at line 13848 of file zstd.c.

◆ ZSTD_cwksp_mark_tables_clean()

MEM_STATIC void ZSTD_cwksp_mark_tables_clean ( ZSTD_cwksp ws)

Definition at line 14087 of file zstd.c.

◆ ZSTD_cwksp_mark_tables_dirty()

MEM_STATIC void ZSTD_cwksp_mark_tables_dirty ( ZSTD_cwksp ws)

Definition at line 14058 of file zstd.c.

◆ ZSTD_cwksp_move()

MEM_STATIC void ZSTD_cwksp_move ( ZSTD_cwksp dst,
ZSTD_cwksp src 
)

Moves the management of a workspace from one cwksp to another. The src cwksp is left in an invalid state (src must be re-init()'ed before it's used again).

Definition at line 14212 of file zstd.c.

◆ ZSTD_cwksp_owns_buffer()

MEM_STATIC int ZSTD_cwksp_owns_buffer ( const ZSTD_cwksp ws,
const void *  ptr 
)

Returns whether this object/buffer/etc was allocated in this workspace.

Definition at line 13881 of file zstd.c.

◆ ZSTD_cwksp_reserve_aligned()

MEM_STATIC void* ZSTD_cwksp_reserve_aligned ( ZSTD_cwksp ws,
size_t  bytes 
)

Reserves and returns memory sized on and aligned on ZSTD_CWKSP_ALIGNMENT_BYTES (64 bytes).

Definition at line 13961 of file zstd.c.

◆ ZSTD_cwksp_reserve_aligned_init_once()

MEM_STATIC void* ZSTD_cwksp_reserve_aligned_init_once ( ZSTD_cwksp ws,
size_t  bytes 
)

Reserves and returns memory sized on and aligned on ZSTD_CWKSP_ALIGNMENT_BYTES (64 bytes). This memory has been initialized at least once in the past. This doesn't mean it has been initialized this time, and it might contain data from previous operations. The main usage is for algorithms that might need read access into uninitialized memory. The algorithm must maintain safety under these conditions and must make sure it doesn't leak any of the past data (directly or in side channels).

Definition at line 13937 of file zstd.c.

◆ ZSTD_cwksp_reserve_buffer()

MEM_STATIC BYTE* ZSTD_cwksp_reserve_buffer ( ZSTD_cwksp ws,
size_t  bytes 
)

Reserves and returns unaligned memory.

Definition at line 13923 of file zstd.c.

◆ ZSTD_cwksp_reserve_failed()

MEM_STATIC int ZSTD_cwksp_reserve_failed ( const ZSTD_cwksp ws)

Definition at line 14226 of file zstd.c.

◆ ZSTD_cwksp_reserve_internal()

MEM_STATIC void* ZSTD_cwksp_reserve_internal ( ZSTD_cwksp ws,
size_t  bytes,
ZSTD_cwksp_alloc_phase_e  phase 
)

Internal function. Do not use directly.

Definition at line 13890 of file zstd.c.

◆ ZSTD_cwksp_reserve_internal_buffer_space()

MEM_STATIC void* ZSTD_cwksp_reserve_internal_buffer_space ( ZSTD_cwksp ws,
size_t const  bytes 
)

Internal function. Do not use directly. Reserves the given number of bytes within the aligned/buffer segment of the wksp, which counts from the end of the wksp (as opposed to the object/table segment).

Returns a pointer to the beginning of that space.

Definition at line 13820 of file zstd.c.

◆ ZSTD_cwksp_reserve_object()

MEM_STATIC void* ZSTD_cwksp_reserve_object ( ZSTD_cwksp ws,
size_t  bytes 
)

Aligned on sizeof(void*). Note : should happen only once, at workspace first initialization

Definition at line 14019 of file zstd.c.

◆ ZSTD_cwksp_reserve_table()

MEM_STATIC void* ZSTD_cwksp_reserve_table ( ZSTD_cwksp ws,
size_t  bytes 
)

Aligned on 64 bytes. These buffers have the special property that their values remain constrained, allowing us to re-use them without memset()-ing them.

Definition at line 13974 of file zstd.c.

◆ ZSTD_cwksp_sizeof()

MEM_STATIC size_t ZSTD_cwksp_sizeof ( const ZSTD_cwksp ws)

Definition at line 14217 of file zstd.c.

◆ ZSTD_cwksp_slack_space_required()

MEM_STATIC size_t ZSTD_cwksp_slack_space_required ( void  )

Returns the amount of additional space the cwksp must allocate for internal purposes (currently only alignment).

Definition at line 13783 of file zstd.c.

◆ ZSTD_cwksp_used()

MEM_STATIC size_t ZSTD_cwksp_used ( const ZSTD_cwksp ws)

Definition at line 14221 of file zstd.c.

◆ ZSTD_cycleLog()

U32 ZSTD_cycleLog ( U32  hashLog,
ZSTD_strategy  strat 
)

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

Definition at line 19051 of file zstd.c.

◆ ZSTD_DCtx_get_bmi2()

MEM_STATIC int ZSTD_DCtx_get_bmi2 ( const struct ZSTD_DCtx_s dctx)

Definition at line 34987 of file zstd.c.

◆ ZSTD_DCtx_getParameter()

size_t ZSTD_DCtx_getParameter ( ZSTD_DCtx dctx,
ZSTD_dParameter  param,
int *  value 
)

Definition at line 37197 of file zstd.c.

◆ ZSTD_DCtx_isOverflow()

static int ZSTD_DCtx_isOverflow ( ZSTD_DStream zds,
size_t const  neededInBuffSize,
size_t const  neededOutBuffSize 
)
static

Definition at line 37317 of file zstd.c.

◆ ZSTD_DCtx_isOversizedTooLong()

static int ZSTD_DCtx_isOversizedTooLong ( ZSTD_DStream zds)
static

Definition at line 37330 of file zstd.c.

◆ ZSTD_DCtx_loadDictionary()

size_t ZSTD_DCtx_loadDictionary ( ZSTD_DCtx dctx,
const void *  dict,
size_t  dictSize 
)

ZSTD_DCtx_loadDictionary() : Requires v1.4.0+ Create an internal DDict from dict buffer, to be used to decompress all future frames. The dictionary remains valid for all future frames, until explicitly invalidated, or a new dictionary is loaded.

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, meaning "return to no-dictionary mode". Note 1 : Loading a dictionary involves building tables, which has a non-negligible impact on CPU usage and latency. It's recommended to "load once, use many times", to amortize the cost Note 2 :dict content will be copied internally, so dict can be released after loading. Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead. Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of how dictionary content is loaded and interpreted.

Definition at line 37044 of file zstd.c.

◆ ZSTD_DCtx_loadDictionary_advanced()

size_t ZSTD_DCtx_loadDictionary_advanced ( ZSTD_DCtx dctx,
const void *  dict,
size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod,
ZSTD_dictContentType_e  dictContentType 
)

Definition at line 37023 of file zstd.c.

◆ ZSTD_DCtx_loadDictionary_byReference()

size_t ZSTD_DCtx_loadDictionary_byReference ( ZSTD_DCtx dctx,
const void *  dict,
size_t  dictSize 
)

Definition at line 37039 of file zstd.c.

◆ ZSTD_DCtx_refDDict()

size_t ZSTD_DCtx_refDDict ( ZSTD_DCtx dctx,
const ZSTD_DDict ddict 
)

ZSTD_DCtx_refDDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used to decompress next frames. The dictionary remains active for decompression of future frames using same DCtx.

If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function will store the DDict references in a table, and the DDict used for decompression will be determined at decompression time, as per the dict ID in the frame. The memory for the table is allocated on the first call to refDDict, and can be freed with ZSTD_freeDCtx().

If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary will be managed, and referencing a dictionary effectively "discards" any previous one.

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Special: referencing a NULL DDict means "return to no-dictionary mode". Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.

Definition at line 37104 of file zstd.c.

◆ ZSTD_DCtx_refPrefix()

size_t ZSTD_DCtx_refPrefix ( ZSTD_DCtx dctx,
const void *  prefix,
size_t  prefixSize 
)

ZSTD_DCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) to decompress next frame. This is the reverse operation of ZSTD_CCtx_refPrefix(), and must use the same prefix as the one used during compression. Prefix is only used once. Reference is discarded at end of frame. End of frame is reached when ZSTD_decompressStream() returns 0.

Returns
: 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary Note 2 : Prefix buffer is referenced. It must outlive decompression. Prefix buffer must remain unmodified up to the end of frame, reached when ZSTD_decompressStream() returns 0. Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. A full dictionary is more costly, as it requires building tables.

Definition at line 37056 of file zstd.c.

◆ ZSTD_DCtx_refPrefix_advanced()

size_t ZSTD_DCtx_refPrefix_advanced ( ZSTD_DCtx dctx,
const void *  prefix,
size_t  prefixSize,
ZSTD_dictContentType_e  dictContentType 
)

Definition at line 37049 of file zstd.c.

◆ ZSTD_DCtx_reset()

size_t ZSTD_DCtx_reset ( ZSTD_DCtx dctx,
ZSTD_ResetDirective  reset 
)

ZSTD_DCtx_reset() : Return a DCtx to clean state. Session and parameters can be reset jointly or separately. Parameters can only be reset when no active frame is being decompressed.

Returns
: 0, or an error code, which can be tested with ZSTD_isError()

Definition at line 37260 of file zstd.c.

◆ ZSTD_DCtx_resetParameters()

static void ZSTD_DCtx_resetParameters ( ZSTD_DCtx dctx)
static

Definition at line 35591 of file zstd.c.

◆ ZSTD_DCtx_selectFrameDDict()

static void ZSTD_DCtx_selectFrameDDict ( ZSTD_DCtx dctx)
static

Definition at line 35709 of file zstd.c.

◆ ZSTD_DCtx_setFormat()

size_t ZSTD_DCtx_setFormat ( ZSTD_DCtx dctx,
ZSTD_format_e  format 
)

Definition at line 37140 of file zstd.c.

◆ ZSTD_DCtx_setMaxWindowSize()

size_t ZSTD_DCtx_setMaxWindowSize ( ZSTD_DCtx dctx,
size_t  maxWindowSize 
)

Definition at line 37128 of file zstd.c.

◆ ZSTD_DCtx_setParameter()

size_t ZSTD_DCtx_setParameter ( ZSTD_DCtx dctx,
ZSTD_dParameter  param,
int  value 
)

ZSTD_DCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_dParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is only possible during frame initialization (before starting decompression).

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

Definition at line 37223 of file zstd.c.

◆ ZSTD_DCtx_trace_end()

static void ZSTD_DCtx_trace_end ( ZSTD_DCtx const *  dctx,
U64  uncompressedSize,
U64  compressedSize,
unsigned  streaming 
)
static

Definition at line 36267 of file zstd.c.

◆ ZSTD_DCtx_updateOversizedDuration()

static void ZSTD_DCtx_updateOversizedDuration ( ZSTD_DStream zds,
size_t const  neededInBuffSize,
size_t const  neededOutBuffSize 
)
static

Definition at line 37322 of file zstd.c.

◆ ZSTD_DDict_dictContent()

const void * ZSTD_DDict_dictContent ( const ZSTD_DDict ddict)

Definition at line 35082 of file zstd.c.

◆ ZSTD_DDict_dictSize()

size_t ZSTD_DDict_dictSize ( const ZSTD_DDict ddict)

Definition at line 35088 of file zstd.c.

◆ ZSTD_DDictHashSet_addDDict()

static size_t ZSTD_DDictHashSet_addDDict ( ZSTD_DDictHashSet hashSet,
const ZSTD_DDict ddict,
ZSTD_customMem  customMem 
)
static

Definition at line 35560 of file zstd.c.

◆ ZSTD_DDictHashSet_emplaceDDict()

static size_t ZSTD_DDictHashSet_emplaceDDict ( ZSTD_DDictHashSet hashSet,
const ZSTD_DDict ddict 
)
static

Definition at line 35456 of file zstd.c.

◆ ZSTD_DDictHashSet_expand()

static size_t ZSTD_DDictHashSet_expand ( ZSTD_DDictHashSet hashSet,
ZSTD_customMem  customMem 
)
static

Definition at line 35482 of file zstd.c.

◆ ZSTD_DDictHashSet_getDDict()

static const ZSTD_DDict* ZSTD_DDictHashSet_getDDict ( ZSTD_DDictHashSet hashSet,
U32  dictID 
)
static

Definition at line 35507 of file zstd.c.

◆ ZSTD_DDictHashSet_getIndex()

static size_t ZSTD_DDictHashSet_getIndex ( const ZSTD_DDictHashSet hashSet,
U32  dictID 
)
static

Definition at line 35446 of file zstd.c.

◆ ZSTD_decodeFrameHeader()

static size_t ZSTD_decodeFrameHeader ( ZSTD_DCtx dctx,
const void *  src,
size_t  headerSize 
)
static

ZSTD_decodeFrameHeader() : headerSize must be the size provided by ZSTD_frameHeaderSize(). If multiple DDict references are enabled, also will choose the correct DDict to use.

Returns
: 0 if success, or an error code, which can be tested using ZSTD_isError()

Definition at line 36049 of file zstd.c.

◆ ZSTD_decodeLiteralsBlock()

size_t ZSTD_decodeLiteralsBlock ( ZSTD_DCtx dctx,
const void *  src,
size_t  srcSize,
void *  dst,
size_t  dstCapacity,
const streaming_operation  streaming 
)

ZSTD_decodeLiteralsBlock() : Where it is possible to do so without being stomped by the output during decompression, the literals block will be stored in the dstBuffer. If there is room to do so, it will be stored in full in the excess dst space after where the current block will be output. Otherwise it will be stored at the end of the current dst blockspace, with a small portion being stored in dctx->litExtraBuffer to help keep it "ahead" of the current output write.

Returns
: nb of bytes read from src (< srcSize ) note : symbol not declared but exposed for fullbench

Definition at line 37828 of file zstd.c.

◆ ZSTD_decodeSeqHeaders()

size_t ZSTD_decodeSeqHeaders ( ZSTD_DCtx dctx,
int *  nbSeqPtr,
const void *  src,
size_t  srcSize 
)

ZSTD_decodeSeqHeaders() : decode sequence header from src

Definition at line 38373 of file zstd.c.

◆ ZSTD_decodeSequence()

FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequence ( seqState_t seqState,
const ZSTD_longOffset_e  longOffsets 
)

Definition at line 38894 of file zstd.c.

◆ ZSTD_decodingBufferSize_min()

size_t ZSTD_decodingBufferSize_min ( unsigned long long  windowSize,
unsigned long long  frameContentSize 
)

Definition at line 37282 of file zstd.c.

◆ ZSTD_decompress()

size_t ZSTD_decompress ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  compressedSize 
)

ZSTD_decompress() : compressedSize : must be the exact size of some number of compressed and/or skippable frames. dstCapacity is an upper bound of originalSize to regenerate. If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data.

Returns
: the number of bytes decompressed into dst (<= dstCapacity), or an errorCode if it fails (which can be tested using ZSTD_isError()).

Definition at line 36530 of file zstd.c.

◆ ZSTD_decompress_insertDictionary()

static size_t ZSTD_decompress_insertDictionary ( ZSTD_DCtx dctx,
const void *  dict,
size_t  dictSize 
)
static

Definition at line 36864 of file zstd.c.

◆ ZSTD_decompress_usingDDict()

size_t ZSTD_decompress_usingDDict ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const ZSTD_DDict ddict 
)

ZSTD_decompress_usingDDict() : Decompression using a pre-digested Dictionary Use dictionary without significant overhead.

Definition at line 36980 of file zstd.c.

◆ ZSTD_decompress_usingDict()

size_t ZSTD_decompress_usingDict ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const void *  dict,
size_t  dictSize 
)

ZSTD_decompress_usingDict() : Decompression using a known Dictionary. Dictionary must be identical to the one used during compression. Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note : When dict == NULL || dictSize < 8 no dictionary is used.

Definition at line 36498 of file zstd.c.

◆ ZSTD_decompressBegin()

size_t ZSTD_decompressBegin ( ZSTD_DCtx dctx)

Definition at line 36885 of file zstd.c.

◆ ZSTD_decompressBegin_usingDDict()

size_t ZSTD_decompressBegin_usingDDict ( ZSTD_DCtx dctx,
const ZSTD_DDict ddict 
)

Definition at line 36925 of file zstd.c.

◆ ZSTD_decompressBegin_usingDict()

size_t ZSTD_decompressBegin_usingDict ( ZSTD_DCtx dctx,
const void *  dict,
size_t  dictSize 
)

Definition at line 36912 of file zstd.c.

◆ ZSTD_decompressBlock()

size_t ZSTD_decompressBlock ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

Definition at line 39896 of file zstd.c.

◆ ZSTD_decompressBlock_deprecated()

size_t ZSTD_decompressBlock_deprecated ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

Definition at line 39883 of file zstd.c.

◆ ZSTD_decompressBlock_internal()

size_t ZSTD_decompressBlock_internal ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const int  frame,
const streaming_operation  streaming 
)

Definition at line 39761 of file zstd.c.

◆ ZSTD_decompressBound()

unsigned long long ZSTD_decompressBound ( const void *  src,
size_t  srcSize 
)

ZSTD_decompressBound() : compatible with legacy mode src must point to the start of a ZSTD frame or a skippeable frame srcSize must be at least as large as the frame contained

Returns
: the maximum decompressed size of the compressed source

Definition at line 36165 of file zstd.c.

◆ ZSTD_decompressContinue()

size_t ZSTD_decompressContinue ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

ZSTD_decompressContinue() : srcSize : must be the exact nb of bytes expected (see ZSTD_nextSrcSizeToDecompress())

Returns
: nb of bytes generated into dst (necessarily <= `dstCapacity) or an error code, which can be tested using ZSTD_isError()

Definition at line 36602 of file zstd.c.

◆ ZSTD_decompressContinueStream()

static size_t ZSTD_decompressContinueStream ( ZSTD_DStream zds,
char **  op,
char *  oend,
void const *  src,
size_t  srcSize 
)
static

Definition at line 37358 of file zstd.c.

◆ ZSTD_decompressDCtx()

size_t ZSTD_decompressDCtx ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

ZSTD_decompressDCtx() : Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx. Compatible with sticky parameters.

Definition at line 36524 of file zstd.c.

◆ ZSTD_decompressFrame()

static size_t ZSTD_decompressFrame ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void **  srcPtr,
size_t *  srcSizePtr 
)
static

ZSTD_decompressFrame() : @dctx must be properly initialized will update *srcPtr and *srcSizePtr, to make *srcPtr progress by one frame.

Definition at line 36298 of file zstd.c.

◆ ZSTD_decompressionMargin()

size_t ZSTD_decompressionMargin ( void const *  src,
size_t  srcSize 
)

Definition at line 36183 of file zstd.c.

◆ ZSTD_decompressMultiFrame()

static size_t ZSTD_decompressMultiFrame ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize,
const void *  dict,
size_t  dictSize,
const ZSTD_DDict ddict 
)
static

Definition at line 36406 of file zstd.c.

◆ ZSTD_decompressSequences()

static size_t ZSTD_decompressSequences ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)
static

Definition at line 39632 of file zstd.c.

◆ ZSTD_decompressSequences_body()

FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE ZSTD_decompressSequences_body ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)

Definition at line 39277 of file zstd.c.

◆ ZSTD_decompressSequences_bodySplitLitBuffer()

FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE ZSTD_decompressSequences_bodySplitLitBuffer ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)

Definition at line 39060 of file zstd.c.

◆ ZSTD_decompressSequences_default()

static size_t ZSTD_decompressSequences_default ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)
static

Definition at line 39365 of file zstd.c.

◆ ZSTD_decompressSequencesLong()

static size_t ZSTD_decompressSequencesLong ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)
static

Definition at line 39669 of file zstd.c.

◆ ZSTD_decompressSequencesLong_body()

FORCE_INLINE_TEMPLATE size_t ZSTD_decompressSequencesLong_body ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)

Definition at line 39405 of file zstd.c.

◆ ZSTD_decompressSequencesLong_default()

static size_t ZSTD_decompressSequencesLong_default ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)
static

Definition at line 39572 of file zstd.c.

◆ ZSTD_decompressSequencesSplitLitBuffer()

static size_t ZSTD_decompressSequencesSplitLitBuffer ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)
static

Definition at line 39646 of file zstd.c.

◆ ZSTD_decompressSequencesSplitLitBuffer_default()

static size_t ZSTD_decompressSequencesSplitLitBuffer_default ( ZSTD_DCtx dctx,
void *  dst,
size_t  maxDstSize,
const void *  seqStart,
size_t  seqSize,
int  nbSeq,
const ZSTD_longOffset_e  isLongOffset,
const int  frame 
)
static

Definition at line 39375 of file zstd.c.

◆ ZSTD_decompressStream()

size_t ZSTD_decompressStream ( ZSTD_DStream zds,
ZSTD_outBuffer output,
ZSTD_inBuffer input 
)

ZSTD_decompressStream() : Streaming decompression function. Call repetitively to consume full input updating it as necessary. Function will update both input and output pos fields exposing current state via these fields:

  • input.pos < input.size, some input remaining and caller should provide remaining input on the next call.
  • output.pos < output.size, decoder finished and flushed all remaining buffers.
  • output.pos == output.size, potentially uncflushed data present in the internal buffers, call ZSTD_decompressStream() again to flush remaining data to output. Note : with no additional input, amount of data flushed <= ZSTD_BLOCKSIZE_MAX.
Returns
: 0 when a frame is completely decoded and fully flushed, or an error code, which can be tested using ZSTD_isError(), or any other value > 0, which means there is some decoding or flushing to do to complete current frame.

Definition at line 37387 of file zstd.c.

◆ ZSTD_decompressStream_simpleArgs()

size_t ZSTD_decompressStream_simpleArgs ( ZSTD_DCtx dctx,
void *  dst,
size_t  dstCapacity,
size_t *  dstPos,
const void *  src,
size_t  srcSize,
size_t *  srcPos 
)

Definition at line 37689 of file zstd.c.

◆ ZSTD_dedicatedDictSearch_getCParams()

static ZSTD_compressionParameters ZSTD_dedicatedDictSearch_getCParams ( int const  compressionLevel,
size_t const  dictSize 
)
static

Definition at line 24651 of file zstd.c.

◆ ZSTD_dedicatedDictSearch_isSupported()

static int ZSTD_dedicatedDictSearch_isSupported ( const ZSTD_compressionParameters *  cParams)
static

Definition at line 24672 of file zstd.c.

◆ ZSTD_dedicatedDictSearch_lazy_loadDictionary()

void ZSTD_dedicatedDictSearch_lazy_loadDictionary ( ZSTD_matchState_t ms,
const BYTE *const  ip 
)

Definition at line 26931 of file zstd.c.

◆ ZSTD_dedicatedDictSearch_lazy_search()

FORCE_INLINE_TEMPLATE size_t ZSTD_dedicatedDictSearch_lazy_search ( size_t *  offsetPtr,
size_t  ml,
U32  nbAttempts,
const ZSTD_matchState_t *const  dms,
const BYTE *const  ip,
const BYTE *const  iLimit,
const BYTE *const  prefixStart,
const U32  curr,
const U32  dictLimit,
const size_t  ddsIdx 
)

Definition at line 27049 of file zstd.c.

◆ ZSTD_dedicatedDictSearch_revertCParams()

static void ZSTD_dedicatedDictSearch_revertCParams ( ZSTD_compressionParameters *  cParams)
static

Reverses the adjustment applied to cparams when enabling dedicated dict search. This is used to recover the params set to be used in the working context. (Otherwise, those tables would also grow.)

Definition at line 24686 of file zstd.c.

◆ ZSTD_defaultCLevel()

int ZSTD_defaultCLevel ( void  )

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

Definition at line 24649 of file zstd.c.

◆ ZSTD_deriveBlockSplits()

static size_t ZSTD_deriveBlockSplits ( ZSTD_CCtx zc,
U32  partitions[],
U32  nbSeq 
)
static

Definition at line 21717 of file zstd.c.

◆ ZSTD_deriveBlockSplitsHelper()

static void ZSTD_deriveBlockSplitsHelper ( seqStoreSplits splits,
size_t  startIdx,
size_t  endIdx,
ZSTD_CCtx zc,
const seqStore_t origSeqStore 
)
static

Definition at line 21675 of file zstd.c.

◆ ZSTD_deriveSeqStoreChunk()

static void ZSTD_deriveSeqStoreChunk ( seqStore_t resultSeqStore,
const seqStore_t originalSeqStore,
size_t  startIdx,
size_t  endIdx 
)
static

Definition at line 21480 of file zstd.c.

◆ ZSTD_dictAndWindowLog()

static U32 ZSTD_dictAndWindowLog ( U32  windowLog,
U64  srcSize,
U64  dictSize 
)
static

ZSTD_dictAndWindowLog() : Returns an adjusted window log that is large enough to fit the source and the dictionary. The zstd format says that the entire dictionary is valid if one byte of the dictionary is within the window. So the hashLog and chainLog should be large enough to reference both the dictionary and the window. So we must use this adjusted dictAndWindowLog when downsizing the hashLog and windowLog. NOTE: srcSize must not be ZSTD_CONTENTSIZE_UNKNOWN.

Definition at line 19065 of file zstd.c.

◆ ZSTD_dictNCountRepeat()

static FSE_repeat ZSTD_dictNCountRepeat ( short *  normalizedCounter,
unsigned  dictMaxSymbolValue,
unsigned  maxSymbolValue 
)
static

Definition at line 22447 of file zstd.c.

◆ ZSTD_dictTooBig()

static int ZSTD_dictTooBig ( size_t const  loadedDictSize)
static

ZSTD_dictTooBig(): When dictionaries are larger than ZSTD_CHUNKSIZE_MAX they can't be loaded in one go generically. So we ensure that in that case we reset the tables to zero, so that we can load as much of the dictionary as possible.

Definition at line 19672 of file zstd.c.

◆ ZSTD_downscaleStats()

static U32 ZSTD_downscaleStats ( unsigned *  table,
U32  lastEltIndex,
U32  shift,
base_directive_e  base1 
)
static

Definition at line 29624 of file zstd.c.

◆ ZSTD_dParam_getBounds()

ZSTD_bounds ZSTD_dParam_getBounds ( ZSTD_dParameter  dParam)

ZSTD_dParam_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()
  • both lower and upper bounds, inclusive

Definition at line 37145 of file zstd.c.

◆ ZSTD_dParam_withinBounds()

static int ZSTD_dParam_withinBounds ( ZSTD_dParameter  dParam,
int  value 
)
static

Definition at line 37184 of file zstd.c.

◆ ZSTD_DStreamInSize()

size_t ZSTD_DStreamInSize ( void  )

recommended size for input buffer

Definition at line 37020 of file zstd.c.

◆ ZSTD_DStreamOutSize()

size_t ZSTD_DStreamOutSize ( void  )

recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances.

Definition at line 37021 of file zstd.c.

◆ ZSTD_DUBT_findBestMatch()

static size_t ZSTD_DUBT_findBestMatch ( ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iend,
size_t *  offBasePtr,
U32 const  mls,
const ZSTD_dictMode_e  dictMode 
)
static

Definition at line 26764 of file zstd.c.

◆ ZSTD_DUBT_findBetterDictMatch()

static size_t ZSTD_DUBT_findBetterDictMatch ( const ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iend,
size_t *  offsetPtr,
size_t  bestLength,
U32  nbCompares,
U32 const  mls,
const ZSTD_dictMode_e  dictMode 
)
static

Definition at line 26686 of file zstd.c.

◆ ZSTD_encodeSequences()

size_t ZSTD_encodeSequences ( void *  dst,
size_t  dstCapacity,
FSE_CTable const *  CTable_MatchLength,
BYTE const *  mlCodeTable,
FSE_CTable const *  CTable_OffsetBits,
BYTE const *  ofCodeTable,
FSE_CTable const *  CTable_LitLength,
BYTE const *  llCodeTable,
seqDef const *  sequences,
size_t  nbSeq,
int  longOffsets,
int  bmi2 
)

Definition at line 16620 of file zstd.c.

◆ ZSTD_encodeSequences_body()

FORCE_INLINE_TEMPLATE size_t ZSTD_encodeSequences_body ( void *  dst,
size_t  dstCapacity,
FSE_CTable const *  CTable_MatchLength,
BYTE const *  mlCodeTable,
FSE_CTable const *  CTable_OffsetBits,
BYTE const *  ofCodeTable,
FSE_CTable const *  CTable_LitLength,
BYTE const *  llCodeTable,
seqDef const *  sequences,
size_t  nbSeq,
int  longOffsets 
)

Definition at line 16492 of file zstd.c.

◆ ZSTD_encodeSequences_default()

static size_t ZSTD_encodeSequences_default ( void *  dst,
size_t  dstCapacity,
FSE_CTable const *  CTable_MatchLength,
BYTE const *  mlCodeTable,
FSE_CTable const *  CTable_OffsetBits,
BYTE const *  ofCodeTable,
FSE_CTable const *  CTable_LitLength,
BYTE const *  llCodeTable,
seqDef const *  sequences,
size_t  nbSeq,
int  longOffsets 
)
static

Definition at line 16586 of file zstd.c.

◆ ZSTD_endStream()

size_t ZSTD_endStream ( ZSTD_CStream zcs,
ZSTD_outBuffer output 
)

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

Definition at line 24493 of file zstd.c.

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

Definition at line 20590 of file zstd.c.

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

Definition at line 20470 of file zstd.c.

◆ ZSTD_entropyCost()

static size_t ZSTD_entropyCost ( unsigned const *  count,
unsigned const  max,
size_t const  total 
)
static

Returns the cost in bits of encoding the distribution described by count using the entropy bound.

Definition at line 16285 of file zstd.c.

◆ ZSTD_errorFrameSizeInfo()

static ZSTD_frameSizeInfo ZSTD_errorFrameSizeInfo ( size_t  ret)
static

Definition at line 36073 of file zstd.c.

◆ ZSTD_estimateBlockSize()

static size_t ZSTD_estimateBlockSize ( const BYTE literals,
size_t  litSize,
const BYTE ofCodeTable,
const BYTE llCodeTable,
const BYTE mlCodeTable,
size_t  nbSeq,
const ZSTD_entropyCTables_t entropy,
const ZSTD_entropyCTablesMetadata_t entropyMetadata,
void *  workspace,
size_t  wkspSize,
int  writeLitEntropy,
int  writeSeqEntropy 
)
static

Definition at line 21403 of file zstd.c.

◆ ZSTD_estimateBlockSize_literal()

static size_t ZSTD_estimateBlockSize_literal ( const BYTE literals,
size_t  litSize,
const ZSTD_hufCTables_t huf,
const ZSTD_hufCTablesMetadata_t hufMetadata,
void *  workspace,
size_t  wkspSize,
int  writeEntropy 
)
static

Definition at line 21309 of file zstd.c.

◆ ZSTD_estimateBlockSize_sequences()

static size_t ZSTD_estimateBlockSize_sequences ( const BYTE ofCodeTable,
const BYTE llCodeTable,
const BYTE mlCodeTable,
size_t  nbSeq,
const ZSTD_fseCTables_t fseTables,
const ZSTD_fseCTablesMetadata_t fseMetadata,
void *  workspace,
size_t  wkspSize,
int  writeEntropy 
)
static

Definition at line 21374 of file zstd.c.

◆ ZSTD_estimateBlockSize_symbolType()

static size_t ZSTD_estimateBlockSize_symbolType ( symbolEncodingType_e  type,
const BYTE codeTable,
size_t  nbSeq,
unsigned  maxCode,
const FSE_CTable fseCTable,
const U8 additionalBits,
short const *  defaultNorm,
U32  defaultNormLog,
U32  defaultMax,
void *  workspace,
size_t  wkspSize 
)
static

Definition at line 21336 of file zstd.c.

◆ ZSTD_estimateCCtxSize()

size_t ZSTD_estimateCCtxSize ( int  compressionLevel)

Definition at line 19382 of file zstd.c.

◆ ZSTD_estimateCCtxSize_internal()

static size_t ZSTD_estimateCCtxSize_internal ( int  compressionLevel)
static

Definition at line 19369 of file zstd.c.

◆ ZSTD_estimateCCtxSize_usingCCtxParams()

size_t ZSTD_estimateCCtxSize_usingCCtxParams ( const ZSTD_CCtx_params *  params)

Definition at line 19337 of file zstd.c.

◆ ZSTD_estimateCCtxSize_usingCCtxParams_internal()

static size_t ZSTD_estimateCCtxSize_usingCCtxParams_internal ( const ZSTD_compressionParameters *  cParams,
const ldmParams_t ldmParams,
const int  isStatic,
const ZSTD_paramSwitch_e  useRowMatchFinder,
const size_t  buffInSize,
const size_t  buffOutSize,
const U64  pledgedSrcSize,
int  useSequenceProducer,
size_t  maxBlockSize 
)
static

Definition at line 19285 of file zstd.c.

◆ ZSTD_estimateCCtxSize_usingCParams()

size_t ZSTD_estimateCCtxSize_usingCParams ( ZSTD_compressionParameters  cParams)

Definition at line 19352 of file zstd.c.

◆ ZSTD_estimateCDictSize()

size_t ZSTD_estimateCDictSize ( size_t  dictSize,
int  compressionLevel 
)

Definition at line 22937 of file zstd.c.

◆ 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

Definition at line 22922 of file zstd.c.

◆ ZSTD_estimateCStreamSize()

size_t ZSTD_estimateCStreamSize ( int  compressionLevel)

Definition at line 19437 of file zstd.c.

◆ ZSTD_estimateCStreamSize_internal()

static size_t ZSTD_estimateCStreamSize_internal ( int  compressionLevel)
static

Definition at line 19431 of file zstd.c.

◆ ZSTD_estimateCStreamSize_usingCCtxParams()

size_t ZSTD_estimateCStreamSize_usingCCtxParams ( const ZSTD_CCtx_params *  params)

Definition at line 19394 of file zstd.c.

◆ ZSTD_estimateCStreamSize_usingCParams()

size_t ZSTD_estimateCStreamSize_usingCParams ( ZSTD_compressionParameters  cParams)

Definition at line 19414 of file zstd.c.

◆ ZSTD_estimateDCtxSize()

size_t ZSTD_estimateDCtxSize ( void  )

Definition at line 35580 of file zstd.c.

◆ ZSTD_estimateDDictSize()

size_t ZSTD_estimateDDictSize ( size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod 
)

ZSTD_estimateDDictSize() : Estimate amount of memory that will be needed to create a dictionary for decompression. Note : dictionary created by reference using ZSTD_dlm_byRef are smaller

Definition at line 35261 of file zstd.c.

◆ ZSTD_estimateDStreamSize()

size_t ZSTD_estimateDStreamSize ( size_t  windowSize)

Definition at line 37294 of file zstd.c.

◆ ZSTD_estimateDStreamSize_fromFrame()

size_t ZSTD_estimateDStreamSize_fromFrame ( const void *  src,
size_t  srcSize 
)

Definition at line 37302 of file zstd.c.

◆ ZSTD_estimateSubBlockSize()

static size_t ZSTD_estimateSubBlockSize ( const BYTE literals,
size_t  litSize,
const BYTE ofCodeTable,
const BYTE llCodeTable,
const BYTE mlCodeTable,
size_t  nbSeq,
const ZSTD_entropyCTables_t entropy,
const ZSTD_entropyCTablesMetadata_t entropyMetadata,
void *  workspace,
size_t  wkspSize,
int  writeLitEntropy,
int  writeSeqEntropy 
)
static

Definition at line 17070 of file zstd.c.

◆ ZSTD_estimateSubBlockSize_literal()

static size_t ZSTD_estimateSubBlockSize_literal ( const BYTE literals,
size_t  litSize,
const ZSTD_hufCTables_t huf,
const ZSTD_hufCTablesMetadata_t hufMetadata,
void *  workspace,
size_t  wkspSize,
int  writeEntropy 
)
static

Definition at line 16984 of file zstd.c.

◆ ZSTD_estimateSubBlockSize_sequences()

static size_t ZSTD_estimateSubBlockSize_sequences ( const BYTE ofCodeTable,
const BYTE llCodeTable,
const BYTE mlCodeTable,
size_t  nbSeq,
const ZSTD_fseCTables_t fseTables,
const ZSTD_fseCTablesMetadata_t fseMetadata,
void *  workspace,
size_t  wkspSize,
int  writeEntropy 
)
static

Definition at line 17042 of file zstd.c.

◆ ZSTD_estimateSubBlockSize_symbolType()

static size_t ZSTD_estimateSubBlockSize_symbolType ( symbolEncodingType_e  type,
const BYTE codeTable,
unsigned  maxCode,
size_t  nbSeq,
const FSE_CTable fseCTable,
const U8 additionalBits,
short const *  defaultNorm,
U32  defaultNormLog,
U32  defaultMax,
void *  workspace,
size_t  wkspSize 
)
static

Definition at line 17007 of file zstd.c.

◆ ZSTD_execSequence()

HINT_INLINE size_t ZSTD_execSequence ( BYTE op,
BYTE *const  oend,
seq_t  sequence,
const BYTE **  litPtr,
const BYTE *const  litLimit,
const BYTE *const  prefixStart,
const BYTE *const  virtualStart,
const BYTE *const  dictEnd 
)

Definition at line 38673 of file zstd.c.

◆ ZSTD_execSequenceEnd()

FORCE_NOINLINE size_t ZSTD_execSequenceEnd ( BYTE op,
BYTE *const  oend,
seq_t  sequence,
const BYTE **  litPtr,
const BYTE *const  litLimit,
const BYTE *const  prefixStart,
const BYTE *const  virtualStart,
const BYTE *const  dictEnd 
)

Definition at line 38581 of file zstd.c.

◆ ZSTD_execSequenceEndSplitLitBuffer()

FORCE_NOINLINE size_t ZSTD_execSequenceEndSplitLitBuffer ( BYTE op,
BYTE *const  oend,
const BYTE *const  oend_w,
seq_t  sequence,
const BYTE **  litPtr,
const BYTE *const  litLimit,
const BYTE *const  prefixStart,
const BYTE *const  virtualStart,
const BYTE *const  dictEnd 
)

Definition at line 38628 of file zstd.c.

◆ ZSTD_execSequenceSplitLitBuffer()

HINT_INLINE size_t ZSTD_execSequenceSplitLitBuffer ( BYTE op,
BYTE *const  oend,
const BYTE *const  oend_w,
seq_t  sequence,
const BYTE **  litPtr,
const BYTE *const  litLimit,
const BYTE *const  prefixStart,
const BYTE *const  virtualStart,
const BYTE *const  dictEnd 
)

Definition at line 38771 of file zstd.c.

◆ ZSTD_fastSequenceLengthSum()

static size_t ZSTD_fastSequenceLengthSum ( ZSTD_Sequence const *  seqBuf,
size_t  seqBufSize 
)
static

Definition at line 20772 of file zstd.c.

◆ ZSTD_fillDoubleHashTable()

void ZSTD_fillDoubleHashTable ( ZSTD_matchState_t ms,
void const *  end,
ZSTD_dictTableLoadMethod_e  dtlm,
ZSTD_tableFillPurpose_e  tfp 
)

Definition at line 24892 of file zstd.c.

◆ ZSTD_fillDoubleHashTableForCCtx()

static void ZSTD_fillDoubleHashTableForCCtx ( ZSTD_matchState_t ms,
void const *  end,
ZSTD_dictTableLoadMethod_e  dtlm 
)
static

Definition at line 24858 of file zstd.c.

◆ ZSTD_fillDoubleHashTableForCDict()

static void ZSTD_fillDoubleHashTableForCDict ( ZSTD_matchState_t ms,
void const *  end,
ZSTD_dictTableLoadMethod_e  dtlm 
)
static

Definition at line 24822 of file zstd.c.

◆ ZSTD_fillHashTable()

void ZSTD_fillHashTable ( ZSTD_matchState_t ms,
void const *  end,
ZSTD_dictTableLoadMethod_e  dtlm,
ZSTD_tableFillPurpose_e  tfp 
)

Definition at line 25651 of file zstd.c.

◆ ZSTD_fillHashTableForCCtx()

static void ZSTD_fillHashTableForCCtx ( ZSTD_matchState_t ms,
const void *const  end,
ZSTD_dictTableLoadMethod_e  dtlm 
)
static

Definition at line 25617 of file zstd.c.

◆ ZSTD_fillHashTableForCDict()

static void ZSTD_fillHashTableForCDict ( ZSTD_matchState_t ms,
const void *const  end,
ZSTD_dictTableLoadMethod_e  dtlm 
)
static

Definition at line 25582 of file zstd.c.

◆ ZSTD_finalizeOffBase()

static U32 ZSTD_finalizeOffBase ( U32  rawOffset,
const U32  rep[ZSTD_REP_NUM],
U32  ll0 
)
static

Definition at line 24015 of file zstd.c.

◆ ZSTD_findDecompressedSize()

unsigned long long ZSTD_findDecompressedSize ( const void *  src,
size_t  srcSize 
)

ZSTD_findDecompressedSize() : srcSize must be the exact length of some number of ZSTD compressed and/or skippable frames note: compatible with legacy mode

Returns
: decompressed size of the frames contained

Definition at line 35990 of file zstd.c.

◆ ZSTD_findFrameCompressedSize()

size_t ZSTD_findFrameCompressedSize ( const void *  src,
size_t  srcSize 
)

ZSTD_findFrameCompressedSize() : compatible with legacy mode src must point to the start of a ZSTD frame, ZSTD legacy frame, or skippable frame srcSize must be at least as large as the frame contained

Returns
: the compressed size of the frame starting at src

Definition at line 36153 of file zstd.c.

◆ ZSTD_findFrameSizeInfo()

static ZSTD_frameSizeInfo ZSTD_findFrameSizeInfo ( const void *  src,
size_t  srcSize 
)
static

Definition at line 36081 of file zstd.c.

◆ ZSTD_flushStream()

size_t ZSTD_flushStream ( ZSTD_CStream zcs,
ZSTD_outBuffer output 
)

ZSTD_flushStream() :

Returns
: amount of data remaining to flush

Definition at line 24485 of file zstd.c.

◆ ZSTD_fracWeight()

MEM_STATIC U32 ZSTD_fracWeight ( U32  rawStat)

Definition at line 29572 of file zstd.c.

◆ ZSTD_frameHeaderSize()

size_t ZSTD_frameHeaderSize ( const void *  src,
size_t  srcSize 
)

ZSTD_frameHeaderSize() : srcSize must be >= ZSTD_frameHeaderSize_prefix.

Returns
: size of the Frame Header, or an error code (if srcSize is too small)

Definition at line 35784 of file zstd.c.

◆ ZSTD_frameHeaderSize_internal()

static size_t ZSTD_frameHeaderSize_internal ( const void *  src,
size_t  srcSize,
ZSTD_format_e  format 
)
static

ZSTD_frameHeaderSize_internal() : srcSize must be large enough to reach header size fields. note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless.

Returns
: size of the Frame Header or an error code, which can be tested with ZSTD_isError()

Definition at line 35765 of file zstd.c.

◆ ZSTD_freeCCtx()

size_t ZSTD_freeCCtx ( ZSTD_CCtx cctx)

Definition at line 17818 of file zstd.c.

◆ ZSTD_freeCCtxContent()

static void ZSTD_freeCCtxContent ( ZSTD_CCtx cctx)
static

Definition at line 17807 of file zstd.c.

◆ ZSTD_freeCCtxParams()

size_t ZSTD_freeCCtxParams ( ZSTD_CCtx_params *  params)

Definition at line 17991 of file zstd.c.

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

Definition at line 23130 of file zstd.c.

◆ ZSTD_freeCStream()

size_t ZSTD_freeCStream ( ZSTD_CStream zcs)

Definition at line 23342 of file zstd.c.

◆ ZSTD_freeDCtx()

size_t ZSTD_freeDCtx ( ZSTD_DCtx dctx)

Definition at line 35673 of file zstd.c.

◆ ZSTD_freeDDict()

size_t ZSTD_freeDDict ( ZSTD_DDict ddict)

ZSTD_freeDDict() : Function frees memory allocated with ZSTD_createDDict() If a NULL pointer is passed, no operation is performed.

Definition at line 35248 of file zstd.c.

◆ ZSTD_freeDDictHashSet()

static void ZSTD_freeDDictHashSet ( ZSTD_DDictHashSet hashSet,
ZSTD_customMem  customMem 
)
static

Definition at line 35547 of file zstd.c.

◆ ZSTD_freeDStream()

size_t ZSTD_freeDStream ( ZSTD_DStream zds)

Definition at line 37012 of file zstd.c.

◆ ZSTD_freeThreadPool()

void ZSTD_freeThreadPool ( ZSTD_threadPool *  pool)

Definition at line 4483 of file zstd.c.

◆ ZSTD_fseBitCost()

size_t ZSTD_fseBitCost ( FSE_CTable const *  ctable,
unsigned const *  count,
unsigned const  max 
)

Returns the cost in bits of encoding the distribution in count using ctable. Returns an error if ctable cannot represent all the symbols in count.

Definition at line 16305 of file zstd.c.

◆ ZSTD_generateSequences()

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

Definition at line 21014 of file zstd.c.

◆ ZSTD_getBlockSize()

size_t ZSTD_getBlockSize ( const ZSTD_CCtx cctx)

Definition at line 22296 of file zstd.c.

◆ ZSTD_getBlockSize_deprecated()

static size_t ZSTD_getBlockSize_deprecated ( const ZSTD_CCtx cctx)
static

Definition at line 22288 of file zstd.c.

◆ ZSTD_getcBlockSize()

size_t ZSTD_getcBlockSize ( const void *  src,
size_t  srcSize,
blockProperties_t bpPtr 
)

ZSTD_getcBlockSize() : Provides the size of compressed block from block header src

Definition at line 37765 of file zstd.c.

◆ ZSTD_getCParamMode()

static ZSTD_cParamMode_e ZSTD_getCParamMode ( ZSTD_CDict const *  cdict,
ZSTD_CCtx_params const *  params,
U64  pledgedSrcSize 
)
static

Definition at line 23358 of file zstd.c.

◆ ZSTD_getCParamRowSize()

static U64 ZSTD_getCParamRowSize ( U64  srcSizeHint,
size_t  dictSize,
ZSTD_cParamMode_e  mode 
)
static

Definition at line 24708 of file zstd.c.

◆ 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

Definition at line 24761 of file zstd.c.

◆ ZSTD_getCParams_internal()

static ZSTD_compressionParameters ZSTD_getCParams_internal ( int  compressionLevel,
unsigned long long  srcSizeHint,
size_t  dictSize,
ZSTD_cParamMode_e  mode 
)
static

ZSTD_getCParams_internal() :

Returns
ZSTD_compressionParameters structure for a selected compression level, srcSize and dictSize. Note: srcSizeHint 0 means 0, use ZSTD_CONTENTSIZE_UNKNOWN for unknown. Use dictSize == 0 for unknown or unused. Note: mode controls how we treat the dictSize. See docs for ZSTD_cParamMode_e.

Definition at line 24733 of file zstd.c.

◆ ZSTD_getCParamsFromCCtxParams()

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

Definition at line 19221 of file zstd.c.

◆ ZSTD_getCParamsFromCDict()

ZSTD_compressionParameters ZSTD_getCParamsFromCDict ( const ZSTD_CDict cdict)

ZSTD_getCParamsFromCDict() : as the name implies

Definition at line 23203 of file zstd.c.

◆ ZSTD_getDDict()

static ZSTD_DDict const* ZSTD_getDDict ( ZSTD_DCtx dctx)
static

Definition at line 36507 of file zstd.c.

◆ ZSTD_getDecompressedSize()

unsigned long long ZSTD_getDecompressedSize ( const void *  src,
size_t  srcSize 
)

ZSTD_getDecompressedSize() : compatible with legacy mode

Returns
: decompressed size if known, 0 otherwise note : 0 can mean any of the following :
  • frame content is empty
  • decompressed size field is not present in frame header
  • frame header unknown / not supported
  • frame header not complete (srcSize too small)

Definition at line 36037 of file zstd.c.

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

Definition at line 23213 of file zstd.c.

◆ ZSTD_getDictID_fromDDict()

unsigned ZSTD_getDictID_fromDDict ( const ZSTD_DDict ddict)

ZSTD_getDictID_fromDDict() : Provides the dictID of the dictionary loaded into ddict. 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.

Definition at line 35276 of file zstd.c.

◆ ZSTD_getDictID_fromDict()

unsigned ZSTD_getDictID_fromDict ( const void *  dict,
size_t  dictSize 
)

ZSTD_getDictID_fromDict() : Provides the dictID stored within dictionary. if

Returns
== 0, the dictionary is not conformant with Zstandard specification. It can still be loaded, but as a content-only dictionary.

Definition at line 36948 of file zstd.c.

◆ ZSTD_getDictID_fromFrame()

unsigned ZSTD_getDictID_fromFrame ( const void *  src,
size_t  srcSize 
)

ZSTD_getDictID_fromFrame() : Provides the dictID required to decompress frame stored within src. If

Returns
== 0, the dictID could not be decoded. This could for one of the following reasons :
  • The frame does not require a dictionary (most common case).
  • The frame was built with dictID intentionally removed. Needed dictionary is a hidden piece of information. Note : this use case also happens when using a non-conformant dictionary.
  • srcSize is too small, and as a result, frame header could not be decoded. Note : possible if srcSize < ZSTD_FRAMEHEADERSIZE_MAX.
  • This is not a Zstandard frame. When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.

Definition at line 36968 of file zstd.c.

◆ ZSTD_getErrorCode()

ZSTD_ErrorCode ZSTD_getErrorCode ( size_t  code)

ZSTD_getErrorCode() : convert a size_t function result into a ZSTD_ErrorCode enum type, which can be used to compare with enum list published above

ZSTD_getError() : convert a size_t function result into a proper ZSTD_errorCode enum

Definition at line 11156 of file zstd.c.

◆ ZSTD_getErrorName()

const char* ZSTD_getErrorName ( size_t  code)

ZSTD_getErrorName() : provides error code string from function result (useful for debugging)

Definition at line 11152 of file zstd.c.

◆ ZSTD_getErrorString()

const char * ZSTD_getErrorString ( ZSTD_ErrorCode  code)

Same as ZSTD_getErrorName, but using a ZSTD_ErrorCode enum argument

ZSTD_getErrorString() : provides error code string from enum

Definition at line 11160 of file zstd.c.

◆ ZSTD_getFrameContentSize()

unsigned long long ZSTD_getFrameContentSize ( const void *  src,
size_t  srcSize 
)

ZSTD_getFrameContentSize() : compatible with legacy mode

Returns
: decompressed size of the single frame pointed to be src if known, otherwise
  • ZSTD_CONTENTSIZE_UNKNOWN if the size cannot be determined
  • ZSTD_CONTENTSIZE_ERROR if an error occurred (e.g. invalid magic number, srcSize too small)

Definition at line 35916 of file zstd.c.

◆ ZSTD_getFrameHeader()

size_t ZSTD_getFrameHeader ( ZSTD_frameHeader *  zfhPtr,
const void *  src,
size_t  srcSize 
)

ZSTD_getFrameHeader() : decode Frame Header, or require larger srcSize. note : this function does not consume input, it only reads it.

Returns
: 0, zfhPtr is correctly filled, >0, srcSize is too small, value is wanted srcSize amount, or an error code, which can be tested using ZSTD_isError()

Definition at line 35906 of file zstd.c.

◆ ZSTD_getFrameHeader_advanced()

size_t ZSTD_getFrameHeader_advanced ( ZSTD_frameHeader *  zfhPtr,
const void *  src,
size_t  srcSize,
ZSTD_format_e  format 
)

ZSTD_getFrameHeader_advanced() : decode Frame Header, or require larger srcSize. note : only works for formats ZSTD_f_zstd1 and ZSTD_f_zstd1_magicless

Returns
: 0, zfhPtr is correctly filled, >0, srcSize is too small, value is wanted srcSize amount, or an error code, which can be tested using ZSTD_isError()

Definition at line 35796 of file zstd.c.

◆ ZSTD_getFrameProgression()

ZSTD_frameProgression ZSTD_getFrameProgression ( const ZSTD_CCtx cctx)

Definition at line 19452 of file zstd.c.

◆ ZSTD_getFSEMaxSymbolValue()

static unsigned ZSTD_getFSEMaxSymbolValue ( FSE_CTable const *  ctable)
static

Definition at line 16247 of file zstd.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 15653 of file zstd.c.

◆ 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 15670 of file zstd.c.

◆ ZSTD_getMatchPrice()

FORCE_INLINE_TEMPLATE U32 ZSTD_getMatchPrice ( U32 const  offBase,
U32 const  matchLength,
const optState_t *const  optPtr,
int const  optLevel 
)

Definition at line 29842 of file zstd.c.

◆ ZSTD_getOffsetInfo()

static ZSTD_OffsetInfo ZSTD_getOffsetInfo ( const ZSTD_seqSymbol offTable,
int  nbSeq 
)
static

Definition at line 39708 of file zstd.c.

◆ 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

Definition at line 24785 of file zstd.c.

◆ ZSTD_getParams_internal()

static ZSTD_parameters ZSTD_getParams_internal ( int  compressionLevel,
unsigned long long  srcSizeHint,
size_t  dictSize,
ZSTD_cParamMode_e  mode 
)
static

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

Definition at line 24771 of file zstd.c.

◆ ZSTD_getSeqStore()

const seqStore_t * ZSTD_getSeqStore ( const ZSTD_CCtx ctx)

Definition at line 17858 of file zstd.c.

◆ ZSTD_getSequenceLength()

MEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength ( seqStore_t const *  seqStore,
seqDef const *  seq 
)

Returns the ZSTD_sequenceLength for the given sequences. It handles the decoding of long sequences indicated by longLengthPos and longLengthType, and adds MINMATCH back to matchLength.

Definition at line 11059 of file zstd.c.

◆ ZSTD_hash3()

static U32 ZSTD_hash3 ( U32  u,
U32  h,
U32  s 
)
static

Definition at line 15163 of file zstd.c.

◆ ZSTD_hash3Ptr()

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

Definition at line 15164 of file zstd.c.

◆ ZSTD_hash3PtrS()

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

Definition at line 15165 of file zstd.c.

◆ ZSTD_hash4()

static U32 ZSTD_hash4 ( U32  u,
U32  h,
U32  s 
)
static

Definition at line 15168 of file zstd.c.

◆ ZSTD_hash4Ptr()

static size_t ZSTD_hash4Ptr ( const void *  ptr,
U32  h 
)
static

Definition at line 15169 of file zstd.c.

◆ ZSTD_hash4PtrS()

static size_t ZSTD_hash4PtrS ( const void *  ptr,
U32  h,
U32  s 
)
static

Definition at line 15170 of file zstd.c.

◆ ZSTD_hash5()

static size_t ZSTD_hash5 ( U64  u,
U32  h,
U64  s 
)
static

Definition at line 15173 of file zstd.c.

◆ ZSTD_hash5Ptr()

static size_t ZSTD_hash5Ptr ( const void *  p,
U32  h 
)
static

Definition at line 15174 of file zstd.c.

◆ ZSTD_hash5PtrS()

static size_t ZSTD_hash5PtrS ( const void *  p,
U32  h,
U64  s 
)
static

Definition at line 15175 of file zstd.c.

◆ ZSTD_hash6()

static size_t ZSTD_hash6 ( U64  u,
U32  h,
U64  s 
)
static

Definition at line 15178 of file zstd.c.

◆ ZSTD_hash6Ptr()

static size_t ZSTD_hash6Ptr ( const void *  p,
U32  h 
)
static

Definition at line 15179 of file zstd.c.

◆ ZSTD_hash6PtrS()

static size_t ZSTD_hash6PtrS ( const void *  p,
U32  h,
U64  s 
)
static

Definition at line 15180 of file zstd.c.

◆ ZSTD_hash7()

static size_t ZSTD_hash7 ( U64  u,
U32  h,
U64  s 
)
static

Definition at line 15183 of file zstd.c.

◆ ZSTD_hash7Ptr()

static size_t ZSTD_hash7Ptr ( const void *  p,
U32  h 
)
static

Definition at line 15184 of file zstd.c.

◆ ZSTD_hash7PtrS()

static size_t ZSTD_hash7PtrS ( const void *  p,
U32  h,
U64  s 
)
static

Definition at line 15185 of file zstd.c.

◆ ZSTD_hash8()

static size_t ZSTD_hash8 ( U64  u,
U32  h,
U64  s 
)
static

Definition at line 15188 of file zstd.c.

◆ ZSTD_hash8Ptr()

static size_t ZSTD_hash8Ptr ( const void *  p,
U32  h 
)
static

Definition at line 15189 of file zstd.c.

◆ ZSTD_hash8PtrS()

static size_t ZSTD_hash8PtrS ( const void *  p,
U32  h,
U64  s 
)
static

Definition at line 15190 of file zstd.c.

◆ ZSTD_hashPtr()

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

Definition at line 15194 of file zstd.c.

◆ ZSTD_hashPtrSalted()

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

Definition at line 15212 of file zstd.c.

◆ ZSTD_HcFindBestMatch()

FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch ( ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iLimit,
size_t *  offsetPtr,
const U32  mls,
const ZSTD_dictMode_e  dictMode 
)

Definition at line 27184 of file zstd.c.

◆ ZSTD_highbit32()

MEM_STATIC unsigned ZSTD_highbit32 ( U32  val)

Definition at line 1990 of file zstd.c.

◆ ZSTD_indexTooCloseToMax()

static int ZSTD_indexTooCloseToMax ( ZSTD_window_t  w)
static

Definition at line 19662 of file zstd.c.

◆ ZSTD_initCCtx()

static void ZSTD_initCCtx ( ZSTD_CCtx cctx,
ZSTD_customMem  memManager 
)
static

Definition at line 17740 of file zstd.c.

◆ ZSTD_initCDict_internal()

static size_t ZSTD_initCDict_internal ( ZSTD_CDict cdict,
const void *  dictBuffer,
size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod,
ZSTD_dictContentType_e  dictContentType,
ZSTD_CCtx_params  params 
)
static

Definition at line 22952 of file zstd.c.

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

Note that ZSTD_initCStream() clears any previously set dictionary. Use the new API to compress with a dictionary.

Definition at line 23476 of file zstd.c.

◆ ZSTD_initCStream_advanced()

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

Definition at line 23434 of file zstd.c.

◆ 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 23385 of file zstd.c.

◆ ZSTD_initCStream_srcSize()

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

Definition at line 23461 of file zstd.c.

◆ ZSTD_initCStream_usingCDict()

size_t ZSTD_initCStream_usingCDict ( ZSTD_CStream zcs,
const ZSTD_CDict cdict 
)

Definition at line 23421 of file zstd.c.

◆ ZSTD_initCStream_usingCDict_advanced()

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

Definition at line 23407 of file zstd.c.

◆ ZSTD_initCStream_usingDict()

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

Definition at line 23452 of file zstd.c.

◆ ZSTD_initDCtx_internal()

static void ZSTD_initDCtx_internal ( ZSTD_DCtx dctx)
static

Definition at line 35602 of file zstd.c.

◆ ZSTD_initDDict_internal()

static size_t ZSTD_initDDict_internal ( ZSTD_DDict ddict,
const void *  dict,
size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod,
ZSTD_dictContentType_e  dictContentType 
)
static

Definition at line 35156 of file zstd.c.

◆ ZSTD_initDStream()

size_t ZSTD_initDStream ( ZSTD_DStream zds)

ZSTD_initDStream() : Initialize/reset DStream state for new decompression operation. Call before new decompression operation using same DStream.

Note : This function is redundant with the advanced API and equivalent to: ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); ZSTD_DCtx_refDDict(zds, NULL);

Definition at line 37074 of file zstd.c.

◆ ZSTD_initDStream_usingDDict()

size_t ZSTD_initDStream_usingDDict ( ZSTD_DStream dctx,
const ZSTD_DDict ddict 
)

Definition at line 37085 of file zstd.c.

◆ ZSTD_initDStream_usingDict()

size_t ZSTD_initDStream_usingDict ( ZSTD_DStream zds,
const void *  dict,
size_t  dictSize 
)

Definition at line 37065 of file zstd.c.

◆ ZSTD_initFseState()

static void ZSTD_initFseState ( ZSTD_fseState DStatePtr,
BIT_DStream_t bitD,
const ZSTD_seqSymbol dt 
)
static

Definition at line 38863 of file zstd.c.

◆ ZSTD_initLocalDict()

static size_t ZSTD_initLocalDict ( ZSTD_CCtx cctx)
static

Initializes the local dictionary using requested parameters. NOTE: Initialization does not employ the pledged src size, because the dictionary may be used for multiple compressions.

Definition at line 18878 of file zstd.c.

◆ ZSTD_initStaticCCtx()

ZSTD_CCtx* ZSTD_initStaticCCtx ( void *  workspace,
size_t  workspaceSize 
)

Definition at line 17764 of file zstd.c.

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

Definition at line 23156 of file zstd.c.

◆ ZSTD_initStaticCStream()

ZSTD_CStream* ZSTD_initStaticCStream ( void *  workspace,
size_t  workspaceSize 
)

Definition at line 23332 of file zstd.c.

◆ ZSTD_initStaticDCtx()

ZSTD_DCtx* ZSTD_initStaticDCtx ( void *  workspace,
size_t  workspaceSize 
)

Definition at line 35630 of file zstd.c.

◆ ZSTD_initStaticDDict()

const ZSTD_DDict* ZSTD_initStaticDDict ( void *  sBuffer,
size_t  sBufferSize,
const void *  dict,
size_t  dictSize,
ZSTD_dictLoadMethod_e  dictLoadMethod,
ZSTD_dictContentType_e  dictContentType 
)

Definition at line 35223 of file zstd.c.

◆ ZSTD_initStaticDStream()

ZSTD_DStream* ZSTD_initStaticDStream ( void *  workspace,
size_t  workspaceSize 
)

Definition at line 37002 of file zstd.c.

◆ ZSTD_initStats_ultra()

static void ZSTD_initStats_ultra ( ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
const void *  src,
size_t  srcSize 
)
static

Definition at line 30903 of file zstd.c.

◆ ZSTD_insertAndFindFirstIndex()

U32 ZSTD_insertAndFindFirstIndex ( ZSTD_matchState_t ms,
const BYTE ip 
)

Definition at line 27177 of file zstd.c.

◆ ZSTD_insertAndFindFirstIndex_internal()

FORCE_INLINE_TEMPLATE U32 ZSTD_insertAndFindFirstIndex_internal ( ZSTD_matchState_t ms,
const ZSTD_compressionParameters *const  cParams,
const BYTE ip,
U32 const  mls,
U32 const  lazySkipping 
)

Definition at line 27150 of file zstd.c.

◆ ZSTD_insertAndFindFirstIndexHash3()

static U32 ZSTD_insertAndFindFirstIndexHash3 ( const ZSTD_matchState_t ms,
U32 nextToUpdate3,
const BYTE *const  ip 
)
static

Definition at line 29927 of file zstd.c.

◆ ZSTD_insertBlock()

size_t ZSTD_insertBlock ( ZSTD_DCtx dctx,
const void *  blockStart,
size_t  blockSize 
)

ZSTD_insertBlock() : insert src block into dctx history. Useful to track uncompressed blocks.

Definition at line 36232 of file zstd.c.

◆ ZSTD_insertBt1()

static U32 ZSTD_insertBt1 ( const ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iend,
U32 const  target,
U32 const  mls,
const int  extDict 
)
static

ZSTD_insertBt1() : add one or multiple positions to tree.

Parameters
ipassumed <= iend-8 .
targetThe target of ZSTD_updateTree_internal() - we are filling to this position
Returns
: nb of positions added

Definition at line 29956 of file zstd.c.

◆ ZSTD_insertBtAndGetAllMatches()

FORCE_INLINE_TEMPLATE U32 ZSTD_insertBtAndGetAllMatches ( ZSTD_match_t matches,
ZSTD_matchState_t ms,
U32 nextToUpdate3,
const BYTE *const  ip,
const BYTE *const  iLimit,
const ZSTD_dictMode_e  dictMode,
const U32  rep[ZSTD_REP_NUM],
const U32  ll0,
const U32  lengthToBeat,
const U32  mls 
)

Definition at line 30101 of file zstd.c.

◆ ZSTD_insertDUBT1()

static void ZSTD_insertDUBT1 ( const ZSTD_matchState_t ms,
U32  curr,
const BYTE inputEnd,
U32  nbCompares,
U32  btLow,
const ZSTD_dictMode_e  dictMode 
)
static

ZSTD_insertDUBT1() : sort one already inserted but unsorted position assumption : curr >= btlow == (curr - btmask) doesn't fail

Definition at line 26597 of file zstd.c.

◆ ZSTD_invalidateMatchState()

static void ZSTD_invalidateMatchState ( ZSTD_matchState_t ms)
static

ZSTD_invalidateMatchState() Invalidate all the matches in the match finder tables. Requires nextSrc and base to be set (can be NULL).

Definition at line 19516 of file zstd.c.

◆ ZSTD_invalidateRepCodes()

void ZSTD_invalidateRepCodes ( ZSTD_CCtx cctx)

Definition at line 19869 of file zstd.c.

◆ ZSTD_ipow()

static U64 ZSTD_ipow ( U64  base,
U64  exponent 
)
static

ZSTD_ipow() : Return base^exponent.

Definition at line 15232 of file zstd.c.

◆ ZSTD_isAligned()

MEM_STATIC int ZSTD_isAligned ( void const *  ptr,
size_t  align 
)

Definition at line 27325 of file zstd.c.

◆ ZSTD_isError()

unsigned ZSTD_isError ( size_t  code)

ZSTD_isError() : tells if a return value is an error code symbol is required for external callers

Definition at line 11148 of file zstd.c.

◆ ZSTD_isFrame()

unsigned ZSTD_isFrame ( const void *  buffer,
size_t  size 
)

ZSTD_isFrame() : Tells if the content of buffer starts with a valid Frame Identifier. Note : Frame Identifier is 4 bytes. If size < 4,

Returns
will always be 0. Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled. Note 3 : Skippable Frame Identifiers are considered valid.

Definition at line 35734 of file zstd.c.

◆ ZSTD_isRLE()

static int ZSTD_isRLE ( const BYTE src,
size_t  length 
)
static

Definition at line 21051 of file zstd.c.

◆ ZSTD_isSkipFrame()

static int ZSTD_isSkipFrame ( ZSTD_DCtx dctx)
static

Definition at line 36596 of file zstd.c.

◆ ZSTD_isSkippableFrame()

unsigned ZSTD_isSkippableFrame ( const void *  buffer,
size_t  size 
)

ZSTD_isSkippableFrame() : Tells if the content of buffer starts with a valid Frame Identifier for a skippable frame. Note : Frame Identifier is 4 bytes. If size < 4,

Returns
will always be 0.

Definition at line 35751 of file zstd.c.

◆ ZSTD_isUpdateAuthorized()

static int ZSTD_isUpdateAuthorized ( ZSTD_cParameter  param)
static

Definition at line 18297 of file zstd.c.

◆ ZSTD_ldm_adjustParameters()

void ZSTD_ldm_adjustParameters ( ldmParams_t params,
ZSTD_compressionParameters const *  cParams 
)

ZSTD_ldm_adjustParameters() : If the params->hashRateLog is not set, set it to its default value based on windowLog and params->hashLog.

Ensures that params->bucketSizeLog is <= params->hashLog (setting it to params->hashLog if it is not).

Ensures that the minMatchLength >= targetLength during optimal parsing.

Definition at line 28931 of file zstd.c.

◆ ZSTD_ldm_blockCompress()

size_t ZSTD_ldm_blockCompress ( rawSeqStore_t rawSeqStore,
ZSTD_matchState_t ms,
seqStore_t seqStore,
U32  rep[ZSTD_REP_NUM],
ZSTD_paramSwitch_e  useRowMatchFinder,
void const *  src,
size_t  srcSize 
)

ZSTD_ldm_blockCompress():

Compresses a block using the predefined sequences, along with a secondary block compressor. The literals section of every sequence is passed to the secondary block compressor, and those sequences are interspersed with the predefined sequences. Returns the length of the last literals. Updates rawSeqStore.pos to indicate how many sequences have been consumed. rawSeqStore.seq may also be updated to split the last sequence between two blocks.

Returns
The length of the last literals.

NOTE: The source must be at most the maximum block size, but the predefined sequences can be any size, and may be longer than the block. In the case that they are longer than the block, the last sequences may need to be split into two. We handle that case correctly, and update rawSeqStore appropriately. NOTE: This function does not return any errors.

Definition at line 29456 of file zstd.c.

◆ ZSTD_ldm_countBackwardsMatch()

static size_t ZSTD_ldm_countBackwardsMatch ( const BYTE pIn,
const BYTE pAnchor,
const BYTE pMatch,
const BYTE pMatchBase 
)
static

ZSTD_ldm_countBackwardsMatch() : Returns the number of bytes that match backwards before pIn and pMatch.

We count only bytes where pMatch >= pBase and pIn >= pAnchor.

Definition at line 28992 of file zstd.c.

◆ ZSTD_ldm_countBackwardsMatch_2segments()

static size_t ZSTD_ldm_countBackwardsMatch_2segments ( const BYTE pIn,
const BYTE pAnchor,
const BYTE pMatch,
const BYTE pMatchBase,
const BYTE pExtDictStart,
const BYTE pExtDictEnd 
)
static

ZSTD_ldm_countBackwardsMatch_2segments() : Returns the number of bytes that match backwards from pMatch, even with the backwards match spanning 2 different segments.

On reaching pMatchBase, start counting from mEnd

Definition at line 29010 of file zstd.c.

◆ ZSTD_ldm_fillFastTables()

static size_t ZSTD_ldm_fillFastTables ( ZSTD_matchState_t ms,
void const *  end 
)
static

ZSTD_ldm_fillFastTables() :

Fills the relevant tables for the ZSTD_fast and ZSTD_dfast strategies. This is similar to ZSTD_loadDictionaryContent.

The tables for the other strategies are filled within their block compressors.

Definition at line 29033 of file zstd.c.

◆ ZSTD_ldm_fillHashTable()

void ZSTD_ldm_fillHashTable ( ldmState_t state,
const BYTE ip,
const BYTE iend,
ldmParams_t const *  params 
)

Definition at line 29063 of file zstd.c.

◆ ZSTD_ldm_gear_feed()

static size_t ZSTD_ldm_gear_feed ( ldmRollingHashState_t state,
BYTE const *  data,
size_t  size,
size_t *  splits,
unsigned *  numSplits 
)
static

ZSTD_ldm_gear_feed():

Registers in the splits array all the split points found in the first size bytes following the data pointer. This function terminates when either all the data has been processed or LDM_BATCH_SIZE splits are present in the splits array.

Precondition: The splits array must not be full. Returns: The number of bytes processed.

Definition at line 28892 of file zstd.c.

◆ ZSTD_ldm_gear_init()

static void ZSTD_ldm_gear_init ( ldmRollingHashState_t state,
ldmParams_t const *  params 
)
static

ZSTD_ldm_gear_init():

Initializes the rolling hash state such that it will honor the settings in params.

Definition at line 28828 of file zstd.c.

◆ ZSTD_ldm_gear_reset()

static void ZSTD_ldm_gear_reset ( ldmRollingHashState_t state,
BYTE const *  data,
size_t  minMatchLength 
)
static

ZSTD_ldm_gear_reset() Feeds [data, data + minMatchLength) into the hash without registering any splits. This effectively resets the hash state. This is used when skipping over data, either at the beginning of a block, or skipping sections.

Definition at line 28861 of file zstd.c.

◆ ZSTD_ldm_generateSequences()

size_t ZSTD_ldm_generateSequences ( ldmState_t ldms,
rawSeqStore_t sequences,
ldmParams_t const *  params,
void const *  src,
size_t  srcSize 
)

ZSTD_ldm_generateSequences():

Generates the sequences using the long distance match finder. Generates long range matching sequences in sequences, which parse a prefix of the source. sequences must be large enough to store every sequence, which can be checked with ZSTD_ldm_getMaxNbSeq().

Returns
0 or an error code.

NOTE: The user must have called ZSTD_window_update() for all of the input they have, even if they pass it to ZSTD_ldm_generateSequences() in chunks. NOTE: This function returns an error if it runs out of space to store sequences.

Definition at line 29301 of file zstd.c.

◆ ZSTD_ldm_generateSequences_internal()

static size_t ZSTD_ldm_generateSequences_internal ( ldmState_t ldmState,
rawSeqStore_t rawSeqStore,
ldmParams_t const *  params,
void const *  src,
size_t  srcSize 
)
static

Definition at line 29117 of file zstd.c.

◆ ZSTD_ldm_getBucket()

static ldmEntry_t* ZSTD_ldm_getBucket ( ldmState_t ldmState,
size_t  hash,
ldmParams_t const  ldmParams 
)
static

ZSTD_ldm_getBucket() : Returns a pointer to the start of the bucket associated with hash.

Definition at line 28968 of file zstd.c.

◆ ZSTD_ldm_getMaxNbSeq()

size_t ZSTD_ldm_getMaxNbSeq ( ldmParams_t  params,
size_t  maxChunkSize 
)

ZSTD_ldm_getSeqSpace() : Return an upper bound on the number of sequences that can be produced by the long distance matcher, or 0 if LDM is disabled.

Definition at line 28961 of file zstd.c.

◆ ZSTD_ldm_getTableSize()

size_t ZSTD_ldm_getTableSize ( ldmParams_t  params)

ZSTD_ldm_getTableSize() : Estimate the space needed for long distance matching tables or 0 if LDM is disabled.

Definition at line 28951 of file zstd.c.

◆ ZSTD_ldm_insertEntry()

static void ZSTD_ldm_insertEntry ( ldmState_t ldmState,
size_t const  hash,
const ldmEntry_t  entry,
ldmParams_t const  ldmParams 
)
static

ZSTD_ldm_insertEntry() : Insert the entry with corresponding hash into the hash table

Definition at line 28976 of file zstd.c.

◆ ZSTD_ldm_limitTableUpdate()

static void ZSTD_ldm_limitTableUpdate ( ZSTD_matchState_t ms,
const BYTE anchor 
)
static

ZSTD_ldm_limitTableUpdate() :

Sets cctx->nextToUpdate to a position corresponding closer to anchor if it is far way (after a long match, only update tables a limited amount).

Definition at line 29108 of file zstd.c.

◆ ZSTD_ldm_reduceTable()

static void ZSTD_ldm_reduceTable ( ldmEntry_t *const  table,
U32 const  size,
U32 const  reducerValue 
)
static

ZSTD_ldm_reduceTable() : reduce table indexes by reducerValue

Definition at line 29291 of file zstd.c.

◆ ZSTD_ldm_skipRawSeqStoreBytes()

void ZSTD_ldm_skipRawSeqStoreBytes ( rawSeqStore_t rawSeqStore,
size_t  nbBytes 
)

Definition at line 29439 of file zstd.c.

◆ ZSTD_ldm_skipSequences()

void ZSTD_ldm_skipSequences ( rawSeqStore_t rawSeqStore,
size_t  srcSize,
U32 const  minMatch 
)

ZSTD_ldm_skipSequences():

Skip past srcSize bytes worth of sequences in rawSeqStore. Avoids emitting matches less than minMatch bytes. Must be called for data that is not passed to ZSTD_ldm_blockCompress().

Definition at line 29379 of file zstd.c.

◆ ZSTD_limitCopy()

MEM_STATIC size_t ZSTD_limitCopy ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

Definition at line 10989 of file zstd.c.

◆ ZSTD_literalsCompressionIsDisabled()

MEM_STATIC int ZSTD_literalsCompressionIsDisabled ( const ZSTD_CCtx_params *  cctxParams)

Definition at line 14968 of file zstd.c.

◆ ZSTD_litLengthPrice()

static U32 ZSTD_litLengthPrice ( U32 const  litLength,
const optState_t *const  optPtr,
int  optLevel 
)
static

Definition at line 29813 of file zstd.c.

◆ ZSTD_LLcode()

MEM_STATIC U32 ZSTD_LLcode ( U32  litLength)

Definition at line 14886 of file zstd.c.

◆ ZSTD_loadCEntropy()

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

Definition at line 22461 of file zstd.c.

◆ ZSTD_loadDEntropy()

size_t ZSTD_loadDEntropy ( ZSTD_entropyDTables_t entropy,
const void *const  dict,
size_t const  dictSize 
)

ZSTD_loadDEntropy() : dict : must point at beginning of a valid zstd dictionary.

Returns
: size of dictionary header (size of magic number + dict ID + entropy tables)

ZSTD_loadDEntropy() : dict : must point at beginning of a valid zstd dictionary.

Returns
: size of entropy tables read

Definition at line 36777 of file zstd.c.

◆ ZSTD_loadDictionaryContent()

static size_t ZSTD_loadDictionaryContent ( ZSTD_matchState_t ms,
ldmState_t ls,
ZSTD_cwksp ws,
ZSTD_CCtx_params const *  params,
const void *  src,
size_t  srcSize,
ZSTD_dictTableLoadMethod_e  dtlm,
ZSTD_tableFillPurpose_e  tfp 
)
static

ZSTD_loadDictionaryContent() :

Returns
: 0, or an error code

Definition at line 22320 of file zstd.c.

◆ ZSTD_loadEntropy_intoDDict()

static size_t ZSTD_loadEntropy_intoDDict ( ZSTD_DDict ddict,
ZSTD_dictContentType_e  dictContentType 
)
static

Definition at line 35126 of file zstd.c.

◆ ZSTD_loadZstdDictionary()

static size_t ZSTD_loadZstdDictionary ( ZSTD_compressedBlockState_t bs,
ZSTD_matchState_t ms,
ZSTD_cwksp ws,
ZSTD_CCtx_params const *  params,
const void *  dict,
size_t  dictSize,
ZSTD_dictTableLoadMethod_e  dtlm,
ZSTD_tableFillPurpose_e  tfp,
void *  workspace 
)
static

ZSTD_loadZstdDictionary() :

Returns
: dictID, or an error code assumptions : magic number supposed already checked dictSize supposed >= 8

Definition at line 22562 of file zstd.c.

◆ ZSTD_makeCCtxParamsFromCParams()

static ZSTD_CCtx_params ZSTD_makeCCtxParamsFromCParams ( ZSTD_compressionParameters  cParams)
static

Definition at line 17948 of file zstd.c.

◆ 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 15334 of file zstd.c.

◆ ZSTD_maxCLevel()

int ZSTD_maxCLevel ( void  )

maximum compression level available

Definition at line 24647 of file zstd.c.

◆ ZSTD_maxNbSeq()

static size_t ZSTD_maxNbSeq ( size_t  blockSize,
unsigned  minMatch,
int  useSequenceProducer 
)
static

Definition at line 19280 of file zstd.c.

◆ ZSTD_maxShortOffset()

static size_t ZSTD_maxShortOffset ( void  )
static
Returns
The maximum offset we can decode in one read of our bitstream, without reloading more bits in the middle of the offset bits read. Any offsets larger than this must use the long offset decoder.

Definition at line 39740 of file zstd.c.

◆ ZSTD_maybeRLE()

static int ZSTD_maybeRLE ( seqStore_t const *  seqStore)
static

Definition at line 21077 of file zstd.c.

◆ ZSTD_mergeBlockDelimiters()

size_t ZSTD_mergeBlockDelimiters ( ZSTD_Sequence *  sequences,
size_t  seqsSize 
)

Definition at line 21034 of file zstd.c.

◆ ZSTD_minCLevel()

int ZSTD_minCLevel ( void  )

minimum negative compression level allowed, requires v1.4.0+

Definition at line 24648 of file zstd.c.

◆ ZSTD_minGain()

MEM_STATIC size_t ZSTD_minGain ( size_t  srcSize,
ZSTD_strategy  strat 
)

Definition at line 14960 of file zstd.c.

◆ ZSTD_minLiteralsToCompress()

static size_t ZSTD_minLiteralsToCompress ( ZSTD_strategy  strategy,
HUF_repeat  huf_repeat 
)
static

Definition at line 16024 of file zstd.c.

◆ ZSTD_MLcode()

MEM_STATIC U32 ZSTD_MLcode ( U32  mlBase)

Definition at line 14903 of file zstd.c.

◆ ZSTD_NbCommonBytes()

MEM_STATIC unsigned ZSTD_NbCommonBytes ( size_t  val)

Definition at line 1973 of file zstd.c.

◆ ZSTD_NCountCost()

static size_t ZSTD_NCountCost ( unsigned const *  count,
unsigned const  max,
size_t const  nbSeq,
unsigned const  FSELog 
)
static

Returns the cost in bytes of encoding the normalized count header. Returns an error if any of the helper functions return an error.

Definition at line 16271 of file zstd.c.

◆ ZSTD_needSequenceEntropyTables()

static int ZSTD_needSequenceEntropyTables ( ZSTD_fseCTablesMetadata_t const *  fseMetadata)
static

Definition at line 17089 of file zstd.c.

◆ ZSTD_newRep()

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

Definition at line 15106 of file zstd.c.

◆ ZSTD_nextInputSizeHint()

static size_t ZSTD_nextInputSizeHint ( const ZSTD_CCtx cctx)
static

Definition at line 23487 of file zstd.c.

◆ ZSTD_nextInputSizeHint_MTorST()

static size_t ZSTD_nextInputSizeHint_MTorST ( const ZSTD_CCtx cctx)
static

Definition at line 23687 of file zstd.c.

◆ ZSTD_nextInputType()

ZSTD_nextInputType_e ZSTD_nextInputType ( ZSTD_DCtx dctx)

Definition at line 36571 of file zstd.c.

◆ ZSTD_nextSrcSizeToDecompress()

size_t ZSTD_nextSrcSizeToDecompress ( ZSTD_DCtx dctx)

Definition at line 36551 of file zstd.c.

◆ ZSTD_nextSrcSizeToDecompressWithInputSize()

static size_t ZSTD_nextSrcSizeToDecompressWithInputSize ( ZSTD_DCtx dctx,
size_t  inputSize 
)
static

Similar to ZSTD_nextSrcSizeToDecompress(), but when a block input can be streamed, we allow taking a partial block as the input. Currently only raw uncompressed blocks can be streamed.

For blocks that can be streamed, this allows us to reduce the latency until we produce output, and avoid copying the input.

Parameters
inputSize- The total amount of input that the caller currently has.

Definition at line 36563 of file zstd.c.

◆ ZSTD_noCompressBlock()

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

Definition at line 14933 of file zstd.c.

◆ ZSTD_noCompressLiterals()

size_t ZSTD_noCompressLiterals ( void *  dst,
size_t  dstCapacity,
const void *  src,
size_t  srcSize 
)

Definition at line 15948 of file zstd.c.

◆ ZSTD_opt_getNextMatchAndUpdateSeqStore()

static void ZSTD_opt_getNextMatchAndUpdateSeqStore ( ZSTD_optLdm_t optLdm,
U32  currPosInBlock,
U32  blockBytesRemaining 
)
static

Definition at line 30450 of file zstd.c.

◆ ZSTD_optLdm_maybeAddMatch()

static void ZSTD_optLdm_maybeAddMatch ( ZSTD_match_t matches,
U32 nbMatches,
const ZSTD_optLdm_t optLdm,
U32  currPosInBlock 
)
static

Definition at line 30505 of file zstd.c.

◆ ZSTD_optLdm_processMatchCandidate()

static void ZSTD_optLdm_processMatchCandidate ( ZSTD_optLdm_t optLdm,
ZSTD_match_t matches,
U32 nbMatches,
U32  currPosInBlock,
U32  remainingBytes 
)
static

Definition at line 30533 of file zstd.c.

◆ ZSTD_optLdm_skipRawSeqStoreBytes()

static void ZSTD_optLdm_skipRawSeqStoreBytes ( rawSeqStore_t rawSeqStore,
size_t  nbBytes 
)
static

Definition at line 30427 of file zstd.c.

◆ ZSTD_overflowCorrectIfNeeded()

static void ZSTD_overflowCorrectIfNeeded ( ZSTD_matchState_t ms,
ZSTD_cwksp ws,
ZSTD_CCtx_params const *  params,
void const *  ip,
void const *  iend 
)
static

Definition at line 21999 of file zstd.c.

◆ ZSTD_overlapCopy8()

HINT_INLINE void ZSTD_overlapCopy8 ( BYTE **  op,
BYTE const **  ip,
size_t  offset 
)

ZSTD_overlapCopy8() : Copies 8 bytes from ip to op and updates op and ip where ip <= op. If the offset is < 8 then the offset is spread to at least 8 bytes.

Precondition: *ip <= *op Postcondition: *op - *op >= 8

Definition at line 38479 of file zstd.c.

◆ ZSTD_overrideCParams()

static void ZSTD_overrideCParams ( ZSTD_compressionParameters *  cParams,
const ZSTD_compressionParameters *  overrides 
)
static

Definition at line 19208 of file zstd.c.

◆ ZSTD_postProcessSequenceProducerResult()

static size_t ZSTD_postProcessSequenceProducerResult ( ZSTD_Sequence *  outSeqs,
size_t  nbExternalSeqs,
size_t  outSeqsCapacity,
size_t  srcSize 
)
static

Definition at line 20723 of file zstd.c.

◆ ZSTD_prefetchMatch()

FORCE_INLINE_TEMPLATE size_t ZSTD_prefetchMatch ( size_t  prefetchPos,
seq_t const  sequence,
const BYTE *const  prefixStart,
const BYTE *const  dictEnd 
)

Definition at line 39388 of file zstd.c.

◆ ZSTD_preserveUnsortedMark()

void ZSTD_preserveUnsortedMark ( U32 *const  table,
U32 const  size,
U32 const  reducerValue 
)

◆ ZSTD_rawLiteralsCost()

static U32 ZSTD_rawLiteralsCost ( const BYTE *const  literals,
U32 const  litLength,
const optState_t *const  optPtr,
int  optLevel 
)
static

Definition at line 29785 of file zstd.c.

◆ ZSTD_readMINMATCH()

MEM_STATIC U32 ZSTD_readMINMATCH ( const void *  memPtr,
U32  length 
)

Definition at line 29911 of file zstd.c.

◆ ZSTD_readSkippableFrame()

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

ZSTD_readSkippableFrame() : Retrieves content of a skippable frame, and writes it to dst buffer.

The parameter magicVariant will receive the magicVariant that was supplied when the frame was written, i.e. magicNumber - ZSTD_MAGIC_SKIPPABLE_START. This can be NULL if the caller is not interested in the magicVariant.

Returns an error if destination buffer is not large enough, or if this is not a valid skippable frame.

Returns
: number of bytes written or a ZSTD error.

Definition at line 35961 of file zstd.c.

◆ ZSTD_reduceIndex()

static void ZSTD_reduceIndex ( ZSTD_matchState_t ms,
ZSTD_CCtx_params const *  params,
const U32  reducerValue 
)
static

ZSTD_reduceIndex() : rescale all indexes to avoid future overflow (indexes are U32)

Definition at line 20248 of file zstd.c.

◆ ZSTD_reduceTable()

static void ZSTD_reduceTable ( U32 *const  table,
U32 const  size,
U32 const  reducerValue 
)
static

Definition at line 20236 of file zstd.c.

◆ ZSTD_reduceTable_btlazy2()

static void ZSTD_reduceTable_btlazy2 ( U32 *const  table,
U32 const  size,
U32 const  reducerValue 
)
static

Definition at line 20241 of file zstd.c.

◆ 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

Definition at line 20195 of file zstd.c.

◆ ZSTD_refDictContent()

static size_t ZSTD_refDictContent ( ZSTD_DCtx dctx,
const void *  dict,
size_t  dictSize 
)
static

Definition at line 36760 of file zstd.c.

◆ ZSTD_referenceExternalSequences()

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

Definition at line 22195 of file zstd.c.

◆ ZSTD_registerSequenceProducer()

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

Definition at line 24790 of file zstd.c.

◆ ZSTD_rescaleFreqs()

static void ZSTD_rescaleFreqs ( optState_t *const  optPtr,
const BYTE *const  src,
size_t const  srcSize,
int const  optLevel 
)
static

Definition at line 29660 of file zstd.c.

◆ ZSTD_reset_compressedBlockState()

void ZSTD_reset_compressedBlockState ( ZSTD_compressedBlockState_t bs)

Definition at line 19501 of file zstd.c.

◆ ZSTD_reset_matchState()

static size_t ZSTD_reset_matchState ( ZSTD_matchState_t ms,
ZSTD_cwksp ws,
const ZSTD_compressionParameters *  cParams,
const ZSTD_paramSwitch_e  useRowMatchFinder,
const ZSTD_compResetPolicy_e  crp,
const ZSTD_indexResetPolicy_e  forceResetIndex,
const ZSTD_resetTarget_e  forWho 
)
static

Definition at line 19568 of file zstd.c.

◆ ZSTD_resetCCtx_byAttachingCDict()

static size_t ZSTD_resetCCtx_byAttachingCDict ( ZSTD_CCtx cctx,
const ZSTD_CDict cdict,
ZSTD_CCtx_params  params,
U64  pledgedSrcSize,
ZSTD_buffered_policy_e  zbuff 
)
static

Definition at line 19908 of file zstd.c.

◆ ZSTD_resetCCtx_byCopyingCDict()

static size_t ZSTD_resetCCtx_byCopyingCDict ( ZSTD_CCtx cctx,
const ZSTD_CDict cdict,
ZSTD_CCtx_params  params,
U64  pledgedSrcSize,
ZSTD_buffered_policy_e  zbuff 
)
static

Definition at line 19985 of file zstd.c.

◆ ZSTD_resetCCtx_internal()

static size_t ZSTD_resetCCtx_internal ( ZSTD_CCtx zc,
ZSTD_CCtx_params const *  params,
U64 const  pledgedSrcSize,
size_t const  loadedDictSize,
ZSTD_compResetPolicy_e const  crp,
ZSTD_buffered_policy_e const  zbuff 
)
static

ZSTD_resetCCtx_internal() :

Parameters
loadedDictSizeThe size of the dictionary to be loaded into the context, if any. If no dictionary is used, or the dictionary is being attached / copied, then pass 0. note : params are assumed fully validated at this stage.

Definition at line 19683 of file zstd.c.

◆ ZSTD_resetCCtx_usingCDict()

static size_t ZSTD_resetCCtx_usingCDict ( ZSTD_CCtx cctx,
const ZSTD_CDict cdict,
const ZSTD_CCtx_params *  params,
U64  pledgedSrcSize,
ZSTD_buffered_policy_e  zbuff 
)
static

Definition at line 20069 of file zstd.c.

◆ ZSTD_resetCStream()

size_t ZSTD_resetCStream ( ZSTD_CStream zcs,
unsigned long long  pss 
)

Definition at line 23368 of file zstd.c.

◆ ZSTD_resetDStream()

size_t ZSTD_resetDStream ( ZSTD_DStream dctx)

Definition at line 37096 of file zstd.c.

◆ ZSTD_resetSeqStore()

void ZSTD_resetSeqStore ( seqStore_t ssPtr)

Definition at line 20710 of file zstd.c.

◆ ZSTD_resolveBlockSplitterMode()

static ZSTD_paramSwitch_e ZSTD_resolveBlockSplitterMode ( ZSTD_paramSwitch_e  mode,
const ZSTD_compressionParameters *const  cParams 
)
static

Definition at line 17893 of file zstd.c.

◆ ZSTD_resolveEnableLdm()

static ZSTD_paramSwitch_e ZSTD_resolveEnableLdm ( ZSTD_paramSwitch_e  mode,
const ZSTD_compressionParameters *const  cParams 
)
static

Definition at line 17914 of file zstd.c.

◆ ZSTD_resolveExternalRepcodeSearch()

static ZSTD_paramSwitch_e ZSTD_resolveExternalRepcodeSearch ( ZSTD_paramSwitch_e  value,
int  cLevel 
)
static

Definition at line 17933 of file zstd.c.

◆ ZSTD_resolveExternalSequenceValidation()

static int ZSTD_resolveExternalSequenceValidation ( int  mode)
static

Definition at line 17920 of file zstd.c.

◆ ZSTD_resolveMaxBlockSize()

static size_t ZSTD_resolveMaxBlockSize ( size_t  maxBlockSize)
static

Definition at line 17925 of file zstd.c.

◆ ZSTD_resolveRepcodeToRawOffset()

static U32 ZSTD_resolveRepcodeToRawOffset ( const U32  rep[ZSTD_REP_NUM],
const U32  offBase,
const U32  ll0 
)
static

Returns the raw offset represented by the combination of offBase, ll0, and repcode history. offBase must represent a repcode in the numeric representation of ZSTD_storeSeq().

Definition at line 21517 of file zstd.c.

◆ ZSTD_resolveRowMatchFinderMode()

static ZSTD_paramSwitch_e ZSTD_resolveRowMatchFinderMode ( ZSTD_paramSwitch_e  mode,
const ZSTD_compressionParameters *const  cParams 
)
static

Definition at line 17874 of file zstd.c.

◆ ZSTD_rleCompressBlock()

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

Definition at line 14945 of file zstd.c.

◆ ZSTD_rollingHash_append()

static U64 ZSTD_rollingHash_append ( U64  hash,
void const *  buf,
size_t  size 
)
static

ZSTD_rollingHash_append() : Add the buffer to the hash value.

Definition at line 15248 of file zstd.c.

◆ 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 15262 of file zstd.c.

◆ 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 15271 of file zstd.c.

◆ 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 15279 of file zstd.c.

◆ ZSTD_rotateRight_U16()

MEM_STATIC U16 ZSTD_rotateRight_U16 ( U16 const  value,
U32  count 
)

Definition at line 2015 of file zstd.c.

◆ ZSTD_rotateRight_U32()

MEM_STATIC U32 ZSTD_rotateRight_U32 ( U32 const  value,
U32  count 
)

Definition at line 2008 of file zstd.c.

◆ ZSTD_rotateRight_U64()

MEM_STATIC U64 ZSTD_rotateRight_U64 ( U64 const  value,
U32  count 
)

Definition at line 2001 of file zstd.c.

◆ ZSTD_row_fillHashCache()

FORCE_INLINE_TEMPLATE void ZSTD_row_fillHashCache ( ZSTD_matchState_t ms,
const BYTE base,
U32 const  rowLog,
U32 const  mls,
U32  idx,
const BYTE *const  iLimit 
)

Definition at line 27352 of file zstd.c.

◆ ZSTD_row_getMatchMask()

FORCE_INLINE_TEMPLATE ZSTD_VecMask ZSTD_row_getMatchMask ( const BYTE *const  tagRow,
const BYTE  tag,
const U32  headGrouped,
const U32  rowEntries 
)

Definition at line 27570 of file zstd.c.

◆ ZSTD_row_matchMaskGroupWidth()

FORCE_INLINE_TEMPLATE U32 ZSTD_row_matchMaskGroupWidth ( const U32  rowEntries)

Definition at line 27472 of file zstd.c.

◆ ZSTD_row_nextCachedHash()

FORCE_INLINE_TEMPLATE U32 ZSTD_row_nextCachedHash ( U32 cache,
U32 const *  hashTable,
BYTE const *  tagTable,
BYTE const *  base,
U32  idx,
U32 const  hashLog,
U32 const  rowLog,
U32 const  mls,
U64 const  hashSalt 
)

Definition at line 27378 of file zstd.c.

◆ ZSTD_row_nextIndex()

FORCE_INLINE_TEMPLATE U32 ZSTD_row_nextIndex ( BYTE *const  tagRow,
U32 const  rowMask 
)

Definition at line 27315 of file zstd.c.

◆ ZSTD_row_prefetch()

FORCE_INLINE_TEMPLATE void ZSTD_row_prefetch ( U32 const *  hashTable,
BYTE const *  tagTable,
U32 const  relRow,
U32 const  rowLog 
)

Definition at line 27333 of file zstd.c.

◆ ZSTD_row_update()

void ZSTD_row_update ( ZSTD_matchState_t *const  ms,
const BYTE ip 
)

Definition at line 27458 of file zstd.c.

◆ ZSTD_row_update_internal()

FORCE_INLINE_TEMPLATE void ZSTD_row_update_internal ( ZSTD_matchState_t ms,
const BYTE ip,
U32 const  mls,
U32 const  rowLog,
U32 const  rowMask,
U32 const  useCache 
)

Definition at line 27425 of file zstd.c.

◆ ZSTD_row_update_internalImpl()

FORCE_INLINE_TEMPLATE void ZSTD_row_update_internalImpl ( ZSTD_matchState_t ms,
U32  updateStartIdx,
U32 const  updateEndIdx,
U32 const  mls,
U32 const  rowLog,
U32 const  rowMask,
U32 const  useCache 
)

Definition at line 27396 of file zstd.c.

◆ ZSTD_RowFindBestMatch()

FORCE_INLINE_TEMPLATE size_t ZSTD_RowFindBestMatch ( ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iLimit,
size_t *  offsetPtr,
const U32  mls,
const ZSTD_dictMode_e  dictMode,
const U32  rowLog 
)

Definition at line 27649 of file zstd.c.

◆ ZSTD_rowMatchFinderSupported()

static int ZSTD_rowMatchFinderSupported ( const ZSTD_strategy  strategy)
static

Definition at line 17861 of file zstd.c.

◆ ZSTD_rowMatchFinderUsed()

static int ZSTD_rowMatchFinderUsed ( const ZSTD_strategy  strategy,
const ZSTD_paramSwitch_e  mode 
)
static

Definition at line 17868 of file zstd.c.

◆ ZSTD_safecopy()

static void ZSTD_safecopy ( BYTE op,
const BYTE *const  oend_w,
BYTE const *  ip,
ptrdiff_t  length,
ZSTD_overlap_e  ovtype 
)
static

ZSTD_safecopy() : Specialized version of memcpy() that is allowed to READ up to WILDCOPY_OVERLENGTH past the input buffer and write up to 16 bytes past oend_w (op >= oend_w is allowed). This function is only called in the uncommon case where the sequence is near the end of the block. It should be fast for a single long sequence, but can be slow for several short sequences.

Parameters
ovtypecontrols the overlap detection
  • ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart.
  • ZSTD_overlap_src_before_dst: The src and dst may overlap and may be any distance apart. The src buffer must be before the dst buffer.

Definition at line 38512 of file zstd.c.

◆ ZSTD_safecopyDstBeforeSrc()

static void ZSTD_safecopyDstBeforeSrc ( BYTE op,
BYTE const *  ip,
ptrdiff_t  length 
)
static

Definition at line 38552 of file zstd.c.

◆ ZSTD_safecopyLiterals()

static void ZSTD_safecopyLiterals ( BYTE op,
BYTE const *  ip,
BYTE const *const  iend,
BYTE const *  ilimit_w 
)
static

ZSTD_safecopyLiterals() : memcpy() function that won't read beyond more than WILDCOPY_OVERLENGTH bytes past ilimit_w. Only called when the sequence ends past ilimit_w, so it only needs to be optimized for single large copies.

Definition at line 14989 of file zstd.c.

◆ ZSTD_scaleStats()

static U32 ZSTD_scaleStats ( unsigned *  table,
U32  lastEltIndex,
U32  logTarget 
)
static

Definition at line 29642 of file zstd.c.

◆ ZSTD_searchMax()

FORCE_INLINE_TEMPLATE size_t ZSTD_searchMax ( ZSTD_matchState_t ms,
const BYTE ip,
const BYTE iend,
size_t *  offsetPtr,
U32 const  mls,
U32 const  rowLog,
searchMethod_e const  searchMethod,
ZSTD_dictMode_e const  dictMode 
)

Searches for the longest match at ip. Dispatches to the correct implementation function based on the (searchMethod, dictMode, mls, rowLog). We use switch statements here instead of using an indirect function call through a function pointer because after Spectre and Meltdown mitigations, indirect function calls can be very costly, especially in the kernel.

NOTE: dictMode and searchMethod should be templated, so those switch statements should be optimized out. Only the mls & rowLog switches should be left.

Parameters
msThe match state.
ipThe position to search at.
iendThe end of the input data.
[out]offsetPtrStores the match offset into this pointer.
mlsThe minimum search length, in the range [4, 6].
rowLogThe row log (if applicable), in the range [4, 6].
searchMethodThe search method to use (templated).
dictModeThe dictMode (templated).
Returns
The length of the longest match found, or < mls if no match is found. If a match is found its offset is stored in offsetPtr.

Definition at line 27995 of file zstd.c.

◆ ZSTD_selectBlockCompressor()

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

Definition at line 20629 of file zstd.c.

◆ ZSTD_selectBtGetAllMatches()

static ZSTD_getAllMatchesFn ZSTD_selectBtGetAllMatches ( ZSTD_matchState_t const *  ms,
ZSTD_dictMode_e const  dictMode 
)
static

Definition at line 30398 of file zstd.c.

◆ ZSTD_selectEncodingType()

symbolEncodingType_e ZSTD_selectEncodingType ( FSE_repeat repeatMode,
unsigned const *  count,
unsigned const  max,
size_t const  mostFrequent,
size_t  nbSeq,
unsigned const  FSELog,
FSE_CTable const *  prevCTable,
short const *  defaultNorm,
U32  defaultNormLog,
ZSTD_defaultPolicy_e const  isDefaultAllowed,
ZSTD_strategy const  strategy 
)

Definition at line 16358 of file zstd.c.

◆ ZSTD_selectSequenceCopier()

static ZSTD_sequenceCopier ZSTD_selectSequenceCopier ( ZSTD_sequenceFormat_e  mode)
static

Definition at line 24243 of file zstd.c.

◆ ZSTD_seqDecompressedSize()

static size_t ZSTD_seqDecompressedSize ( seqStore_t const *  seqStore,
const seqDef sequences,
size_t  nbSeq,
size_t  litSize,
int  lastSequence 
)
static

Definition at line 16807 of file zstd.c.

◆ ZSTD_seqStore_resolveOffCodes()

static void ZSTD_seqStore_resolveOffCodes ( repcodes_t *const  dRepcodes,
repcodes_t *const  cRepcodes,
const seqStore_t *const  seqStore,
U32 const  nbSeq 
)
static

ZSTD_seqStore_resolveOffCodes() reconciles any possible divergences in offset history that may arise due to emission of RLE/raw blocks that disturb the offset history, and replaces any repcodes within the seqStore that may be invalid.

dRepcodes are updated as would be on the decompression side. cRepcodes are updated exactly in accordance with the seqStore.

Note : this function assumes seq->offBase respects the following numbering scheme : 0 : invalid 1-3 : repcode 1-3 4+ : real_offset+3

Definition at line 21549 of file zstd.c.

◆ ZSTD_seqToCodes()

int ZSTD_seqToCodes ( const seqStore_t seqStorePtr)

Definition at line 20275 of file zstd.c.

◆ ZSTD_sequenceBound()

size_t ZSTD_sequenceBound ( size_t  srcSize)

Definition at line 21010 of file zstd.c.

◆ ZSTD_setBasePrices()

static void ZSTD_setBasePrices ( optState_t optPtr,
int  optLevel 
)
static

Definition at line 29601 of file zstd.c.

◆ ZSTD_setBufferExpectations()

static void ZSTD_setBufferExpectations ( ZSTD_CCtx cctx,
const ZSTD_outBuffer output,
const ZSTD_inBuffer input 
)
static

Definition at line 23709 of file zstd.c.

◆ ZSTD_setRleBlock()

static size_t ZSTD_setRleBlock ( void *  dst,
size_t  dstCapacity,
BYTE  b,
size_t  regenSize 
)
static

Definition at line 36254 of file zstd.c.

◆ ZSTD_shouldAttachDict()

static int ZSTD_shouldAttachDict ( const ZSTD_CDict cdict,
const ZSTD_CCtx_params *  params,
U64  pledgedSrcSize 
)
static

Definition at line 19892 of file zstd.c.

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

Definition at line 17842 of file zstd.c.

◆ ZSTD_sizeof_CDict()

size_t ZSTD_sizeof_CDict ( const ZSTD_CDict cdict)

Definition at line 22943 of file zstd.c.

◆ ZSTD_sizeof_CStream()

size_t ZSTD_sizeof_CStream ( const ZSTD_CStream zcs)

Definition at line 17852 of file zstd.c.

◆ ZSTD_sizeof_DCtx()

size_t ZSTD_sizeof_DCtx ( const ZSTD_DCtx dctx)

Definition at line 35572 of file zstd.c.

◆ ZSTD_sizeof_DDict()

size_t ZSTD_sizeof_DDict ( const ZSTD_DDict ddict)

Definition at line 35266 of file zstd.c.

◆ ZSTD_sizeof_DStream()

size_t ZSTD_sizeof_DStream ( const ZSTD_DStream dctx)

Definition at line 37277 of file zstd.c.

◆ ZSTD_sizeof_localDict()

static size_t ZSTD_sizeof_localDict ( ZSTD_localDict  dict)
static

Definition at line 17800 of file zstd.c.

◆ ZSTD_sizeof_matchState()

static size_t ZSTD_sizeof_matchState ( const ZSTD_compressionParameters *const  cParams,
const ZSTD_paramSwitch_e  useRowMatchFinder,
const U32  enableDedicatedDictSearch,
const U32  forCCtx 
)
static

Definition at line 19237 of file zstd.c.

◆ ZSTD_sizeof_mtctx()

static size_t ZSTD_sizeof_mtctx ( const ZSTD_CCtx cctx)
static

Definition at line 17831 of file zstd.c.

◆ ZSTD_startingInputLength()

static size_t ZSTD_startingInputLength ( ZSTD_format_e  format)
static

Definition at line 35583 of file zstd.c.

◆ ZSTD_storeLastLiterals()

static void ZSTD_storeLastLiterals ( seqStore_t seqStorePtr,
const BYTE anchor,
size_t  lastLLSize 
)
static

Definition at line 20703 of file zstd.c.

◆ 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 15018 of file zstd.c.

◆ ZSTD_toFlushNow()

size_t ZSTD_toFlushNow ( ZSTD_CCtx cctx)

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

Definition at line 19476 of file zstd.c.

◆ ZSTD_totalHistorySize()

static size_t ZSTD_totalHistorySize ( BYTE op,
BYTE const *  virtualStart 
)
static
Returns
The total size of the history referenceable by zstd, including both the prefix and the extDict. At op any offset larger than this is invalid.

Definition at line 39691 of file zstd.c.

◆ ZSTD_totalLen()

static U32 ZSTD_totalLen ( ZSTD_optimal_t  sol)
static

Definition at line 30560 of file zstd.c.

◆ ZSTD_updateDUBT()

static void ZSTD_updateDUBT ( ZSTD_matchState_t ms,
const BYTE ip,
const BYTE iend,
U32  mls 
)
static

Definition at line 26553 of file zstd.c.

◆ ZSTD_updateFseStateWithDInfo()

FORCE_INLINE_TEMPLATE void ZSTD_updateFseStateWithDInfo ( ZSTD_fseState DStatePtr,
BIT_DStream_t bitD,
U16  nextState,
U32  nbBits 
)

Definition at line 38875 of file zstd.c.

◆ ZSTD_updateRep()

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

Definition at line 15082 of file zstd.c.

◆ ZSTD_updateStats()

static void ZSTD_updateStats ( optState_t *const  optPtr,
U32  litLength,
const BYTE literals,
U32  offBase,
U32  matchLength 
)
static

Definition at line 29874 of file zstd.c.

◆ ZSTD_updateTree()

void ZSTD_updateTree ( ZSTD_matchState_t ms,
const BYTE ip,
const BYTE iend 
)

Definition at line 30096 of file zstd.c.

◆ ZSTD_updateTree_internal()

FORCE_INLINE_TEMPLATE void ZSTD_updateTree_internal ( ZSTD_matchState_t ms,
const BYTE *const  ip,
const BYTE *const  iend,
const U32  mls,
const ZSTD_dictMode_e  dictMode 
)

Definition at line 30075 of file zstd.c.

◆ ZSTD_useLowProbCount()

static unsigned ZSTD_useLowProbCount ( size_t const  nbSeq)
static

Returns true if we should use ncount=-1 else we should use ncount=1 for low probability symbols instead.

Definition at line 16258 of file zstd.c.

◆ ZSTD_useTargetCBlockSize()

static int ZSTD_useTargetCBlockSize ( const ZSTD_CCtx_params *  cctxParams)
static

Definition at line 20307 of file zstd.c.

◆ ZSTD_validateSequence()

static size_t ZSTD_validateSequence ( U32  offCode,
U32  matchLength,
U32  minMatch,
size_t  posInSrc,
U32  windowLog,
size_t  dictSize,
int  useSequenceProducer 
)
static

Definition at line 23997 of file zstd.c.

◆ ZSTD_VecMask_next()

MEM_STATIC U32 ZSTD_VecMask_next ( ZSTD_VecMask  val)

Definition at line 27307 of file zstd.c.

◆ ZSTD_versionNumber()

unsigned ZSTD_versionNumber ( void  )

ZSTD_versionNumber() : Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE).

Definition at line 11136 of file zstd.c.

◆ ZSTD_versionString()

const char* ZSTD_versionString ( void  )

ZSTD_versionString() : Return runtime library version, like "1.4.5". Requires v1.3.0+.

Definition at line 11138 of file zstd.c.

◆ ZSTD_wildcopy()

MEM_STATIC FORCE_INLINE_ATTR void ZSTD_wildcopy ( void *  dst,
const void *  src,
ptrdiff_t  length,
ZSTD_overlap_e const  ovtype 
)

ZSTD_wildcopy() : Custom version of ZSTD_memcpy(), can over read/write up to WILDCOPY_OVERLENGTH bytes (if length==0)

Parameters
ovtypecontrols the overlap detection
  • ZSTD_no_overlap: The source and destination are guaranteed to be at least WILDCOPY_VECLEN bytes apart.
  • ZSTD_overlap_src_before_dst: The src and dst may overlap, but they MUST be at least 8 bytes apart. The src buffer must be before the dst buffer.

Definition at line 10957 of file zstd.c.

◆ 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 15360 of file zstd.c.

◆ 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 15304 of file zstd.c.

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

Definition at line 15420 of file zstd.c.

◆ 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 15517 of file zstd.c.

◆ 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 15324 of file zstd.c.

◆ ZSTD_window_init()

MEM_STATIC void ZSTD_window_init ( ZSTD_window_t window)

Definition at line 15595 of file zstd.c.

◆ ZSTD_window_isEmpty()

MEM_STATIC U32 ZSTD_window_isEmpty ( ZSTD_window_t const  window)

Definition at line 15313 of file zstd.c.

◆ 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 15395 of file zstd.c.

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

Definition at line 15613 of file zstd.c.

◆ ZSTD_writeEpilogue()

static size_t ZSTD_writeEpilogue ( ZSTD_CCtx cctx,
void *  dst,
size_t  dstCapacity 
)
static

ZSTD_writeEpilogue() : Ends a frame.

Returns
: nb of bytes written into dst (or an error code)

Definition at line 22745 of file zstd.c.

◆ ZSTD_writeFrameHeader()

static size_t ZSTD_writeFrameHeader ( void *  dst,
size_t  dstCapacity,
const ZSTD_CCtx_params *  params,
U64  pledgedSrcSize,
U32  dictID 
)
static

Definition at line 22112 of file zstd.c.

◆ ZSTD_writeLastEmptyBlock()

size_t ZSTD_writeLastEmptyBlock ( void *  dst,
size_t  dstCapacity 
)

Definition at line 22185 of file zstd.c.

◆ ZSTD_writeSkippableFrame()

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

Definition at line 22166 of file zstd.c.

◆ ZSTD_writeTaggedIndex()

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

Definition at line 15738 of file zstd.c.

◆ ZSTDMT_CCtxParam_setNbWorkers()

static size_t ZSTDMT_CCtxParam_setNbWorkers ( ZSTD_CCtx_params *  params,
unsigned  nbWorkers 
)
static

Definition at line 31911 of file zstd.c.

◆ ZSTDMT_compressionJob()

static void ZSTDMT_compressionJob ( void *  jobDescription)
static

Definition at line 31665 of file zstd.c.

◆ ZSTDMT_compressStream_generic()

size_t ZSTDMT_compressStream_generic ( ZSTDMT_CCtx mtctx,
ZSTD_outBuffer output,
ZSTD_inBuffer input,
ZSTD_EndDirective  endOp 
)

ZSTDMT_compressStream_generic() : Combines ZSTDMT_compressStream() with optional ZSTDMT_flushStream() or ZSTDMT_endStream() depending on flush directive.

Returns
: minimum amount of data still to be flushed 0 if fully flushed or an error code note : needs to be init using any ZSTD_initCStream*() variant

ZSTDMT_compressStream_generic() : internal use only - exposed to be invoked from zstd_compress.c assumption : output and input are valid (pos <= size)

Returns
: minimum amount of data remaining to flush, 0 if none

Definition at line 32794 of file zstd.c.

◆ ZSTDMT_computeOverlapSize()

static size_t ZSTDMT_computeOverlapSize ( const ZSTD_CCtx_params *  params)
static

Definition at line 32192 of file zstd.c.

◆ ZSTDMT_computeTargetJobLog()

static unsigned ZSTDMT_computeTargetJobLog ( const ZSTD_CCtx_params *  params)
static

Definition at line 32150 of file zstd.c.

◆ ZSTDMT_createBufferPool()

static ZSTDMT_bufferPool* ZSTDMT_createBufferPool ( unsigned  maxNbBuffers,
ZSTD_customMem  cMem 
)
static

Definition at line 31103 of file zstd.c.

◆ ZSTDMT_createCCtx_advanced()

ZSTDMT_CCtx * ZSTDMT_createCCtx_advanced ( unsigned  nbWorkers,
ZSTD_customMem  cMem,
ZSTD_threadPool *  pool 
)

Definition at line 31958 of file zstd.c.

◆ ZSTDMT_createCCtx_advanced_internal()

MEM_STATIC ZSTDMT_CCtx* ZSTDMT_createCCtx_advanced_internal ( unsigned  nbWorkers,
ZSTD_customMem  cMem,
ZSTD_threadPool *  pool 
)

Definition at line 31916 of file zstd.c.

◆ ZSTDMT_createCCtxPool()

static ZSTDMT_CCtxPool* ZSTDMT_createCCtxPool ( int  nbWorkers,
ZSTD_customMem  cMem 
)
static

Definition at line 31365 of file zstd.c.

◆ ZSTDMT_createCompressionJob()

static size_t ZSTDMT_createCompressionJob ( ZSTDMT_CCtx mtctx,
size_t  srcSize,
ZSTD_EndDirective  endOp 
)
static

Definition at line 32349 of file zstd.c.

◆ ZSTDMT_createJobsTable()

static ZSTDMT_jobDescription* ZSTDMT_createJobsTable ( U32 nbJobsPtr,
ZSTD_customMem  cMem 
)
static

Definition at line 31874 of file zstd.c.

◆ ZSTDMT_createSeqPool()

static ZSTDMT_seqPool* ZSTDMT_createSeqPool ( unsigned  nbWorkers,
ZSTD_customMem  cMem 
)
static

Definition at line 31323 of file zstd.c.

◆ ZSTDMT_doesOverlapWindow()

static int ZSTDMT_doesOverlapWindow ( buffer_t  buffer,
ZSTD_window_t  window 
)
static

Definition at line 32576 of file zstd.c.

◆ ZSTDMT_expandBufferPool()

static ZSTDMT_bufferPool* ZSTDMT_expandBufferPool ( ZSTDMT_bufferPool srcBufPool,
unsigned  maxNbBuffers 
)
static

Definition at line 31160 of file zstd.c.

◆ ZSTDMT_expandCCtxPool()

static ZSTDMT_CCtxPool* ZSTDMT_expandCCtxPool ( ZSTDMT_CCtxPool srcPool,
int  nbWorkers 
)
static

Definition at line 31385 of file zstd.c.

◆ ZSTDMT_expandJobsTable()

static size_t ZSTDMT_expandJobsTable ( ZSTDMT_CCtx mtctx,
U32  nbWorkers 
)
static

Definition at line 31895 of file zstd.c.

◆ ZSTDMT_expandSeqPool()

static ZSTDMT_seqPool* ZSTDMT_expandSeqPool ( ZSTDMT_seqPool pool,
U32  nbWorkers 
)
static

Definition at line 31336 of file zstd.c.

◆ ZSTDMT_flushProduced()

static size_t ZSTDMT_flushProduced ( ZSTDMT_CCtx mtctx,
ZSTD_outBuffer output,
unsigned  blockToFlush,
ZSTD_EndDirective  end 
)
static

ZSTDMT_flushProduced() : flush whatever data has been produced but not yet flushed in current job. move to next job if current one is fully flushed. output : pos will be updated with amount of data flushed . blockToFlush : if >0, the function will block and wait if there is no data available to flush .

Returns
: amount of data remaining within internal buffer, 0 if no more, 1 if unknown but > 0, or an error code

Definition at line 32434 of file zstd.c.

◆ ZSTDMT_freeBufferPool()

static void ZSTDMT_freeBufferPool ( ZSTDMT_bufferPool bufPool)
static

Definition at line 31119 of file zstd.c.

◆ ZSTDMT_freeCCtx()

size_t ZSTDMT_freeCCtx ( ZSTDMT_CCtx mtctx)

Definition at line 32010 of file zstd.c.

◆ ZSTDMT_freeCCtxPool()

static void ZSTDMT_freeCCtxPool ( ZSTDMT_CCtxPool pool)
static

Definition at line 31354 of file zstd.c.

◆ ZSTDMT_freeJobsTable()

static void ZSTDMT_freeJobsTable ( ZSTDMT_jobDescription jobTable,
U32  nbJobs,
ZSTD_customMem  cMem 
)
static

Definition at line 31860 of file zstd.c.

◆ ZSTDMT_freeSeqPool()

static void ZSTDMT_freeSeqPool ( ZSTDMT_seqPool seqPool)
static

Definition at line 31331 of file zstd.c.

◆ ZSTDMT_getBuffer()

static buffer_t ZSTDMT_getBuffer ( ZSTDMT_bufferPool bufPool)
static

ZSTDMT_getBuffer() : assumption : bufPool must be valid

Returns
: a buffer, with start pointer and size note: allocation may fail, in this case, start==NULL and size==0

Definition at line 31181 of file zstd.c.

◆ ZSTDMT_getCCtx()

static ZSTD_CCtx* ZSTDMT_getCCtx ( ZSTDMT_CCtxPool cctxPool)
static

Definition at line 31415 of file zstd.c.

◆ ZSTDMT_getFrameProgression()

ZSTD_frameProgression ZSTDMT_getFrameProgression ( ZSTDMT_CCtx mtctx)

ZSTDMT_getFrameProgression(): tells how much data has been consumed (input) and produced (output) for current frame. able to count progression inside worker threads.

Definition at line 32079 of file zstd.c.

◆ ZSTDMT_getInputDataInUse()

static range_t ZSTDMT_getInputDataInUse ( ZSTDMT_CCtx mtctx)
static

Returns the range of data used by the earliest job that is not yet complete. If the data of the first job is broken up into two segments, we cover both sections.

Definition at line 32525 of file zstd.c.

◆ ZSTDMT_getSeq()

static rawSeqStore_t ZSTDMT_getSeq ( ZSTDMT_seqPool seqPool)
static

Definition at line 31298 of file zstd.c.

◆ ZSTDMT_initCStream_internal()

size_t ZSTDMT_initCStream_internal ( ZSTDMT_CCtx mtctx,
const void *  dict,
size_t  dictSize,
ZSTD_dictContentType_e  dictContentType,
const ZSTD_CDict cdict,
ZSTD_CCtx_params  params,
unsigned long long  pledgedSrcSize 
)

ZSTDMT_initCStream_internal() : Private use only. Init streaming operation. expects params to be valid. must receive dict, or cdict, or none, but not both. mtctx can be freshly constructed or reused from a prior compression. If mtctx is reused, memory allocations from the prior compression may not be freed, even if they are not needed for the current compression.

Returns
: 0, or an error code

Definition at line 32215 of file zstd.c.

◆ ZSTDMT_isOverlapped()

static int ZSTDMT_isOverlapped ( buffer_t  buffer,
range_t  range 
)
static

Returns non-zero iff buffer and range overlap.

Definition at line 32556 of file zstd.c.

◆ ZSTDMT_nextInputSizeHint()

size_t ZSTDMT_nextInputSizeHint ( const ZSTDMT_CCtx mtctx)

Definition at line 32783 of file zstd.c.

◆ ZSTDMT_overlapLog()

static int ZSTDMT_overlapLog ( int  ovlog,
ZSTD_strategy  strat 
)
static

Definition at line 32185 of file zstd.c.

◆ ZSTDMT_overlapLog_default()

static int ZSTDMT_overlapLog_default ( ZSTD_strategy  strat)
static

Definition at line 32164 of file zstd.c.

◆ ZSTDMT_releaseAllJobResources()

static void ZSTDMT_releaseAllJobResources ( ZSTDMT_CCtx mtctx)
static

Definition at line 31973 of file zstd.c.

◆ ZSTDMT_releaseBuffer()

static void ZSTDMT_releaseBuffer ( ZSTDMT_bufferPool bufPool,
buffer_t  buf 
)
static

Definition at line 31244 of file zstd.c.

◆ ZSTDMT_releaseCCtx()

static void ZSTDMT_releaseCCtx ( ZSTDMT_CCtxPool pool,
ZSTD_CCtx cctx 
)
static

Definition at line 31430 of file zstd.c.

◆ ZSTDMT_releaseSeq()

static void ZSTDMT_releaseSeq ( ZSTDMT_seqPool seqPool,
rawSeqStore_t  seq 
)
static

Definition at line 31313 of file zstd.c.

◆ ZSTDMT_resize()

static size_t ZSTDMT_resize ( ZSTDMT_CCtx mtctx,
unsigned  nbWorkers 
)
static

Definition at line 32044 of file zstd.c.

◆ ZSTDMT_serialState_ensureFinished()

static void ZSTDMT_serialState_ensureFinished ( serialState_t serialState,
unsigned  jobID,
size_t  cSize 
)
static

Definition at line 31609 of file zstd.c.

◆ ZSTDMT_serialState_free()

static void ZSTDMT_serialState_free ( serialState_t serialState)
static

Definition at line 31549 of file zstd.c.

◆ ZSTDMT_serialState_init()

static int ZSTDMT_serialState_init ( serialState_t serialState)
static

Definition at line 31538 of file zstd.c.

◆ ZSTDMT_serialState_reset()

static int ZSTDMT_serialState_reset ( serialState_t serialState,
ZSTDMT_seqPool seqPool,
ZSTD_CCtx_params  params,
size_t  jobSize,
const void *  dict,
size_t const  dictSize,
ZSTD_dictContentType_e  dictContentType 
)
static

Definition at line 31468 of file zstd.c.

◆ ZSTDMT_serialState_update()

static void ZSTDMT_serialState_update ( serialState_t serialState,
ZSTD_CCtx jobCCtx,
rawSeqStore_t  seqStore,
range_t  src,
unsigned  jobID 
)
static

Definition at line 31560 of file zstd.c.

◆ ZSTDMT_setBufferSize()

static void ZSTDMT_setBufferSize ( ZSTDMT_bufferPool *const  bufPool,
size_t const  bSize 
)
static

Definition at line 31151 of file zstd.c.

◆ ZSTDMT_setNbSeq()

static void ZSTDMT_setNbSeq ( ZSTDMT_seqPool *const  seqPool,
size_t const  nbSeq 
)
static

Definition at line 31318 of file zstd.c.

◆ ZSTDMT_sizeof_bufferPool()

static size_t ZSTDMT_sizeof_bufferPool ( ZSTDMT_bufferPool bufPool)
static

Definition at line 31133 of file zstd.c.

◆ ZSTDMT_sizeof_CCtx()

size_t ZSTDMT_sizeof_CCtx ( ZSTDMT_CCtx mtctx)

Definition at line 32028 of file zstd.c.

◆ ZSTDMT_sizeof_CCtxPool()

static size_t ZSTDMT_sizeof_CCtxPool ( ZSTDMT_CCtxPool cctxPool)
static

Definition at line 31398 of file zstd.c.

◆ ZSTDMT_sizeof_seqPool()

static size_t ZSTDMT_sizeof_seqPool ( ZSTDMT_seqPool seqPool)
static

Definition at line 31277 of file zstd.c.

◆ ZSTDMT_toFlushNow()

size_t ZSTDMT_toFlushNow ( ZSTDMT_CCtx mtctx)

ZSTDMT_toFlushNow() Tell how many bytes are ready to be flushed immediately. Probe the oldest active job (not yet entirely flushed) and check its output buffer. If return 0, it means there is no active job, or, it means oldest job is still active, but everything produced has been flushed so far, therefore flushing is limited by speed of oldest job.

Definition at line 32113 of file zstd.c.

◆ ZSTDMT_tryGetInputRange()

static int ZSTDMT_tryGetInputRange ( ZSTDMT_CCtx mtctx)
static

Attempts to set the inBuff to the next section to fill. If any part of the new section is still in use we give up. Returns non-zero if the buffer is filled.

Definition at line 32621 of file zstd.c.

◆ ZSTDMT_updateCParams_whileCompressing()

void ZSTDMT_updateCParams_whileCompressing ( ZSTDMT_CCtx mtctx,
const ZSTD_CCtx_params *  cctxParams 
)

ZSTDMT_updateCParams_whileCompressing() : Updates only a selected set of compression parameters, to remain compatible with current frame. New parameters will be applied to next compression job.

ZSTDMT_updateCParams_whileCompressing() : Updates a selected set of compression parameters, remaining compatible with currently active frame. New parameters will be applied to next compression job.

Definition at line 32062 of file zstd.c.

◆ ZSTDMT_waitForAllJobsCompleted()

static void ZSTDMT_waitForAllJobsCompleted ( ZSTDMT_CCtx mtctx)
static

Definition at line 31995 of file zstd.c.

◆ ZSTDMT_waitForLdmComplete()

static void ZSTDMT_waitForLdmComplete ( ZSTDMT_CCtx mtctx,
buffer_t  buffer 
)
static

Definition at line 32598 of file zstd.c.

◆ ZSTDMT_writeLastEmptyBlock()

static void ZSTDMT_writeLastEmptyBlock ( ZSTDMT_jobDescription job)
static

Definition at line 32331 of file zstd.c.

Variable Documentation

◆ algoTime

const algo_time_t algoTime[16][2]
static
Initial value:
=
{
{{0,0}, {1,1}},
{{0,0}, {1,1}},
{{ 150,216}, { 381,119}},
{{ 170,205}, { 514,112}},
{{ 177,199}, { 539,110}},
{{ 197,194}, { 644,107}},
{{ 221,192}, { 735,107}},
{{ 256,189}, { 881,106}},
{{ 359,188}, {1167,109}},
{{ 582,187}, {1570,114}},
{{ 688,187}, {1712,122}},
{{ 825,186}, {1965,136}},
{{ 976,185}, {2131,150}},
{{1180,186}, {2070,175}},
{{1377,185}, {1731,202}},
{{1412,185}, {1695,202}},
}

Definition at line 34600 of file zstd.c.

◆ attachDictSizeCutoffs

const size_t attachDictSizeCutoffs[ZSTD_STRATEGY_MAX+1]
static
Initial value:
= {
8 KB,
8 KB,
16 KB,
32 KB,
32 KB,
32 KB,
32 KB,
32 KB,
8 KB,
8 KB
}

Definition at line 19879 of file zstd.c.

◆ BIT_mask

const unsigned BIT_mask[]
static
Initial value:
= {
0, 1, 3, 7, 0xF, 0x1F,
0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF,
0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0x1FFFF,
0x3FFFF, 0x7FFFF, 0xFFFFF, 0x1FFFFF, 0x3FFFFF, 0x7FFFFF,
0xFFFFFF, 0x1FFFFFF, 0x3FFFFFF, 0x7FFFFFF, 0xFFFFFFF, 0x1FFFFFFF,
0x3FFFFFFF, 0x7FFFFFFF}

Definition at line 2126 of file zstd.c.

◆ COVER_prime4bytes

const U32 COVER_prime4bytes = 2654435761U
static

Internal hash function

Definition at line 40679 of file zstd.c.

◆ FASTCOVER_defaultAccelParameters

const FASTCOVER_accel_t FASTCOVER_defaultAccelParameters[FASTCOVER_MAX_ACCEL+1]
static
Initial value:
= {
{ 100, 0 },
{ 100, 0 },
{ 50, 1 },
{ 34, 2 },
{ 25, 3 },
{ 20, 4 },
{ 17, 5 },
{ 14, 6 },
{ 13, 7 },
{ 11, 8 },
{ 10, 9 },
}

Definition at line 43889 of file zstd.c.

◆ g_coverCtx

COVER_ctx_t* g_coverCtx = NULL
static

Definition at line 40774 of file zstd.c.

◆ g_debuglevel

int g_debuglevel = DEBUGLEVEL

Definition at line 302 of file zstd.c.

◆ g_displayLevel

int g_displayLevel = 0
static

Definition at line 40596 of file zstd.c.

◆ g_nullBuffer

const buffer_t g_nullBuffer = { NULL, 0 }
static

Definition at line 31092 of file zstd.c.

◆ g_refreshRate

const clock_t g_refreshRate = CLOCKS_PER_SEC * 15 / 100
static

Definition at line 40613 of file zstd.c.

◆ g_selectivity_default

const U32 g_selectivity_default = 9
static

Definition at line 44618 of file zstd.c.

◆ g_time

clock_t g_time = 0
static

Definition at line 40614 of file zstd.c.

◆ g_ZSTD_threading_useless_symbol

int g_ZSTD_threading_useless_symbol

Definition at line 3976 of file zstd.c.

◆ kInverseProbabilityLog256

const unsigned kInverseProbabilityLog256[256]
static
Initial value:
= {
0, 2048, 1792, 1642, 1536, 1453, 1386, 1329, 1280, 1236, 1197, 1162,
1130, 1100, 1073, 1047, 1024, 1001, 980, 960, 941, 923, 906, 889,
874, 859, 844, 830, 817, 804, 791, 779, 768, 756, 745, 734,
724, 714, 704, 694, 685, 676, 667, 658, 650, 642, 633, 626,
618, 610, 603, 595, 588, 581, 574, 567, 561, 554, 548, 542,
535, 529, 523, 517, 512, 506, 500, 495, 489, 484, 478, 473,
468, 463, 458, 453, 448, 443, 438, 434, 429, 424, 420, 415,
411, 407, 402, 398, 394, 390, 386, 382, 377, 373, 370, 366,
362, 358, 354, 350, 347, 343, 339, 336, 332, 329, 325, 322,
318, 315, 311, 308, 305, 302, 298, 295, 292, 289, 286, 282,
279, 276, 273, 270, 267, 264, 261, 258, 256, 253, 250, 247,
244, 241, 239, 236, 233, 230, 228, 225, 222, 220, 217, 215,
212, 209, 207, 204, 202, 199, 197, 194, 192, 190, 187, 185,
182, 180, 178, 175, 173, 171, 168, 166, 164, 162, 159, 157,
155, 153, 151, 149, 146, 144, 142, 140, 138, 136, 134, 132,
130, 128, 126, 123, 121, 119, 117, 115, 114, 112, 110, 108,
106, 104, 102, 100, 98, 96, 94, 93, 91, 89, 87, 85,
83, 82, 80, 78, 76, 74, 73, 71, 69, 67, 66, 64,
62, 61, 59, 57, 55, 54, 52, 50, 49, 47, 46, 44,
42, 41, 39, 37, 36, 34, 33, 31, 30, 28, 26, 25,
23, 22, 20, 19, 17, 16, 14, 13, 11, 10, 8, 7,
5, 4, 2, 1,
}

-log2(x / 256) lookup table for x in [0, 256). If x == 0: Return 0 Else: Return floor(-log2(x / 256) * 256)

Definition at line 16222 of file zstd.c.

◆ kNullRange

const range_t kNullRange = { NULL, 0 }
static

Definition at line 31633 of file zstd.c.

◆ kNullRawSeqStore

const UNUSED_ATTR rawSeqStore_t kNullRawSeqStore = {NULL, 0, 0, 0, 0}
static

Definition at line 14523 of file zstd.c.

◆ kNullRoundBuff

const roundBuff_t kNullRoundBuff = {NULL, 0, 0}
static

Definition at line 31813 of file zstd.c.

◆ lg_table

const int lg_table[256]
static
Initial value:
= {
-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
}

Definition at line 42005 of file zstd.c.

◆ LL_base

const UNUSED_ATTR U32 LL_base[MaxLL+1]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 18, 20, 22, 24, 28, 32, 40,
48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000,
0x2000, 0x4000, 0x8000, 0x10000 }

Definition at line 34806 of file zstd.c.

◆ LL_bits

const UNUSED_ATTR U8 LL_bits[MaxLL+1]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 2, 2, 3, 3,
4, 6, 7, 8, 9,10,11,12,
13,14,15,16
}

Definition at line 10860 of file zstd.c.

◆ LL_defaultDTable

const ZSTD_seqSymbol LL_defaultDTable[(1<< LL_DEFAULTNORMLOG)+1]
static

Definition at line 38042 of file zstd.c.

◆ LL_defaultNorm

const UNUSED_ATTR S16 LL_defaultNorm[MaxLL+1]
static
Initial value:
= {
4, 3, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2,
2, 3, 2, 1, 1, 1, 1, 1,
-1,-1,-1,-1
}

Definition at line 10867 of file zstd.c.

◆ LL_defaultNormLog

const UNUSED_ATTR U32 LL_defaultNormLog = LL_DEFAULTNORMLOG
static

Definition at line 10875 of file zstd.c.

◆ ML_base

const UNUSED_ATTR U32 ML_base[MaxML+1]
static
Initial value:
= {
3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34,
35, 37, 39, 41, 43, 47, 51, 59,
67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803,
0x1003, 0x2003, 0x4003, 0x8003, 0x10003 }

Definition at line 34825 of file zstd.c.

◆ ML_bits

const UNUSED_ATTR U8 ML_bits[MaxML+1]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 2, 2, 3, 3,
4, 4, 5, 7, 8, 9,10,11,
12,13,14,15,16
}

Definition at line 10877 of file zstd.c.

◆ ML_defaultDTable

const ZSTD_seqSymbol ML_defaultDTable[(1<< ML_DEFAULTNORMLOG)+1]
static

Definition at line 38103 of file zstd.c.

◆ ML_defaultNorm

const UNUSED_ATTR S16 ML_defaultNorm[MaxML+1]
static
Initial value:
= {
1, 4, 3, 2, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,-1,-1,
-1,-1,-1,-1,-1
}

Definition at line 10886 of file zstd.c.

◆ ML_defaultNormLog

const UNUSED_ATTR U32 ML_defaultNormLog = ML_DEFAULTNORMLOG
static

Definition at line 10896 of file zstd.c.

◆ OF_base

const UNUSED_ATTR U32 OF_base[MaxOff+1]
static
Initial value:
= {
0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D,
0xFD, 0x1FD, 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD,
0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD, 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD,
0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD, 0x1FFFFFFD, 0x3FFFFFFD, 0x7FFFFFFD }

Definition at line 34813 of file zstd.c.

◆ OF_bits

const UNUSED_ATTR U8 OF_bits[MaxOff+1]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31 }

Definition at line 34819 of file zstd.c.

◆ OF_defaultDTable

const ZSTD_seqSymbol OF_defaultDTable[(1<< OF_DEFAULTNORMLOG)+1]
static
Initial value:
= {
{ 1, 1, 1, OF_DEFAULTNORMLOG},
{ 0, 0, 5, 0}, { 0, 6, 4, 61},
{ 0, 9, 5, 509}, { 0, 15, 5,32765},
{ 0, 21, 5,2097149}, { 0, 3, 5, 5},
{ 0, 7, 4, 125}, { 0, 12, 5, 4093},
{ 0, 18, 5,262141}, { 0, 23, 5,8388605},
{ 0, 5, 5, 29}, { 0, 8, 4, 253},
{ 0, 14, 5,16381}, { 0, 20, 5,1048573},
{ 0, 2, 5, 1}, { 16, 7, 4, 125},
{ 0, 11, 5, 2045}, { 0, 17, 5,131069},
{ 0, 22, 5,4194301}, { 0, 4, 5, 13},
{ 16, 8, 4, 253}, { 0, 13, 5, 8189},
{ 0, 19, 5,524285}, { 0, 1, 5, 1},
{ 16, 6, 4, 61}, { 0, 10, 5, 1021},
{ 0, 16, 5,65533}, { 0, 28, 5,268435453},
{ 0, 27, 5,134217725}, { 0, 26, 5,67108861},
{ 0, 25, 5,33554429}, { 0, 24, 5,16777213},
}

Definition at line 38080 of file zstd.c.

◆ OF_defaultNorm

const UNUSED_ATTR S16 OF_defaultNorm[DefaultMaxOff+1]
static
Initial value:
= {
1, 1, 1, 1, 1, 1, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,
-1,-1,-1,-1,-1
}

Definition at line 10898 of file zstd.c.

◆ OF_defaultNormLog

const UNUSED_ATTR U32 OF_defaultNormLog = OF_DEFAULTNORMLOG
static

Definition at line 10905 of file zstd.c.

◆ prime3bytes

const U32 prime3bytes = 506832829U
static

Definition at line 15162 of file zstd.c.

◆ prime4bytes

const U32 prime4bytes = 2654435761U
static

Definition at line 15167 of file zstd.c.

◆ prime5bytes

const U64 prime5bytes = 889523592379ULL
static

Definition at line 15172 of file zstd.c.

◆ prime6bytes

const U64 prime6bytes = 227718039650203ULL
static

Definition at line 15177 of file zstd.c.

◆ prime7bytes

const U64 prime7bytes = 58295818150454627ULL
static

Definition at line 15182 of file zstd.c.

◆ prime8bytes

const U64 prime8bytes = 0xCF1BBCDCB7A56463ULL
static

Definition at line 15187 of file zstd.c.

◆ repStartValue

const UNUSED_ATTR U32 repStartValue[ZSTD_REP_NUM] = { 1, 4, 8 }
static

Definition at line 10806 of file zstd.c.

◆ sqq_table

const int sqq_table[256]
static
Initial value:
= {
0, 16, 22, 27, 32, 35, 39, 42, 45, 48, 50, 53, 55, 57, 59, 61,
64, 65, 67, 69, 71, 73, 75, 76, 78, 80, 81, 83, 84, 86, 87, 89,
90, 91, 93, 94, 96, 97, 98, 99, 101, 102, 103, 104, 106, 107, 108, 109,
110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
128, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
143, 144, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155,
156, 157, 158, 159, 160, 160, 161, 162, 163, 163, 164, 165, 166, 167, 167, 168,
169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180,
181, 181, 182, 183, 183, 184, 185, 185, 186, 187, 187, 188, 189, 189, 190, 191,
192, 192, 193, 193, 194, 195, 195, 196, 197, 197, 198, 199, 199, 200, 201, 201,
202, 203, 203, 204, 204, 205, 206, 206, 207, 208, 208, 209, 209, 210, 211, 211,
212, 212, 213, 214, 214, 215, 215, 216, 217, 217, 218, 218, 219, 219, 220, 221,
221, 222, 222, 223, 224, 224, 225, 225, 226, 226, 227, 227, 228, 229, 229, 230,
230, 231, 231, 232, 232, 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 238,
239, 240, 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, 247,
247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255
}

Definition at line 42042 of file zstd.c.

◆ ZSTD_blockHeaderSize

const UNUSED_ATTR size_t ZSTD_blockHeaderSize = ZSTD_BLOCKHEADERSIZE
static

Definition at line 10826 of file zstd.c.

◆ ZSTD_defaultCParameters

const ZSTD_compressionParameters ZSTD_defaultCParameters[4][ZSTD_MAX_CLEVEL+1]
static

Definition at line 24535 of file zstd.c.

◆ ZSTD_did_fieldSize

const UNUSED_ATTR size_t ZSTD_did_fieldSize[4] = { 0, 1, 2, 4 }
static

Definition at line 10821 of file zstd.c.

◆ ZSTD_fcs_fieldSize

const UNUSED_ATTR size_t ZSTD_fcs_fieldSize[4] = { 0, 2, 4, 8 }
static

Definition at line 10820 of file zstd.c.

◆ ZSTD_ldm_gearTab

const UNUSED_ATTR U64 ZSTD_ldm_gearTab[256]
static

Definition at line 28723 of file zstd.c.

ZSTD_SWITCH_ROWLOG
#define ZSTD_SWITCH_ROWLOG(dictMode, mls)
Definition: zstd.c:27949
nlohmann::detail::hash
std::size_t hash(const BasicJsonType &j)
hash a JSON value
Definition: json.hpp:5097
srcSize
char int srcSize
Definition: lz4.h:765
GEN_ZSTD_CALL_ROW_SEARCH_FN
#define GEN_ZSTD_CALL_ROW_SEARCH_FN(dictMode, mls, rowLog)
Definition: zstd.c:27940
ZSTD_ldm_gearTab
static const UNUSED_ATTR U64 ZSTD_ldm_gearTab[256]
Definition: zstd.c:28723
sol::meta::enable_t::_
@ _
backward::ColorMode::type
type
Definition: backward.hpp:3600
nonstd::span_lite::size_t
span_CONFIG_SIZE_TYPE size_t
Definition: span.hpp:576
ZSTD_REP_NUM
#define ZSTD_REP_NUM
Definition: zstd.c:10805
cond
static int cond(LexState *ls)
Definition: lparser.c:1394
X
#define X(name, r, bit)
Definition: zstd.c:4805
g_time
static clock_t g_time
Definition: zstd.c:40614
ERR_isError
ERR_STATIC unsigned ERR_isError(size_t code)
Definition: zstd.c:1448
nonstd::span_lite::ssize
span_constexpr std::ptrdiff_t ssize(span< T, Extent > const &spn)
Definition: span.hpp:1560
ZDICT_clockSpan
static clock_t ZDICT_clockSpan(clock_t nPrevious)
Definition: zstd.c:44629
CACHELINE_SIZE
#define CACHELINE_SIZE
Definition: zstd.c:632
U32
unsigned int U32
Definition: lz4.c:314
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
ZSTD_btGetAllMatches_internal
FORCE_INLINE_TEMPLATE U32 ZSTD_btGetAllMatches_internal(ZSTD_match_t *matches, ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *ip, const BYTE *const iHighLimit, const U32 rep[ZSTD_REP_NUM], U32 const ll0, U32 const lengthToBeat, const ZSTD_dictMode_e dictMode, const U32 mls)
Definition: zstd.c:30341
HUF_DTable
U32 HUF_DTable
Definition: zstd.c:2901
ZSTD_BT_GET_ALL_MATCHES_FN
#define ZSTD_BT_GET_ALL_MATCHES_FN(dictMode, mls)
Definition: zstd.c:30361
detail::in
constexpr auto in(type t, int set) -> bool
Definition: core.h:628
HUF_decodeSymbolX2
FORCE_INLINE_TEMPLATE U32 HUF_decodeSymbolX2(void *op, BIT_DStream_t *DStream, const HUF_DEltX2 *dt, const U32 dtLog)
Definition: zstd.c:34083
XXH_rotl32
#define XXH_rotl32(x, r)
Definition: zstd.c:6677
XXH_PRIME32_5
#define XXH_PRIME32_5
Definition: zstd.c:6786
ZSTD_BtFindBestMatch
FORCE_INLINE_TEMPLATE size_t ZSTD_BtFindBestMatch(ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iLimit, size_t *offBasePtr, const U32 mls, const ZSTD_dictMode_e dictMode)
Definition: zstd.c:26915
noDict
@ noDict
Definition: lz4.c:721
KB
#define KB
Definition: zstd.c:44610
XXH_get32bits
#define XXH_get32bits(p)
Definition: zstd.c:6871
seqStore_t
Definition: zstd.c:11031
GEN_ZSTD_CALL_HC_SEARCH_FN
#define GEN_ZSTD_CALL_HC_SEARCH_FN(dictMode, mls)
Definition: zstd.c:27937
ZSTD_ROW_SEARCH_FN
#define ZSTD_ROW_SEARCH_FN(dictMode, mls, rowLog)
Definition: zstd.c:27869
XXH_PRIME32_1
#define XXH_PRIME32_1
Definition: zstd.c:6782
BYTE
unsigned char BYTE
Definition: lz4.c:312
MEM_64bits
MEM_STATIC unsigned MEM_64bits(void)
Definition: zstd.c:988
MAX
#define MAX(a, b)
Definition: zstd.c:10796
sol::lib
lib
Definition: sol.hpp:7809
ss_compare
static INLINE int ss_compare(const unsigned char *T, const int *p1, const int *p2, int depth)
Definition: zstd.c:42096
OF_DEFAULTNORMLOG
#define OF_DEFAULTNORMLOG
Definition: zstd.c:10904
ERROR
#define ERROR(name)
Definition: zstd.c:1445
ZSTD_RowFindBestMatch
FORCE_INLINE_TEMPLATE size_t ZSTD_RowFindBestMatch(ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iLimit, size_t *offsetPtr, const U32 mls, const ZSTD_dictMode_e dictMode, const U32 rowLog)
Definition: zstd.c:27649
search_rowHash
@ search_rowHash
Definition: zstd.c:27932
g_refreshRate
static const clock_t g_refreshRate
Definition: zstd.c:40613
GEN_ZSTD_BT_GET_ALL_MATCHES_
#define GEN_ZSTD_BT_GET_ALL_MATCHES_(dictMode, mls)
Definition: zstd.c:30363
ZSTD_HcFindBestMatch
FORCE_INLINE_TEMPLATE size_t ZSTD_HcFindBestMatch(ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iLimit, size_t *offsetPtr, const U32 mls, const ZSTD_dictMode_e dictMode)
Definition: zstd.c:27184
nlohmann::detail::void
j template void())
Definition: json.hpp:4061
MEM_STATIC
#define MEM_STATIC
Definition: zstd.c:879
ERR_QUOTE
#define ERR_QUOTE(str)
Definition: zstd.c:1493
GETIDX
#define GETIDX(a)
UNLIKELY
#define UNLIKELY(x)
Definition: zstd.c:666
search_hashChain
@ search_hashChain
Definition: zstd.c:27932
search_binaryTree
@ search_binaryTree
Definition: zstd.c:27932
ZSTD_cpuid_t
Definition: zstd.c:4720
ZSTD_cParam_withinBounds
MEM_STATIC int ZSTD_cParam_withinBounds(ZSTD_cParameter cParam, int value)
Definition: zstd.c:14920
ERR_getErrorName
const ERR_STATIC char * ERR_getErrorName(size_t code)
Definition: zstd.c:1463
ZSTD_BT_SEARCH_FN
#define ZSTD_BT_SEARCH_FN(dictMode, mls)
Definition: zstd.c:27867
ZSTD_HC_SEARCH_FN
#define ZSTD_HC_SEARCH_FN(dictMode, mls)
Definition: zstd.c:27868
ZSTD_FOR_EACH_ROWLOG
#define ZSTD_FOR_EACH_ROWLOG(X, dictMode, mls)
Definition: zstd.c:27904
GEN_ZSTD_CALL_BT_SEARCH_FN
#define GEN_ZSTD_CALL_BT_SEARCH_FN(dictMode, mls)
Definition: zstd.c:27934
ip
#define ip
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
HUF_TABLELOG_MAX
#define HUF_TABLELOG_MAX
Definition: zstd.c:2874
math_pb2._b
int _b
Definition: math_pb2.py:5
ZSTD_CURRENT_MAX
#define ZSTD_CURRENT_MAX
Definition: zstd.c:15294
XXH_PRIME32_3
#define XXH_PRIME32_3
Definition: zstd.c:6784
detail::arg_id_kind::name
@ name
ZSTD_cParam_getBounds
ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param)
Definition: zstd.c:18064
MIN
#define MIN(a, b)
Definition: zstd.c:10795
ZSTD_SEARCH_FN_ATTRS
#define ZSTD_SEARCH_FN_ATTRS
Definition: zstd.c:27871
ZSTD_dParam_withinBounds
static int ZSTD_dParam_withinBounds(ZSTD_dParameter dParam, int value)
Definition: zstd.c:37184
combine
static const Proto * combine(lua_State *L, int n)
Definition: luac.c:143
LDM_BATCH_SIZE
#define LDM_BATCH_SIZE
Definition: zstd.c:14643
dst
char * dst
Definition: lz4.h:792
U32
unsigned int U32
Definition: zstd.c:916
XXH_PRIME32_4
#define XXH_PRIME32_4
Definition: zstd.c:6785
STREAM_ACCUMULATOR_MIN_32
#define STREAM_ACCUMULATOR_MIN_32
Definition: zstd.c:2036
DISPLAY
#define DISPLAY(...)
Definition: zstd.c:44625
sol::detail::ptr
T * ptr(T &val)
Definition: sol.hpp:2106
ZSTD_matchState_t
Definition: zstd.c:14580
STACK_SIZE
#define STACK_SIZE


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:50