1 /* ****************************************************************** 2 * huff0 huffman codec, 3 * part of Finite State Entropy library 4 * Copyright (c) Yann Collet, Facebook, Inc. 5 * 6 * You can contact the author at : 7 * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy 8 * 9 * This source code is licensed under both the BSD-style license (found in the 10 * LICENSE file in the root directory of this source tree) and the GPLv2 (found 11 * in the COPYING file in the root directory of this source tree). 12 * You may select, at your option, one of the above-listed licenses. 13 ****************************************************************** */ 14 15 #ifndef HUF_H_298734234 16 #define HUF_H_298734234 17 18 /* *** Dependencies *** */ 19 #include "zstd_deps.h" /* size_t */ 20 21 /* *** library symbols visibility *** */ 22 /* Note : when linking with -fvisibility=hidden on gcc, or by default on Visual, 23 * HUF symbols remain "private" (internal symbols for library only). 24 * Set macro FSE_DLL_EXPORT to 1 if you want HUF symbols visible on DLL interface */ 25 #if defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) && defined(__GNUC__) && (__GNUC__ >= 4) 26 # define HUF_PUBLIC_API __attribute__ ((visibility ("default"))) 27 #elif defined(FSE_DLL_EXPORT) && (FSE_DLL_EXPORT==1) /* Visual expected */ 28 # define HUF_PUBLIC_API __declspec(dllexport) 29 #elif defined(FSE_DLL_IMPORT) && (FSE_DLL_IMPORT==1) 30 # define HUF_PUBLIC_API __declspec(dllimport) /* not required, just to generate faster code (saves a function pointer load from IAT and an indirect jump) */ 31 #else 32 # define HUF_PUBLIC_API 33 #endif 34 35 /* ========================== */ 36 /* *** simple functions *** */ 37 /* ========================== */ 38 39 /* HUF_compress() : 40 * Compress content from buffer 'src', of size 'srcSize', into buffer 'dst'. 41 * 'dst' buffer must be already allocated. 42 * Compression runs faster if `dstCapacity` >= HUF_compressBound(srcSize). 43 * `srcSize` must be <= `HUF_BLOCKSIZE_MAX` == 128 KB. 44 * @return : size of compressed data (<= `dstCapacity`). 45 * Special values : if return == 0, srcData is not compressible => Nothing is stored within dst !!! 46 * if HUF_isError(return), compression failed (more details using HUF_getErrorName()) 47 */ 48 HUF_PUBLIC_API size_t HUF_compress(void* dst, size_t dstCapacity, 49 const void* src, size_t srcSize); 50 51 /* HUF_decompress() : 52 * Decompress HUF data from buffer 'cSrc', of size 'cSrcSize', 53 * into already allocated buffer 'dst', of minimum size 'dstSize'. 54 * `originalSize` : **must** be the ***exact*** size of original (uncompressed) data. 55 * Note : in contrast with FSE, HUF_decompress can regenerate 56 * RLE (cSrcSize==1) and uncompressed (cSrcSize==dstSize) data, 57 * because it knows size to regenerate (originalSize). 58 * @return : size of regenerated data (== originalSize), 59 * or an error code, which can be tested using HUF_isError() 60 */ 61 HUF_PUBLIC_API size_t HUF_decompress(void* dst, size_t originalSize, 62 const void* cSrc, size_t cSrcSize); 63 64 /* *** Tool functions *** */ 65 #define HUF_BLOCKSIZE_MAX (128 * 1024) /*< maximum input size for a single block compressed with HUF_compress */ 66 HUF_PUBLIC_API size_t HUF_compressBound(size_t size); /*< maximum compressed size (worst case) */ 67 68 /* Error Management */ 69 HUF_PUBLIC_API unsigned HUF_isError(size_t code); /*< tells if a return value is an error code */ 70 HUF_PUBLIC_API const char* HUF_getErrorName(size_t code); /*< provides error code string (useful for debugging) */ 71 72 /* *** Advanced function *** */ 73 74 /* HUF_compress2() : 75 * Same as HUF_compress(), but offers control over `maxSymbolValue` and `tableLog`. 76 * `maxSymbolValue` must be <= HUF_SYMBOLVALUE_MAX . 77 * `tableLog` must be `<= HUF_TABLELOG_MAX` . */ 78 HUF_PUBLIC_API size_t HUF_compress2 (void* dst, size_t dstCapacity, 79 const void* src, size_t srcSize, 80 unsigned maxSymbolValue, unsigned tableLog); 81 82 /* HUF_compress4X_wksp() : 83 * Same as HUF_compress2(), but uses externally allocated `workSpace`. 84 * `workspace` must be at least as large as HUF_WORKSPACE_SIZE */ 85 #define HUF_WORKSPACE_SIZE ((8 << 10) + 512 /* sorting scratch space */) 86 #define HUF_WORKSPACE_SIZE_U64 (HUF_WORKSPACE_SIZE / sizeof(U64)) 87 HUF_PUBLIC_API size_t HUF_compress4X_wksp (void* dst, size_t dstCapacity, 88 const void* src, size_t srcSize, 89 unsigned maxSymbolValue, unsigned tableLog, 90 void* workSpace, size_t wkspSize); 91 92 #endif /* HUF_H_298734234 */ 93 94 /* ****************************************************************** 95 * WARNING !! 96 * The following section contains advanced and experimental definitions 97 * which shall never be used in the context of a dynamic library, 98 * because they are not guaranteed to remain stable in the future. 99 * Only consider them in association with static linking. 100 * *****************************************************************/ 101 #if !defined(HUF_H_HUF_STATIC_LINKING_ONLY) 102 #define HUF_H_HUF_STATIC_LINKING_ONLY 103 104 /* *** Dependencies *** */ 105 #include "mem.h" /* U32 */ 106 #define FSE_STATIC_LINKING_ONLY 107 #include "fse.h" 108 109 /* *** Constants *** */ 110 #define HUF_TABLELOG_MAX 12 /* max runtime value of tableLog (due to static allocation); can be modified up to HUF_TABLELOG_ABSOLUTEMAX */ 111 #define HUF_TABLELOG_DEFAULT 11 /* default tableLog value when none specified */ 112 #define HUF_SYMBOLVALUE_MAX 255 113 114 #define HUF_TABLELOG_ABSOLUTEMAX 12 /* absolute limit of HUF_MAX_TABLELOG. Beyond that value, code does not work */ 115 #if (HUF_TABLELOG_MAX > HUF_TABLELOG_ABSOLUTEMAX) 116 # error "HUF_TABLELOG_MAX is too large !" 117 #endif 118 119 /* **************************************** 120 * Static allocation 121 ******************************************/ 122 /* HUF buffer bounds */ 123 #define HUF_CTABLEBOUND 129 124 #define HUF_BLOCKBOUND(size) (size + (size>>8) + 8) /* only true when incompressible is pre-filtered with fast heuristic */ 125 #define HUF_COMPRESSBOUND(size) (HUF_CTABLEBOUND + HUF_BLOCKBOUND(size)) /* Macro version, useful for static allocation */ 126 127 /* static allocation of HUF's Compression Table */ 128 /* this is a private definition, just exposed for allocation and strict aliasing purpose. never EVER access its members directly */ 129 typedef size_t HUF_CElt; /* consider it an incomplete type */ 130 #define HUF_CTABLE_SIZE_ST(maxSymbolValue) ((maxSymbolValue)+2) /* Use tables of size_t, for proper alignment */ 131 #define HUF_CTABLE_SIZE(maxSymbolValue) (HUF_CTABLE_SIZE_ST(maxSymbolValue) * sizeof(size_t)) 132 #define HUF_CREATE_STATIC_CTABLE(name, maxSymbolValue) \ 133 HUF_CElt name[HUF_CTABLE_SIZE_ST(maxSymbolValue)] /* no final ; */ 134 135 /* static allocation of HUF's DTable */ 136 typedef U32 HUF_DTable; 137 #define HUF_DTABLE_SIZE(maxTableLog) (1 + (1<<(maxTableLog))) 138 #define HUF_CREATE_STATIC_DTABLEX1(DTable, maxTableLog) \ 139 HUF_DTable DTable[HUF_DTABLE_SIZE((maxTableLog)-1)] = { ((U32)((maxTableLog)-1) * 0x01000001) } 140 #define HUF_CREATE_STATIC_DTABLEX2(DTable, maxTableLog) \ 141 HUF_DTable DTable[HUF_DTABLE_SIZE(maxTableLog)] = { ((U32)(maxTableLog) * 0x01000001) } 142 143 /* **************************************** 144 * Advanced decompression functions 145 ******************************************/ 146 size_t HUF_decompress4X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< single-symbol decoder */ 147 #ifndef HUF_FORCE_DECOMPRESS_X1 148 size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< double-symbols decoder */ 149 #endif 150 151 size_t HUF_decompress4X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< decodes RLE and uncompressed */ 152 size_t HUF_decompress4X_hufOnly(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< considers RLE and uncompressed as errors */ 153 size_t HUF_decompress4X_hufOnly_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /*< considers RLE and uncompressed as errors */ 154 size_t HUF_decompress4X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< single-symbol decoder */ 155 size_t HUF_decompress4X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /*< single-symbol decoder */ 156 #ifndef HUF_FORCE_DECOMPRESS_X1 157 size_t HUF_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< double-symbols decoder */ 158 size_t HUF_decompress4X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /*< double-symbols decoder */ 159 #endif 160 161 /* **************************************** 162 * HUF detailed API 163 * ****************************************/ 164 165 /*! HUF_compress() does the following: 166 * 1. count symbol occurrence from source[] into table count[] using FSE_count() (exposed within "fse.h") 167 * 2. (optional) refine tableLog using HUF_optimalTableLog() 168 * 3. build Huffman table from count using HUF_buildCTable() 169 * 4. save Huffman table to memory buffer using HUF_writeCTable() 170 * 5. encode the data stream using HUF_compress4X_usingCTable() 171 * 172 * The following API allows targeting specific sub-functions for advanced tasks. 173 * For example, it's possible to compress several blocks using the same 'CTable', 174 * or to save and regenerate 'CTable' using external methods. 175 */ 176 unsigned HUF_optimalTableLog(unsigned maxTableLog, size_t srcSize, unsigned maxSymbolValue); 177 size_t HUF_buildCTable (HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue, unsigned maxNbBits); /* @return : maxNbBits; CTable and count can overlap. In which case, CTable will overwrite count content */ 178 size_t HUF_writeCTable (void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog); 179 size_t HUF_writeCTable_wksp(void* dst, size_t maxDstSize, const HUF_CElt* CTable, unsigned maxSymbolValue, unsigned huffLog, void* workspace, size_t workspaceSize); 180 size_t HUF_compress4X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable); 181 size_t HUF_compress4X_usingCTable_bmi2(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int bmi2); 182 size_t HUF_estimateCompressedSize(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); 183 int HUF_validateCTable(const HUF_CElt* CTable, const unsigned* count, unsigned maxSymbolValue); 184 185 typedef enum { 186 HUF_repeat_none, /*< Cannot use the previous table */ 187 HUF_repeat_check, /*< Can use the previous table but it must be checked. Note : The previous table must have been constructed by HUF_compress{1, 4}X_repeat */ 188 HUF_repeat_valid /*< Can use the previous table and it is assumed to be valid */ 189 } HUF_repeat; 190 /* HUF_compress4X_repeat() : 191 * Same as HUF_compress4X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. 192 * If it uses hufTable it does not modify hufTable or repeat. 193 * If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. 194 * If preferRepeat then the old table will always be used if valid. 195 * If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */ 196 size_t HUF_compress4X_repeat(void* dst, size_t dstSize, 197 const void* src, size_t srcSize, 198 unsigned maxSymbolValue, unsigned tableLog, 199 void* workSpace, size_t wkspSize, /*< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */ 200 HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2, unsigned suspectUncompressible); 201 202 /* HUF_buildCTable_wksp() : 203 * Same as HUF_buildCTable(), but using externally allocated scratch buffer. 204 * `workSpace` must be aligned on 4-bytes boundaries, and its size must be >= HUF_CTABLE_WORKSPACE_SIZE. 205 */ 206 #define HUF_CTABLE_WORKSPACE_SIZE_U32 (2*HUF_SYMBOLVALUE_MAX +1 +1) 207 #define HUF_CTABLE_WORKSPACE_SIZE (HUF_CTABLE_WORKSPACE_SIZE_U32 * sizeof(unsigned)) 208 size_t HUF_buildCTable_wksp (HUF_CElt* tree, 209 const unsigned* count, U32 maxSymbolValue, U32 maxNbBits, 210 void* workSpace, size_t wkspSize); 211 212 /*! HUF_readStats() : 213 * Read compact Huffman tree, saved by HUF_writeCTable(). 214 * `huffWeight` is destination buffer. 215 * @return : size read from `src` , or an error Code . 216 * Note : Needed by HUF_readCTable() and HUF_readDTableXn() . */ 217 size_t HUF_readStats(BYTE* huffWeight, size_t hwSize, 218 U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, 219 const void* src, size_t srcSize); 220 221 /*! HUF_readStats_wksp() : 222 * Same as HUF_readStats() but takes an external workspace which must be 223 * 4-byte aligned and its size must be >= HUF_READ_STATS_WORKSPACE_SIZE. 224 * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0. 225 */ 226 #define HUF_READ_STATS_WORKSPACE_SIZE_U32 FSE_DECOMPRESS_WKSP_SIZE_U32(6, HUF_TABLELOG_MAX-1) 227 #define HUF_READ_STATS_WORKSPACE_SIZE (HUF_READ_STATS_WORKSPACE_SIZE_U32 * sizeof(unsigned)) 228 size_t HUF_readStats_wksp(BYTE* huffWeight, size_t hwSize, 229 U32* rankStats, U32* nbSymbolsPtr, U32* tableLogPtr, 230 const void* src, size_t srcSize, 231 void* workspace, size_t wkspSize, 232 int bmi2); 233 234 /* HUF_readCTable() : 235 * Loading a CTable saved with HUF_writeCTable() */ 236 size_t HUF_readCTable (HUF_CElt* CTable, unsigned* maxSymbolValuePtr, const void* src, size_t srcSize, unsigned *hasZeroWeights); 237 238 /* HUF_getNbBitsFromCTable() : 239 * Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX 240 * Note 1 : is not inlined, as HUF_CElt definition is private */ 241 U32 HUF_getNbBitsFromCTable(const HUF_CElt* symbolTable, U32 symbolValue); 242 243 /* 244 * HUF_decompress() does the following: 245 * 1. select the decompression algorithm (X1, X2) based on pre-computed heuristics 246 * 2. build Huffman table from save, using HUF_readDTableX?() 247 * 3. decode 1 or 4 segments in parallel using HUF_decompress?X?_usingDTable() 248 */ 249 250 /* HUF_selectDecoder() : 251 * Tells which decoder is likely to decode faster, 252 * based on a set of pre-computed metrics. 253 * @return : 0==HUF_decompress4X1, 1==HUF_decompress4X2 . 254 * Assumption : 0 < dstSize <= 128 KB */ 255 U32 HUF_selectDecoder (size_t dstSize, size_t cSrcSize); 256 257 /* 258 * The minimum workspace size for the `workSpace` used in 259 * HUF_readDTableX1_wksp() and HUF_readDTableX2_wksp(). 260 * 261 * The space used depends on HUF_TABLELOG_MAX, ranging from ~1500 bytes when 262 * HUF_TABLE_LOG_MAX=12 to ~1850 bytes when HUF_TABLE_LOG_MAX=15. 263 * Buffer overflow errors may potentially occur if code modifications result in 264 * a required workspace size greater than that specified in the following 265 * macro. 266 */ 267 #define HUF_DECOMPRESS_WORKSPACE_SIZE ((2 << 10) + (1 << 9)) 268 #define HUF_DECOMPRESS_WORKSPACE_SIZE_U32 (HUF_DECOMPRESS_WORKSPACE_SIZE / sizeof(U32)) 269 270 #ifndef HUF_FORCE_DECOMPRESS_X2 271 size_t HUF_readDTableX1 (HUF_DTable* DTable, const void* src, size_t srcSize); 272 size_t HUF_readDTableX1_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize); 273 #endif 274 #ifndef HUF_FORCE_DECOMPRESS_X1 275 size_t HUF_readDTableX2 (HUF_DTable* DTable, const void* src, size_t srcSize); 276 size_t HUF_readDTableX2_wksp (HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize); 277 #endif 278 279 size_t HUF_decompress4X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); 280 #ifndef HUF_FORCE_DECOMPRESS_X2 281 size_t HUF_decompress4X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); 282 #endif 283 #ifndef HUF_FORCE_DECOMPRESS_X1 284 size_t HUF_decompress4X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); 285 #endif 286 287 /* ====================== */ 288 /* single stream variants */ 289 /* ====================== */ 290 291 size_t HUF_compress1X (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog); 292 size_t HUF_compress1X_wksp (void* dst, size_t dstSize, const void* src, size_t srcSize, unsigned maxSymbolValue, unsigned tableLog, void* workSpace, size_t wkspSize); /*< `workSpace` must be a table of at least HUF_WORKSPACE_SIZE_U64 U64 */ 293 size_t HUF_compress1X_usingCTable(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable); 294 size_t HUF_compress1X_usingCTable_bmi2(void* dst, size_t dstSize, const void* src, size_t srcSize, const HUF_CElt* CTable, int bmi2); 295 /* HUF_compress1X_repeat() : 296 * Same as HUF_compress1X_wksp(), but considers using hufTable if *repeat != HUF_repeat_none. 297 * If it uses hufTable it does not modify hufTable or repeat. 298 * If it doesn't, it sets *repeat = HUF_repeat_none, and it sets hufTable to the table used. 299 * If preferRepeat then the old table will always be used if valid. 300 * If suspectUncompressible then some sampling checks will be run to potentially skip huffman coding */ 301 size_t HUF_compress1X_repeat(void* dst, size_t dstSize, 302 const void* src, size_t srcSize, 303 unsigned maxSymbolValue, unsigned tableLog, 304 void* workSpace, size_t wkspSize, /*< `workSpace` must be aligned on 4-bytes boundaries, `wkspSize` must be >= HUF_WORKSPACE_SIZE */ 305 HUF_CElt* hufTable, HUF_repeat* repeat, int preferRepeat, int bmi2, unsigned suspectUncompressible); 306 307 size_t HUF_decompress1X1 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* single-symbol decoder */ 308 #ifndef HUF_FORCE_DECOMPRESS_X1 309 size_t HUF_decompress1X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* double-symbol decoder */ 310 #endif 311 312 size_t HUF_decompress1X_DCtx (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); 313 size_t HUF_decompress1X_DCtx_wksp (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); 314 #ifndef HUF_FORCE_DECOMPRESS_X2 315 size_t HUF_decompress1X1_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< single-symbol decoder */ 316 size_t HUF_decompress1X1_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /*< single-symbol decoder */ 317 #endif 318 #ifndef HUF_FORCE_DECOMPRESS_X1 319 size_t HUF_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /*< double-symbols decoder */ 320 size_t HUF_decompress1X2_DCtx_wksp(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize); /*< double-symbols decoder */ 321 #endif 322 323 size_t HUF_decompress1X_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); /*< automatic selection of sing or double symbol decoder, based on DTable */ 324 #ifndef HUF_FORCE_DECOMPRESS_X2 325 size_t HUF_decompress1X1_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); 326 #endif 327 #ifndef HUF_FORCE_DECOMPRESS_X1 328 size_t HUF_decompress1X2_usingDTable(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable); 329 #endif 330 331 /* BMI2 variants. 332 * If the CPU has BMI2 support, pass bmi2=1, otherwise pass bmi2=0. 333 */ 334 size_t HUF_decompress1X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2); 335 #ifndef HUF_FORCE_DECOMPRESS_X2 336 size_t HUF_decompress1X1_DCtx_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2); 337 #endif 338 size_t HUF_decompress4X_usingDTable_bmi2(void* dst, size_t maxDstSize, const void* cSrc, size_t cSrcSize, const HUF_DTable* DTable, int bmi2); 339 size_t HUF_decompress4X_hufOnly_wksp_bmi2(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize, void* workSpace, size_t wkspSize, int bmi2); 340 #ifndef HUF_FORCE_DECOMPRESS_X2 341 size_t HUF_readDTableX1_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2); 342 #endif 343 #ifndef HUF_FORCE_DECOMPRESS_X1 344 size_t HUF_readDTableX2_wksp_bmi2(HUF_DTable* DTable, const void* src, size_t srcSize, void* workSpace, size_t wkspSize, int bmi2); 345 #endif 346 347 #endif /* HUF_STATIC_LINKING_ONLY */ 348 349