|
Turnstone Operating System
|
LZ77 compression algorithm implementation with simple encoding. More...
Classes | |
| struct | zpack_match_t |
| match structure More... | |
| struct | zpack_hashtable_t |
| hashtable structure More... | |
Macros | |
| #define | ZPACK_MAX_MATCH (0x3f + 0x40 + 4) |
| #define | ZPACK_MIN_MATCH (4) |
| #define | ZPACK_WINDOW_SIZE 16383 |
| #define | ZPACK_HASHTABLE_SIZE 15 |
| #define | ZPACK_HASHTABLE_MUL 2654435761U |
| #define | ZPACK_HASHTABLE_PREV_SIZE 16384 |
| #define | ZPACK_NO_POS (-1) |
Typedefs | |
| typedef struct zpack_match_t | zpack_match_t |
| match structure | |
| typedef struct zpack_hashtable_t | zpack_hashtable_t |
| hashtable structure | |
Functions | |
| MODULE ("turnstone.lib") | |
| static uint32_t | zpack_hash4 (uint32_t data) |
| hash function | |
| static void | zpack_hash_insert (int64_t pos, uint32_t h, zpack_hashtable_t *ht) |
| insert position to hashtable | |
| static zpack_match_t | zpack_find_bestmatch (buffer_t *in, int64_t in_len, int64_t in_p, zpack_hashtable_t *ht) |
| find best match | |
| int8_t | zpack_pack (buffer_t *in, buffer_t *out) |
| packs data at input buffer to output buffer with z77 algorithm | |
| int8_t | zpack_unpack (buffer_t *in, buffer_t *out) |
| unpacks data at input buffer to output buffer with z77 algorithm | |
LZ77 compression algorithm implementation with simple encoding.
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
| #define ZPACK_HASHTABLE_MUL 2654435761U |
hash4 multiplier
| #define ZPACK_HASHTABLE_PREV_SIZE 16384 |
hashtable previous size, backward item count
| #define ZPACK_HASHTABLE_SIZE 15 |
hashtable size 2^15
| #define ZPACK_MAX_MATCH (0x3f + 0x40 + 4) |
maximum match length
| #define ZPACK_MIN_MATCH (4) |
minimum match length
| #define ZPACK_NO_POS (-1) |
no position
| #define ZPACK_WINDOW_SIZE 16383 |
window size
| MODULE | ( | "turnstone.lib" | ) |
module name
|
static |
find best match
| [in] | in | input buffer |
| [in] | in_len | input buffer length |
| [in] | in_p | input buffer position |
| [in] | ht | hashtable |
hash function
| [in] | data | data to hash |
|
inlinestatic |
insert position to hashtable
| [in] | pos | position |
| [in] | h | hash value |
| [in] | ht | hashtable |
packs data at input buffer to output buffer with z77 algorithm
| [in] | in | input buffer |
| [in] | out | output buffer |