Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ZSTD_compressBlock_lazy_extDict_generic

Proto:void ZSTD_compressBlock_lazy_extDict_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
2060  seqStorePtr = &seqStore
2061  istart = src
2062  ip = istart
2063  anchor = istart
2064  iend = istart + srcSize
2065  ilimit = iend - 8
2066  base = base
2067  dictLimit = dictLimit
2068  lowestIndex = lowLimit
2069  prefixStart = base + dictLimit
2070  dictBase = dictBase
2071  dictEnd = dictBase + dictLimit
2072  dictStart = dictBase + lowLimit
2074  maxSearches = 1 << searchLog
2075  mls = searchLength
2077  typedef  size_t( * searchMax_f)(ZSTD_CCtx * zc, const BYTE * ip, const BYTE * iLimit, size_t * offsetPtr, U32 maxNbAttempts, U32 matchLengthSearch)
2078  searchMax = If searchMethod Then ZSTD_BtFindBestMatch_selectMLS_extDict Else ZSTD_HcFindBestMatch_extDict_selectMLS
2080  offset_1 = rep[0] , offset_2 = rep[1]
2083  nextToUpdate3 = nextToUpdate
2084  ip += ip == prefixStart
2087  When ip < ilimit cycle
2088  matchLength = 0
2089  offset = 0
2090  start = ip + 1
2091  curr = ip - base
2095  repIndex = curr + 1 - offset_1
2096  repBase = If repIndex < dictLimit Then dictBase Else base
2098  If dictLimit - 1 - repIndex >= 3 & repIndex > lowestIndex Then If ZSTD_read32(ip + 1) == ZSTD_read32(repMatch) Then
2101  repEnd = If repIndex < dictLimit Then dictEnd Else iend
2104  If depth == 0 Then Go to _storeSequence
2111  offsetFound = 99999999
2112  ml2 = searchMax(ctx, ip, iend, & offsetFound, maxSearches, mls)
2113  If ml2 > matchLength Then matchLength = ml2 , start = ip , offset = offsetFound
2117  If matchLength < EQUAL_READ32 Then
2118  ip += ( ip - anchor >> control skip over incompressible data ) + 1
2119  Continue
2123  If depth >= 1 Then When ip < ilimit cycle
2125  ip++
2126  curr++
2128  If offset Then
2129  repIndex = curr - offset_1
2130  repBase = If repIndex < dictLimit Then dictBase Else base
2132  If dictLimit - 1 - repIndex >= 3 & repIndex > lowestIndex Then If ZSTD_read32(ip) == ZSTD_read32(repMatch) Then
2135  repEnd = If repIndex < dictLimit Then dictEnd Else iend
2139  gain2 = repLength * 3
2141  If repLength >= EQUAL_READ32 && gain2 > gain1 Then matchLength = repLength , offset = 0 , start = ip
2148  offset2 = 99999999
2149  ml2 = searchMax(ctx, ip, iend, & offset2, maxSearches, mls)
2150  gain2 = ml2 * 4 - ====== common function ======
2151  gain1 = matchLength * 4 - ====== common function ====== + 4
2152  If ml2 >= EQUAL_READ32 && gain2 > gain1 Then
2153  matchLength = ml2 , offset = offset2 , start = ip
2154  Continue
2159  If depth == 2 && ip < ilimit Then
2160  ip++
2161  curr++
2163  If offset Then
2164  repIndex = curr - offset_1
2165  repBase = If repIndex < dictLimit Then dictBase Else base
2167  If dictLimit - 1 - repIndex >= 3 & repIndex > lowestIndex Then If ZSTD_read32(ip) == ZSTD_read32(repMatch) Then
2170  repEnd = If repIndex < dictLimit Then dictEnd Else iend
2174  gain2 = repLength * 4
2176  If repLength >= EQUAL_READ32 && gain2 > gain1 Then matchLength = repLength , offset = 0 , start = ip
2183  offset2 = 99999999
2184  ml2 = searchMax(ctx, ip, iend, & offset2, maxSearches, mls)
2185  gain2 = ml2 * 4 - ====== common function ======
2186  gain1 = matchLength * 4 - ====== common function ====== + 7
2187  If ml2 >= EQUAL_READ32 && gain2 > gain1 Then
2188  matchLength = ml2 , offset = offset2 , start = ip
2189  Continue
2193  Break
2197  If offset Then
2198  matchIndex = start - base - offset - ZSTD_REP_MOVE
2199  match = If matchIndex < dictLimit Then dictBase + matchIndex Else base + matchIndex
2200  mStart = If matchIndex < dictLimit Then dictStart Else prefixStart
2201  When start > anchor && match > mStart && start[ - 1] == match[ - 1] cycle
2202  start--
2203  match--
2204  matchLength++
2206  offset_2 = offset_1
2207  offset_1 = offset - ZSTD_REP_MOVE
2211  _storeSequence :
2212  litLength = start - anchor
2213  ! 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
2214  anchor = ip = start + matchLength
2218  When ip <= ilimit cycle
2219  repIndex = ip - base - offset_2
2220  repBase = If repIndex < dictLimit Then dictBase Else base
2221  repMatch = repBase + repIndex
2222  If dictLimit - 1 - repIndex >= 3 & repIndex > lowestIndex Then If ZSTD_read32(ip) == ZSTD_read32(repMatch) Then
2225  repEnd = If repIndex < dictLimit Then dictEnd Else iend
2226  matchLength = ZSTD_count_2segments() :* can count match length with `ip` & `match` in 2 different segments.* convention : on reaching mEnd, match count continue starting from iStart + EQUAL_READ32
2228  offset = offset_2
2229  offset_2 = offset_1
2230  offset_1 = offset
2231  ! 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
2232  ip += matchLength
2233  anchor = ip
2234  Continue
2236  Break
2241  repToConfirm[0] = offset_1
2242  repToConfirm[1] = offset_2
2246  lastLLSize = iend - anchor
2247  No 3D Now!(lit, anchor, lastLLSize)
2248  lit += lastLLSize
Caller
NameDescribe
ZSTD_compressBlock_greedy_extDict
ZSTD_compressBlock_lazy_extDict
ZSTD_compressBlock_lazy2_extDict
ZSTD_compressBlock_btlazy2_extDict