函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: : size of saved CTable

函数原型:size_t HUF_writeCTable_wksp(void *dst, size_t maxDstSize, const HUF_CElt *CTable, U32 maxSymbolValue, U32 huffLog, void *workspace, size_t workspaceSize)

返回类型:size_t

参数:

类型参数名称
void *dst
size_tmaxDstSize
const HUF_CElt *CTable
U32maxSymbolValue
U32huffLog
void *workspace
size_tworkspaceSize

摘要:! HUF_writeCTable_wksp() :`CTable` : Huffman tree to save, using huf representation.

154  op等于dst
159  spaceUsed32等于0
161  bitsToWeight等于workspacespaceUsed32
162  spaceUsed32加等于@a is a power of 2 value (max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG + 1, sizeof(U32))右移2位
163  huffWeight等于workspacespaceUsed32
164  spaceUsed32加等于@a is a power of 2 value (HUF_SYMBOLVALUE_MAX, sizeof(U32))右移2位
166  如果spaceUsed32左移2位大于workspaceSize则返回:-***************************************** Error codes handling(tableLog_tooLarge)
168  workspace等于workspacespaceUsed32
169  workspaceSize减等于spaceUsed32左移2位
172  如果maxSymbolValue大于HUF_SYMBOLVALUE_MAX则返回:-***************************************** Error codes handling(maxSymbolValue_tooLarge)
176  bitsToWeight[0]等于0
177 n小于huffLog加1循环bitsToWeight[n]等于huffLog加1减n
179 n小于maxSymbolValue循环huffWeight[n]等于bitsToWeight[nbBits]
184  CHECK_V_F(hSize, HUF_compressWeights_wksp(op + 1, maxDstSize - 1, huffWeight, maxSymbolValue, workspace, workspaceSize))
185  如果hSize大于1按位与hSize小于maxSymbolValue除2则
186  op[0]等于hSize
187  返回:hSize加1
192  如果maxSymbolValue大于256减128则返回:-***************************************** Error codes handling(GENERIC)
194  如果maxSymbolValue加1的和除2加1大于maxDstSize则返回:-***************************************** Error codes handling(dstSize_tooSmall)
196  op[0]等于128加maxSymbolValue减1
197  huffWeight[maxSymbolValue]等于0
198 n小于maxSymbolValue循环op[(n / 2) + 1]等于huffWeight[n]左移4位的值加huffWeight[n + 1]
200  返回:maxSymbolValue加1的和除2加1
调用者
名称描述
HUF_compress_internal`workSpace` must a table of at least 1024 unsigned