lzma_encoder_presets.c | lzma_encoder_presets.c | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
if (level > 9 || (flags & ~supported_flags)) | if (level > 9 || (flags & ~supported_flags)) | |||
return true; | return true; | |||
options->preset_dict = NULL; | options->preset_dict = NULL; | |||
options->preset_dict_size = 0; | options->preset_dict_size = 0; | |||
options->lc = LZMA_LC_DEFAULT; | options->lc = LZMA_LC_DEFAULT; | |||
options->lp = LZMA_LP_DEFAULT; | options->lp = LZMA_LP_DEFAULT; | |||
options->pb = LZMA_PB_DEFAULT; | options->pb = LZMA_PB_DEFAULT; | |||
options->dict_size = UINT32_C(1) << (uint8_t []){ | static const uint8_t dict_pow2[] | |||
18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }[level]; | = { 18, 20, 21, 22, 22, 23, 23, 24, 25, 26 }; | |||
options->dict_size = UINT32_C(1) << dict_pow2[level]; | ||||
if (level <= 3) { | if (level <= 3) { | |||
options->mode = LZMA_MODE_FAST; | options->mode = LZMA_MODE_FAST; | |||
options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4; | options->mf = level == 0 ? LZMA_MF_HC3 : LZMA_MF_HC4; | |||
options->nice_len = level <= 1 ? 128 : 273; | options->nice_len = level <= 1 ? 128 : 273; | |||
options->depth = (uint8_t []){ 4, 8, 24, 48 }[level]; | static const uint8_t depths[] = { 4, 8, 24, 48 }; | |||
options->depth = depths[level]; | ||||
} else { | } else { | |||
options->mode = LZMA_MODE_NORMAL; | options->mode = LZMA_MODE_NORMAL; | |||
options->mf = LZMA_MF_BT4; | options->mf = LZMA_MF_BT4; | |||
options->nice_len = level == 4 ? 16 : level == 5 ? 32 : 64; | options->nice_len = level == 4 ? 16 : level == 5 ? 32 : 64; | |||
options->depth = 0; | options->depth = 0; | |||
} | } | |||
if (flags & LZMA_PRESET_EXTREME) { | if (flags & LZMA_PRESET_EXTREME) { | |||
options->mode = LZMA_MODE_NORMAL; | options->mode = LZMA_MODE_NORMAL; | |||
options->mf = LZMA_MF_BT4; | options->mf = LZMA_MF_BT4; | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 5 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |