Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ZSTD_compressBlock_doubleFast_generic

Proto:void ZSTD_compressBlock_doubleFast_generic(ZSTD_CCtx *cctx, const void *src, size_t srcSize, const U32 mls)

Type:void

Parameter:

TypeParameterName
ZSTD_CCtx *cctx
const void *src
size_tsrcSize
const U32mls
1256  hashLong = hashTable
1257  hBitsL = hashLog
1258  hashSmall = chainTable
1259  hBitsS = chainLog
1260  seqStorePtr = &seqStore
1261  base = base
1262  istart = src
1263  ip = istart
1264  anchor = istart
1265  lowestIndex = dictLimit
1266  lowest = base + lowestIndex
1267  iend = istart + srcSize
1268  ilimit = iend - HASH_READ_SIZE
1269  offset_1 = rep[0] , offset_2 = rep[1]
1270  offsetSaved = 0
1273  ip += ip == lowest
1275  maxRep = ip - lowest
1276  If offset_2 > maxRep Then offsetSaved = offset_2 , offset_2 = 0
1278  If offset_1 > maxRep Then offsetSaved = offset_1 , offset_1 = 0
1283  When ip < ilimit cycle
1285  h2 = ZSTD_hashPtr(ip, hBitsL, 8)
1286  h = ZSTD_hashPtr(ip, hBitsS, mls)
1287  curr = ip - base
1288  matchIndexL = hashLong[h2]
1289  matchIndexS = hashSmall[h]
1290  matchLong = base + matchIndexL
1291  match = base + matchIndexS
1292  hashLong[h2] = hashSmall[h] = curr
1294  If offset_1 > 0 & ZSTD_read32(ip + 1 - offset_1) == ZSTD_read32(ip + 1) Then
1295  mLength = ZSTD_count(ip + 1 + 4, ip + 1 + 4 - offset_1, iend) + 4
1296  ip++
1298  Else
1301  mLength = ZSTD_count(ip + 8, matchLong + 8, iend) + 8
1302  offset = ip - matchLong
1303  When ip > anchor & matchLong > lowest && ip[ - 1] == matchLong[ - 1] cycle
1304  ip--
1305  matchLong--
1306  mLength++
1308  Else if matchIndexS > lowestIndex && ZSTD_read32(match) == ZSTD_read32(ip) Then
1309  h3 = ZSTD_hashPtr(ip + 1, hBitsL, 8)
1310  matchIndex3 = hashLong[h3]
1311  match3 = base + matchIndex3
1312  hashLong[h3] = curr + 1
1313  If matchIndex3 > lowestIndex && ZSTD_read64(match3) == ZSTD_read64(ip + 1) Then
1314  mLength = ZSTD_count(ip + 9, match3 + 8, iend) + 8
1315  ip++
1316  offset = ip - match3
1317  When ip > anchor & match3 > lowest && ip[ - 1] == match3[ - 1] cycle
1318  ip--
1319  match3--
1320  mLength++
1322  Else
1323  mLength = ZSTD_count(ip + 4, match + 4, iend) + 4
1324  offset = ip - match
1325  When ip > anchor & match > lowest && ip[ - 1] == match[ - 1] cycle
1326  ip--
1327  match--
1328  mLength++
1331  Else
1333  Continue
1336  offset_2 = offset_1
1337  offset_1 = offset
1343  ip += mLength
1344  anchor = ip
1346  If ip <= ilimit Then
1350  hashLong[ZSTD_hashPtr(ip - 2, hBitsL, 8)] = hashSmall[ZSTD_hashPtr(ip - 2, hBitsS, mls)] = ip - 2 - base
1353  When ip <= ilimit && offset_2 > 0 & ZSTD_read32(ip) == ZSTD_read32(ip - offset_2) cycle
1372  repToConfirm[0] = If offset_1 Then offset_1 Else offsetSaved
1373  repToConfirm[1] = If offset_2 Then offset_2 Else offsetSaved
1377  lastLLSize = iend - anchor
1378  No 3D Now!(lit, anchor, lastLLSize)
1379  lit += lastLLSize
Caller
NameDescribe
ZSTD_compressBlock_doubleFast