Project Alice
|
#include "../common/zstd_deps.h"
#include "../common/compiler.h"
#include "../common/cpu.h"
#include "../common/mem.h"
#include "../common/fse.h"
#include "../common/huf.h"
#include "../common/zstd_internal.h"
#include "zstd_decompress_internal.h"
#include "zstd_ddict.h"
#include "zstd_decompress_block.h"
#include "../common/bits.h"
Go to the source code of this file.
Classes | |
struct | seq_t |
struct | ZSTD_fseState |
struct | seqState_t |
struct | ZSTD_OffsetInfo |
Macros | |
#define | FSE_STATIC_LINKING_ONLY |
#define | LONG_OFFSETS_MAX_EXTRA_BITS_32 |
#define | STORED_SEQS 8 |
#define | STORED_SEQS_MASK (STORED_SEQS-1) |
#define | ADVANCED_SEQS STORED_SEQS |
Typedefs | |
typedef size_t(* | ZSTD_decompressSequences_t) (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset) |
Enumerations | |
enum | ZSTD_longOffset_e { ZSTD_lo_isRegularOffset , ZSTD_lo_isLongOffset =1 } |
Functions | |
size_t | ZSTD_getcBlockSize (const void *src, size_t srcSize, blockProperties_t *bpPtr) |
size_t | ZSTD_decodeLiteralsBlock_wrapper (ZSTD_DCtx *dctx, const void *src, size_t srcSize, void *dst, size_t dstCapacity) |
FORCE_INLINE_TEMPLATE void | ZSTD_buildFSETable_body (ZSTD_seqSymbol *dt, const short *normalizedCounter, unsigned maxSymbolValue, const U32 *baseValue, const U8 *nbAdditionalBits, unsigned tableLog, void *wksp, size_t wkspSize) |
void | ZSTD_buildFSETable (ZSTD_seqSymbol *dt, const short *normalizedCounter, unsigned maxSymbolValue, const U32 *baseValue, const U8 *nbAdditionalBits, unsigned tableLog, void *wksp, size_t wkspSize, int bmi2) |
size_t | ZSTD_decodeSeqHeaders (ZSTD_DCtx *dctx, int *nbSeqPtr, const void *src, size_t srcSize) |
HINT_INLINE void | ZSTD_overlapCopy8 (BYTE **op, BYTE const **ip, size_t offset) |
FORCE_NOINLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t | ZSTD_execSequenceEnd (BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd) |
FORCE_NOINLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t | ZSTD_execSequenceEndSplitLitBuffer (BYTE *op, BYTE *const oend, const BYTE *const oend_w, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd) |
HINT_INLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t | ZSTD_execSequence (BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd) |
HINT_INLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t | ZSTD_execSequenceSplitLitBuffer (BYTE *op, BYTE *const oend, const BYTE *const oend_w, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const prefixStart, const BYTE *const virtualStart, const BYTE *const dictEnd) |
FORCE_INLINE_TEMPLATE void | ZSTD_updateFseStateWithDInfo (ZSTD_fseState *DStatePtr, BIT_DStream_t *bitD, U16 nextState, U32 nbBits) |
FORCE_INLINE_TEMPLATE seq_t | ZSTD_decodeSequence (seqState_t *seqState, const ZSTD_longOffset_e longOffsets, const int isLastSeq) |
FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE | ZSTD_decompressSequences_bodySplitLitBuffer (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset) |
FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE | ZSTD_decompressSequences_body (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset) |
FORCE_INLINE_TEMPLATE size_t | ZSTD_prefetchMatch (size_t prefetchPos, seq_t const sequence, const BYTE *const prefixStart, const BYTE *const dictEnd) |
FORCE_INLINE_TEMPLATE size_t | ZSTD_decompressSequencesLong_body (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset) |
size_t | ZSTD_decompressBlock_internal (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, const streaming_operation streaming) |
ZSTD_ALLOW_POINTER_OVERFLOW_ATTR void | ZSTD_checkContinuity (ZSTD_DCtx *dctx, const void *dst, size_t dstSize) |
size_t | ZSTD_decompressBlock_deprecated (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize) |
size_t | ZSTD_decompressBlock (ZSTD_DCtx *dctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize) |
#define ADVANCED_SEQS STORED_SEQS |
#define FSE_STATIC_LINKING_ONLY |
Definition at line 21 of file zstd_decompress_block.c.
#define LONG_OFFSETS_MAX_EXTRA_BITS_32 |
Definition at line 1215 of file zstd_decompress_block.c.
#define STORED_SEQS 8 |
#define STORED_SEQS_MASK (STORED_SEQS-1) |
typedef size_t(* ZSTD_decompressSequences_t) (ZSTD_DCtx *dctx, void *dst, size_t maxDstSize, const void *seqStart, size_t seqSize, int nbSeq, const ZSTD_longOffset_e isLongOffset) |
Definition at line 1938 of file zstd_decompress_block.c.
enum ZSTD_longOffset_e |
Enumerator | |
---|---|
ZSTD_lo_isRegularOffset | |
ZSTD_lo_isLongOffset |
Definition at line 1220 of file zstd_decompress_block.c.
void ZSTD_buildFSETable | ( | ZSTD_seqSymbol * | dt, |
const short * | normalizedCounter, | ||
unsigned | maxSymbolValue, | ||
const U32 * | baseValue, | ||
const U8 * | nbAdditionalBits, | ||
unsigned | tableLog, | ||
void * | wksp, | ||
size_t | wkspSize, | ||
int | bmi2 | ||
) |
Definition at line 626 of file zstd_decompress_block.c.
FORCE_INLINE_TEMPLATE void ZSTD_buildFSETable_body | ( | ZSTD_seqSymbol * | dt, |
const short * | normalizedCounter, | ||
unsigned | maxSymbolValue, | ||
const U32 * | baseValue, | ||
const U8 * | nbAdditionalBits, | ||
unsigned | tableLog, | ||
void * | wksp, | ||
size_t | wkspSize | ||
) |
Definition at line 485 of file zstd_decompress_block.c.
ZSTD_ALLOW_POINTER_OVERFLOW_ATTR void ZSTD_checkContinuity | ( | ZSTD_DCtx * | dctx, |
const void * | dst, | ||
size_t | dstSize | ||
) |
ZSTD_checkContinuity() : check if next dst
follows previous position, where decompression ended. If yes, do nothing (continue on current segment). If not, classify previous segment as "external dictionary", and start a new segment. This function cannot fail.
Definition at line 2184 of file zstd_decompress_block.c.
size_t ZSTD_decodeLiteralsBlock_wrapper | ( | ZSTD_DCtx * | dctx, |
const void * | src, | ||
size_t | srcSize, | ||
void * | dst, | ||
size_t | dstCapacity | ||
) |
Definition at line 346 of file zstd_decompress_block.c.
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.
FORCE_INLINE_TEMPLATE seq_t ZSTD_decodeSequence | ( | seqState_t * | seqState, |
const ZSTD_longOffset_e | longOffsets, | ||
const int | isLastSeq | ||
) |
ZSTD_decodeSequence(): longOffsets
: tells the decoder to reload more bit while decoding large offsets only used in 32-bit mode
Definition at line 1229 of file zstd_decompress_block.c.
size_t ZSTD_decompressBlock | ( | ZSTD_DCtx * | dctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
Definition at line 2210 of file zstd_decompress_block.c.
size_t ZSTD_decompressBlock_deprecated | ( | ZSTD_DCtx * | dctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize | ||
) |
Definition at line 2195 of file zstd_decompress_block.c.
size_t ZSTD_decompressBlock_internal | ( | ZSTD_DCtx * | dctx, |
void * | dst, | ||
size_t | dstCapacity, | ||
const void * | src, | ||
size_t | srcSize, | ||
const streaming_operation | streaming | ||
) |
Definition at line 2072 of file zstd_decompress_block.c.
FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE ZSTD_decompressSequences_body | ( | ZSTD_DCtx * | dctx, |
void * | dst, | ||
size_t | maxDstSize, | ||
const void * | seqStart, | ||
size_t | seqSize, | ||
int | nbSeq, | ||
const ZSTD_longOffset_e | isLongOffset | ||
) |
Definition at line 1615 of file zstd_decompress_block.c.
FORCE_INLINE_TEMPLATE size_t DONT_VECTORIZE ZSTD_decompressSequences_bodySplitLitBuffer | ( | ZSTD_DCtx * | dctx, |
void * | dst, | ||
size_t | maxDstSize, | ||
const void * | seqStart, | ||
size_t | seqSize, | ||
int | nbSeq, | ||
const ZSTD_longOffset_e | isLongOffset | ||
) |
Definition at line 1403 of file zstd_decompress_block.c.
FORCE_INLINE_TEMPLATE size_t ZSTD_decompressSequencesLong_body | ( | ZSTD_DCtx * | dctx, |
void * | dst, | ||
size_t | maxDstSize, | ||
const void * | seqStart, | ||
size_t | seqSize, | ||
int | nbSeq, | ||
const ZSTD_longOffset_e | isLongOffset | ||
) |
Definition at line 1733 of file zstd_decompress_block.c.
HINT_INLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t ZSTD_execSequence | ( | BYTE * | op, |
BYTE *const | oend, | ||
seq_t | sequence, | ||
const BYTE ** | litPtr, | ||
const BYTE *const | litLimit, | ||
const BYTE *const | prefixStart, | ||
const BYTE *const | virtualStart, | ||
const BYTE *const | dictEnd | ||
) |
Definition at line 1001 of file zstd_decompress_block.c.
FORCE_NOINLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t ZSTD_execSequenceEnd | ( | BYTE * | op, |
BYTE *const | oend, | ||
seq_t | sequence, | ||
const BYTE ** | litPtr, | ||
const BYTE *const | litLimit, | ||
const BYTE *const | prefixStart, | ||
const BYTE *const | virtualStart, | ||
const BYTE *const | dictEnd | ||
) |
Definition at line 907 of file zstd_decompress_block.c.
FORCE_NOINLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t ZSTD_execSequenceEndSplitLitBuffer | ( | BYTE * | op, |
BYTE *const | oend, | ||
const BYTE *const | oend_w, | ||
seq_t | sequence, | ||
const BYTE ** | litPtr, | ||
const BYTE *const | litLimit, | ||
const BYTE *const | prefixStart, | ||
const BYTE *const | virtualStart, | ||
const BYTE *const | dictEnd | ||
) |
Definition at line 955 of file zstd_decompress_block.c.
HINT_INLINE ZSTD_ALLOW_POINTER_OVERFLOW_ATTR size_t ZSTD_execSequenceSplitLitBuffer | ( | BYTE * | op, |
BYTE *const | oend, | ||
const BYTE *const | oend_w, | ||
seq_t | sequence, | ||
const BYTE ** | litPtr, | ||
const BYTE *const | litLimit, | ||
const BYTE *const | prefixStart, | ||
const BYTE *const | virtualStart, | ||
const BYTE *const | dictEnd | ||
) |
Definition at line 1100 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.
HINT_INLINE void ZSTD_overlapCopy8 | ( | BYTE ** | op, |
BYTE const ** | ip, | ||
size_t | offset | ||
) |
ZSTD_overlapCopy8() : Copies 8 bytes from ip to op and updates op and ip where ip <= op. If the offset is < 8 then the offset is spread to at least 8 bytes.
Precondition: *ip <= *op Postcondition: *op - *op >= 8
Definition at line 804 of file zstd_decompress_block.c.
FORCE_INLINE_TEMPLATE size_t ZSTD_prefetchMatch | ( | size_t | prefetchPos, |
seq_t const | sequence, | ||
const BYTE *const | prefixStart, | ||
const BYTE *const | dictEnd | ||
) |
Definition at line 1715 of file zstd_decompress_block.c.
FORCE_INLINE_TEMPLATE void ZSTD_updateFseStateWithDInfo | ( | ZSTD_fseState * | DStatePtr, |
BIT_DStream_t * | bitD, | ||
U16 | nextState, | ||
U32 | nbBits | ||
) |
Definition at line 1204 of file zstd_decompress_block.c.