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:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Determine the best encoding for the current block: dynamic trees, static* trees or store, and output the encoded block to the zip file. This function* returns the total compressed length for the file so far.

Proto:ulg zlib_tr_flush_block(deflate_state *s, char *buf, ulg stored_len, int eof)

Type:ulg

Parameter:

TypeParameterName
deflate_state *s
char *bufput block, or NULL if too old
ulgstored_lenlength of input block
inteofrue if this is the last block for a file
864  max_blindex = 0
867  If compression level (1..9) > 0 Then
870  If UNKNOWN, BINARY or ASCII == Z_UNKNOWN Then set_data_type(s)
873  build_tree(s, (tree_desc * )( & (Huffman tree for bit lengths )))
877  build_tree(s, (tree_desc * )( & (desc. for distance tree )))
887  max_blindex = build_bl_tree(s)
890  opt_lenb = length of current block with optimal trees + 3 + 7 >> 3
891  static_lenb = length of current block with static trees + 3 + 7 >> 3
897  If static_lenb <= opt_lenb Then opt_lenb = static_lenb
899  Else
901  opt_lenb = static_lenb = length of input block + 5
926  If length of input block + 4 <= opt_lenb && put block, or NULL if too old != 0 Then
935  Send a stored block
940  Else if static_lenb == opt_lenb Then
943  compress_block(s, (ct_data * )Local data. These are initialized only once., (ct_data * )The static literal tree. Since the bit lengths are imposed, there is no* need for the L_CODES extra codes used during heap construction. However* The codes 286 and 287 are needed to build a canonical tree (see zlib_tr_init* below).)
944  al bit length of compressed file += 3 + length of current block with static trees
945  Else
947  send_all_trees(s, largest code with non zero frequency + 1, largest code with non zero frequency + 1, max_blindex + 1)
949  compress_block(s, (ct_data * )literal and length tree , (ct_data * )dyn_dtree)
950  al bit length of compressed file += 3 + length of current block with optimal trees
953  init_block(s)