lzma_encoder_presets.c File Reference

Encoder presets. More...

`#include "common.h"`

## Functions

lzma_bool | lzma_lzma_preset (lzma_options_lzma *options, uint32_t preset)
| Set a compression preset to lzma_options_lzma structure. More...

## Detailed Description

Encoder presets.

Note
  xz needs this even when only decoding is enabled.

## Function Documentation

## lzma_lzma_preset()

lzma_bool lzma_lzma_preset | ( | lzma_options_lzma * | options,
|  | uint32_t | preset
| ) |  |

Set a compression preset to lzma_options_lzma structure.

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.

Returns
  On success, false is returned. If the preset is not supported, true is returned.

References LZMA_PRESET_EXTREME, and LZMA_PRESET_LEVEL_MASK.

Referenced by lzma_easy_preset().