Lines Matching refs:matchLength

292  * Provides the cost of the match part (offset + matchLength) of a sequence
299 U32 const matchLength,
305 U32 const mlBase = matchLength - MINMATCH;
306 assert(matchLength >= MINMATCH);
323 DEBUGLOG(8, "ZSTD_getMatchPrice(ml:%u) = %u", matchLength, price);
331 U32 offsetCode, U32 matchLength)
355 { U32 const mlBase = matchLength - MINMATCH;
460 size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
484 if (!extDict || (matchIndex+matchLength >= dictLimit)) {
485 assert(matchIndex+matchLength >= dictLimit); /* might be wrong if actually extDict */
487 matchLength += ZSTD_count(ip+matchLength, match+matchLength, iend);
490 matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iend, dictEnd, prefixStart);
491 if (matchIndex+matchLength >= dictLimit)
492 match = base + matchIndex; /* to prepare for next usage of match[matchLength] */
495 if (matchLength > bestLength) {
496 bestLength = matchLength;
497 if (matchLength > matchEndIdx - matchIndex)
498 matchEndIdx = matchIndex + (U32)matchLength;
501 if (ip+matchLength == iend) { /* equal : no way to know if inf or sup */
505 if (match[matchLength] < ip[matchLength]) { /* necessarily within buffer */
508 commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
515 commonLengthLarger = matchLength;
692 size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
695 if ((dictMode == ZSTD_noDict) || (dictMode == ZSTD_dictMatchState) || (matchIndex+matchLength >= dictLimit)) {
696 assert(matchIndex+matchLength >= dictLimit); /* ensure the condition is correct when !extDict */
698 if (matchIndex >= dictLimit) assert(memcmp(match, ip, matchLength) == 0); /* ensure early section of match is equal as expected */
699 matchLength += ZSTD_count(ip+matchLength, match+matchLength, iLimit);
702 assert(memcmp(match, ip, matchLength) == 0); /* ensure early section of match is equal as expected */
703 matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iLimit, dictEnd, prefixStart);
704 if (matchIndex+matchLength >= dictLimit)
705 match = base + matchIndex; /* prepare for match[matchLength] read */
708 if (matchLength > bestLength) {
710 (U32)matchLength, curr - matchIndex, STORE_OFFSET(curr - matchIndex));
712 if (matchLength > matchEndIdx - matchIndex)
713 matchEndIdx = matchIndex + (U32)matchLength;
714 bestLength = matchLength;
716 matches[mnum].len = (U32)matchLength;
718 if ( (matchLength > ZSTD_OPT_NUM)
719 | (ip+matchLength == iLimit) /* equal : no way to know if inf or sup */) {
724 if (match[matchLength] < ip[matchLength]) {
727 commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
733 commonLengthLarger = matchLength;
749 size_t matchLength = MIN(commonLengthSmaller, commonLengthLarger); /* guaranteed minimum nb of common bytes */
751 matchLength += ZSTD_count_2segments(ip+matchLength, match+matchLength, iLimit, dmsEnd, prefixStart);
752 if (dictMatchIndex+matchLength >= dmsHighLimit)
753 match = base + dictMatchIndex + dmsIndexDelta; /* to prepare for next usage of match[matchLength] */
755 if (matchLength > bestLength) {
758 (U32)matchLength, curr - matchIndex, STORE_OFFSET(curr - matchIndex));
759 if (matchLength > matchEndIdx - matchIndex)
760 matchEndIdx = matchIndex + (U32)matchLength;
761 bestLength = matchLength;
763 matches[mnum].len = (U32)matchLength;
765 if ( (matchLength > ZSTD_OPT_NUM)
766 | (ip+matchLength == iLimit) /* equal : no way to know if inf or sup */) {
771 if (match[matchLength] < ip[matchLength]) {
772 commonLengthSmaller = matchLength; /* all smaller will now have at least this guaranteed common length */
776 commonLengthLarger = matchLength;
886 if (currPos >= currSeq.litLength + currSeq.matchLength) {
887 currPos -= currSeq.litLength + currSeq.matchLength;
918 /* Calculate appropriate bytes left in matchLength and litLength
921 assert(optLdm->seqStore.posInSequence <= currSeq.litLength + currSeq.matchLength);
927 currSeq.matchLength - ((U32)optLdm->seqStore.posInSequence - currSeq.litLength) :
928 currSeq.matchLength;
963 /* Note: ZSTD_match_t actually contains offCode and matchLength (before subtracting MINMATCH) */
975 DEBUGLOG(6, "ZSTD_optLdm_maybeAddMatch(): Adding ldm candidate match (offCode: %u matchLength %u) at block position=%u",