Move ldm enable to compressStream2()
This commit is contained in:
parent
d28d8a1d72
commit
578e889ec1
@ -1552,12 +1552,6 @@ static size_t ZSTD_resetCCtx_internal(ZSTD_CCtx* zc,
|
||||
|
||||
zc->isFirstBlock = 1;
|
||||
|
||||
if (params.cParams.strategy >= ZSTD_btopt && params.cParams.windowLog >= 27 && params.nbWorkers == 0) {
|
||||
/* Enable LDM by default for optimal parser and window size >= 128MB */
|
||||
DEBUGLOG(4, "LDM enabled by default (window size >= 128MB, strategy >= btopt)");
|
||||
params.ldmParams.enableLdm = 1;
|
||||
}
|
||||
|
||||
if (params.ldmParams.enableLdm) {
|
||||
/* Adjust long distance matching parameters */
|
||||
ZSTD_ldm_adjustParameters(¶ms.ldmParams, ¶ms.cParams);
|
||||
@ -4194,6 +4188,11 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,
|
||||
dictSize, mode);
|
||||
}
|
||||
|
||||
if (params.cParams.strategy >= ZSTD_btopt && params.cParams.windowLog >= 27) {
|
||||
/* Enable LDM by default for optimal parser and window size >= 128MB */
|
||||
DEBUGLOG(4, "LDM enabled by default (window size >= 128MB, strategy >= btopt)");
|
||||
params.ldmParams.enableLdm = 1;
|
||||
}
|
||||
|
||||
#ifdef ZSTD_MULTITHREAD
|
||||
if ((cctx->pledgedSrcSizePlusOne-1) <= ZSTDMT_JOBSIZE_MIN) {
|
||||
|
@ -1459,13 +1459,6 @@ size_t ZSTDMT_initCStream_internal(
|
||||
|
||||
mtctx->params = params;
|
||||
mtctx->frameContentSize = pledgedSrcSize;
|
||||
|
||||
if (params.cParams.strategy >= ZSTD_btopt && params.cParams.windowLog >= 27) {
|
||||
/* Enable LDM by default for optimal parser and window size >= 128MB */
|
||||
DEBUGLOG(4, "LDM enabled by default (window size >= 128MB, strategy >= btopt)");
|
||||
params.ldmParams.enableLdm = 1;
|
||||
}
|
||||
|
||||
if (dict) {
|
||||
ZSTD_freeCDict(mtctx->cdictLocal);
|
||||
mtctx->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize,
|
||||
|
Loading…
x
Reference in New Issue
Block a user