From f3460fc148fc828b9c33b1a3967b6e494ad1f8f2 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Sat, 29 Apr 2017 15:00:47 +0300 Subject: liz4hc.h: fix a comment: LZ4HC_MAX_CLEVEL -> LZ4HC_CLEVEL_MAX --- lib/lz4hc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lz4hc.h b/lib/lz4hc.h index 2e3880d..c4284c0 100644 --- a/lib/lz4hc.h +++ b/lib/lz4hc.h @@ -58,8 +58,8 @@ extern "C" { * `dst` must be already allocated. * Compression is guaranteed to succeed if `dstCapacity >= LZ4_compressBound(srcSize)` (see "lz4.h") * Max supported `srcSize` value is LZ4_MAX_INPUT_SIZE (see "lz4.h") - * `compressionLevel` : Recommended values are between 4 and 9, although any value between 1 and LZ4HC_MAX_CLEVEL will work. - * Values >LZ4HC_MAX_CLEVEL behave the same as LZ4HC_MAX_CLEVEL. + * `compressionLevel` : Recommended values are between 4 and 9, although any value between 1 and LZ4HC_CLEVEL_MAX will work. + * Values >LZ4HC_CLEVEL_MAX behave the same as LZ4HC_CLEVEL_MAX. * @return : the number of bytes written into 'dst' * or 0 if compression fails. */ -- cgit v0.12 From a41df535f709fcb6ccba079dd4d630c4ec4f7151 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Sat, 29 Apr 2017 15:16:51 +0300 Subject: lz4cli.c: fix a comment: LZ4HC_DEFAULT_CLEVEL -> LZ4HC_CLEVEL_MAX Actually the program only mentions LZ4HC_CLEVEL_MAX. --- programs/lz4cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 329ca0b..10aa5aa 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -49,7 +49,7 @@ #include /* strcmp, strlen */ #include "bench.h" /* BMK_benchFile, BMK_SetNbIterations, BMK_SetBlocksize, BMK_SetPause */ #include "lz4io.h" /* LZ4IO_compressFilename, LZ4IO_decompressFilename, LZ4IO_compressMultipleFilenames */ -#include "lz4hc.h" /* LZ4HC_DEFAULT_CLEVEL */ +#include "lz4hc.h" /* LZ4HC_CLEVEL_MAX */ #include "lz4.h" /* LZ4_VERSION_STRING */ -- cgit v0.12 From 6cf1f7d758c23d6033d388eabbbb50380c364d2e Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Sat, 29 Apr 2017 15:52:51 +0300 Subject: lz4hc.c: clamp compression levels > 12 I noticed that, while 'lz4 -12' works fine, 'lz4 -13' does not compress at all. $ cat searchNum = LZ4HC_getSearchNum(cLevel); return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, 128, 0); default: + cLevel = 12; + /* pass-through */ case 12: ctx->searchNum = LZ4HC_getSearchNum(cLevel); return LZ4HC_compress_optimal(ctx, src, dst, *srcSizePtr, dstCapacity, limit, LZ4_OPT_NUM, 1); -- cgit v0.12