Lines Matching refs:matchIndex
55 U32 const matchIndex = hashTable[h]; in ZSTD_updateDUBT() local
62 *nextCandidatePtr = matchIndex; /* update BT like a chain */ in ZSTD_updateDUBT()
95 …U32 matchIndex = *smallerPtr; /* this candidate is unsorted : next sorted candidate is reached t… in ZSTD_insertDUBT1() local
107 for (; nbCompares && (matchIndex > windowLow); --nbCompares) { in ZSTD_insertDUBT1()
108 U32* const nextPtr = bt + 2*(matchIndex & btMask); in ZSTD_insertDUBT1()
110 assert(matchIndex < curr); in ZSTD_insertDUBT1()
116 || (matchIndex+matchLength >= dictLimit) /* both in current segment*/ in ZSTD_insertDUBT1()
119 || (matchIndex+matchLength >= dictLimit)) ? in ZSTD_insertDUBT1()
121 …assert( (matchIndex+matchLength >= dictLimit) /* might be wrong if extDict is incorrectly set to… in ZSTD_insertDUBT1()
123 match = mBase + matchIndex; in ZSTD_insertDUBT1()
126 match = dictBase + matchIndex; in ZSTD_insertDUBT1()
128 if (matchIndex+matchLength >= dictLimit) in ZSTD_insertDUBT1()
129 match = base + matchIndex; /* preparation for next read of match[matchLength] */ in ZSTD_insertDUBT1()
133 curr, matchIndex, (U32)matchLength); in ZSTD_insertDUBT1()
141 *smallerPtr = matchIndex; /* update smaller idx */ in ZSTD_insertDUBT1()
143 … if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop searching */ in ZSTD_insertDUBT1()
145 matchIndex, btLow, nextPtr[1]); in ZSTD_insertDUBT1()
147 …matchIndex = nextPtr[1]; /* new matchIndex, larger than previous and closer to curren… in ZSTD_insertDUBT1()
150 *largerPtr = matchIndex; in ZSTD_insertDUBT1()
152 … if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop searching */ in ZSTD_insertDUBT1()
154 matchIndex, btLow, nextPtr[0]); in ZSTD_insertDUBT1()
156 matchIndex = nextPtr[0]; in ZSTD_insertDUBT1()
209 U32 matchIndex = dictMatchIndex + dictIndexDelta; in ZSTD_DUBT_findBetterDictMatch() local
210 …if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(curr-matchIndex+1) - ZSTD_highbit32(… in ZSTD_DUBT_findBetterDictMatch()
212 …32)matchLength, (U32)*offsetPtr, OFFSET_TO_OFFBASE(curr - matchIndex), dictMatchIndex, matchIndex); in ZSTD_DUBT_findBetterDictMatch()
213 bestLength = matchLength, *offsetPtr = OFFSET_TO_OFFBASE(curr - matchIndex); in ZSTD_DUBT_findBetterDictMatch()
254 U32 matchIndex = hashTable[h]; in ZSTD_DUBT_findBestMatch() local
266 U32* nextCandidate = bt + 2*(matchIndex&btMask); in ZSTD_DUBT_findBestMatch()
267 U32* unsortedMark = bt + 2*(matchIndex&btMask) + 1; in ZSTD_DUBT_findBestMatch()
277 while ( (matchIndex > unsortLimit) in ZSTD_DUBT_findBestMatch()
281 matchIndex); in ZSTD_DUBT_findBestMatch()
283 previousCandidate = matchIndex; in ZSTD_DUBT_findBestMatch()
284 matchIndex = *nextCandidate; in ZSTD_DUBT_findBestMatch()
285 nextCandidate = bt + 2*(matchIndex&btMask); in ZSTD_DUBT_findBestMatch()
286 unsortedMark = bt + 2*(matchIndex&btMask) + 1; in ZSTD_DUBT_findBestMatch()
292 if ( (matchIndex > unsortLimit) in ZSTD_DUBT_findBestMatch()
295 matchIndex); in ZSTD_DUBT_findBestMatch()
300 matchIndex = previousCandidate; in ZSTD_DUBT_findBestMatch()
301 while (matchIndex) { /* will end on matchIndex == 0 */ in ZSTD_DUBT_findBestMatch()
302 U32* const nextCandidateIdxPtr = bt + 2*(matchIndex&btMask) + 1; in ZSTD_DUBT_findBestMatch()
304 ZSTD_insertDUBT1(ms, matchIndex, iend, in ZSTD_DUBT_findBestMatch()
306 matchIndex = nextCandidateIdx; in ZSTD_DUBT_findBestMatch()
322 matchIndex = hashTable[h]; in ZSTD_DUBT_findBestMatch()
325 for (; nbCompares && (matchIndex > windowLow); --nbCompares) { in ZSTD_DUBT_findBestMatch()
326 U32* const nextPtr = bt + 2*(matchIndex & btMask); in ZSTD_DUBT_findBestMatch()
330 if ((dictMode != ZSTD_extDict) || (matchIndex+matchLength >= dictLimit)) { in ZSTD_DUBT_findBestMatch()
331 match = base + matchIndex; in ZSTD_DUBT_findBestMatch()
334 match = dictBase + matchIndex; in ZSTD_DUBT_findBestMatch()
336 if (matchIndex+matchLength >= dictLimit) in ZSTD_DUBT_findBestMatch()
337 … match = base + matchIndex; /* to prepare for next usage of match[matchLength] */ in ZSTD_DUBT_findBestMatch()
341 if (matchLength > matchEndIdx - matchIndex) in ZSTD_DUBT_findBestMatch()
342 matchEndIdx = matchIndex + (U32)matchLength; in ZSTD_DUBT_findBestMatch()
343 …if ( (4*(int)(matchLength-bestLength)) > (int)(ZSTD_highbit32(curr - matchIndex + 1) - ZSTD_highbi… in ZSTD_DUBT_findBestMatch()
344 bestLength = matchLength, *offBasePtr = OFFSET_TO_OFFBASE(curr - matchIndex); in ZSTD_DUBT_findBestMatch()
357 *smallerPtr = matchIndex; /* update smaller idx */ in ZSTD_DUBT_findBestMatch()
359 … if (matchIndex <= btLow) { smallerPtr=&dummy32; break; } /* beyond tree size, stop the search */ in ZSTD_DUBT_findBestMatch()
361 …matchIndex = nextPtr[1]; /* new matchIndex larger than previous (closer to current) */ in ZSTD_DUBT_findBestMatch()
364 *largerPtr = matchIndex; in ZSTD_DUBT_findBestMatch()
366 … if (matchIndex <= btLow) { largerPtr=&dummy32; break; } /* beyond tree size, stop the search */ in ZSTD_DUBT_findBestMatch()
368 matchIndex = nextPtr[0]; in ZSTD_DUBT_findBestMatch()
543 U32 matchIndex; in ZSTD_dedicatedDictSearch_lazy_search() local
559 matchIndex = dms->hashTable[ddsIdx + ddsAttempt]; in ZSTD_dedicatedDictSearch_lazy_search()
560 match = ddsBase + matchIndex; in ZSTD_dedicatedDictSearch_lazy_search()
562 if (!matchIndex) { in ZSTD_dedicatedDictSearch_lazy_search()
568 assert(matchIndex >= ddsLowestIndex); in ZSTD_dedicatedDictSearch_lazy_search()
578 *offsetPtr = OFFSET_TO_OFFBASE(curr - (matchIndex + ddsIndexDelta)); in ZSTD_dedicatedDictSearch_lazy_search()
601 matchIndex = dms->chainTable[chainIndex]; in ZSTD_dedicatedDictSearch_lazy_search()
602 match = ddsBase + matchIndex; in ZSTD_dedicatedDictSearch_lazy_search()
605 assert(matchIndex >= ddsLowestIndex); in ZSTD_dedicatedDictSearch_lazy_search()
615 *offsetPtr = OFFSET_TO_OFFBASE(curr - (matchIndex + ddsIndexDelta)); in ZSTD_dedicatedDictSearch_lazy_search()
699 U32 matchIndex; in ZSTD_HcFindBestMatch() local
707 matchIndex = ZSTD_insertAndFindFirstIndex_internal(ms, cParams, ip, mls, ms->lazySkipping); in ZSTD_HcFindBestMatch()
709 for ( ; (matchIndex>=lowLimit) & (nbAttempts>0) ; nbAttempts--) { in ZSTD_HcFindBestMatch()
711 if ((dictMode != ZSTD_extDict) || matchIndex >= dictLimit) { in ZSTD_HcFindBestMatch()
712 const BYTE* const match = base + matchIndex; in ZSTD_HcFindBestMatch()
713 … assert(matchIndex >= dictLimit); /* ensures this is true if dictMode != ZSTD_extDict */ in ZSTD_HcFindBestMatch()
718 const BYTE* const match = dictBase + matchIndex; in ZSTD_HcFindBestMatch()
727 *offsetPtr = OFFSET_TO_OFFBASE(curr - matchIndex); in ZSTD_HcFindBestMatch()
731 if (matchIndex <= minChain) break; in ZSTD_HcFindBestMatch()
732 matchIndex = NEXT_IN_CHAIN(matchIndex, chainMask); in ZSTD_HcFindBestMatch()
750 matchIndex = dms->hashTable[ZSTD_hashPtr(ip, dms->cParams.hashLog, mls)]; in ZSTD_HcFindBestMatch()
752 for ( ; (matchIndex>=dmsLowestIndex) & (nbAttempts>0) ; nbAttempts--) { in ZSTD_HcFindBestMatch()
754 const BYTE* const match = dmsBase + matchIndex; in ZSTD_HcFindBestMatch()
762 assert(curr > matchIndex + dmsIndexDelta); in ZSTD_HcFindBestMatch()
763 *offsetPtr = OFFSET_TO_OFFBASE(curr - (matchIndex + dmsIndexDelta)); in ZSTD_HcFindBestMatch()
767 if (matchIndex <= dmsMinChain) break; in ZSTD_HcFindBestMatch()
769 matchIndex = dmsChainTable[matchIndex & dmsChainMask]; in ZSTD_HcFindBestMatch()
1232 U32 const matchIndex = row[matchPos]; in ZSTD_RowFindBestMatch() local
1235 if (matchIndex < lowLimit) in ZSTD_RowFindBestMatch()
1237 if ((dictMode != ZSTD_extDict) || matchIndex >= dictLimit) { in ZSTD_RowFindBestMatch()
1238 PREFETCH_L1(base + matchIndex); in ZSTD_RowFindBestMatch()
1240 PREFETCH_L1(dictBase + matchIndex); in ZSTD_RowFindBestMatch()
1242 matchBuffer[numMatches++] = matchIndex; in ZSTD_RowFindBestMatch()
1256 U32 const matchIndex = matchBuffer[currMatch]; in ZSTD_RowFindBestMatch() local
1258 assert(matchIndex < curr); in ZSTD_RowFindBestMatch()
1259 assert(matchIndex >= lowLimit); in ZSTD_RowFindBestMatch()
1261 if ((dictMode != ZSTD_extDict) || matchIndex >= dictLimit) { in ZSTD_RowFindBestMatch()
1262 const BYTE* const match = base + matchIndex; in ZSTD_RowFindBestMatch()
1263 … assert(matchIndex >= dictLimit); /* ensures this is true if dictMode != ZSTD_extDict */ in ZSTD_RowFindBestMatch()
1268 const BYTE* const match = dictBase + matchIndex; in ZSTD_RowFindBestMatch()
1277 *offsetPtr = OFFSET_TO_OFFBASE(curr - matchIndex); in ZSTD_RowFindBestMatch()
1303 U32 const matchIndex = dmsRow[matchPos]; in ZSTD_RowFindBestMatch() local
1305 if (matchIndex < dmsLowestIndex) in ZSTD_RowFindBestMatch()
1307 PREFETCH_L1(dmsBase + matchIndex); in ZSTD_RowFindBestMatch()
1308 matchBuffer[numMatches++] = matchIndex; in ZSTD_RowFindBestMatch()
1314 U32 const matchIndex = matchBuffer[currMatch]; in ZSTD_RowFindBestMatch() local
1316 assert(matchIndex >= dmsLowestIndex); in ZSTD_RowFindBestMatch()
1317 assert(matchIndex < curr); in ZSTD_RowFindBestMatch()
1319 { const BYTE* const match = dmsBase + matchIndex; in ZSTD_RowFindBestMatch()
1327 assert(curr > matchIndex + dmsIndexDelta); in ZSTD_RowFindBestMatch()
1328 *offsetPtr = OFFSET_TO_OFFBASE(curr - (matchIndex + dmsIndexDelta)); in ZSTD_RowFindBestMatch()
1715 U32 const matchIndex = (U32)((size_t)(start-base) - OFFBASE_TO_OFFSET(offBase)); in ZSTD_compressBlock_lazy_generic() local
1716 …const BYTE* match = (matchIndex < prefixLowestIndex) ? dictBase + matchIndex - dictIndexDelta : ba… in ZSTD_compressBlock_lazy_generic()
1717 … const BYTE* const mStart = (matchIndex < prefixLowestIndex) ? dictLowest : prefixLowest; in ZSTD_compressBlock_lazy_generic()
2089 U32 const matchIndex = (U32)((size_t)(start-base) - OFFBASE_TO_OFFSET(offBase)); in ZSTD_compressBlock_lazy_extDict_generic() local
2090 … const BYTE* match = (matchIndex < dictLimit) ? dictBase + matchIndex : base + matchIndex; in ZSTD_compressBlock_lazy_extDict_generic()
2091 const BYTE* const mStart = (matchIndex < dictLimit) ? dictStart : prefixStart; in ZSTD_compressBlock_lazy_extDict_generic()