| 1 | // SPDX-License-Identifier: 0BSD |
| 2 | |
| 3 | /////////////////////////////////////////////////////////////////////////////// |
| 4 | // |
| 5 | /// \file easy_encoder_memusage.c |
| 6 | /// \brief Easy .xz Stream encoder memory usage calculation |
| 7 | // |
| 8 | // Author: Lasse Collin |
| 9 | // |
| 10 | /////////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #include "easy_preset.h" |
| 13 | |
| 14 | |
| 15 | extern LZMA_API(uint64_t) |
| 16 | lzma_easy_encoder_memusage(uint32_t preset) |
| 17 | { |
| 18 | lzma_options_easy opt_easy; |
| 19 | if (lzma_easy_preset(&opt_easy, preset)) |
| 20 | return UINT32_MAX; |
| 21 | |
| 22 | return lzma_raw_encoder_memusage(opt_easy.filters); |
| 23 | } |