Lines Matching refs:opt
33 # define WEIGHT(stat, opt) ((void)(opt), ZSTD_bitWeight(stat))
37 # define WEIGHT(stat,opt) ((void)(opt), ZSTD_fracWeight(stat)) argument
41 # define WEIGHT(stat,opt) ((opt) ? ZSTD_fracWeight(stat) : ZSTD_bitWeight(stat)) argument
1085 optState_t* const optStatePtr = &ms->opt; in ZSTD_compressBlock_opt_generic()
1101 ZSTD_optimal_t* const opt = optStatePtr->priceTable; in ZSTD_compressBlock_opt_generic() local
1144 opt[0].mlen = 0; /* there are only literals so far */ in ZSTD_compressBlock_opt_generic()
1145 opt[0].litlen = litlen; in ZSTD_compressBlock_opt_generic()
1151 opt[0].price = LL_PRICE(litlen); in ZSTD_compressBlock_opt_generic()
1152 ZSTD_STATIC_ASSERT(sizeof(opt[0].rep[0]) == sizeof(rep[0])); in ZSTD_compressBlock_opt_generic()
1153 ZSTD_memcpy(&opt[0].rep, rep, sizeof(opt[0].rep)); in ZSTD_compressBlock_opt_generic()
1173 assert(opt[0].price >= 0); in ZSTD_compressBlock_opt_generic()
1177 opt[pos].price = ZSTD_MAX_PRICE; in ZSTD_compressBlock_opt_generic()
1178 opt[pos].mlen = 0; in ZSTD_compressBlock_opt_generic()
1179 opt[pos].litlen = litlen + pos; in ZSTD_compressBlock_opt_generic()
1186 int const sequencePrice = opt[0].price + matchPrice; in ZSTD_compressBlock_opt_generic()
1189 opt[pos].mlen = pos; in ZSTD_compressBlock_opt_generic()
1190 opt[pos].off = offBase; in ZSTD_compressBlock_opt_generic()
1191 opt[pos].litlen = 0; /* end of match */ in ZSTD_compressBlock_opt_generic()
1192 opt[pos].price = sequencePrice + LL_PRICE(0); in ZSTD_compressBlock_opt_generic()
1196 opt[pos].price = ZSTD_MAX_PRICE; in ZSTD_compressBlock_opt_generic()
1207 { U32 const litlen = opt[cur-1].litlen + 1; in ZSTD_compressBlock_opt_generic()
1208 int const price = opt[cur-1].price in ZSTD_compressBlock_opt_generic()
1212 if (price <= opt[cur].price) { in ZSTD_compressBlock_opt_generic()
1213 ZSTD_optimal_t const prevMatch = opt[cur]; in ZSTD_compressBlock_opt_generic()
1215 … (int)(inr-istart), cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price), litlen, in ZSTD_compressBlock_opt_generic()
1216 opt[cur-1].rep[0], opt[cur-1].rep[1], opt[cur-1].rep[2]); in ZSTD_compressBlock_opt_generic()
1217 opt[cur] = opt[cur-1]; in ZSTD_compressBlock_opt_generic()
1218 opt[cur].litlen = litlen; in ZSTD_compressBlock_opt_generic()
1219 opt[cur].price = price; in ZSTD_compressBlock_opt_generic()
1231 && (with1literal < opt[cur+1].price) ) { in ZSTD_compressBlock_opt_generic()
1234 … Repcodes_t const newReps = ZSTD_newRep(opt[prev].rep, prevMatch.off, opt[prev].litlen==0); in ZSTD_compressBlock_opt_generic()
1239 opt[cur+1] = prevMatch; /* mlen & offbase */ in ZSTD_compressBlock_opt_generic()
1240 ZSTD_memcpy(opt[cur+1].rep, &newReps, sizeof(Repcodes_t)); in ZSTD_compressBlock_opt_generic()
1241 opt[cur+1].litlen = 1; in ZSTD_compressBlock_opt_generic()
1242 opt[cur+1].price = with1literal; in ZSTD_compressBlock_opt_generic()
1248 … (int)(inr-istart), cur, ZSTD_fCost(price), ZSTD_fCost(opt[cur].price)); in ZSTD_compressBlock_opt_generic()
1255 ZSTD_STATIC_ASSERT(sizeof(opt[cur].rep) == sizeof(Repcodes_t)); in ZSTD_compressBlock_opt_generic()
1256 assert(cur >= opt[cur].mlen); in ZSTD_compressBlock_opt_generic()
1257 if (opt[cur].litlen == 0) { in ZSTD_compressBlock_opt_generic()
1259 U32 const prev = cur - opt[cur].mlen; in ZSTD_compressBlock_opt_generic()
1260 … Repcodes_t const newReps = ZSTD_newRep(opt[prev].rep, opt[cur].off, opt[prev].litlen==0); in ZSTD_compressBlock_opt_generic()
1261 ZSTD_memcpy(opt[cur].rep, &newReps, sizeof(Repcodes_t)); in ZSTD_compressBlock_opt_generic()
1270 && (opt[cur+1].price <= opt[cur].price + (BITCOST_MULTIPLIER/2)) ) { in ZSTD_compressBlock_opt_generic()
1275 assert(opt[cur].price >= 0); in ZSTD_compressBlock_opt_generic()
1276 { U32 const ll0 = (opt[cur].litlen == 0); in ZSTD_compressBlock_opt_generic()
1277 int const previousPrice = opt[cur].price; in ZSTD_compressBlock_opt_generic()
1279 …U32 nbMatches = getAllMatches(matches, ms, &nextToUpdate3, inr, iend, opt[cur].rep, ll0, minMatch); in ZSTD_compressBlock_opt_generic()
1313 matchNb, matches[matchNb].off, lastML, opt[cur].litlen); in ZSTD_compressBlock_opt_generic()
1319 if ((pos > last_pos) || (price < opt[pos].price)) { in ZSTD_compressBlock_opt_generic()
1321 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price)); in ZSTD_compressBlock_opt_generic()
1325 opt[last_pos].price = ZSTD_MAX_PRICE; in ZSTD_compressBlock_opt_generic()
1326 … opt[last_pos].litlen = !0; /* just needs to be != 0, to mean "not an end of match" */ in ZSTD_compressBlock_opt_generic()
1328 opt[pos].mlen = mlen; in ZSTD_compressBlock_opt_generic()
1329 opt[pos].off = offset; in ZSTD_compressBlock_opt_generic()
1330 opt[pos].litlen = 0; in ZSTD_compressBlock_opt_generic()
1331 opt[pos].price = price; in ZSTD_compressBlock_opt_generic()
1334 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[pos].price)); in ZSTD_compressBlock_opt_generic()
1338 opt[last_pos+1].price = ZSTD_MAX_PRICE; in ZSTD_compressBlock_opt_generic()
1341 lastStretch = opt[last_pos]; in ZSTD_compressBlock_opt_generic()
1346 assert(opt[0].mlen == 0); in ZSTD_compressBlock_opt_generic()
1361 Repcodes_t const reps = ZSTD_newRep(opt[cur].rep, lastStretch.off, opt[cur].litlen==0); in ZSTD_compressBlock_opt_generic()
1388 opt[storeEnd].litlen = lastStretch.litlen; in ZSTD_compressBlock_opt_generic()
1389 opt[storeEnd].mlen = 0; in ZSTD_compressBlock_opt_generic()
1391 opt[storeStart] = lastStretch; in ZSTD_compressBlock_opt_generic()
1393 opt[storeEnd] = lastStretch; /* note: litlen will be fixed */ in ZSTD_compressBlock_opt_generic()
1397 ZSTD_optimal_t nextStretch = opt[stretchPos]; in ZSTD_compressBlock_opt_generic()
1398 opt[storeStart].litlen = nextStretch.litlen; in ZSTD_compressBlock_opt_generic()
1400 opt[storeStart].litlen, opt[storeStart].mlen, opt[storeStart].off); in ZSTD_compressBlock_opt_generic()
1406 opt[storeStart] = nextStretch; /* note: litlen will be fixed */ in ZSTD_compressBlock_opt_generic()
1415 U32 const llen = opt[storePos].litlen; in ZSTD_compressBlock_opt_generic()
1416 U32 const mlen = opt[storePos].mlen; in ZSTD_compressBlock_opt_generic()
1417 U32 const offBase = opt[storePos].off; in ZSTD_compressBlock_opt_generic()
1494 assert(ms->opt.litLengthSum == 0); /* first block */ in ZSTD_initStats_ultra()
1534 if ( (ms->opt.litLengthSum==0) /* first block */ in ZSTD_compressBlock_btultra2()