filter_common.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file filter_common.c
  4. /// \brief Filter-specific stuff common for both encoder and decoder
  5. //
  6. // Author: Lasse Collin
  7. //
  8. // This file has been put into the public domain.
  9. // You can do whatever you want with this file.
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #ifndef LZMA_FILTER_COMMON_H
  13. #define LZMA_FILTER_COMMON_H
  14. #include "common.h"
  15. /// Both lzma_filter_encoder and lzma_filter_decoder begin with these members.
  16. typedef struct {
  17. /// Filter ID
  18. lzma_vli id;
  19. /// Initializes the filter encoder and calls lzma_next_filter_init()
  20. /// for filters + 1.
  21. lzma_init_function init;
  22. /// Calculates memory usage of the encoder. If the options are
  23. /// invalid, UINT64_MAX is returned.
  24. uint64_t (*memusage)(const void *options);
  25. } lzma_filter_coder;
  26. typedef const lzma_filter_coder *(*lzma_filter_find)(lzma_vli id);
  27. extern lzma_ret lzma_raw_coder_init(
  28. lzma_next_coder *next, const lzma_allocator *allocator,
  29. const lzma_filter *filters,
  30. lzma_filter_find coder_find, bool is_encoder);
  31. extern uint64_t lzma_raw_coder_memusage(lzma_filter_find coder_find,
  32. const lzma_filter *filters);
  33. #endif