Lines Matching refs:optLevel

84 static void ZSTD_setBasePrices(optState_t* optPtr, int optLevel)  in ZSTD_setBasePrices()  argument
87 optPtr->litSumBasePrice = WEIGHT(optPtr->litSum, optLevel); in ZSTD_setBasePrices()
88 optPtr->litLengthSumBasePrice = WEIGHT(optPtr->litLengthSum, optLevel); in ZSTD_setBasePrices()
89 optPtr->matchLengthSumBasePrice = WEIGHT(optPtr->matchLengthSum, optLevel); in ZSTD_setBasePrices()
90 optPtr->offCodeSumBasePrice = WEIGHT(optPtr->offCodeSum, optLevel); in ZSTD_setBasePrices()
118 int const optLevel) in ZSTD_rescaleFreqs() argument
221 ZSTD_setBasePrices(optPtr, optLevel); in ZSTD_rescaleFreqs()
229 int optLevel) in ZSTD_rawLiteralsCost() argument
243 …assert(WEIGHT(optPtr->litFreq[literals[u]], optLevel) <= optPtr->litSumBasePrice); /* literal co… in ZSTD_rawLiteralsCost()
244 price -= WEIGHT(optPtr->litFreq[literals[u]], optLevel); in ZSTD_rawLiteralsCost()
252 static U32 ZSTD_litLengthPrice(U32 const litLength, const optState_t* const optPtr, int optLevel) in ZSTD_litLengthPrice() argument
254 if (optPtr->priceType == zop_predef) return WEIGHT(litLength, optLevel); in ZSTD_litLengthPrice()
260 - WEIGHT(optPtr->litLengthFreq[llCode], optLevel); in ZSTD_litLengthPrice()
272 int const optLevel) in ZSTD_getMatchPrice() argument
280 return WEIGHT(mlBase, optLevel) + ((16 + offCode) * BITCOST_MULTIPLIER); in ZSTD_getMatchPrice()
283 …TCOST_MULTIPLIER) + (optPtr->offCodeSumBasePrice - WEIGHT(optPtr->offCodeFreq[offCode], optLevel)); in ZSTD_getMatchPrice()
284 if ((optLevel<2) /*static*/ && offCode >= 20) in ZSTD_getMatchPrice()
289 …ULTIPLIER) + (optPtr->matchLengthSumBasePrice - WEIGHT(optPtr->matchLengthFreq[mlCode], optLevel)); in ZSTD_getMatchPrice()
947 const int optLevel, in ZSTD_compressBlock_opt_generic() argument
976 assert(optLevel <= 2); in ZSTD_compressBlock_opt_generic()
977 ZSTD_rescaleFreqs(optStatePtr, (const BYTE*)src, srcSize, optLevel); in ZSTD_compressBlock_opt_generic()
1001 opt[0].price = ZSTD_litLengthPrice(litlen, optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()
1021 … { U32 const literalsPrice = opt[0].price + ZSTD_litLengthPrice(0, optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()
1031 … U32 const matchPrice = ZSTD_getMatchPrice(offset, pos, optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()
1053 + ZSTD_rawLiteralsCost(ip+cur-1, 1, optStatePtr, optLevel) in ZSTD_compressBlock_opt_generic()
1054 + ZSTD_litLengthPrice(litlen, optStatePtr, optLevel) in ZSTD_compressBlock_opt_generic()
1055 - ZSTD_litLengthPrice(litlen-1, optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()
1092 if ( (optLevel==0) /*static_test*/ in ZSTD_compressBlock_opt_generic()
1101 U32 const basePrice = previousPrice + ZSTD_litLengthPrice(0, optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()
1140 … int const price = basePrice + ZSTD_getMatchPrice(offset, mlen, optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()
1153 … if (optLevel==0) break; /* early update abort; gets ~+10% speed for about -0.01 ratio loss */ in ZSTD_compressBlock_opt_generic()
1218 ZSTD_setBasePrices(optStatePtr, optLevel); in ZSTD_compressBlock_opt_generic()