函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\compress.c Create Date:2022-07-27 08:00:41
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ZSTD_compressLiterals

函数原型:static size_t ZSTD_compressLiterals(ZSTD_CCtx *zc, void *dst, size_t dstCapacity, const void *src, size_t srcSize)

返回类型:size_t

参数:

类型参数名称
ZSTD_CCtx *zc
void *dst
size_tdstCapacity
const void *src
size_tsrcSize
484  minGain等于ZSTD_minGain(srcSize)
485  size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB)
486  ostart等于dst
487  singleStream等于srcSize小于256
488  hType等于set_compressed
494  minLitSize等于如果flagStaticHufTable恒等于HUF_repeat_valid则6否则small ? don't even attempt compression (speed opt)
495  如果srcSize小于等于minLitSize则返回:ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize)
499  如果dstCapacity小于lhSize加1则返回:-***************************************** Error codes handling(dstSize_tooSmall)
502  repeat等于flagStaticHufTable
503  preferRepeat等于如果strategy小于ZSTD_lazysrcSize小于等于1024否则0
504  如果repeat恒等于HUF_repeat_validlhSize恒等于3则singleStream等于1
506  cLitSize等于如果singleStreamHUF_compress1X_repeat(ostart + lhSize, dstCapacity - lhSize, src, srcSize, 255, 11, tmpCounters, tmpCounters的长度, hufTable, & repeat, preferRepeat)否则HUF_compress4X_repeat(ostart + lhSize, dstCapacity - lhSize, src, srcSize, 255, 11, tmpCounters, tmpCounters的长度, hufTable, & repeat, preferRepeat)
510  如果repeat不等于*< Cannot use the previous table
511  hType等于set_repeat
513  否则
518  如果cLitSize恒等于0按位或cLitSize大于等于srcSizeminGain
519  flagStaticHufTable等于*< Cannot use the previous table
520  返回:ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize)
522  如果cLitSize恒等于1则
523  flagStaticHufTable等于*< Cannot use the previous table
524  返回:ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize)
529  :lhSize恒等于3
531  lhc等于hType加非singleStream左移2位的值加srcSize左移4位的值加cLitSize左移14位的值
533  退出
535  :lhSize恒等于4
537  lhc等于hType加2左移2位的值加srcSize左移4位的值加cLitSize左移18位的值
538  ZSTD_writeLE32(ostart, lhc)
539  退出
541  默认
542  :lhSize恒等于5
544  lhc等于hType加3左移2位的值加srcSize左移4位的值加cLitSize左移22位的值
545  ZSTD_writeLE32(ostart, lhc)
546  ostart[4]等于cLitSize右移10位
547  退出
550  返回:lhSizecLitSize
调用者
名称描述
ZSTD_compressSequences_internal