]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
proper max limit to 11
authorYann Collet <cyan@fb.com>
Fri, 21 Jan 2022 06:19:35 +0000 (22:19 -0800)
committerYann Collet <cyan@fb.com>
Wed, 26 Jan 2022 22:47:24 +0000 (14:47 -0800)
lib/compress/huf_compress.c

index fee2c0b528a75bff1c0459a61494afc0272ecff1..d3b597d9852307167f3f9eed4bf60bab58827f00 100644 (file)
@@ -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 */