LZMA1 and LZMA2 filters. More...
Data Structures | |
struct | lzma_options_lzma |
Options specific to the LZMA1 and LZMA2 filters. More... | |
Defines | |
#define | LZMA_FILTER_LZMA1 LZMA_VLI_C(0x4000000000000001) |
LZMA1 Filter ID. | |
#define | LZMA_FILTER_LZMA2 LZMA_VLI_C(0x21) |
LZMA2 Filter ID. | |
#define | LZMA_DICT_SIZE_MIN UINT32_C(4096) |
#define | LZMA_DICT_SIZE_DEFAULT (UINT32_C(1) << 23) |
#define | LZMA_LCLP_MIN 0 |
#define | LZMA_LCLP_MAX 4 |
#define | LZMA_LC_DEFAULT 3 |
#define | LZMA_LP_DEFAULT 0 |
#define | LZMA_PB_MIN 0 |
#define | LZMA_PB_MAX 4 |
#define | LZMA_PB_DEFAULT 2 |
Enumerations | |
enum | lzma_match_finder { LZMA_MF_HC3 = 0x03, LZMA_MF_HC4 = 0x04, LZMA_MF_BT2 = 0x12, LZMA_MF_BT3 = 0x13, LZMA_MF_BT4 = 0x14 } |
Match finders. More... | |
enum | lzma_mode { LZMA_MODE_FAST = 1, LZMA_MODE_NORMAL = 2 } |
LZMA compression modes. More... | |
Functions | |
LZMA_API (lzma_bool) lzma_mf_is_supported(lzma_match_finder match_finder) lzma_attr_const | |
Test if given match finder is supported. | |
Variables | |
uint32_t | preset |
LZMA1 and LZMA2 filters.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
#define LZMA_FILTER_LZMA1 LZMA_VLI_C(0x4000000000000001) |
LZMA1 Filter ID.
LZMA1 is the very same thing as what was called just LZMA in earlier LZMA Utils, 7-Zip, and LZMA SDK. It's called LZMA1 here to prevent developers from accidentally using LZMA when they actually want LZMA2.
Referenced by message_filters().
#define LZMA_FILTER_LZMA2 LZMA_VLI_C(0x21) |
LZMA2 Filter ID.
Usually you want this instead of LZMA1. Compared to LZMA1, LZMA2 adds support for LZMA_SYNC_FLUSH, uncompressed chunks (expands uncompressible data less), possibility to change lc/lp/pb in the middle of encoding, and some other internal improvements.
Referenced by message_filters().
enum lzma_match_finder |
Match finders.
Match finder has major effect on both speed and compression ratio. Usually hash chains are faster than binary trees.
The memory usage formulas are only rough estimates, which are closest to reality when dict_size is a power of two. The formulas are more complex in reality, and can also change a little between liblzma versions. Use lzma_memusage_encoder() to get more accurate estimate of memory usage.
enum lzma_mode |
LZMA compression modes.
This selects the function used to analyze the data produced by the match finder.
LZMA_API | ( | lzma_bool | ) |
Test if given match finder is supported.
Test if the given Filter ID is supported for encoding.
Test if the given Check ID is supported.
Set a compression preset to lzma_options_lzma structure.
Test if given compression mode is supported.
Returns true if the given match finder is supported by this liblzma build. Otherwise false is returned. It is safe to call this with a value that isn't listed in lzma_match_finder enumeration; the return value will be false.
There is no way to list which match finders are available in this particular liblzma version and build. It would be useless, because a new match finder, which the application developer wasn't aware, could require giving additional options to the encoder that the older match finders don't need.
Returns true if the given compression mode is supported by this liblzma build. Otherwise false is returned. It is safe to call this with a value that isn't listed in lzma_mode enumeration; the return value will be false.
There is no way to list which modes are available in this particular liblzma version and build. It would be useless, because a new compression mode, which the application developer wasn't aware, could require giving additional options to the encoder that the older modes don't need.
0 is the fastest and 9 is the slowest. These match the switches -0 .. -9 of the xz command line tool. In addition, it is possible to bitwise-or flags to the preset. Currently only LZMA_PRESET_EXTREME is supported. The flags are defined in container.h, because the flags are used also with lzma_easy_encoder().
The preset values are subject to changes between liblzma versions.
This function is available only if LZMA1 or LZMA2 encoder has been enabled when building liblzma.
References init_current(), next_group(), previous_group(), and set_info().