Function report |
Source Code:lib\zstd\compress.c |
Create Date:2022-07-28 07:03:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:ZSTD_compressLiterals
Proto:static size_t ZSTD_compressLiterals(ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t srcSize)
Type:size_t
Parameter:
Type | Parameter | Name |
---|---|---|
ZSTD_CCtx * | zc | |
void * | dst | |
size_t | dstCapacity | |
const void * | src | |
size_t | srcSize |
484 | minGain = ZSTD_minGain(srcSize) |
487 | singleStream = srcSize < 256 |
488 | hType = set_compressed |
494 | minLitSize = If flagStaticHufTable == HUF_repeat_valid Then 6 Else small ? don't even attempt compression (speed opt) |
495 | If srcSize <= minLitSize Then Return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize) |
499 | If dstCapacity < lhSize + 1 Then Return -***************************************** Error codes handling(dstSize_tooSmall) |
502 | repeat = flagStaticHufTable |
503 | preferRepeat = If strategy < ZSTD_lazy Then srcSize <= 1024 Else 0 |
504 | If repeat == HUF_repeat_valid && lhSize == 3 Then singleStream = 1 |
506 | cLitSize = If singleStream Then HUF_compress1X_repeat(ostart + lhSize, dstCapacity - lhSize, src, srcSize, 255, 11, tmpCounters, size of tmpCounters , hufTable, & repeat, preferRepeat) Else HUF_compress4X_repeat(ostart + lhSize, dstCapacity - lhSize, src, srcSize, 255, 11, tmpCounters, size of tmpCounters , hufTable, & repeat, preferRepeat) |
510 | If repeat != *< Cannot use the previous table Then |
511 | hType = set_repeat |
513 | Else |
520 | Return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize) |
522 | If cLitSize == 1 Then |
524 | Return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize) |
529 | Case lhSize == 3 |
531 | lhc = hType + ( Not singleStream << 2) + (srcSize << 4) + (cLitSize << 14) |
532 | ZSTD_writeLE24(ostart, lhc) |
533 | Break |
535 | Case lhSize == 4 |
538 | ZSTD_writeLE32(ostart, lhc) |
539 | Break |
541 | Default |
542 | Case lhSize == 5 |
545 | ZSTD_writeLE32(ostart, lhc) |
547 | Break |
Name | Describe |
---|---|
ZSTD_compressSequences_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 |