]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Use cycleLog instead of chainLog to determine LDM jobLog
authorsenhuang42 <senhuang96@fb.com>
Mon, 12 Oct 2020 16:20:18 +0000 (12:20 -0400)
committersenhuang42 <senhuang96@fb.com>
Mon, 12 Oct 2020 20:09:59 +0000 (16:09 -0400)
lib/compress/zstdmt_compress.c

index baf6ef4ca6da2f472191773d49f343ded5ee392f..0c9ae69be231850c12f6be63ccd4ae513c16a8ce 100644 (file)
@@ -1184,8 +1184,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) + 4);
     } else {
         jobLog = MAX(20, params->cParams.windowLog + 2);
     }