Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:longest_match

Proto:static uInt longest_match(deflate_state *s, IPos cur_match)

Type:uInt

Parameter:

TypeParameterName
deflate_state *s
IPoscur_match
559  chain_length = Length of the best match at previous step. Matches not greater than this* are discarded. This is used in the lazy match evaluation.
560  scan = window + start of string to insert
563  best_len = prev_length
564  nice_match = Stop searching when current match exceeds this
565  limit = If start of string to insert > Minimum amount of lookahead, except at the end of the input file.* See deflate.c for comments about the MIN_MATCH+1.(s) Then start of string to insert - Minimum amount of lookahead, except at the end of the input file.* See deflate.c for comments about the MIN_MATCH+1.(s) Else Local data
570  prev = Actual size of window: 2*wSize, except when the user input buffer* is directly used as sliding window.
571  wmask = w_size - 1
581  strend = window + start of string to insert + MAX_MATCH
582  scan_end1 = scan[best_len - 1]
583  scan_end = scan[best_len]
592  If prev_length >= good_match Then
593  chain_length >>= 2
598  If nice_match > umber of valid bytes ahead in window Then nice_match = umber of valid bytes ahead in window
602  Do
604  match = window + cur_match
644  If match[best_len] != scan_end || match[best_len - 1] != scan_end1 || match != scan || *++match != scan[1] Then Continue
655  scan += 2 , match++
661  Do
662  When *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && *++scan == *++match && scan < strend cycle
670  len = MAX_MATCH - strend - scan
671  scan = strend - MAX_MATCH
675  If len > best_len Then
677  best_len = len
678  If len >= nice_match Then Break
682  scan_end1 = scan[best_len - 1]
686  When (cur_match = prev[cur_match & wmask]) > limit && --chain_length != 0 cycle
689  If best_len <= umber of valid bytes ahead in window Then Return best_len
690  Return umber of valid bytes ahead in window
Caller
NameDescribe
deflate_fast
deflate_slow