Lines Matching refs:matchLength

98         size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger);   /* guaranteed minimum nb of common bytes */
105 || (matchIndex+matchLength >= dictLimit) /* both in current segment*/
108 || (matchIndex+matchLength >= dictLimit)) ?
110 assert( (matchIndex+matchLength >= dictLimit) /* might be wrong if extDict is incorrectly set to 0 */
113 matchLength += ZSTD_count(ip+matchLength, match+matchLength, iend);
116 matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart);
117 if (matchIndex+matchLength >= dictLimit)
118 match = base + matchIndex; /* preparation for next read of match[matchLength] */
122 curr, matchIndex, (U32)matchLength);
124 if (ip+matchLength == iend) { /* equal : no way to know if inf or sup */
128 if (match[matchLength] < ip[matchLength]) { /* necessarily within buffer */
131 commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
140 commonLengthLarger = matchLength;
190 size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
192 matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart);
193 if (dictMatchIndex+matchLength >= dictHighLimit)
194 match = base + dictMatchIndex + dictIndexDelta; /* to prepare for next usage of match[matchLength] */
196 if (matchLength > bestLength) {
198 if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(curr-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) ) {
200 curr, (U32)bestLength, (U32)matchLength, (U32)*offsetPtr, STORE_OFFSET(curr - matchIndex), dictMatchIndex, matchIndex);
201 bestLength = matchLength, *offsetPtr = STORE_OFFSET(curr - matchIndex);
203 if (ip+matchLength == iend) { /* reached end of input : ip[matchLength] is not valid, no way to know if it's larger or smaller than match */
208 if (match[matchLength] < ip[matchLength]) {
210 commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
215 commonLengthLarger = matchLength;
314 size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
317 if ((dictMode != ZSTD_extDict) || (matchIndex+matchLength >= dictLimit)) {
319 matchLength += ZSTD_count(ip+matchLength, match+matchLength, iend);
322 matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart);
323 if (matchIndex+matchLength >= dictLimit)
324 match = base + matchIndex; /* to prepare for next usage of match[matchLength] */
327 if (matchLength > bestLength) {
328 if (matchLength > matchEndIdx - matchIndex)
329 matchEndIdx = matchIndex + (U32)matchLength;
330 if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(curr-matchIndex+1) - ZSTD_highbit32((U32)offsetPtr[0]+1)) )
331 bestLength = matchLength, *offsetPtr = STORE_OFFSET(curr - matchIndex);
332 if (ip+matchLength == iend) { /* equal : no way to know if inf or sup */
342 if (match[matchLength] < ip[matchLength]) {
345 commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
352 commonLengthLarger = matchLength;
1539 size_t matchLength=0;
1554 matchLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repMatchEnd, prefixLowest) + 4;
1560 matchLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4;
1567 if (ml2 > matchLength)
1568 matchLength = ml2, start = ip, offcode=offsetFound;
1571 if (matchLength < 4) {
1585 int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 1);
1587 matchLength = mlRep, offcode = STORE_REPCODE_1, start = ip;
1599 int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 1);
1601 matchLength = mlRep, offcode = STORE_REPCODE_1, start = ip;
1607 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 4);
1609 matchLength = ml2, offcode = offset2, start = ip;
1621 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 1);
1623 matchLength = mlRep, offcode = STORE_REPCODE_1, start = ip;
1635 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 1);
1637 matchLength = mlRep, offcode = STORE_REPCODE_1, start = ip;
1643 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 7);
1645 matchLength = ml2, offcode = offset2, start = ip;
1660 { start--; matchLength++; }
1666 while ((start>anchor) && (match>mStart) && (start[-1] == match[-1])) { start--; match--; matchLength++; } /* catch up */
1673 ZSTD_storeSeq(seqStore, litLength, anchor, iend, (U32)offcode, matchLength);
1674 anchor = ip = start + matchLength;
1688 matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd2, prefixLowest) + 4;
1690 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength);
1691 ip += matchLength;
1703 matchLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4;
1705 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength);
1706 ip += matchLength;
1905 size_t matchLength=0;
1920 matchLength = ZSTD_count_2segments(ip+1+4, repMatch+4, iend, repEnd, prefixStart) + 4;
1927 if (ml2 > matchLength)
1928 matchLength = ml2, start = ip, offcode=offsetFound;
1931 if (matchLength < 4) {
1954 int const gain1 = (int)(matchLength*3 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 1);
1956 matchLength = repLength, offcode = STORE_REPCODE_1, start = ip;
1963 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 4);
1965 matchLength = ml2, offcode = offset2, start = ip;
1986 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 1);
1988 matchLength = repLength, offcode = STORE_REPCODE_1, start = ip;
1995 int const gain1 = (int)(matchLength*4 - ZSTD_highbit32((U32)STORED_TO_OFFBASE(offcode)) + 7);
1997 matchLength = ml2, offcode = offset2, start = ip;
2008 while ((start>anchor) && (match>mStart) && (start[-1] == match[-1])) { start--; match--; matchLength++; } /* catch up */
2015 ZSTD_storeSeq(seqStore, litLength, anchor, iend, (U32)offcode, matchLength);
2016 anchor = ip = start + matchLength;
2031 matchLength = ZSTD_count_2segments(ip+4, repMatch+4, iend, repEnd, prefixStart) + 4;
2033 ZSTD_storeSeq(seqStore, 0, anchor, iend, STORE_REPCODE_1, matchLength);
2034 ip += matchLength;