ReactOS 0.4.16-dev-91-g764881a
|
Go to the source code of this file.
Classes | |
struct | ZSTD_prefixDict_s |
struct | ZSTD_localDict |
struct | ZSTD_hufCTables_t |
struct | ZSTD_fseCTables_t |
struct | ZSTD_entropyCTables_t |
struct | ZSTD_match_t |
struct | ZSTD_optimal_t |
struct | optState_t |
struct | ZSTD_compressedBlockState_t |
struct | ZSTD_window_t |
struct | ZSTD_matchState_t |
struct | ZSTD_blockState_t |
struct | ldmEntry_t |
struct | ldmState_t |
struct | ldmParams_t |
struct | rawSeq |
struct | rawSeqStore_t |
struct | SeqCollector |
struct | ZSTD_CCtx_params_s |
struct | ZSTD_CCtx_s |
struct | repcodes_s |
Macros | |
#define | kSearchStrength 8 |
#define | HASH_READ_SIZE 8 |
#define | ZSTD_DUBT_UNSORTED_MARK |
#define | ZSTD_ROLL_HASH_CHAR_OFFSET 10 |
#define | ZSTD_CURRENT_MAX ((3U << 29) + (1U << ZSTD_WINDOWLOG_MAX)) |
#define | ZSTD_CHUNKSIZE_MAX |
Typedefs | |
typedef struct ZSTD_prefixDict_s | ZSTD_prefixDict |
typedef struct ZSTD_matchState_t | ZSTD_matchState_t |
typedef size_t(* | ZSTD_blockCompressor) (ZSTD_matchState_t *bs, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize) |
typedef struct repcodes_s | repcodes_t |
Enumerations | |
enum | ZSTD_compressionStage_e { ZSTDcs_created =0 , ZSTDcs_init , ZSTDcs_ongoing , ZSTDcs_ending } |
enum | ZSTD_cStreamStage { zcss_init =0 , zcss_load , zcss_flush } |
enum | ZSTD_OptPrice_e { zop_dynamic =0 , zop_predef } |
enum | ZSTD_dictTableLoadMethod_e { ZSTD_dtlm_fast , ZSTD_dtlm_full } |
enum | ZSTD_dictMode_e { ZSTD_noDict = 0 , ZSTD_extDict = 1 , ZSTD_dictMatchState = 2 } |
Variables | |
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 |
#define HASH_READ_SIZE 8 |
Definition at line 36 of file zstd_compress_internal.h.
#define kSearchStrength 8 |
Definition at line 35 of file zstd_compress_internal.h.
#define ZSTD_CHUNKSIZE_MAX |
Definition at line 703 of file zstd_compress_internal.h.
Definition at line 701 of file zstd_compress_internal.h.
#define ZSTD_DUBT_UNSORTED_MARK |
Definition at line 37 of file zstd_compress_internal.h.
#define ZSTD_ROLL_HASH_CHAR_OFFSET 10 |
Definition at line 650 of file zstd_compress_internal.h.
typedef struct repcodes_s repcodes_t |
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 286 of file zstd_compress_internal.h.
typedef struct ZSTD_matchState_t ZSTD_matchState_t |
Definition at line 129 of file zstd_compress_internal.h.
typedef struct ZSTD_prefixDict_s ZSTD_prefixDict |
Enumerator | |
---|---|
ZSTDcs_created | |
ZSTDcs_init | |
ZSTDcs_ongoing | |
ZSTDcs_ending |
Definition at line 43 of file zstd_compress_internal.h.
Enumerator | |
---|---|
zcss_init | |
zcss_load | |
zcss_flush |
Definition at line 44 of file zstd_compress_internal.h.
Enumerator | |
---|---|
ZSTD_noDict | |
ZSTD_extDict | |
ZSTD_dictMatchState |
Definition at line 283 of file zstd_compress_internal.h.
Enumerator | |
---|---|
ZSTD_dtlm_fast | |
ZSTD_dtlm_full |
Definition at line 281 of file zstd_compress_internal.h.
Enumerator | |
---|---|
zop_dynamic | |
zop_predef |
Definition at line 92 of file zstd_compress_internal.h.
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 887 of file zstd_compress_internal.h.
Referenced by ZSTD_compress_frameChunk().
size_t ZSTD_compress_advanced_internal | ( | ZSTD_CCtx * | cctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const void * | dict, | ||
size_t | dictSize, | ||
const ZSTD_CCtx_params * | params | ||
) |
Definition at line 3270 of file zstd_compress.c.
Referenced by ZSTD_compress_internal(), and ZSTD_compress_usingDict().
size_t ZSTD_compressBegin_advanced_internal | ( | ZSTD_CCtx * | cctx, |
const void * | dict, | ||
size_t | dictSize, | ||
ZSTD_dictContentType_e | dictContentType, | ||
ZSTD_dictTableLoadMethod_e | dtlm, | ||
const ZSTD_CDict * | cdict, | ||
const ZSTD_CCtx_params * | params, | ||
unsigned long long | pledgedSrcSize | ||
) |
Definition at line 3122 of file zstd_compress.c.
Referenced by ZSTD_compressBegin_advanced().
Definition at line 555 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_generic(), ZSTD_compressBlock_fast_dictMatchState_generic(), ZSTD_compressBlock_fast_generic(), ZSTD_compressBlock_lazy_generic(), ZSTD_count_2segments(), ZSTD_DUBT_findBestMatch(), ZSTD_HcFindBestMatch_generic(), ZSTD_insertBt1(), ZSTD_insertBtAndGetAllMatches(), ZSTD_insertDUBT1(), and ZSTD_ldm_generateSequences_internal().
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 581 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_doubleFast_generic(), ZSTD_compressBlock_fast_dictMatchState_generic(), ZSTD_compressBlock_fast_extDict_generic(), ZSTD_compressBlock_lazy_extDict_generic(), ZSTD_compressBlock_lazy_generic(), ZSTD_DUBT_findBestMatch(), ZSTD_DUBT_findBetterDictMatch(), ZSTD_HcFindBestMatch_generic(), ZSTD_insertBt1(), ZSTD_insertBtAndGetAllMatches(), ZSTD_insertDUBT1(), and ZSTD_ldm_generateSequences_internal().
MEM_STATIC int ZSTD_cParam_withinBounds | ( | ZSTD_cParameter | cParam, |
int | value | ||
) |
Definition at line 351 of file zstd_compress_internal.h.
Referenced by ZSTD_selectBlockCompressor().
U32 ZSTD_cycleLog | ( | U32 | hashLog, |
ZSTD_strategy | strat | ||
) |
ZSTD_cycleLog() : condition for correct operation : hashLog > 1
Definition at line 1019 of file zstd_compress.c.
Referenced by ZSTD_adjustCParams_internal(), and ZSTD_overflowCorrectIfNeeded().
MEM_STATIC int ZSTD_disableLiteralsCompression | ( | const ZSTD_CCtx_params * | cctxParams | ) |
Definition at line 396 of file zstd_compress_internal.h.
Referenced by ZSTD_buildSuperBlockEntropy(), and ZSTD_compressSequences_internal().
ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams | ( | const ZSTD_CCtx_params * | CCtxParams, |
U64 | srcSizeHint, | ||
size_t | dictSize | ||
) |
Definition at line 1077 of file zstd_compress.c.
Referenced by ZSTD_compressStream2(), ZSTD_estimateCCtxSize_usingCCtxParams(), ZSTD_estimateCStreamSize_usingCCtxParams(), ZSTD_initLocalDict(), and ZSTD_resetCStream_internal().
ZSTD_compressionParameters ZSTD_getCParamsFromCDict | ( | const ZSTD_CDict * | cdict | ) |
ZSTD_getCParamsFromCDict() : as the name implies
Definition at line 3530 of file zstd_compress.c.
Referenced by ZSTD_compressBegin_usingCDict_advanced().
MEM_STATIC U32 ZSTD_getLowestMatchIndex | ( | const ZSTD_matchState_t * | ms, |
U32 | current, | ||
unsigned | windowLog | ||
) |
Returns the lowest allowed match index. It may either be in the ext-dict or the prefix.
Definition at line 970 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_fast_extDict_generic(), ZSTD_compressBlock_lazy_extDict_generic(), ZSTD_DUBT_findBestMatch(), and ZSTD_insertBtAndGetAllMatches().
MEM_STATIC U32 ZSTD_getLowestPrefixIndex | ( | const ZSTD_matchState_t * | ms, |
U32 | current, | ||
unsigned | windowLog | ||
) |
Returns the lowest allowed match index in the prefix.
Definition at line 983 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_generic(), ZSTD_compressBlock_fast_generic(), and ZSTD_compressBlock_lazy_generic().
Definition at line 600 of file zstd_compress_internal.h.
MEM_STATIC size_t ZSTD_hash3Ptr | ( | const void * | ptr, |
U32 | h | ||
) |
Definition at line 601 of file zstd_compress_internal.h.
Referenced by ZSTD_insertAndFindFirstIndexHash3().
Definition at line 604 of file zstd_compress_internal.h.
Definition at line 605 of file zstd_compress_internal.h.
Definition at line 608 of file zstd_compress_internal.h.
Definition at line 609 of file zstd_compress_internal.h.
Definition at line 612 of file zstd_compress_internal.h.
Definition at line 613 of file zstd_compress_internal.h.
Definition at line 616 of file zstd_compress_internal.h.
Referenced by ZSTD_hashPtr().
Definition at line 617 of file zstd_compress_internal.h.
Definition at line 620 of file zstd_compress_internal.h.
Definition at line 621 of file zstd_compress_internal.h.
Definition at line 623 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_doubleFast_generic(), ZSTD_compressBlock_fast_dictMatchState_generic(), ZSTD_compressBlock_fast_extDict_generic(), ZSTD_compressBlock_fast_generic(), ZSTD_DUBT_findBestMatch(), ZSTD_DUBT_findBetterDictMatch(), ZSTD_fillDoubleHashTable(), ZSTD_fillHashTable(), ZSTD_HcFindBestMatch_generic(), ZSTD_insertAndFindFirstIndex_internal(), ZSTD_insertBt1(), ZSTD_insertBtAndGetAllMatches(), and ZSTD_updateDUBT().
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.
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 3690 of file zstd_compress.c.
ZSTD_ipow() : Return base^exponent.
Definition at line 639 of file zstd_compress_internal.h.
MEM_STATIC U32 ZSTD_LLcode | ( | U32 | litLength | ) |
Definition at line 292 of file zstd_compress_internal.h.
Referenced by ZSTD_litLengthPrice(), ZSTD_seqToCodes(), and ZSTD_updateStats().
size_t ZSTD_loadCEntropy | ( | ZSTD_compressedBlockState_t * | bs, |
void * | workspace, | ||
short * | offcodeNCount, | ||
unsigned * | offcodeMaxValue, | ||
const void *const | dict, | ||
size_t | dictSize | ||
) |
Definition at line 2902 of file zstd_compress.c.
Referenced by ZSTD_loadZstdDictionary().
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 734 of file zstd_compress_internal.h.
Referenced by ZSTD_buildSeqStore(), and ZSTD_ldm_blockCompress().
MEM_STATIC size_t ZSTD_minGain | ( | size_t | srcSize, |
ZSTD_strategy | strat | ||
) |
Definition at line 388 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_targetCBlockSize_body(), ZSTD_compressLiterals(), and ZSTD_compressSequences().
MEM_STATIC U32 ZSTD_MLcode | ( | U32 | mlBase | ) |
Definition at line 309 of file zstd_compress_internal.h.
Referenced by ZSTD_getMatchPrice(), ZSTD_seqToCodes(), and ZSTD_updateStats().
Definition at line 490 of file zstd_compress_internal.h.
MEM_STATIC size_t ZSTD_noCompressBlock | ( | void * | dst, |
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
U32 | lastBlock | ||
) |
Definition at line 363 of file zstd_compress_internal.h.
Referenced by ZSTD_compress_frameChunk(), ZSTD_compressBlock_targetCBlockSize_body(), and ZSTD_compressSubBlock_multi().
Definition at line 2717 of file zstd_compress.c.
Referenced by ZSTD_resetCCtx_internal().
void ZSTD_reset_compressedBlockState | ( | ZSTD_compressedBlockState_t * | bs | ) |
Definition at line 1282 of file zstd_compress.c.
Referenced by ZSTD_compress_insertDictionary(), ZSTD_initCDict_internal(), and ZSTD_resetCCtx_internal().
void ZSTD_resetSeqStore | ( | seqStore_t * | ssPtr | ) |
Definition at line 2233 of file zstd_compress.c.
Referenced by ZSTD_buildSeqStore(), and ZSTD_initStats_ultra().
MEM_STATIC size_t ZSTD_rleCompressBlock | ( | void * | dst, |
size_t | dstCapacity, | ||
BYTE | src, | ||
size_t | srcSize, | ||
U32 | lastBlock | ||
) |
Definition at line 373 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_targetCBlockSize_body().
ZSTD_rollingHash_append() : Add the buffer to the hash value.
Definition at line 655 of file zstd_compress_internal.h.
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 669 of file zstd_compress_internal.h.
Referenced by ZSTD_ldm_fillHashTable(), and ZSTD_ldm_generateSequences_internal().
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 678 of file zstd_compress_internal.h.
Referenced by ZSTD_resetCCtx_internal().
ZSTD_rollingHash_rotate() : Rotate the rolling hash by one byte.
Definition at line 686 of file zstd_compress_internal.h.
Referenced by ZSTD_ldm_fillLdmHashTable(), and ZSTD_ldm_generateSequences_internal().
|
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 416 of file zstd_compress_internal.h.
ZSTD_blockCompressor ZSTD_selectBlockCompressor | ( | ZSTD_strategy | strat, |
ZSTD_dictMode_e | dictMode | ||
) |
Definition at line 2183 of file zstd_compress.c.
Referenced by ZSTD_buildSeqStore(), and ZSTD_ldm_blockCompress().
HINT_INLINE UNUSED_ATTR void ZSTD_storeSeq | ( | seqStore_t * | seqStorePtr, |
size_t | litLength, | ||
const BYTE * | literals, | ||
const BYTE * | litLimit, | ||
U32 | offCode, | ||
size_t | mlBase | ||
) |
ZSTD_storeSeq() : Store a sequence (litlen, litPtr, offCode and mlBase) into seqStore_t. offCode
: distance to match + ZSTD_REP_MOVE (values <= ZSTD_REP_MOVE are repCodes). mlBase
: matchLength - MINMATCH Allowed to overread literals up to litLimit.
Definition at line 433 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_doubleFast_generic(), ZSTD_compressBlock_fast_dictMatchState_generic(), ZSTD_compressBlock_fast_extDict_generic(), ZSTD_compressBlock_fast_generic(), ZSTD_compressBlock_lazy_extDict_generic(), ZSTD_compressBlock_lazy_generic(), ZSTD_compressBlock_opt_generic(), and ZSTD_ldm_blockCompress().
MEM_STATIC repcodes_t ZSTD_updateRep | ( | U32 const | rep[3], |
U32 const | offset, | ||
U32 const | ll0 | ||
) |
Definition at line 327 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_opt_generic(), and ZSTD_compressSubBlock_multi().
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 711 of file zstd_compress_internal.h.
Referenced by ZSTD_invalidateMatchState(), ZSTD_resetCCtx_byAttachingCDict(), and ZSTD_resetCCtx_internal().
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. NOTE: (maxDist & cycleMask) must be zero.
Definition at line 765 of file zstd_compress_internal.h.
Referenced by ZSTD_ldm_generateSequences(), and ZSTD_overflowCorrectIfNeeded().
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 842 of file zstd_compress_internal.h.
Referenced by ZSTD_ldm_generateSequences().
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 724 of file zstd_compress_internal.h.
Referenced by ZSTD_invalidateRepCodes(), ZSTD_ldm_generateSequences_internal(), and ZSTD_matchState_dictMode().
MEM_STATIC void ZSTD_window_init | ( | ZSTD_window_t * | window | ) |
Definition at line 915 of file zstd_compress_internal.h.
Referenced by ZSTD_reset_matchState(), and ZSTD_resetCCtx_internal().
MEM_STATIC U32 ZSTD_window_needOverflowCorrection | ( | ZSTD_window_t const | window, |
void const * | srcEnd | ||
) |
ZSTD_window_needOverflowCorrection(): Returns non-zero if the indices are getting too large and need overflow protection.
Definition at line 748 of file zstd_compress_internal.h.
Referenced by ZSTD_ldm_generateSequences(), and ZSTD_overflowCorrectIfNeeded().
MEM_STATIC U32 ZSTD_window_update | ( | ZSTD_window_t * | window, |
void const * | src, | ||
size_t | srcSize | ||
) |
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 931 of file zstd_compress_internal.h.
Referenced by ZSTD_compressContinue_internal(), and ZSTD_loadDictionaryContent().
Definition at line 2707 of file zstd_compress.c.
Definition at line 599 of file zstd_compress_internal.h.
Referenced by ZSTD_hash4Ptr().
Definition at line 603 of file zstd_compress_internal.h.
Referenced by ZSTD_hash5Ptr().
Definition at line 607 of file zstd_compress_internal.h.
Referenced by ZSTD_hash6Ptr().
Definition at line 611 of file zstd_compress_internal.h.
Referenced by ZSTD_hash7Ptr().
Definition at line 615 of file zstd_compress_internal.h.
Referenced by ZSTD_hash8Ptr().
Definition at line 619 of file zstd_compress_internal.h.
Referenced by ZSTD_rollingHash_append().