Lines Matching refs:price
93 U32 price, u; in ZSTD_getLiteralPrice() local
105 price = ssPtr->cachedPrice + additional * ssPtr->log2litSum; in ZSTD_getLiteralPrice()
107 price -= ZSTD_highbit32(ssPtr->litFreq[literals2[u]] + 1); in ZSTD_getLiteralPrice()
108 ssPtr->cachedPrice = price; in ZSTD_getLiteralPrice()
111 price = litLength * ssPtr->log2litSum; in ZSTD_getLiteralPrice()
113 price -= ZSTD_highbit32(ssPtr->litFreq[literals[u]] + 1); in ZSTD_getLiteralPrice()
117 ssPtr->cachedPrice = price; in ZSTD_getLiteralPrice()
126 …price += LL_bits[llCode] + ssPtr->log2litLengthSum - ZSTD_highbit32(ssPtr->litLengthFreq[llCode] +… in ZSTD_getLiteralPrice()
129 return price; in ZSTD_getLiteralPrice()
135 U32 price; in ZSTD_getPrice() local
141 …price = offCode + seqStorePtr->log2offCodeSum - ZSTD_highbit32(seqStorePtr->offCodeFreq[offCode] +… in ZSTD_getPrice()
143 price += (offCode - 19) * 2; in ZSTD_getPrice()
149 …price += ML_bits[mlCode] + seqStorePtr->log2matchLengthSum - ZSTD_highbit32(seqStorePtr->matchLeng… in ZSTD_getPrice()
152 return price + ZSTD_getLiteralPrice(seqStorePtr, litLength, literals) + seqStorePtr->factor; in ZSTD_getPrice()
193 opt[last_pos + 1].price = ZSTD_MAX_PRICE; \
199 opt[pos].price = price_; \
430 U32 cur, match_num, last_pos, litlen, price; in ZSTD_compressBlock_opt_generic() local
453 price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_generic()
454 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_generic()
455 SET_PRICE(mlen, mlen, i, litlen, price); /* note : macro modifies last_pos */ in ZSTD_compressBlock_opt_generic()
483 price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off - 1, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_generic()
484 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_generic()
485 SET_PRICE(mlen, mlen, matches[u].off, litlen, price); /* note : macro modifies last_pos */ in ZSTD_compressBlock_opt_generic()
511 price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - litlen); in ZSTD_compressBlock_opt_generic()
513 price = ZSTD_getLiteralPrice(seqStorePtr, litlen, anchor); in ZSTD_compressBlock_opt_generic()
516 price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - 1); in ZSTD_compressBlock_opt_generic()
519 if (cur > last_pos || price <= opt[cur].price) in ZSTD_compressBlock_opt_generic()
520 SET_PRICE(cur, 1, 0, litlen, price); in ZSTD_compressBlock_opt_generic()
564 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr - litlen, in ZSTD_compressBlock_opt_generic()
567 price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_generic()
570 … price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_generic()
573 if (cur + mlen > last_pos || price <= opt[cur + mlen].price) in ZSTD_compressBlock_opt_generic()
574 SET_PRICE(cur + mlen, mlen, i, litlen, price); in ZSTD_compressBlock_opt_generic()
599 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip + cur - litlen, in ZSTD_compressBlock_opt_generic()
602 … price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off - 1, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_generic()
605 …price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off - 1, mlen - MINMATCH, … in ZSTD_compressBlock_opt_generic()
608 if (cur + mlen > last_pos || (price < opt[cur + mlen].price)) in ZSTD_compressBlock_opt_generic()
609 SET_PRICE(cur + mlen, mlen, matches[u].off, litlen, price); in ZSTD_compressBlock_opt_generic()
728 U32 cur, match_num, last_pos, litlen, price; in ZSTD_compressBlock_opt_extDict_generic() local
761 price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_extDict_generic()
762 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_extDict_generic()
763 SET_PRICE(mlen, mlen, i, litlen, price); /* note : macro modifies last_pos */ in ZSTD_compressBlock_opt_extDict_generic()
800 price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off - 1, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_extDict_generic()
801 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_extDict_generic()
802 SET_PRICE(mlen, mlen, matches[u].off, litlen, price); in ZSTD_compressBlock_opt_extDict_generic()
819 price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - litlen); in ZSTD_compressBlock_opt_extDict_generic()
821 price = ZSTD_getLiteralPrice(seqStorePtr, litlen, anchor); in ZSTD_compressBlock_opt_extDict_generic()
824 price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - 1); in ZSTD_compressBlock_opt_extDict_generic()
827 if (cur > last_pos || price <= opt[cur].price) in ZSTD_compressBlock_opt_extDict_generic()
828 SET_PRICE(cur, 1, 0, litlen, price); in ZSTD_compressBlock_opt_extDict_generic()
878 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr - litlen, in ZSTD_compressBlock_opt_extDict_generic()
881 price = ZSTD_getPrice(seqStorePtr, litlen, anchor, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_extDict_generic()
884 … price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_extDict_generic()
887 if (cur + mlen > last_pos || price <= opt[cur + mlen].price) in ZSTD_compressBlock_opt_extDict_generic()
888 SET_PRICE(cur + mlen, mlen, i, litlen, price); in ZSTD_compressBlock_opt_extDict_generic()
913 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip + cur - litlen, in ZSTD_compressBlock_opt_extDict_generic()
916 … price = ZSTD_getPrice(seqStorePtr, litlen, anchor, matches[u].off - 1, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_extDict_generic()
919 …price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off - 1, mlen - MINMATCH, … in ZSTD_compressBlock_opt_extDict_generic()
922 if (cur + mlen > last_pos || (price < opt[cur + mlen].price)) in ZSTD_compressBlock_opt_extDict_generic()
923 SET_PRICE(cur + mlen, mlen, matches[u].off, litlen, price); in ZSTD_compressBlock_opt_extDict_generic()