Lines Matching defs:cur

440 		U32 cur, match_num, last_pos, litlen, price;
457 cur = 0;
482 cur = 0;
515 for (cur = 1; cur <= last_pos; cur++) {
516 inr = ip + cur;
518 if (opt[cur - 1].mlen == 1) {
519 litlen = opt[cur - 1].litlen + 1;
520 if (cur > litlen) {
521 price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - litlen);
526 price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - 1);
529 if (cur > last_pos || price <= opt[cur].price)
530 SET_PRICE(cur, 1, 0, litlen, price);
532 if (cur == last_pos)
538 mlen = opt[cur].mlen;
539 if (opt[cur].off > ZSTD_REP_MOVE_OPT) {
540 opt[cur].rep[2] = opt[cur - mlen].rep[1];
541 opt[cur].rep[1] = opt[cur - mlen].rep[0];
542 opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE_OPT;
544 opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur - mlen].rep[1] : opt[cur - mlen].rep[2];
545 opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur - mlen].rep[0] : opt[cur - mlen].rep[1];
546 opt[cur].rep[0] =
547 ((opt[cur].off == ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur - mlen].rep[0] - 1) : (opt[cur - mlen].rep[opt[cur].off]);
553 for (i = (opt[cur].mlen != 1); i < last_i; i++) { /* check rep */
554 const S32 repCur = (i == ZSTD_REP_MOVE_OPT) ? (opt[cur].rep[0] - 1) : opt[cur].rep[i];
559 if (mlen > sufficient_len || cur + mlen >= ZSTD_OPT_NUM) {
562 last_pos = cur + 1;
566 best_off = i - (opt[cur].mlen != 1);
571 if (opt[cur].mlen == 1) {
572 litlen = opt[cur].litlen;
573 if (cur > litlen) {
574 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr - litlen,
580 price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra);
583 if (cur + mlen > last_pos || price <= opt[cur + mlen].price)
584 SET_PRICE(cur + mlen, mlen, i, litlen, price);
593 if (match_num > 0 && (matches[match_num - 1].len > sufficient_len || cur + matches[match_num - 1].len >= ZSTD_OPT_NUM)) {
596 last_pos = cur + 1;
600 /* set prices using matches at position = cur */
606 if (opt[cur].mlen == 1) {
607 litlen = opt[cur].litlen;
608 if (cur > litlen)
609 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip + cur - litlen,
615 price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off - 1, mlen - MINMATCH, ultra);
618 if (cur + mlen > last_pos || (price < opt[cur + mlen].price))
619 SET_PRICE(cur + mlen, mlen, matches[u].off, litlen, price);
628 cur = last_pos - best_mlen;
631 _storeSequence: /* cur, last_pos, best_mlen, best_off have to be set */
635 mlen = opt[cur].mlen;
636 offset = opt[cur].off;
637 opt[cur].mlen = best_mlen;
638 opt[cur].off = best_off;
641 if (mlen > cur)
643 cur -= mlen;
650 for (cur = 0; cur < last_pos;) {
651 mlen = opt[cur].mlen;
654 cur++;
657 offset = opt[cur].off;
658 cur += mlen;
682 } /* for (cur=0; cur < last_pos; ) */
738 U32 cur, match_num, last_pos, litlen, price;
763 cur = 0;
797 cur = 0;
823 for (cur = 1; cur <= last_pos; cur++) {
824 inr = ip + cur;
826 if (opt[cur - 1].mlen == 1) {
827 litlen = opt[cur - 1].litlen + 1;
828 if (cur > litlen) {
829 price = opt[cur - litlen].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - litlen);
834 price = opt[cur - 1].price + ZSTD_getLiteralPrice(seqStorePtr, litlen, inr - 1);
837 if (cur > last_pos || price <= opt[cur].price)
838 SET_PRICE(cur, 1, 0, litlen, price);
840 if (cur == last_pos)
846 mlen = opt[cur].mlen;
847 if (opt[cur].off > ZSTD_REP_MOVE_OPT) {
848 opt[cur].rep[2] = opt[cur - mlen].rep[1];
849 opt[cur].rep[1] = opt[cur - mlen].rep[0];
850 opt[cur].rep[0] = opt[cur].off - ZSTD_REP_MOVE_OPT;
852 opt[cur].rep[2] = (opt[cur].off > 1) ? opt[cur - mlen].rep[1] : opt[cur - mlen].rep[2];
853 opt[cur].rep[1] = (opt[cur].off > 0) ? opt[cur - mlen].rep[0] : opt[cur - mlen].rep[1];
854 opt[cur].rep[0] =
855 ((opt[cur].off == ZSTD_REP_MOVE_OPT) && (mlen != 1)) ? (opt[cur - mlen].rep[0] - 1) : (opt[cur - mlen].rep[opt[cur].off]);
862 const S32 repCur = (i == ZSTD_REP_MOVE_OPT) ? (opt[cur].rep[0] - 1) : opt[cur].rep[i];
863 const U32 repIndex = (U32)(curr + cur - repCur);
866 if ((repCur > 0 && repCur <= (S32)(curr + cur)) &&
873 if (mlen > sufficient_len || cur + mlen >= ZSTD_OPT_NUM) {
876 last_pos = cur + 1;
880 best_off = i - (opt[cur].mlen != 1);
885 if (opt[cur].mlen == 1) {
886 litlen = opt[cur].litlen;
887 if (cur > litlen) {
888 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, inr - litlen,
894 price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, best_off, mlen - MINMATCH, ultra);
897 if (cur + mlen > last_pos || price <= opt[cur + mlen].price)
898 SET_PRICE(cur + mlen, mlen, i, litlen, price);
907 if (match_num > 0 && (matches[match_num - 1].len > sufficient_len || cur + matches[match_num - 1].len >= ZSTD_OPT_NUM)) {
910 last_pos = cur + 1;
914 /* set prices using matches at position = cur */
920 if (opt[cur].mlen == 1) {
921 litlen = opt[cur].litlen;
922 if (cur > litlen)
923 price = opt[cur - litlen].price + ZSTD_getPrice(seqStorePtr, litlen, ip + cur - litlen,
929 price = opt[cur].price + ZSTD_getPrice(seqStorePtr, 0, NULL, matches[u].off - 1, mlen - MINMATCH, ultra);
932 if (cur + mlen > last_pos || (price < opt[cur + mlen].price))
933 SET_PRICE(cur + mlen, mlen, matches[u].off, litlen, price);
938 } /* for (cur = 1; cur <= last_pos; cur++) */
942 cur = last_pos - best_mlen;
945 _storeSequence: /* cur, last_pos, best_mlen, best_off have to be set */
949 mlen = opt[cur].mlen;
950 offset = opt[cur].off;
951 opt[cur].mlen = best_mlen;
952 opt[cur].off = best_off;
955 if (mlen > cur)
957 cur -= mlen;
964 for (cur = 0; cur < last_pos;) {
965 mlen = opt[cur].mlen;
968 cur++;
971 offset = opt[cur].off;
972 cur += mlen;
997 } /* for (cur=0; cur < last_pos; ) */