Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:gen_bitlen

Proto:static void gen_bitlen(deflate_state *s, tree_desc *desc)

Type:void

Parameter:

TypeParameterName
deflate_state *s
tree_desc *desc
412  tree = the dynamic tree
413  max_code = largest code with non zero frequency
414  stree = static_tree
415  extra = extra_bits
416  base = extra_base
417  max_length = max_length
423  overflow = 0
425  When bits <= maximum heap size cycle bl_count[bits] = 0
430  Len = 0
432  When h < umber of codes used to transfer the bit lengths cycle
433  n = umber of codes at each bit length for an optimal tree [h]
434  bits = Len + 1
435  If bits > max_length Then bits = max_length , overflow++
436  Len = bits
439  If n > max_code Then Continue
441  bl_count[bits]++
442  xbits = 0
443  If n >= base Then xbits = extra[n - base]
444  f = Freq
445  length of current block with optimal trees += f * (bits + xbits)
446  If stree Then length of current block with static trees += f * (Len + xbits)
448  If overflow == 0 Then Return
454  Do
455  bits = max_length - 1
456  When bl_count[bits] == 0 cycle
456  bits--
457  bl_count[bits]--
458  bl_count[bits + 1] += 2
459  bl_count[max_length]--
463  overflow -= 2
464  When overflow > 0 cycle
471  When bits != 0 cycle
472  n = bl_count[bits]
473  When n != 0 cycle
475  If m > max_code Then Continue
476  If Len != bits Then
482  n--
Caller
NameDescribe
build_tree