|
HOPS
HOPS class reference
|
Macros | |
| #define | ALIGNMENT_FUDGE (U(16)) |
| #define | ANY_HASH_INDEX (0) |
| #define | COMPRESS_ACTION_COMPRESS 1 |
| #define | COMPRESS_ACTION_DECOMPRESS 2 |
| #define | COMPRESS_ACTION_IDENTITY 0 |
| #define | DEPTH_MASK (HASH_TABLE_DEPTH-1) |
| #define | FLAG_BYTES 4 |
| #define | FLAG_COMPRESS 0 /* Signals that output was result of compression. */ |
| #define | FLAG_COPY 1 /* Signals that output was simply copied over. */ |
| #define | HASH(PTR) |
| #define | HASH_MASK (PARTITION_LENGTH-1) |
| #define | HASH_TABLE_DEPTH (1<<HASH_TABLE_DEPTH_BITS ) |
| #define | HASH_TABLE_DEPTH_BITS (3) /* Must be in range [0,12]. */ |
| #define | HASH_TABLE_LENGTH (4096) |
| #define | MAX_CMP_GROUP (2+16*2) |
| #define | MAX_RAW_GROUP (16*MAX_RAW_ITEM) |
| #define | MAX_RAW_ITEM (18) |
| #define | MEM_REQ ( U(4096)*(SIZE_P_BYTE) + ALIGNMENT_FUDGE ) |
| #define | PARTITION_LENGTH (1<<PARTITION_LENGTH_BITS) |
| #define | PARTITION_LENGTH_BITS (12-HASH_TABLE_DEPTH_BITS) |
| #define | PS *p++!=*s++ |
| #define | SIZE_P_BYTE (U(sizeof(U8 *))) |
| #define | START_STRING_18 ((U8 *) "123456789012345678") |
| #define | TOPWORD 0xFFFF0000 |
| #define | U(X) ((U32) X) |
| #define | U32_ALIGN_UP(X) (X) |
| #define | UCARD unsigned |
| #define | UPDATE_I(I_BASE, NEWPTR) {hash[(I_BASE)+cycle++]=(NEWPTR); cycle&=DEPTH_MASK;} |
| #define | UPDATE_P(P_BASE, NEWPTR) {(P_BASE)[cycle++]=(NEWPTR); cycle&=DEPTH_MASK;} |
| #define | ZH *p_h++=START_STRING_18 |
| #define | ZJ *p_h++=START_STRING_18 |
Functions | |
| void | compress (U16 action, U8 *wrk_mem, U8 *src_adr, U32 src_len, U8 *dst_adr, U32 *p_dst_len) |
| void | compress_compress (U8 *, U8 *, U32, U8 *, U32 *) |
| void | compress_decompress (U8 *, U8 *, U32, U8 *, U32 *) |
| #define ALIGNMENT_FUDGE (U(16)) |
| #define ANY_HASH_INDEX (0) |
| #define COMPRESS_ACTION_COMPRESS 1 |
| #define COMPRESS_ACTION_DECOMPRESS 2 |
| #define COMPRESS_ACTION_IDENTITY 0 |
| #define DEPTH_MASK (HASH_TABLE_DEPTH-1) |
| #define FLAG_BYTES 4 |
| #define FLAG_COMPRESS 0 /* Signals that output was result of compression. */ |
| #define FLAG_COPY 1 /* Signals that output was simply copied over. */ |
| #define HASH | ( | PTR | ) |
| #define HASH_MASK (PARTITION_LENGTH-1) |
| #define HASH_TABLE_DEPTH (1<<HASH_TABLE_DEPTH_BITS ) |
| #define HASH_TABLE_DEPTH_BITS (3) /* Must be in range [0,12]. */ |
| #define HASH_TABLE_LENGTH (4096) |
| #define MAX_CMP_GROUP (2+16*2) |
| #define MAX_RAW_GROUP (16*MAX_RAW_ITEM) |
| #define MAX_RAW_ITEM (18) |
| #define MEM_REQ ( U(4096)*(SIZE_P_BYTE) + ALIGNMENT_FUDGE ) |
| #define PARTITION_LENGTH (1<<PARTITION_LENGTH_BITS) |
| #define PARTITION_LENGTH_BITS (12-HASH_TABLE_DEPTH_BITS) |
| #define PS *p++!=*s++ |
| #define START_STRING_18 ((U8 *) "123456789012345678") |
| #define TOPWORD 0xFFFF0000 |
| #define U | ( | X | ) | ((U32) X) |
| #define U32_ALIGN_UP | ( | X | ) | (X) |
| #define UCARD unsigned |
| #define UPDATE_I | ( | I_BASE, | |
| NEWPTR | |||
| ) | {hash[(I_BASE)+cycle++]=(NEWPTR); cycle&=DEPTH_MASK;} |
| #define UPDATE_P | ( | P_BASE, | |
| NEWPTR | |||
| ) | {(P_BASE)[cycle++]=(NEWPTR); cycle&=DEPTH_MASK;} |
| #define ZH *p_h++=START_STRING_18 |
| #define ZJ *p_h++=START_STRING_18 |
| void compress | ( | U16 | action, |
| U8 * | wrk_mem, | ||
| U8 * | src_adr, | ||
| U32 | src_len, | ||
| U8 * | dst_adr, | ||
| U32 * | p_dst_len | ||
| ) |
| void compress_compress | ( | U8 * | p_wrk_mem, |
| U8 * | p_src_first, | ||
| U32 | src_len, | ||
| U8 * | p_dst_first, | ||
| U32 * | p_dst_len | ||
| ) |