Lines Matching refs:opt

203 			opt[last_pos + 1].price = ZSTD_MAX_PRICE; \
206 opt[pos].mlen = mlen_; \
207 opt[pos].off = offset_; \
208 opt[pos].litlen = litlen_; \
209 opt[pos].price = price_; \
423 ZSTD_optimal_t *opt = seqStorePtr->priceTable; in ZSTD_compressBlock_opt_generic() local
442 memset(opt, 0, sizeof(ZSTD_optimal_t)); in ZSTD_compressBlock_opt_generic()
464 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_generic()
494 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_generic()
509 opt[0].rep[i] = rep[i]; in ZSTD_compressBlock_opt_generic()
511 opt[0].mlen = 1; in ZSTD_compressBlock_opt_generic()
512 opt[0].litlen = litlen; in ZSTD_compressBlock_opt_generic()
518 if (opt[cur - 1].mlen == 1) { in ZSTD_compressBlock_opt_generic()
519 litlen = opt[cur - 1].litlen + 1; in ZSTD_compressBlock_opt_generic()
521 price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - litlen); in ZSTD_compressBlock_opt_generic()
526 price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - 1); in ZSTD_compressBlock_opt_generic()
529 if (cur > last_pos || price <= opt[cur].price) in ZSTD_compressBlock_opt_generic()
538 mlen = opt[cur].mlen; in ZSTD_compressBlock_opt_generic()
539 if (opt[cur].off > ZSTD_REP_MOVE_OPT) { in ZSTD_compressBlock_opt_generic()
540 opt[cur].rep[2] = opt[cur - mlen].rep[1]; in ZSTD_compressBlock_opt_generic()
541 opt[cur].rep[1] = opt[cur - mlen].rep[0]; in ZSTD_compressBlock_opt_generic()
542 opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE_OPT; in ZSTD_compressBlock_opt_generic()
544 opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur - mlen].rep[1] : opt[cur - mlen].rep[2]; in ZSTD_compressBlock_opt_generic()
545 opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur - mlen].rep[0] : opt[cur - mlen].rep[1]; in ZSTD_compressBlock_opt_generic()
546 opt[cur].rep[0] = in ZSTD_compressBlock_opt_generic()
547 …((opt[cur].off == ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur - mlen].rep[0] - 1) : (opt[cur - m… in ZSTD_compressBlock_opt_generic()
553 for (i = (opt[cur].mlen != 1); i < last_i; i++) { /* check rep */ in ZSTD_compressBlock_opt_generic()
554 const S32 repCur = (i == ZSTD_REP_MOVE_OPT) ? (opt[cur].rep[0] - 1) : opt[cur].rep[i]; in ZSTD_compressBlock_opt_generic()
566 best_off = i - (opt[cur].mlen != 1); in ZSTD_compressBlock_opt_generic()
571 if (opt[cur].mlen == 1) { in ZSTD_compressBlock_opt_generic()
572 litlen = opt[cur].litlen; in ZSTD_compressBlock_opt_generic()
574 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr - litlen, in ZSTD_compressBlock_opt_generic()
580 … price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_generic()
583 if (cur + mlen > last_pos || price <= opt[cur + mlen].price) in ZSTD_compressBlock_opt_generic()
606 if (opt[cur].mlen == 1) { in ZSTD_compressBlock_opt_generic()
607 litlen = opt[cur].litlen; in ZSTD_compressBlock_opt_generic()
609 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip + cur - litlen, in ZSTD_compressBlock_opt_generic()
615 …price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off - 1, mlen - MINMATCH, … in ZSTD_compressBlock_opt_generic()
618 if (cur + mlen > last_pos || (price < opt[cur + mlen].price)) in ZSTD_compressBlock_opt_generic()
626 best_mlen = opt[last_pos].mlen; in ZSTD_compressBlock_opt_generic()
627 best_off = opt[last_pos].off; in ZSTD_compressBlock_opt_generic()
632 opt[0].mlen = 1; in ZSTD_compressBlock_opt_generic()
635 mlen = opt[cur].mlen; in ZSTD_compressBlock_opt_generic()
636 offset = opt[cur].off; in ZSTD_compressBlock_opt_generic()
637 opt[cur].mlen = best_mlen; in ZSTD_compressBlock_opt_generic()
638 opt[cur].off = best_off; in ZSTD_compressBlock_opt_generic()
647 u += opt[u].mlen; in ZSTD_compressBlock_opt_generic()
651 mlen = opt[cur].mlen; in ZSTD_compressBlock_opt_generic()
657 offset = opt[cur].off; in ZSTD_compressBlock_opt_generic()
720 ZSTD_optimal_t *opt = seqStorePtr->priceTable; in ZSTD_compressBlock_opt_extDict_generic() local
741 memset(opt, 0, sizeof(ZSTD_optimal_t)); in ZSTD_compressBlock_opt_extDict_generic()
743 opt[0].litlen = (U32)(ip - anchor); in ZSTD_compressBlock_opt_extDict_generic()
769 litlen = opt[0].litlen; in ZSTD_compressBlock_opt_extDict_generic()
772 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_extDict_generic()
790 opt[0].rep[i] = rep[i]; in ZSTD_compressBlock_opt_extDict_generic()
792 opt[0].mlen = 1; in ZSTD_compressBlock_opt_extDict_generic()
808 litlen = opt[0].litlen; in ZSTD_compressBlock_opt_extDict_generic()
811 if (mlen > last_pos || price < opt[mlen].price) in ZSTD_compressBlock_opt_extDict_generic()
826 if (opt[cur - 1].mlen == 1) { in ZSTD_compressBlock_opt_extDict_generic()
827 litlen = opt[cur - 1].litlen + 1; in ZSTD_compressBlock_opt_extDict_generic()
829 price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - litlen); in ZSTD_compressBlock_opt_extDict_generic()
834 price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - 1); in ZSTD_compressBlock_opt_extDict_generic()
837 if (cur > last_pos || price <= opt[cur].price) in ZSTD_compressBlock_opt_extDict_generic()
846 mlen = opt[cur].mlen; in ZSTD_compressBlock_opt_extDict_generic()
847 if (opt[cur].off > ZSTD_REP_MOVE_OPT) { in ZSTD_compressBlock_opt_extDict_generic()
848 opt[cur].rep[2] = opt[cur - mlen].rep[1]; in ZSTD_compressBlock_opt_extDict_generic()
849 opt[cur].rep[1] = opt[cur - mlen].rep[0]; in ZSTD_compressBlock_opt_extDict_generic()
850 opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE_OPT; in ZSTD_compressBlock_opt_extDict_generic()
852 opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur - mlen].rep[1] : opt[cur - mlen].rep[2]; in ZSTD_compressBlock_opt_extDict_generic()
853 opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur - mlen].rep[0] : opt[cur - mlen].rep[1]; in ZSTD_compressBlock_opt_extDict_generic()
854 opt[cur].rep[0] = in ZSTD_compressBlock_opt_extDict_generic()
855 …((opt[cur].off == ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur - mlen].rep[0] - 1) : (opt[cur - m… in ZSTD_compressBlock_opt_extDict_generic()
862 const S32 repCur = (i == ZSTD_REP_MOVE_OPT) ? (opt[cur].rep[0] - 1) : opt[cur].rep[i]; in ZSTD_compressBlock_opt_extDict_generic()
880 best_off = i - (opt[cur].mlen != 1); in ZSTD_compressBlock_opt_extDict_generic()
885 if (opt[cur].mlen == 1) { in ZSTD_compressBlock_opt_extDict_generic()
886 litlen = opt[cur].litlen; in ZSTD_compressBlock_opt_extDict_generic()
888 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr - litlen, in ZSTD_compressBlock_opt_extDict_generic()
894 … price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra); in ZSTD_compressBlock_opt_extDict_generic()
897 if (cur + mlen > last_pos || price <= opt[cur + mlen].price) in ZSTD_compressBlock_opt_extDict_generic()
920 if (opt[cur].mlen == 1) { in ZSTD_compressBlock_opt_extDict_generic()
921 litlen = opt[cur].litlen; in ZSTD_compressBlock_opt_extDict_generic()
923 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip + cur - litlen, in ZSTD_compressBlock_opt_extDict_generic()
929 …price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off - 1, mlen - MINMATCH, … in ZSTD_compressBlock_opt_extDict_generic()
932 if (cur + mlen > last_pos || (price < opt[cur + mlen].price)) in ZSTD_compressBlock_opt_extDict_generic()
940 best_mlen = opt[last_pos].mlen; in ZSTD_compressBlock_opt_extDict_generic()
941 best_off = opt[last_pos].off; in ZSTD_compressBlock_opt_extDict_generic()
946 opt[0].mlen = 1; in ZSTD_compressBlock_opt_extDict_generic()
949 mlen = opt[cur].mlen; in ZSTD_compressBlock_opt_extDict_generic()
950 offset = opt[cur].off; in ZSTD_compressBlock_opt_extDict_generic()
951 opt[cur].mlen = best_mlen; in ZSTD_compressBlock_opt_extDict_generic()
952 opt[cur].off = best_off; in ZSTD_compressBlock_opt_extDict_generic()
961 u += opt[u].mlen; in ZSTD_compressBlock_opt_extDict_generic()
965 mlen = opt[cur].mlen; in ZSTD_compressBlock_opt_extDict_generic()
971 offset = opt[cur].off; in ZSTD_compressBlock_opt_extDict_generic()