FireBirdLib - Topfield TMS PVR TAP Programming Library
lh5.c File Reference
#include <stdio.h>
#include <string.h>
#include "libFireBird.h"

Go to the source code of this file.

Data Structures

struct  ARDATA
 

Macros

#define PERCOLATE
 
#define BITBUFSIZ   (16)
 
#define UCHARMAX   (255)
 
#define DICBIT   (13)
 
#define DICSIZ   (1<<DICBIT)
 
#define MATCHBIT   (8)
 
#define MAXMATCH   (1<<MATCHBIT)
 
#define THRESHOLD   (3)
 
#define PERCFLAG   (0x8000)
 
#define NC   (UCHARMAX+MAXMATCH+2-THRESHOLD)
 
#define CBIT   (9)
 
#define CODEBIT   (16)
 
#define NP   (DICBIT+1)
 
#define NT   (CODEBIT+3)
 
#define PBIT   4
 
#define TBIT   5
 
#define NPT   NT
 
#define NUL   (0)
 
#define MAXHASHVAL   (3*DICSIZ+((DICSIZ>>9)+1)*UCHARMAX)
 
#define WINBIT   (14)
 
#define WINDOWSIZE   (1<<WINBIT)
 
#define BUFBIT   (15)
 
#define BUFSIZE   (1<<BUFBIT)
 
#define FREEMEM(p)   if(p) {TAP_MemFree(p); p = NULL;}
 

Typedefs

typedef short * ARPWord
 
typedef byte * ARPByte
 

Functions

word CompressBlock (byte *inputbuffer, word inputsize, byte *outputbuffer)
 
word UncompressBlock (byte *inputbuffer, word inputsize, byte *outputbuffer, word BufferSize)
 

Macro Definition Documentation

◆ BITBUFSIZ

#define BITBUFSIZ   (16)

Definition at line 43 of file lh5.c.

◆ BUFBIT

#define BUFBIT   (15)

Definition at line 70 of file lh5.c.

◆ BUFSIZE

#define BUFSIZE   (1<<BUFBIT)

Definition at line 71 of file lh5.c.

◆ CBIT

#define CBIT   (9)

Definition at line 55 of file lh5.c.

◆ CODEBIT

#define CODEBIT   (16)

Definition at line 56 of file lh5.c.

◆ DICBIT

#define DICBIT   (13)

Definition at line 46 of file lh5.c.

◆ DICSIZ

#define DICSIZ   (1<<DICBIT)

Definition at line 47 of file lh5.c.

◆ FREEMEM

#define FREEMEM (   p)    if(p) {TAP_MemFree(p); p = NULL;}

Definition at line 1245 of file lh5.c.

◆ MATCHBIT

#define MATCHBIT   (8)

Definition at line 49 of file lh5.c.

◆ MAXHASHVAL

#define MAXHASHVAL   (3*DICSIZ+((DICSIZ>>9)+1)*UCHARMAX)

Definition at line 65 of file lh5.c.

◆ MAXMATCH

#define MAXMATCH   (1<<MATCHBIT)

Definition at line 50 of file lh5.c.

◆ NC

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

Definition at line 54 of file lh5.c.

◆ NP

#define NP   (DICBIT+1)

Definition at line 58 of file lh5.c.

◆ NPT

#define NPT   NT

Definition at line 62 of file lh5.c.

◆ NT

#define NT   (CODEBIT+3)

Definition at line 59 of file lh5.c.

◆ NUL

#define NUL   (0)

Definition at line 64 of file lh5.c.

◆ PBIT

#define PBIT   4

Definition at line 60 of file lh5.c.

◆ PERCFLAG

#define PERCFLAG   (0x8000)

Definition at line 52 of file lh5.c.

◆ PERCOLATE

#define PERCOLATE

Definition at line 5 of file lh5.c.

◆ TBIT

#define TBIT   5

Definition at line 61 of file lh5.c.

◆ THRESHOLD

#define THRESHOLD   (3)

Definition at line 51 of file lh5.c.

◆ UCHARMAX

#define UCHARMAX   (255)

Definition at line 44 of file lh5.c.

◆ WINBIT

#define WINBIT   (14)

Definition at line 67 of file lh5.c.

◆ WINDOWSIZE

#define WINDOWSIZE   (1<<WINBIT)

Definition at line 68 of file lh5.c.

Typedef Documentation

◆ ARPByte

typedef byte* ARPByte

Definition at line 18 of file lh5.c.

◆ ARPWord

typedef short* ARPWord

Definition at line 17 of file lh5.c.

Function Documentation

◆ CompressBlock()

word CompressBlock ( byte *  inputbuffer,
word  inputsize,
byte *  outputbuffer 
)

Definition at line 1309 of file lh5.c.

References TRACEENTER, and TRACEEXIT.

Referenced by CompressTFD().

◆ UncompressBlock()

word UncompressBlock ( byte *  inputbuffer,
word  inputsize,
byte *  outputbuffer,
word  BufferSize 
)

Definition at line 1342 of file lh5.c.

References TRACEENTER, and TRACEEXIT.

Referenced by UncompressFirmware(), UncompressLoader(), and UncompressTFD().