18 const ZSTD_compressionParameters*
const cParams = &ms->
cParams;
20 U32 const hBitsL = cParams->hashLog;
21 U32 const mls = cParams->minMatch;
23 U32 const hBitsS = cParams->chainLog;
27 const U32 fastHashFillStep = 3;
33 for (;
ip + fastHashFillStep - 1 <= iend;
ip += fastHashFillStep) {
36 for (
i = 0;
i < fastHashFillStep; ++
i) {
41 if (
i == 0 || hashLarge[lgHash] == 0)
53 void const*
src,
size_t srcSize,
56 ZSTD_compressionParameters
const* cParams = &ms->
cParams;
58 const U32 hBitsL = cParams->hashLog;
60 const U32 hBitsS = cParams->chainLog;
64 const BYTE* anchor = istart;
65 const U32 endIndex = (
U32)((
size_t)(istart -
base) + srcSize);
68 const BYTE*
const prefixLowest =
base + prefixLowestIndex;
69 const BYTE*
const iend = istart + srcSize;
71 U32 offset_1=rep[0], offset_2=rep[1];
75 const ZSTD_compressionParameters*
const dictCParams =
87 dictBase + dictStartIndex :
NULL;
91 prefixLowestIndex - (
U32)(dictEnd - dictBase) :
94 dictCParams->hashLog : hBitsL;
96 dictCParams->chainLog : hBitsS;
97 const U32 dictAndPrefixLength = (
U32)((
ip - prefixLowest) + (dictEnd - dictStart));
99 DEBUGLOG(5,
"ZSTD_compressBlock_doubleFast_generic");
109 ip += (dictAndPrefixLength == 0);
114 if (offset_2 > maxRep) offsetSaved = offset_2, offset_2 = 0;
115 if (offset_1 > maxRep) offsetSaved = offset_1, offset_1 = 0;
120 assert(offset_1 <= dictAndPrefixLength);
121 assert(offset_2 <= dictAndPrefixLength);
125 while (
ip < ilimit) {
133 U32 const matchIndexL = hashLong[h2];
134 U32 matchIndexS = hashSmall[
h];
135 const BYTE* matchLong =
base + matchIndexL;
139 && repIndex < prefixLowestIndex) ?
140 dictBase + (repIndex - dictIndexDelta) :
142 hashLong[h2] = hashSmall[
h] =
current;
146 && ((
U32)((prefixLowestIndex-1) - repIndex) >= 3 )
148 const BYTE* repMatchEnd = repIndex < prefixLowestIndex ? dictEnd : iend;
164 if (matchIndexL > prefixLowestIndex) {
169 while (((
ip>anchor) & (matchLong>prefixLowest)) && (
ip[-1] == matchLong[-1])) {
ip--; matchLong--; mLength++; }
174 U32 const dictMatchIndexL = dictHashLong[dictHL];
175 const BYTE* dictMatchL = dictBase + dictMatchIndexL;
176 assert(dictMatchL < dictEnd);
181 while (((
ip>anchor) & (dictMatchL>dictStart)) && (
ip[-1] == dictMatchL[-1])) {
ip--; dictMatchL--; mLength++; }
185 if (matchIndexS > prefixLowestIndex) {
188 goto _search_next_long;
192 U32 const dictMatchIndexS = dictHashSmall[dictHS];
193 match = dictBase + dictMatchIndexS;
194 matchIndexS = dictMatchIndexS + dictIndexDelta;
197 goto _search_next_long;
201#if defined(__aarch64__)
210 U32 const matchIndexL3 = hashLong[hl3];
211 const BYTE* matchL3 =
base + matchIndexL3;
215 if (matchIndexL3 > prefixLowestIndex) {
220 while (((
ip>anchor) & (matchL3>prefixLowest)) && (
ip[-1] == matchL3[-1])) {
ip--; matchL3--; mLength++; }
225 U32 const dictMatchIndexL3 = dictHashLong[dictHLNext];
226 const BYTE* dictMatchL3 = dictBase + dictMatchIndexL3;
227 assert(dictMatchL3 < dictEnd);
232 while (((
ip>anchor) & (dictMatchL3>dictStart)) && (
ip[-1] == dictMatchL3[-1])) {
ip--; dictMatchL3--; mLength++; }
272 while (
ip <= ilimit) {
274 U32 const repIndex2 = current2 - offset_2;
276 && repIndex2 < prefixLowestIndex ?
277 dictBase + repIndex2 - dictIndexDelta :
279 if ( ((
U32)((prefixLowestIndex-1) - (
U32)repIndex2) >= 3 )
281 const BYTE*
const repEnd2 = repIndex2 < prefixLowestIndex ? dictEnd : iend;
283 U32 tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset;
295 while ( (
ip <= ilimit)
300 U32 const tmpOff = offset_2; offset_2 = offset_1; offset_1 = tmpOff;
311 rep[0] = offset_1 ? offset_1 : offsetSaved;
312 rep[1] = offset_2 ? offset_2 : offsetSaved;
315 return (
size_t)(iend - anchor);
321 void const*
src,
size_t srcSize)
341 void const*
src,
size_t srcSize)
361 void const*
src,
size_t srcSize,
364 ZSTD_compressionParameters
const* cParams = &ms->
cParams;
366 U32 const hBitsL = cParams->hashLog;
368 U32 const hBitsS = cParams->chainLog;
371 const BYTE* anchor = istart;
372 const BYTE*
const iend = istart + srcSize;
373 const BYTE*
const ilimit = iend - 8;
375 const U32 endIndex = (
U32)((
size_t)(istart -
base) + srcSize);
377 const U32 dictStartIndex = lowLimit;
379 const U32 prefixStartIndex = (dictLimit > lowLimit) ? dictLimit : lowLimit;
380 const BYTE*
const prefixStart =
base + prefixStartIndex;
382 const BYTE*
const dictStart = dictBase + dictStartIndex;
383 const BYTE*
const dictEnd = dictBase + prefixStartIndex;
384 U32 offset_1=rep[0], offset_2=rep[1];
386 DEBUGLOG(5,
"ZSTD_compressBlock_doubleFast_extDict_generic (srcSize=%zu)", srcSize);
389 if (prefixStartIndex == dictStartIndex)
393 while (
ip < ilimit) {
395 const U32 matchIndex = hashSmall[hSmall];
396 const BYTE*
const matchBase = matchIndex < prefixStartIndex ? dictBase :
base;
397 const BYTE*
match = matchBase + matchIndex;
400 const U32 matchLongIndex = hashLong[hLong];
401 const BYTE*
const matchLongBase = matchLongIndex < prefixStartIndex ? dictBase :
base;
402 const BYTE* matchLong = matchLongBase + matchLongIndex;
406 const BYTE*
const repBase = repIndex < prefixStartIndex ? dictBase :
base;
407 const BYTE*
const repMatch = repBase + repIndex;
409 hashSmall[hSmall] = hashLong[hLong] =
current;
411 if ((((
U32)((prefixStartIndex-1) - repIndex) >= 3)
412 & (repIndex > dictStartIndex))
414 const BYTE* repMatchEnd = repIndex < prefixStartIndex ? dictEnd : iend;
420 const BYTE*
const matchEnd = matchLongIndex < prefixStartIndex ? dictEnd : iend;
421 const BYTE*
const lowMatchPtr = matchLongIndex < prefixStartIndex ? dictStart : prefixStart;
425 while (((
ip>anchor) & (matchLong>lowMatchPtr)) && (
ip[-1] == matchLong[-1])) {
ip--; matchLong--; mLength++; }
432 U32 const matchIndex3 = hashLong[h3];
433 const BYTE*
const match3Base = matchIndex3 < prefixStartIndex ? dictBase :
base;
434 const BYTE* match3 = match3Base + matchIndex3;
438 const BYTE*
const matchEnd = matchIndex3 < prefixStartIndex ? dictEnd : iend;
439 const BYTE*
const lowMatchPtr = matchIndex3 < prefixStartIndex ? dictStart : prefixStart;
443 while (((
ip>anchor) & (match3>lowMatchPtr)) && (
ip[-1] == match3[-1])) {
ip--; match3--; mLength++; }
445 const BYTE*
const matchEnd = matchIndex < prefixStartIndex ? dictEnd : iend;
446 const BYTE*
const lowMatchPtr = matchIndex < prefixStartIndex ? dictStart : prefixStart;
475 while (
ip <= ilimit) {
477 U32 const repIndex2 = current2 - offset_2;
478 const BYTE* repMatch2 = repIndex2 < prefixStartIndex ? dictBase + repIndex2 :
base + repIndex2;
479 if ( (((
U32)((prefixStartIndex-1) - repIndex2) >= 3)
480 & (repIndex2 > dictStartIndex))
482 const BYTE*
const repEnd2 = repIndex2 < prefixStartIndex ? dictEnd : iend;
484 U32 const tmpOffset = offset_2; offset_2 = offset_1; offset_1 = tmpOffset;
500 return (
size_t)(iend - anchor);
506 void const*
src,
size_t srcSize)
void mls(int argc, const char *argv[])
MEM_STATIC U32 MEM_read32(const void *memPtr)
MEM_STATIC U64 MEM_read64(const void *memPtr)
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct task_struct * current
ZSTD_compressionParameters cParams
const ZSTD_matchState_t * dictMatchState
#define FORCE_INLINE_TEMPLATE
MEM_STATIC size_t ZSTD_count_2segments(const BYTE *ip, const BYTE *match, const BYTE *iEnd, const BYTE *mEnd, const BYTE *iStart)
MEM_STATIC size_t ZSTD_hashPtr(const void *p, U32 hBits, U32 mls)
MEM_STATIC U32 ZSTD_getLowestPrefixIndex(const ZSTD_matchState_t *ms, U32 current, unsigned windowLog)
MEM_STATIC U32 ZSTD_getLowestMatchIndex(const ZSTD_matchState_t *ms, U32 current, unsigned windowLog)
MEM_STATIC size_t ZSTD_count(const BYTE *pIn, const BYTE *pMatch, const BYTE *const pInLimit)
HINT_INLINE UNUSED_ATTR void ZSTD_storeSeq(seqStore_t *seqStorePtr, size_t litLength, const BYTE *literals, const BYTE *litLimit, U32 offCode, size_t mlBase)
ZSTD_dictTableLoadMethod_e
size_t ZSTD_compressBlock_doubleFast(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
void ZSTD_fillDoubleHashTable(ZSTD_matchState_t *ms, void const *end, ZSTD_dictTableLoadMethod_e dtlm)
size_t ZSTD_compressBlock_doubleFast_extDict(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
size_t ZSTD_compressBlock_doubleFast_dictMatchState(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize)
static size_t ZSTD_compressBlock_doubleFast_extDict_generic(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls)
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_doubleFast_generic(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], void const *src, size_t srcSize, U32 const mls, ZSTD_dictMode_e const dictMode)