Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:LZ4_compress_generic() :* inlined, to ensure branches are decided at compilation time

Proto:static inline __attribute__((__always_inline__)) int LZ4_compress_generic(LZ4_stream_t_internal *const dictPtr, const char *const source, char *const dest, const int inputSize, const int maxOutputSize, const limitedOutput_directive outputLimited, const tableType_t tableType, const dict_directive dict, const dictIssue_directive dictIssue, const U32 acceleration)

Type:int

Parameter:

TypeParameterName
LZ4_stream_t_internal *constdictPtr
const char *constsource
char *constdest
const intinputSize
const intmaxOutputSize
const limitedOutput_directiveoutputLimited
const tableType_ttableType
const dict_directivedict
const dictIssue_directivedictIssue
const U32acceleration
188  ip = source
191  lowRefLimit = ip - dictSize
192  dictionary = dictionary
193  dictEnd = dictionary + dictSize
194  dictDelta = dictEnd - source
195  anchor = source
196  iend = ip + inputSize
197  mflimit = iend - MFLIMIT
198  matchlimit = iend - LASTLITERALS
200  op = dest
201  olimit = op + maxOutputSize
204  refDelta = 0
207  If inputSize > 2 113 929 216 bytes Then
209  Return 0
213  Case dict == noDict
214  Default
215  base = source
216  lowLimit = source
217  Break
218  Case dict == withPrefix64k
221  Break
222  Case dict == usingExtDict
224  lowLimit = source
225  Break
228  If tableType == byU16 && inputSize >= LZ4_64Klimit Then
231  Return 0
234  If inputSize < LZ4_minLength Then
236  Go to _last_literals
240  LZ4_putPosition(ip, hashTable, tableType, base)
241  ip++
242  forwardH = LZ4_hashPosition(ip, tableType)
245  cycle
251  forwardIp = ip
252  step = 1
255  Do
283  When If dictIssue == dictSmall Then match < lowRefLimit Else 0 || If tableType == byU16 Then 0 Else match + MAX_DISTANCE < ip || LZ4_read32(match + refDelta) != LZ4_read32(ip) cycle
296  ip--
297  match--
302  litLength = ip - anchor
304  token = op++
313  If litLength >= RUN_MASK Then
314  len = litLength - RUN_MASK
316  token = RUN_MASK << ML_BITS
318  When len >= 255 cycle op++ = 255
320  op++ = len
321  Else token = litLength << ML_BITS
326  op += litLength
329  _next_match :
331  LZ4_writeLE16(op, (U16)(ip - match))
332  op += 2
391  anchor = ip
394  If ip > mflimit Then Break
404  If dict == usingExtDict Then
405  If match < source Then
408  Else
409  refDelta = 0
410  lowLimit = source
416  If If dictIssue == dictSmall Then match >= lowRefLimit Else 1 && match + MAX_DISTANCE >= ip && LZ4_read32(match + refDelta) == LZ4_read32(ip) Then
419  token = op++
420  token = 0
421  Go to _next_match
428  _last_literals :
431  lastRun = iend - anchor
433  If outputLimited && op - dest + lastRun + 1 + ( lastRun + 255 - RUN_MASK) / 255 > maxOutputSize Then Return 0
439  If lastRun >= RUN_MASK Then
441  op++ = RUN_MASK << ML_BITS
442  When accumulator >= 255 cycle op++ = 255
444  op++ = accumulator
445  Else
446  op++ = lastRun << ML_BITS
451  op += lastRun
455  Return op - dest
Caller
NameDescribe
LZ4_compress_fast_extState
LZ4_compress_fast_continue