函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\fse_compress.c Create Date:2022-07-27 07:59:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:FSE_buildCTable_wksp() :* Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`)

函数原型:size_t FSE_buildCTable_wksp(FSE_CTable *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workspace, size_t workspaceSize)

返回类型:size_t

参数:

类型参数名称
FSE_CTable *ct
const short *normalizedCounter
unsignedmaxSymbolValue
unsignedtableLog
void *workspace
size_tworkspaceSize
94  tableSize等于1左移tableLog
95  tableMask等于tableSize减1
96  ptr等于ct
97  tableU16等于ptr加2
98  FSCT等于ptr加1加如果tableLogtableSize右移1位否则1
99  symbolTT等于FSCT
100  step等于FSE_TABLESTEP(tableSize)
101  highThreshold等于tableSize减1
104  mplate functions type & suffixtableSymbol
105  spaceUsed32等于0
107  cumul等于workspacespaceUsed32
108  spaceUsed32加等于!FSE_MAX_SYMBOL_VALUE :* Maximum symbol value authorized.* Required for proper stack allocation 加2
109  tableSymbolmplate functions type & suffix等于workspacespaceUsed32
110  spaceUsed32加等于@a is a power of 2 value (mplate functions type & suffix的长度 * ((size_t)1 << tableLog), sizeof(U32))右移2位
112  如果spaceUsed32左移2位大于workspaceSize则返回:-***************************************** Error codes handling(tableLog_tooLarge)
114  workspace等于workspacespaceUsed32
115  workspaceSize减等于spaceUsed32左移2位
118  tableU16[ - 2]等于tableLog
119  tableU16[ - 1]等于maxSymbolValue
127  cumul[0]等于0
128 u小于等于maxSymbolValue加1循环
129  如果normalizedCounter[u - 1]恒等于负1则
130  cumul[u]等于cumul[u - 1]加1
132  否则
133  cumul[u]等于cumul[u - 1]加normalizedCounter[u - 1]
136  cumul[maxSymbolValue + 1]等于tableSize加1
141  position等于0
143 symbol小于等于maxSymbolValue循环
147  position等于positionstep按位与tableMask
149  position等于positionstep按位与tableMask
153  如果position不等于0则返回:-***************************************** Error codes handling(GENERIC)
160 u小于tableSize循环
162  tableU16[cumul[s]++]等于tableSizeu
168  total等于0
170 s小于等于maxSymbolValue循环
172  :normalizedCounter[s]恒等于0
172  退出
174  :normalizedCounter[s]恒等于负1
175  :normalizedCounter[s]恒等于1
176  deltaNbBits等于tableLog左移16位的值减1左移tableLog位的值
177  deltaFindState等于total减1
178  total自加
179  退出
180  默认
191  返回:0
调用者
名称描述
HUF_compressWeights_wksp
ZSTD_compressSequences_internal
ZSTD_loadZstdDictionary : 0, or an error code