]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
huf: increase threshold detection of poorly compressible data 1202/head
authorYann Collet <cyan@fb.com>
Fri, 22 Jun 2018 01:32:38 +0000 (18:32 -0700)
committerYann Collet <cyan@fb.com>
Fri, 22 Jun 2018 01:32:38 +0000 (18:32 -0700)
lib/compress/huf_compress.c

index 2e531918733de7939ab02d5e8dadbf0fd78313e0..9cdaa5d796f2e55e9cc8ed6d0556d0c8cab9adfd 100644 (file)
@@ -670,7 +670,7 @@ static size_t HUF_compress_internal (
     /* Scan input and build symbol stats */
     {   CHECK_V_F(largest, HIST_count_wksp (table->count, &maxSymbolValue, (const BYTE*)src, srcSize, table->count) );
         if (largest == srcSize) { *ostart = ((const BYTE*)src)[0]; return 1; }   /* single symbol, rle */
-        if (largest <= (srcSize >> 7)+1) return 0;   /* heuristic : probably not compressible enough */
+        if (largest <= (srcSize >> 7)+4) return 0;   /* heuristic : probably not compressible enough */
     }
 
     /* Check validity of previous table */