Project Alice
|
#include "compiler.h"
#include "cpu.h"
#include "mem.h"
#include "debug.h"
#include "error_private.h"
#include "../zstd.h"
#include "fse.h"
#include "huf.h"
#include "xxhash.h"
#include "zstd_trace.h"
Go to the source code of this file.
Classes | |
struct | seqDef_s |
struct | seqStore_t |
struct | ZSTD_sequenceLength |
struct | ZSTD_frameSizeInfo |
struct | blockProperties_t |
Macros | |
#define | ZSTD_STATIC_LINKING_ONLY |
#define | FSE_STATIC_LINKING_ONLY |
#define | XXH_STATIC_LINKING_ONLY /* XXH64_state_t */ |
#define | ZSTD_STATIC_ASSERT(c) DEBUG_STATIC_ASSERT(c) |
#define | ZSTD_isError ERR_isError /* for inlining */ |
#define | FSE_isError ERR_isError |
#define | HUF_isError ERR_isError |
#define | MIN(a, b) ((a)<(b) ? (a) : (b)) |
#define | MAX(a, b) ((a)>(b) ? (a) : (b)) |
#define | BOUNDED(min, val, max) (MAX(min,MIN(val,max))) |
#define | ZSTD_OPT_NUM (1<<12) |
#define | ZSTD_REP_NUM 3 /* number of repcodes */ |
#define | KB *(1 <<10) |
#define | MB *(1 <<20) |
#define | GB *(1U<<30) |
#define | BIT7 128 |
#define | BIT6 64 |
#define | BIT5 32 |
#define | BIT4 16 |
#define | BIT1 2 |
#define | BIT0 1 |
#define | ZSTD_WINDOWLOG_ABSOLUTEMIN 10 |
#define | ZSTD_FRAMEIDSIZE 4 /* magic number size */ |
#define | ZSTD_BLOCKHEADERSIZE 3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */ |
#define | ZSTD_FRAMECHECKSUMSIZE 4 |
#define | MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */ |
#define | MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */) /* for a non-null block */ |
#define | MIN_LITERALS_FOR_4_STREAMS 6 |
#define | LONGNBSEQ 0x7F00 |
#define | MINMATCH 3 |
#define | Litbits 8 |
#define | LitHufLog 11 |
#define | MaxLit ((1<<Litbits) - 1) |
#define | MaxML 52 |
#define | MaxLL 35 |
#define | DefaultMaxOff 28 |
#define | MaxOff 31 |
#define | MaxSeq MAX(MaxLL, MaxML) /* Assumption : MaxOff < MaxLL,MaxML */ |
#define | MLFSELog 9 |
#define | LLFSELog 9 |
#define | OffFSELog 8 |
#define | MaxFSELog MAX(MAX(MLFSELog, LLFSELog), OffFSELog) |
#define | MaxMLBits 16 |
#define | MaxLLBits 16 |
#define | ZSTD_MAX_HUF_HEADER_SIZE 128 /* header + <= 127 byte tree description */ |
#define | ZSTD_MAX_FSE_HEADERS_SIZE (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8) |
#define | LL_DEFAULTNORMLOG 6 /* for static allocation */ |
#define | ML_DEFAULTNORMLOG 6 /* for static allocation */ |
#define | OF_DEFAULTNORMLOG 5 /* for static allocation */ |
#define | COPY8(d, s) do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0) |
#define | COPY16(d, s) do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0) |
#define | WILDCOPY_OVERLENGTH 32 |
#define | WILDCOPY_VECLEN 16 |
#define | ZSTD_WORKSPACETOOLARGE_FACTOR 3 |
#define | ZSTD_WORKSPACETOOLARGE_MAXDURATION 128 |
Typedefs | |
typedef struct seqDef_s | seqDef |
Enumerations | |
enum | blockType_e { bt_raw , bt_rle , bt_compressed , bt_reserved } |
enum | symbolEncodingType_e { set_basic , set_rle , set_compressed , set_repeat } |
enum | ZSTD_overlap_e { ZSTD_no_overlap , ZSTD_overlap_src_before_dst } |
enum | ZSTD_bufferMode_e { ZSTD_bm_buffered = 0 , ZSTD_bm_stable = 1 } |
enum | ZSTD_longLengthType_e { ZSTD_llt_none = 0 , ZSTD_llt_literalLength = 1 , ZSTD_llt_matchLength = 2 } |
Functions | |
MEM_STATIC FORCE_INLINE_ATTR void | ZSTD_wildcopy (void *dst, const void *src, ptrdiff_t length, ZSTD_overlap_e const ovtype) |
MEM_STATIC size_t | ZSTD_limitCopy (void *dst, size_t dstCapacity, const void *src, size_t srcSize) |
MEM_STATIC ZSTD_sequenceLength | ZSTD_getSequenceLength (seqStore_t const *seqStore, seqDef const *seq) |
const seqStore_t * | ZSTD_getSeqStore (const ZSTD_CCtx *ctx) |
int | ZSTD_seqToCodes (const seqStore_t *seqStorePtr) |
void | ZSTD_invalidateRepCodes (ZSTD_CCtx *cctx) |
size_t | ZSTD_getcBlockSize (const void *src, size_t srcSize, blockProperties_t *bpPtr) |
size_t | ZSTD_decodeSeqHeaders (ZSTD_DCtx *dctx, int *nbSeqPtr, const void *src, size_t srcSize) |
MEM_STATIC int | ZSTD_cpuSupportsBmi2 (void) |
#define BIT0 1 |
Definition at line 80 of file zstd_internal.h.
#define BIT1 2 |
Definition at line 79 of file zstd_internal.h.
#define BIT4 16 |
Definition at line 78 of file zstd_internal.h.
#define BIT5 32 |
Definition at line 77 of file zstd_internal.h.
#define BIT6 64 |
Definition at line 76 of file zstd_internal.h.
#define BIT7 128 |
Definition at line 75 of file zstd_internal.h.
Definition at line 60 of file zstd_internal.h.
#define COPY16 | ( | d, | |
s | |||
) | do { ZSTD_copy16(d,s); d+=16; s+=16; } while (0) |
Definition at line 201 of file zstd_internal.h.
#define COPY8 | ( | d, | |
s | |||
) | do { ZSTD_copy8(d,s); d+=8; s+=8; } while (0) |
Definition at line 181 of file zstd_internal.h.
#define DefaultMaxOff 28 |
Definition at line 109 of file zstd_internal.h.
#define FSE_isError ERR_isError |
Definition at line 49 of file zstd_internal.h.
#define FSE_STATIC_LINKING_ONLY |
Definition at line 29 of file zstd_internal.h.
#define GB *(1U<<30) |
Definition at line 73 of file zstd_internal.h.
#define HUF_isError ERR_isError |
Definition at line 50 of file zstd_internal.h.
#define KB *(1 <<10) |
Definition at line 71 of file zstd_internal.h.
#define Litbits 8 |
Definition at line 104 of file zstd_internal.h.
#define LitHufLog 11 |
Definition at line 105 of file zstd_internal.h.
#define LL_DEFAULTNORMLOG 6 /* for static allocation */ |
Definition at line 137 of file zstd_internal.h.
#define LLFSELog 9 |
Definition at line 113 of file zstd_internal.h.
#define LONGNBSEQ 0x7F00 |
Definition at line 100 of file zstd_internal.h.
#define MAX | ( | a, | |
b | |||
) | ((a)>(b) ? (a) : (b)) |
Definition at line 59 of file zstd_internal.h.
Definition at line 115 of file zstd_internal.h.
#define MaxLit ((1<<Litbits) - 1) |
Definition at line 106 of file zstd_internal.h.
#define MaxLL 35 |
Definition at line 108 of file zstd_internal.h.
#define MaxLLBits 16 |
Definition at line 117 of file zstd_internal.h.
#define MaxML 52 |
Definition at line 107 of file zstd_internal.h.
#define MaxMLBits 16 |
Definition at line 116 of file zstd_internal.h.
#define MaxOff 31 |
Definition at line 110 of file zstd_internal.h.
Definition at line 111 of file zstd_internal.h.
#define MB *(1 <<20) |
Definition at line 72 of file zstd_internal.h.
#define MIN | ( | a, | |
b | |||
) | ((a)<(b) ? (a) : (b)) |
Definition at line 58 of file zstd_internal.h.
#define MIN_CBLOCK_SIZE (1 /*litCSize*/ + 1 /* RLE or RAW */) /* for a non-null block */ |
Definition at line 95 of file zstd_internal.h.
#define MIN_LITERALS_FOR_4_STREAMS 6 |
Definition at line 96 of file zstd_internal.h.
#define MIN_SEQUENCES_SIZE 1 /* nbSeq==0 */ |
Definition at line 94 of file zstd_internal.h.
#define MINMATCH 3 |
Definition at line 102 of file zstd_internal.h.
#define ML_DEFAULTNORMLOG 6 /* for static allocation */ |
Definition at line 158 of file zstd_internal.h.
#define MLFSELog 9 |
Definition at line 112 of file zstd_internal.h.
#define OF_DEFAULTNORMLOG 5 /* for static allocation */ |
Definition at line 167 of file zstd_internal.h.
#define OffFSELog 8 |
Definition at line 114 of file zstd_internal.h.
#define WILDCOPY_OVERLENGTH 32 |
Definition at line 203 of file zstd_internal.h.
#define WILDCOPY_VECLEN 16 |
Definition at line 204 of file zstd_internal.h.
#define XXH_STATIC_LINKING_ONLY /* XXH64_state_t */ |
Definition at line 33 of file zstd_internal.h.
#define ZSTD_BLOCKHEADERSIZE 3 /* C standard doesn't allow `static const` variable to be init using another `static const` variable */ |
Definition at line 88 of file zstd_internal.h.
#define ZSTD_FRAMECHECKSUMSIZE 4 |
Definition at line 92 of file zstd_internal.h.
#define ZSTD_FRAMEIDSIZE 4 /* magic number size */ |
Definition at line 86 of file zstd_internal.h.
#define ZSTD_isError ERR_isError /* for inlining */ |
Definition at line 48 of file zstd_internal.h.
#define ZSTD_MAX_FSE_HEADERS_SIZE (((MaxML + 1) * MLFSELog + (MaxLL + 1) * LLFSELog + (MaxOff + 1) * OffFSELog + 7) / 8) |
Definition at line 121 of file zstd_internal.h.
#define ZSTD_MAX_HUF_HEADER_SIZE 128 /* header + <= 127 byte tree description */ |
Definition at line 119 of file zstd_internal.h.
#define ZSTD_OPT_NUM (1<<12) |
Definition at line 66 of file zstd_internal.h.
#define ZSTD_REP_NUM 3 /* number of repcodes */ |
Definition at line 68 of file zstd_internal.h.
#define ZSTD_STATIC_ASSERT | ( | c | ) | DEBUG_STATIC_ASSERT(c) |
Definition at line 47 of file zstd_internal.h.
#define ZSTD_STATIC_LINKING_ONLY |
Definition at line 27 of file zstd_internal.h.
#define ZSTD_WINDOWLOG_ABSOLUTEMIN 10 |
Definition at line 82 of file zstd_internal.h.
#define ZSTD_WORKSPACETOOLARGE_FACTOR 3 |
Definition at line 262 of file zstd_internal.h.
#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128 |
Definition at line 269 of file zstd_internal.h.
enum blockType_e |
Enumerator | |
---|---|
bt_raw | |
bt_rle | |
bt_compressed | |
bt_reserved |
Definition at line 90 of file zstd_internal.h.
enum symbolEncodingType_e |
Enumerator | |
---|---|
set_basic | |
set_rle | |
set_compressed | |
set_repeat |
Definition at line 98 of file zstd_internal.h.
enum ZSTD_bufferMode_e |
Enumerator | |
---|---|
ZSTD_bm_buffered | |
ZSTD_bm_stable |
Definition at line 272 of file zstd_internal.h.
Enumerator | |
---|---|
ZSTD_llt_none | |
ZSTD_llt_literalLength | |
ZSTD_llt_matchLength |
Definition at line 288 of file zstd_internal.h.
enum ZSTD_overlap_e |
Enumerator | |
---|---|
ZSTD_no_overlap | |
ZSTD_overlap_src_before_dst |
Definition at line 206 of file zstd_internal.h.
MEM_STATIC int ZSTD_cpuSupportsBmi2 | ( | void | ) |
Definition at line 382 of file zstd_internal.h.
size_t ZSTD_decodeSeqHeaders | ( | ZSTD_DCtx * | dctx, |
int * | nbSeqPtr, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
ZSTD_decodeSeqHeaders() : decode sequence header from src
Definition at line 695 of file zstd_decompress_block.c.
size_t ZSTD_getcBlockSize | ( | const void * | src, |
size_t | srcSize, | ||
blockProperties_t * | bpPtr | ||
) |
ZSTD_getcBlockSize() : Provides the size of compressed block from block header src
Definition at line 63 of file zstd_decompress_block.c.
const seqStore_t * ZSTD_getSeqStore | ( | const ZSTD_CCtx * | ctx | ) |
Definition at line 220 of file zstd_compress.c.
MEM_STATIC ZSTD_sequenceLength ZSTD_getSequenceLength | ( | seqStore_t const * | seqStore, |
seqDef const * | seq | ||
) |
Returns the ZSTD_sequenceLength for the given sequences. It handles the decoding of long sequences indicated by longLengthPos and longLengthType, and adds MINMATCH back to matchLength.
Definition at line 322 of file zstd_internal.h.
void ZSTD_invalidateRepCodes | ( | ZSTD_CCtx * | cctx | ) |
MEM_STATIC size_t ZSTD_limitCopy | ( | void * | dst, |
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
Definition at line 252 of file zstd_internal.h.
int ZSTD_seqToCodes | ( | const seqStore_t * | seqStorePtr | ) |
MEM_STATIC FORCE_INLINE_ATTR void ZSTD_wildcopy | ( | void * | dst, |
const void * | src, | ||
ptrdiff_t | length, | ||
ZSTD_overlap_e const | ovtype | ||
) |
ZSTD_wildcopy() : Custom version of ZSTD_memcpy(), can over read/write up to WILDCOPY_OVERLENGTH bytes (if length==0)
ovtype | controls the overlap detection
|
Definition at line 220 of file zstd_internal.h.