Lines Matching +full:step +full:- +full:up

5  * This source code is licensed under both the BSD-style license (found in the
8 * You may select, at your option, one of the above-listed licenses.
18 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_fillDoubleHashTable()
19 U32* const hashLarge = ms->hashTable; in ZSTD_fillDoubleHashTable()
20 U32 const hBitsL = cParams->hashLog; in ZSTD_fillDoubleHashTable()
21 U32 const mls = cParams->minMatch; in ZSTD_fillDoubleHashTable()
22 U32* const hashSmall = ms->chainTable; in ZSTD_fillDoubleHashTable()
23 U32 const hBitsS = cParams->chainLog; in ZSTD_fillDoubleHashTable()
24 const BYTE* const base = ms->window.base; in ZSTD_fillDoubleHashTable()
25 const BYTE* ip = base + ms->nextToUpdate; in ZSTD_fillDoubleHashTable()
26 const BYTE* const iend = ((const BYTE*)end) - HASH_READ_SIZE; in ZSTD_fillDoubleHashTable()
33 for (; ip + fastHashFillStep - 1 <= iend; ip += fastHashFillStep) { in ZSTD_fillDoubleHashTable()
34 U32 const curr = (U32)(ip - base); in ZSTD_fillDoubleHashTable()
55 ZSTD_compressionParameters const* cParams = &ms->cParams; in ZSTD_compressBlock_doubleFast_noDict_generic()
56 U32* const hashLong = ms->hashTable; in ZSTD_compressBlock_doubleFast_noDict_generic()
57 const U32 hBitsL = cParams->hashLog; in ZSTD_compressBlock_doubleFast_noDict_generic()
58 U32* const hashSmall = ms->chainTable; in ZSTD_compressBlock_doubleFast_noDict_generic()
59 const U32 hBitsS = cParams->chainLog; in ZSTD_compressBlock_doubleFast_noDict_generic()
60 const BYTE* const base = ms->window.base; in ZSTD_compressBlock_doubleFast_noDict_generic()
63 const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); in ZSTD_compressBlock_doubleFast_noDict_generic()
65 const U32 prefixLowestIndex = ZSTD_getLowestPrefixIndex(ms, endIndex, cParams->windowLog); in ZSTD_compressBlock_doubleFast_noDict_generic()
68 const BYTE* const ilimit = iend - HASH_READ_SIZE; in ZSTD_compressBlock_doubleFast_noDict_generic()
76 /* how many positions to search before increasing step size */ in ZSTD_compressBlock_doubleFast_noDict_generic()
78 /* the position at which to increment the step size if no match is found */ in ZSTD_compressBlock_doubleFast_noDict_generic()
80 size_t step; /* the current step size */ in ZSTD_compressBlock_doubleFast_noDict_generic() local
98 ip += ((ip - prefixLowest) == 0); in ZSTD_compressBlock_doubleFast_noDict_generic()
100 U32 const current = (U32)(ip - base); in ZSTD_compressBlock_doubleFast_noDict_generic()
101 U32 const windowLow = ZSTD_getLowestPrefixIndex(ms, current, cParams->windowLog); in ZSTD_compressBlock_doubleFast_noDict_generic()
102 U32 const maxRep = current - windowLow; in ZSTD_compressBlock_doubleFast_noDict_generic()
109 step = 1; in ZSTD_compressBlock_doubleFast_noDict_generic()
111 ip1 = ip + step; in ZSTD_compressBlock_doubleFast_noDict_generic()
125 curr = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_noDict_generic()
131 if ((offset_1 > 0) & (MEM_read32(ip+1-offset_1) == MEM_read32(ip+1))) { in ZSTD_compressBlock_doubleFast_noDict_generic()
132 mLength = ZSTD_count(ip+1+4, ip+1+4-offset_1, iend) + 4; in ZSTD_compressBlock_doubleFast_noDict_generic()
134 … ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_REPCODE_1, mLength); in ZSTD_compressBlock_doubleFast_noDict_generic()
144 offset = (U32)(ip-matchl0); in ZSTD_compressBlock_doubleFast_noDict_generic()
145 …ip>anchor) & (matchl0>prefixLowest)) && (ip[-1] == matchl0[-1])) { ip--; matchl0--; mLength++; } /… in ZSTD_compressBlock_doubleFast_noDict_generic()
163 step++; in ZSTD_compressBlock_doubleFast_noDict_generic()
167 ip1 += step; in ZSTD_compressBlock_doubleFast_noDict_generic()
183 return (size_t)(iend - anchor); in ZSTD_compressBlock_doubleFast_noDict_generic()
192 offset = (U32)(ip-matchl1); in ZSTD_compressBlock_doubleFast_noDict_generic()
193 …ip>anchor) & (matchl1>prefixLowest)) && (ip[-1] == matchl1[-1])) { ip--; matchl1--; mLength++; } /… in ZSTD_compressBlock_doubleFast_noDict_generic()
200 offset = (U32)(ip - matchs0); in ZSTD_compressBlock_doubleFast_noDict_generic()
201 …ip>anchor) & (matchs0>prefixLowest)) && (ip[-1] == matchs0[-1])) { ip--; matchs0--; mLength++; } /… in ZSTD_compressBlock_doubleFast_noDict_generic()
203 /* fall-through */ in ZSTD_compressBlock_doubleFast_noDict_generic()
209 if (step < 4) { in ZSTD_compressBlock_doubleFast_noDict_generic()
215 * 4 bytes, so as long as step, the distance between ip and ip1 in ZSTD_compressBlock_doubleFast_noDict_generic()
217 hashLong[hl1] = (U32)(ip1 - base); in ZSTD_compressBlock_doubleFast_noDict_generic()
220 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength); in ZSTD_compressBlock_doubleFast_noDict_generic()
229 /* done after iLimit test, as candidates could be > iend-8 */ in ZSTD_compressBlock_doubleFast_noDict_generic()
232 hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); in ZSTD_compressBlock_doubleFast_noDict_generic()
234 hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base); in ZSTD_compressBlock_doubleFast_noDict_generic()
240 & (MEM_read32(ip) == MEM_read32(ip - offset_2)) )) { in ZSTD_compressBlock_doubleFast_noDict_generic()
242 size_t const rLength = ZSTD_count(ip+4, ip+4-offset_2, iend) + 4; in ZSTD_compressBlock_doubleFast_noDict_generic()
244 hashSmall[ZSTD_hashPtr(ip, hBitsS, mls)] = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_noDict_generic()
245 hashLong[ZSTD_hashPtr(ip, hBitsL, 8)] = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_noDict_generic()
262 ZSTD_compressionParameters const* cParams = &ms->cParams; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
263 U32* const hashLong = ms->hashTable; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
264 const U32 hBitsL = cParams->hashLog; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
265 U32* const hashSmall = ms->chainTable; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
266 const U32 hBitsS = cParams->chainLog; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
267 const BYTE* const base = ms->window.base; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
271 const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
273 const U32 prefixLowestIndex = ZSTD_getLowestPrefixIndex(ms, endIndex, cParams->windowLog); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
276 const BYTE* const ilimit = iend - HASH_READ_SIZE; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
280 const ZSTD_matchState_t* const dms = ms->dictMatchState; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
281 const ZSTD_compressionParameters* const dictCParams = &dms->cParams; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
282 const U32* const dictHashLong = dms->hashTable; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
283 const U32* const dictHashSmall = dms->chainTable; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
284 const U32 dictStartIndex = dms->window.dictLimit; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
285 const BYTE* const dictBase = dms->window.base; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
287 const BYTE* const dictEnd = dms->window.nextSrc; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
288 const U32 dictIndexDelta = prefixLowestIndex - (U32)(dictEnd - dictBase); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
289 const U32 dictHBitsL = dictCParams->hashLog; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
290 const U32 dictHBitsS = dictCParams->chainLog; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
291 const U32 dictAndPrefixLength = (U32)((ip - prefixLowest) + (dictEnd - dictStart)); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
296 assert(ms->window.dictLimit + (1U << cParams->windowLog) >= endIndex); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
314 U32 const curr = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
319 const U32 repIndex = curr + 1 - offset_1; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
321 dictBase + (repIndex - dictIndexDelta) : in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
326 if (((U32)((prefixLowestIndex-1) - repIndex) >= 3 /* intentional underflow */) in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
331 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_REPCODE_1, mLength); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
339 offset = (U32)(ip-matchLong); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
340 …nchor) & (matchLong>prefixLowest)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; }… in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
351 offset = (U32)(curr - dictMatchIndexL - dictIndexDelta); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
352 …anchor) & (dictMatchL>dictStart)) && (ip[-1] == dictMatchL[-1])) { ip--; dictMatchL--; mLength++; … in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
371 ip += ((ip-anchor) >> kSearchStrength) + 1; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
390 offset = (U32)(ip-matchL3); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
391 …ip>anchor) & (matchL3>prefixLowest)) && (ip[-1] == matchL3[-1])) { ip--; matchL3--; mLength++; } /… in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
402 offset = (U32)(curr + 1 - dictMatchIndexL3 - dictIndexDelta); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
403 …chor) & (dictMatchL3>dictStart)) && (ip[-1] == dictMatchL3[-1])) { ip--; dictMatchL3--; mLength++;… in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
410 offset = (U32)(curr - matchIndexS); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
411 …ile (((ip>anchor) & (match>dictStart)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* … in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
414 offset = (U32)(ip - match); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
415 … (((ip>anchor) & (match>prefixLowest)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /* … in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
422 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
431 /* done after iLimit test, as candidates could be > iend-8 */ in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
434 hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
436 hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
441 U32 const current2 = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
442 U32 const repIndex2 = current2 - offset_2; in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
444 dictBase + repIndex2 - dictIndexDelta : in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
446 if ( ((U32)((prefixLowestIndex-1) - (U32)repIndex2) >= 3 /* intentional overflow */) in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
468 return (size_t)(iend - anchor); in ZSTD_compressBlock_doubleFast_dictMatchState_generic()
494 const U32 mls = ms->cParams.minMatch; in ZSTD_compressBlock_doubleFast()
514 const U32 mls = ms->cParams.minMatch; in ZSTD_compressBlock_doubleFast_dictMatchState()
535 ZSTD_compressionParameters const* cParams = &ms->cParams; in ZSTD_compressBlock_doubleFast_extDict_generic()
536 U32* const hashLong = ms->hashTable; in ZSTD_compressBlock_doubleFast_extDict_generic()
537 U32 const hBitsL = cParams->hashLog; in ZSTD_compressBlock_doubleFast_extDict_generic()
538 U32* const hashSmall = ms->chainTable; in ZSTD_compressBlock_doubleFast_extDict_generic()
539 U32 const hBitsS = cParams->chainLog; in ZSTD_compressBlock_doubleFast_extDict_generic()
544 const BYTE* const ilimit = iend - 8; in ZSTD_compressBlock_doubleFast_extDict_generic()
545 const BYTE* const base = ms->window.base; in ZSTD_compressBlock_doubleFast_extDict_generic()
546 const U32 endIndex = (U32)((size_t)(istart - base) + srcSize); in ZSTD_compressBlock_doubleFast_extDict_generic()
547 const U32 lowLimit = ZSTD_getLowestMatchIndex(ms, endIndex, cParams->windowLog); in ZSTD_compressBlock_doubleFast_extDict_generic()
549 const U32 dictLimit = ms->window.dictLimit; in ZSTD_compressBlock_doubleFast_extDict_generic()
552 const BYTE* const dictBase = ms->window.dictBase; in ZSTD_compressBlock_doubleFast_extDict_generic()
575 const U32 curr = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_extDict_generic()
576 const U32 repIndex = curr + 1 - offset_1; /* offset_1 expected <= curr +1 */ in ZSTD_compressBlock_doubleFast_extDict_generic()
582 …if ((((U32)((prefixStartIndex-1) - repIndex) >= 3) /* intentional underflow : ensure repIndex does… in ZSTD_compressBlock_doubleFast_extDict_generic()
583 & (offset_1 <= curr+1 - dictStartIndex)) /* note: we are searching at curr+1 */ in ZSTD_compressBlock_doubleFast_extDict_generic()
588 ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_REPCODE_1, mLength); in ZSTD_compressBlock_doubleFast_extDict_generic()
595 offset = curr - matchLongIndex; in ZSTD_compressBlock_doubleFast_extDict_generic()
596 …nchor) & (matchLong>lowMatchPtr)) && (ip[-1] == matchLong[-1])) { ip--; matchLong--; mLength++; } … in ZSTD_compressBlock_doubleFast_extDict_generic()
599 … ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength); in ZSTD_compressBlock_doubleFast_extDict_generic()
613 offset = curr+1 - matchIndex3; in ZSTD_compressBlock_doubleFast_extDict_generic()
614 …(((ip>anchor) & (match3>lowMatchPtr)) && (ip[-1] == match3[-1])) { ip--; match3--; mLength++; } /*… in ZSTD_compressBlock_doubleFast_extDict_generic()
619 offset = curr - matchIndex; in ZSTD_compressBlock_doubleFast_extDict_generic()
620 … (((ip>anchor) & (match>lowMatchPtr)) && (ip[-1] == match[-1])) { ip--; match--; mLength++; } /*… in ZSTD_compressBlock_doubleFast_extDict_generic()
624 … ZSTD_storeSeq(seqStore, (size_t)(ip-anchor), anchor, iend, STORE_OFFSET(offset), mLength); in ZSTD_compressBlock_doubleFast_extDict_generic()
627 ip += ((ip-anchor) >> kSearchStrength) + 1; in ZSTD_compressBlock_doubleFast_extDict_generic()
637 /* done after iLimit test, as candidates could be > iend-8 */ in ZSTD_compressBlock_doubleFast_extDict_generic()
640 hashLong[ZSTD_hashPtr(ip-2, hBitsL, 8)] = (U32)(ip-2-base); in ZSTD_compressBlock_doubleFast_extDict_generic()
642 hashSmall[ZSTD_hashPtr(ip-1, hBitsS, mls)] = (U32)(ip-1-base); in ZSTD_compressBlock_doubleFast_extDict_generic()
647 U32 const current2 = (U32)(ip-base); in ZSTD_compressBlock_doubleFast_extDict_generic()
648 U32 const repIndex2 = current2 - offset_2; in ZSTD_compressBlock_doubleFast_extDict_generic()
650 …if ( (((U32)((prefixStartIndex-1) - repIndex2) >= 3) /* intentional overflow : ensure repIndex2 … in ZSTD_compressBlock_doubleFast_extDict_generic()
651 & (offset_2 <= current2 - dictStartIndex)) in ZSTD_compressBlock_doubleFast_extDict_generic()
671 return (size_t)(iend - anchor); in ZSTD_compressBlock_doubleFast_extDict_generic()
683 U32 const mls = ms->cParams.minMatch; in ZSTD_compressBlock_doubleFast_extDict()