easy_encoder_memusage.c 654 B

12345678910111213141516171819202122232425
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file easy_encoder_memusage.c
  4. /// \brief Easy .xz Stream encoder memory usage calculation
  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. #include "easy_preset.h"
  13. extern LZMA_API(uint64_t)
  14. lzma_easy_encoder_memusage(uint32_t preset)
  15. {
  16. lzma_options_easy opt_easy;
  17. if (lzma_easy_preset(&opt_easy, preset))
  18. return UINT32_MAX;
  19. return lzma_raw_encoder_memusage(opt_easy.filters);
  20. }