From: Yann Collet Date: Fri, 21 Jan 2022 06:19:35 +0000 (-0800) Subject: proper max limit to 11 X-Git-Tag: v1.5.4^2~260^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db717af10bebadcc08fe13abe00ddba24b83b3d;p=thirdparty%2Fzstd.git proper max limit to 11 --- 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 */