Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ZSTD_compressBlock_opt_generic

Proto:void ZSTD_compressBlock_opt_generic(ZSTD_CCtx *ctx, const void *src, size_t srcSize, const int ultra)

Type:void

Parameter:

TypeParameterName
ZSTD_CCtx *ctx
const void *src
size_tsrcSize
const intultra
409  seqStorePtr = &seqStore
410  istart = src
411  ip = istart
412  anchor = istart
413  iend = istart + srcSize
414  ilimit = iend - 8
415  base = base
416  prefixStart = base + dictLimit
418  maxSearches = 1U << searchLog
419  sufficient_len = targetLength
420  mls = searchLength
421  minMatch = If searchLength == 3 Then 3 Else 4
423  opt = opt
424  matches = matchTable
429  nextToUpdate3 = nextToUpdate
430  ZSTD_rescaleFreqs(seqStorePtr, (constBYTE * )src, srcSize)
431  ip += ip == prefixStart
434  When i < umber of repcodes cycle rep[i] = rep[i]
439  When ip < ilimit cycle
442  memset(opt, 0, sizeof(ZSTD_optimal_t))
443  last_pos = 0
444  litlen = ip - anchor
449  When i < last_i cycle
450  repCur = If i == ZSTD_REP_MOVE_OPT Then rep[0] - 1 Else rep[i]
455  best_mlen = mlen
456  best_off = i
457  cur = 0
458  last_pos = 1
459  Go to _storeSequence
461  best_off = i - (ip == anchor)
462  Do
467  When mlen >= minMatch cycle
472  match_num = ZSTD_BtGetAllMatches_selectMLS(ctx, ip, iend, maxSearches, mls, matches, minMatch)
474  If Not last_pos && Not match_num Then
475  ip++
476  Continue
480  best_mlen = len
481  best_off = off
482  cur = 0
483  last_pos = 1
484  Go to _storeSequence
488  best_mlen = If last_pos Then last_pos Else minMatch
489  When u < match_num cycle
490  mlen = If u > 0 Then len + 1 Else best_mlen
491  best_mlen = len
492  When mlen <= best_mlen cycle
494  If mlen > last_pos || price < price Then
496  mlen++
500  If last_pos < minMatch Then
501  ip++
502  Continue
508  When i < umber of repcodes cycle rep[i] = rep[i]
511  mlen = 1
512  litlen = litlen
515  When cur <= last_pos cycle
516  inr = ip + cur
518  If mlen == 1 Then
524  Else
529  If cur > last_pos || price <= price Then
532  If cur == last_pos Then Break
535  If inr > ilimit Then Continue
538  mlen = mlen
539  If off > ZSTD_REP_MOVE_OPT Then
540  rep[2] = rep[1]
541  rep[1] = rep[0]
542  rep[0] = off - ZSTD_REP_MOVE_OPT
543  Else
544  rep[2] = If off > 1 Then rep[1] Else rep[2]
545  rep[1] = If off > 0 Then rep[0] Else rep[1]
546  rep[0] = If off == ZSTD_REP_MOVE_OPT && mlen != 1 Then rep[0] - 1 Else rep[off]
553  When i < last_i cycle
554  repCur = If i == ZSTD_REP_MOVE_OPT Then rep[0] - 1 Else rep[i]
560  best_mlen = mlen
561  best_off = i
562  last_pos = cur + 1
563  Go to _storeSequence
566  best_off = i - (mlen != 1)
567  If mlen > best_mlen Then best_mlen = mlen
570  Do
571  If mlen == 1 Then
578  Else
583  If cur + mlen > last_pos || price <= price Then
585  mlen--
586  When mlen >= minMatch cycle
594  best_mlen = len
595  best_off = off
596  last_pos = cur + 1
597  Go to _storeSequence
601  When u < match_num cycle
602  mlen = If u > 0 Then len + 1 Else best_mlen
603  best_mlen = len
605  When mlen <= best_mlen cycle
606  If mlen == 1 Then
613  Else
614  litlen = 0
618  If cur + mlen > last_pos || price < price Then
621  mlen++
626  best_mlen = mlen
627  best_off = off
628  cur = last_pos - best_mlen
631  _storeSequence :
632  mlen = 1
634  When 1 cycle
635  mlen = mlen
636  offset = off
637  mlen = best_mlen
638  off = best_off
639  best_mlen = mlen
640  best_off = offset
641  If mlen > cur Then Break
643  cur -= mlen
646  When u <= last_pos cycle
647  u += mlen
650  When cur < last_pos cycle
651  mlen = mlen
652  If mlen == 1 Then
653  ip++
654  cur++
655  Continue
657  offset = off
658  cur += mlen
659  litLength = ip - anchor
661  If offset > ZSTD_REP_MOVE_OPT Then
662  rep[2] = rep[1]
663  rep[1] = rep[0]
665  offset--
666  Else
667  If offset != 0 Then
668  best_off = If offset == ZSTD_REP_MOVE_OPT Then rep[0] - 1 Else rep[offset]
669  If offset != 1 Then rep[2] = rep[1]
671  rep[1] = rep[0]
672  rep[0] = best_off
674  If litLength == 0 Then offset--
680  anchor = ip = ip + mlen
687  When i < umber of repcodes cycle repToConfirm[i] = rep[i]
693  lastLLSize = iend - anchor
694  No 3D Now!(lit, anchor, lastLLSize)
695  lit += lastLLSize
Caller
NameDescribe
ZSTD_compressBlock_btopt
ZSTD_compressBlock_btopt2