Function report |
Source Code:lib\zstd\fse_compress.c |
Create Date:2022-07-28 07:01:52 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:FSE_buildCTable_wksp() :* Same as FSE_buildCTable(), but using an externally allocated scratch buffer (`workSpace`)
Proto:size_t FSE_buildCTable_wksp(FSE_CTable *ct, const short *normalizedCounter, unsigned maxSymbolValue, unsigned tableLog, void *workspace, size_t workspaceSize)
Type:size_t
Parameter:
Type | Parameter | Name |
---|---|---|
FSE_CTable * | ct | |
const short * | normalizedCounter | |
unsigned | maxSymbolValue | |
unsigned | tableLog | |
void * | workspace | |
size_t | workspaceSize |
100 | step = FSE_TABLESTEP(tableSize) |
101 | highThreshold = tableSize - 1 |
105 | spaceUsed32 = 0 |
107 | cumul = workspace + spaceUsed32 |
108 | spaceUsed32 += !FSE_MAX_SYMBOL_VALUE :* Maximum symbol value authorized.* Required for proper stack allocation + 2 |
110 | spaceUsed32 += @a is a power of 2 value ( size of mplate functions type & suffix * ((size_t)1 << tableLog), sizeof(U32)) >> 2 |
112 | If spaceUsed32 << 2 > workspaceSize Then Return -***************************************** Error codes handling(tableLog_tooLarge) |
114 | workspace = workspace + spaceUsed32 |
115 | workspaceSize -= spaceUsed32 << 2 |
119 | tableU16[ - 1] = maxSymbolValue |
127 | cumul[0] = 0 |
128 | When u <= maxSymbolValue + 1 cycle |
129 | If normalizedCounter[u - 1] == -1 Then |
131 | tableSymbol[highThreshold--] = (mplate functions type & suffix)(u - 1) |
132 | Else |
136 | cumul[maxSymbolValue + 1] = tableSize + 1 |
141 | position = 0 |
143 | When symbol <= maxSymbolValue cycle |
145 | When nbOccurences < normalizedCounter[symbol] cycle |
153 | If position != 0 Then Return -***************************************** Error codes handling(GENERIC) |
168 | total = 0 |
170 | When s <= maxSymbolValue cycle |
172 | Case normalizedCounter[s] == 0 |
172 | Break |
174 | Case normalizedCounter[s] == -1 |
175 | Case normalizedCounter[s] == 1 |
176 | deltaNbBits = (tableLog << 16) - (1 << tableLog) |
177 | deltaFindState = total - 1 |
178 | total++ |
179 | Break |
180 | Default |
181 | maxBitsOut = tableLog - -*************************************************************** Internal functions |
182 | minStatePlus = normalizedCounter[s] << maxBitsOut |
183 | deltaNbBits = (maxBitsOut << 16) - minStatePlus |
184 | deltaFindState = total - normalizedCounter[s] |
185 | total += normalizedCounter[s] |
191 | Return 0 |
Name | Describe |
---|---|
HUF_compressWeights_wksp | |
ZSTD_compressSequences_internal | |
ZSTD_loadZstdDictionary | : 0, or an error code |
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 |