Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:FSE_normalizeCount

Proto:size_t FSE_normalizeCount(short *normalizedCounter, unsigned tableLog, const unsigned *count, size_t total, unsigned maxSymbolValue)

Type:size_t

Parameter:

TypeParameterName
short *normalizedCounter
unsignedtableLog
const unsigned *count
size_ttotal
unsignedmaxSymbolValue
611  If tableLog == 0 Then tableLog = FSE_DEFAULT_TABLELOG
613  If tableLog < FSE_MIN_TABLELOG Then Return -***************************************** Error codes handling(GENERIC)
615  If tableLog > Constants Then Return -***************************************** Error codes handling(tableLog_tooLarge)
617  If tableLog < provides the minimum logSize to safely represent a distribution Then Return -***************************************** Error codes handling(GENERIC)
621  U32 const rtbTable[] = {0, 473195, 504333, 520860, 550000, 700000, 750000, 830000}
622  scale = 62 - tableLog
623  step = div_u64 - unsigned 64bit divide with 32bit divisor*@dividend: unsigned 64bit dividend*@divisor: unsigned 32bit divisor* This is the most common 64bit divide and should be used if possible,* as many 32bit archs can optimize this variant better than a full
624  vStep = 1ULL << scale - 20
625  stillToDistribute = 1 << tableLog
627  largest = 0
628  largestP = 0
629  lowThreshold = total >> tableLog
631  When s <= maxSymbolValue cycle
632  If count[s] == total Then Return 0
634  If count[s] == 0 Then
635  normalizedCounter[s] = 0
636  Continue
638  If count[s] <= lowThreshold Then
639  normalizedCounter[s] = -1
641  Else
642  proba = count[s] * step >> scale
643  If proba < 8 Then
645  proba += count[s] * step - (proba << scale) > restToBeat
647  If proba > largestP Then largestP = proba , largest = s
653  If -stillToDistribute >= normalizedCounter[largest] >> 1 Then
656  If Error Management Then Return errorCode
658  Else normalizedCounter[largest] += stillToDistribute
662  Return tableLog
Caller
NameDescribe
HUF_compressWeights_wksp
ZSTD_compressSequences_internal