aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2010-09-03 12:28:41 +0300
committerLasse Collin <lasse.collin@tukaani.org>2010-09-03 12:28:41 +0300
commit77fe5954cd3d10fb1837372684cbc133b56b6a87 (patch)
treeb6c211524ce570b689fc5630b0539c5613e235a5 /src/liblzma
parentxz: Make --help two lines shorter. (diff)
downloadxz-77fe5954cd3d10fb1837372684cbc133b56b6a87.tar.xz
liblzma: Adjust default depth calculation for HC3 and HC4.
It was 8 + nice_len / 4, now it is 4 + nice_len / 4. This allows faster settings at lower nice_len values, even though it seems that I won't use automatic depth calcuation with HC3 and HC4 in the presets.
Diffstat (limited to 'src/liblzma')
-rw-r--r--src/liblzma/lz/lz_encoder.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/liblzma/lz/lz_encoder.c b/src/liblzma/lz/lz_encoder.c
index 9e980a2c..273f577b 100644
--- a/src/liblzma/lz/lz_encoder.c
+++ b/src/liblzma/lz/lz_encoder.c
@@ -349,9 +349,10 @@ lz_encoder_prepare(lzma_mf *mf, lzma_allocator *allocator,
// Maximum number of match finder cycles
mf->depth = lz_options->depth;
if (mf->depth == 0) {
- mf->depth = 16 + (mf->nice_len / 2);
- if (!is_bt)
- mf->depth /= 2;
+ if (is_bt)
+ mf->depth = 16 + mf->nice_len / 2;
+ else
+ mf->depth = 4 + mf->nice_len / 4;
}
return false;