Lines Matching refs:huffNode

290 static U32 HUF_setMaxHeight(nodeElt *huffNode, U32 lastNonNull, U32 maxNbBits)  in HUF_setMaxHeight()  argument
292 const U32 largestBits = huffNode[lastNonNull].nbBits; in HUF_setMaxHeight()
302 while (huffNode[n].nbBits > maxNbBits) { in HUF_setMaxHeight()
303 totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits)); in HUF_setMaxHeight()
304 huffNode[n].nbBits = (BYTE)maxNbBits; in HUF_setMaxHeight()
307 while (huffNode[n].nbBits == maxNbBits) in HUF_setMaxHeight()
324 if (huffNode[pos].nbBits >= currNbBits) in HUF_setMaxHeight()
326 currNbBits = huffNode[pos].nbBits; /* < maxNbBits */ in HUF_setMaxHeight()
341 U32 const highTotal = huffNode[highPos].count; in HUF_setMaxHeight()
342 U32 const lowTotal = 2 * huffNode[lowPos].count; in HUF_setMaxHeight()
354 huffNode[rankLast[nBitsToDecrease]].nbBits++; in HUF_setMaxHeight()
359 if (huffNode[rankLast[nBitsToDecrease]].nbBits != maxNbBits - nBitsToDecrease) in HUF_setMaxHeight()
367 while (huffNode[n].nbBits == maxNbBits) in HUF_setMaxHeight()
369 huffNode[n + 1].nbBits--; in HUF_setMaxHeight()
374 huffNode[rankLast[1] + 1].nbBits--; in HUF_setMaxHeight()
389 static void HUF_sort(nodeElt *huffNode, const U32 *count, U32 maxSymbolValue) in HUF_sort() argument
407 while ((pos > rank[r].base) && (c > huffNode[pos - 1].count)) in HUF_sort()
408 huffNode[pos] = huffNode[pos - 1], pos--; in HUF_sort()
409 huffNode[pos].count = c; in HUF_sort()
410 huffNode[pos].byte = (BYTE)n; in HUF_sort()
423 nodeElt *const huffNode = huffNode0 + 1; in HUF_buildCTable_wksp() local
439 HUF_sort(huffNode, count, maxSymbolValue); in HUF_buildCTable_wksp()
443 while (huffNode[nonNullRank].count == 0) in HUF_buildCTable_wksp()
448 huffNode[nodeNb].count = huffNode[lowS].count + huffNode[lowS - 1].count; in HUF_buildCTable_wksp()
449 huffNode[lowS].parent = huffNode[lowS - 1].parent = nodeNb; in HUF_buildCTable_wksp()
453 huffNode[n].count = (U32)(1U << 30); in HUF_buildCTable_wksp()
458 U32 n1 = (huffNode[lowS].count < huffNode[lowN].count) ? lowS-- : lowN++; in HUF_buildCTable_wksp()
459 U32 n2 = (huffNode[lowS].count < huffNode[lowN].count) ? lowS-- : lowN++; in HUF_buildCTable_wksp()
460 huffNode[nodeNb].count = huffNode[n1].count + huffNode[n2].count; in HUF_buildCTable_wksp()
461 huffNode[n1].parent = huffNode[n2].parent = nodeNb; in HUF_buildCTable_wksp()
466 huffNode[nodeRoot].nbBits = 0; in HUF_buildCTable_wksp()
468 huffNode[n].nbBits = huffNode[huffNode[n].parent].nbBits + 1; in HUF_buildCTable_wksp()
470 huffNode[n].nbBits = huffNode[huffNode[n].parent].nbBits + 1; in HUF_buildCTable_wksp()
473 maxNbBits = HUF_setMaxHeight(huffNode, nonNullRank, maxNbBits); in HUF_buildCTable_wksp()
482 nbPerRank[huffNode[n].nbBits]++; in HUF_buildCTable_wksp()
493 tree[huffNode[n].byte].nbBits = huffNode[n].nbBits; /* push nbBits per symbol, symbol order */ in HUF_buildCTable_wksp()