Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\compress.c Create Date:2022-07-28 07:03:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ZSTD_compressSequences_internal

Proto:ZSTD_STATIC size_t ZSTD_compressSequences_internal(ZSTD_CCtx *zc, void *dst, size_t dstCapacity)

Type:size_t

Parameter:

TypeParameterName
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 = ostart + dstCapacity
600  op = ostart
601  nbSeq = sequences - sequencesStart
607  workspaceSize = size of tmpCounters
609  spaceUsed32 = 0
610  count = tmpCounters + spaceUsed32
611  spaceUsed32 += Assumption : MaxOff < MaxLL,MaxML + 1
612  norm = tmpCounters + spaceUsed32
613  spaceUsed32 += @a is a power of 2 value (sizeof(S16) * (Assumption : MaxOff < MaxLL,MaxML + 1), sizeof(U32)) >> 2
615  workspace = tmpCounters + spaceUsed32
616  workspaceSize -= spaceUsed32 << 2
621  literals = litStart
622  litSize = lit - literals
623  cSize = ZSTD_compressLiterals(zc, op, dstCapacity, literals, litSize)
624  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
626  op += cSize
630  If oend - op < 3 + 1 Then Return -***************************************** Error codes handling(dstSize_tooSmall)
632  If nbSeq < 0x7F Then op++ = nbSeq
634  Else if nbSeq < LONGNBSEQ Then op[0] = (nbSeq >> 8) + 0x80 , op[1] = nbSeq , op += 2
636  Else op[0] = 0xFF , op += 3
638  If nbSeq == 0 Then Return op - ostart
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  If mostFrequent == nbSeq && nbSeq > 2 Then
655  op++ = llCodeTable[0]
657  LLtype = set_rle
659  LLtype = set_repeat
662  LLtype = set_basic
663  Else
664  nbSeq_1 = nbSeq
666  If count[llCodeTable[nbSeq - 1]] > 1 Then
667  count[llCodeTable[nbSeq - 1]]--
668  nbSeq_1--
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  If mostFrequent == nbSeq && nbSeq > 2 Then
687  op++ = ofCodeTable[0]
689  Offtype = set_rle
694  Offtype = set_basic
695  Else
696  nbSeq_1 = nbSeq
698  If count[ofCodeTable[nbSeq - 1]] > 1 Then
699  count[ofCodeTable[nbSeq - 1]]--
700  nbSeq_1--
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  If mostFrequent == nbSeq && nbSeq > 2 Then
719  op++ = mlCodeTable
721  MLtype = set_rle
723  MLtype = set_repeat
726  MLtype = set_basic
727  Else
728  nbSeq_1 = nbSeq
730  If count[mlCodeTable[nbSeq - 1]] > 1 Then
731  count[mlCodeTable[nbSeq - 1]]--
732  nbSeq_1--
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  If -*************************************************************** Memory I/O Then BIT_flushBits( & blockStream)
765  BIT_addBits( & blockStream, matchLength, ML_bits[mlCodeTable[nbSeq - 1]])
766  If -*************************************************************** Memory I/O Then BIT_flushBits( & blockStream)
768  If longOffsets Then
769  ofBits = ofCodeTable[nbSeq - 1]
771  If extraBits Then
776  Else
783  When n < nbSeq cycle
818  FSE_flushCState( & blockStream, & stateMatchLength)
819  FSE_flushCState( & blockStream, & stateOffsetBits)
826  op += streamSize
829  Return op - ostart
Caller
NameDescribe
ZSTD_compressSequences