Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# trees.c File Reference

`#include "deflate.h"`

Include dependency graph for trees.c:

## Compounds
struct | static_tree_desc_s
## Defines
#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 | Buf_size (8 * 2*sizeof(char))
#define | DIST_CODE_LEN 512
#define | send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
#define | put_short(s, w)
#define | send_bits(s, value, length)
#define | MAX(a, b) (a >= b ? a : b)
#define | SMALLEST 1
#define | pqremove(s, tree, top)
#define | smaller(tree, n, m, depth)
## Functions
void | tr_static_init ()
void | init_block ()
void | pqdownheap ()
void | gen_bitlen ()
void | gen_codes ()
void | build_tree ()
void | scan_tree ()
void | send_tree ()
int | build_bl_tree ()
void | send_all_trees ()
void | compress_block ()
void | set_data_type ()
unsigned | bi_reverse ()
void | bi_windup ()
void | bi_flush ()
void | copy_block ()
void | _tr_init (s) deflate_state *s
## Variables
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}
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}
int | extra_blbits [19] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7}
uch | bl_order [19] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}
ct_data | static_ltree [(256+1+29)+2]
ct_data | static_dtree [30]
uch | _dist_code [512]
uch | _length_code [258-3+1]
int | base_length [29]
int | base_dist [30]
static_tree_desc | static_l_desc
static_tree_desc | static_d_desc
static_tree_desc | static_bl_desc
ct_data * | tree
int | k
tree_desc * | desc
int | max_code
ushf * | bl_count
int | lcodes
int | dcodes
int | blcodes
charf * | buf
ulg | stored_len
int | eof
unsigned | dist
unsigned | lc
ct_data * | ltree
ct_data * | dtree
int | len
int | header

## Define Documentation

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

#define DIST_CODE_LEN 512

#define END_BLOCK 256

#define MAX | ( | a,
|  | b |  | ) | (a >= b ? a : b)

#define MAX_BL_BITS 7

#define pqremove | ( | s,
|  | tree,
|  | top |  | ) |

| Value:
    {\
        top = s->heap[SMALLEST]; \
        s->heap[SMALLEST] = s->heap[s->heap_len--]; \
        pqdownheap(s, tree, SMALLEST); \
    }

#define put_short | ( | s,
|  | w |  | ) |

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

#define REP_3_6 16

#define REPZ_11_138 18

#define REPZ_3_10 17

#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;\
      }\
    }

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

#define smaller | ( | tree,
|  | n,
|  | m,
|  | depth |  | ) |

| Value:
    (tree[n].Freq < tree[m].Freq || \
       (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))

#define SMALLEST 1

## Function Documentation

void _tr_init | ( | s |  | ) |

void bi_flush | ( |  | ) | `[static]`

unsigned bi_reverse | ( |  | ) | `[static]`

void bi_windup | ( |  | ) | `[static]`

int build_bl_tree | ( |  | ) | `[static]`

void build_tree | ( |  | ) | `[static]`

void compress_block | ( |  | ) | `[static]`

void copy_block | ( |  | ) | `[static]`

void gen_bitlen | ( |  | ) | `[static]`

void gen_codes | ( |  | ) | `[static]`

void init_block | ( |  | ) | `[static]`

void pqdownheap | ( |  | ) | `[static]`

void scan_tree | ( |  | ) | `[static]`

void send_all_trees | ( |  | ) | `[static]`

void send_tree | ( |  | ) | `[static]`

void set_data_type | ( |  | ) | `[static]`

void tr_static_init | ( |  | ) | `[static]`

## Variable Documentation

uch _dist_code[ 512 ]

uch _length_code[ 258 - 3 +1]

int base_dist[ 30 ]`[static]`

int base_length[ 29 ]`[static]`

ushf* bl_count

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

int blcodes

charf* buf

int dcodes

tree_desc * desc

unsigned dist

ct_data* dtree

int eof

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

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]`

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]`

int header

int k

unsigned lc

int lcodes

unsigned len

ct_data* ltree

int max_code

static_tree_desc static_bl_desc`[static]`

| Initial value:
    {(   ct_data *)0, extra_blbits, 0,    19 ,  7 }

static_tree_desc static_d_desc`[static]`

| Initial value:
    {static_dtree, extra_dbits, 0,           30 ,  15 }

ct_data static_dtree[ 30 ]`[static]`

static_tree_desc static_l_desc`[static]`

| Initial value:
    {static_ltree, extra_lbits,  256 +1,  ( 256 +1+ 29 ) ,  15 }

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

ulg stored_len

ct_data * tree