Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ZSTD_compressBlock_lazy_generic

Proto:void ZSTD_compressBlock_lazy_generic(ZSTD_CCtx *ctx, const void *src, size_t srcSize, const U32 searchMethod, const U32 depth)

Type:void

Parameter:

TypeParameterName
ZSTD_CCtx *ctx
const void *src
size_tsrcSize
const U32searchMethod
const U32depth
1899  seqStorePtr = &seqStore
1900  istart = src
1901  ip = istart
1902  anchor = istart
1903  iend = istart + srcSize
1904  ilimit = iend - 8
1905  base = base + dictLimit
1907  maxSearches = 1 << searchLog
1908  mls = searchLength
1910  typedef  size_t( * searchMax_f)(ZSTD_CCtx * zc, const BYTE * ip, const BYTE * iLimit, size_t * offsetPtr, U32 maxNbAttempts, U32 matchLengthSearch)
1911  searchMax = If searchMethod Then ZSTD_BtFindBestMatch_selectMLS Else ZSTD_HcFindBestMatch_selectMLS
1912  offset_1 = rep[0] , offset_2 = rep[1] , savedOffset = 0
1915  ip += ip == base
1916  nextToUpdate3 = nextToUpdate
1918  maxRep = ip - base
1919  If offset_2 > maxRep Then savedOffset = offset_2 , offset_2 = 0
1921  If offset_1 > maxRep Then savedOffset = offset_1 , offset_1 = 0
1926  When ip < ilimit cycle
1927  matchLength = 0
1928  offset = 0
1929  start = ip + 1
1932  If offset_1 > 0 & ZSTD_read32(ip + 1) == ZSTD_read32(ip + 1 - offset_1) Then
1935  If depth == 0 Then Go to _storeSequence
1941  offsetFound = 99999999
1943  If ml2 > matchLength Then matchLength = ml2 , start = ip , offset = offsetFound
1947  If matchLength < EQUAL_READ32 Then
1949  Continue
1953  If depth >= 1 Then When ip < ilimit cycle
1955  ip++
1956  If offset && offset_1 > 0 & ZSTD_read32(ip) == ZSTD_read32(ip - offset_1) Then
1958  gain2 = mlRep * 3
1960  If mlRep >= EQUAL_READ32 && gain2 > gain1 Then matchLength = mlRep , offset = 0 , start = ip
1964  offset2 = 99999999
1968  If ml2 >= EQUAL_READ32 && gain2 > gain1 Then
1969  matchLength = ml2 , offset = offset2 , start = ip
1970  Continue
1975  If depth == 2 && ip < ilimit Then
1976  ip++
1977  If offset && offset_1 > 0 & ZSTD_read32(ip) == ZSTD_read32(ip - offset_1) Then
1979  gain2 = ml2 * 4
1981  If ml2 >= EQUAL_READ32 && gain2 > gain1 Then matchLength = ml2 , offset = 0 , start = ip
1985  offset2 = 99999999
1989  If ml2 >= EQUAL_READ32 && gain2 > gain1 Then
1990  matchLength = ml2 , offset = offset2 , start = ip
1991  Continue
1995  Break
2004  If offset Then
2005  When ((start > anchor) && (start > base + offset - ZSTD_REP_MOVE) && (start[ - 1] == ))) cycle
2008  start--
2009  matchLength++
2011  offset_2 = offset_1
2012  offset_1 = offset - ZSTD_REP_MOVE
2016  _storeSequence :
2018  litLength = start - anchor
2019  ! ZSTD_storeSeq() :Store a sequence (literal length, literals, offset code and match length code) into seqStore_t.`offsetCode` : distance to match, or 0 == repCode.`matchCode` : matchLength - MINMATCH
2020  anchor = ip = start + matchLength
2024  When ip <= ilimit && offset_2 > 0 & ZSTD_read32(ip) == ZSTD_read32(ip - offset_2) cycle
2026  matchLength = ZSTD_count(ip + EQUAL_READ32, ip + EQUAL_READ32 - offset_2, iend) + EQUAL_READ32
2027  offset = offset_2
2028  offset_2 = offset_1
2029  offset_1 = offset
2030  ! ZSTD_storeSeq() :Store a sequence (literal length, literals, offset code and match length code) into seqStore_t.`offsetCode` : distance to match, or 0 == repCode.`matchCode` : matchLength - MINMATCH
2031  ip += matchLength
2032  anchor = ip
2033  Continue
2038  repToConfirm[0] = If offset_1 Then offset_1 Else savedOffset
2039  repToConfirm[1] = If offset_2 Then offset_2 Else savedOffset
2043  lastLLSize = iend - anchor
2044  No 3D Now!(lit, anchor, lastLLSize)
2045  lit += lastLLSize
Caller
NameDescribe
ZSTD_compressBlock_btlazy2
ZSTD_compressBlock_lazy2
ZSTD_compressBlock_lazy
ZSTD_compressBlock_greedy