Lines Matching refs:lookahead
244 * Fill the window when the lookahead becomes insufficient.
245 * Updates strstart and lookahead.
247 * IN assertion: lookahead < MIN_LOOKAHEAD
258 Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
261 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
265 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
270 * strstart == 0 && lookahead == 1 (input done a byte at time)
276 /* If the window is almost full and there is insufficient lookahead,
293 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
294 * more == window_size - lookahead - strstart
299 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
305 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
306 s->lookahead += n;
309 if (s->lookahead + s->insert >= MIN_MATCH) {
324 if (s->lookahead + s->insert < MIN_MATCH)
332 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
339 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
342 ulg curr = s->strstart + (ulg)(s->lookahead);
564 if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
590 while (s->lookahead >= MIN_MATCH) {
592 n = s->lookahead - (MIN_MATCH-1);
602 s->lookahead = MIN_MATCH-1;
605 s->strstart += s->lookahead;
607 s->insert = s->lookahead;
608 s->lookahead = 0;
626 len = s->strstart + s->lookahead;
630 zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len);
689 s->lookahead = 0;
777 if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
1180 if (strm->avail_in != 0 || s->lookahead != 0 ||
1215 if (s->lookahead == 0) {
1348 * OUT assertion: the match length is not greater than s->lookahead.
1390 if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
1393 "need lookahead");
1401 * for insufficient lookahead only occur occasionally for performance
1404 * However the length of the match is limited to the lookahead, so
1418 * lookahead only every 4th comparison; the 128th check will be made
1421 * to check more often for insufficient lookahead.
1457 /* We check for insufficient lookahead only every 8th comparison;
1489 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
1490 return s->lookahead;
1510 "need lookahead");
1529 /* We check for insufficient lookahead only every 8th comparison;
1546 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1818 /* Make sure that we always have enough lookahead, except
1823 if (s->lookahead < MIN_LOOKAHEAD) {
1825 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1828 if (s->lookahead == 0) break; /* flush the current block */
1835 if (s->lookahead >= MIN_MATCH) {
1856 s->lookahead -= s->match_length;
1863 s->lookahead >= MIN_MATCH) {
1883 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
1891 s->lookahead--;
1918 /* Make sure that we always have enough lookahead, except
1923 if (s->lookahead < MIN_LOOKAHEAD) {
1925 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1928 if (s->lookahead == 0) break; /* flush the current block */
1935 if (s->lookahead >= MIN_MATCH) {
1970 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
1980 * enough lookahead, the last two strings are not inserted in
1983 s->lookahead -= s->prev_length - 1;
2007 s->lookahead--;
2015 s->lookahead--;
2046 /* Make sure that we always have enough lookahead, except
2050 if (s->lookahead <= MAX_MATCH) {
2052 if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
2055 if (s->lookahead == 0) break; /* flush the current block */
2060 if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
2072 if (s->match_length > s->lookahead)
2073 s->match_length = s->lookahead;
2085 s->lookahead -= s->match_length;
2092 s->lookahead--;
2116 if (s->lookahead == 0) {
2118 if (s->lookahead == 0) {
2129 s->lookahead--;