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.

Classes

struct  static_tree_desc_s
 

Macros

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

Functions

void _tr_align (deflate_state *s)
 
void _tr_flush_block (deflate_state *s, charf *buf, ulg stored_len, int eof)
 
void _tr_init (deflate_state *s)
 
void _tr_stored_block (deflate_state *s, charf *buf, ulg stored_len, int eof)
 
int _tr_tally (deflate_state *s, unsigned dist, unsigned lc)
 
void bi_flush (deflate_state *s)
 
unsigned bi_reverse (unsigned code, int len)
 
void bi_windup (deflate_state *s)
 
int build_bl_tree (deflate_state *s)
 
void build_tree (deflate_state *s, tree_desc *desc)
 
void compress_block (deflate_state *s, ct_data *ltree, ct_data *dtree)
 
void copy_block (deflate_state *s, charf *buf, unsigned len, int header)
 
void gen_bitlen (deflate_state *s, tree_desc *desc)
 
void gen_codes (ct_data *tree, int max_code, ushf *bl_count)
 
void init_block (deflate_state *s)
 
void gen_codes OF ((ct_data *tree, int max_code, ushf *bl_count))
 
void init_block OF ((deflate_state *s))
 
void copy_block OF ((deflate_state *s, charf *buf, unsigned len, int header))
 
void compress_block OF ((deflate_state *s, ct_data *ltree, ct_data *dtree))
 
void pqdownheap OF ((deflate_state *s, ct_data *tree, int k))
 
void scan_tree OF ((deflate_state *s, ct_data *tree, int max_code))
 
void send_all_trees OF ((deflate_state *s, int lcodes, int dcodes, int blcodes))
 
void gen_bitlen OF ((deflate_state *s, tree_desc *desc))
 
unsigned bi_reverse OF ((unsigned value, int length))
 
void tr_static_init OF ((void))
 
void pqdownheap (deflate_state *s, ct_data *tree, int k)
 
void scan_tree (deflate_state *s, ct_data *tree, int max_code)
 
void send_all_trees (deflate_state *s, int lcodes, int dcodes, int blcodes)
 
void send_tree (deflate_state *s, ct_data *tree, int max_code)
 
void set_data_type (deflate_state *s)
 
void tr_static_init ()
 

Variables

uch _dist_code [DIST_CODE_LEN]
 
uch _length_code [MAX_MATCH-MIN_MATCH+1]
 
int base_dist [D_CODES]
 
int base_length [LENGTH_CODES]
 
const uch bl_order [BL_CODES] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}
 
const int extra_blbits [BL_CODES] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}
 
const int extra_dbits [D_CODES] = {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}
 
const int extra_lbits [LENGTH_CODES] = {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_tree_desc static_bl_desc
 
static_tree_desc static_d_desc
 
ct_data static_dtree [D_CODES]
 
static_tree_desc static_l_desc
 
ct_data static_ltree [L_CODES+2]
 

Macro Definition Documentation

◆ Buf_size

#define Buf_size   (8 * 2*sizeof(char))

Definition at line 76 of file trees.c.

◆ DIST_CODE_LEN

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

Definition at line 85 of file trees.c.

◆ END_BLOCK

#define END_BLOCK   256

Definition at line 49 of file trees.c.

◆ MAX_BL_BITS

#define MAX_BL_BITS   7

Definition at line 46 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); \
}

Definition at line 434 of file trees.c.

◆ put_short

#define put_short (   s,
 
)
Value:
{ \
put_byte(s, (uch)((w) & 0xff)); \
put_byte(s, (uch)((ush)(w) >> 8)); \
}

Definition at line 180 of file trees.c.

◆ REP_3_6

#define REP_3_6   16

Definition at line 52 of file trees.c.

◆ REPZ_11_138

#define REPZ_11_138   18

Definition at line 58 of file trees.c.

◆ REPZ_3_10

#define REPZ_3_10   17

Definition at line 55 of file trees.c.

◆ send_bits

#define send_bits (   s,
  value,
  length 
)
Value:
{ int len = length;\
if (s->bi_valid > (int)Buf_size - len) {\
int val = value;\
s->bi_buf |= (val << s->bi_valid);\
put_short(s, s->bi_buf);\
s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
s->bi_valid += len - Buf_size;\
} else {\
s->bi_buf |= (value) << s->bi_valid;\
s->bi_valid += len;\
}\
}

Definition at line 217 of file trees.c.

◆ send_code

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

Definition at line 167 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]))

Definition at line 445 of file trees.c.

◆ SMALLEST

#define SMALLEST   1

Definition at line 426 of file trees.c.

Function Documentation

◆ _tr_align()

void _tr_align ( deflate_state s)

Definition at line 892 of file trees.c.

◆ _tr_flush_block()

void _tr_flush_block ( deflate_state s,
charf buf,
ulg  stored_len,
int  eof 
)

Definition at line 921 of file trees.c.

◆ _tr_init()

void _tr_init ( deflate_state s)

Definition at line 382 of file trees.c.

◆ _tr_stored_block()

void _tr_stored_block ( deflate_state s,
charf buf,
ulg  stored_len,
int  eof 
)

Definition at line 867 of file trees.c.

◆ _tr_tally()

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

Definition at line 1022 of file trees.c.

◆ bi_flush()

void bi_flush ( deflate_state s)

Definition at line 1161 of file trees.c.

◆ bi_reverse()

unsigned bi_reverse ( unsigned  code,
int  len 
)

Definition at line 1146 of file trees.c.

◆ bi_windup()

void bi_windup ( deflate_state s)

Definition at line 1178 of file trees.c.

◆ build_bl_tree()

int build_bl_tree ( deflate_state s)

Definition at line 803 of file trees.c.

◆ build_tree()

void build_tree ( deflate_state s,
tree_desc desc 
)

Definition at line 619 of file trees.c.

◆ compress_block()

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

Definition at line 1072 of file trees.c.

◆ copy_block()

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

Definition at line 1197 of file trees.c.

◆ gen_bitlen()

void gen_bitlen ( deflate_state s,
tree_desc desc 
)

Definition at line 490 of file trees.c.

◆ gen_codes()

void gen_codes ( ct_data tree,
int  max_code,
ushf bl_count 
)

Definition at line 577 of file trees.c.

◆ init_block()

void init_block ( deflate_state s)

Definition at line 411 of file trees.c.

◆ OF() [1/10]

void gen_codes OF ( (ct_data *tree, int max_code, ushf *bl_count)  )

◆ OF() [2/10]

void init_block OF ( (deflate_state *s)  )

◆ OF() [3/10]

void copy_block OF ( (deflate_state *s, charf *buf, unsigned len, int header)  )

◆ OF() [4/10]

void compress_block OF ( (deflate_state *s, ct_data *ltree, ct_data *dtree)  )

◆ OF() [5/10]

void pqdownheap OF ( (deflate_state *s, ct_data *tree, int k)  )

◆ OF() [6/10]

void scan_tree OF ( (deflate_state *s, ct_data *tree, int max_code)  )

◆ OF() [7/10]

void send_all_trees OF ( (deflate_state *s, int lcodes, int dcodes, int blcodes)  )

◆ OF() [8/10]

void gen_bitlen OF ( (deflate_state *s, tree_desc *desc)  )

◆ OF() [9/10]

unsigned bi_reverse OF ( (unsigned value, int length )

◆ OF() [10/10]

void tr_static_init OF ( (void )

◆ pqdownheap()

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

Definition at line 455 of file trees.c.

◆ scan_tree()

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

Definition at line 707 of file trees.c.

◆ send_all_trees()

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

Definition at line 838 of file trees.c.

◆ send_tree()

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

Definition at line 752 of file trees.c.

◆ set_data_type()

void set_data_type ( deflate_state s)

Definition at line 1126 of file trees.c.

◆ tr_static_init()

void tr_static_init ( )

Definition at line 238 of file trees.c.

Variable Documentation

◆ _dist_code

uch _dist_code[DIST_CODE_LEN]

Definition at line 102 of file trees.c.

◆ _length_code

uch _length_code[MAX_MATCH-MIN_MATCH+1]

Definition at line 108 of file trees.c.

◆ base_dist

int base_dist[D_CODES]

Definition at line 114 of file trees.c.

◆ base_length

int base_length[LENGTH_CODES]

Definition at line 111 of file trees.c.

◆ bl_order

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

Definition at line 71 of file trees.c.

◆ extra_blbits

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

Definition at line 68 of file trees.c.

◆ extra_dbits

const int extra_dbits[D_CODES] = {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}

Definition at line 65 of file trees.c.

◆ extra_lbits

const int extra_lbits[LENGTH_CODES] = {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}

Definition at line 62 of file trees.c.

◆ static_bl_desc

static_tree_desc static_bl_desc
Initial value:

Definition at line 135 of file trees.c.

◆ static_d_desc

static_tree_desc static_d_desc
Initial value:

Definition at line 132 of file trees.c.

◆ static_dtree

ct_data static_dtree[D_CODES]

Definition at line 97 of file trees.c.

◆ static_l_desc

static_tree_desc static_l_desc
Initial value:

Definition at line 129 of file trees.c.

◆ static_ltree

ct_data static_ltree[L_CODES+2]

Definition at line 90 of file trees.c.

MAX_BITS
#define MAX_BITS
Definition: deflate.h:48
jpeg_error_mgr::s
char s[JMSG_STR_PARM_MAX]
Definition: jpeglib.h:663
SMALLEST
#define SMALLEST
Definition: trees.c:426
uch
unsigned char uch
Definition: zutil.h:47
autoplay.n
n
Definition: autoplay.py:12
BL_CODES
#define BL_CODES
Definition: deflate.h:42
static_ltree
ct_data static_ltree[L_CODES+2]
Definition: trees.c:90
MAX_BL_BITS
#define MAX_BL_BITS
Definition: trees.c:46
LITERALS
#define LITERALS
Definition: deflate.h:33
ush
unsigned short ush
Definition: zutil.h:49
value
png_voidp int value
Definition: png.h:2110
extra_blbits
const int extra_blbits[BL_CODES]
Definition: trees.c:68
val
int val
Definition: jpeglib.h:956
ct_data_s
Definition: deflate.h:62
extra_dbits
const int extra_dbits[D_CODES]
Definition: trees.c:65
L_CODES
#define L_CODES
Definition: deflate.h:36
D_CODES
#define D_CODES
Definition: deflate.h:39
length
png_bytep png_bytep png_size_t length
Definition: png.h:1538
static_dtree
ct_data static_dtree[D_CODES]
Definition: trees.c:97
Buf_size
#define Buf_size
Definition: trees.c:76
extra_lbits
const int extra_lbits[LENGTH_CODES]
Definition: trees.c:62


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:05