003 File Manager
Current Path:
/usr/src/contrib/xz/src/liblzma/lzma
usr
/
src
/
contrib
/
xz
/
src
/
liblzma
/
lzma
/
📁
..
📄
fastpos.h
(3.9 KB)
📄
fastpos_table.c
(33.16 KB)
📄
fastpos_tablegen.c
(1.24 KB)
📄
lzma2_decoder.c
(7.4 KB)
📄
lzma2_decoder.h
(819 B)
📄
lzma2_encoder.c
(10.25 KB)
📄
lzma2_encoder.h
(1.16 KB)
📄
lzma_common.h
(6.78 KB)
📄
lzma_decoder.c
(26.68 KB)
📄
lzma_decoder.h
(1.52 KB)
📄
lzma_encoder.c
(18.08 KB)
📄
lzma_encoder.h
(1.57 KB)
📄
lzma_encoder_optimum_fast.c
(4.3 KB)
📄
lzma_encoder_optimum_normal.c
(22.74 KB)
📄
lzma_encoder_presets.c
(1.72 KB)
📄
lzma_encoder_private.h
(3.82 KB)
Editing: lzma_encoder_presets.c
/////////////////////////////////////////////////////////////////////////////// // /// \file lzma_encoder_presets.c /// \brief Encoder presets /// \note xz needs this even when only decoding is enabled. // // Author: Lasse Collin // // This file has been put into the public domain. // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// #include "common.h" extern LZMA_API(lzma_bool) lzma_lzma_preset(lzma_options_lzma *options, uint32_t preset) { const uint32_t level = preset & LZMA_PRESET_LEVEL_MASK; const uint32_t flags = preset & ~LZMA_PRESET_LEVEL_MASK; const uint32_t supported_flags = LZMA_PRESET_EXTREME; if (level > 9 || (flags & ~supported_flags)) return true; options->preset_dict = NULL; options->preset_dict_size = 0; options->lc = LZMA_LC_DEFAULT; options->lp = LZMA_LP_DEFAULT; options->pb = LZMA_PB_DEFAULT; static const uint8_t dict_pow2[] = { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }; options->dict_size = UINT32_C(1) << dict_pow2[level]; if (level <= 3) { options->mode = LZMA_MODE_FAST; options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4; options->nice_len = level <= 1 ? 128 : 273; static const uint8_t depths[] = { 4, 8, 24, 48 }; options->depth = depths[level]; } else { options->mode = LZMA_MODE_NORMAL; options->mf = LZMA_MF_BT4; options->nice_len = level == 4 ? 16 : level == 5 ? 32 : 64; options->depth = 0; } if (flags & LZMA_PRESET_EXTREME) { options->mode = LZMA_MODE_NORMAL; options->mf = LZMA_MF_BT4; if (level == 3 || level == 5) { options->nice_len = 192; options->depth = 0; } else { options->nice_len = 273; options->depth = 512; } } return false; }
Upload File
Create Folder