Home | History | Annotate | Download | only in src

Lines Matching refs:lookahead

338     if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
364 while (s->lookahead >= MIN_MATCH) {
366 n = s->lookahead - (MIN_MATCH-1);
376 s->lookahead = MIN_MATCH-1;
379 s->strstart += s->lookahead;
381 s->insert = s->lookahead;
382 s->lookahead = 0;
899 if (strm->avail_in != 0 || s->lookahead != 0 ||
933 if (s->lookahead == 0) {
1122 s->lookahead = 0;
1142 * OUT assertion: the match length is not greater than s->lookahead.
1191 if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
1193 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
1201 * for insufficient lookahead only occur occasionally for performance
1204 * However the length of the match is limited to the lookahead, so
1218 * lookahead only every 4th comparison; the 128th check will be made
1221 * to check more often for insufficient lookahead.
1256 /* We check for insufficient lookahead only every 8th comparison;
1287 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
1288 return s->lookahead;
1311 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
1330 /* We check for insufficient lookahead only every 8th comparison;
1347 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1381 lookahead becomes insufficient.
1382 * Updates strstart and lookahead.
1384 * IN assertion: lookahead < MIN_LOOKAHEAD
1398 Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
1401 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
1405 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
1410 * strstart == 0 && lookahead == 1 (input done a byte at time)
1416 /* If the window is almost full and there is insufficient lookahead,
1455 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
1456 * more == window_size - lookahead - strstart
1461 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
1467 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
1468 s->lookahead += n;
1471 if (s->lookahead + s->insert >= MIN_MATCH) {
1486 if (s->lookahead + s->insert < MIN_MATCH)
1494 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
1501 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
1504 ulg curr = s->strstart + (ulg)(s->lookahead);
1581 if (s->lookahead <= 1) {
1587 if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
1589 if (s->lookahead == 0) break; /* flush the current block */
1593 s->strstart += s->lookahead;
1594 s->lookahead = 0;
1600 s->lookahead = (uInt)(s->strstart - max_start);
1636 /* Make sure that we always have enough lookahead, except
1641 if (s->lookahead < MIN_LOOKAHEAD) {
1643 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1646 if (s->lookahead == 0) break; /* flush the current block */
1653 if (s->lookahead >= MIN_MATCH) {
1674 s->lookahead -= s->match_length;
1681 s->lookahead >= MIN_MATCH) {
1701 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
1709 s->lookahead--;
1739 /* Make sure that we always have enough lookahead, except
1744 if (s->lookahead < MIN_LOOKAHEAD) {
1746 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1749 if (s->lookahead == 0) break; /* flush the current block */
1756 if (s->lookahead >= MIN_MATCH) {
1791 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
1801 * enough lookahead, the last two strings are not inserted in
1804 s->lookahead -= s->prev_length-1;
1828 s->lookahead--;
1836 s->lookahead--;
1870 /* Make sure that we always have enough lookahead, except
1874 if (s->lookahead <= MAX_MATCH) {
1876 if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
1879 if (s->lookahead == 0) break; /* flush the current block */
1884 if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
1896 if (s->match_length > s->lookahead)
1897 s->match_length = s->lookahead;
1908 s->lookahead -= s->match_length;
1915 s->lookahead--;
1942 if (s->lookahead == 0) {
1944 if (s->lookahead == 0) {
1955 s->lookahead--;