You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zstd_compress_sequences.h 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_COMPRESS_SEQUENCES_H
  11. #define ZSTD_COMPRESS_SEQUENCES_H
  12. #include "fse.h" /* FSE_repeat, FSE_CTable */
  13. #include "zstd_internal.h" /* symbolEncodingType_e, ZSTD_strategy */
  14. typedef enum {
  15. ZSTD_defaultDisallowed = 0,
  16. ZSTD_defaultAllowed = 1
  17. } ZSTD_defaultPolicy_e;
  18. symbolEncodingType_e
  19. ZSTD_selectEncodingType(
  20. FSE_repeat* repeatMode, unsigned const* count, unsigned const max,
  21. size_t const mostFrequent, size_t nbSeq, unsigned const FSELog,
  22. FSE_CTable const* prevCTable,
  23. short const* defaultNorm, U32 defaultNormLog,
  24. ZSTD_defaultPolicy_e const isDefaultAllowed,
  25. ZSTD_strategy const strategy);
  26. size_t
  27. ZSTD_buildCTable(void* dst, size_t dstCapacity,
  28. FSE_CTable* nextCTable, U32 FSELog, symbolEncodingType_e type,
  29. unsigned* count, U32 max,
  30. const BYTE* codeTable, size_t nbSeq,
  31. const S16* defaultNorm, U32 defaultNormLog, U32 defaultMax,
  32. const FSE_CTable* prevCTable, size_t prevCTableSize,
  33. void* entropyWorkspace, size_t entropyWorkspaceSize);
  34. size_t ZSTD_encodeSequences(
  35. void* dst, size_t dstCapacity,
  36. FSE_CTable const* CTable_MatchLength, BYTE const* mlCodeTable,
  37. FSE_CTable const* CTable_OffsetBits, BYTE const* ofCodeTable,
  38. FSE_CTable const* CTable_LitLength, BYTE const* llCodeTable,
  39. seqDef const* sequences, size_t nbSeq, int longOffsets, int bmi2);
  40. size_t ZSTD_fseBitCost(
  41. FSE_CTable const* ctable,
  42. unsigned const* count,
  43. unsigned const max);
  44. size_t ZSTD_crossEntropyCost(short const* norm, unsigned accuracyLog,
  45. unsigned const* count, unsigned const max);
  46. #endif /* ZSTD_COMPRESS_SEQUENCES_H */