#include <lzsscomprs.h>
Definition at line 33 of file lzsscomprs.h.
LZSSCompress::LZSSCompress |
( |
| ) |
|
LZSSCompress::~LZSSCompress |
( |
| ) |
|
|
virtual |
void LZSSCompress::decode |
( |
void |
| ) |
|
|
virtual |
Reimplemented from SWCompress.
Definition at line 611 of file lzsscomprs.cpp.
620 unsigned long totalLen = 0;
643 if (flag_count > 0) {
644 flags = (
unsigned char) (flags >> 1);
650 if (
getChars((
char *) &flags, 1) != 1)
676 r = (
short int) ( (r + 1) & (
N - 1) );
704 pos = (
short int) ( c[0] | ((c[1] & 0xf0) << 4) );
706 len = (
short int) ( (c[1] & 0x0f) +
THRESHOLD );
712 for (k = 0; k < len; k++) {
718 r = (
short int) ( (r + 1) & (
N - 1) );
723 if (
sendChars((
char *) c, len) != (
unsigned int)len) {
static unsigned char m_ring_buffer[N+F-1]
virtual unsigned long getChars(char *buf, unsigned long len)
virtual unsigned long sendChars(char *buf, unsigned long len)
void LZSSCompress::encode |
( |
void |
| ) |
|
|
virtual |
Reimplemented from SWCompress.
Definition at line 367 of file lzsscomprs.cpp.
372 unsigned short int len;
373 short int last_match_length;
374 short int code_buf_pos;
375 unsigned char code_buf[17];
409 r = (
short int)
N - (
short int)
F;
436 for (i = 1; i <=
F; i++) {
476 code_buf[code_buf_pos++] = (
unsigned char) (
484 mask = (
unsigned char) (mask << 1);
494 sendChars((
char *) code_buf, code_buf_pos);
507 for (i = 0; i < last_match_length; i++) {
551 s = (
short int) ( (s + 1) & (
N - 1) );
552 r = (
short int) ( (r + 1) & (
N - 1) );
564 while (i++ < last_match_length) {
567 s = (
short int) ( (s + 1) & (
N - 1) );
568 r = (
short int) ( (r + 1) & (
N - 1) );
590 if (code_buf_pos > 1) {
594 sendChars((
char *) code_buf, code_buf_pos);
void InsertNode(short int Pos)
void DeleteNode(short int Node)
static short int m_match_length
static unsigned char m_ring_buffer[N+F-1]
virtual unsigned long getChars(char *buf, unsigned long len)
static short int m_match_position
virtual unsigned long sendChars(char *buf, unsigned long len)
unsigned long SWCompress::getChars |
( |
char * |
buf, |
|
|
unsigned long |
len |
|
) |
| |
|
virtualinherited |
char * SWCompress::getCompressedBuf |
( |
unsigned long * |
len = 0 | ) |
|
|
virtualinherited |
Definition at line 111 of file swcomprs.cpp.
116 if (len) *len =
zlen;
virtual void encode(void)
virtual int SWCompress::getLevel |
( |
| ) |
|
|
inlinevirtualinherited |
char * SWCompress::getUncompressedBuf |
( |
unsigned long * |
len = 0 | ) |
|
|
virtualinherited |
Definition at line 90 of file swcomprs.cpp.
92 buf = (
char *)calloc(1,1);
virtual void decode(void)
unsigned long SWCompress::sendChars |
( |
char * |
buf, |
|
|
unsigned long |
len |
|
) |
| |
|
virtualinherited |
Definition at line 141 of file swcomprs.cpp.
145 if ((
pos + len) > (
unsigned)
slen) {
147 memset(&
buf[
pos], 0, len + 1024);
150 else buf = (
char *)calloc(1, len + 1024);
151 memmove(&
buf[
pos], ibuf, len);
162 zbuf = (
char *)calloc(1, len + 1024);
void SWCompress::setCompressedBuf |
( |
unsigned long * |
len, |
|
|
char * |
buf = 0 |
|
) |
| |
|
virtualinherited |
virtual void SWCompress::setLevel |
( |
int |
l | ) |
|
|
inlinevirtualinherited |
void SWCompress::setUncompressedBuf |
( |
const char * |
buf = 0 , |
|
|
unsigned long * |
len = 0 |
|
) |
| |
|
virtualinherited |
Definition at line 75 of file swcomprs.cpp.
78 slen = (len) ? *len : strlen(ibuf);
79 buf = (
char *) calloc(
slen + 1, 1);
83 buf = (
char *)calloc(1,1);
virtual void decode(void)
|
mutableprotectedinherited |
|
mutableprotectedinherited |
unsigned long SWCompress::pos |
|
protectedinherited |
unsigned long SWCompress::slen |
|
protectedinherited |
|
mutableprotectedinherited |
unsigned long SWCompress::zlen |
|
protectedinherited |
unsigned long SWCompress::zpos |
|
protectedinherited |
The documentation for this class was generated from the following files: