Lines Matching refs:UInt32

19 #define kMaxValForNormalize ((UInt32)0)

20 // #define kMaxValForNormalize ((UInt32)(1 << 20) + 0xfff) // for debug
45 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
47 hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
50 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
52 temp ^= ((UInt32)cur[2] << 8); \
57 UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
59 temp ^= ((UInt32)cur[2] << 8); \
65 #define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
78 static int LzInWindow_Create2(CMatchFinder *p, UInt32 blockSize, ISzAllocPtr alloc)
92 // we can allocate 4GiB, but still use UInt32 for (p->blockSize)
93 // we use UInt32 type for (p->blockSize), because
95 // when we use (p->streamPos - p->pos) that is UInt32.
96 if (blockSize >= (UInt32)0 - (UInt32)kBlockSizeAlign)
113 static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return GET_AVAIL_BYTES(p); }
127 UInt32 curSize = 0xFFFFFFFF - GET_AVAIL_BYTES(p);
129 curSize = (UInt32)p->directInputRem;
171 p->streamPos += (UInt32)size;
244 UInt32 r = (UInt32)i;
247 r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
280 static UInt32 GetBlockSize(CMatchFinder *p, UInt32 historySize)
282 UInt32 blockSize = (p->keepSizeBefore + p->keepSizeAfter);
293 const UInt32 kBlockSizeMax = (UInt32)0 - (UInt32)kBlockSizeAlign;
294 const UInt32 rem = kBlockSizeMax - blockSize;
295 const UInt32 reserve = (blockSize >> (blockSize < ((UInt32)1 << 30) ? 1 : 2))
305 blockSize &= ~(UInt32)(kBlockSizeAlign - 1);
315 static UInt32 MatchFinder_GetHashMask2(CMatchFinder *p, UInt32 hs)
341 static UInt32 MatchFinder_GetHashMask(CMatchFinder *p, UInt32 hs)
370 int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
371 UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
376 // keepAddBufferBefore = (UInt32)0xFFFFFFFF - (1 << 22); // for debug
392 UInt32 hs;
393 UInt32 hsCur;
404 hs = (UInt32)0 - 1;
406 hs = ((UInt32)1 << numBits) - 1;
412 const UInt32 hs2 = MatchFinder_GetHashMask2(p, historySize);
419 const UInt32 hs2 = MatchFinder_GetHashMask2(p, (UInt32)p->expectedDataSize);
430 hsCur = MatchFinder_GetHashMask(p, (UInt32)p->expectedDataSize);
443 UInt32 fixedHashSize = 0;
457 const UInt32 newCyclicBufferSize = historySize + 1; // do not change it
496 UInt32 k;
497 UInt32 n = kMaxValForNormalize - p->pos;
499 n = (UInt32)(Int32)-1; // we allow (pos == 0) at start even with (kMaxValForNormalize == 0)
507 const UInt32 ksa = p->keepSizeAfter;
508 UInt32 mm = p->matchMaxLen;
683 LzFind_SaturSub_128(UInt32 subValue, CLzRef *items, const CLzRef *lim)
731 LzFind_SaturSub_256(UInt32 subValue, CLzRef *items, const CLzRef *lim)
748 UInt32 subValue, CLzRef *items, const CLzRef *lim);
756 // #define SASUB_32(i) { UInt32 v = items[i]; UInt32 m = v - subValue; if (v < subValue) m = kEmptyHashValue; items[i] = m; }
757 #define SASUB_32(i) { UInt32 v = items[i]; if (v < subValue) v = subValue; items[i] = v - subValue; }
771 LzFind_SaturSub_32(UInt32 subValue, CLzRef *items, const CLzRef *lim)
788 void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
849 const UInt32 subValue = (p->pos - p->historySize - 1) /* & ~(UInt32)(kNormalizeAlign - 1) */;
850 // const UInt32 subValue = (1 << 15); // for debug
873 static UInt32 * Hc_GetMatchesSpec(size_t lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
874 size_t _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
875 UInt32 *d, unsigned maxLen)
881 UInt32 delta = pos - curMatch;
889 UInt32 len = 0;
911 UInt32 delta;
930 d[0] = (UInt32)(lim - cur);
940 d[0] = (UInt32)len;
955 UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
956 size_t _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
957 UInt32 *d, UInt32 maxLen)
963 UInt32 cmCheck;
967 cmCheck = (UInt32)(pos - _cyclicBufferSize);
968 if ((UInt32)pos <= _cyclicBufferSize)
974 const UInt32 delta = pos - curMatch;
979 const UInt32 pair0 = pair[0];
988 maxLen = (UInt32)len;
989 *d++ = (UInt32)len;
1002 // const UInt32 curMatch2 = pair[1];
1025 static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
1026 size_t _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
1032 UInt32 cmCheck;
1034 cmCheck = (UInt32)(pos - _cyclicBufferSize);
1035 if ((UInt32)pos <= _cyclicBufferSize)
1042 const UInt32 delta = pos - curMatch;
1087 { const UInt32 pos1 = p->pos + 1; p->pos = pos1; if (pos1 == p->posLimit) MatchFinder_CheckLimits(p); }
1106 unsigned lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \
1119 distances, (UInt32)_maxLen_); MOVE_POS_RET
1136 static UInt32* Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1145 UInt32* Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1161 static UInt32* Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1163 UInt32 mmm;
1164 UInt32 h2, d2, pos;
1166 UInt32 *hash;
1188 distances[0] = (UInt32)maxLen;
1202 static UInt32* Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1204 UInt32 mmm;
1205 UInt32 h2, h3, d2, d3, pos;
1207 UInt32 *hash;
1257 distances[-2] = (UInt32)maxLen;
1270 static UInt32* Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1272 UInt32 mmm;
1273 UInt32 h2, h3, d2, d3, maxLen, pos;
1274 UInt32 *hash;
1329 distances[-2] = (UInt32)maxLen;
1342 static UInt32* Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1344 UInt32 mmm;
1345 UInt32 h2, h3, d2, d3, pos;
1347 UInt32 *hash;
1397 distances[-2] = (UInt32)maxLen;
1410 static UInt32 * Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1412 UInt32 mmm;
1413 UInt32 h2, h3, d2, d3, maxLen, pos;
1414 UInt32 *hash;
1482 UInt32* Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
1492 static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1503 void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1514 static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1518 UInt32 h2;
1519 UInt32 *hash;
1529 static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1533 UInt32 h2, h3;
1534 UInt32 *hash;
1545 static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1549 UInt32 h2, h3;
1550 UInt32 *hash;
1566 UInt32 *hash; \
1567 UInt32 *son; \
1568 UInt32 pos = p->pos; \
1569 UInt32 num2 = num; \
1571 { const UInt32 rem = p->posLimit - pos; if (num2 > rem) num2 = rem; } \
1573 { const UInt32 cycPos = p->cyclicBufferPos; \
1579 UInt32 curMatch; \
1580 UInt32 hv;
1592 static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1596 UInt32 h2, h3;
1607 static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
1611 UInt32 h2, h3;
1623 void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)