1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file easy_common.c
4 /// \brief Shared stuff for easy encoder initialization functions
6 // Copyright (C) 2008 Lasse Collin
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
18 ///////////////////////////////////////////////////////////////////////////////
20 #include "easy_common.h"
24 lzma_easy_set_filters(lzma_options_filter *filters, uint32_t level)
29 filters[0].id = LZMA_VLI_VALUE_UNKNOWN;
31 #ifdef HAVE_FILTER_LZMA
32 } else if (level <= 9) {
33 filters[0].id = LZMA_FILTER_LZMA;
34 filters[0].options = (void *)(&lzma_preset_lzma[level - 1]);
35 filters[1].id = LZMA_VLI_VALUE_UNKNOWN;
46 extern LZMA_API uint32_t
47 lzma_easy_memory_usage(lzma_easy_level level)
49 lzma_options_filter filters[8];
50 if (lzma_easy_set_filters(filters, level))
53 return lzma_memory_usage(filters, true);