ReactOS
0.4.15-dev-1618-g9c8ed68
|
#include "zstd_internal.h"
Go to the source code of this file.
Classes | |
struct | ZSTD_prefixDict_s |
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 | ZSTD_CCtx_params_s |
struct | ZSTD_CCtx_s |
Macros | |
#define | kSearchStrength 8 |
#define | HASH_READ_SIZE 8 |
#define | ZSTD_DUBT_UNSORTED_MARK |
#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) |
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_dictAttachPref_e { ZSTD_dictDefaultAttach = 0, ZSTD_dictForceAttach = 1, ZSTD_dictForceCopy = -1 } |
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 35 of file zstd_compress_internal.h.
#define kSearchStrength 8 |
Definition at line 34 of file zstd_compress_internal.h.
#define ZSTD_CHUNKSIZE_MAX |
Definition at line 507 of file zstd_compress_internal.h.
#define ZSTD_CURRENT_MAX ((3U << 29) + (1U << ZSTD_WINDOWLOG_MAX)) |
Definition at line 505 of file zstd_compress_internal.h.
#define ZSTD_DUBT_UNSORTED_MARK |
Definition at line 36 of file zstd_compress_internal.h.
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 266 of file zstd_compress_internal.h.
typedef struct ZSTD_matchState_t ZSTD_matchState_t |
Definition at line 131 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 48 of file zstd_compress_internal.h.
Enumerator | |
---|---|
zcss_init | |
zcss_load | |
zcss_flush |
Definition at line 49 of file zstd_compress_internal.h.
Enumerator | |
---|---|
ZSTD_dictDefaultAttach | |
ZSTD_dictForceAttach | |
ZSTD_dictForceCopy |
Definition at line 51 of file zstd_compress_internal.h.
Enumerator | |
---|---|
ZSTD_noDict | |
ZSTD_extDict | |
ZSTD_dictMatchState |
Definition at line 263 of file zstd_compress_internal.h.
Enumerator | |
---|---|
ZSTD_dtlm_fast | |
ZSTD_dtlm_full |
Definition at line 261 of file zstd_compress_internal.h.
Enumerator | |
---|---|
zop_dynamic | |
zop_predef |
Definition at line 95 of file zstd_compress_internal.h.
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, | ||
ZSTD_CCtx_params | params | ||
) |
Definition at line 3135 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, | ||
ZSTD_CCtx_params | params, | ||
unsigned long long | pledgedSrcSize | ||
) |
Definition at line 2989 of file zstd_compress.c.
Referenced by ZSTD_compressBegin_advanced().
size_t ZSTD_compressStream_generic | ( | ZSTD_CStream * | zcs, |
ZSTD_outBuffer * | output, | ||
ZSTD_inBuffer * | input, | ||
ZSTD_EndDirective const | flushMode | ||
) |
ZSTD_compressStream_generic() : Private use only. To be called from zstdmt_compress.c in single-thread mode.
ZSTD_compressStream_generic(): internal function for all compressStream() variants and *compress_generic() non-static, because can be called from zstdmt_compress.c
Definition at line 3627 of file zstd_compress.c.
Referenced by ZSTD_compress_generic(), ZSTD_compressStream(), ZSTD_endStream(), and ZSTD_flushStream().
Definition at line 420 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_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 446 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_doubleFast_generic(), ZSTD_compressBlock_fast_extDict_generic(), ZSTD_compressBlock_fast_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 void ZSTD_debugTable | ( | const U32 * | table, |
U32 | max | ||
) |
Definition at line 707 of file zstd_compress_internal.h.
MEM_STATIC double ZSTD_fWeight | ( | U32 | rawStat | ) |
ZSTD_compressionParameters ZSTD_getCParamsFromCCtxParams | ( | const ZSTD_CCtx_params * | CCtxParams, |
U64 | srcSizeHint, | ||
size_t | dictSize | ||
) |
Definition at line 768 of file zstd_compress.c.
Referenced by ZSTD_CCtx_loadDictionary_advanced(), ZSTD_compress_generic(), ZSTD_estimateCCtxSize_usingCCtxParams(), ZSTD_initCStream_internal(), and ZSTD_resetCStream_internal().
ZSTD_compressionParameters ZSTD_getCParamsFromCDict | ( | const ZSTD_CDict * | cdict | ) |
ZSTD_getCParamsFromCDict() : as the name implies
Definition at line 3370 of file zstd_compress.c.
Referenced by ZSTD_compressBegin_usingCDict_advanced(), ZSTD_initCStream_internal(), and ZSTD_initCStream_usingCDict_advanced().
Definition at line 465 of file zstd_compress_internal.h.
Referenced by ZSTD_hash3Ptr().
MEM_STATIC size_t ZSTD_hash3Ptr | ( | const void * | ptr, |
U32 | h | ||
) |
Definition at line 466 of file zstd_compress_internal.h.
Referenced by ZSTD_insertAndFindFirstIndexHash3().
Definition at line 469 of file zstd_compress_internal.h.
Referenced by ZSTD_hash4Ptr().
Definition at line 473 of file zstd_compress_internal.h.
Referenced by ZSTD_hash5Ptr().
Definition at line 477 of file zstd_compress_internal.h.
Referenced by ZSTD_hash6Ptr().
Definition at line 481 of file zstd_compress_internal.h.
Referenced by ZSTD_hash7Ptr().
Definition at line 485 of file zstd_compress_internal.h.
Referenced by ZSTD_hash8Ptr().
Definition at line 488 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_doubleFast_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, | ||
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 3518 of file zstd_compress.c.
Referenced by ZSTD_initCStream_advanced(), ZSTD_initCStream_srcSize(), ZSTD_initCStream_usingCDict_advanced(), and ZSTD_initCStream_usingDict().
MEM_STATIC U32 ZSTD_LLcode | ( | U32 | litLength | ) |
Definition at line 272 of file zstd_compress_internal.h.
Referenced by ZSTD_litLengthContribution(), ZSTD_litLengthPrice(), ZSTD_seqToCodes(), and ZSTD_updateStats().
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 538 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_internal(), and ZSTD_ldm_blockCompress().
MEM_STATIC U32 ZSTD_MLcode | ( | U32 | mlBase | ) |
Definition at line 289 of file zstd_compress_internal.h.
Referenced by ZSTD_getMatchPrice(), ZSTD_seqToCodes(), and ZSTD_updateStats().
Definition at line 351 of file zstd_compress_internal.h.
Referenced by ZSTD_count().
Definition at line 2652 of file zstd_compress.c.
Referenced by ZSTD_continueCCtx(), and ZSTD_resetCCtx_internal().
void ZSTD_resetSeqStore | ( | seqStore_t * | ssPtr | ) |
Definition at line 2411 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_btultra(), and ZSTD_compressBlock_internal().
ZSTD_blockCompressor ZSTD_selectBlockCompressor | ( | ZSTD_strategy | strat, |
ZSTD_dictMode_e | dictMode | ||
) |
Definition at line 2363 of file zstd_compress.c.
Referenced by ZSTD_compressBlock_internal(), and ZSTD_ldm_blockCompress().
MEM_STATIC void ZSTD_storeSeq | ( | seqStore_t * | seqStorePtr, |
size_t | litLength, | ||
const void * | literals, | ||
U32 | offsetCode, | ||
size_t | mlBase | ||
) |
ZSTD_storeSeq() : Store a sequence (literal length, literals, offset code and match length code) into seqStore_t. offsetCode
: distance to match + 3 (values 1-3 are repCodes). mlBase
: matchLength - MINMATCH
Definition at line 308 of file zstd_compress_internal.h.
Referenced by ZSTD_compressBlock_doubleFast_extDict_generic(), ZSTD_compressBlock_doubleFast_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 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 515 of file zstd_compress_internal.h.
Referenced by ZSTD_continueCCtx(), 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 569 of file zstd_compress_internal.h.
Referenced by ZSTD_compress_frameChunk(), ZSTD_compressContinue_internal(), and ZSTD_ldm_generateSequences().
MEM_STATIC void ZSTD_window_enforceMaxDist | ( | ZSTD_window_t * | window, |
void const * | srcEnd, | ||
U32 | maxDist, | ||
U32 * | loadedDictEndPtr, | ||
const ZSTD_matchState_t ** | dictMatchStatePtr | ||
) |
ZSTD_window_enforceMaxDist(): Updates lowLimit so that: (srcEnd - base) - lowLimit == maxDist + loadedDictEnd
This allows a simple check that index >= lowLimit to see if index is valid. This must be called before a block compression call, with srcEnd as the block source end.
If loadedDictEndPtr is not NULL, we set it to zero once we update lowLimit. This is because dictionaries are allowed to be referenced as long as the last byte of the dictionary is in the window, but once they are out of range, they cannot be referenced. If loadedDictEndPtr is NULL, we use loadedDictEnd == 0.
In normal dict mode, the dict is 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 629 of file zstd_compress_internal.h.
Referenced by ZSTD_compress_frameChunk(), and 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 528 of file zstd_compress_internal.h.
Referenced by ZSTD_invalidateRepCodes(), ZSTD_ldm_generateSequences_internal(), and ZSTD_matchState_dictMode().
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 552 of file zstd_compress_internal.h.
Referenced by ZSTD_compress_frameChunk(), ZSTD_compressContinue_internal(), and ZSTD_ldm_generateSequences().
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 659 of file zstd_compress_internal.h.
Referenced by ZSTD_compressContinue_internal(), and ZSTD_loadDictionaryContent().
Definition at line 2643 of file zstd_compress.c.
Definition at line 464 of file zstd_compress_internal.h.
Referenced by ZSTD_hash3().
Definition at line 468 of file zstd_compress_internal.h.
Referenced by ZSTD_hash4().
Definition at line 472 of file zstd_compress_internal.h.
Referenced by ZSTD_hash5().
Definition at line 476 of file zstd_compress_internal.h.
Referenced by ZSTD_hash6().
Definition at line 480 of file zstd_compress_internal.h.
Referenced by ZSTD_hash7().
Definition at line 484 of file zstd_compress_internal.h.
Referenced by ZSTD_hash8(), ZSTD_ldm_getHashPower(), ZSTD_ldm_getRollingHash(), and ZSTD_ldm_updateHash().