1*3b35e7eeSXin LI // SPDX-License-Identifier: 0BSD 2*3b35e7eeSXin LI 381ad8388SMartin Matuska /////////////////////////////////////////////////////////////////////////////// 481ad8388SMartin Matuska // 581ad8388SMartin Matuska /// \file easy_encoder_memusage.c 681ad8388SMartin Matuska /// \brief Easy .xz Stream encoder memory usage calculation 781ad8388SMartin Matuska // 881ad8388SMartin Matuska // Author: Lasse Collin 981ad8388SMartin Matuska // 1081ad8388SMartin Matuska /////////////////////////////////////////////////////////////////////////////// 1181ad8388SMartin Matuska 1281ad8388SMartin Matuska #include "easy_preset.h" 1381ad8388SMartin Matuska 1481ad8388SMartin Matuska 1581ad8388SMartin Matuska extern LZMA_API(uint64_t) 1681ad8388SMartin Matuska lzma_easy_encoder_memusage(uint32_t preset) 1781ad8388SMartin Matuska { 1881ad8388SMartin Matuska lzma_options_easy opt_easy; 1981ad8388SMartin Matuska if (lzma_easy_preset(&opt_easy, preset)) 2081ad8388SMartin Matuska return UINT32_MAX; 2181ad8388SMartin Matuska 2281ad8388SMartin Matuska return lzma_raw_encoder_memusage(opt_easy.filters); 2381ad8388SMartin Matuska } 24