ssPtr 43 lib/zstd/compress.c static void ZSTD_resetSeqStore(seqStore_t *ssPtr) ssPtr 45 lib/zstd/compress.c ssPtr->lit = ssPtr->litStart; ssPtr 46 lib/zstd/compress.c ssPtr->sequences = ssPtr->sequencesStart; ssPtr 47 lib/zstd/compress.c ssPtr->longLengthID = 0; ssPtr 29 lib/zstd/zstd_opt.h FORCE_INLINE void ZSTD_setLog2Prices(seqStore_t *ssPtr) ssPtr 31 lib/zstd/zstd_opt.h ssPtr->log2matchLengthSum = ZSTD_highbit32(ssPtr->matchLengthSum + 1); ssPtr 32 lib/zstd/zstd_opt.h ssPtr->log2litLengthSum = ZSTD_highbit32(ssPtr->litLengthSum + 1); ssPtr 33 lib/zstd/zstd_opt.h ssPtr->log2litSum = ZSTD_highbit32(ssPtr->litSum + 1); ssPtr 34 lib/zstd/zstd_opt.h ssPtr->log2offCodeSum = ZSTD_highbit32(ssPtr->offCodeSum + 1); ssPtr 35 lib/zstd/zstd_opt.h ssPtr->factor = 1 + ((ssPtr->litSum >> 5) / ssPtr->litLengthSum) + ((ssPtr->litSum << 1) / (ssPtr->litSum + ssPtr->matchSum)); ssPtr 38 lib/zstd/zstd_opt.h ZSTD_STATIC void ZSTD_rescaleFreqs(seqStore_t *ssPtr, const BYTE *src, size_t srcSize) ssPtr 42 lib/zstd/zstd_opt.h ssPtr->cachedLiterals = NULL; ssPtr 43 lib/zstd/zstd_opt.h ssPtr->cachedPrice = ssPtr->cachedLitLength = 0; ssPtr 44 lib/zstd/zstd_opt.h ssPtr->staticPrices = 0; ssPtr 46 lib/zstd/zstd_opt.h if (ssPtr->litLengthSum == 0) { ssPtr 48 lib/zstd/zstd_opt.h ssPtr->staticPrices = 1; ssPtr 51 lib/zstd/zstd_opt.h ssPtr->litFreq[u] = 0; ssPtr 53 lib/zstd/zstd_opt.h ssPtr->litFreq[src[u]]++; ssPtr 55 lib/zstd/zstd_opt.h ssPtr->litSum = 0; ssPtr 56 lib/zstd/zstd_opt.h ssPtr->litLengthSum = MaxLL + 1; ssPtr 57 lib/zstd/zstd_opt.h ssPtr->matchLengthSum = MaxML + 1; ssPtr 58 lib/zstd/zstd_opt.h ssPtr->offCodeSum = (MaxOff + 1); ssPtr 59 lib/zstd/zstd_opt.h ssPtr->matchSum = (ZSTD_LITFREQ_ADD << Litbits); ssPtr 62 lib/zstd/zstd_opt.h ssPtr->litFreq[u] = 1 + (ssPtr->litFreq[u] >> ZSTD_FREQ_DIV); ssPtr 63 lib/zstd/zstd_opt.h ssPtr->litSum += ssPtr->litFreq[u]; ssPtr 66 lib/zstd/zstd_opt.h ssPtr->litLengthFreq[u] = 1; ssPtr 68 lib/zstd/zstd_opt.h ssPtr->matchLengthFreq[u] = 1; ssPtr 70 lib/zstd/zstd_opt.h ssPtr->offCodeFreq[u] = 1; ssPtr 72 lib/zstd/zstd_opt.h ssPtr->matchLengthSum = 0; ssPtr 73 lib/zstd/zstd_opt.h ssPtr->litLengthSum = 0; ssPtr 74 lib/zstd/zstd_opt.h ssPtr->offCodeSum = 0; ssPtr 75 lib/zstd/zstd_opt.h ssPtr->matchSum = 0; ssPtr 76 lib/zstd/zstd_opt.h ssPtr->litSum = 0; ssPtr 79 lib/zstd/zstd_opt.h ssPtr->litFreq[u] = 1 + (ssPtr->litFreq[u] >> (ZSTD_FREQ_DIV + 1)); ssPtr 80 lib/zstd/zstd_opt.h ssPtr->litSum += ssPtr->litFreq[u]; ssPtr 83 lib/zstd/zstd_opt.h ssPtr->litLengthFreq[u] = 1 + (ssPtr->litLengthFreq[u] >> (ZSTD_FREQ_DIV + 1)); ssPtr 84 lib/zstd/zstd_opt.h ssPtr->litLengthSum += ssPtr->litLengthFreq[u]; ssPtr 87 lib/zstd/zstd_opt.h ssPtr->matchLengthFreq[u] = 1 + (ssPtr->matchLengthFreq[u] >> ZSTD_FREQ_DIV); ssPtr 88 lib/zstd/zstd_opt.h ssPtr->matchLengthSum += ssPtr->matchLengthFreq[u]; ssPtr 89 lib/zstd/zstd_opt.h ssPtr->matchSum += ssPtr->matchLengthFreq[u] * (u + 3); ssPtr 91 lib/zstd/zstd_opt.h ssPtr->matchSum *= ZSTD_LITFREQ_ADD; ssPtr 93 lib/zstd/zstd_opt.h ssPtr->offCodeFreq[u] = 1 + (ssPtr->offCodeFreq[u] >> ZSTD_FREQ_DIV); ssPtr 94 lib/zstd/zstd_opt.h ssPtr->offCodeSum += ssPtr->offCodeFreq[u]; ssPtr 98 lib/zstd/zstd_opt.h ZSTD_setLog2Prices(ssPtr); ssPtr 101 lib/zstd/zstd_opt.h FORCE_INLINE U32 ZSTD_getLiteralPrice(seqStore_t *ssPtr, U32 litLength, const BYTE *literals) ssPtr 105 lib/zstd/zstd_opt.h if (ssPtr->staticPrices) ssPtr 109 lib/zstd/zstd_opt.h return ssPtr->log2litLengthSum - ZSTD_highbit32(ssPtr->litLengthFreq[0] + 1); ssPtr 112 lib/zstd/zstd_opt.h if (ssPtr->cachedLiterals == literals) { ssPtr 113 lib/zstd/zstd_opt.h U32 const additional = litLength - ssPtr->cachedLitLength; ssPtr 114 lib/zstd/zstd_opt.h const BYTE *literals2 = ssPtr->cachedLiterals + ssPtr->cachedLitLength; ssPtr 115 lib/zstd/zstd_opt.h price = ssPtr->cachedPrice + additional * ssPtr->log2litSum; ssPtr 117 lib/zstd/zstd_opt.h price -= ZSTD_highbit32(ssPtr->litFreq[literals2[u]] + 1); ssPtr 118 lib/zstd/zstd_opt.h ssPtr->cachedPrice = price; ssPtr 119 lib/zstd/zstd_opt.h ssPtr->cachedLitLength = litLength; ssPtr 121 lib/zstd/zstd_opt.h price = litLength * ssPtr->log2litSum; ssPtr 123 lib/zstd/zstd_opt.h price -= ZSTD_highbit32(ssPtr->litFreq[literals[u]] + 1); ssPtr 126 lib/zstd/zstd_opt.h ssPtr->cachedLiterals = literals; ssPtr 127 lib/zstd/zstd_opt.h ssPtr->cachedPrice = price; ssPtr 128 lib/zstd/zstd_opt.h ssPtr->cachedLitLength = litLength; ssPtr 136 lib/zstd/zstd_opt.h price += LL_bits[llCode] + ssPtr->log2litLengthSum - ZSTD_highbit32(ssPtr->litLengthFreq[llCode] + 1);