Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\zstd_opt.h Create Date:2022-07-28 07:04:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ZSTD_rescaleFreqs

Proto:ZSTD_STATIC void ZSTD_rescaleFreqs(seqStore_t *ssPtr, const BYTE *src, size_t srcSize)

Type:void

Parameter:

TypeParameterName
seqStore_t *ssPtr
const BYTE *src
size_tsrcSize
42  cachedLiterals = NULL
43  cachedPrice = cachedLitLength = 0
44  staticPrices = 0
46  If litLengthSum == 0 Then
47  If srcSize <= 1024 Then staticPrices = 1
50  When u <= MaxLit cycle litFreq[u] = 0
52  When u < srcSize cycle litFreq[src[u]]++
55  litSum = 0
56  litLengthSum = MaxLL + 1
57  matchLengthSum = MaxML + 1
58  offCodeSum = MaxOff + 1
59  matchSum = ZSTD_LITFREQ_ADD << Litbits
61  When u <= MaxLit cycle
62  litFreq[u] = 1 + (litFreq[u] >> ZSTD_FREQ_DIV)
63  litSum += litFreq[u]
65  When u <= MaxLL cycle litLengthFreq[u] = 1
67  When u <= MaxML cycle matchLengthFreq[u] = 1
69  When u <= MaxOff cycle offCodeFreq[u] = 1
71  Else
72  matchLengthSum = 0
73  litLengthSum = 0
74  offCodeSum = 0
75  matchSum = 0
76  litSum = 0
78  When u <= MaxLit cycle
79  litFreq[u] = 1 + (litFreq[u] >> ZSTD_FREQ_DIV + 1 )
80  litSum += litFreq[u]
82  When u <= MaxLL cycle
83  litLengthFreq[u] = 1 + (litLengthFreq[u] >> ZSTD_FREQ_DIV + 1 )
86  When u <= MaxML cycle
89  matchSum += matchLengthFreq[u] * (u + 3)
91  matchSum *= ZSTD_LITFREQ_ADD
92  When u <= MaxOff cycle
98  -************************************** Price functions for optimal parser