Lines Matching defs:opt

29 #  define WEIGHT(stat, opt) ((void)opt, ZSTD_bitWeight(stat))
33 # define WEIGHT(stat,opt) ((void)opt, ZSTD_fracWeight(stat))
34 #else /* opt==approx, ultra==accurate */
37 # define WEIGHT(stat,opt) (opt ? ZSTD_fracWeight(stat) : ZSTD_bitWeight(stat))
1044 optState_t* const optStatePtr = &ms->opt;
1060 ZSTD_optimal_t* const opt = optStatePtr->priceTable;
1088 /* initialize opt[0] */
1089 { U32 i ; for (i=0; i<ZSTD_REP_NUM; i++) opt[0].rep[i] = rep[i]; }
1090 opt[0].mlen = 0; /* means is_a_literal */
1091 opt[0].litlen = litlen;
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 */
1132 opt[pos].mlen = pos;
1133 opt[pos].off = offcode;
1134 opt[pos].litlen = litlen;
1135 opt[pos].price = (int)sequencePrice;
1148 { U32 const litlen = (opt[cur-1].mlen == 0) ? opt[cur-1].litlen + 1 : 1;
1149 int const price = opt[cur-1].price
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));
1190 && (opt[cur+1].price <= opt[cur].price + (BITCOST_MULTIPLIER/2)) ) {
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);
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 */
1240 if ((pos > last_pos) || (price < opt[pos].price)) {
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 */
1244 opt[pos].mlen = mlen;
1245 opt[pos].off = offset;
1246 opt[pos].litlen = litlen;
1247 opt[pos].price = price;
1250 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price));
1256 lastSequence = opt[last_pos];
1261 assert(opt[0].mlen == 0);
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));
1283 opt[storeEnd] = lastSequence;
1285 U32 const backDist = ZSTD_totalLen(opt[seqPos]);
1288 seqPos, storeStart, opt[seqPos].litlen, opt[seqPos].mlen, opt[seqPos].off);
1289 opt[storeStart] = opt[seqPos];
1297 U32 const llen = opt[storePos].litlen;
1298 U32 const mlen = opt[storePos].mlen;
1299 U32 const offCode = opt[storePos].off;
1364 assert(ms->opt.litLengthSum == 0); /* first block */
1369 ZSTD_compressBlock_opt2(ms, seqStore, tmpRep, src, srcSize, ZSTD_noDict); /* generate stats into ms->opt*/
1404 if ( (ms->opt.litLengthSum==0) /* first block */