Lines Matching refs:match
826 * Index of match position registered in hash table.
989 const BYTE* match;
993 /* Find a match */
1007 match = LZ4_getPositionOnHash(h, cctx->hashTable, tableType, base);
1011 } while ( (match+LZ4_DISTANCE_MAX < ip)
1012 || (LZ4_read32(match) != LZ4_read32(ip)) );
1034 /* there was no match, try the dictionary */
1037 match = dictBase + matchIndex;
1041 match = base + matchIndex;
1049 match = dictBase + matchIndex;
1052 match = base + matchIndex;
1056 match = base + matchIndex;
1062 if ((dictIssue == dictSmall) && (matchIndex < prefixIdxLimit)) { continue; } /* match outside of valid area */
1068 assert((current - matchIndex) <= LZ4_DISTANCE_MAX); /* match now expected within distance */
1070 if (LZ4_read32(match) == LZ4_read32(ip)) {
1072 break; /* match found */
1080 while (((ip>anchor) & (match > lowLimit)) && (unlikely(ip[-1]==match[-1]))) { ip--; match--; }
1090 (unlikely(op + (litLength+240)/255 /* litlen */ + litLength /* literals */ + 2 /* offset */ + 1 /* token */ + MFLIMIT - MINMATCH /* min last literals so last match is <= end - MFLIMIT */ > olimit))) {
1105 DEBUGLOG(6, "seq.start:%i, literals=%u, match.start:%i",
1112 * - match : at start of previous pattern occurrence; can be within current prefix, or within extDict
1114 * - lowLimit : must be == dictionary to mean "match is within extDict"; must be == source otherwise
1115 * - token and *token : position to write 4-bits for match length; higher 4-bits for literal length supposed already written
1119 (op + 2 /* offset */ + 1 /* token */ + MFLIMIT - MINMATCH /* min last literals so last match is <= end - MFLIMIT */ > olimit)) {
1120 /* the match was too close to the end, rewind and go to last literals */
1131 DEBUGLOG(6, " with offset=%u (same segment)", (U32)(ip - match));
1132 assert(ip-match <= LZ4_DISTANCE_MAX);
1133 LZ4_writeLE16(op, (U16)(ip - match)); op+=2;
1140 && (lowLimit==dictionary) /* match within extDict */ ) {
1141 const BYTE* limit = ip + (dictEnd-match);
1142 assert(dictEnd > match);
1144 matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, limit);
1153 matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, matchlimit);
1212 match = LZ4_getPosition(ip, cctx->hashTable, tableType, base);
1214 if ( (match+LZ4_DISTANCE_MAX >= ip)
1215 && (LZ4_read32(match) == LZ4_read32(ip)) )
1226 /* there was no match, try the dictionary */
1228 match = dictBase + matchIndex;
1229 lowLimit = dictionary; /* required for match length counter */
1232 match = base + matchIndex;
1233 lowLimit = (const BYTE*)source; /* required for match length counter */
1238 match = dictBase + matchIndex;
1239 lowLimit = dictionary; /* required for match length counter */
1241 match = base + matchIndex;
1242 lowLimit = (const BYTE*)source; /* required for match length counter */
1245 match = base + matchIndex;
1251 && (LZ4_read32(match) == LZ4_read32(ip)) ) {
1255 DEBUGLOG(6, "seq.start:%i, literals=%u, match.start:%i",
1831 * last match must start at least MFLIMIT==12 bytes before end of output block */
1835 /* match */
1848 { const BYTE* match = op - offset;
1863 /* match entirely within extDict */
1868 /* match split between extDict & prefix */
1873 match = prefixStart;
1876 /* match copy - slow variant, supporting overlap copy */
1879 op[u] = match[u];
1883 DEBUGLOG(5, "invalid: match ends at distance %zi from end of block", oend-op);
1885 * last match must stop at least LASTLITERALS==5 bytes before end of output block */
1888 } /* match */
1894 /* Read the variable-length literal or match length.
1968 const BYTE* match;
2029 match = op - offset;
2030 assert(match <= op); /* overflow check */
2041 if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) { goto _output_error; } /* Error : offset outside buffers */
2052 if ((dict == withPrefix64k) || (match >= lowPrefix)) {
2054 assert(match >= lowPrefix);
2055 assert(match <= op);
2058 LZ4_memcpy(op, match, 8);
2059 LZ4_memcpy(op+8, match+8, 8);
2060 LZ4_memcpy(op+16, match+16, 2);
2065 if (checkOffset && (unlikely(match + dictSize < lowPrefix))) { goto _output_error; } /* Error : offset outside buffers */
2066 /* match starting within external dictionary */
2067 if ((dict==usingExtDict) && (match < lowPrefix)) {
2071 DEBUGLOG(7, "partialDecoding: dictionary match, close to dstEnd");
2077 if (length <= (size_t)(lowPrefix-match)) {
2078 /* match fits entirely within external dictionary : just copy */
2079 LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
2082 /* match stretches into both external dictionary and current block */
2083 size_t const copySize = (size_t)(lowPrefix - match);
2098 /* copy match within block */
2103 LZ4_memcpy_using_offset(op, match, cpy, offset);
2105 LZ4_wildCopy32(op, match, cpy);
2123 * 2) Further if the match length is 4..18, copy 18 bytes in a similar
2135 /* The second stage: prepare for match copying, decode full info.
2137 length = token & ML_MASK; /* match length */
2139 match = op - offset;
2140 assert(match <= op); /* check overflow */
2145 && (dict==withPrefix64k || match >= lowPrefix) ) {
2146 /* Copy the match. */
2147 LZ4_memcpy(op + 0, match + 0, 8);
2148 LZ4_memcpy(op + 8, match + 8, 8);
2149 LZ4_memcpy(op +16, match +16, 2);
2156 * Propel it right to the point of match copying. */
2221 * can't proceed with reading an offset for following match.
2233 match = op - offset;
2250 if ((checkOffset) && (unlikely(match + dictSize < lowPrefix))) goto _output_error; /* Error : offset outside buffers */
2251 /* match starting within external dictionary */
2252 if ((dict==usingExtDict) && (match < lowPrefix)) {
2259 if (length <= (size_t)(lowPrefix-match)) {
2260 /* match fits entirely within external dictionary : just copy */
2261 LZ4_memmove(op, dictEnd - (lowPrefix-match), length);
2264 /* match stretches into both external dictionary and current block */
2265 size_t const copySize = (size_t)(lowPrefix - match);
2279 assert(match >= lowPrefix);
2281 /* copy match within block */
2288 const BYTE* const matchEnd = match + mlen;
2291 while (op < copyEnd) { *op++ = *match++; }
2293 LZ4_memcpy(op, match, mlen);
2302 op[0] = match[0];
2303 op[1] = match[1];
2304 op[2] = match[2];
2305 op[3] = match[3];
2306 match += inc32table[offset];
2307 LZ4_memcpy(op+4, match, 4);
2308 match -= dec64table[offset];
2310 LZ4_memcpy(op, match, 8);
2311 match += 8;
2319 LZ4_wildCopy8(op, match, oCopyLimit);
2320 match += oCopyLimit - op;
2323 while (op < cpy) { *op++ = *match++; }
2325 LZ4_memcpy(op, match, 8);
2326 if (length > 16) { LZ4_wildCopy8(op+8, match+8, cpy); }