Function report |
Source Code:lib\zstd\decompress.c |
Create Date:2022-07-28 07:07:55 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ZSTD_decompressStream
Proto:size_t ZSTD_decompressStream(ZSTD_DStream *zds, ZSTD_outBuffer *output, ZSTD_inBuffer *input)
Type:size_t
Parameter:
Type | Parameter | Name |
---|---|---|
ZSTD_DStream * | zds | |
ZSTD_outBuffer * | output | |
ZSTD_inBuffer * | input |
2306 | someMoreWork = 1 |
2308 | When someMoreWork cycle |
2311 | ZSTD_resetDStream(zds) |
2314 | Case stage == zdss_loadHeader |
2316 | If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return hSize |
2318 | If hSize != 0 Then |
2321 | No 3D Now!(headerBuffer + lhSize, ip, iend - ip) |
2324 | Return MAX(ZSTD_frameHeaderSize_min, hSize) - lhSize + ZSTD_blockHeaderSize |
2327 | No 3D Now!(headerBuffer + lhSize, ip, toLoad) |
2330 | Break |
2334 | If frameContentSize && windowSize && oend - op >= frameContentSize Then |
2338 | decompressedSize = ! ZSTD_decompress_usingDDict() :* Decompression using a pre-digested Dictionary* Use dictionary without significant overhead. |
2339 | If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return decompressedSize |
2342 | op += decompressedSize |
2343 | expected = 0 |
2345 | someMoreWork = 0 |
2346 | Break |
2351 | ZSTD_refDDict(dctx, ddict) |
2361 | windowSize = MAX(windowSize, 1U << ZSTD_WINDOWLOG_ABSOLUTEMIN) |
2367 | blockSize = -************************************** shared macros(maxWindowSize, Define for static allocation ) |
2368 | neededOutSize = maxWindowSize + blockSize + ! ZSTD_wildcopy() :* custom version of memcpy(), can copy up to 7 bytes too many (8 bytes if length==0) * 2 |
2369 | If inBuffSize < blockSize Then |
2372 | If outBuffSize < neededOutSize Then |
2382 | neededInSize = -*************************************** Advanced Streaming Decompression API* Bufferless and synchronous |
2383 | If neededInSize == 0 Then |
2388 | If iend - ip >= neededInSize Then |
2389 | isSkipFrame = ZSTD_isSkipFrame(dctx) |
2392 | If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return decodedSize |
2394 | ip += neededInSize |
2395 | If Not decodedSize && Not isSkipFrame Then Break |
2397 | outEnd = outStart + decodedSize |
2398 | stage = zdss_flush |
2399 | Break |
2402 | someMoreWork = 0 |
2403 | Break |
2411 | neededInSize = -*************************************** Advanced Streaming Decompression API* Bufferless and synchronous |
2412 | toLoad = neededInSize - inPos |
2414 | If toLoad > inBuffSize - inPos Then Return -***************************************** Error codes handling(corruption_detected) |
2416 | loadedSize = Decompression ***** |
2417 | ip += loadedSize |
2418 | inPos += loadedSize |
2419 | If loadedSize < toLoad Then |
2420 | someMoreWork = 0 |
2421 | Break |
2426 | isSkipFrame = ZSTD_isSkipFrame(dctx) |
2429 | If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return decodedSize |
2431 | inPos = 0 |
2432 | If Not decodedSize && Not isSkipFrame Then |
2436 | outEnd = outStart + decodedSize |
2437 | stage = zdss_flush |
2443 | Case stage == zdss_flush |
2444 | toFlushSize = outEnd - outStart |
2445 | flushedSize = Decompression ***** |
2446 | op += flushedSize |
2447 | outStart += flushedSize |
2448 | If flushedSize == toFlushSize Then |
2450 | If outStart + blockSize > outBuffSize Then outStart = outEnd = 0 |
2452 | Break |
2455 | someMoreWork = 0 |
2456 | Break |
2458 | Default |
2467 | nextSrcSizeHint = -*************************************** Advanced Streaming Decompression API* Bufferless and synchronous |
2468 | If Not nextSrcSizeHint Then |
2470 | If hostageByte Then |
2477 | Return 0 |
2479 | If Not hostageByte Then |
2480 | pos-- |
2481 | hostageByte = 1 |
2483 | Return 1 |
2485 | nextSrcSizeHint += ZSTD_blockHeaderSize * (ZSTD_nextInputType(dctx) == ZSTDnit_block) |
2486 | If inPos > nextSrcSizeHint Then Return -***************************************** Error codes handling(GENERIC) |
2488 | nextSrcSizeHint -= inPos |
2489 | Return nextSrcSizeHint |
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 |