NCBI C++ ToolKit
Classes | Macros | Functions | Variables
trees.c File Reference
#include "deflate.h"
+ Include dependency graph for trees.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  static_tree_desc_s
 

Macros

#define MAX_BL_BITS   7
 
#define END_BLOCK   256
 
#define REP_3_6   16
 
#define REPZ_3_10   17
 
#define REPZ_11_138   18
 
#define DIST_CODE_LEN   512 /* see definition of array dist_code below */
 
#define send_code(s, c, tree)   send_bits(s, tree[c].Code, tree[c].Len)
 
#define SMALLEST   1
 
#define pqremove(s, tree, top)
 
#define smaller(tree, n, m, depth)
 

Functions

static void tr_static_init (void)
 
static void init_block (deflate_state *s)
 
static void pqdownheap (deflate_state *s, ct_data *tree, int k)
 
static void gen_bitlen (deflate_state *s, tree_desc *desc)
 
static void gen_codes (ct_data *tree, int max_code, uint16_t *bl_count)
 
static void build_tree (deflate_state *s, tree_desc *desc)
 
static void scan_tree (deflate_state *s, ct_data *tree, int max_code)
 
static void send_tree (deflate_state *s, ct_data *tree, int max_code)
 
static int build_bl_tree (deflate_state *s)
 
static void send_all_trees (deflate_state *s, int lcodes, int dcodes, int blcodes)
 
static void compress_block (deflate_state *s, const ct_data *ltree, const ct_data *dtree)
 
static int detect_data_type (deflate_state *s)
 
static unsigned bi_reverse (unsigned value, int length)
 
static void bi_windup (deflate_state *s)
 
static void bi_flush (deflate_state *s)
 
static void copy_block (deflate_state *s, uint8_t *buf, unsigned len, int header)
 
static void send_bits (deflate_state *s, uint64_t val, int len)
 
void ZLIB_INTERNAL _tr_init (deflate_state *s)
 
void ZLIB_INTERNAL _tr_stored_block (deflate_state *s, uint8_t *buf, uint64_t stored_len, int last)
 
void ZLIB_INTERNAL _tr_flush_bits (deflate_state *s)
 
void ZLIB_INTERNAL _tr_align (deflate_state *s)
 
void ZLIB_INTERNAL _tr_flush_block (deflate_state *s, uint8_t *buf, uint64_t stored_len, int last)
 
int ZLIB_INTERNAL _tr_tally (deflate_state *s, unsigned dist, unsigned lc)
 

Variables

static const int extra_lbits [29] = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}
 
static const int extra_dbits [30] = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}
 
static const int extra_blbits [19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}
 
static const uint8_t bl_order [19] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}
 
static ct_data static_ltree [(256+1+29)+2]
 
static ct_data static_dtree [30]
 
uint8_t _dist_code [512]
 
uint8_t _length_code [MAX_MATCH-MIN_MATCH+1]
 
static int base_length [29]
 
static int base_dist [30]
 
static static_tree_desc static_l_desc
 
static static_tree_desc static_d_desc
 
static static_tree_desc static_bl_desc
 

Macro Definition Documentation

◆ DIST_CODE_LEN

#define DIST_CODE_LEN   512 /* see definition of array dist_code below */

Definition at line 81 of file trees.c.

◆ END_BLOCK

#define END_BLOCK   256

Definition at line 50 of file trees.c.

◆ MAX_BL_BITS

#define MAX_BL_BITS   7

Definition at line 47 of file trees.c.

◆ pqremove

#define pqremove (   s,
  tree,
  top 
)
Value:
{\
top = s->heap[SMALLEST]; \
s->heap[SMALLEST] = s->heap[s->heap_len--]; \
pqdownheap(s, tree, SMALLEST); \
}
#define SMALLEST
Definition: trees.c:386

Definition at line 394 of file trees.c.

◆ REP_3_6

#define REP_3_6   16

Definition at line 53 of file trees.c.

◆ REPZ_11_138

#define REPZ_11_138   18

Definition at line 59 of file trees.c.

◆ REPZ_3_10

#define REPZ_3_10   17

Definition at line 56 of file trees.c.

◆ send_code

#define send_code (   s,
  c,
  tree 
)    send_bits(s, tree[c].Code, tree[c].Len)

Definition at line 163 of file trees.c.

◆ smaller

#define smaller (   tree,
  n,
  m,
  depth 
)
Value:
(tree[n].Freq < tree[m].Freq || \
(tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
static unsigned char depth[2 *(256+1+29)+1]
yy_size_t n

Definition at line 405 of file trees.c.

◆ SMALLEST

#define SMALLEST   1

Definition at line 386 of file trees.c.

Function Documentation

◆ _tr_align()

void ZLIB_INTERNAL _tr_align ( deflate_state s)

Definition at line 823 of file trees.c.

References bi_flush(), END_BLOCK, send_bits, send_code, static_ltree, and STATIC_TREES.

◆ _tr_flush_bits()

void ZLIB_INTERNAL _tr_flush_bits ( deflate_state s)

Definition at line 815 of file trees.c.

References bi_flush().

◆ _tr_flush_block()

void ZLIB_INTERNAL _tr_flush_block ( deflate_state s,
uint8_t buf,
uint64_t  stored_len,
int  last 
)

◆ _tr_init()

void ZLIB_INTERNAL _tr_init ( deflate_state s)

◆ _tr_stored_block()

void ZLIB_INTERNAL _tr_stored_block ( deflate_state s,
uint8_t buf,
uint64_t  stored_len,
int  last 
)

Definition at line 802 of file trees.c.

References buf, copy_block(), last(), send_bits(), and STORED_BLOCK.

◆ _tr_tally()

int ZLIB_INTERNAL _tr_tally ( deflate_state s,
unsigned  dist,
unsigned  lc 
)

◆ bi_flush()

static void bi_flush ( deflate_state s)
static

Definition at line 1165 of file trees.c.

References internal_state::bi_buf, internal_state::bi_valid, put_byte, and put_short.

◆ bi_reverse()

static unsigned bi_reverse ( unsigned  value,
int  length 
)
static

Definition at line 1150 of file trees.c.

References len.

◆ bi_windup()

static void bi_windup ( deflate_state s)
static

Definition at line 1182 of file trees.c.

References internal_state::bi_buf, internal_state::bi_valid, put_byte, and put_short.

◆ build_bl_tree()

static int build_bl_tree ( deflate_state s)
static

◆ build_tree()

static void build_tree ( deflate_state s,
tree_desc desc 
)
static

◆ compress_block()

static void compress_block ( deflate_state s,
const ct_data ltree,
const ct_data dtree 
)
static

◆ copy_block()

static void copy_block ( deflate_state s,
uint8_t buf,
unsigned  len,
int  header 
)
static

Definition at line 1205 of file trees.c.

References bi_windup(), buf, len, put_byte, and put_short.

Referenced by _tr_stored_block(), and bm::bvector< Alloc >::combine_operation_with_block().

◆ detect_data_type()

static int detect_data_type ( deflate_state s)
static

Definition at line 1117 of file trees.c.

References internal_state::dyn_ltree, LITERALS, n, Z_BINARY, and Z_TEXT.

◆ gen_bitlen()

static void gen_bitlen ( deflate_state s,
tree_desc desc 
)
static

◆ gen_codes()

static void gen_codes ( ct_data tree,
int  max_code,
uint16_t bl_count 
)
static

Definition at line 530 of file trees.c.

References Assert, bi_reverse(), bl_count, Code, isgraph(), len, MAX_BITS, n, static_ltree, Tracecv, and Tracev.

◆ init_block()

static void init_block ( deflate_state s)
static

◆ pqdownheap()

static void pqdownheap ( deflate_state s,
ct_data tree,
int  k 
)
static

Definition at line 415 of file trees.c.

References internal_state::depth, internal_state::heap, heap_len, and smaller.

◆ scan_tree()

static void scan_tree ( deflate_state s,
ct_data tree,
int  max_code 
)
static

Definition at line 654 of file trees.c.

References internal_state::bl_tree, n, REP_3_6, REPZ_11_138, and REPZ_3_10.

◆ send_all_trees()

static void send_all_trees ( deflate_state s,
int  lcodes,
int  dcodes,
int  blcodes 
)
static

◆ send_bits()

static void send_bits ( deflate_state s,
uint64_t  val,
int  len 
)
static

◆ send_tree()

static void send_tree ( deflate_state s,
ct_data tree,
int  max_code 
)
static

Definition at line 695 of file trees.c.

References Assert, internal_state::bl_tree, n, REP_3_6, REPZ_11_138, REPZ_3_10, send_bits(), and send_code.

◆ tr_static_init()

static void tr_static_init ( void  )
static

Variable Documentation

◆ _dist_code

uint8_t _dist_code[512]

Definition at line 98 of file trees.c.

◆ _length_code

uint8_t _length_code[MAX_MATCH-MIN_MATCH+1]

Definition at line 104 of file trees.c.

◆ base_dist

int base_dist[30]
static

Definition at line 110 of file trees.c.

◆ base_length

int base_length[29]
static

Definition at line 107 of file trees.c.

◆ bl_order

const uint8_t bl_order[19] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}
static

Definition at line 71 of file trees.c.

◆ extra_blbits

const int extra_blbits[19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}
static

Definition at line 68 of file trees.c.

◆ extra_dbits

const int extra_dbits[30] = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}
static

Definition at line 65 of file trees.c.

◆ extra_lbits

const int extra_lbits[29] = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0}
static

Definition at line 62 of file trees.c.

◆ static_bl_desc

static_tree_desc static_bl_desc
static
Initial value:
=
{(const ct_data *)0, extra_blbits, 0, 19 , 7 }
const int extra_blbits[19]
Definition: trees.c:69

Definition at line 131 of file trees.c.

◆ static_d_desc

static_tree_desc static_d_desc
static
Initial value:
=
{static_dtree, extra_dbits, 0, 30 , 15 }
ct_data static_dtree[30]
Definition: trees.c:93
const int extra_dbits[30]
Definition: trees.c:66

Definition at line 128 of file trees.c.

◆ static_dtree

ct_data static_dtree[30]
static

Definition at line 93 of file trees.c.

◆ static_l_desc

static_tree_desc static_l_desc
static
Initial value:
=
{static_ltree, extra_lbits, 256 +1, ( 256 +1+ 29 ) , 15 }
const int extra_lbits[29]
Definition: trees.c:63
ct_data static_ltree[(256+1+29)+2]
Definition: trees.c:86

Definition at line 125 of file trees.c.

◆ static_ltree

ct_data static_ltree[(256+1+29)+2]
static

Definition at line 86 of file trees.c.

Modified on Mon Jul 22 05:06:12 2024 by modify_doxy.py rev. 669887