wok rev 19560
fusecloop: libdeflate uses 12 compression levels, not 9
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 14 21:23:06 2016 +0100 (2016-12-14) |
parents | aac6b4243788 |
children | a8df27023cb2 |
files | fusecloop/stuff/fusecloop.u |
line diff
1.1 --- a/fusecloop/stuff/fusecloop.u Wed Dec 14 13:56:37 2016 +0100 1.2 +++ b/fusecloop/stuff/fusecloop.u Wed Dec 14 21:23:06 2016 +0100 1.3 @@ -620,13 +620,14 @@ 1.4 +} 1.5 --- create_compressed_fs.c 1.6 +++ create_compressed_fs.c 1.7 -@@ -0,0 +1,223 @@ 1.8 +@@ -0,0 +1,224 @@ 1.9 +#ifdef FIND_BEST_COMPRESSION 1.10 +#include <compress.h> 1.11 +extern "C" { 1.12 +#include <stdlib.h> 1.13 +#include <string.h> 1.14 + 1.15 ++#define ZMAX 12 /* 12 compression levels with libdeflate, not 9 */ 1.16 +static shrink_t level; 1.17 +static int pass, iter; 1.18 +static int best_compress(unsigned char *compressed, 1.19 @@ -648,10 +649,10 @@ 1.20 + } 1.21 + buf[0] = compressed; 1.22 + buf[1] = buffer; 1.23 -+ for (i = j = 0; i <= 11 && (pass == 0 || i < pass); i++) { 1.24 ++ for (i = j = 0; i <= ZMAX+2 && (pass == 0 || i < pass); i++) { 1.25 + llen = len = *compressed_len; 1.26 -+ if (i >= 10) { 1.27 -+ level.level = (i == 10) ? shrink_extra : shrink_insane; 1.28 ++ if (i >= ZMAX+1) { 1.29 ++ level.level = (i == ZMAX+1) ? shrink_extra : shrink_insane; 1.30 + err = (compress_zlib(level, buf[j], 1.31 + len, uncompressed, 1.32 + uncompressed_len)) ? Z_OK : Z_DATA_ERROR;