ROOTANA
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
lz4frame.cxx File Reference
#include <stdlib.h>
#include <string.h>
#include "mlz4frame_static.h"
#include "mlz4.h"
#include "mlz4hc.h"
#include "mxxhash.h"
Include dependency graph for lz4frame.cxx:

Go to the source code of this file.

Data Structures

struct  MLZ4F_cctx_s
 
struct  MLZ4F_dctx_s
 

Macros

#define ALLOCATOR(s)   calloc(1,s)
 
#define FREEMEM   free
 
#define MEM_INIT   memset
 
#define KB   *(1<<10)
 
#define MB   *(1<<20)
 
#define GB   *(1<<30)
 
#define _1BIT   0x01
 
#define _2BITS   0x03
 
#define _3BITS   0x07
 
#define _4BITS   0x0F
 
#define _8BITS   0xFF
 
#define MLZ4F_MAGIC_SKIPPABLE_START   0x184D2A50U
 
#define MLZ4F_MAGICNUMBER   0x184D2204U
 
#define MLZ4F_BLOCKUNCOMPRESSED_FLAG   0x80000000U
 
#define MLZ4F_BLOCKSIZEID_DEFAULT   MLZ4F_max64KB
 
#define MLZ4F_GENERATE_STRING(STRING)   #STRING,
 

Typedefs

typedef unsigned char BYTE
 
typedef unsigned short U16
 
typedef unsigned int U32
 
typedef signed int S32
 
typedef unsigned long long U64
 
typedef struct MLZ4F_cctx_s MLZ4F_cctx_t
 
typedef struct MLZ4F_dctx_s MLZ4F_dctx_t
 
typedef int(* compressFunc_t) (void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)
 

Enumerations

enum  MLZ4F_lastBlockStatus { notDone , fromTmpBuffer , fromSrcBuffer }
 
enum  dStage_t {
  dstage_getHeader =0 , dstage_storeHeader , dstage_getCBlockSize , dstage_storeCBlockSize ,
  dstage_copyDirect , dstage_getCBlock , dstage_storeCBlock , dstage_decodeCBlock ,
  dstage_decodeCBlock_intoDst , dstage_decodeCBlock_intoTmp , dstage_flushOut , dstage_getSuffix ,
  dstage_storeSuffix , dstage_getSFrameSize , dstage_storeSFrameSize , dstage_skipSkippable
}
 

Functions

unsigned MLZ4F_isError (MLZ4F_errorCode_t code)
 
const char * MLZ4F_getErrorName (MLZ4F_errorCode_t code)
 
static size_t MLZ4F_getBlockSize (unsigned blockSizeID)
 
static U32 MLZ4F_readLE32 (const BYTE *srcPtr)
 
static void MLZ4F_writeLE32 (BYTE *dstPtr, U32 value32)
 
static U64 MLZ4F_readLE64 (const BYTE *srcPtr)
 
static void MLZ4F_writeLE64 (BYTE *dstPtr, U64 value64)
 
static BYTE MLZ4F_headerChecksum (const void *header, size_t length)
 
static MLZ4F_blockSizeID_t MLZ4F_optimalBSID (const MLZ4F_blockSizeID_t requestedBSID, const size_t srcSize)
 
size_t MLZ4F_compressFrameBound (size_t srcSize, const MLZ4F_preferences_t *preferencesPtr)
 
size_t MLZ4F_compressFrame (void *dstBuffer, size_t dstMaxSize, const void *srcBuffer, size_t srcSize, const MLZ4F_preferences_t *preferencesPtr)
 
MLZ4F_errorCode_t MLZ4F_createCompressionContext (MLZ4F_compressionContext_t *MLZ4F_compressionContextPtr, unsigned version)
 
MLZ4F_errorCode_t MLZ4F_freeCompressionContext (MLZ4F_compressionContext_t MLZ4F_compressionContext)
 
size_t MLZ4F_compressBegin (MLZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const MLZ4F_preferences_t *preferencesPtr)
 
size_t MLZ4F_compressBound (size_t srcSize, const MLZ4F_preferences_t *preferencesPtr)
 
static size_t MLZ4F_compressBlock (void *dst, const void *src, size_t srcSize, compressFunc_t compress, void *lz4ctx, int level)
 
static int MLZ4F_localMLZ4_compress_limitedOutput_withState (void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)
 
static int MLZ4F_localMLZ4_compress_limitedOutput_continue (void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)
 
static int MLZ4F_localMLZ4_compressHC_limitedOutput_continue (void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)
 
static compressFunc_t MLZ4F_selectCompression (MLZ4F_blockMode_t blockMode, int level)
 
static int MLZ4F_localSaveDict (MLZ4F_cctx_t *cctxPtr)
 
size_t MLZ4F_compressUpdate (MLZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const void *srcBuffer, size_t srcSize, const MLZ4F_compressOptions_t *compressOptionsPtr)
 
size_t MLZ4F_flush (MLZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const MLZ4F_compressOptions_t *compressOptionsPtr)
 
size_t MLZ4F_compressEnd (MLZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const MLZ4F_compressOptions_t *compressOptionsPtr)
 
MLZ4F_errorCode_t MLZ4F_createDecompressionContext (MLZ4F_decompressionContext_t *MLZ4F_decompressionContextPtr, unsigned versionNumber)
 
MLZ4F_errorCode_t MLZ4F_freeDecompressionContext (MLZ4F_decompressionContext_t MLZ4F_decompressionContext)
 
static size_t MLZ4F_decodeHeader (MLZ4F_dctx_t *dctxPtr, const void *srcVoidPtr, size_t srcSize)
 
MLZ4F_errorCode_t MLZ4F_getFrameInfo (MLZ4F_decompressionContext_t dCtx, MLZ4F_frameInfo_t *frameInfoPtr, const void *srcBuffer, size_t *srcSizePtr)
 
static int MLZ4F_decompress_safe (const char *source, char *dest, int compressedSize, int maxDecompressedSize, const char *dictStart, int dictSize)
 
static void MLZ4F_updateDict (MLZ4F_dctx_t *dctxPtr, const BYTE *dstPtr, size_t dstSize, const BYTE *dstPtr0, unsigned withinTmp)
 
size_t MLZ4F_decompress (MLZ4F_decompressionContext_t decompressionContext, void *dstBuffer, size_t *dstSizePtr, const void *srcBuffer, size_t *srcSizePtr, const MLZ4F_decompressOptions_t *decompressOptionsPtr)
 

Variables

static const size_t minFHSize = 7
 
static const size_t maxFHSize = 15
 
static const size_t BHSize = 4
 
static const int minHClevel = 3
 
static const char * MLZ4F_errorStrings [] = { MLZ4F_LIST_ERRORS(MLZ4F_GENERATE_STRING) }
 

Macro Definition Documentation

◆ _1BIT

#define _1BIT   0x01

Definition at line 94 of file lz4frame.cxx.

◆ _2BITS

#define _2BITS   0x03

Definition at line 95 of file lz4frame.cxx.

◆ _3BITS

#define _3BITS   0x07

Definition at line 96 of file lz4frame.cxx.

◆ _4BITS

#define _4BITS   0x0F

Definition at line 97 of file lz4frame.cxx.

◆ _8BITS

#define _8BITS   0xFF

Definition at line 98 of file lz4frame.cxx.

◆ ALLOCATOR

#define ALLOCATOR (   s)    calloc(1,s)

Definition at line 53 of file lz4frame.cxx.

◆ FREEMEM

#define FREEMEM   free

Definition at line 54 of file lz4frame.cxx.

◆ GB

#define GB   *(1<<30)

Definition at line 92 of file lz4frame.cxx.

◆ KB

#define KB   *(1<<10)

Definition at line 90 of file lz4frame.cxx.

◆ MB

#define MB   *(1<<20)

Definition at line 91 of file lz4frame.cxx.

◆ MEM_INIT

#define MEM_INIT   memset

Definition at line 56 of file lz4frame.cxx.

◆ MLZ4F_BLOCKSIZEID_DEFAULT

#define MLZ4F_BLOCKSIZEID_DEFAULT   MLZ4F_max64KB

Definition at line 103 of file lz4frame.cxx.

◆ MLZ4F_BLOCKUNCOMPRESSED_FLAG

#define MLZ4F_BLOCKUNCOMPRESSED_FLAG   0x80000000U

Definition at line 102 of file lz4frame.cxx.

◆ MLZ4F_GENERATE_STRING

#define MLZ4F_GENERATE_STRING (   STRING)    #STRING,

Definition at line 156 of file lz4frame.cxx.

◆ MLZ4F_MAGIC_SKIPPABLE_START

#define MLZ4F_MAGIC_SKIPPABLE_START   0x184D2A50U

Definition at line 100 of file lz4frame.cxx.

◆ MLZ4F_MAGICNUMBER

#define MLZ4F_MAGICNUMBER   0x184D2204U

Definition at line 101 of file lz4frame.cxx.

Typedef Documentation

◆ BYTE

typedef unsigned char BYTE

Definition at line 79 of file lz4frame.cxx.

◆ compressFunc_t

typedef int(* compressFunc_t) (void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)

Definition at line 496 of file lz4frame.cxx.

◆ MLZ4F_cctx_t

typedef struct MLZ4F_cctx_s MLZ4F_cctx_t

◆ MLZ4F_dctx_t

typedef struct MLZ4F_dctx_s MLZ4F_dctx_t

◆ S32

typedef signed int S32

Definition at line 82 of file lz4frame.cxx.

◆ U16

typedef unsigned short U16

Definition at line 80 of file lz4frame.cxx.

◆ U32

typedef unsigned int U32

Definition at line 81 of file lz4frame.cxx.

◆ U64

typedef unsigned long long U64

Definition at line 83 of file lz4frame.cxx.

Enumeration Type Documentation

◆ dStage_t

enum dStage_t
Enumerator
dstage_getHeader 
dstage_storeHeader 
dstage_getCBlockSize 
dstage_storeCBlockSize 
dstage_copyDirect 
dstage_getCBlock 
dstage_storeCBlock 
dstage_decodeCBlock 
dstage_decodeCBlock_intoDst 
dstage_decodeCBlock_intoTmp 
dstage_flushOut 
dstage_getSuffix 
dstage_storeSuffix 
dstage_getSFrameSize 
dstage_storeSFrameSize 
dstage_skipSkippable 

Definition at line 791 of file lz4frame.cxx.

◆ MLZ4F_lastBlockStatus

Enumerator
notDone 
fromTmpBuffer 
fromSrcBuffer 

Definition at line 551 of file lz4frame.cxx.

Function Documentation

◆ MLZ4F_compressBegin()

size_t MLZ4F_compressBegin ( MLZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const MLZ4F_preferences_t preferencesPtr 
)

Definition at line 392 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_compressBlock()

static size_t MLZ4F_compressBlock ( void *  dst,
const void *  src,
size_t  srcSize,
compressFunc_t  compress,
void *  lz4ctx,
int  level 
)
static

Definition at line 498 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_compressBound()

size_t MLZ4F_compressBound ( size_t  srcSize,
const MLZ4F_preferences_t preferencesPtr 
)

Definition at line 477 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_compressEnd()

size_t MLZ4F_compressEnd ( MLZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const MLZ4F_compressOptions_t compressOptionsPtr 
)

Definition at line 714 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_compressFrame()

size_t MLZ4F_compressFrame ( void *  dstBuffer,
size_t  dstMaxSize,
const void *  srcBuffer,
size_t  srcSize,
const MLZ4F_preferences_t preferencesPtr 
)

Definition at line 284 of file lz4frame.cxx.

Here is the call graph for this function:

◆ MLZ4F_compressFrameBound()

size_t MLZ4F_compressFrameBound ( size_t  srcSize,
const MLZ4F_preferences_t preferencesPtr 
)

Definition at line 256 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_compressUpdate()

size_t MLZ4F_compressUpdate ( MLZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const void *  srcBuffer,
size_t  srcSize,
const MLZ4F_compressOptions_t compressOptionsPtr 
)

Definition at line 562 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_createCompressionContext()

MLZ4F_errorCode_t MLZ4F_createCompressionContext ( MLZ4F_compressionContext_t MLZ4F_compressionContextPtr,
unsigned  version 
)

Definition at line 355 of file lz4frame.cxx.

◆ MLZ4F_createDecompressionContext()

MLZ4F_errorCode_t MLZ4F_createDecompressionContext ( MLZ4F_decompressionContext_t MLZ4F_decompressionContextPtr,
unsigned  versionNumber 
)

Definition at line 760 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_decodeHeader()

static size_t MLZ4F_decodeHeader ( MLZ4F_dctx_t dctxPtr,
const void *  srcVoidPtr,
size_t  srcSize 
)
static

Definition at line 810 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_decompress()

size_t MLZ4F_decompress ( MLZ4F_decompressionContext_t  decompressionContext,
void *  dstBuffer,
size_t *  dstSizePtr,
const void *  srcBuffer,
size_t *  srcSizePtr,
const MLZ4F_decompressOptions_t decompressOptionsPtr 
)

Definition at line 1044 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_decompress_safe()

static int MLZ4F_decompress_safe ( const char *  source,
char *  dest,
int  compressedSize,
int  maxDecompressedSize,
const char *  dictStart,
int  dictSize 
)
static

Definition at line 954 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_flush()

size_t MLZ4F_flush ( MLZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const MLZ4F_compressOptions_t compressOptionsPtr 
)

Definition at line 673 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_freeCompressionContext()

MLZ4F_errorCode_t MLZ4F_freeCompressionContext ( MLZ4F_compressionContext_t  MLZ4F_compressionContext)

Definition at line 371 of file lz4frame.cxx.

◆ MLZ4F_freeDecompressionContext()

MLZ4F_errorCode_t MLZ4F_freeDecompressionContext ( MLZ4F_decompressionContext_t  MLZ4F_decompressionContext)

Definition at line 772 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_getBlockSize()

static size_t MLZ4F_getBlockSize ( unsigned  blockSizeID)
static

Definition at line 176 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_getErrorName()

const char * MLZ4F_getErrorName ( MLZ4F_errorCode_t  code)

Definition at line 165 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_getFrameInfo()

MLZ4F_errorCode_t MLZ4F_getFrameInfo ( MLZ4F_decompressionContext_t  dCtx,
MLZ4F_frameInfo_t frameInfoPtr,
const void *  srcBuffer,
size_t *  srcSizePtr 
)

Definition at line 928 of file lz4frame.cxx.

Here is the call graph for this function:

◆ MLZ4F_headerChecksum()

static BYTE MLZ4F_headerChecksum ( const void *  header,
size_t  length 
)
static

Definition at line 231 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_isError()

unsigned MLZ4F_isError ( MLZ4F_errorCode_t  code)

Definition at line 160 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_localMLZ4_compress_limitedOutput_continue()

static int MLZ4F_localMLZ4_compress_limitedOutput_continue ( void *  ctx,
const char *  src,
char *  dst,
int  srcSize,
int  dstSize,
int  level 
)
static

Definition at line 521 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_localMLZ4_compress_limitedOutput_withState()

static int MLZ4F_localMLZ4_compress_limitedOutput_withState ( void *  ctx,
const char *  src,
char *  dst,
int  srcSize,
int  dstSize,
int  level 
)
static

Definition at line 515 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_localMLZ4_compressHC_limitedOutput_continue()

static int MLZ4F_localMLZ4_compressHC_limitedOutput_continue ( void *  ctx,
const char *  src,
char *  dst,
int  srcSize,
int  dstSize,
int  level 
)
static

Definition at line 527 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_localSaveDict()

static int MLZ4F_localSaveDict ( MLZ4F_cctx_t cctxPtr)
static

Definition at line 544 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_optimalBSID()

static MLZ4F_blockSizeID_t MLZ4F_optimalBSID ( const MLZ4F_blockSizeID_t  requestedBSID,
const size_t  srcSize 
)
static

Definition at line 241 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_readLE32()

static U32 MLZ4F_readLE32 ( const BYTE srcPtr)
static

Definition at line 188 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_readLE64()

static U64 MLZ4F_readLE64 ( const BYTE srcPtr)
static

Definition at line 205 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_selectCompression()

static compressFunc_t MLZ4F_selectCompression ( MLZ4F_blockMode_t  blockMode,
int  level 
)
static

Definition at line 533 of file lz4frame.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MLZ4F_updateDict()

static void MLZ4F_updateDict ( MLZ4F_dctx_t dctxPtr,
const BYTE dstPtr,
size_t  dstSize,
const BYTE dstPtr0,
unsigned  withinTmp 
)
static

Definition at line 961 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_writeLE32()

static void MLZ4F_writeLE32 ( BYTE dstPtr,
U32  value32 
)
static

Definition at line 197 of file lz4frame.cxx.

Here is the caller graph for this function:

◆ MLZ4F_writeLE64()

static void MLZ4F_writeLE64 ( BYTE dstPtr,
U64  value64 
)
static

Definition at line 218 of file lz4frame.cxx.

Here is the caller graph for this function:

Variable Documentation

◆ BHSize

const size_t BHSize = 4
static

Definition at line 107 of file lz4frame.cxx.

◆ maxFHSize

const size_t maxFHSize = 15
static

Definition at line 106 of file lz4frame.cxx.

◆ minFHSize

const size_t minFHSize = 7
static

Definition at line 105 of file lz4frame.cxx.

◆ minHClevel

const int minHClevel = 3
static

Definition at line 108 of file lz4frame.cxx.

◆ MLZ4F_errorStrings

const char* MLZ4F_errorStrings[] = { MLZ4F_LIST_ERRORS(MLZ4F_GENERATE_STRING) }
static

Definition at line 157 of file lz4frame.cxx.