zstd_opt.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #include "zstd_compress_internal.h"
  13. #if !defined(ZSTD_EXCLUDE_BTLAZY2_BLOCK_COMPRESSOR) \
  14. || !defined(ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR) \
  15. || !defined(ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR)
  16. /* used in ZSTD_loadDictionaryContent() */
  17. void ZSTD_updateTree(ZSTD_MatchState_t* ms, const BYTE* ip, const BYTE* iend);
  18. #endif
  19. #ifndef ZSTD_EXCLUDE_BTOPT_BLOCK_COMPRESSOR
  20. size_t ZSTD_compressBlock_btopt(
  21. ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  22. void const* src, size_t srcSize);
  23. size_t ZSTD_compressBlock_btopt_dictMatchState(
  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_extDict(
  27. ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  28. void const* src, size_t srcSize);
  29. #define ZSTD_COMPRESSBLOCK_BTOPT ZSTD_compressBlock_btopt
  30. #define ZSTD_COMPRESSBLOCK_BTOPT_DICTMATCHSTATE ZSTD_compressBlock_btopt_dictMatchState
  31. #define ZSTD_COMPRESSBLOCK_BTOPT_EXTDICT ZSTD_compressBlock_btopt_extDict
  32. #else
  33. #define ZSTD_COMPRESSBLOCK_BTOPT NULL
  34. #define ZSTD_COMPRESSBLOCK_BTOPT_DICTMATCHSTATE NULL
  35. #define ZSTD_COMPRESSBLOCK_BTOPT_EXTDICT NULL
  36. #endif
  37. #ifndef ZSTD_EXCLUDE_BTULTRA_BLOCK_COMPRESSOR
  38. size_t ZSTD_compressBlock_btultra(
  39. ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  40. void const* src, size_t srcSize);
  41. size_t ZSTD_compressBlock_btultra_dictMatchState(
  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_extDict(
  45. ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  46. void const* src, size_t srcSize);
  47. /* note : no btultra2 variant for extDict nor dictMatchState,
  48. * because btultra2 is not meant to work with dictionaries
  49. * and is only specific for the first block (no prefix) */
  50. size_t ZSTD_compressBlock_btultra2(
  51. ZSTD_MatchState_t* ms, SeqStore_t* seqStore, U32 rep[ZSTD_REP_NUM],
  52. void const* src, size_t srcSize);
  53. #define ZSTD_COMPRESSBLOCK_BTULTRA ZSTD_compressBlock_btultra
  54. #define ZSTD_COMPRESSBLOCK_BTULTRA_DICTMATCHSTATE ZSTD_compressBlock_btultra_dictMatchState
  55. #define ZSTD_COMPRESSBLOCK_BTULTRA_EXTDICT ZSTD_compressBlock_btultra_extDict
  56. #define ZSTD_COMPRESSBLOCK_BTULTRA2 ZSTD_compressBlock_btultra2
  57. #else
  58. #define ZSTD_COMPRESSBLOCK_BTULTRA NULL
  59. #define ZSTD_COMPRESSBLOCK_BTULTRA_DICTMATCHSTATE NULL
  60. #define ZSTD_COMPRESSBLOCK_BTULTRA_EXTDICT NULL
  61. #define ZSTD_COMPRESSBLOCK_BTULTRA2 NULL
  62. #endif
  63. #endif /* ZSTD_OPT_H */