mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Default compression level and window size on lzma is set to 7 which is the highest it goes.
Scale the 9 levels down to the 7 that lzma has. This makes the default lzma compression level 5 which is what lzma normally has, and uses a lot less ram and is significantly faster than previously, but at the cost of giving slightly less compression.
This commit is contained in:
parent
13e443e23c
commit
e0265b33e1
5
stream.c
5
stream.c
|
|
@ -281,8 +281,9 @@ static void lzma_compress_buf(struct compress_thread *cthread)
|
||||||
* and receive properties in control->lzma_properties */
|
* and receive properties in control->lzma_properties */
|
||||||
|
|
||||||
lzma_ret = LzmaCompress(c_buf, &dlen, cthread->s_buf,
|
lzma_ret = LzmaCompress(c_buf, &dlen, cthread->s_buf,
|
||||||
(size_t)cthread->s_len, control.lzma_properties, &prop_size, control.compression_level,
|
(size_t)cthread->s_len, control.lzma_properties, &prop_size,
|
||||||
0, /* dict size. set default */
|
control.compression_level * 7 / 9 ? : 1, /* only 7 levels with lzma, scale them */
|
||||||
|
0, /* dict size. set default, choose by level */
|
||||||
-1, -1, -1, -1, /* lc, lp, pb, fb */
|
-1, -1, -1, -1, /* lc, lp, pb, fb */
|
||||||
control.threads);
|
control.threads);
|
||||||
if (lzma_ret != SZ_OK) {
|
if (lzma_ret != SZ_OK) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue