Path: blob/master/Utilities/cmzstd/lib/decompress/zstd_decompress_block.h
3158 views
/*1* Copyright (c) Meta Platforms, Inc. and affiliates.2* All rights reserved.3*4* This source code is licensed under both the BSD-style license (found in the5* LICENSE file in the root directory of this source tree) and the GPLv2 (found6* in the COPYING file in the root directory of this source tree).7* You may select, at your option, one of the above-listed licenses.8*/91011#ifndef ZSTD_DEC_BLOCK_H12#define ZSTD_DEC_BLOCK_H1314/*-*******************************************************15* Dependencies16*********************************************************/17#include "../common/zstd_deps.h" /* size_t */18#include "../zstd.h" /* DCtx, and some public functions */19#include "../common/zstd_internal.h" /* blockProperties_t, and some public functions */20#include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */212223/* === Prototypes === */2425/* note: prototypes already published within `zstd.h` :26* ZSTD_decompressBlock()27*/2829/* note: prototypes already published within `zstd_internal.h` :30* ZSTD_getcBlockSize()31* ZSTD_decodeSeqHeaders()32*/333435/* Streaming state is used to inform allocation of the literal buffer */36typedef enum {37not_streaming = 0,38is_streaming = 139} streaming_operation;4041/* ZSTD_decompressBlock_internal() :42* decompress block, starting at `src`,43* into destination buffer `dst`.44* @return : decompressed block size,45* or an error code (which can be tested using ZSTD_isError())46*/47size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,48void* dst, size_t dstCapacity,49const void* src, size_t srcSize, const int frame, const streaming_operation streaming);5051/* ZSTD_buildFSETable() :52* generate FSE decoding table for one symbol (ll, ml or off)53* this function must be called with valid parameters only54* (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.)55* in which case it cannot fail.56* The workspace must be 4-byte aligned and at least ZSTD_BUILD_FSE_TABLE_WKSP_SIZE bytes, which is57* defined in zstd_decompress_internal.h.58* Internal use only.59*/60void ZSTD_buildFSETable(ZSTD_seqSymbol* dt,61const short* normalizedCounter, unsigned maxSymbolValue,62const U32* baseValue, const U8* nbAdditionalBits,63unsigned tableLog, void* wksp, size_t wkspSize,64int bmi2);6566/* Internal definition of ZSTD_decompressBlock() to avoid deprecation warnings. */67size_t ZSTD_decompressBlock_deprecated(ZSTD_DCtx* dctx,68void* dst, size_t dstCapacity,69const void* src, size_t srcSize);707172#endif /* ZSTD_DEC_BLOCK_H */737475