Lines Matching refs:U32
86 U32 offBase; /* offBase == Offset + ZSTD_REP_NUM, or repcode 1,2,3 */
114 U32 longLengthPos; /* Index of the sequence to apply long length modification to */
118 U32 litLength;
119 U32 matchLength;
131 if (seqStore->longLengthPos == (U32)(seq - seqStore->sequencesStart)) {
195 U32 off; /* Offset sumtype code for the match, using ZSTD_storeSeq() format */
196 U32 len; /* Raw length of match */
200 U32 offset; /* Offset of sequence */
201 U32 litLength; /* Length of literals prior to match */
202 U32 matchLength; /* Raw length of match */
218 U32 off; /* offset of previous match */
219 U32 mlen; /* length of previous match */
220 U32 litlen; /* nb of literals since previous match */
221 U32 rep[ZSTD_REP_NUM]; /* offset history after previous match */
236 U32 litSum; /* nb of literals */
237 U32 litLengthSum; /* nb of litLength codes */
238 U32 matchLengthSum; /* nb of matchLength codes */
239 U32 offCodeSum; /* nb of offset codes */
240 U32 litSumBasePrice; /* to compare to log2(litfreq) */
241 U32 litLengthSumBasePrice; /* to compare to log2(llfreq) */
242 U32 matchLengthSumBasePrice;/* to compare to log2(mlfreq) */
243 U32 offCodeSumBasePrice; /* to compare to log2(offreq) */
251 U32 rep[ZSTD_REP_NUM];
258 U32 dictLimit; /* below that point, need extDict */
259 U32 lowLimit; /* below that point, no more valid data */
260 U32 nbOverflowCorrections; /* Number of times overflow correction has run since
274 U32 loadedDictEnd; /* index of end of dictionary, within context's referential.
281 U32 nextToUpdate; /* index from which to continue table update */
282 U32 hashLog3; /* dispatch table for matches of len==3 : larger == faster, more memory */
284 U32 rowHashLog; /* For row-based matchfinder: Hashlog based on nb of rows in the hashTable.*/
286 U32 hashCache[ZSTD_ROW_HASH_CACHE_SIZE]; /* For row-based matchFinder: a cache of hashes to improve speed */
288 U32 hashSaltEntropy; /* For row-based matchFinder: collects entropy for salt generation */
290 U32* hashTable;
291 U32* hashTable3;
292 U32* chainTable;
324 U32 offset;
325 U32 checksum;
330 U32 hash;
331 U32 checksum;
340 U32 loadedDictEnd;
348 U32 hashLog; /* Log size of hashTable */
349 U32 bucketSizeLog; /* Log bucket size for collision resolution, at most 8 */
350 U32 minMatchLength; /* Minimum match length */
351 U32 hashRateLog; /* Log number of entries to skip */
352 U32 windowLog; /* Window log for the LDM */
468 U32 partitions[ZSTD_MAX_NB_BLOCK_SPLITS];
479 U32 dictID;
518 U32 frameEnded;
579 ZSTD_MatchState_t* bs, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
584 MEM_STATIC U32 ZSTD_LLcode(U32 litLength)
594 static const U32 LL_deltaCode = 19;
601 MEM_STATIC U32 ZSTD_MLcode(U32 mlBase)
611 static const U32 ML_deltaCode = 36;
631 ZSTD_selectAddr(U32 index, U32 lowLimit, const BYTE* candidate, const BYTE* backup)
650 ZSTD_noCompressBlock(void* dst, size_t dstCapacity, const void* src, size_t srcSize, U32 lastBlock)
652 U32 const cBlockHeader24 = lastBlock + (((U32)bt_raw)<<1) + (U32)(srcSize << 3);
662 ZSTD_rleCompressBlock(void* dst, size_t dstCapacity, BYTE src, size_t srcSize, U32 lastBlock)
665 U32 const cBlockHeader = lastBlock + (((U32)bt_rle)<<1) + (U32)(srcSize << 3);
679 U32 const minlog = (strat>=ZSTD_btultra) ? (U32)(strat) - 1 : 6;
737 U32 offBase,
747 seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
761 seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
778 U32 offBase,
786 { U32 const pos = (U32)((const BYTE*)literals - g_start);
788 pos, (U32)litLength, (U32)matchLength, (U32)offBase);
818 ZSTD_updateRep(U32 rep[ZSTD_REP_NUM], U32 const offBase, U32 const ll0)
825 U32 const repCode = OFFBASE_TO_REPCODE(offBase) - 1 + ll0;
827 U32 const currentOffset = (repCode==ZSTD_REP_NUM) ? (rep[0] - 1) : rep[repCode];
838 U32 rep[3];
842 ZSTD_newRep(U32 const rep[ZSTD_REP_NUM], U32 const offBase, U32 const ll0)
898 static const U32 prime3bytes = 506832829U;
899 static U32 ZSTD_hash3(U32 u, U32 h, U32 s) { assert(h <= 32); return (((u << (32-24)) * prime3bytes) ^ s) >> (32-h) ; }
900 MEM_STATIC size_t ZSTD_hash3Ptr(const void* ptr, U32 h) { return ZSTD_hash3(MEM_readLE32(ptr), h, 0); } /* only in zstd_opt.h */
901 MEM_STATIC size_t ZSTD_hash3PtrS(const void* ptr, U32 h, U32 s) { return ZSTD_hash3(MEM_readLE32(ptr), h, s); }
903 static const U32 prime4bytes = 2654435761U;
904 static U32 ZSTD_hash4(U32 u, U32 h, U32 s) { assert(h <= 32); return ((u * prime4bytes) ^ s) >> (32-h) ; }
905 static size_t ZSTD_hash4Ptr(const void* ptr, U32 h) { return ZSTD_hash4(MEM_readLE32(ptr), h, 0); }
906 static size_t ZSTD_hash4PtrS(const void* ptr, U32 h, U32 s) { return ZSTD_hash4(MEM_readLE32(ptr), h, s); }
909 static size_t ZSTD_hash5(U64 u, U32 h, U64 s) { assert(h <= 64); return (size_t)((((u << (64-40)) * prime5bytes) ^ s) >> (64-h)) ; }
910 static size_t ZSTD_hash5Ptr(const void* p, U32 h) { return ZSTD_hash5(MEM_readLE64(p), h, 0); }
911 static size_t ZSTD_hash5PtrS(const void* p, U32 h, U64 s) { return ZSTD_hash5(MEM_readLE64(p), h, s); }
914 static size_t ZSTD_hash6(U64 u, U32 h, U64 s) { assert(h <= 64); return (size_t)((((u << (64-48)) * prime6bytes) ^ s) >> (64-h)) ; }
915 static size_t ZSTD_hash6Ptr(const void* p, U32 h) { return ZSTD_hash6(MEM_readLE64(p), h, 0); }
916 static size_t ZSTD_hash6PtrS(const void* p, U32 h, U64 s) { return ZSTD_hash6(MEM_readLE64(p), h, s); }
919 static size_t ZSTD_hash7(U64 u, U32 h, U64 s) { assert(h <= 64); return (size_t)((((u << (64-56)) * prime7bytes) ^ s) >> (64-h)) ; }
920 static size_t ZSTD_hash7Ptr(const void* p, U32 h) { return ZSTD_hash7(MEM_readLE64(p), h, 0); }
921 static size_t ZSTD_hash7PtrS(const void* p, U32 h, U64 s) { return ZSTD_hash7(MEM_readLE64(p), h, s); }
924 static size_t ZSTD_hash8(U64 u, U32 h, U64 s) { assert(h <= 64); return (size_t)((((u) * prime8bytes) ^ s) >> (64-h)) ; }
925 static size_t ZSTD_hash8Ptr(const void* p, U32 h) { return ZSTD_hash8(MEM_readLE64(p), h, 0); }
926 static size_t ZSTD_hash8PtrS(const void* p, U32 h, U64 s) { return ZSTD_hash8(MEM_readLE64(p), h, s); }
930 size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls)
948 size_t ZSTD_hashPtrSalted(const void* p, U32 hBits, U32 mls, const U64 hashSalt) {
956 case 4: return ZSTD_hash4PtrS(p, hBits, (U32)hashSalt);
1007 MEM_STATIC U64 ZSTD_rollingHash_primePower(U32 length)
1030 * doesn't overflow U32 index capacity (4 GB) */
1034 ( ((U32)-1) /* Maximum ending current index */ \
1044 U32 const end = (U32)endT;
1050 MEM_STATIC U32 ZSTD_window_isEmpty(ZSTD_window_t const window)
1061 MEM_STATIC U32 ZSTD_window_hasExtDict(ZSTD_window_t const window)
1097 MEM_STATIC U32 ZSTD_window_canOverflowCorrect(ZSTD_window_t const window,
1098 U32 cycleLog,
1099 U32 maxDist,
1100 U32 loadedDictEnd,
1103 U32 const cycleSize = 1u << cycleLog;
1104 U32 const curr = (U32)((BYTE const*)src - window.base);
1105 U32 const minIndexToOverflowCorrect = cycleSize
1114 U32 const adjustment = window.nbOverflowCorrections + 1;
1115 U32 const adjustedIndex = MAX(minIndexToOverflowCorrect * adjustment,
1117 U32 const indexLargeEnough = curr > adjustedIndex;
1122 U32 const dictionaryInvalidated = curr > maxDist + loadedDictEnd;
1132 MEM_STATIC U32 ZSTD_window_needOverflowCorrection(ZSTD_window_t const window,
1133 U32 cycleLog,
1134 U32 maxDist,
1135 U32 loadedDictEnd,
1139 U32 const curr = (U32)((BYTE const*)srcEnd - window.base);
1159 U32 ZSTD_window_correctOverflow(ZSTD_window_t* window, U32 cycleLog,
1160 U32 maxDist, void const* src)
1181 U32 const cycleSize = 1u << cycleLog;
1182 U32 const cycleMask = cycleSize - 1;
1183 U32 const curr = (U32)((BYTE const*)src - window->base);
1184 U32 const currentCycle = curr & cycleMask;
1186 U32 const currentCycleCorrection = currentCycle < ZSTD_WINDOW_START_INDEX
1189 U32 const newCurrent = currentCycle
1192 U32 const correction = curr - newCurrent;
1258 U32 maxDist,
1259 U32* loadedDictEndPtr,
1262 U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base);
1263 U32 const loadedDictEnd = (loadedDictEndPtr != NULL) ? *loadedDictEndPtr : 0;
1281 U32 const newLowLimit = blockEndIdx - maxDist;
1303 U32 maxDist,
1304 U32* loadedDictEndPtr,
1309 { U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base);
1310 U32 const loadedDictEnd = *loadedDictEndPtr;
1354 U32 ZSTD_window_update(ZSTD_window_t* window,
1359 U32 contiguous = 1;
1371 assert(distanceFromBase == (size_t)(U32)distanceFromBase); /* should never overflow */
1372 window->dictLimit = (U32)distanceFromBase;
1384 U32 const lowLimitMax = (highInputIdx > (size_t)window->dictLimit) ? window->dictLimit : (U32)highInputIdx;
1395 MEM_STATIC U32 ZSTD_getLowestMatchIndex(const ZSTD_MatchState_t* ms, U32 curr, unsigned windowLog)
1397 U32 const maxDistance = 1U << windowLog;
1398 U32 const lowestValid = ms->window.lowLimit;
1399 U32 const withinWindow = (curr - lowestValid > maxDistance) ? curr - maxDistance : lowestValid;
1400 U32 const isDictionary = (ms->loadedDictEnd != 0);
1405 U32 const matchLowest = isDictionary ? lowestValid : withinWindow;
1412 MEM_STATIC U32 ZSTD_getLowestPrefixIndex(const ZSTD_MatchState_t* ms, U32 curr, unsigned windowLog)
1414 U32 const maxDistance = 1U << windowLog;
1415 U32 const lowestValid = ms->window.dictLimit;
1416 U32 const withinWindow = (curr - lowestValid > maxDistance) ? curr - maxDistance : lowestValid;
1417 U32 const isDictionary = (ms->loadedDictEnd != 0);
1421 U32 const matchLowest = isDictionary ? lowestValid : withinWindow;
1429 MEM_STATIC int ZSTD_index_overlap_check(const U32 prefixLowestIndex, const U32 repIndex) {
1430 return ((U32)((prefixLowestIndex-1) - repIndex) >= 3);
1437 MEM_STATIC double ZSTD_fWeight(U32 rawStat)
1439 U32 const fp_accuracy = 8;
1440 U32 const fp_multiplier = (1 << fp_accuracy);
1441 U32 const newStat = rawStat + 1;
1442 U32 const hb = ZSTD_highbit32(newStat);
1443 U32 const BWeight = hb * fp_multiplier;
1444 U32 const FWeight = (newStat << fp_accuracy) >> hb;
1445 U32 const weight = BWeight + FWeight;
1452 MEM_STATIC void ZSTD_debugTable(const U32* table, U32 max)
1487 MEM_STATIC void ZSTD_writeTaggedIndex(U32* const hashTable, size_t hashAndTag, U32 index) {
1489 U32 const tag = (U32)(hashAndTag & ZSTD_SHORT_CACHE_TAG_MASK);
1497 U32 const tag1 = packedTag1 & ZSTD_SHORT_CACHE_TAG_MASK;
1498 U32 const tag2 = packedTag2 & ZSTD_SHORT_CACHE_TAG_MASK;
1518 U32 idx; /* Index in array of ZSTD_Sequence */
1519 U32 posInSequence; /* Position within sequence at idx */
1605 U32 ZSTD_cycleLog(U32 hashLog, ZSTD_strategy strat);