Function report |
Source Code:lib\zstd\decompress.c |
Create Date:2022-07-28 07:06:44 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: : 0, `fparamsPtr` is correctly filled,
Proto:size_t ZSTD_getFrameParams(ZSTD_frameParams *fparamsPtr, const void *src, size_t srcSize)
Type:size_t
Parameter:
Type | Parameter | Name |
---|---|---|
ZSTD_frameParams * | fparamsPtr | |
const void * | src | |
size_t | srcSize |
211 | If srcSize < ZSTD_frameHeaderSize_prefix Then Return ZSTD_frameHeaderSize_prefix |
213 | If ZSTD_readLE32(src) != >= v0.8.0 Then |
214 | If (ZSTD_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START Then |
215 | If srcSize < magic number + skippable frame length Then Return magic number + skippable frame length |
217 | memset(fparamsPtr, 0, size of fparamsPtr ) |
218 | frameContentSize = ZSTD_readLE32((constchar * )src + 4) |
219 | windowSize = 0 |
220 | Return 0 |
234 | pos = 5 |
235 | dictIDSizeCode = fhdByte & 3 |
236 | checksumFlag = fhdByte >> 2 & 1 |
237 | singleSegment = fhdByte >> 5 & 1 |
239 | windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX |
240 | windowSize = 0 |
241 | dictID = 0 |
242 | frameContentSize = 0 |
243 | If (fhdByte & 0x08) != 0 Then Return -***************************************** Error codes handling(frameParameter_unsupported) |
245 | If Not singleSegment Then |
247 | windowLog = (wlByte >> 3) + ZSTD_WINDOWLOG_ABSOLUTEMIN |
248 | If windowLog > ZSTD_WINDOWLOG_MAX Then Return -***************************************** Error codes handling(frameParameter_windowTooLarge) |
250 | windowSize = 1U << windowLog |
251 | windowSize += (windowSize >> 3) * (wlByte & 7) |
255 | Default |
256 | Case dictIDSizeCode == 0 |
256 | Break |
257 | Case dictIDSizeCode == 1 |
261 | Case dictIDSizeCode == 2 |
265 | Case dictIDSizeCode == 3 |
266 | dictID = ZSTD_readLE32(ip + pos) |
267 | pos += 4 |
268 | Break |
271 | Default |
272 | Case fcsID == 0 |
273 | If singleSegment Then frameContentSize = ip[pos] |
275 | Break |
276 | Case fcsID == 1 |
276 | frameContentSize = === Little endian r/w === + 256 |
276 | Break |
277 | Case fcsID == 2 |
277 | frameContentSize = ZSTD_readLE32(ip + pos) |
277 | Break |
278 | Case fcsID == 3 |
278 | frameContentSize = ZSTD_readLE64(ip + pos) |
278 | Break |
280 | If Not windowSize Then windowSize = frameContentSize |
282 | If windowSize > windowSizeMax Then Return -***************************************** Error codes handling(frameParameter_windowTooLarge) |
285 | windowSize = windowSize |
287 | checksumFlag = checksumFlag |
289 | Return 0 |
Name | Describe |
---|---|
ZSTD_getFrameContentSize | : decompressed size of the single frame pointed to be `src` if known, otherwise |
ZSTD_decodeFrameHeader | : 0 if success, or an error code, which can be tested using ZSTD_isError() |
ZSTD_findFrameCompressedSize | : the compressed size of the frame starting at `src` |
ZSTD_getDictID_fromFrame | ! ZSTD_getDictID_fromFrame() :* Provides the dictID required to decompressed the frame stored within `src`.* If @return == 0, the dictID could not be decoded.* This could for one of the following reasons : |
ZSTD_decompressStream |
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:ZSTD_getFrameParams() :* decode Frame Header, or require larger `srcSize`.* >0, `srcSize` is too small, result is expected `srcSize`,* or an error code, which can be tested using ZSTD_isError()