Function report |
Source Code:lib\zstd\huf_compress.c |
Create Date:2022-07-28 07:02:21 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: : size of saved CTable
Proto:size_t HUF_writeCTable_wksp(void *dst, size_t maxDstSize, const HUF_CElt *CTable, U32 maxSymbolValue, U32 huffLog, void *workspace, size_t workspaceSize)
Type:size_t
Parameter:
Type | Parameter | Name |
---|---|---|
void * | dst | |
size_t | maxDstSize | |
const HUF_CElt * | CTable | |
U32 | maxSymbolValue | |
U32 | huffLog | |
void * | workspace | |
size_t | workspaceSize |
159 | spaceUsed32 = 0 |
161 | bitsToWeight = workspace + spaceUsed32 |
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 = workspace + spaceUsed32 |
164 | spaceUsed32 += @a is a power of 2 value (HUF_SYMBOLVALUE_MAX, sizeof(U32)) >> 2 |
166 | If spaceUsed32 << 2 > workspaceSize Then Return -***************************************** Error codes handling(tableLog_tooLarge) |
168 | workspace = workspace + spaceUsed32 |
169 | workspaceSize -= spaceUsed32 << 2 |
172 | If maxSymbolValue > HUF_SYMBOLVALUE_MAX Then Return -***************************************** Error codes handling(maxSymbolValue_tooLarge) |
176 | bitsToWeight[0] = 0 |
179 | When n < maxSymbolValue cycle huffWeight[n] = bitsToWeight[nbBits] |
184 | CHECK_V_F(hSize, HUF_compressWeights_wksp(op + 1, maxDstSize - 1, huffWeight, maxSymbolValue, workspace, workspaceSize)) |
185 | If hSize > 1 & hSize < maxSymbolValue / 2 Then |
192 | If maxSymbolValue > 256 - 128 Then Return -***************************************** Error codes handling(GENERIC) |
194 | If (maxSymbolValue + 1) / 2 + 1 > maxDstSize Then Return -***************************************** Error codes handling(dstSize_tooSmall) |
196 | op[0] = 128 + maxSymbolValue - 1 |
197 | huffWeight[maxSymbolValue] = 0 |
198 | When n < maxSymbolValue cycle op[(n / 2) + 1] = (huffWeight[n] << 4) + huffWeight[n + 1] |
200 | Return (maxSymbolValue + 1) / 2 + 1 |
Name | Describe |
---|---|
HUF_compress_internal | `workSpace` must a table of at least 1024 unsigned |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |
Brief:! HUF_writeCTable_wksp() :`CTable` : Huffman tree to save, using huf representation.