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:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Secondary normalization method.To be used when primary method fails.

Proto:static size_t FSE_normalizeM2(short *norm, U32 tableLog, const unsigned *count, size_t total, U32 maxSymbolValue)

Type:size_t

Parameter:

TypeParameterName
short *norm
U32tableLog
const unsigned *count
size_ttotal
U32maxSymbolValue
521  NOT_YET_ASSIGNED = -2
523  distributed = 0
527  lowThreshold = total >> tableLog
528  lowOne = total * 3 >> tableLog + 1
530  When s <= maxSymbolValue cycle
531  If count[s] == 0 Then
532  norm[s] = 0
533  Continue
535  If count[s] <= lowThreshold Then
536  norm[s] = -1
537  distributed++
538  total -= count[s]
539  Continue
541  If count[s] <= lowOne Then
542  norm[s] = 1
543  distributed++
544  total -= count[s]
545  Continue
548  norm[s] = NOT_YET_ASSIGNED
550  ToDistribute = (1 << tableLog) - distributed
552  If total / ToDistribute > lowOne Then
554  lowOne = total * 3 / ToDistribute * 2
555  When s <= maxSymbolValue cycle
556  If norm[s] == NOT_YET_ASSIGNED && count[s] <= lowOne Then
557  norm[s] = 1
558  distributed++
559  total -= count[s]
560  Continue
563  ToDistribute = (1 << tableLog) - distributed
566  If distributed == maxSymbolValue + 1 Then
570  maxV = 0 , maxC = 0
571  When s <= maxSymbolValue cycle If count[s] > maxC Then
573  maxV = s , maxC = count[s]
574  norm[maxV] += ToDistribute
575  Return 0
578  If total == 0 Then
580  When ToDistribute > 0 cycle If norm[s] > 0 Then
582  ToDistribute--, norm[s]++
583  Return 0
587  vStepLog = 62 - tableLog
588  mid = (1ULL << vStepLog - 1 ) - 1
589  rStep = 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
590  tmpTotal = mid
591  When s <= maxSymbolValue cycle
592  If norm[s] == NOT_YET_ASSIGNED Then
605  Return 0
Caller
NameDescribe
FSE_normalizeCount