CMSIS2000
0.0.7
|
Go to the source code of this file.
Data Structures | |
struct | _U16_S |
struct | _U32_S |
struct | _U64_S |
struct | LZ4HC_Data_Structure |
Macros | |
#define | A16(x) (((U16_S *)(x))->v) |
#define | A32(x) (((U32_S *)(x))->v) |
#define | A64(x) (((U64_S *)(x))->v) |
#define | AARCH A32 |
#define | ALLOCATOR(s) calloc(1,s) |
#define | BYTE uint8_t |
#define | COPYLENGTH 8 |
#define | DELTANEXT(p) chainTable[(size_t)(p) & MAXD_MASK] |
#define | DICTIONARY_LOGSIZE 16 |
#define | forceinline inline |
#define | FREEMEM free |
#define | GETNEXT(p) ((p) - (size_t)DELTANEXT(p)) |
#define | HASH_FUNCTION(i) (((i) * 2654435761U) >> ((MINMATCH*8)-HASH_LOG)) |
#define | HASH_LOG (DICTIONARY_LOGSIZE-1) |
#define | HASH_MASK (HASHTABLESIZE - 1) |
#define | HASH_POINTER(p) (HashTable[HASH_VALUE(p)] + base) |
#define | HASH_VALUE(p) HASH_FUNCTION(A32(p)) |
#define | HASHTABLESIZE (1 << HASH_LOG) |
#define | HTYPE const BYTE* |
#define | INITBASE(b, s) const int b = 0 |
#define | LASTLITERALS 5 |
#define | LZ4_ARCH64 0 |
#define | LZ4_BLINDCOPY(s, d, l) { BYTE* e=d+l; LZ4_WILDCOPY(s,d,e); d=e; } |
#define | lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) |
#define | LZ4_COPYPACKET(s, d) LZ4_COPYSTEP(s,d); LZ4_COPYSTEP(s,d); |
#define | LZ4_COPYSTEP(s, d) A32(d) = A32(s); d+=4; s+=4; |
#define | LZ4_READ_LITTLEENDIAN_16(d, s, p) { d = (s) - A16(p); } |
#define | LZ4_WILDCOPY(s, d, e) do { LZ4_COPYPACKET(s,d) } while (d<e); |
#define | LZ4_WRITE_LITTLEENDIAN_16(p, v) { A16(p) = v; p+=2; } |
#define | MAX_DISTANCE (MAXD - 1) |
#define | MAX_NB_ATTEMPTS 256 |
#define | MAXD (1<<DICTIONARY_LOGSIZE) |
#define | MAXD_MASK ((U32)(MAXD - 1)) |
#define | MEM_INIT memset |
#define | MFLIMIT (COPYLENGTH+MINMATCH) |
#define | MINLENGTH (MFLIMIT+1) |
#define | MINMATCH 4 |
#define | ML_BITS 4 |
#define | ML_MASK (size_t)((1U<<ML_BITS)-1) |
#define | OPTIMAL_ML (int)((ML_MASK-1)+MINMATCH) |
#define | REPEAT_OPTIMIZATION |
#define | restrict |
#define | RUN_BITS (8-ML_BITS) |
#define | RUN_MASK ((1U<<RUN_BITS)-1) |
#define | S32 int32_t |
#define | STEPSIZE 4 |
#define | U16 uint16_t |
#define | U32 uint32_t |
#define | U64 uint64_t |
#define | UARCH U32 |
Typedefs | |
typedef struct _U16_S | U16_S |
typedef struct _U32_S | U32_S |
typedef struct _U64_S | U64_S |
Functions | |
int | LZ4_compressHC (const char *source, char *dest, int isize) |
int | LZ4_compressHCCtx (LZ4HC_Data_Structure *ctx, const char *source, char *dest, int isize) |
static forceinline int | LZ4_encodeSequence (const BYTE **ip, BYTE **op, const BYTE **anchor, int ml, const BYTE *ref) |
static int | LZ4_NbCommonBytes (register U32 val) |
static forceinline size_t | LZ4HC_CommonLength (const BYTE *p1, const BYTE *p2, const BYTE *const matchlimit) |
static void * | LZ4HC_Create (const BYTE *base) |
static int | LZ4HC_Free (void **LZ4HC_Data) |
static int | LZ4HC_Init (LZ4HC_Data_Structure *hc4, const BYTE *base) |
static forceinline void | LZ4HC_Insert (LZ4HC_Data_Structure *hc4, const BYTE *ip) |
static forceinline int | LZ4HC_InsertAndFindBestMatch (LZ4HC_Data_Structure *hc4, const BYTE *ip, const BYTE *const matchlimit, const BYTE **matchpos) |
static forceinline int | LZ4HC_InsertAndGetWiderMatch (LZ4HC_Data_Structure *hc4, const BYTE *ip, const BYTE *startLimit, const BYTE *matchlimit, int longest, const BYTE **matchpos, const BYTE **startpos) |
Definition at line 155 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
Definition at line 154 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define AARCH A32 |
Definition at line 202 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
#define ALLOCATOR | ( | s | ) | calloc(1,s) |
Definition at line 118 of file lz4hc.c.
Referenced by LZ4HC_Create().
#define DELTANEXT | ( | p | ) | chainTable[(size_t)(p) & MAXD_MASK] |
Definition at line 236 of file lz4hc.c.
Referenced by LZ4HC_Insert(), and LZ4HC_InsertAndFindBestMatch().
#define FREEMEM free |
Definition at line 119 of file lz4hc.c.
Referenced by LZ4HC_Free().
#define GETNEXT | ( | p | ) | ((p) - (size_t)DELTANEXT(p)) |
Definition at line 237 of file lz4hc.c.
Referenced by LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define HASH_FUNCTION | ( | i | ) | (((i) * 2654435761U) >> ((MINMATCH*8)-HASH_LOG)) |
#define HASH_LOG (DICTIONARY_LOGSIZE-1) |
#define HASH_MASK (HASHTABLESIZE - 1) |
#define HASH_POINTER | ( | p | ) | (HashTable[HASH_VALUE(p)] + base) |
Definition at line 235 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define HASH_VALUE | ( | p | ) | HASH_FUNCTION(A32(p)) |
Definition at line 234 of file lz4hc.c.
Referenced by LZ4HC_Insert(), and LZ4HC_InsertAndFindBestMatch().
#define HTYPE const BYTE* |
Definition at line 203 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define INITBASE | ( | b, | |
s | |||
) | const int b = 0 |
Definition at line 204 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define LASTLITERALS 5 |
Definition at line 180 of file lz4hc.c.
Referenced by LZ4_compressHCCtx().
#define LZ4_ARCH64 0 |
Definition at line 42 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), LZ4HC_Init(), and LZ4HC_InsertAndGetWiderMatch().
#define LZ4_BLINDCOPY | ( | s, | |
d, | |||
l | |||
) | { BYTE* e=d+l; LZ4_WILDCOPY(s,d,e); d=e; } |
Definition at line 232 of file lz4hc.c.
Referenced by LZ4_encodeSequence().
#define LZ4_COPYPACKET | ( | s, | |
d | |||
) | LZ4_COPYSTEP(s,d); LZ4_COPYSTEP(s,d); |
#define LZ4_READ_LITTLEENDIAN_16 | ( | d, | |
s, | |||
p | |||
) | { d = (s) - A16(p); } |
#define LZ4_WILDCOPY | ( | s, | |
d, | |||
e | |||
) | do { LZ4_COPYPACKET(s,d) } while (d<e); |
#define LZ4_WRITE_LITTLEENDIAN_16 | ( | p, | |
v | |||
) | { A16(p) = v; p+=2; } |
Definition at line 212 of file lz4hc.c.
Referenced by LZ4_encodeSequence().
#define MAX_DISTANCE (MAXD - 1) |
Definition at line 166 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define MAX_NB_ATTEMPTS 256 |
Definition at line 172 of file lz4hc.c.
Referenced by LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define MAXD (1<<DICTIONARY_LOGSIZE) |
#define MEM_INIT memset |
Definition at line 120 of file lz4hc.c.
Referenced by LZ4HC_Init().
#define MFLIMIT (COPYLENGTH+MINMATCH) |
Definition at line 181 of file lz4hc.c.
Referenced by LZ4_compressHCCtx().
#define MINMATCH 4 |
Definition at line 161 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), LZ4_encodeSequence(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define ML_BITS 4 |
Definition at line 174 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
#define ML_MASK (size_t)((1U<<ML_BITS)-1) |
Definition at line 175 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
Definition at line 183 of file lz4hc.c.
Referenced by LZ4_compressHCCtx().
#define REPEAT_OPTIMIZATION |
#define RUN_MASK ((1U<<RUN_BITS)-1) |
Definition at line 177 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
#define S32 int32_t |
Definition at line 137 of file lz4hc.c.
Referenced by LZ4_NbCommonBytes().
#define STEPSIZE 4 |
Definition at line 198 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
#define U16 uint16_t |
Definition at line 135 of file lz4hc.c.
Referenced by LZ4_encodeSequence(), LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define U32 uint32_t |
Definition at line 136 of file lz4hc.c.
Referenced by LZ4_NbCommonBytes().
#define UARCH U32 |
Definition at line 201 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
int LZ4_compressHC | ( | const char * | source, |
char * | dest, | ||
int | isize | ||
) |
Definition at line 719 of file lz4hc.c.
References LZ4_compressHCCtx(), LZ4HC_Create(), and LZ4HC_Free().
Referenced by compress_file().
int LZ4_compressHCCtx | ( | LZ4HC_Data_Structure * | ctx, |
const char * | source, | ||
char * | dest, | ||
int | isize | ||
) |
Definition at line 534 of file lz4hc.c.
References BYTE, LASTLITERALS, LZ4_encodeSequence(), LZ4HC_InsertAndFindBestMatch(), LZ4HC_InsertAndGetWiderMatch(), matchlimit, MFLIMIT, MINMATCH, ML_BITS, ML_MASK, NULL, OPTIMAL_ML, and RUN_MASK.
Referenced by LZ4_compressHC().
|
static |
Definition at line 500 of file lz4hc.c.
References BYTE, LZ4_BLINDCOPY, LZ4_WRITE_LITTLEENDIAN_16, MINMATCH, ML_BITS, ML_MASK, RUN_MASK, and U16.
Referenced by LZ4_compressHCCtx().
Definition at line 277 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
|
static |
Definition at line 355 of file lz4hc.c.
References A16, A32, AARCH, LZ4_ARCH64, LZ4_NbCommonBytes(), STEPSIZE, and UARCH.
Referenced by LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
|
inlinestatic |
Definition at line 319 of file lz4hc.c.
References ALLOCATOR, and LZ4HC_Init().
Referenced by LZ4_compressHC().
|
inlinestatic |
Definition at line 328 of file lz4hc.c.
Referenced by LZ4_compressHC().
|
inlinestatic |
Definition at line 309 of file lz4hc.c.
References LZ4HC_Data_Structure::base, LZ4HC_Data_Structure::chainTable, LZ4HC_Data_Structure::hashTable, LZ4_ARCH64, MEM_INIT, and LZ4HC_Data_Structure::nextToUpdate.
Referenced by LZ4HC_Create().
|
static |
Definition at line 337 of file lz4hc.c.
References LZ4HC_Data_Structure::base, LZ4HC_Data_Structure::chainTable, DELTANEXT, HASH_POINTER, HASH_VALUE, LZ4HC_Data_Structure::hashTable, HTYPE, INITBASE, MAX_DISTANCE, LZ4HC_Data_Structure::nextToUpdate, and U16.
Referenced by LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
|
static |
Definition at line 373 of file lz4hc.c.
References A32, LZ4HC_Data_Structure::base, LZ4HC_Data_Structure::chainTable, DELTANEXT, GETNEXT, HASH_POINTER, HASH_VALUE, LZ4HC_Data_Structure::hashTable, HTYPE, INITBASE, LZ4HC_CommonLength(), LZ4HC_Insert(), MAX_DISTANCE, MAX_NB_ATTEMPTS, MINMATCH, LZ4HC_Data_Structure::nextToUpdate, and U16.
Referenced by LZ4_compressHCCtx().
|
static |
Definition at line 441 of file lz4hc.c.
References A16, A32, AARCH, LZ4HC_Data_Structure::base, LZ4HC_Data_Structure::chainTable, GETNEXT, HASH_POINTER, LZ4HC_Data_Structure::hashTable, HTYPE, INITBASE, LZ4_ARCH64, LZ4_NbCommonBytes(), LZ4HC_CommonLength(), LZ4HC_Insert(), MAX_DISTANCE, MAX_NB_ATTEMPTS, MINMATCH, STEPSIZE, U16, and UARCH.
Referenced by LZ4_compressHCCtx().