From 5db717af10bebadcc08fe13abe00ddba24b83b3d Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 20 Jan 2022 22:19:35 -0800 Subject: [PATCH] proper max limit to 11 --- lib/compress/huf_compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compress/huf_compress.c b/lib/compress/huf_compress.c index fee2c0b52..d3b597d98 100644 --- a/lib/compress/huf_compress.c +++ b/lib/compress/huf_compress.c @@ -745,10 +745,10 @@ HUF_buildCTable_wksp(HUF_CElt* CTable, const unsigned* count, U32 maxSymbolValue nonNullRank = HUF_buildTree(huffNode, maxSymbolValue); /* determine and enforce maxTableLog */ - /* Loosen target when maxNbBits is within limits. + /* Loosen target when maxNbBits is already within limits. * A harsh rebalancing can be bad for compression ratio * while a mild one tends to be better */ - while (maxNbBits < HUF_TABLELOG_MAX) { + while (maxNbBits < HUF_TABLELOG_DEFAULT) { size_t const nbSTL = HUF_nbSymbolsTooLarge(huffNode, maxSymbolValue, maxNbBits); #define HUF_NB_NODES_TO_FIX_MAX 32 if (nbSTL < HUF_NB_NODES_TO_FIX_MAX) /* heuristic */ -- 2.47.3