diff --git a/lib/compress/zstdmt_compress.c b/lib/compress/zstdmt_compress.c index d68f4718..0d384c61 100644 --- a/lib/compress/zstdmt_compress.c +++ b/lib/compress/zstdmt_compress.c @@ -1192,8 +1192,8 @@ static unsigned ZSTDMT_computeTargetJobLog(const ZSTD_CCtx_params* params) if (params->ldmParams.enableLdm) { /* In Long Range Mode, the windowLog is typically oversized. * In which case, it's preferable to determine the jobSize - * based on chainLog instead. */ - jobLog = MAX(21, params->cParams.chainLog + 4); + * based on cycleLog instead. */ + jobLog = MAX(21, ZSTD_cycleLog(params->cParams.chainLog, params->cParams.strategy) + 3); } else { jobLog = MAX(20, params->cParams.windowLog + 2); } diff --git a/programs/fileio.c b/programs/fileio.c index e02c3f83..66636c50 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -909,7 +909,7 @@ static void FIO_adjustParamsForPatchFromMode(FIO_prefs_t* const prefs, if (fileWindowLog > ZSTD_WINDOWLOG_MAX) DISPLAYLEVEL(1, "Max window log exceeded by file (compression ratio will suffer)\n"); comprParams->windowLog = MIN(ZSTD_WINDOWLOG_MAX, fileWindowLog); - if (fileWindowLog > ZSTD_cycleLog(cParams.hashLog, cParams.strategy)) { + if (fileWindowLog > ZSTD_cycleLog(cParams.chainLog, cParams.strategy)) { if (!prefs->ldmFlag) DISPLAYLEVEL(1, "long mode automatically triggered\n"); FIO_setLdmFlag(prefs, 1);