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

Name:HUF_compressWeights_wksp

Proto:size_t HUF_compressWeights_wksp(void *dst, size_t dstSize, const void *weightTable, size_t wtSize, void *workspace, size_t workspaceSize)

Type:size_t

Parameter:

TypeParameterName
void *dst
size_tdstSize
const void *weightTable
size_twtSize
void *workspace
size_tworkspaceSize
84  ostart = dst
85  op = ostart
86  oend = ostart + dstSize
88  maxSymbolValue = max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG
89  tableLog = HUF_compressWeights() :* Same as FSE_compress(), but dedicated to huff0's weights compression.* The use case needs much less stack memory.* Note : all elements within weightTable are supposed to be <= HUF_TABLELOG_MAX.
94  spaceUsed32 = 0
98  CTable = workspace + spaceUsed32
99  spaceUsed32 += It is possible to statically allocate FSE CTable/DTable as a table of FSE_CTable/FSE_DTable using below macros (HUF_compressWeights() :* Same as FSE_compress(), but dedicated to huff0's weights compression.* The use case needs much less stack memory.* Note : all elements within weightTable are supposed to be <= HUF_TABLELOG_MAX., max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG )
100  count = workspace + spaceUsed32
101  spaceUsed32 += max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG + 1
102  norm = workspace + spaceUsed32
103  spaceUsed32 += @a is a power of 2 value (sizeof(S16) * (max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG + 1), sizeof(U32)) >> 2
105  If spaceUsed32 << 2 > workspaceSize Then Return -***************************************** Error codes handling(tableLog_tooLarge)
107  workspace = workspace + spaceUsed32
108  workspaceSize -= spaceUsed32 << 2
111  If wtSize <= 1 Then Return 0
116  CHECK_V_F(maxCount, : count of most numerous element)
117  If maxCount == wtSize Then Return 1
119  If maxCount == 1 Then Return 0
123  tableLog = FSE_optimalTableLog(tableLog, wtSize, maxSymbolValue)
128  CHECK_V_F(hSize, FSE_writeNCount(op, oend - op, norm, maxSymbolValue, tableLog))
129  op += hSize
135  CHECK_V_F(cSize, FSE_compress_usingCTable(op, oend - op, weightTable, wtSize, CTable))
136  If cSize == 0 Then Return 0
138  op += cSize
141  Return op - ostart
Caller
NameDescribe
HUF_writeCTable_wksp : size of saved CTable