UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
lz4hc.h File Reference
#include "lz4.h"

Go to the source code of this file.

Classes

struct  LZ4HC_CCtx_internal
 
union  LZ4_streamHC_u
 

Macros

#define LZ4HC_CLEVEL_MIN   3
 
#define LZ4HC_CLEVEL_DEFAULT   9
 
#define LZ4HC_CLEVEL_OPT_MIN   10
 
#define LZ4HC_CLEVEL_MAX   12
 
#define LZ4HC_DICTIONARY_LOGSIZE   16
 
#define LZ4HC_MAXD   (1<<LZ4HC_DICTIONARY_LOGSIZE)
 
#define LZ4HC_MAXD_MASK   (LZ4HC_MAXD - 1)
 
#define LZ4HC_HASH_LOG   15
 
#define LZ4HC_HASHTABLESIZE   (1 << LZ4HC_HASH_LOG)
 
#define LZ4HC_HASH_MASK   (LZ4HC_HASHTABLESIZE - 1)
 
#define LZ4_STREAMHC_MINSIZE   262200 /* static size, for inter-version compatibility */
 

Typedefs

typedef union LZ4_streamHC_u LZ4_streamHC_t
 
typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal
 

Functions

LZ4LIB_API int LZ4_compress_HC (const char *src, char *dst, int srcSize, int dstCapacity, int compressionLevel)
 
LZ4LIB_API int LZ4_sizeofStateHC (void)
 
LZ4LIB_API int LZ4_compress_HC_extStateHC (void *stateHC, const char *src, char *dst, int srcSize, int maxDstSize, int compressionLevel)
 
LZ4LIB_API int LZ4_compress_HC_destSize (void *stateHC, const char *src, char *dst, int *srcSizePtr, int targetDstSize, int compressionLevel)
 
LZ4LIB_API LZ4_streamHC_tLZ4_createStreamHC (void)
 
LZ4LIB_API int LZ4_freeStreamHC (LZ4_streamHC_t *streamHCPtr)
 
LZ4LIB_API void LZ4_resetStreamHC_fast (LZ4_streamHC_t *streamHCPtr, int compressionLevel)
 
LZ4LIB_API int LZ4_loadDictHC (LZ4_streamHC_t *streamHCPtr, const char *dictionary, int dictSize)
 
LZ4LIB_API int LZ4_compress_HC_continue (LZ4_streamHC_t *streamHCPtr, const char *src, char *dst, int srcSize, int maxDstSize)
 
LZ4LIB_API int LZ4_compress_HC_continue_destSize (LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int *srcSizePtr, int targetDstSize)
 
LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t *streamHCPtr, char *safeBuffer, int maxDictSize)
 
LZ4LIB_API LZ4_streamHC_tLZ4_initStreamHC (void *buffer, size_t size)
 
LZ4LIB_API void LZ4_resetStreamHC (LZ4_streamHC_t *streamHCPtr, int compressionLevel)
 

Macro Definition Documentation

◆ LZ4_STREAMHC_MINSIZE

#define LZ4_STREAMHC_MINSIZE   262200 /* static size, for inter-version compatibility */

◆ LZ4HC_CLEVEL_DEFAULT

#define LZ4HC_CLEVEL_DEFAULT   9

◆ LZ4HC_CLEVEL_MAX

#define LZ4HC_CLEVEL_MAX   12

◆ LZ4HC_CLEVEL_MIN

#define LZ4HC_CLEVEL_MIN   3

◆ LZ4HC_CLEVEL_OPT_MIN

#define LZ4HC_CLEVEL_OPT_MIN   10

◆ LZ4HC_DICTIONARY_LOGSIZE

#define LZ4HC_DICTIONARY_LOGSIZE   16

◆ LZ4HC_HASH_LOG

#define LZ4HC_HASH_LOG   15

◆ LZ4HC_HASH_MASK

#define LZ4HC_HASH_MASK   (LZ4HC_HASHTABLESIZE - 1)

◆ LZ4HC_HASHTABLESIZE

#define LZ4HC_HASHTABLESIZE   (1 << LZ4HC_HASH_LOG)

◆ LZ4HC_MAXD

#define LZ4HC_MAXD   (1<<LZ4HC_DICTIONARY_LOGSIZE)

◆ LZ4HC_MAXD_MASK

#define LZ4HC_MAXD_MASK   (LZ4HC_MAXD - 1)

Typedef Documentation

◆ LZ4_streamHC_t

◆ LZ4HC_CCtx_internal

Function Documentation

◆ LZ4_compress_HC()

LZ4LIB_API 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.

Returns
: the number of bytes written into 'dst' or 0 if compression fails.

◆ LZ4_compress_HC_continue()

LZ4LIB_API int LZ4_compress_HC_continue ( LZ4_streamHC_t streamHCPtr,
const char src,
char dst,
int  srcSize,
int  maxDstSize 
)

◆ LZ4_compress_HC_continue_destSize()

LZ4LIB_API 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 :

Returns
: the number of bytes written into 'dst' (necessarily <= targetDstSize) or 0 if compression fails. 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.

◆ LZ4_compress_HC_destSize()

LZ4LIB_API 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 :

Returns
: the number of bytes written into 'dst' (necessarily <= targetDstSize) or 0 if compression fails. srcSizePtr : on success, *srcSizePtr is updated to indicate how much bytes were read from src

◆ LZ4_compress_HC_extStateHC()

LZ4LIB_API int LZ4_compress_HC_extStateHC ( void stateHC,
const char src,
char dst,
int  srcSize,
int  maxDstSize,
int  compressionLevel 
)

◆ LZ4_createStreamHC()

LZ4LIB_API 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.

◆ LZ4_freeStreamHC()

LZ4LIB_API int LZ4_freeStreamHC ( LZ4_streamHC_t streamHCPtr)

◆ LZ4_initStreamHC()

LZ4LIB_API LZ4_streamHC_t * LZ4_initStreamHC ( void buffer,
size_t  size 
)

◆ LZ4_loadDictHC()

LZ4LIB_API int LZ4_loadDictHC ( LZ4_streamHC_t streamHCPtr,
const char dictionary,
int  dictSize 
)

◆ LZ4_resetStreamHC()

LZ4LIB_API void LZ4_resetStreamHC ( LZ4_streamHC_t streamHCPtr,
int  compressionLevel 
)

◆ LZ4_resetStreamHC_fast()

LZ4LIB_API void LZ4_resetStreamHC_fast ( LZ4_streamHC_t streamHCPtr,
int  compressionLevel 
)

◆ LZ4_saveDictHC()

LZ4LIB_API int LZ4_saveDictHC ( LZ4_streamHC_t streamHCPtr,
char safeBuffer,
int  maxDictSize 
)

◆ LZ4_sizeofStateHC()

LZ4LIB_API 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).