16#define ZSTD_LITFREQ_ADD 2
17#define ZSTD_FREQ_DIV 4
18#define ZSTD_MAX_PRICE (1<<30)
20#define ZSTD_PREDEF_THRESHOLD 1024
28# define BITCOST_ACCURACY 0
29# define BITCOST_MULTIPLIER (1 << BITCOST_ACCURACY)
30# define WEIGHT(stat) ((void)opt, ZSTD_bitWeight(stat))
32# define BITCOST_ACCURACY 8
33# define BITCOST_MULTIPLIER (1 << BITCOST_ACCURACY)
34# define WEIGHT(stat,opt) ((void)opt, ZSTD_fracWeight(stat))
36# define BITCOST_ACCURACY 8
37# define BITCOST_MULTIPLIER (1 << BITCOST_ACCURACY)
38# define WEIGHT(stat,opt) (opt ? ZSTD_fracWeight(stat) : ZSTD_bitWeight(stat))
51 U32 const FWeight = (stat << BITCOST_ACCURACY) >> hb;
88 DEBUGLOG(5,
"ZSTD_downscaleStat (nbElts=%u)", (
unsigned)lastEltIndex+1);
90 for (
s=0;
s<lastEltIndex+1;
s++) {
105 const BYTE*
const src,
size_t const srcSize,
109 DEBUGLOG(5,
"ZSTD_rescaleFreqs (srcSize=%u)", (
unsigned)srcSize);
114 DEBUGLOG(5,
"(srcSize <= ZSTD_PREDEF_THRESHOLD) => zop_predef");
123 if (compressedLiterals) {
127 for (lit=0; lit<=
MaxLit; lit++) {
128 U32 const scaleLog = 11;
130 assert(bitCost <= scaleLog);
131 optPtr->
litFreq[lit] = bitCost ? 1 << (scaleLog-bitCost) : 1 ;
136 FSE_CState_t llstate;
140 U32 const scaleLog = 10;
141 U32 const bitCost = FSE_getMaxNbBits(llstate.symbolTT,
ll);
142 assert(bitCost < scaleLog);
148 FSE_CState_t mlstate;
151 for (ml=0; ml<=
MaxML; ml++) {
152 U32 const scaleLog = 10;
153 U32 const bitCost = FSE_getMaxNbBits(mlstate.symbolTT, ml);
154 assert(bitCost < scaleLog);
160 FSE_CState_t ofstate;
163 for (of=0; of<=
MaxOff; of++) {
164 U32 const scaleLog = 10;
165 U32 const bitCost = FSE_getMaxNbBits(ofstate.symbolTT, of);
166 assert(bitCost < scaleLog);
167 optPtr->
offCodeFreq[of] = bitCost ? 1 << (scaleLog-bitCost) : 1 ;
174 if (compressedLiterals) {
187 for (ml=0; ml<=
MaxML; ml++)
193 for (of=0; of<=
MaxOff; of++)
202 if (compressedLiterals)
219 if (litLength == 0)
return 0;
230 for (
u=0;
u < litLength;
u++) {
258 U32 const matchLength,
272 if ((optLevel<2) && offCode >= 20)
282 DEBUGLOG(8,
"ZSTD_getMatchPrice(ml:%u) = %u", matchLength, price);
289 U32 litLength,
const BYTE* literals,
290 U32 offsetCode,
U32 matchLength)
295 for (
u=0;
u < litLength;
u++)
359 return hashTable3[hash3];
372 U32 const mls,
const int extDict)
374 const ZSTD_compressionParameters*
const cParams = &ms->
cParams;
376 U32 const hashLog = cParams->hashLog;
379 U32 const btLog = cParams->chainLog - 1;
380 U32 const btMask = (1 << btLog) - 1;
381 U32 matchIndex = hashTable[
h];
382 size_t commonLengthSmaller=0, commonLengthLarger=0;
386 const BYTE*
const dictEnd = dictBase + dictLimit;
387 const BYTE*
const prefixStart =
base + dictLimit;
392 U32* largerPtr = smallerPtr + 1;
396 size_t bestLength = 8;
397 U32 nbCompares = 1U << cParams->searchLog;
399 U32 predictedSmall = *(bt + 2*((
current-1)&btMask) + 0);
400 U32 predictedLarge = *(bt + 2*((
current-1)&btMask) + 1);
401 predictedSmall += (predictedSmall>0);
402 predictedLarge += (predictedLarge>0);
411 while (nbCompares-- && (matchIndex >= windowLow)) {
412 U32*
const nextPtr = bt + 2*(matchIndex & btMask);
413 size_t matchLength =
MIN(commonLengthSmaller, commonLengthLarger);
417 const U32* predictPtr = bt + 2*((matchIndex-1) & btMask);
418 if (matchIndex == predictedSmall) {
420 *smallerPtr = matchIndex;
421 if (matchIndex <= btLow) { smallerPtr=&dummy32;
break; }
422 smallerPtr = nextPtr+1;
423 matchIndex = nextPtr[1];
424 predictedSmall = predictPtr[1] + (predictPtr[1]>0);
427 if (matchIndex == predictedLarge) {
428 *largerPtr = matchIndex;
429 if (matchIndex <= btLow) { largerPtr=&dummy32;
break; }
431 matchIndex = nextPtr[0];
432 predictedLarge = predictPtr[0] + (predictPtr[0]>0);
437 if (!extDict || (matchIndex+matchLength >= dictLimit)) {
438 assert(matchIndex+matchLength >= dictLimit);
442 match = dictBase + matchIndex;
444 if (matchIndex+matchLength >= dictLimit)
448 if (matchLength > bestLength) {
449 bestLength = matchLength;
450 if (matchLength > matchEndIdx - matchIndex)
451 matchEndIdx = matchIndex + (
U32)matchLength;
454 if (
ip+matchLength == iend) {
458 if (
match[matchLength] <
ip[matchLength]) {
460 *smallerPtr = matchIndex;
461 commonLengthSmaller = matchLength;
462 if (matchIndex <= btLow) { smallerPtr=&dummy32;
break; }
463 smallerPtr = nextPtr+1;
464 matchIndex = nextPtr[1];
467 *largerPtr = matchIndex;
468 commonLengthLarger = matchLength;
469 if (matchIndex <= btLow) { largerPtr=&dummy32;
break; }
471 matchIndex = nextPtr[0];
474 *smallerPtr = *largerPtr = 0;
476 if (bestLength > 384) positions =
MIN(192, (
U32)(bestLength - 384));
478 return MAX(positions, matchEndIdx - (
current + 8));
491 DEBUGLOG(6,
"ZSTD_updateTree_internal, from %u to %u (dictMode:%u)",
516 const U32 lengthToBeat,
519 const ZSTD_compressionParameters*
const cParams = &ms->
cParams;
523 U32 const hashLog = cParams->hashLog;
524 U32 const minMatch = (
mls==3) ? 3 : 4;
527 U32 matchIndex = hashTable[
h];
529 U32 const btLog = cParams->chainLog - 1;
530 U32 const btMask= (1U << btLog) - 1;
531 size_t commonLengthSmaller=0, commonLengthLarger=0;
534 const BYTE*
const dictEnd = dictBase + dictLimit;
535 const BYTE*
const prefixStart =
base + dictLimit;
538 U32 const matchLow = windowLow ? windowLow : 1;
544 U32 nbCompares = 1U << cParams->searchLog;
547 const ZSTD_compressionParameters*
const dmsCParams =
557 U32 const dmsBtLow = dictMode ==
ZSTD_dictMatchState && dmsBtMask < dmsHighLimit - dmsLowLimit ? dmsHighLimit - dmsBtMask : dmsLowLimit;
559 size_t bestLength = lengthToBeat-1;
566 for (repCode = ll0; repCode < lastR; repCode++) {
567 U32 const repOffset = (repCode==
ZSTD_REP_NUM) ? (rep[0] - 1) : rep[repCode];
571 if (repOffset-1 <
current-dictLimit) {
580 dmsBase + repIndex - dmsIndexDelta :
584 && ( ((repOffset-1) <
current - windowLow)
585 & (((
U32)((dictLimit-1) - repIndex) >= 3) ) )
590 && ( ((repOffset-1) <
current - (dmsLowLimit + dmsIndexDelta))
591 & ((
U32)((dictLimit-1) - repIndex) >= 3) )
596 if (repLen > bestLength) {
597 DEBUGLOG(8,
"found repCode %u (ll0:%u, offset:%u) of length %u",
598 repCode, ll0, repOffset, repLen);
600 matches[mnum].off = repCode - ll0;
603 if ( (repLen > sufficient_len)
604 | (
ip+repLen == iLimit) ) {
609 if ((
mls == 3) && (bestLength <
mls)) {
611 if ((matchIndex3 >= matchLow)
612 & (
current - matchIndex3 < (1<<18)) ) {
618 const BYTE*
const match = dictBase + matchIndex3;
624 DEBUGLOG(8,
"found small match with hlog3, of length %u",
632 if ( (mlen > sufficient_len) |
633 (
ip+mlen == iLimit) ) {
642 while (nbCompares-- && (matchIndex >= matchLow)) {
643 U32*
const nextPtr = bt + 2*(matchIndex & btMask);
645 size_t matchLength =
MIN(commonLengthSmaller, commonLengthLarger);
649 assert(matchIndex+matchLength >= dictLimit);
654 match = dictBase + matchIndex;
657 if (matchIndex+matchLength >= dictLimit)
661 if (matchLength > bestLength) {
662 DEBUGLOG(8,
"found match of length %u at distance %u (offCode=%u)",
664 assert(matchEndIdx > matchIndex);
665 if (matchLength > matchEndIdx - matchIndex)
666 matchEndIdx = matchIndex + (
U32)matchLength;
667 bestLength = matchLength;
672 | (
ip+matchLength == iLimit) ) {
678 if (
match[matchLength] <
ip[matchLength]) {
680 *smallerPtr = matchIndex;
681 commonLengthSmaller = matchLength;
682 if (matchIndex <= btLow) { smallerPtr=&dummy32;
break; }
683 smallerPtr = nextPtr+1;
684 matchIndex = nextPtr[1];
686 *largerPtr = matchIndex;
687 commonLengthLarger = matchLength;
688 if (matchIndex <= btLow) { largerPtr=&dummy32;
break; }
690 matchIndex = nextPtr[0];
693 *smallerPtr = *largerPtr = 0;
699 commonLengthSmaller = commonLengthLarger = 0;
700 while (nbCompares-- && (dictMatchIndex > dmsLowLimit)) {
701 const U32*
const nextPtr = dmsBt + 2*(dictMatchIndex & dmsBtMask);
702 size_t matchLength =
MIN(commonLengthSmaller, commonLengthLarger);
703 const BYTE*
match = dmsBase + dictMatchIndex;
705 if (dictMatchIndex+matchLength >= dmsHighLimit)
706 match =
base + dictMatchIndex + dmsIndexDelta;
708 if (matchLength > bestLength) {
709 matchIndex = dictMatchIndex + dmsIndexDelta;
710 DEBUGLOG(8,
"found dms match of length %u at distance %u (offCode=%u)",
712 if (matchLength > matchEndIdx - matchIndex)
713 matchEndIdx = matchIndex + (
U32)matchLength;
714 bestLength = matchLength;
719 | (
ip+matchLength == iLimit) ) {
724 if (dictMatchIndex <= dmsBtLow) {
break; }
725 if (
match[matchLength] <
ip[matchLength]) {
726 commonLengthSmaller = matchLength;
727 dictMatchIndex = nextPtr[1];
730 commonLengthLarger = matchLength;
731 dictMatchIndex = nextPtr[0];
749 U32 const lengthToBeat)
751 const ZSTD_compressionParameters*
const cParams = &ms->
cParams;
752 U32 const matchLengthSearch = cParams->minMatch;
753 DEBUGLOG(8,
"ZSTD_BtGetAllMatches");
756 switch(matchLengthSearch)
781listStats(
const U32*
table,
int lastEltID)
783 int const nbElts = lastEltID + 1;
785 for (enb=0; enb < nbElts; enb++) {
799 const void*
src,
size_t srcSize,
806 const BYTE* anchor = istart;
807 const BYTE*
const iend = istart + srcSize;
808 const BYTE*
const ilimit = iend - 8;
811 const ZSTD_compressionParameters*
const cParams = &ms->
cParams;
814 U32 const minMatch = (cParams->minMatch == 3) ? 3 : 4;
822 DEBUGLOG(5,
"ZSTD_compressBlock_opt_generic: current=%u, prefix=%u, nextToUpdate=%u",
826 ip += (
ip==prefixStart);
829 while (
ip < ilimit) {
833 {
U32 const litlen = (
U32)(
ip - anchor);
834 U32 const ll0 = !litlen;
836 if (!nbMatches) {
ip++;
continue; }
851 U32 const maxOffset =
matches[nbMatches-1].off;
852 DEBUGLOG(6,
"found %u matches of maxLength=%u and maxOffCode=%u at cPos=%u => start new series",
853 nbMatches, maxML, maxOffset, (
U32)(
ip-prefixStart));
855 if (maxML > sufficient_len) {
856 lastSequence.
litlen = litlen;
857 lastSequence.
mlen = maxML;
858 lastSequence.
off = maxOffset;
859 DEBUGLOG(6,
"large match (%u>%u), immediate encoding",
860 maxML, sufficient_len);
873 for (matchNb = 0; matchNb < nbMatches; matchNb++) {
878 U32 const sequencePrice = literalsPrice + matchPrice;
879 DEBUGLOG(7,
"rPos:%u => set initial price : %.2f",
880 pos, ZSTD_fCost(sequencePrice));
897 {
U32 const litlen = (opt[
cur-1].
mlen == 0) ? opt[
cur-1].litlen + 1 : 1;
902 assert(price < 1000000000);
903 if (price <= opt[
cur].price) {
904 DEBUGLOG(7,
"cPos:%zi==rPos:%u : better price (%.2f<=%.2f) using literal (ll==%u) (hist:%u,%u,%u)",
905 inr-istart,
cur, ZSTD_fCost(price), ZSTD_fCost(opt[
cur].price), litlen,
906 opt[
cur-1].rep[0], opt[
cur-1].rep[1], opt[
cur-1].rep[2]);
912 DEBUGLOG(7,
"cPos:%zi==rPos:%u : literal would cost more (%.2f>%.2f) (hist:%u,%u,%u)",
913 inr-istart,
cur, ZSTD_fCost(price), ZSTD_fCost(opt[
cur].price),
914 opt[
cur].rep[0], opt[
cur].rep[1], opt[
cur].rep[2]);
925 if (opt[
cur].mlen != 0) {
934 if (inr > ilimit)
continue;
936 if (
cur == last_pos)
break;
940 DEBUGLOG(7,
"move to next rPos:%u : price is <=",
cur+1);
945 U32 const litlen = (opt[
cur].
mlen == 0) ? opt[
cur].litlen : 0;
956 DEBUGLOG(7,
"cPos:%zi==rPos:%u, found %u matches, of maxLength=%u",
957 inr-istart,
cur, nbMatches, maxML);
959 if ( (maxML > sufficient_len)
961 lastSequence.
mlen = maxML;
963 lastSequence.
litlen = litlen;
971 for (matchNb = 0; matchNb < nbMatches; matchNb++) {
974 U32 const startML = (matchNb>0) ?
matches[matchNb-1].
len+1 : minMatch;
977 DEBUGLOG(7,
"testing match %u => offCode=%4u, mlen=%2u, llen=%2u",
978 matchNb,
matches[matchNb].off, lastML, litlen);
980 for (mlen = lastML; mlen >= startML; mlen--) {
984 if ((
pos > last_pos) || (price < opt[
pos].price)) {
985 DEBUGLOG(7,
"rPos:%u (ml=%2u) => new better price (%.2f<%.2f)",
986 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[
pos].price));
993 DEBUGLOG(7,
"rPos:%u (ml=%2u) => new price is worse (%.2f>=%.2f)",
994 pos, mlen, ZSTD_fCost(price), ZSTD_fCost(opt[
pos].price));
995 if (optLevel==0)
break;
1000 lastSequence = opt[last_pos];
1005 assert(opt[0].mlen == 0);
1011 if (lastSequence.
mlen != 0) {
1013 memcpy(rep, &reps,
sizeof(reps));
1018 {
U32 const storeEnd =
cur + 1;
1019 U32 storeStart = storeEnd;
1022 DEBUGLOG(6,
"start reverse traversal (last_pos:%u, cur:%u)",
1023 last_pos,
cur); (
void)last_pos;
1025 DEBUGLOG(6,
"last sequence copied into pos=%u (llen=%u,mlen=%u,ofc=%u)",
1026 storeEnd, lastSequence.
litlen, lastSequence.
mlen, lastSequence.
off);
1027 opt[storeEnd] = lastSequence;
1028 while (seqPos > 0) {
1031 DEBUGLOG(6,
"sequence from rPos=%u copied into pos=%u (llen=%u,mlen=%u,ofc=%u)",
1032 seqPos, storeStart, opt[seqPos].litlen, opt[seqPos].mlen, opt[seqPos].off);
1033 opt[storeStart] = opt[seqPos];
1034 seqPos = (seqPos > backDist) ? seqPos - backDist : 0;
1038 DEBUGLOG(6,
"sending selected sequences into seqStore")
1040 for (storePos=storeStart; storePos <= storeEnd; storePos++) {
1042 U32 const mlen = opt[storePos].
mlen;
1043 U32 const offCode = opt[storePos].
off;
1045 DEBUGLOG(6,
"considering seq starting at %zi, llen=%u, mlen=%u",
1046 anchor - istart, (
unsigned)llen, (
unsigned)mlen);
1049 assert(storePos == storeEnd);
1054 assert(anchor + llen <= iend);
1065 return (
size_t)(iend - anchor);
1071 const void*
src,
size_t srcSize)
1073 DEBUGLOG(5,
"ZSTD_compressBlock_btopt");
1083 for (
s=0;
s<lastEltIndex+1;
s++) {
1110 const void*
src,
size_t srcSize)
1113 memcpy(tmpRep, rep,
sizeof(tmpRep));
1115 DEBUGLOG(4,
"ZSTD_initStats_ultra (srcSize=%zu)", srcSize);
1136 const void*
src,
size_t srcSize)
1138 DEBUGLOG(5,
"ZSTD_compressBlock_btultra (srcSize=%zu)", srcSize);
1144 const void*
src,
size_t srcSize)
1147 DEBUGLOG(5,
"ZSTD_compressBlock_btultra2 (srcSize=%zu)", srcSize);
1172 const void*
src,
size_t srcSize)
1179 const void*
src,
size_t srcSize)
1186 const void*
src,
size_t srcSize)
1193 const void*
src,
size_t srcSize)
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
void mls(int argc, const char *argv[])
MEM_STATIC U32 MEM_read32(const void *memPtr)
MEM_STATIC unsigned MEM_isLittleEndian(void)
GLuint GLsizei GLsizei * length
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
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 * u
unsigned HIST_count_simple(unsigned *count, unsigned *maxSymbolValuePtr, const void *src, size_t srcSize)
U32 HUF_getNbBits(const void *symbolTable, U32 symbolValue)
#define memcpy(s1, s2, n)
struct task_struct * current
static IHTMLWindow2 * window
static int sum(int x_, int y_)
FSE_CTable offcodeCTable[FSE_CTABLE_SIZE_U32(OffFSELog, MaxOff)]
FSE_CTable litlengthCTable[FSE_CTABLE_SIZE_U32(LLFSELog, MaxLL)]
FSE_CTable matchlengthCTable[FSE_CTABLE_SIZE_U32(MLFSELog, MaxML)]
U32 CTable[HUF_CTABLE_SIZE_U32(255)]
ZSTD_compressionParameters cParams
const ZSTD_matchState_t * dictMatchState
ZSTD_match_t * matchTable
ZSTD_optimal_t * priceTable
U32 matchLengthSumBasePrice
U32 litLengthSumBasePrice
ZSTD_OptPrice_e priceType
unsigned * matchLengthFreq
ZSTD_literalCompressionMode_e literalCompressionMode
const ZSTD_entropyCTables_t * symbolCosts
#define FORCE_INLINE_TEMPLATE
#define ZSTD_BLOCKSIZE_MAX
void ZSTD_resetSeqStore(seqStore_t *ssPtr)
MEM_STATIC U32 ZSTD_MLcode(U32 mlBase)
MEM_STATIC size_t ZSTD_count_2segments(const BYTE *ip, const BYTE *match, const BYTE *iEnd, const BYTE *mEnd, const BYTE *iStart)
MEM_STATIC repcodes_t ZSTD_updateRep(U32 const rep[3], U32 const offset, U32 const ll0)
MEM_STATIC size_t ZSTD_hashPtr(const void *p, U32 hBits, U32 mls)
MEM_STATIC U32 ZSTD_LLcode(U32 litLength)
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)
MEM_STATIC size_t ZSTD_hash3Ptr(const void *ptr, U32 h)
HINT_INLINE UNUSED_ATTR void ZSTD_storeSeq(seqStore_t *seqStorePtr, size_t litLength, const BYTE *literals, const BYTE *litLimit, U32 offCode, size_t mlBase)
MEM_STATIC U32 ZSTD_highbit32(U32 val)
static const U32 ML_bits[MaxML+1]
static const U32 LL_bits[MaxLL+1]
#define ZSTD_STATIC_ASSERT(c)
MEM_STATIC U32 ZSTD_fracWeight(U32 rawStat)
FORCE_INLINE_TEMPLATE U32 ZSTD_getMatchPrice(U32 const offset, U32 const matchLength, const optState_t *const optPtr, int const optLevel)
FORCE_INLINE_TEMPLATE U32 ZSTD_insertBtAndGetAllMatches(ZSTD_match_t *matches, ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *const ip, const BYTE *const iLimit, const ZSTD_dictMode_e dictMode, const U32 rep[ZSTD_REP_NUM], U32 const ll0, const U32 lengthToBeat, U32 const mls)
static void ZSTD_rescaleFreqs(optState_t *const optPtr, const BYTE *const src, size_t const srcSize, int const optLevel)
static U32 ZSTD_upscaleStat(unsigned *table, U32 lastEltIndex, int bonus)
#define WEIGHT(stat, opt)
MEM_STATIC U32 ZSTD_bitWeight(U32 stat)
size_t ZSTD_compressBlock_btopt_extDict(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
FORCE_INLINE_TEMPLATE size_t ZSTD_compressBlock_opt_generic(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize, const int optLevel, const ZSTD_dictMode_e dictMode)
size_t ZSTD_compressBlock_btopt(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
static U32 ZSTD_insertBt1(ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iend, U32 const mls, const int extDict)
static void ZSTD_setBasePrices(optState_t *optPtr, int optLevel)
static U32 ZSTD_insertAndFindFirstIndexHash3(ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *const ip)
#define BITCOST_MULTIPLIER
MEM_STATIC U32 ZSTD_readMINMATCH(const void *memPtr, U32 length)
static U32 ZSTD_litLengthPrice(U32 const litLength, const optState_t *const optPtr, int optLevel)
void ZSTD_updateTree(ZSTD_matchState_t *ms, const BYTE *ip, const BYTE *iend)
static U32 ZSTD_downscaleStat(unsigned *table, U32 lastEltIndex, int malus)
static void ZSTD_updateStats(optState_t *const optPtr, U32 litLength, const BYTE *literals, U32 offsetCode, U32 matchLength)
MEM_STATIC void ZSTD_upscaleStats(optState_t *optPtr)
FORCE_INLINE_TEMPLATE void ZSTD_updateTree_internal(ZSTD_matchState_t *ms, const BYTE *const ip, const BYTE *const iend, const U32 mls, const ZSTD_dictMode_e dictMode)
static U32 ZSTD_totalLen(ZSTD_optimal_t sol)
static U32 ZSTD_rawLiteralsCost(const BYTE *const literals, U32 const litLength, const optState_t *const optPtr, int optLevel)
size_t ZSTD_compressBlock_btultra_dictMatchState(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
static int ZSTD_compressedLiterals(optState_t const *const optPtr)
size_t ZSTD_compressBlock_btultra_extDict(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
size_t ZSTD_compressBlock_btultra2(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
size_t ZSTD_compressBlock_btultra(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
size_t ZSTD_compressBlock_btopt_dictMatchState(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
FORCE_INLINE_TEMPLATE U32 ZSTD_BtGetAllMatches(ZSTD_match_t *matches, ZSTD_matchState_t *ms, U32 *nextToUpdate3, const BYTE *ip, const BYTE *const iHighLimit, const ZSTD_dictMode_e dictMode, const U32 rep[ZSTD_REP_NUM], U32 const ll0, U32 const lengthToBeat)
static void ZSTD_initStats_ultra(ZSTD_matchState_t *ms, seqStore_t *seqStore, U32 rep[ZSTD_REP_NUM], const void *src, size_t srcSize)
#define ZSTD_PREDEF_THRESHOLD