![]() |
Paradox Game Engine
v1.0.0 beta06
|
Go to the source code of this file.
Classes | |
struct | _U16_S |
struct | _U32_S |
struct | _U64_S |
struct | LZ4HC_Data_Structure |
Macros | |
#define | LZ4_ARCH64 0 |
#define | restrict |
#define | forceinline inline |
#define | lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))) |
#define | ALLOCATOR(s) calloc(1,s) |
#define | FREEMEM free |
#define | MEM_INIT memset |
#define | BYTE uint8_t |
#define | U16 uint16_t |
#define | U32 uint32_t |
#define | S32 int32_t |
#define | U64 uint64_t |
#define | S64 int64_t |
#define | A64(x) (((U64_S *)(x))->v) |
#define | A32(x) (((U32_S *)(x))->v) |
#define | A16(x) (((U16_S *)(x))->v) |
#define | MINMATCH 4 |
#define | DICTIONARY_LOGSIZE 16 |
#define | MAXD (1<<DICTIONARY_LOGSIZE) |
#define | MAXD_MASK ((U32)(MAXD - 1)) |
#define | MAX_DISTANCE (MAXD - 1) |
#define | HASH_LOG (DICTIONARY_LOGSIZE-1) |
#define | HASHTABLESIZE (1 << HASH_LOG) |
#define | HASH_MASK (HASHTABLESIZE - 1) |
#define | MAX_NB_ATTEMPTS 256 |
#define | ML_BITS 4 |
#define | ML_MASK (size_t)((1U<<ML_BITS)-1) |
#define | RUN_BITS (8-ML_BITS) |
#define | RUN_MASK ((1U<<RUN_BITS)-1) |
#define | COPYLENGTH 8 |
#define | LASTLITERALS 5 |
#define | MFLIMIT (COPYLENGTH+MINMATCH) |
#define | MINLENGTH (MFLIMIT+1) |
#define | OPTIMAL_ML (int)((ML_MASK-1)+MINMATCH) |
#define | STEPSIZE 4 |
#define | LZ4_COPYSTEP(s, d) A32(d) = A32(s); d+=4; s+=4; |
#define | LZ4_COPYPACKET(s, d) LZ4_COPYSTEP(s,d); LZ4_COPYSTEP(s,d); |
#define | UARCH U32 |
#define | AARCH A32 |
#define | HTYPE const BYTE* |
#define | INITBASE(b, s) const int b = 0 |
#define | LZ4_READ_LITTLEENDIAN_16(d, s, p) { d = (s) - A16(p); } |
#define | LZ4_WRITE_LITTLEENDIAN_16(p, v) { A16(p) = v; p+=2; } |
#define | LZ4_WILDCOPY(s, d, e) do { LZ4_COPYPACKET(s,d) } while (d<e); |
#define | LZ4_BLINDCOPY(s, d, l) { BYTE* e=d+l; LZ4_WILDCOPY(s,d,e); d=e; } |
#define | HASH_FUNCTION(i) (((i) * 2654435761U) >> ((MINMATCH*8)-HASH_LOG)) |
#define | HASH_VALUE(p) HASH_FUNCTION(A32(p)) |
#define | HASH_POINTER(p) (HashTable[HASH_VALUE(p)] + base) |
#define | DELTANEXT(p) chainTable[(size_t)(p) & MAXD_MASK] |
#define | GETNEXT(p) ((p) - (size_t)DELTANEXT(p)) |
#define | REPEAT_OPTIMIZATION |
Typedefs | |
typedef struct _U16_S | U16_S |
typedef struct _U32_S | U32_S |
typedef struct _U64_S | U64_S |
Functions | |
static int | LZ4_NbCommonBytes (register U32 val) |
static int | LZ4HC_Init (LZ4HC_Data_Structure *hc4, const BYTE *base) |
static void * | LZ4HC_Create (const BYTE *base) |
static int | LZ4HC_Free (void **LZ4HC_Data) |
static forceinline void | LZ4HC_Insert (LZ4HC_Data_Structure *hc4, const BYTE *ip) |
static forceinline size_t | LZ4HC_CommonLength (const BYTE *p1, const BYTE *p2, const BYTE *const matchlimit) |
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) |
static forceinline int | LZ4_encodeSequence (const BYTE **ip, BYTE **op, const BYTE **anchor, int matchLength, const BYTE *ref, BYTE *oend) |
int | LZ4_compressHCCtx (LZ4HC_Data_Structure *ctx, const char *source, char *dest, int inputSize, int maxOutputSize) |
CORE_EXPORT (int) | |
#define A16 | ( | x | ) | (((U16_S *)(x))->v) |
Definition at line 167 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
#define A32 | ( | x | ) | (((U32_S *)(x))->v) |
Definition at line 166 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define AARCH A32 |
Definition at line 214 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
Definition at line 128 of file lz4hc.c.
Referenced by LZ4HC_Create().
#define BYTE uint8_t |
Definition at line 145 of file lz4hc.c.
Referenced by CORE_EXPORT(), LZ4_compressHCCtx(), LZ4_encodeSequence(), LZ4HC_CommonLength(), LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define DELTANEXT | ( | p | ) | chainTable[(size_t)(p) & MAXD_MASK] |
Definition at line 248 of file lz4hc.c.
Referenced by LZ4HC_Insert(), and LZ4HC_InsertAndFindBestMatch().
#define FREEMEM free |
Definition at line 129 of file lz4hc.c.
Referenced by LZ4HC_Free().
#define GETNEXT | ( | p | ) | ((p) - (size_t)DELTANEXT(p)) |
Definition at line 249 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 247 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define HASH_VALUE | ( | p | ) | HASH_FUNCTION(A32(p)) |
Definition at line 246 of file lz4hc.c.
Referenced by LZ4HC_Insert(), and LZ4HC_InsertAndFindBestMatch().
#define HTYPE const BYTE* |
Definition at line 215 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
Definition at line 216 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define LASTLITERALS 5 |
Definition at line 192 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
#define LZ4_ARCH64 0 |
Definition at line 45 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 244 of file lz4hc.c.
Referenced by LZ4_encodeSequence().
#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_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 224 of file lz4hc.c.
Referenced by LZ4_encodeSequence().
#define MAX_DISTANCE (MAXD - 1) |
Definition at line 178 of file lz4hc.c.
Referenced by LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define MAX_NB_ATTEMPTS 256 |
Definition at line 184 of file lz4hc.c.
Referenced by LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define MAXD (1<<DICTIONARY_LOGSIZE) |
#define MEM_INIT memset |
Definition at line 130 of file lz4hc.c.
Referenced by LZ4HC_Init().
#define MFLIMIT (COPYLENGTH+MINMATCH) |
Definition at line 193 of file lz4hc.c.
Referenced by LZ4_compressHCCtx().
#define MINMATCH 4 |
Definition at line 173 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), LZ4_encodeSequence(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define ML_BITS 4 |
Definition at line 186 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
#define ML_MASK (size_t)((1U<<ML_BITS)-1) |
Definition at line 187 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
Definition at line 195 of file lz4hc.c.
Referenced by LZ4_compressHCCtx().
#define REPEAT_OPTIMIZATION |
#define RUN_MASK ((1U<<RUN_BITS)-1) |
Definition at line 189 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_encodeSequence().
#define S32 int32_t |
Definition at line 148 of file lz4hc.c.
Referenced by LZ4_NbCommonBytes().
#define STEPSIZE 4 |
Definition at line 210 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
#define U16 uint16_t |
Definition at line 146 of file lz4hc.c.
Referenced by LZ4_encodeSequence(), LZ4HC_Insert(), LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
#define U32 uint32_t |
Definition at line 147 of file lz4hc.c.
Referenced by LZ4_compressHCCtx(), and LZ4_NbCommonBytes().
#define UARCH U32 |
Definition at line 213 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
CORE_EXPORT | ( | int | ) |
Definition at line 745 of file lz4hc.c.
References BYTE, LZ4_compressHCCtx(), LZ4HC_Create(), and LZ4HC_Free().
int LZ4_compressHCCtx | ( | LZ4HC_Data_Structure * | ctx, |
const char * | source, | ||
char * | dest, | ||
int | inputSize, | ||
int | maxOutputSize | ||
) |
Definition at line 557 of file lz4hc.c.
References BYTE, dest, inputSize, LASTLITERALS, LZ4_encodeSequence(), LZ4HC_InsertAndFindBestMatch(), LZ4HC_InsertAndGetWiderMatch(), matchlimit, maxOutputSize, MFLIMIT, MINMATCH, ML_BITS, ML_MASK, OPTIMAL_ML, RUN_MASK, and U32.
Referenced by CORE_EXPORT().
|
static |
Definition at line 521 of file lz4hc.c.
References BYTE, LASTLITERALS, LZ4_BLINDCOPY, LZ4_WRITE_LITTLEENDIAN_16, MINMATCH, ML_BITS, ML_MASK, RUN_MASK, and U16.
Referenced by LZ4_compressHCCtx().
|
static |
Definition at line 293 of file lz4hc.c.
Referenced by LZ4HC_CommonLength(), and LZ4HC_InsertAndGetWiderMatch().
|
static |
Definition at line 376 of file lz4hc.c.
References A16, A32, AARCH, BYTE, LZ4_ARCH64, LZ4_NbCommonBytes(), STEPSIZE, and UARCH.
Referenced by LZ4HC_InsertAndFindBestMatch(), and LZ4HC_InsertAndGetWiderMatch().
|
static |
Definition at line 340 of file lz4hc.c.
References ALLOCATOR, and LZ4HC_Init().
Referenced by CORE_EXPORT().
|
static |
|
static |
Definition at line 330 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 358 of file lz4hc.c.
References LZ4HC_Data_Structure::base, BYTE, 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 394 of file lz4hc.c.
References A32, LZ4HC_Data_Structure::base, BYTE, 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 462 of file lz4hc.c.
References A16, A32, AARCH, LZ4HC_Data_Structure::base, BYTE, 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().