slightly nudge choices towards less sequences

also slightly improve some strange detrimental corner cases.
dev
Yann Collet 2018-05-25 14:52:21 -07:00
parent f6ad59ab5c
commit e2c0e3d437
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}