Function report |
Source Code:lib\zstd\compress.c |
Create Date:2022-07-28 07:05:07 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: : compressed size, or an error code
Proto:static size_t ZSTD_compress_generic(ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastFrameChunk)
Type:size_t
Parameter:
Type | Parameter | Name |
---|---|---|
ZSTD_CCtx * | cctx | |
void * | dst | |
size_t | dstCapacity | |
const void * | src | |
size_t | srcSize | |
U32 | lastFrameChunk |
2364 | If checksumFlag && srcSize Then xxh64_update( & xxhState, src, srcSize) |
2368 | lastBlock = lastFrameChunk & blockSize >= remaining |
2371 | If dstCapacity < ZSTD_blockHeaderSize + r a non-null block Then Return -***************************************** Error codes handling(dstSize_tooSmall) |
2377 | If lowLimit > 3U << 29 Then |
2378 | cycleMask = (1 << ZSTD_cycleLog() :* condition for correct operation : hashLog > 1 ) - 1 |
2381 | correction = curr - newCurr |
2384 | base += correction |
2385 | dictBase += correction |
2386 | lowLimit -= correction |
2387 | dictLimit -= correction |
2388 | If nextToUpdate < correction Then nextToUpdate = 0 |
2390 | Else nextToUpdate -= correction |
2394 | If ip + blockSize - base > loadedDictEnd + maxDist Then |
2396 | newLowLimit = ip + blockSize - base - maxDist |
2397 | If lowLimit < newLowLimit Then lowLimit = newLowLimit |
2403 | cSize = ZSTD_compressBlock_internal(cctx, op + ZSTD_blockHeaderSize, dstCapacity - ZSTD_blockHeaderSize, ip, blockSize) |
2404 | 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 cSize |
2407 | If cSize == 0 Then |
2408 | cBlockHeader24 = lastBlock + (bt_raw << 1) + (blockSize << 3) |
2409 | If blockSize + ZSTD_blockHeaderSize > dstCapacity Then Return -***************************************** Error codes handling(dstSize_tooSmall) |
2411 | ZSTD_writeLE32(op, cBlockHeader24) |
2412 | No 3D Now!(op + ZSTD_blockHeaderSize, ip, blockSize) |
2413 | cSize = ZSTD_blockHeaderSize + blockSize |
2414 | Else |
2415 | cBlockHeader24 = lastBlock + (bt_compressed << 1) + (cSize << 3) |
2416 | ZSTD_writeLE24(op, cBlockHeader24) |
2417 | cSize += ZSTD_blockHeaderSize |
2421 | dstCapacity -= cSize |
2426 | If lastFrameChunk && op > ostart Then stage = ZSTDcs_ending |
Name | Describe |
---|---|
ZSTD_compressContinue_internal |
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_compress_generic() :* Compress a chunk of data into one or multiple blocks.* All blocks will be terminated, all input will be consumed.* Function will issue an error if there is not enough `dstCapacity` to hold the compressed content.* Frame is supposed already started (header already produced)