函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ZSTD_compressSequences_internal

函数原型:ZSTD_STATIC size_t ZSTD_compressSequences_internal(ZSTD_CCtx *zc, void *dst, size_t dstCapacity)

返回类型:size_t

参数:

类型参数名称
ZSTD_CCtx *zc
void *dst
size_tdstCapacity
588  longOffsets等于windowLog大于STREAM_ACCUMULATOR_MIN
589  seqStorePtr等于seqStore的地址
590  CTable_LitLength等于litlengthCTable
591  CTable_OffsetBits等于offcodeCTable
592  CTable_MatchLength等于matchlengthCTable
594  sequences等于sequencesStart
595  ofCodeTable等于ofCode
596  llCodeTable等于llCode
597  mlCodeTable等于mlCode
598  ostart等于dst
599  oend等于ostartdstCapacity
600  op等于ostart
601  nbSeq等于sequencessequencesStart
607  workspaceSize等于tmpCounters的长度
609  spaceUsed32等于0
610  count等于tmpCountersspaceUsed32
611  spaceUsed32加等于Assumption : MaxOff < MaxLL,MaxML 加1
612  norm等于tmpCountersspaceUsed32
613  spaceUsed32加等于@a is a power of 2 value (sizeof(S16) * (Assumption : MaxOff < MaxLL,MaxML + 1), sizeof(U32))右移2位
615  workspace等于tmpCountersspaceUsed32
616  workspaceSize减等于spaceUsed32左移2位
621  literals等于litStart
622  litSize等于litliterals
623  cSize等于ZSTD_compressLiterals(zc, op, dstCapacity, literals, litSize)
624  如果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.则返回:cSize
626  op加等于cSize
630  如果oendop小于3加1则返回:-***************************************** Error codes handling(dstSize_tooSmall)
632  如果nbSeq小于0x7F则op自加等于nbSeq
634  否则如果nbSeq小于LONGNBSEQop[0]等于nbSeq右移8位的值加0x80, op[1]等于nbSeq, op加等于2
636  否则op[0]等于0xFF, op加等于3
638  如果nbSeq恒等于0则返回:opostart
642  seqHead等于op自加
648  ZSTD_seqToCodes(seqStorePtr)
652  max等于MaxLL
653  mostFrequent等于FSE_countFast_wksp() :* Same as FSE_countFast(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned
654  如果mostFrequent恒等于nbSeqnbSeq大于2则
655  op自加等于llCodeTable[0]
657  LLtype等于set_rle
658  否则如果flagStaticTablesnbSeq小于MAX_SEQ_FOR_STATIC_FSE
659  LLtype等于set_repeat
662  LLtype等于set_basic
663  否则
664  nbSeq_1等于nbSeq
666  如果count[llCodeTable[nbSeq - 1]]大于1则
667  count[llCodeTable[nbSeq - 1]]自减
668  nbSeq_1自减
673  如果Error Management 则返回:NCountSize
675  op加等于NCountSize
678  LLtype等于set_compressed
684  max等于MaxOff
685  mostFrequent等于FSE_countFast_wksp() :* Same as FSE_countFast(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned
686  如果mostFrequent恒等于nbSeqnbSeq大于2则
687  op自加等于ofCodeTable[0]
689  Offtype等于set_rle
690  否则如果flagStaticTablesnbSeq小于MAX_SEQ_FOR_STATIC_FSE
691  Offtype等于set_repeat
694  Offtype等于set_basic
695  否则
696  nbSeq_1等于nbSeq
698  如果count[ofCodeTable[nbSeq - 1]]大于1则
699  count[ofCodeTable[nbSeq - 1]]自减
700  nbSeq_1自减
705  如果Error Management 则返回:NCountSize
707  op加等于NCountSize
710  Offtype等于set_compressed
716  max等于MaxML
717  mostFrequent等于FSE_countFast_wksp() :* Same as FSE_countFast(), but using an externally provided scratch buffer.* `workSpace` size must be table of >= `1024` unsigned
718  如果mostFrequent恒等于nbSeqnbSeq大于2则
719  op自加等于mlCodeTable
721  MLtype等于set_rle
722  否则如果flagStaticTablesnbSeq小于MAX_SEQ_FOR_STATIC_FSE
723  MLtype等于set_repeat
726  MLtype等于set_basic
727  否则
728  nbSeq_1等于nbSeq
730  如果count[mlCodeTable[nbSeq - 1]]大于1则
731  count[mlCodeTable[nbSeq - 1]]自减
732  nbSeq_1自减
737  如果Error Management 则返回:NCountSize
739  op加等于NCountSize
742  MLtype等于set_compressed
746  seqHead等于LLtype左移6位的值加Offtype左移4位的值加MLtype左移2位的值
747  flagStaticTables等于0
759  ! FSE_initCState2() :* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)* uses the smallest state value possible, saving the cost of this symbol
760  ! FSE_initCState2() :* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)* uses the smallest state value possible, saving the cost of this symbol
761  ! FSE_initCState2() :* Same as FSE_initCState(), but the first symbol to include (which will be the last to be read)* uses the smallest state value possible, saving the cost of this symbol
762  BIT_addBits( & blockStream, litLength, LL_bits[llCodeTable[nbSeq - 1]])
763  如果-*************************************************************** Memory I/OBIT_flushBits( & blockStream)
765  BIT_addBits( & blockStream, matchLength, ML_bits[mlCodeTable[nbSeq - 1]])
766  如果-*************************************************************** Memory I/OBIT_flushBits( & blockStream)
768  如果longOffsets
769  ofBits等于ofCodeTable[nbSeq - 1]
771  如果extraBits
776  否则
783 n小于nbSeq循环
784  llCode等于llCodeTable[n]
785  ofCode等于ofCodeTable[n]
786  mlCode等于mlCodeTable[n]
787  llBits等于LL_bits[llCode]
788  ofBits等于ofCode
789  mlBits等于ML_bits[mlCode]
804  如果longOffsets
811  否则
818  FSE_flushCState( & blockStream, & stateMatchLength)
819  FSE_flushCState( & blockStream, & stateOffsetBits)
826  op加等于streamSize
829  返回:opostart
调用者
名称描述
ZSTD_compressSequences