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_decompress_block.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_DEC_BLOCK_H
  11. #define ZSTD_DEC_BLOCK_H
  12. /*-*******************************************************
  13. * Dependencies
  14. *********************************************************/
  15. #include "zstd_deps.h" /* size_t */
  16. #include "zstd.h" /* DCtx, and some public functions */
  17. #include "zstd_internal.h" /* blockProperties_t, and some public functions */
  18. #include "zstd_decompress_internal.h" /* ZSTD_seqSymbol */
  19. /* === Prototypes === */
  20. /* note: prototypes already published within `zstd.h` :
  21. * ZSTD_decompressBlock()
  22. */
  23. /* note: prototypes already published within `zstd_internal.h` :
  24. * ZSTD_getcBlockSize()
  25. * ZSTD_decodeSeqHeaders()
  26. */
  27. /* Streaming state is used to inform allocation of the literal buffer */
  28. typedef enum {
  29. not_streaming = 0,
  30. is_streaming = 1
  31. } streaming_operation;
  32. /* ZSTD_decompressBlock_internal() :
  33. * decompress block, starting at `src`,
  34. * into destination buffer `dst`.
  35. * @return : decompressed block size,
  36. * or an error code (which can be tested using ZSTD_isError())
  37. */
  38. size_t ZSTD_decompressBlock_internal(ZSTD_DCtx* dctx,
  39. void* dst, size_t dstCapacity,
  40. const void* src, size_t srcSize, const int frame, const streaming_operation streaming);
  41. /* ZSTD_buildFSETable() :
  42. * generate FSE decoding table for one symbol (ll, ml or off)
  43. * this function must be called with valid parameters only
  44. * (dt is large enough, normalizedCounter distribution total is a power of 2, max is within range, etc.)
  45. * in which case it cannot fail.
  46. * The workspace must be 4-byte aligned and at least ZSTD_BUILD_FSE_TABLE_WKSP_SIZE bytes, which is
  47. * defined in zstd_decompress_internal.h.
  48. * Internal use only.
  49. */
  50. void ZSTD_buildFSETable(ZSTD_seqSymbol* dt,
  51. const short* normalizedCounter, unsigned maxSymbolValue,
  52. const U32* baseValue, const U8* nbAdditionalBits,
  53. unsigned tableLog, void* wksp, size_t wkspSize,
  54. int bmi2);
  55. #endif /* ZSTD_DEC_BLOCK_H */