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

Name:`workSpace` must a table of at least 1024 unsigned

Proto:static size_t HUF_compress_internal(void *dst, size_t dstSize, const void *src, size_t srcSize, unsigned maxSymbolValue, unsigned huffLog, unsigned singleStream, void *workSpace, size_t wkspSize, HUF_CElt *oldHufTable, HUF_repeat *repeat, int preferRepeat)

Type:size_t

Parameter:

TypeParameterName
void *dst
size_tdstSize
const void *src
size_tsrcSize
unsignedmaxSymbolValue
unsignedhuffLog
unsignedsingleStream
void *workSpace
size_twkspSize
HUF_CElt *oldHufTable
HUF_repeat *repeat
intpreferRepeat
656  ostart = dst
657  oend = ostart + dstSize
658  op = ostart
661  countSize = sizeof(U32) * (HUF_SYMBOLVALUE_MAX + 1)
663  CTableSize = sizeof(HUF_CElt) * (HUF_SYMBOLVALUE_MAX + 1)
666  If wkspSize < sizeof(huffNodeTable) + countSize + CTableSize Then Return -***************************************** Error codes handling(GENERIC)
668  If Not srcSize Then Return 0
670  If Not dstSize Then Return 0
672  If srcSize > < maximum input size for a single block compressed with HUF_compress Then Return -***************************************** Error codes handling(srcSize_wrong)
674  If huffLog > max configured tableLog (for static allocation); can be modified up to HUF_ABSOLUTEMAX_TABLELOG Then Return -***************************************** Error codes handling(tableLog_tooLarge)
676  If Not maxSymbolValue Then maxSymbolValue = HUF_SYMBOLVALUE_MAX
678  If Not huffLog Then huffLog = ableLog by default, when not specified
681  count = workSpace
682  workSpace = workSpace + countSize
683  wkspSize -= countSize
684  CTable = workSpace
685  workSpace = workSpace + CTableSize
686  wkspSize -= CTableSize
689  If preferRepeat && repeat && repeat == HUF_repeat_valid Then
690  Return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable)
695  CHECK_V_F(largest, FSE_count_wksp() :* Same as FSE_count(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned )
696  If largest == srcSize Then
697  * ostart = )
698  Return 1
700  If largest <= (srcSize >> 7) + 1 Then Return 0
705  If repeat && repeat == *< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat && Not HUF_validateCTable(oldHufTable, count, maxSymbolValue) Then
706  repeat = *< Cannot use the previous table
709  If preferRepeat && repeat && repeat != *< Cannot use the previous table Then
710  Return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, oldHufTable)
714  huffLog = Utils
716  CHECK_V_F(maxBits, HUF_buildCTable_wksp(CTable, count, maxSymbolValue, huffLog, workSpace, wkspSize))
717  huffLog = maxBits
719  memset(CTable + maxSymbolValue + 1, 0, CTableSize - (maxSymbolValue + 1) * sizeof(HUF_CElt))
724  CHECK_V_F(hSize, : size of saved CTable )
729  If oldSize <= hSize + newSize || hSize + 12 >= srcSize Then
734  If hSize + 12ul >= srcSize Then
735  Return 0
737  op += hSize
738  If repeat Then
741  If oldHufTable Then
745  Return HUF_compressCTable_internal(ostart, op, oend, src, srcSize, singleStream, CTable)
Caller
NameDescribe
HUF_compress1X_wksp
HUF_compress1X_repeat
HUF_compress4X_wksp
HUF_compress4X_repeat