From 698fd00afbbda554409ecfc74a250f7b3a760ce1 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 21 Jun 2018 18:32:38 -0700 Subject: [PATCH] huf: increase threshold detection of poorly compressible data --- lib/compress/huf_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compress/huf_compress.c b/lib/compress/huf_compress.c index 2e5319187..9cdaa5d79 100644 --- a/lib/compress/huf_compress.c +++ b/lib/compress/huf_compress.c @@ -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 */ -- 2.47.2