Lines Matching defs:totalCost
312 { int totalCost = 0;
317 * Compute totalCost, which is how far the sum of the ranks is
321 totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits));
330 /* renorm totalCost from 2^largestBits to 2^maxNbBits
331 * note : totalCost is necessarily a multiple of baseCost */
332 assert((totalCost & (baseCost - 1)) == 0);
333 totalCost >>= (largestBits - maxNbBits);
334 assert(totalCost > 0);
350 while (totalCost > 0) {
351 /* Try to reduce the next power of 2 above totalCost because we
354 U32 nBitsToDecrease = BIT_highbit32((U32)totalCost) + 1;
374 totalCost -= 1 << (nBitsToDecrease-1);
397 } /* while (totalCost > 0) */
405 while (totalCost < 0) { /* Sometimes, cost correction overshoot */
414 totalCost++;
419 totalCost ++;