Lines Matching defs:cur
1078 U32 cur, last_pos = 0;
1111 cur = 0;
1142 for (cur = 1; cur <= last_pos; cur++) {
1143 const BYTE* const inr = ip + cur;
1144 assert(cur < ZSTD_OPT_NUM);
1145 DEBUGLOG(7, "cPos:%zi==rPos:%u", inr-istart, cur)
1148 { U32 const litlen = (opt[cur-1].mlen == 0) ? opt[cur-1].litlen + 1 : 1;
1149 int const price = opt[cur-1].price
1150 + (int)ZSTD_rawLiteralsCost(ip+cur-1, 1, optStatePtr, optLevel)
1154 if (price <= opt[cur].price) {
1156 inr-istart, cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price), litlen,
1157 opt[cur-1].rep[0], opt[cur-1].rep[1], opt[cur-1].rep[2]);
1158 opt[cur].mlen = 0;
1159 opt[cur].off = 0;
1160 opt[cur].litlen = litlen;
1161 opt[cur].price = price;
1164 inr-istart, cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price),
1165 opt[cur].rep[0], opt[cur].rep[1], opt[cur].rep[2]);
1174 ZSTD_STATIC_ASSERT(sizeof(opt[cur].rep) == sizeof(repcodes_t));
1175 assert(cur >= opt[cur].mlen);
1176 if (opt[cur].mlen != 0) {
1177 U32 const prev = cur - opt[cur].mlen;
1178 repcodes_t const newReps = ZSTD_newRep(opt[prev].rep, opt[cur].off, opt[cur].litlen==0);
1179 ZSTD_memcpy(opt[cur].rep, &newReps, sizeof(repcodes_t));
1181 ZSTD_memcpy(opt[cur].rep, opt[cur - 1].rep, sizeof(repcodes_t));
1187 if (cur == last_pos) break;
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);
1196 { U32 const ll0 = (opt[cur].mlen != 0);
1197 U32 const litlen = (opt[cur].mlen == 0) ? opt[cur].litlen : 0;
1198 U32 const previousPrice = (U32)opt[cur].price;
1200 U32 nbMatches = getAllMatches(matches, ms, &nextToUpdate3, inr, iend, opt[cur].rep, ll0, minMatch);
1207 DEBUGLOG(7, "rPos:%u : no match found", cur);
1213 inr-istart, cur, nbMatches, maxML);
1216 || (cur + maxML >= ZSTD_OPT_NUM) ) {
1220 cur -= (opt[cur].mlen==0) ? opt[cur].litlen : 0; /* last sequence is actually only literals, fix cur to last match - note : may underflow, in which case, it's first sequence, and it's okay */
1221 last_pos = cur + ZSTD_totalLen(lastSequence);
1222 if (cur > ZSTD_OPT_NUM) cur = 0; /* underflow => first match */
1226 /* set prices using matches found at position == cur */
1237 U32 const pos = cur + mlen;
1254 } /* for (cur = 1; cur <= last_pos; cur++) */
1257 cur = last_pos > ZSTD_totalLen(lastSequence) ? last_pos - ZSTD_totalLen(lastSequence) : 0; /* single sequence, and it starts before `ip` */
1258 assert(cur < ZSTD_OPT_NUM); /* control overflow*/
1260 _shortestPath: /* cur, last_pos, best_mlen, best_off have to be set */
1268 repcodes_t const reps = ZSTD_newRep(opt[cur].rep, lastSequence.off, lastSequence.litlen==0);
1271 ZSTD_memcpy(rep, opt[cur].rep, sizeof(repcodes_t));
1274 { U32 const storeEnd = cur + 1;
1276 U32 seqPos = cur;
1278 DEBUGLOG(6, "start reverse traversal (last_pos:%u, cur:%u)",
1279 last_pos, cur); (void)last_pos;