Lines Matching refs:U32
126 U32 off; /* Offset sumtype code for the match, using ZSTD_storeSeq() format */
127 U32 len; /* Raw length of match */
131 U32 offset; /* Offset of sequence */
132 U32 litLength; /* Length of literals prior to match */
133 U32 matchLength; /* Raw length of match */
149 U32 off;
150 U32 mlen;
151 U32 litlen;
152 U32 rep[ZSTD_REP_NUM];
166 U32 litSum; /* nb of literals */
167 U32 litLengthSum; /* nb of litLength codes */
168 U32 matchLengthSum; /* nb of matchLength codes */
169 U32 offCodeSum; /* nb of offset codes */
170 U32 litSumBasePrice; /* to compare to log2(litfreq) */
171 U32 litLengthSumBasePrice; /* to compare to log2(llfreq) */
172 U32 matchLengthSumBasePrice;/* to compare to log2(mlfreq) */
173 U32 offCodeSumBasePrice; /* to compare to log2(offreq) */
181 U32 rep[ZSTD_REP_NUM];
188 U32 dictLimit; /* below that point, need extDict */
189 U32 lowLimit; /* below that point, no more valid data */
190 U32 nbOverflowCorrections; /* Number of times overflow correction has run since
204 U32 loadedDictEnd; /* index of end of dictionary, within context's referential.
211 U32 nextToUpdate; /* index from which to continue table update */
212 U32 hashLog3; /* dispatch table for matches of len==3 : larger == faster, more memory */
214 U32 rowHashLog; /* For row-based matchfinder: Hashlog based on nb of rows in the hashTable.*/
216 U32 hashCache[ZSTD_ROW_HASH_CACHE_SIZE]; /* For row-based matchFinder: a cache of hashes to improve speed */
218 U32* hashTable;
219 U32* hashTable3;
220 U32* chainTable;
222 U32 forceNonContiguous; /* Non-zero if we should force non-contiguous load for the next window update. */
240 U32 offset;
241 U32 checksum;
246 U32 hash;
247 U32 checksum;
256 U32 loadedDictEnd;
264 U32 hashLog; /* Log size of hashTable */
265 U32 bucketSizeLog; /* Log bucket size for collision resolution, at most 8 */
266 U32 minMatchLength; /* Minimum match length */
267 U32 hashRateLog; /* Log number of entries to skip */
268 U32 windowLog; /* Window log for the LDM */
354 U32 partitions[ZSTD_MAX_NB_BLOCK_SPLITS];
365 U32 dictID;
387 U32* entropyWorkspace; /* entropy workspace of ENTROPY_WORKSPACE_SIZE bytes */
403 U32 frameEnded;
452 ZSTD_matchState_t* bs, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
457 MEM_STATIC U32 ZSTD_LLcode(U32 litLength)
467 static const U32 LL_deltaCode = 19;
474 MEM_STATIC U32 ZSTD_MLcode(U32 mlBase)
484 static const U32 ML_deltaCode = 36;
503 MEM_STATIC size_t ZSTD_noCompressBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize, U32 lastBlock)
505 U32 const cBlockHeader24 = lastBlock + (((U32)bt_raw)<<1) + (U32)(srcSize << 3);
513 MEM_STATIC size_t ZSTD_rleCompressBlock (void* dst, size_t dstCapacity, BYTE src, size_t srcSize, U32 lastBlock)
516 U32 const cBlockHeader = lastBlock + (((U32)bt_rle)<<1) + (U32)(srcSize << 3);
530 U32 const minlog = (strat>=ZSTD_btultra) ? (U32)(strat) - 1 : 6;
590 U32 offBase_minus1,
598 { U32 const pos = (U32)((const BYTE*)literals - g_start);
600 pos, (U32)litLength, (U32)matchLength, (U32)offBase_minus1);
626 seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
639 seqStorePtr->longLengthPos = (U32)(seqStorePtr->sequences - seqStorePtr->sequencesStart);
652 ZSTD_updateRep(U32 rep[ZSTD_REP_NUM], U32 const offBase_minus1, U32 const ll0)
659 U32 const repCode = STORED_REPCODE(offBase_minus1) - 1 + ll0;
661 U32 const currentOffset = (repCode==ZSTD_REP_NUM) ? (rep[0] - 1) : rep[repCode];
672 U32 rep[3];
676 ZSTD_newRep(U32 const rep[ZSTD_REP_NUM], U32 const offBase_minus1, U32 const ll0)
707 return (__builtin_ctz((U32)val) >> 3);
713 return DeBruijnBytePos[((U32)((val & -(S32)val) * 0x077CB531U)) >> 27];
730 return (__builtin_clz((U32)val) >> 3);
785 static const U32 prime3bytes = 506832829U;
786 static U32 ZSTD_hash3(U32 u, U32 h) { return ((u << (32-24)) * prime3bytes) >> (32-h) ; }
787 MEM_STATIC size_t ZSTD_hash3Ptr(const void* ptr, U32 h) { return ZSTD_hash3(MEM_readLE32(ptr), h); } /* only in zstd_opt.h */
789 static const U32 prime4bytes = 2654435761U;
790 static U32 ZSTD_hash4(U32 u, U32 h) { return (u * prime4bytes) >> (32-h) ; }
791 static size_t ZSTD_hash4Ptr(const void* ptr, U32 h) { return ZSTD_hash4(MEM_read32(ptr), h); }
794 static size_t ZSTD_hash5(U64 u, U32 h) { return (size_t)(((u << (64-40)) * prime5bytes) >> (64-h)) ; }
795 static size_t ZSTD_hash5Ptr(const void* p, U32 h) { return ZSTD_hash5(MEM_readLE64(p), h); }
798 static size_t ZSTD_hash6(U64 u, U32 h) { return (size_t)(((u << (64-48)) * prime6bytes) >> (64-h)) ; }
799 static size_t ZSTD_hash6Ptr(const void* p, U32 h) { return ZSTD_hash6(MEM_readLE64(p), h); }
802 static size_t ZSTD_hash7(U64 u, U32 h) { return (size_t)(((u << (64-56)) * prime7bytes) >> (64-h)) ; }
803 static size_t ZSTD_hash7Ptr(const void* p, U32 h) { return ZSTD_hash7(MEM_readLE64(p), h); }
806 static size_t ZSTD_hash8(U64 u, U32 h) { return (size_t)(((u) * prime8bytes) >> (64-h)) ; }
807 static size_t ZSTD_hash8Ptr(const void* p, U32 h) { return ZSTD_hash8(MEM_readLE64(p), h); }
810 size_t ZSTD_hashPtr(const void* p, U32 hBits, U32 mls)
865 MEM_STATIC U64 ZSTD_rollingHash_primePower(U32 length)
891 ( ((U32)-1) /* Maximum ending current index */ \
901 U32 const end = (U32)endT;
907 MEM_STATIC U32 ZSTD_window_isEmpty(ZSTD_window_t const window)
918 MEM_STATIC U32 ZSTD_window_hasExtDict(ZSTD_window_t const window)
954 MEM_STATIC U32 ZSTD_window_canOverflowCorrect(ZSTD_window_t const window,
955 U32 cycleLog,
956 U32 maxDist,
957 U32 loadedDictEnd,
960 U32 const cycleSize = 1u << cycleLog;
961 U32 const curr = (U32)((BYTE const*)src - window.base);
962 U32 const minIndexToOverflowCorrect = cycleSize
971 U32 const adjustment = window.nbOverflowCorrections + 1;
972 U32 const adjustedIndex = MAX(minIndexToOverflowCorrect * adjustment,
974 U32 const indexLargeEnough = curr > adjustedIndex;
979 U32 const dictionaryInvalidated = curr > maxDist + loadedDictEnd;
989 MEM_STATIC U32 ZSTD_window_needOverflowCorrection(ZSTD_window_t const window,
990 U32 cycleLog,
991 U32 maxDist,
992 U32 loadedDictEnd,
996 U32 const curr = (U32)((BYTE const*)srcEnd - window.base);
1014 MEM_STATIC U32 ZSTD_window_correctOverflow(ZSTD_window_t* window, U32 cycleLog,
1015 U32 maxDist, void const* src)
1036 U32 const cycleSize = 1u << cycleLog;
1037 U32 const cycleMask = cycleSize - 1;
1038 U32 const curr = (U32)((BYTE const*)src - window->base);
1039 U32 const currentCycle = curr & cycleMask;
1041 U32 const currentCycleCorrection = currentCycle < ZSTD_WINDOW_START_INDEX
1044 U32 const newCurrent = currentCycle
1047 U32 const correction = curr - newCurrent;
1113 U32 maxDist,
1114 U32* loadedDictEndPtr,
1117 U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base);
1118 U32 const loadedDictEnd = (loadedDictEndPtr != NULL) ? *loadedDictEndPtr : 0;
1136 U32 const newLowLimit = blockEndIdx - maxDist;
1158 U32 maxDist,
1159 U32* loadedDictEndPtr,
1164 { U32 const blockEndIdx = (U32)((BYTE const*)blockEnd - window->base);
1165 U32 const loadedDictEnd = *loadedDictEndPtr;
1202 MEM_STATIC U32 ZSTD_window_update(ZSTD_window_t* window,
1207 U32 contiguous = 1;
1219 assert(distanceFromBase == (size_t)(U32)distanceFromBase); /* should never overflow */
1220 window->dictLimit = (U32)distanceFromBase;
1232 U32 const lowLimitMax = (highInputIdx > (ptrdiff_t)window->dictLimit) ? window->dictLimit : (U32)highInputIdx;
1242 MEM_STATIC U32 ZSTD_getLowestMatchIndex(const ZSTD_matchState_t* ms, U32 curr, unsigned windowLog)
1244 U32 const maxDistance = 1U << windowLog;
1245 U32 const lowestValid = ms->window.lowLimit;
1246 U32 const withinWindow = (curr - lowestValid > maxDistance) ? curr - maxDistance : lowestValid;
1247 U32 const isDictionary = (ms->loadedDictEnd != 0);
1252 U32 const matchLowest = isDictionary ? lowestValid : withinWindow;
1259 MEM_STATIC U32 ZSTD_getLowestPrefixIndex(const ZSTD_matchState_t* ms, U32 curr, unsigned windowLog)
1261 U32 const maxDistance = 1U << windowLog;
1262 U32 const lowestValid = ms->window.dictLimit;
1263 U32 const withinWindow = (curr - lowestValid > maxDistance) ? curr - maxDistance : lowestValid;
1264 U32 const isDictionary = (ms->loadedDictEnd != 0);
1268 U32 const matchLowest = isDictionary ? lowestValid : withinWindow;
1277 MEM_STATIC double ZSTD_fWeight(U32 rawStat)
1279 U32 const fp_accuracy = 8;
1280 U32 const fp_multiplier = (1 << fp_accuracy);
1281 U32 const newStat = rawStat + 1;
1282 U32 const hb = ZSTD_highbit32(newStat);
1283 U32 const BWeight = hb * fp_multiplier;
1284 U32 const FWeight = (newStat << fp_accuracy) >> hb;
1285 U32 const weight = BWeight + FWeight;
1292 MEM_STATIC void ZSTD_debugTable(const U32* table, U32 max)
1392 U32 ZSTD_cycleLog(U32 hashLog, ZSTD_strategy strat);