Lines Matching defs:optLevel

71 static void ZSTD_setBasePrices(optState_t* optPtr, int optLevel)
74 optPtr->litSumBasePrice = WEIGHT(optPtr->litSum, optLevel);
75 optPtr->litLengthSumBasePrice = WEIGHT(optPtr->litLengthSum, optLevel);
76 optPtr->matchLengthSumBasePrice = WEIGHT(optPtr->matchLengthSum, optLevel);
77 optPtr->offCodeSumBasePrice = WEIGHT(optPtr->offCodeSum, optLevel);
126 int const optLevel)
239 ZSTD_setBasePrices(optPtr, optLevel);
247 int optLevel)
261 assert(WEIGHT(optPtr->litFreq[literals[u]], optLevel) <= optPtr->litSumBasePrice); /* literal cost should never be negative */
262 price -= WEIGHT(optPtr->litFreq[literals[u]], optLevel);
270 static U32 ZSTD_litLengthPrice(U32 const litLength, const optState_t* const optPtr, int optLevel)
274 return WEIGHT(litLength, optLevel);
281 return BITCOST_MULTIPLIER + ZSTD_litLengthPrice(ZSTD_BLOCKSIZE_MAX - 1, optPtr, optLevel);
287 - WEIGHT(optPtr->litLengthFreq[llCode], optLevel);
295 * @optLevel: when <2, favors small offset for decompression speed (improved cache efficiency)
301 int const optLevel)
309 return WEIGHT(mlBase, optLevel) + ((16 + offCode) * BITCOST_MULTIPLIER);
312 price = (offCode * BITCOST_MULTIPLIER) + (optPtr->offCodeSumBasePrice - WEIGHT(optPtr->offCodeFreq[offCode], optLevel));
313 if ((optLevel<2) /*static*/ && offCode >= 20)
318 price += (ML_bits[mlCode] * BITCOST_MULTIPLIER) + (optPtr->matchLengthSumBasePrice - WEIGHT(optPtr->matchLengthFreq[mlCode], optLevel));
1041 const int optLevel,
1072 assert(optLevel <= 2);
1073 ZSTD_rescaleFreqs(optStatePtr, (const BYTE*)src, srcSize, optLevel);
1097 opt[0].price = (int)ZSTD_litLengthPrice(litlen, optStatePtr, optLevel);
1118 { U32 const literalsPrice = (U32)opt[0].price + ZSTD_litLengthPrice(0, optStatePtr, optLevel);
1128 U32 const matchPrice = ZSTD_getMatchPrice(offcode, pos, optStatePtr, optLevel);
1150 + (int)ZSTD_rawLiteralsCost(ip+cur-1, 1, optStatePtr, optLevel)
1151 + (int)ZSTD_litLengthPrice(litlen, optStatePtr, optLevel)
1152 - (int)ZSTD_litLengthPrice(litlen-1, optStatePtr, optLevel);
1189 if ( (optLevel==0) /*static_test*/
1199 U32 const basePrice = previousPrice + ZSTD_litLengthPrice(0, optStatePtr, optLevel);
1238 int const price = (int)basePrice + (int)ZSTD_getMatchPrice(offset, mlen, optStatePtr, optLevel);
1251 if (optLevel==0) break; /* early update abort; gets ~+10% speed for about -0.01 ratio loss */
1316 ZSTD_setBasePrices(optStatePtr, optLevel);
1328 return ZSTD_compressBlock_opt_generic(ms, seqStore, rep, src, srcSize, 0 /* optLevel */, dictMode);
1335 return ZSTD_compressBlock_opt_generic(ms, seqStore, rep, src, srcSize, 2 /* optLevel */, dictMode);