Lines Matching refs:opts

23     private final Optimum[] opts = new Optimum[OPTS];
53 opts[i] = new Optimum();
63 * Converts the opts array from backward indexes to forward indexes.
70 int optPrev = opts[optCur].optPrev;
73 Optimum opt = opts[optCur];
76 opts[optPrev].optPrev = optCur;
77 opts[optPrev].backPrev = -1;
81 opts[optPrev].optPrev = optPrev + 1;
82 opts[optPrev].backPrev = opt.backPrev2;
88 int temp = opts[optPrev].optPrev;
89 opts[optPrev].optPrev = optCur;
94 optCur = opts[0].optPrev;
95 back = opts[optCur].backPrev;
103 int len = opts[optCur].optPrev - optCur;
104 optCur = opts[optCur].optPrev;
105 back = opts[optCur].backPrev;
181 opts[1].set1(literalPrice, 0, -1);
192 if (shortRepPrice < opts[1].price)
193 opts[1].set1(shortRepPrice, 0, 0);
201 back = opts[1].backPrev;
211 // Initialize the state and reps of this position in opts[].
214 opts[0].state.set(state);
215 System.arraycopy(reps, 0, opts[0].reps, 0, REPS);
217 // Initialize the prices for latter opts that will be used below.
219 opts[i].reset();
232 if (price < opts[repLen].price)
233 opts[repLen].set1(price, 0, rep);
254 if (price < opts[len].price)
255 opts[len].set1(price, 0, dist + REPS);
283 anyMatchPrice = opts[optCur].price
284 + getAnyMatchPrice(opts[optCur].state, posState);
285 anyRepPrice = getAnyRepPrice(anyMatchPrice, opts[optCur].state);
302 * Updates the state and reps for the current byte in the opts array.
305 int optPrev = opts[optCur].optPrev;
308 if (opts[optCur].prev1IsLiteral) {
311 if (opts[optCur].hasPrev2) {
312 opts[optCur].state.set(opts[opts[optCur].optPrev2].state);
313 if (opts[optCur].backPrev2 < REPS)
314 opts[optCur].state.updateLongRep();
316 opts[optCur].state.updateMatch();
318 opts[optCur].state.set(opts[optPrev].state);
321 opts[optCur].state.updateLiteral();
323 opts[optCur].state.set(opts[optPrev].state);
328 assert opts[optCur].backPrev == 0 || opts[optCur].backPrev == -1;
330 if (opts[optCur].backPrev == 0)
331 opts[optCur].state.updateShortRep();
333 opts[optCur].state.updateLiteral();
335 System.arraycopy(opts[optPrev].reps, 0,
336 opts[optCur].reps, 0, REPS);
339 if (opts[optCur].prev1IsLiteral && opts[optCur].hasPrev2) {
340 optPrev = opts[optCur].optPrev2;
341 back = opts[optCur].backPrev2;
342 opts[optCur].state.updateLongRep();
344 back = opts[optCur].backPrev;
346 opts[optCur].state.updateLongRep();
348 opts[optCur].state.updateMatch();
352 opts[optCur].reps[0] = opts[optPrev].reps[back];
356 opts[optCur].reps[rep] = opts[optPrev].reps[rep - 1];
359 opts[optCur].reps[rep] = opts[optPrev].reps[rep];
361 opts[optCur].reps[0] = back - REPS;
362 System.arraycopy(opts[optPrev].reps, 0,
363 opts[optCur].reps, 1, REPS - 1);
377 int matchByte = lz.getByte(opts[optCur].reps[0] + 1);
380 int literalPrice = opts[optCur].price
382 pos, opts[optCur].state);
383 if (literalPrice < opts[optCur + 1].price) {
384 opts[optCur + 1].set1(literalPrice, optCur, -1);
389 if (matchByte == curByte && (opts[optCur + 1].optPrev == optCur
390 || opts[optCur + 1].backPrev != 0)) {
392 opts[optCur].state,
394 if (shortRepPrice <= opts[optCur + 1].price) {
395 opts[optCur + 1].set1(shortRepPrice, optCur, 0);
404 int len = lz.getMatchLen(1, opts[optCur].reps[0], lenLimit);
407 nextState.set(opts[optCur].state);
416 opts[++optEnd].reset();
418 if (price < opts[i].price)
419 opts[i].set2(price, optCur, 0);
433 int len = lz.getMatchLen(opts[optCur].reps[rep], lenLimit);
438 opts[++optEnd].reset();
441 opts[optCur].state, posState);
446 if (price < opts[optCur + i].price)
447 opts[optCur + i].set1(price, optCur, rep);
454 int len2 = lz.getMatchLen(len + 1, opts[optCur].reps[rep],
461 nextState.set(opts[optCur].state);
479 opts[++optEnd].reset();
481 if (price < opts[i].price)
482 opts[i].set3(price, optCur, rep, len, 0);
495 // the opts array, shorten the matches.
508 opts[++optEnd].reset();
511 opts[optCur].state);
524 if (matchAndLenPrice < opts[optCur + len].price)
525 opts[optCur + len].set1(matchAndLenPrice,
536 nextState.set(opts[optCur].state);
556 opts[++optEnd].reset();
558 if (price < opts[i].price)
559 opts[i].set3(price, optCur, dist + REPS, len, 0);