Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\compress.c Create Date:2022-07-28 07:05:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ZSTD_writeFrameHeader

Proto:static size_t ZSTD_writeFrameHeader(void *dst, size_t dstCapacity, ZSTD_parameters params, U64 pledgedSrcSize, U32 dictID)

Type:size_t

Parameter:

TypeParameterName
void *dst
size_tdstCapacity
ZSTD_parametersparams
U64pledgedSrcSize
U32dictID
2433  op = dst
2434  dictIDSizeCode = (dictID > 0) + (dictID >= 256 + (dictID >= 65536
2435  checksumFlag = checksumFlag > 0
2436  windowSize = 1U << windowLog
2437  singleSegment = contentSizeFlag && windowSize >= pledgedSrcSize
2438  windowLogByte = windowLog - ZSTD_WINDOWLOG_ABSOLUTEMIN << 3
2439  fcsCode = If contentSizeFlag Then (pledgedSrcSize >= 256 + (pledgedSrcSize >= 65536 + 256 + (pledgedSrcSize >= 0xFFFFFFFFU Else 0
2441  frameHeaderDecriptionByte = dictIDSizeCode + (checksumFlag << 2) + (singleSegment << 5) + (fcsCode << 6)
2444  If dstCapacity < ZSTD_frameHeaderSize_max Then Return -***************************************** Error codes handling(dstSize_tooSmall)
2447  ZSTD_writeLE32(dst, >= v0.8.0 )
2448  op[4] = frameHeaderDecriptionByte
2449  pos = 5
2450  If Not singleSegment Then op[pos++] = windowLogByte
2453  Default
2454  Case dictIDSizeCode == 0
2454  Break
2455  Case dictIDSizeCode == 1
2456  op[pos] = dictID
2457  pos++
2458  Break
2459  Case dictIDSizeCode == 2
2460  ZSTD_writeLE16(op + pos, (U16)dictID)
2461  pos += 2
2462  Break
2463  Case dictIDSizeCode == 3
2464  ZSTD_writeLE32(op + pos, dictID)
2465  pos += 4
2466  Break
2469  Default
2470  Case fcsCode == 0
2471  If singleSegment Then op[pos++] = pledgedSrcSize
2473  Break
2474  Case fcsCode == 1
2475  ZSTD_writeLE16(op + pos, (U16)(pledgedSrcSize - 256))
2476  pos += 2
2477  Break
2478  Case fcsCode == 2
2480  pos += 4
2481  Break
2482  Case fcsCode == 3
2484  pos += 8
2485  Break
2487  Return pos
Caller
NameDescribe
ZSTD_compressContinue_internal
ZSTD_writeEpilogue : nb of bytes written into dst (or an error code)