Go to the source code of this file.
Classes | |
struct | LZ4HC_match_t |
struct | LZ4HC_optimal_t |
Macros | |
#define | anchor (*_anchor) |
#define | DELTANEXTMAXD(p) chainTable[(p) & LZ4HC_MAXD_MASK] /* flexible, LZ4HC_MAXD dependent */ |
#define | DELTANEXTU16(table, pos) table[(U16)(pos)] /* faster */ |
#define | HASH_FUNCTION(i) (((i) * 2654435761U) >> ((MINMATCH*8)-LZ4HC_HASH_LOG)) |
#define | ip (*_ip) |
#define | LZ4_COMMONDEFS_ONLY |
#define | LZ4_HC_STATIC_LINKING_ONLY |
#define | LZ4_OPT_NUM (1<<12) |
#define | LZ4HC_HEAPMODE 1 |
#define | LZ4HC_rotl32(x, r) ((x << r) | (x >> (32 - r))) |
#define | MAX(a, b) ( (a) > (b) ? (a) : (b) ) |
#define | MIN(a, b) ( (a) < (b) ? (a) : (b) ) |
#define | op (*_op) |
#define | OPTIMAL_ML (int)((ML_MASK-1)+MINMATCH) |
#define | TRAILING_LITERALS 3 |
#define | UPDATABLE(ip, op, anchor) &ip, &op, &anchor |
Enumerations | |
enum | dictCtx_directive { noDictCtx, usingDictCtxHc } |
enum | HCfavor_e { favorCompressionRatio =0, favorDecompressionSpeed } |
enum | repeat_state_e { rep_untested, rep_not, rep_confirmed } |
Functions | |
void | LZ4_attach_HC_dictionary (LZ4_streamHC_t *working_stream, const LZ4_streamHC_t *dictionary_stream) |
int | LZ4_compress_HC (const char *src, char *dst, int srcSize, int dstCapacity, int compressionLevel) |
int | LZ4_compress_HC_continue (LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int srcSize, int dstCapacity) |
int | LZ4_compress_HC_continue_destSize (LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int *srcSizePtr, int targetDestSize) |
int | LZ4_compress_HC_destSize (void *state, const char *source, char *dest, int *sourceSizePtr, int targetDestSize, int cLevel) |
int | LZ4_compress_HC_extStateHC (void *state, const char *src, char *dst, int srcSize, int dstCapacity, int compressionLevel) |
int | LZ4_compress_HC_extStateHC_fastReset (void *state, const char *src, char *dst, int srcSize, int dstCapacity, int compressionLevel) |
int | LZ4_compressHC (const char *src, char *dst, int srcSize) |
int | LZ4_compressHC2 (const char *src, char *dst, int srcSize, int cLevel) |
int | LZ4_compressHC2_continue (void *LZ4HC_Data, const char *src, char *dst, int srcSize, int cLevel) |
int | LZ4_compressHC2_limitedOutput (const char *src, char *dst, int srcSize, int maxDstSize, int cLevel) |
int | LZ4_compressHC2_limitedOutput_continue (void *LZ4HC_Data, const char *src, char *dst, int srcSize, int dstCapacity, int cLevel) |
int | LZ4_compressHC2_limitedOutput_withStateHC (void *state, const char *src, char *dst, int srcSize, int maxDstSize, int cLevel) |
int | LZ4_compressHC2_withStateHC (void *state, const char *src, char *dst, int srcSize, int cLevel) |
int | LZ4_compressHC_continue (LZ4_streamHC_t *ctx, const char *src, char *dst, int srcSize) |
static int | LZ4_compressHC_continue_generic (LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int *srcSizePtr, int dstCapacity, limitedOutput_directive limit) |
int | LZ4_compressHC_limitedOutput (const char *src, char *dst, int srcSize, int maxDstSize) |
int | LZ4_compressHC_limitedOutput_continue (LZ4_streamHC_t *ctx, const char *src, char *dst, int srcSize, int maxDstSize) |
int | LZ4_compressHC_limitedOutput_withStateHC (void *state, const char *src, char *dst, int srcSize, int maxDstSize) |
int | LZ4_compressHC_withStateHC (void *state, const char *src, char *dst, int srcSize) |
void * | LZ4_createHC (const char *inputBuffer) |
LZ4_streamHC_t * | LZ4_createStreamHC (void) |
void | LZ4_favorDecompressionSpeed (LZ4_streamHC_t *LZ4_streamHCPtr, int favor) |
int | LZ4_freeHC (void *LZ4HC_Data) |
int | LZ4_freeStreamHC (LZ4_streamHC_t *LZ4_streamHCPtr) |
LZ4_streamHC_t * | LZ4_initStreamHC (void *buffer, size_t size) |
int | LZ4_loadDictHC (LZ4_streamHC_t *LZ4_streamHCPtr, const char *dictionary, int dictSize) |
void | LZ4_resetStreamHC (LZ4_streamHC_t *LZ4_streamHCPtr, int compressionLevel) |
void | LZ4_resetStreamHC_fast (LZ4_streamHC_t *LZ4_streamHCPtr, int compressionLevel) |
int | LZ4_resetStreamStateHC (void *state, char *inputBuffer) |
int | LZ4_saveDictHC (LZ4_streamHC_t *LZ4_streamHCPtr, char *safeBuffer, int dictSize) |
void | LZ4_setCompressionLevel (LZ4_streamHC_t *LZ4_streamHCPtr, int compressionLevel) |
int | LZ4_sizeofStateHC (void) |
int | LZ4_sizeofStreamStateHC (void) |
char * | LZ4_slideInputBufferHC (void *LZ4HC_Data) |
static size_t | LZ4_streamHC_t_alignment (void) |
static void | LZ4HC_clearTables (LZ4HC_CCtx_internal *hc4) |
static int | LZ4HC_compress_generic (LZ4HC_CCtx_internal *const ctx, const char *const src, char *const dst, int *const srcSizePtr, int const dstCapacity, int cLevel, limitedOutput_directive limit) |
static int | LZ4HC_compress_generic_dictCtx (LZ4HC_CCtx_internal *const ctx, const char *const src, char *const dst, int *const srcSizePtr, int const dstCapacity, int cLevel, limitedOutput_directive limit) |
LZ4_FORCE_INLINE int | LZ4HC_compress_generic_internal (LZ4HC_CCtx_internal *const ctx, const char *const src, char *const dst, int *const srcSizePtr, int const dstCapacity, int cLevel, const limitedOutput_directive limit, const dictCtx_directive dict) |
static int | LZ4HC_compress_generic_noDictCtx (LZ4HC_CCtx_internal *const ctx, const char *const src, char *const dst, int *const srcSizePtr, int const dstCapacity, int cLevel, limitedOutput_directive limit) |
LZ4_FORCE_INLINE int | LZ4HC_compress_hashChain (LZ4HC_CCtx_internal *const ctx, const char *const source, char *const dest, int *srcSizePtr, int const maxOutputSize, int maxNbAttempts, const limitedOutput_directive limit, const dictCtx_directive dict) |
static int | LZ4HC_compress_optimal (LZ4HC_CCtx_internal *ctx, const char *const source, char *dst, int *srcSizePtr, int dstCapacity, int const nbSearches, size_t sufficient_len, const limitedOutput_directive limit, int const fullUpdate, const dictCtx_directive dict, const HCfavor_e favorDecSpeed) |
LZ4_FORCE_INLINE int | LZ4HC_countBack (const BYTE *const ip, const BYTE *const match, const BYTE *const iMin, const BYTE *const mMin) |
static unsigned | LZ4HC_countPattern (const BYTE *ip, const BYTE *const iEnd, U32 const pattern32) |
LZ4_FORCE_INLINE int | LZ4HC_encodeSequence (const BYTE **_ip, BYTE **_op, const BYTE **_anchor, int matchLength, const BYTE *const match, limitedOutput_directive limit, BYTE *oend) |
LZ4_FORCE_INLINE LZ4HC_match_t | LZ4HC_FindLongerMatch (LZ4HC_CCtx_internal *const ctx, const BYTE *ip, const BYTE *const iHighLimit, int minLen, int nbSearches, const dictCtx_directive dict, const HCfavor_e favorDecSpeed) |
static U32 | LZ4HC_hashPtr (const void *ptr) |
static void | LZ4HC_init_internal (LZ4HC_CCtx_internal *hc4, const BYTE *start) |
LZ4_FORCE_INLINE void | LZ4HC_Insert (LZ4HC_CCtx_internal *hc4, const BYTE *ip) |
LZ4_FORCE_INLINE int | LZ4HC_InsertAndFindBestMatch (LZ4HC_CCtx_internal *const hc4, const BYTE *const ip, const BYTE *const iLimit, const BYTE **matchpos, const int maxNbAttempts, const int patternAnalysis, const dictCtx_directive dict) |
LZ4_FORCE_INLINE int | LZ4HC_InsertAndGetWiderMatch (LZ4HC_CCtx_internal *const hc4, const BYTE *const ip, const BYTE *const iLowLimit, const BYTE *const iHighLimit, int longest, const BYTE **matchpos, const BYTE **startpos, const int maxNbAttempts, const int patternAnalysis, const int chainSwap, const dictCtx_directive dict, const HCfavor_e favorDecSpeed) |
LZ4_FORCE_INLINE int | LZ4HC_literalsPrice (int const litlen) |
static int | LZ4HC_protectDictEnd (U32 const dictLimit, U32 const matchIndex) |
static unsigned | LZ4HC_reverseCountPattern (const BYTE *ip, const BYTE *const iLow, U32 pattern) |
static U32 | LZ4HC_rotatePattern (size_t const rotate, U32 const pattern) |
LZ4_FORCE_INLINE int | LZ4HC_sequencePrice (int litlen, int mlen) |
static void | LZ4HC_setExternalDict (LZ4HC_CCtx_internal *ctxPtr, const BYTE *newBlock) |
#define anchor (*_anchor) |
#define DELTANEXTMAXD | ( | p | ) | chainTable[(p) & LZ4HC_MAXD_MASK] /* flexible, LZ4HC_MAXD dependent */ |
#define DELTANEXTU16 | ( | table, | |
pos | |||
) | table[(U16)(pos)] /* faster */ |
#define HASH_FUNCTION | ( | i | ) | (((i) * 2654435761U) >> ((MINMATCH*8)-LZ4HC_HASH_LOG)) |
#define ip (*_ip) |
#define LZ4HC_HEAPMODE 1 |
#define op (*_op) |
#define TRAILING_LITERALS 3 |
enum dictCtx_directive |
enum HCfavor_e |
enum repeat_state_e |
void LZ4_attach_HC_dictionary | ( | LZ4_streamHC_t * | working_stream, |
const LZ4_streamHC_t * | dictionary_stream | ||
) |
int LZ4_compress_HC | ( | const char * | src, |
char * | dst, | ||
int | srcSize, | ||
int | dstCapacity, | ||
int | compressionLevel | ||
) |
LZ4_compress_HC() : Compress data from src
into dst
, using the powerful but slower "HC" algorithm. dst
must be already allocated. Compression is guaranteed to succeed if dstCapacity >= LZ4_compressBound(srcSize)
(see "lz4.h") Max supported srcSize
value is LZ4_MAX_INPUT_SIZE (see "lz4.h") compressionLevel
: any value between 1 and LZ4HC_CLEVEL_MAX will work. Values > LZ4HC_CLEVEL_MAX behave the same as LZ4HC_CLEVEL_MAX.
int LZ4_compress_HC_continue | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | dstCapacity | ||
) |
int LZ4_compress_HC_continue_destSize | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
const char * | src, | ||
char * | dst, | ||
int * | srcSizePtr, | ||
int | targetDstSize | ||
) |
LZ4_compress_HC_continue_destSize() : v1.9.0+ Similar to LZ4_compress_HC_continue(), but will read as much data as possible from src
to fit into targetDstSize
budget. Result is provided into 2 parts :
srcSizePtr
: on success, *srcSizePtr will be updated to indicate how much bytes were read from src
. Note that this function may not consume the entire input. int LZ4_compress_HC_destSize | ( | void * | stateHC, |
const char * | src, | ||
char * | dst, | ||
int * | srcSizePtr, | ||
int | targetDstSize, | ||
int | compressionLevel | ||
) |
LZ4_compress_HC_destSize() : v1.9.0+ Will compress as much data as possible from src
to fit into targetDstSize
budget. Result is provided in 2 parts :
srcSizePtr
: on success, *srcSizePtr is updated to indicate how much bytes were read from src
int LZ4_compress_HC_extStateHC | ( | void * | state, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | dstCapacity, | ||
int | compressionLevel | ||
) |
int LZ4_compress_HC_extStateHC_fastReset | ( | void * | state, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | dstCapacity, | ||
int | compressionLevel | ||
) |
int LZ4_compressHC | ( | const char * | src, |
char * | dst, | ||
int | srcSize | ||
) |
int LZ4_compressHC2 | ( | const char * | src, |
char * | dst, | ||
int | srcSize, | ||
int | cLevel | ||
) |
int LZ4_compressHC2_continue | ( | void * | LZ4HC_Data, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | cLevel | ||
) |
int LZ4_compressHC2_limitedOutput | ( | const char * | src, |
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize, | ||
int | cLevel | ||
) |
int LZ4_compressHC2_limitedOutput_continue | ( | void * | LZ4HC_Data, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | dstCapacity, | ||
int | cLevel | ||
) |
int LZ4_compressHC2_limitedOutput_withStateHC | ( | void * | state, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize, | ||
int | cLevel | ||
) |
int LZ4_compressHC2_withStateHC | ( | void * | state, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | cLevel | ||
) |
int LZ4_compressHC_continue | ( | LZ4_streamHC_t * | ctx, |
const char * | src, | ||
char * | dst, | ||
int | srcSize | ||
) |
|
static |
int LZ4_compressHC_limitedOutput | ( | const char * | src, |
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize | ||
) |
int LZ4_compressHC_limitedOutput_continue | ( | LZ4_streamHC_t * | ctx, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize | ||
) |
int LZ4_compressHC_limitedOutput_withStateHC | ( | void * | state, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize | ||
) |
int LZ4_compressHC_withStateHC | ( | void * | state, |
const char * | src, | ||
char * | dst, | ||
int | srcSize | ||
) |
LZ4_streamHC_t* LZ4_createStreamHC | ( | void | ) |
LZ4_createStreamHC() and LZ4_freeStreamHC() : These functions create and release memory for LZ4 HC streaming state. Newly created states are automatically initialized. A same state can be used multiple times consecutively, starting with LZ4_resetStreamHC_fast() to start a new stream of blocks.
void LZ4_favorDecompressionSpeed | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
int | favor | ||
) |
int LZ4_freeStreamHC | ( | LZ4_streamHC_t * | LZ4_streamHCPtr | ) |
LZ4_streamHC_t* LZ4_initStreamHC | ( | void * | buffer, |
size_t | size | ||
) |
int LZ4_loadDictHC | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
const char * | dictionary, | ||
int | dictSize | ||
) |
void LZ4_resetStreamHC | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
int | compressionLevel | ||
) |
void LZ4_resetStreamHC_fast | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
int | compressionLevel | ||
) |
int LZ4_resetStreamStateHC | ( | void * | state, |
char * | inputBuffer | ||
) |
int LZ4_saveDictHC | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
char * | safeBuffer, | ||
int | dictSize | ||
) |
void LZ4_setCompressionLevel | ( | LZ4_streamHC_t * | LZ4_streamHCPtr, |
int | compressionLevel | ||
) |
int LZ4_sizeofStateHC | ( | void | ) |
LZ4_compress_HC_extStateHC() : Same as LZ4_compress_HC(), but using an externally allocated memory segment for state
. state
size is provided by LZ4_sizeofStateHC(). Memory segment must be aligned on 8-bytes boundaries (which a normal malloc() should do properly).
|
static |
|
static |
|
static |
LZ4_FORCE_INLINE int LZ4HC_compress_generic_internal | ( | LZ4HC_CCtx_internal *const | ctx, |
const char *const | src, | ||
char *const | dst, | ||
int *const | srcSizePtr, | ||
int const | dstCapacity, | ||
int | cLevel, | ||
const limitedOutput_directive | limit, | ||
const dictCtx_directive | dict | ||
) |
|
static |
LZ4_FORCE_INLINE int LZ4HC_compress_hashChain | ( | LZ4HC_CCtx_internal *const | ctx, |
const char *const | source, | ||
char *const | dest, | ||
int * | srcSizePtr, | ||
int const | maxOutputSize, | ||
int | maxNbAttempts, | ||
const limitedOutput_directive | limit, | ||
const dictCtx_directive | dict | ||
) |
|
static |
LZ4_FORCE_INLINE int LZ4HC_countBack | ( | const BYTE *const | ip, |
const BYTE *const | match, | ||
const BYTE *const | iMin, | ||
const BYTE *const | mMin | ||
) |
LZ4_FORCE_INLINE int LZ4HC_encodeSequence | ( | const BYTE ** | _ip, |
BYTE ** | _op, | ||
const BYTE ** | _anchor, | ||
int | matchLength, | ||
const BYTE *const | match, | ||
limitedOutput_directive | limit, | ||
BYTE * | oend | ||
) |
LZ4_FORCE_INLINE LZ4HC_match_t LZ4HC_FindLongerMatch | ( | LZ4HC_CCtx_internal *const | ctx, |
const BYTE * | ip, | ||
const BYTE *const | iHighLimit, | ||
int | minLen, | ||
int | nbSearches, | ||
const dictCtx_directive | dict, | ||
const HCfavor_e | favorDecSpeed | ||
) |
|
static |
LZ4_FORCE_INLINE void LZ4HC_Insert | ( | LZ4HC_CCtx_internal * | hc4, |
const BYTE * | ip | ||
) |
LZ4_FORCE_INLINE int LZ4HC_InsertAndFindBestMatch | ( | LZ4HC_CCtx_internal *const | hc4, |
const BYTE *const | ip, | ||
const BYTE *const | iLimit, | ||
const BYTE ** | matchpos, | ||
const int | maxNbAttempts, | ||
const int | patternAnalysis, | ||
const dictCtx_directive | dict | ||
) |
LZ4_FORCE_INLINE int LZ4HC_InsertAndGetWiderMatch | ( | LZ4HC_CCtx_internal *const | hc4, |
const BYTE *const | ip, | ||
const BYTE *const | iLowLimit, | ||
const BYTE *const | iHighLimit, | ||
int | longest, | ||
const BYTE ** | matchpos, | ||
const BYTE ** | startpos, | ||
const int | maxNbAttempts, | ||
const int | patternAnalysis, | ||
const int | chainSwap, | ||
const dictCtx_directive | dict, | ||
const HCfavor_e | favorDecSpeed | ||
) |
LZ4_FORCE_INLINE int LZ4HC_literalsPrice | ( | int const | litlen | ) |
LZ4_FORCE_INLINE int LZ4HC_sequencePrice | ( | int | litlen, |
int | mlen | ||
) |
|
static |