Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
deflate.c File Reference
#include "deflate.h"
Include dependency graph for deflate.c:

Go to the source code of this file.

Classes

struct  config
 
struct  static_tree_desc
 

Macros

#define NIL   0
 
#define TOO_FAR   4096
 
#define EQUAL   0
 
#define RANK(f)   (((f) << 1) - ((f) > 4 ? 9 : 0))
 
#define UPDATE_HASH(s, h, c)   (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
 
#define INSERT_STRING(s, str, match_head)
 
#define CLEAR_HASH(s)
 
#define check_match(s, start, match, length)
 
#define FLUSH_BLOCK_ONLY(s, last)
 
#define FLUSH_BLOCK(s, last)
 

Typedefs

typedef block_state(* compress_func) ()
 

Enumerations

enum  block_state { need_more, block_done, finish_started, finish_done }
 

Functions

static void fill_window ()
 
static block_state deflate_stored ()
 
static block_state deflate_fast ()
 
static block_state deflate_slow ()
 
static block_state deflate_rle ()
 
static block_state deflate_huff ()
 
static void lm_init ()
 
static void putShortMSB ()
 
static void flush_pending ()
 
static int read_buf ()
 
static uInt longest_match ()
 
int deflateInit_ (z_streamp strm, int level, char *version, int stream_size)
 
int deflateInit2_ (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, char *version, int stream_size)
 
int deflateSetDictionary (z_streamp strm, Bytef *dictionary, uInt dictLength)
 
int deflateResetKeep (z_streamp strm)
 
int deflateReset (z_streamp strm)
 
int deflateSetHeader (z_streamp strm, gz_headerp head)
 
int deflatePending (z_streamp strm, unsigned *pending, int *bits)
 
int deflatePrime (z_streamp strm, int bits, int value)
 
int deflateParams (z_streamp strm, int level, int strategy)
 
int deflateTune (z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
 
uLong deflateBound (z_streamp strm, uLong sourceLen)
 
static void putShortMSB (deflate_state *s, uInt b)
 
static void flush_pending (z_streamp strm)
 
int deflate (z_streamp strm, int flush)
 
int deflateEnd (z_streamp strm)
 
int deflateCopy (z_streamp dest, z_streamp source)
 
static int read_buf (z_streamp strm, Bytef *buf, unsigned size)
 
static void lm_init (deflate_state *s)
 
static uInt longest_match (deflate_state *s, IPos cur_match)
 
static void fill_window (deflate_state *s)
 
static block_state deflate_stored (deflate_state *s, int flush)
 
static block_state deflate_fast (deflate_state *s, int flush)
 
static block_state deflate_slow (deflate_state *s, int flush)
 
static block_state deflate_rle (deflate_state *s, int flush)
 
static block_state deflate_huff (deflate_state *s, int flush)
 

Variables

char deflate_copyright []
 
static config configuration_table [10]
 

Class Documentation

struct config

Definition at line 117 of file deflate.c.

Collaboration diagram for config:
Collaboration graph
Class Members
compress_func func
ush good_length
ush max_chain
ush max_lazy
ush nice_length
struct static_tree_desc_s

Definition at line 155 of file deflate.c.

Collaboration diagram for static_tree_desc:
Collaboration graph
Class Members
int dummy
int elems
int extra_base
intf * extra_bits
int max_length
ct_data * static_tree

Macro Definition Documentation

#define check_match (   s,
  start,
  match,
  length 
)

Definition at line 1377 of file deflate.c.

#define CLEAR_HASH (   s)
Value:
s->head[s->hash_size-1] = NIL; \
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
#define NIL
Definition: deflate.c:104
Byte Bytef
Definition: zconf.h:377

Definition at line 196 of file deflate.c.

#define EQUAL   0

Definition at line 151 of file deflate.c.

#define FLUSH_BLOCK (   s,
  last 
)
Value:
{ \
FLUSH_BLOCK_ONLY(s, last); \
if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
}

Definition at line 1550 of file deflate.c.

#define FLUSH_BLOCK_ONLY (   s,
  last 
)
Value:
{ \
_tr_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \
(charf *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \
(last)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
char charf
Definition: zconf.h:379
unsigned long ulg
Definition: zutil.h:45
#define Z_NULL
Definition: zlib.h:208

Definition at line 1538 of file deflate.c.

#define INSERT_STRING (   s,
  str,
  match_head 
)
Value:
(UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
s->head[s->ins_h] = (Pos)(str))
#define MIN_MATCH
Definition: zutil.h:75
ush Pos
Definition: deflate.h:89
#define UPDATE_HASH(s, h, c)
Definition: deflate.c:167

Definition at line 186 of file deflate.c.

#define NIL   0

Definition at line 104 of file deflate.c.

#define RANK (   f)    (((f) << 1) - ((f) > 4 ? 9 : 0))

Definition at line 159 of file deflate.c.

#define TOO_FAR   4096

Definition at line 108 of file deflate.c.

#define UPDATE_HASH (   s,
  h,
 
)    (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)

Definition at line 167 of file deflate.c.

Typedef Documentation

typedef block_state(* compress_func) ()

Definition at line 73 of file deflate.c.

Enumeration Type Documentation

Enumerator
need_more 
block_done 
finish_started 
finish_done 

Definition at line 66 of file deflate.c.

Function Documentation

int deflate ( z_streamp  strm,
int  flush 
)

Definition at line 665 of file deflate.c.

static block_state deflate_fast ( )
static
static block_state deflate_fast ( deflate_state s,
int  flush 
)
static

Definition at line 1628 of file deflate.c.

static block_state deflate_huff ( )
static
static block_state deflate_huff ( deflate_state s,
int  flush 
)
static

Definition at line 1934 of file deflate.c.

static block_state deflate_rle ( )
static
static block_state deflate_rle ( deflate_state s,
int  flush 
)
static

Definition at line 1861 of file deflate.c.

static block_state deflate_slow ( )
static
static block_state deflate_slow ( deflate_state s,
int  flush 
)
static

Definition at line 1730 of file deflate.c.

static block_state deflate_stored ( )
static
static block_state deflate_stored ( deflate_state s,
int  flush 
)
static

Definition at line 1564 of file deflate.c.

uLong deflateBound ( z_streamp  strm,
uLong  sourceLen 
)

Definition at line 566 of file deflate.c.

int deflateCopy ( z_streamp  dest,
z_streamp  source 
)

Definition at line 1014 of file deflate.c.

int deflateEnd ( z_streamp  strm)

Definition at line 979 of file deflate.c.

int deflateInit2_ ( z_streamp  strm,
int  level,
int  method,
int  windowBits,
int  memLevel,
int  strategy,
char *  version,
int  stream_size 
)

Definition at line 213 of file deflate.c.

int deflateInit_ ( z_streamp  strm,
int  level,
char *  version,
int  stream_size 
)

Definition at line 201 of file deflate.c.

int deflateParams ( z_streamp  strm,
int  level,
int  strategy 
)

Definition at line 490 of file deflate.c.

int deflatePending ( z_streamp  strm,
unsigned *  pending,
int *  bits 
)

Definition at line 450 of file deflate.c.

int deflatePrime ( z_streamp  strm,
int  bits,
int  value 
)

Definition at line 464 of file deflate.c.

int deflateReset ( z_streamp  strm)

Definition at line 427 of file deflate.c.

int deflateResetKeep ( z_streamp  strm)

Definition at line 392 of file deflate.c.

int deflateSetDictionary ( z_streamp  strm,
Bytef dictionary,
uInt  dictLength 
)

Definition at line 323 of file deflate.c.

int deflateSetHeader ( z_streamp  strm,
gz_headerp  head 
)

Definition at line 439 of file deflate.c.

int deflateTune ( z_streamp  strm,
int  good_length,
int  max_lazy,
int  nice_length,
int  max_chain 
)

Definition at line 531 of file deflate.c.

static void fill_window ( )
static
static void fill_window ( deflate_state s)
static

Definition at line 1390 of file deflate.c.

static void flush_pending ( )
static
static void flush_pending ( z_streamp  strm)
static

Definition at line 642 of file deflate.c.

static void lm_init ( )
static
static void lm_init ( deflate_state s)
static

Definition at line 1106 of file deflate.c.

static uInt longest_match ( )
static
static uInt longest_match ( deflate_state s,
IPos  cur_match 
)
static

Definition at line 1148 of file deflate.c.

static void putShortMSB ( )
static
static void putShortMSB ( deflate_state s,
uInt  b 
)
static

Definition at line 628 of file deflate.c.

static int read_buf ( )
static
static int read_buf ( z_streamp  strm,
Bytef buf,
unsigned  size 
)
static

Definition at line 1076 of file deflate.c.

Variable Documentation

config configuration_table[10]
static
Initial value:
= {
{0, 0, 0, 0, deflate_stored},
{4, 4, 8, 4, deflate_fast},
{4, 5, 16, 8, deflate_fast},
{4, 6, 32, 32, deflate_fast},
{4, 4, 16, 16, deflate_slow},
{8, 16, 32, 32, deflate_slow},
{8, 16, 128, 128, deflate_slow},
{8, 32, 128, 256, deflate_slow},
{32, 128, 258, 1024, deflate_slow},
{32, 258, 258, 4096, deflate_slow}}
static block_state deflate_slow()
static block_state deflate_fast()
static block_state deflate_stored()

Definition at line 131 of file deflate.c.

char deflate_copyright[]
Initial value:
=
" deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "

Definition at line 54 of file deflate.c.