Lines Matching defs:ms

1603 static void ZSTD_invalidateMatchState(ZSTD_matchState_t* ms)
1605 ZSTD_window_clear(&ms->window);
1607 ms->nextToUpdate = ms->window.dictLimit;
1608 ms->loadedDictEnd = 0;
1609 ms->opt.litLengthSum = 0; /* force reset of btopt stats */
1610 ms->dictMatchState = NULL;
1642 ZSTD_reset_matchState(ZSTD_matchState_t* ms,
1652 ms->dedicatedDictSearch && (forWho == ZSTD_resetTarget_CDict))
1662 ZSTD_window_init(&ms->window);
1666 ms->hashLog3 = hashLog3;
1668 ZSTD_invalidateMatchState(ms);
1676 ms->hashTable = (U32*)ZSTD_cwksp_reserve_table(ws, hSize * sizeof(U32));
1677 ms->chainTable = (U32*)ZSTD_cwksp_reserve_table(ws, chainSize * sizeof(U32));
1678 ms->hashTable3 = (U32*)ZSTD_cwksp_reserve_table(ws, h3Size * sizeof(U32));
1691 ms->opt.litFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (1<<Litbits) * sizeof(unsigned));
1692 ms->opt.litLengthFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (MaxLL+1) * sizeof(unsigned));
1693 ms->opt.matchLengthFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (MaxML+1) * sizeof(unsigned));
1694 ms->opt.offCodeFreq = (unsigned*)ZSTD_cwksp_reserve_aligned(ws, (MaxOff+1) * sizeof(unsigned));
1695 ms->opt.matchTable = (ZSTD_match_t*)ZSTD_cwksp_reserve_aligned(ws, (ZSTD_OPT_NUM+1) * sizeof(ZSTD_match_t));
1696 ms->opt.priceTable = (ZSTD_optimal_t*)ZSTD_cwksp_reserve_aligned(ws, (ZSTD_OPT_NUM+1) * sizeof(ZSTD_optimal_t));
1702 ms->tagTable = (U16*)ZSTD_cwksp_reserve_aligned(ws, tagTableSize);
1703 if (ms->tagTable) ZSTD_memset(ms->tagTable, 0, tagTableSize);
1708 ms->rowHashLog = cParams->hashLog - rowLog;
1712 ms->cParams = *cParams;
2270 static void ZSTD_reduceIndex (ZSTD_matchState_t* ms, ZSTD_CCtx_params const* params, const U32 reducerValue)
2273 ZSTD_reduceTable(ms->hashTable, hSize, reducerValue);
2276 if (ZSTD_allocateChainTable(params->cParams.strategy, params->useRowMatchFinder, (U32)ms->dedicatedDictSearch)) {
2279 ZSTD_reduceTable_btlazy2(ms->chainTable, chainSize, reducerValue);
2281 ZSTD_reduceTable(ms->chainTable, chainSize, reducerValue);
2284 if (ms->hashLog3) {
2285 U32 const h3Size = (U32)1 << ms->hashLog3;
2286 ZSTD_reduceTable(ms->hashTable3, h3Size, reducerValue);
2725 ZSTD_matchState_t* const ms = &zc->blockState.matchState;
2728 /* Assert that we have correctly flushed the ctx params into the ms's copy */
2729 ZSTD_assertEqualCParams(zc->appliedParams.cParams, ms->cParams);
2740 ms->opt.symbolCosts = &zc->blockState.prevCBlock->entropy;
2742 ms->opt.literalCompressionMode = zc->appliedParams.literalCompressionMode;
2746 assert(ms->dictMatchState == NULL || ms->loadedDictEnd == ms->window.dictLimit);
2749 { const BYTE* const base = ms->window.base;
2753 if (curr > ms->nextToUpdate + 384)
2754 ms->nextToUpdate = curr - MIN(192, (U32)(curr - ms->nextToUpdate - 384));
2758 { ZSTD_dictMode_e const dictMode = ZSTD_matchState_dictMode(ms);
2769 ms, &zc->seqStore,
2786 ms, &zc->seqStore,
2795 ms->ldmSeqStore = NULL;
2796 lastLLSize = blockCompressor(ms, &zc->seqStore, zc->blockState.nextCBlock->rep, src, srcSize);
3810 static void ZSTD_overflowCorrectIfNeeded(ZSTD_matchState_t* ms,
3818 if (ZSTD_window_needOverflowCorrection(ms->window, cycleLog, maxDist, ms->loadedDictEnd, ip, iend)) {
3819 U32 const correction = ZSTD_window_correctOverflow(&ms->window, cycleLog, maxDist, ip);
3824 ZSTD_reduceIndex(ms, params, correction);
3826 if (ms->nextToUpdate < correction) ms->nextToUpdate = 0;
3827 else ms->nextToUpdate -= correction;
3829 ms->loadedDictEnd = 0;
3830 ms->dictMatchState = NULL;
3860 ZSTD_matchState_t* const ms = &cctx->blockState.matchState;
3869 ms, &cctx->workspace, &cctx->appliedParams, ip, ip + blockSize);
3870 ZSTD_checkDictValidity(&ms->window, ip + blockSize, maxDist, &ms->loadedDictEnd, &ms->dictMatchState);
3871 ZSTD_window_enforceMaxDist(&ms->window, ip, maxDist, &ms->loadedDictEnd, &ms->dictMatchState);
3874 if (ms->nextToUpdate < ms->window.lowLimit) ms->nextToUpdate = ms->window.lowLimit;
4025 ZSTD_matchState_t* const ms = &cctx->blockState.matchState;
4045 if (!ZSTD_window_update(&ms->window, src, srcSize, ms->forceNonContiguous)) {
4046 ms->forceNonContiguous = 0;
4047 ms->nextToUpdate = ms->window.dictLimit;
4056 ms, &cctx->workspace, &cctx->appliedParams,
4109 static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
4120 /* Assert that we the ms params match the params we're being given */
4121 ZSTD_assertEqualCParams(params->cParams, ms->cParams);
4130 assert(ZSTD_window_isEmpty(ms->window));
4142 ZSTD_window_update(&ms->window, src, srcSize, /* forceNonContiguous */ 0);
4143 ms->loadedDictEnd = params->forceWindow ? 0 : (U32)(iend - ms->window.base);
4144 ms->forceNonContiguous = params->deterministicRefPrefix;
4153 ZSTD_overflowCorrectIfNeeded(ms, ws, params, ip, iend);
4161 ZSTD_fillHashTable(ms, iend, dtlm);
4164 ZSTD_fillDoubleHashTable(ms, iend, dtlm);
4171 if (ms->dedicatedDictSearch) {
4172 assert(ms->chainTable != NULL);
4173 ZSTD_dedicatedDictSearch_lazy_loadDictionary(ms, iend-HASH_READ_SIZE);
4178 ZSTD_memset(ms->tagTable, 0, tagTableSize);
4179 ZSTD_row_update(ms, iend-HASH_READ_SIZE);
4182 ZSTD_insertAndFindFirstIndex(ms, iend-HASH_READ_SIZE);
4193 ZSTD_updateTree(ms, iend-HASH_READ_SIZE, iend);
4200 ms->nextToUpdate = (U32)(iend - ms->window.base);
4325 ZSTD_matchState_t* ms,
4348 ms, NULL, ws, params, dictPtr, dictContentSize, dtlm), "");
4357 ZSTD_matchState_t* ms,
4376 return ZSTD_loadDictionaryContent(ms, ls, ws, params, dict, dictSize, dtlm);
4382 ms, ls, ws, params, dict, dictSize, dtlm);
4390 bs, ms, ws, params, dict, dictSize, dtlm, workspace);