From: Yann Collet Date: Fri, 25 May 2018 21:52:21 +0000 (-0700) Subject: slightly nudge choices towards less sequences X-Git-Tag: v1.3.5~3^2~41^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1141%2Fhead;p=thirdparty%2Fzstd.git slightly nudge choices towards less sequences also slightly improve some strange detrimental corner cases. --- diff --git a/lib/compress/zstd_opt.c b/lib/compress/zstd_opt.c index 2a699c2ac..e66019aa8 100644 --- a/lib/compress/zstd_opt.c +++ b/lib/compress/zstd_opt.c @@ -282,6 +282,8 @@ ZSTD_getMatchPrice(U32 const offset, price += (ML_bits[mlCode] * BITCOST_MULTIPLIER) + (optPtr->matchLengthSumBasePrice - WEIGHT(optPtr->matchLengthFreq[mlCode], optLevel)); } + price += BITCOST_MULTIPLIER / 5; /* heuristic : make matches a bit more costly to favor less sequences -> faster decompression speed */ + DEBUGLOG(8, "ZSTD_getMatchPrice(ml:%u) = %u", matchLength, price); return price; }