diff --git a/lzma_compress.c b/lzma_compress.c index fe1729c..290b59a 100644 --- a/lzma_compress.c +++ b/lzma_compress.c @@ -31,8 +31,6 @@ #include #define SZ_ERROR_DESTLEN 100 -#define LZMA_MAX_DICT (1 << 30) -#define LZMA_DICT_THRESH (1 << 29) #define LZMA_DEFAULT_DICT (1 << 24) CLzmaEncProps *p = NULL; @@ -73,12 +71,20 @@ lzma_init(void **data, int *level, ssize_t chunksize) p->dictSize = 0; } /* Determine the fast bytes value. */ - if (*level < 7) + if (*level < 7) { p->fb = 32; - else if (*level < 10) + + } else if (*level < 10) { p->fb = 64; - else + + } else if (*level < 13) { + p->fb = 64; + p->mc = 128; + + } else { p->fb = 128; + p->mc = 256; + } p->level = *level; LzmaEncProps_Normalize(p); slab_cache_add(p->litprob_sz); diff --git a/main.c b/main.c index b12b9ca..4e828c8 100644 --- a/main.c +++ b/main.c @@ -819,7 +819,7 @@ start_compress(const char *filename, uint64_t chunksize, int level) chunksize = sbuf.st_size; nthreads = 1; } else { - if (nthreads > sbuf.st_size / chunksize) { + if (nthreads == 0 || nthreads > sbuf.st_size / chunksize) { nthreads = sbuf.st_size / chunksize; if (sbuf.st_size % chunksize) nthreads++; diff --git a/rabin/rabin_polynomial.c b/rabin/rabin_polynomial.c index 1b4ada7..6a8f0eb 100755 --- a/rabin/rabin_polynomial.c +++ b/rabin/rabin_polynomial.c @@ -92,7 +92,7 @@ rabin_context_t * create_rabin_context(uint64_t chunksize, uint64_t real_chunksize, const char *algo) { rabin_context_t *ctx; unsigned char *current_window_data; - uint32_t blknum, index; + uint32_t blknum; int level = 14; /*