FireBirdLib - Topfield TMS PVR TAP Programming Library
FBLib_compression.h File Reference
#include <limits.h>
#include "type.h"
#include "libFireBird.h"

Go to the source code of this file.

Data Structures

struct  HASH
 
struct  MATCHDATA
 
struct  ARDATA
 

Macros

#define LOAD_WORD(x)   (((x)[0] << 8) | (x)[1])
 
#define LOAD_WORDLE(x)   (((x)[1] << 8) | (x)[0])
 
#define STORE_WORD(x, y)   (x)[0] = (y) >> 8;(x)[1] = (y) & 0xff
 
#define STORE_WORDLE(x, y)   (x)[1] = (y) >> 8;(x)[0] = (y) & 0xff
 
#define LZHUFF5_METHOD_NUM   5
 
#define LZHUFF6_METHOD_NUM   6
 
#define LZHUFF7_METHOD_NUM   7
 
#define LZHUFF4_DICBIT   12 /* 2^12 = 4KB sliding dictionary */
 
#define LZHUFF5_DICBIT   13 /* 2^13 = 8KB sliding dictionary */
 
#define LZHUFF6_DICBIT   15 /* 2^15 = 32KB sliding dictionary */
 
#define LZHUFF7_DICBIT   16 /* 2^16 = 64KB sliding dictionary */
 
#define NIL   0
 
#define INIT_HASH(pos)
 
#define NEXT_HASH(hash, pos)
 
#define peekbits(n)   (ArData->bitbuf >> (sizeof(ArData->bitbuf)*8 - (n)))
 
#define NC   (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
 
#define MAXMATCH   256 /* formerly F (not more than UCHAR_MAX + 1) */
 
#define THRESHOLD   3 /* choose optimal value */
 
#define MAX_DICBIT   LZHUFF7_DICBIT /* lh7 use 16bits */
 
#define MAX_DICSIZ   (1L << MAX_DICBIT)
 
#define USHRT_BIT   16 /* (CHAR_BIT * sizeof(ushort)) */
 
#define NP   (MAX_DICBIT + 1)
 
#define NT   (USHRT_BIT + 3)
 
#define NPT   0x80 /* #if NT > NP #define NPT NT #else #define NPT NP #endif */
 
#define TBIT   5 /* smallest integer such that (1 << TBIT) > * NT */
 
#define CBIT   9 /* smallest integer such that (1 << CBIT) > * NC */
 
#define HSHSIZ   (((dword)1) <<15)
 
#define TXTSIZ   (MAX_DICSIZ * 2L + MAXMATCH)
 
#define LIMIT   0x100 /* limit of hash chain */
 

Macro Definition Documentation

◆ CBIT

#define CBIT   9 /* smallest integer such that (1 << CBIT) > * NC */

Definition at line 62 of file FBLib_compression.h.

◆ HSHSIZ

#define HSHSIZ   (((dword)1) <<15)

Definition at line 63 of file FBLib_compression.h.

◆ INIT_HASH

#define INIT_HASH (   pos)
Value:
((( (ArData->text[(pos)] << 5) \
^ ArData->text[(pos) + 1] ) << 5) \
^ ArData->text[(pos) + 2] ) & (unsigned)(HSHSIZ - 1);
#define HSHSIZ

Definition at line 42 of file FBLib_compression.h.

◆ LIMIT

#define LIMIT   0x100 /* limit of hash chain */

Definition at line 65 of file FBLib_compression.h.

◆ LOAD_WORD

#define LOAD_WORD (   x)    (((x)[0] << 8) | (x)[1])

Definition at line 25 of file FBLib_compression.h.

◆ LOAD_WORDLE

#define LOAD_WORDLE (   x)    (((x)[1] << 8) | (x)[0])

Definition at line 26 of file FBLib_compression.h.

◆ LZHUFF4_DICBIT

#define LZHUFF4_DICBIT   12 /* 2^12 = 4KB sliding dictionary */

Definition at line 34 of file FBLib_compression.h.

◆ LZHUFF5_DICBIT

#define LZHUFF5_DICBIT   13 /* 2^13 = 8KB sliding dictionary */

Definition at line 35 of file FBLib_compression.h.

◆ LZHUFF5_METHOD_NUM

#define LZHUFF5_METHOD_NUM   5

Definition at line 30 of file FBLib_compression.h.

◆ LZHUFF6_DICBIT

#define LZHUFF6_DICBIT   15 /* 2^15 = 32KB sliding dictionary */

Definition at line 36 of file FBLib_compression.h.

◆ LZHUFF6_METHOD_NUM

#define LZHUFF6_METHOD_NUM   6

Definition at line 31 of file FBLib_compression.h.

◆ LZHUFF7_DICBIT

#define LZHUFF7_DICBIT   16 /* 2^16 = 64KB sliding dictionary */

Definition at line 37 of file FBLib_compression.h.

◆ LZHUFF7_METHOD_NUM

#define LZHUFF7_METHOD_NUM   7

Definition at line 32 of file FBLib_compression.h.

◆ MAX_DICBIT

#define MAX_DICBIT   LZHUFF7_DICBIT /* lh7 use 16bits */

Definition at line 55 of file FBLib_compression.h.

◆ MAX_DICSIZ

#define MAX_DICSIZ   (1L << MAX_DICBIT)

Definition at line 56 of file FBLib_compression.h.

◆ MAXMATCH

#define MAXMATCH   256 /* formerly F (not more than UCHAR_MAX + 1) */

Definition at line 53 of file FBLib_compression.h.

◆ NC

#define NC   (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)

Definition at line 52 of file FBLib_compression.h.

◆ NEXT_HASH

#define NEXT_HASH (   hash,
  pos 
)
Value:
(((hash) << 5) \
^ ArData->text[(pos) + 2] ) & (unsigned)(HSHSIZ - 1);

Definition at line 46 of file FBLib_compression.h.

◆ NIL

#define NIL   0

Definition at line 39 of file FBLib_compression.h.

◆ NP

#define NP   (MAX_DICBIT + 1)

Definition at line 58 of file FBLib_compression.h.

◆ NPT

#define NPT   0x80 /* #if NT > NP #define NPT NT #else #define NPT NP #endif */

Definition at line 60 of file FBLib_compression.h.

◆ NT

#define NT   (USHRT_BIT + 3)

Definition at line 59 of file FBLib_compression.h.

◆ peekbits

#define peekbits (   n)    (ArData->bitbuf >> (sizeof(ArData->bitbuf)*8 - (n)))

Definition at line 51 of file FBLib_compression.h.

◆ STORE_WORD

#define STORE_WORD (   x,
 
)    (x)[0] = (y) >> 8;(x)[1] = (y) & 0xff

Definition at line 27 of file FBLib_compression.h.

◆ STORE_WORDLE

#define STORE_WORDLE (   x,
 
)    (x)[1] = (y) >> 8;(x)[0] = (y) & 0xff

Definition at line 28 of file FBLib_compression.h.

◆ TBIT

#define TBIT   5 /* smallest integer such that (1 << TBIT) > * NT */

Definition at line 61 of file FBLib_compression.h.

◆ THRESHOLD

#define THRESHOLD   3 /* choose optimal value */

Definition at line 54 of file FBLib_compression.h.

◆ TXTSIZ

#define TXTSIZ   (MAX_DICSIZ * 2L + MAXMATCH)

Definition at line 64 of file FBLib_compression.h.

◆ USHRT_BIT

#define USHRT_BIT   16 /* (CHAR_BIT * sizeof(ushort)) */

Definition at line 57 of file FBLib_compression.h.