Lines Matching refs:lookahead
240 * Fill the window when the lookahead becomes insufficient.
241 * Updates strstart and lookahead.
243 * IN assertion: lookahead < MIN_LOOKAHEAD
254 Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
257 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
261 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
266 * strstart == 0 && lookahead == 1 (input done a byte at time)
272 /* If the window is almost full and there is insufficient lookahead,
289 * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
290 * more == window_size - lookahead - strstart
295 * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
301 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
302 s->lookahead += n;
307 if (s->lookahead + s->insert > MIN_MATCH) {
313 if (s->lookahead + s->insert <= MIN_MATCH)
319 if (s->lookahead + s->insert >= MIN_MATCH) {
334 if (s->lookahead + s->insert < MIN_MATCH)
342 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
349 * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
352 ulg curr = s->strstart + (ulg)(s->lookahead);
604 if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
630 while (s->lookahead >= MIN_MATCH) {
632 n = s->lookahead - (MIN_MATCH-1);
638 s->lookahead = MIN_MATCH-1;
641 s->strstart += s->lookahead;
643 s->insert = s->lookahead;
644 s->lookahead = 0;
662 len = s->strstart + s->lookahead;
666 zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len);
725 s->lookahead = 0;
813 if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
1216 if (strm->avail_in != 0 || s->lookahead != 0 ||
1251 if (s->lookahead == 0) {
1393 * OUT assertion: the match length is not greater than s->lookahead.
1435 if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
1438 "need lookahead");
1446 * for insufficient lookahead only occur occasionally for performance
1449 * However the length of the match is limited to the lookahead, so
1463 * lookahead only every 4th comparison; the 128th check will be made
1466 * to check more often for insufficient lookahead.
1520 /* We check for insufficient lookahead only every 8th comparison;
1552 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
1553 return s->lookahead;
1573 "need lookahead");
1592 /* We check for insufficient lookahead only every 8th comparison;
1609 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1873 /* Make sure that we always have enough lookahead, except
1878 if (s->lookahead < MIN_LOOKAHEAD) {
1880 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1883 if (s->lookahead == 0) break; /* flush the current block */
1890 if (s->lookahead >= MIN_MATCH) {
1911 s->lookahead -= s->match_length;
1918 s->lookahead >= MIN_MATCH) {
1940 /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
1949 s->lookahead--;
1976 /* Make sure that we always have enough lookahead, except
1981 if (s->lookahead < MIN_LOOKAHEAD) {
1983 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1986 if (s->lookahead == 0) break; /* flush the current block */
1993 if (s->lookahead >= MIN_MATCH) {
2028 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
2044 * enough lookahead, the last two strings are not inserted in
2047 s->lookahead -= s->prev_length - 1;
2071 s->lookahead--;
2079 s->lookahead--;
2110 /* Make sure that we always have enough lookahead, except
2114 if (s->lookahead <= MAX_MATCH) {
2116 if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
2119 if (s->lookahead == 0) break; /* flush the current block */
2124 if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
2136 if (s->match_length > s->lookahead)
2137 s->match_length = s->lookahead;
2149 s->lookahead -= s->match_length;
2156 s->lookahead--;
2180 if (s->lookahead == 0) {
2182 if (s->lookahead == 0) {
2193 s->lookahead--;