• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/contrib/openzfs/module/zstd/lib/

Lines Matching defs:nbBits

1362 MEM_STATIC void   BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
1402 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
1421 MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
1422 /* faster, but works only if value is "clean", meaning all high bits above nbBits are 0 */
1427 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);
1428 /* faster, but works only if nbBits >= 1 */
1495 size_t value, unsigned nbBits)
1498 assert(nbBits < BIT_MASK_SIZE);
1499 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);
1500 bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos;
1501 bitC->bitPos += nbBits;
1506 * meaning all high bits above nbBits are 0 */
1508 size_t value, unsigned nbBits)
1510 assert((value>>nbBits) == 0);
1511 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8);
1513 bitC->bitPos += nbBits;
1621 MEM_STATIC size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits)
1625 assert(nbBits < BIT_MASK_SIZE);
1626 return (bitContainer >> (start & regMask)) & BIT_mask[nbBits];
1629 MEM_STATIC size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits)
1631 assert(nbBits < BIT_MASK_SIZE);
1632 return bitContainer & BIT_mask[nbBits];
1641 MEM_STATIC size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits)
1645 /* if bitD->bitsConsumed + nbBits > sizeof(bitD->bitContainer)*8,
1647 return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits);
1651 return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMask);
1656 * unsafe version; only works if nbBits >= 1 */
1657 MEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits)
1660 assert(nbBits >= 1);
1661 return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask);
1664 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits)
1666 bitD->bitsConsumed += nbBits;
1671 * Pay attention to not read more than nbBits contained into local register.
1673 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits)
1675 size_t const value = BIT_lookBits(bitD, nbBits);
1676 BIT_skipBits(bitD, nbBits);
1681 * unsafe version; only works only if nbBits >= 1 */
1682 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits)
1684 size_t const value = BIT_lookBitsFast(bitD, nbBits);
1685 assert(nbBits >= 1);
1686 BIT_skipBits(bitD, nbBits);
1785 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);
1786 /**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */
1797 size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);
1798 /**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */
1857 Note : maximum allowed nbBits is 25, for compatibility with 32-bits decoders
1858 BIT_addBits(&bitStream, bitField, nbBits);
1915 Note : maximum allowed nbBits is 25, for 32-bits compatibility
1916 size_t bitField = BIT_readBits(&DStream, nbBits);
1945 /* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */
2042 unsigned char nbBits;
2063 U32 const nbBits = DInfo.nbBits;
2064 size_t const lowBits = BIT_readBits(bitD, nbBits);
2071 U32 const nbBits = DInfo.nbBits;
2073 size_t const lowBits = BIT_readBits(bitD, nbBits);
2084 U32 const nbBits = DInfo.nbBits;
2086 size_t const lowBits = BIT_readBitsFast(bitD, nbBits);
2393 * Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX
2524 int nbBits;
2548 nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */
2549 if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge);
2552 *tableLogPtr = nbBits;
2553 remaining = (1<<nbBits)+1;
2554 threshold = 1<<nbBits;
2555 nbBits++;
2591 bitCount += nbBits-1;
2595 bitCount += nbBits;
2603 nbBits--;
2872 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );
2873 tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
2897 cell->nbBits = 0;
2903 size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits)
2909 const unsigned tableSize = 1 << nbBits;
2915 if (nbBits < 1) return ERROR(GENERIC); /* min size */
2918 DTableH->tableLog = (U16)nbBits;
2923 dinfo[s].nbBits = (BYTE)nbBits;
7679 int nbBits;
7696 nbBits = tableLog+1;
7736 bitCount += nbBits;
7740 while (remaining<threshold) { nbBits--; threshold>>=1; }
7977 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits)
7979 const unsigned tableSize = 1 << nbBits;
7989 if (nbBits < 1) return ERROR(GENERIC); /* min size */
7992 tableU16[-2] = (U16) nbBits;
8000 { const U32 deltaNbBits = (nbBits << 16) - (1 << nbBits);
8472 BYTE nbBits;
8494 huffWeight[n] = bitsToWeight[CTable[n].nbBits];
8536 /* fill nbBits */
8541 CTable[n].nbBits = (BYTE)(tableLog + 1 - w) & -(w != 0);
8547 { U32 n; for (n=0; n<nbSymbols; n++) nbPerRank[CTable[n].nbBits]++; }
8557 { U32 n; for (n=0; n<nbSymbols; n++) CTable[n].val = valPerRank[CTable[n].nbBits]++; }
8568 return table[symbolValue].nbBits;
8576 BYTE nbBits;
8581 const U32 largestBits = huffNode[lastNonNull].nbBits;
8589 while (huffNode[n].nbBits > maxNbBits) {
8590 totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits));
8591 huffNode[n].nbBits = (BYTE)maxNbBits;
8593 } /* n stops at huffNode[n].nbBits <= maxNbBits */
8594 while (huffNode[n].nbBits == maxNbBits) n--; /* n end at index of smallest symbol using < maxNbBits */
8608 if (huffNode[pos].nbBits >= currentNbBits) continue;
8609 currentNbBits = huffNode[pos].nbBits; /* < maxNbBits */
8631 huffNode[rankLast[nBitsToDecrease]].nbBits ++;
8636 if (huffNode[rankLast[nBitsToDecrease]].nbBits != maxNbBits-nBitsToDecrease)
8642 while (huffNode[n].nbBits == maxNbBits) n--;
8643 huffNode[n+1].nbBits--;
8649 huffNode[ rankLast[1] + 1 ].nbBits--;
8744 huffNode[nodeRoot].nbBits = 0;
8746 huffNode[n].nbBits = huffNode[ huffNode[n].parent ].nbBits + 1;
8748 huffNode[n].nbBits = huffNode[ huffNode[n].parent ].nbBits + 1;
8753 /* fill result into tree (val, nbBits) */
8759 nbPerRank[huffNode[n].nbBits]++;
8768 tree[huffNode[n].byte].nbBits = huffNode[n].nbBits; /* push nbBits per symbol, symbol order */
8770 tree[n].val = valPerRank[tree[n].nbBits]++; /* assign value within rank, symbol order */
8788 size_t nbBits = 0;
8791 nbBits += CTable[s].nbBits * count[s];
8793 return nbBits >> 3;
8800 bad |= (count[s] != 0) & (CTable[s].nbBits == 0);
8810 BIT_addBitsFast(bitCPtr, CTable[symbol].val, CTable[symbol].nbBits);
21465 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1; /* single-symbol decoding */
21519 D.nbBits = (BYTE)(tableLog + 1 - w);
21548 BIT_skipBits(Dstream, dt[val].nbBits);
21809 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2; /* double-symbols decoding */
21832 DElt.nbBits = (BYTE)(consumed);
21842 const U32 nbBits = nbBitsBaseline - weight;
21843 const U32 length = 1 << (sizeLog-nbBits);
21849 DElt.nbBits = (BYTE)(nbBits + consumed);
21874 const U32 nbBits = nbBitsBaseline - weight;
21876 const U32 length = 1 << (targetLog-nbBits);
21878 if (targetLog-nbBits >= minBits) { /* enough room for a second symbol */
21880 int minWeight = nbBits + scaleLog;
21883 HUF_fillDTableX2Level2(DTable+start, targetLog-nbBits, nbBits,
21884 rankValOrigin[nbBits], minWeight,
21890 DElt.nbBits = (BYTE)(nbBits);
22013 BIT_skipBits(DStream, dt[val].nbBits);
22022 if (dt[val].length==1) BIT_skipBits(DStream, dt[val].nbBits);
22025 BIT_skipBits(DStream, dt[val].nbBits);
22027 /* ugly hack; works only because it's the last symbol. Note : can't easily extract nbBits from just this symbol */
22693 BYTE nbBits;
26642 /* nextState, nbAddBits, nbBits, baseVal */
26680 /* nextState, nbAddBits, nbBits, baseVal */
26703 /* nextState, nbAddBits, nbBits, baseVal */
26748 cell->nbBits = 0;
26814 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) );
26815 tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize);
26840 U32 const nbBits = nbAdditionalBits[symbol];
26841 ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits);
27204 U32 const nbBits = DInfo.nbBits;
27205 size_t const lowBits = BIT_readBits(bitD, nbBits);
27212 U32 const nbBits = DInfo.nbBits;
27213 size_t const lowBits = BIT_readBits(bitD, nbBits);