Lines Matching refs:lookahead

337     if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
363 while (s->lookahead >= MIN_MATCH) {
365 n = s->lookahead - (MIN_MATCH-1);
375 s->lookahead = MIN_MATCH-1;
378 s->strstart += s->lookahead;
380 s->insert = s->lookahead;
381 s->lookahead = 0;
898 if (strm->avail_in != 0 || s->lookahead != 0 ||
932 if (s->lookahead == 0) {
1121 s->lookahead = 0;
1141 * OUT assertion: the match length is not greater than s->lookahead.
1190 if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
1192 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
1200 * for insufficient lookahead only occur occasionally for performance
1203 * However the length of the match is limited to the lookahead, so
1217 * lookahead only every 4th comparison; the 128th check will be made
1220 * to check more often for insufficient lookahead.
1255 /* We check for insufficient lookahead only every 8th comparison;
1286 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
1287 return s->lookahead;
1310 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
1329 /* We check for insufficient lookahead only every 8th comparison;
1346 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1380 * Fill the window when the lookahead becomes insufficient.
1381 * Updates strstart and lookahead.
1383 * IN assertion: lookahead < MIN_LOOKAHEAD
1397 Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
1400 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
1404 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
1409 * strstart == 0 && lookahead == 1 (input done a byte at time)
1415 /* If the window is almost full and there is insufficient lookahead,
1454 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
1455 * more == window_size - lookahead - strstart
1460 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
1466 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
1467 s->lookahead += n;
1470 if (s->lookahead + s->insert >= MIN_MATCH) {
1485 if (s->lookahead + s->insert < MIN_MATCH)
1493 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
1500 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
1503 ulg curr = s->strstart + (ulg)(s->lookahead);
1580 if (s->lookahead <= 1) {
1586 if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
1588 if (s->lookahead == 0) break; /* flush the current block */
1592 s->strstart += s->lookahead;
1593 s->lookahead = 0;
1599 s->lookahead = (uInt)(s->strstart - max_start);
1635 /* Make sure that we always have enough lookahead, except
1640 if (s->lookahead < MIN_LOOKAHEAD) {
1642 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1645 if (s->lookahead == 0) break; /* flush the current block */
1652 if (s->lookahead >= MIN_MATCH) {
1673 s->lookahead -= s->match_length;
1680 s->lookahead >= MIN_MATCH) {
1700 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
1708 s->lookahead--;
1738 /* Make sure that we always have enough lookahead, except
1743 if (s->lookahead < MIN_LOOKAHEAD) {
1745 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1748 if (s->lookahead == 0) break; /* flush the current block */
1755 if (s->lookahead >= MIN_MATCH) {
1790 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
1800 * enough lookahead, the last two strings are not inserted in
1803 s->lookahead -= s->prev_length-1;
1827 s->lookahead--;
1835 s->lookahead--;
1869 /* Make sure that we always have enough lookahead, except
1873 if (s->lookahead <= MAX_MATCH) {
1875 if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
1878 if (s->lookahead == 0) break; /* flush the current block */
1883 if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
1895 if (s->match_length > s->lookahead)
1896 s->match_length = s->lookahead;
1907 s->lookahead -= s->match_length;
1914 s->lookahead--;
1941 if (s->lookahead == 0) {
1943 if (s->lookahead == 0) {
1954 s->lookahead--;