Lines Matching refs:lookahead
244 * Fill the window when the lookahead becomes insufficient.
245 * Updates strstart and lookahead.
247 * IN assertion: lookahead < MIN_LOOKAHEAD
259 Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
262 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
266 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
271 * strstart == 0 && lookahead == 1 (input done a byte at time)
277 /* If the window is almost full and there is insufficient lookahead,
294 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
295 * more == window_size - lookahead - strstart
300 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
306 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
307 s->lookahead += n;
310 if (s->lookahead + s->insert >= MIN_MATCH) {
325 if (s->lookahead + s->insert < MIN_MATCH)
333 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
340 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
343 ulg curr = s->strstart + (ulg)(s->lookahead);
566 if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
592 while (s->lookahead >= MIN_MATCH) {
594 n = s->lookahead - (MIN_MATCH-1);
604 s->lookahead = MIN_MATCH-1;
607 s->strstart += s->lookahead;
609 s->insert = s->lookahead;
610 s->lookahead = 0;
628 len = s->strstart + s->lookahead;
632 zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len);
692 s->lookahead = 0;
780 if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
1186 if (strm->avail_in != 0 || s->lookahead != 0 ||
1221 if (s->lookahead == 0) {
1354 * OUT assertion: the match length is not greater than s->lookahead.
1397 if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
1400 "need lookahead");
1408 * for insufficient lookahead only occur occasionally for performance
1411 * However the length of the match is limited to the lookahead, so
1425 * lookahead only every 4th comparison; the 128th check will be made
1428 * to check more often for insufficient lookahead.
1464 /* We check for insufficient lookahead only every 8th comparison;
1496 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
1497 return s->lookahead;
1518 "need lookahead");
1537 /* We check for insufficient lookahead only every 8th comparison;
1554 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1829 /* Make sure that we always have enough lookahead, except
1834 if (s->lookahead < MIN_LOOKAHEAD) {
1836 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1839 if (s->lookahead == 0) break; /* flush the current block */
1846 if (s->lookahead >= MIN_MATCH) {
1867 s->lookahead -= s->match_length;
1874 s->lookahead >= MIN_MATCH) {
1894 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
1902 s->lookahead--;
1930 /* Make sure that we always have enough lookahead, except
1935 if (s->lookahead < MIN_LOOKAHEAD) {
1937 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1940 if (s->lookahead == 0) break; /* flush the current block */
1947 if (s->lookahead >= MIN_MATCH) {
1982 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
1992 * enough lookahead, the last two strings are not inserted in
1995 s->lookahead -= s->prev_length - 1;
2019 s->lookahead--;
2027 s->lookahead--;
2059 /* Make sure that we always have enough lookahead, except
2063 if (s->lookahead <= MAX_MATCH) {
2065 if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
2068 if (s->lookahead == 0) break; /* flush the current block */
2073 if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
2085 if (s->match_length > s->lookahead)
2086 s->match_length = s->lookahead;
2098 s->lookahead -= s->match_length;
2105 s->lookahead--;
2130 if (s->lookahead == 0) {
2132 if (s->lookahead == 0) {
2143 s->lookahead--;