Lines Matching defs:maxNbBits
290 static U32 HUF_setMaxHeight(nodeElt *huffNode, U32 lastNonNull, U32 maxNbBits)
293 if (largestBits <= maxNbBits)
294 return largestBits; /* early exit : no elt > maxNbBits */
299 const U32 baseCost = 1 << (largestBits - maxNbBits);
302 while (huffNode[n].nbBits > maxNbBits) {
304 huffNode[n].nbBits = (BYTE)maxNbBits;
306 } /* n stops at huffNode[n].nbBits <= maxNbBits */
307 while (huffNode[n].nbBits == maxNbBits)
308 n--; /* n end at index of smallest symbol using < maxNbBits */
311 totalCost >>= (largestBits - maxNbBits); /* note : totalCost is necessarily a multiple of baseCost */
322 U32 currNbBits = maxNbBits;
326 currNbBits = huffNode[pos].nbBits; /* < maxNbBits */
327 rankLast[maxNbBits - currNbBits] = pos;
359 if (huffNode[rankLast[nBitsToDecrease]].nbBits != maxNbBits - nBitsToDecrease)
365 if (rankLast[1] == noSymbol) { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0
366 (using maxNbBits) */
367 while (huffNode[n].nbBits == maxNbBits)
381 return maxNbBits;
420 size_t HUF_buildCTable_wksp(HUF_CElt *tree, const U32 *count, U32 maxSymbolValue, U32 maxNbBits, void *workSpace, size_t wkspSize)
432 if (maxNbBits == 0)
433 maxNbBits = HUF_TABLELOG_DEFAULT;
473 maxNbBits = HUF_setMaxHeight(huffNode, nonNullRank, maxNbBits);
479 if (maxNbBits > HUF_TABLELOG_MAX)
486 for (n = maxNbBits; n > 0; n--) {
498 return maxNbBits;