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