Lines Matching refs:price

58  * @return price in bytes as fractional value
60 MEM_STATIC double ZSTD_fCost(U32 price)
62 return (double)price / (BITCOST_MULTIPLIER*8);
243 * price of literals (only) in specified segment (which length can be 0).
244 * does not include price of literalLength symbol */
258 { U32 price = litLength * optPtr->litSumBasePrice;
262 price -= WEIGHT(optPtr->litFreq[literals[u]], optLevel);
264 return price;
275 /* We can't compute the litLength price for sizes >= ZSTD_BLOCKSIZE_MAX
303 U32 price;
312 price = (offCode * BITCOST_MULTIPLIER) + (optPtr->offCodeSumBasePrice - WEIGHT(optPtr->offCodeFreq[offCode], optLevel));
314 price += (offCode-19)*2 * BITCOST_MULTIPLIER; /* handicap for long distance offsets, favor decompression speed */
318 price += (ML_bits[mlCode] * BITCOST_MULTIPLIER) + (optPtr->matchLengthSumBasePrice - WEIGHT(optPtr->matchLengthFreq[mlCode], optLevel));
321 price += BITCOST_MULTIPLIER / 5; /* heuristic : make matches a bit more costly to favor less sequences -> faster decompression speed */
323 DEBUGLOG(8, "ZSTD_getMatchPrice(ml:%u) = %u", matchLength, price);
324 return price;
1092 /* We don't need to include the actual price of the literals because
1094 * in every price. We include the literal length to avoid negative
1097 opt[0].price = (int)ZSTD_litLengthPrice(litlen, optStatePtr, optLevel);
1117 assert(opt[0].price >= 0);
1118 { U32 const literalsPrice = (U32)opt[0].price + ZSTD_litLengthPrice(0, optStatePtr, optLevel);
1122 opt[pos].price = ZSTD_MAX_PRICE; /* mlen, litlen and price will be fixed during forward scanning */
1130 DEBUGLOG(7, "rPos:%u => set initial price : %.2f",
1135 opt[pos].price = (int)sequencePrice;
1149 int const price = opt[cur-1].price
1153 assert(price < 1000000000); /* overflow check */
1154 if (price <= opt[cur].price) {
1155 DEBUGLOG(7, "cPos:%zi==rPos:%u : better price (%.2f<=%.2f) using literal (ll==%u) (hist:%u,%u,%u)",
1156 inr-istart, cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price), litlen,
1161 opt[cur].price = price;
1164 inr-istart, cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price),
1190 && (opt[cur+1].price <= opt[cur].price + (BITCOST_MULTIPLIER/2)) ) {
1191 DEBUGLOG(7, "move to next rPos:%u : price is <=", cur+1);
1195 assert(opt[cur].price >= 0);
1198 U32 const previousPrice = (U32)opt[cur].price;
1238 int const price = (int)basePrice + (int)ZSTD_getMatchPrice(offset, mlen, optStatePtr, optLevel);
1240 if ((pos > last_pos) || (price < opt[pos].price)) {
1241 DEBUGLOG(7, "rPos:%u (ml=%2u) => new better price (%.2f<%.2f)",
1242 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price));
1243 while (last_pos < pos) { opt[last_pos+1].price = ZSTD_MAX_PRICE; last_pos++; } /* fill empty positions */
1247 opt[pos].price = price;
1249 DEBUGLOG(7, "rPos:%u (ml=%2u) => new price is worse (%.2f>=%.2f)",
1250 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price));