1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only 2 /* 3 * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc. 4 * All rights reserved. 5 * 6 * This source code is licensed under both the BSD-style license (found in the 7 * LICENSE file in the root directory of this source tree) and the GPLv2 (found 8 * in the COPYING file in the root directory of this source tree). 9 * You may select, at your option, one of the above-listed licenses. 10 */ 11 12 13 #ifndef ZSTD_DEC_BLOCK_H 14 #define ZSTD_DEC_BLOCK_H 15 16 /*-******************************************************* 17 * Dependencies 18 *********************************************************/ 19 #include <stddef.h> /* size_t */ 20 #include "../zstd.h" /* DCtx, and some public functions */ 21 #include "../common/zstd_internal.h" /* blockProperties_t, and some public functions */ 22 #include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */ 23 24 25 /* === Prototypes === */ 26 27 /* note: prototypes already published within `zstd.h` : 28 * ZSTD_decompressBlock() 29 */ 30 31 /* note: prototypes already published within `zstd_internal.h` : 32 * ZSTD_getcBlockSize() 33 * ZSTD_decodeSeqHeaders() 34 */ 35 36 37 /* ZSTD_decompressBlock_internal() : 38 * decompress block, starting at `src`, 39 * into destination buffer `dst`. 40 * @return : decompressed block size, 41 * or an error code (which can be tested using ZSTD_isError()) 42 */ 43 size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx, 44 void* dst, size_t dstCapacity, 45 const void* src, size_t srcSize, const int frame); 46 47 /* ZSTD_buildFSETable() : 48 * generate FSE decoding table for one symbol (ll, ml or off) 49 * this function must be called with valid parameters only 50 * (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.) 51 * in which case it cannot fail. 52 * Internal use only. 53 */ 54 void ZSTD_buildFSETable(ZSTD_seqSymbol* dt, 55 const short* normalizedCounter, unsigned maxSymbolValue, 56 const U32* baseValue, const U32* nbAdditionalBits, 57 unsigned tableLog); 58 59 60 #endif /* ZSTD_DEC_BLOCK_H */ 61