huf.h 20 KB

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