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

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 put_short(s, w)
 
#define send_bits(s, value, length)
 
#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, ushf *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, charf *buf, unsigned len, int header)
 
void ZLIB_INTERNAL _tr_init (deflate_state *s)
 
void ZLIB_INTERNAL _tr_stored_block (deflate_state *s, charf *buf, ulg 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, charf *buf, ulg stored_len, int last)
 
int ZLIB_INTERNAL _tr_tally (deflate_state *s, unsigned dist, unsigned lc)
 

Variables

static 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 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}
 
static 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}
 
static 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}
 
static ct_data static_ltree [L_CODES+2]
 
static ct_data static_dtree [D_CODES]
 
uch _dist_code [DIST_CODE_LEN]
 
uch _length_code [MAX_MATCH-MIN_MATCH+1]
 
static int base_length [LENGTH_CODES]
 
static int base_dist [D_CODES]
 
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 */

◆ END_BLOCK

#define END_BLOCK   256

◆ MAX_BL_BITS

#define MAX_BL_BITS   7

◆ pqremove

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

◆ put_short

#define put_short (   s,
  w 
)
Value:
{ \
put_byte(s, (uch)((w) & 0xff)); \
put_byte(s, (uch)((ush)(w) >> 8)); \
}
GLdouble s
Definition: glext.h:6390
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6742

◆ REP_3_6

#define REP_3_6   16

◆ REPZ_11_138

#define REPZ_11_138   18

◆ REPZ_3_10

#define REPZ_3_10   17

◆ 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 |= (ush)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 |= (ush)(value) << s->bi_valid;\
s->bi_valid += len;\
}\
}
GLuint GLfloat * val
Definition: glext.h:7847
GLenum GLsizei len
Definition: glext.h:7389
GLdouble s
Definition: glext.h:6390
#define put_short(s, w)
Definition: trees.c:169
GLsizei const GLfloat * value
Definition: glext.h:6709
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
#define Buf_size
Definition: deflate.h:51

◆ send_code

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

◆ smaller

#define smaller (   tree,
  n,
  m,
  depth 
)
Value:
(tree[n].Freq < tree[m].Freq || \
(tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glext.h:6293
GLdouble n
Definition: glext.h:8396
const GLfloat * m
Definition: glext.h:11755

◆ SMALLEST

#define SMALLEST   1

Function Documentation

◆ _tr_align()

void ZLIB_INTERNAL _tr_align ( deflate_state s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _tr_flush_bits()

void ZLIB_INTERNAL _tr_flush_bits ( deflate_state s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _tr_flush_block()

void ZLIB_INTERNAL _tr_flush_block ( deflate_state s,
charf buf,
ulg  stored_len,
int  last 
)
Here is the call graph for this function:

◆ _tr_init()

void ZLIB_INTERNAL _tr_init ( deflate_state s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _tr_stored_block()

void ZLIB_INTERNAL _tr_stored_block ( deflate_state s,
charf buf,
ulg  stored_len,
int  last 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _tr_tally()

int ZLIB_INTERNAL _tr_tally ( deflate_state s,
unsigned  dist,
unsigned  lc 
)
Here is the call graph for this function:

◆ bi_flush()

static void bi_flush ( deflate_state s)
static
Here is the caller graph for this function:

◆ bi_reverse()

static unsigned bi_reverse ( unsigned  value,
int  length 
)
static
Here is the caller graph for this function:

◆ bi_windup()

static void bi_windup ( deflate_state s)
static
Here is the caller graph for this function:

◆ build_bl_tree()

static int build_bl_tree ( deflate_state s)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ build_tree()

static void build_tree ( deflate_state s,
tree_desc desc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compress_block()

static void compress_block ( deflate_state s,
const ct_data ltree,
const ct_data dtree 
)
static
Here is the caller graph for this function:

◆ copy_block()

static void copy_block ( deflate_state s,
charf buf,
unsigned  len,
int  header 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detect_data_type()

static int detect_data_type ( deflate_state s)
static
Here is the caller graph for this function:

◆ gen_bitlen()

static void gen_bitlen ( deflate_state s,
tree_desc desc 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gen_codes()

static void gen_codes ( ct_data tree,
int  max_code,
ushf *  bl_count 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_block()

static void init_block ( deflate_state s)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pqdownheap()

static void pqdownheap ( deflate_state s,
ct_data tree,
int  k 
)
static
Here is the caller graph for this function:

◆ scan_tree()

static void scan_tree ( deflate_state s,
ct_data tree,
int  max_code 
)
static
Here is the caller graph for this function:

◆ send_all_trees()

static void send_all_trees ( deflate_state s,
int  lcodes,
int  dcodes,
int  blcodes 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_tree()

static void send_tree ( deflate_state s,
ct_data tree,
int  max_code 
)
static
Here is the caller graph for this function:

◆ tr_static_init()

static void tr_static_init ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _dist_code

uch _dist_code[DIST_CODE_LEN]

◆ _length_code

uch _length_code[MAX_MATCH-MIN_MATCH+1]

◆ base_dist

int base_dist[D_CODES]
static

◆ base_length

int base_length[LENGTH_CODES]
static

◆ 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}
static

◆ 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}
static

◆ 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}
static

◆ 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}
static

◆ static_bl_desc

static_tree_desc static_bl_desc
static
Initial value:
=
static const int extra_blbits[BL_CODES]
Definition: trees.c:69
#define BL_CODES
Definition: deflate.h:42
#define MAX_BL_BITS
Definition: trees.c:47
Definition: deflate.h:65

◆ static_d_desc

static_tree_desc static_d_desc
static
Initial value:
=
static const int extra_dbits[D_CODES]
Definition: trees.c:66
#define D_CODES
Definition: deflate.h:39
static ct_data static_dtree[D_CODES]
Definition: trees.c:93
#define MAX_BITS
Definition: deflate.h:48

◆ static_dtree

ct_data static_dtree[D_CODES]
static

◆ static_l_desc

static_tree_desc static_l_desc
static
Initial value:
=
static ct_data static_ltree[L_CODES+2]
Definition: trees.c:86
#define L_CODES
Definition: deflate.h:36
static const int extra_lbits[LENGTH_CODES]
Definition: trees.c:63
#define LITERALS
Definition: deflate.h:33
#define MAX_BITS
Definition: deflate.h:48

◆ static_ltree

ct_data static_ltree[L_CODES+2]
static