zstd_opt.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under both the BSD-style license (found in the
  6. * LICENSE file in the root directory of this source tree) and the GPLv2 (found
  7. * in the COPYING file in the root directory of this source tree).
  8. * You may select, at your option, one of the above-listed licenses.
  9. */
  10. #ifndef ZSTD_OPT_H
  11. #define ZSTD_OPT_H
  12. #if defined (__cplusplus)
  13. extern "C" {
  14. #endif
  15. #include "zstd_compress_internal.h"
  16. #if !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) \
  17. || !defined(ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR) \
  18. || !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR)
  19. /* used in ZSTD_loadDictionaryContent() */
  20. void ZSTD_updateTree(ZSTD_matchState_t* ms, const BYTE* ip, const BYTE* iend);
  21. #endif
  22. #ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR
  23. size_t ZSTD_compressBlock_btopt(
  24. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  25. void const* src, size_t srcSize);
  26. size_t ZSTD_compressBlock_btopt_dictMatchState(
  27. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  28. void const* src, size_t srcSize);
  29. size_t ZSTD_compressBlock_btopt_extDict(
  30. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  31. void const* src, size_t srcSize);
  32. #define ZSTD_COMPRESSBLOCK_BTOPT ZSTD_compressBlock_btopt
  33. #define ZSTD_COMPRESSBLOCK_BTOPT_DICTMATCHSTATE ZSTD_compressBlock_btopt_dictMatchState
  34. #define ZSTD_COMPRESSBLOCK_BTOPT_EXTDICT ZSTD_compressBlock_btopt_extDict
  35. #else
  36. #define ZSTD_COMPRESSBLOCK_BTOPT NULL
  37. #define ZSTD_COMPRESSBLOCK_BTOPT_DICTMATCHSTATE NULL
  38. #define ZSTD_COMPRESSBLOCK_BTOPT_EXTDICT NULL
  39. #endif
  40. #ifndef ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR
  41. size_t ZSTD_compressBlock_btultra(
  42. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  43. void const* src, size_t srcSize);
  44. size_t ZSTD_compressBlock_btultra_dictMatchState(
  45. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  46. void const* src, size_t srcSize);
  47. size_t ZSTD_compressBlock_btultra_extDict(
  48. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  49. void const* src, size_t srcSize);
  50. /* note : no btultra2 variant for extDict nor dictMatchState,
  51. * because btultra2 is not meant to work with dictionaries
  52. * and is only specific for the first block (no prefix) */
  53. size_t ZSTD_compressBlock_btultra2(
  54. ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  55. void const* src, size_t srcSize);
  56. #define ZSTD_COMPRESSBLOCK_BTULTRA ZSTD_compressBlock_btultra
  57. #define ZSTD_COMPRESSBLOCK_BTULTRA_DICTMATCHSTATE ZSTD_compressBlock_btultra_dictMatchState
  58. #define ZSTD_COMPRESSBLOCK_BTULTRA_EXTDICT ZSTD_compressBlock_btultra_extDict
  59. #define ZSTD_COMPRESSBLOCK_BTULTRA2 ZSTD_compressBlock_btultra2
  60. #else
  61. #define ZSTD_COMPRESSBLOCK_BTULTRA NULL
  62. #define ZSTD_COMPRESSBLOCK_BTULTRA_DICTMATCHSTATE NULL
  63. #define ZSTD_COMPRESSBLOCK_BTULTRA_EXTDICT NULL
  64. #define ZSTD_COMPRESSBLOCK_BTULTRA2 NULL
  65. #endif
  66. #if defined (__cplusplus)
  67. }
  68. #endif
  69. #endif /* ZSTD_OPT_H */