Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:HUF_setMaxHeight

Proto:static U32 HUF_setMaxHeight(nodeElt *huffNode, U32 lastNonNull, U32 maxNbBits)

Type:U32

Parameter:

TypeParameterName
nodeElt *huffNode
U32lastNonNull
U32maxNbBits
292  largestBits = nbBits
293  If largestBits <= maxNbBits Then Return largestBits
298  totalCost = 0
299  baseCost = 1 << largestBits - maxNbBits
300  n = lastNonNull
302  When nbBits > maxNbBits cycle
303  totalCost += baseCost - (1 << largestBits - nbBits )
304  nbBits = maxNbBits
305  n--
307  When nbBits == maxNbBits cycle
308  n--
315  noSymbol = 0xF0F0F0F0
320  memset(rankLast, 0xF0, size of rankLast )
323  When pos >= 0 cycle
324  If nbBits >= currNbBits Then Continue
326  currNbBits = nbBits
331  When totalCost > 0 cycle
350  nBitsToDecrease++
351  totalCost -= 1 << nBitsToDecrease - 1
354  nbBits++
357  Else
364  When totalCost < 0 cycle
366  If rankLast[1] == noSymbol Then
367  When nbBits == maxNbBits cycle
368  n--
369  nbBits--
370  rankLast[1] = n + 1
371  totalCost++
372  Continue
374  nbBits--
375  rankLast[1]++
376  totalCost++
381  Return maxNbBits
Caller
NameDescribe
HUF_buildCTable_wksp