/freebsd-13-stable/sys/contrib/zstd/lib/common/ |
H A D | bitstream.h | 67 MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits); 107 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); 126 MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits); 127 /* faster, but works only if value is "clean", meaning all high bits above nbBits are 0 */ 132 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); 133 /* faster, but works only if nbBits >= 1 */ 204 size_t value, unsigned nbBits) 207 assert(nbBits < BIT_MASK_SIZE); 208 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); 209 bitC->bitContainer |= (value & BIT_mask[nbBits]) << bit 203 BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits) argument 216 BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits) argument 330 BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) argument 338 BIT_getLowerBits(size_t bitContainer, U32 const nbBits) argument 354 BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) argument 370 BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits) argument 377 BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) argument 386 BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) argument 395 BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) argument [all...] |
H A D | entropy_common.c | 70 int nbBits; local 94 nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */ 95 if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge); 98 *tableLogPtr = nbBits; 99 remaining = (1<<nbBits)+1; 100 threshold = 1<<nbBits; 101 nbBits++; 159 bitCount += nbBits-1; 163 bitCount += nbBits; 186 nbBits [all...] |
H A D | fse.h | 330 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits); 331 /**< build a fake FSE_CTable, designed for a flat distribution, where each symbol uses nbBits */ 349 size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits); 350 /**< build a fake FSE_DTable, designed to read a flat distribution where each symbol uses nbBits */ 414 Note : maximum allowed nbBits is 25, for compatibility with 32-bits decoders 415 BIT_addBits(&bitStream, bitField, nbBits); 472 Note : maximum allowed nbBits is 25, for 32-bits compatibility 473 size_t bitField = BIT_readBits(&DStream, nbBits); 502 /* faster, but works only if nbBits is always >= 1 (otherwise, result will be corrupted) */ 599 unsigned char nbBits; [all...] |
H A D | fse_decompress.c | 169 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); 170 tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); 199 cell->nbBits = 0; 205 size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits) argument 211 const unsigned tableSize = 1 << nbBits; 217 if (nbBits < 1) return ERROR(GENERIC); /* min size */ 220 DTableH->tableLog = (U16)nbBits; 225 dinfo[s].nbBits = (BYTE)nbBits;
|
H A D | huf.h | 141 BYTE nbBits; member in struct:HUF_CElt_s 252 * Read nbBits from CTable symbolTable, for symbol `symbolValue` presumed <= HUF_SYMBOLVALUE_MAX
|
/freebsd-13-stable/sys/contrib/zstd/lib/compress/ |
H A D | huf_compress.c | 124 huffWeight[n] = bitsToWeight[CTable[n].nbBits]; 167 /* fill nbBits */ 170 CTable[n].nbBits = (BYTE)(tableLog + 1 - w) & -(w != 0); 176 { U32 n; for (n=0; n<nbSymbols; n++) nbPerRank[CTable[n].nbBits]++; } 186 { U32 n; for (n=0; n<nbSymbols; n++) CTable[n].val = valPerRank[CTable[n].nbBits]++; } 197 return table[symbolValue].nbBits; 205 BYTE nbBits; member in struct:nodeElt_s 212 * It sets all nodes with nbBits > maxNbBits to be maxNbBits. Then it adjusts 216 * where largestBits == huffNode[lastNonNull].nbBits. 230 const U32 largestBits = huffNode[lastNonNull].nbBits; 527 size_t nbBits = 0; local [all...] |
H A D | fse_compress.c | 204 int nbBits; local 221 nbBits = tableLog+1; 261 bitCount += nbBits; 265 while (remaining<threshold) { nbBits--; threshold>>=1; } 501 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits) argument 503 const unsigned tableSize = 1 << nbBits; 513 if (nbBits < 1) return ERROR(GENERIC); /* min size */ 516 tableU16[-2] = (U16) nbBits; 524 { const U32 deltaNbBits = (nbBits << 16) - (1 << nbBits); [all...] |
/freebsd-13-stable/sys/contrib/zstd/lib/legacy/ |
H A D | zstd_v01.c | 129 unsigned char nbBits; member in struct:__anon10998 456 tableDecode[i].nbBits = (BYTE) (tableLog - FSE_highbit32 ((U32)nextState) ); 457 tableDecode[i].newState = (U16) ( (nextState << tableDecode[i].nbBits) - tableSize); 488 int nbBits; local 498 nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */ 499 if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return (size_t)-FSE_ERROR_tableLog_tooLarge; 502 *tableLogPtr = nbBits; 503 remaining = (1<<nbBits)+1; 504 threshold = 1<<nbBits; 505 nbBits 615 FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits) argument 701 FSE_lookBits(FSE_DStream_t* bitD, U32 nbBits) argument 707 FSE_lookBitsFast(FSE_DStream_t* bitD, U32 nbBits) argument 713 FSE_skipBits(FSE_DStream_t* bitD, U32 nbBits) argument 726 FSE_readBits(FSE_DStream_t* bitD, U32 nbBits) argument 733 FSE_readBitsFast(FSE_DStream_t* bitD, U32 nbBits) argument 785 const U32 nbBits = DInfo.nbBits; local 796 const U32 nbBits = DInfo.nbBits; local 942 BYTE nbBits; member in struct:HUF_CElt_s 949 BYTE nbBits; member in struct:nodeElt_s 958 BYTE nbBits; member in struct:__anon11003 1723 U32 offsetCode, nbBits; local [all...] |
H A D | zstd_v03.c | 339 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); 348 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); 349 /* faster, but works only if nbBits >= 1 */ 435 MEM_STATIC size_t BIT_lookBits(BIT_DStream_t* bitD, U32 nbBits) argument 438 return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask); 442 * unsafe version; only works only if nbBits >= 1 */ 443 MEM_STATIC size_t BIT_lookBitsFast(BIT_DStream_t* bitD, U32 nbBits) argument 446 return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); 449 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) argument 451 bitD->bitsConsumed += nbBits; 454 BIT_readBits(BIT_DStream_t* bitD, U32 nbBits) argument 463 BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits) argument 714 unsigned char nbBits; member in struct:__anon11036 729 const U32 nbBits = DInfo.nbBits; local 740 const U32 nbBits = DInfo.nbBits; local 1189 int nbBits; local 1316 FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits) argument 1532 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX2; /* single-symbol decoding */ member in struct:__anon11037 1534 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX4; /* double-symbols decoding */ member in struct:__anon11038 1863 const U32 nbBits = nbBitsBaseline - weight; local 1897 const U32 nbBits = nbBitsBaseline - weight; local 2715 U32 offsetCode, nbBits; local [all...] |
H A D | zstd_v02.c | 337 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); 345 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); 346 /* faster, but works only if nbBits >= 1 */ 433 MEM_STATIC size_t BIT_lookBits(BIT_DStream_t* bitD, U32 nbBits) argument 436 return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask); 440 * unsafe version; only works only if nbBits >= 1 */ 441 MEM_STATIC size_t BIT_lookBitsFast(BIT_DStream_t* bitD, U32 nbBits) argument 444 return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); 447 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) argument 449 bitD->bitsConsumed += nbBits; 452 BIT_readBits(BIT_DStream_t* bitD, U32 nbBits) argument 461 BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits) argument 712 unsigned char nbBits; member in struct:__anon11017 727 const U32 nbBits = DInfo.nbBits; local 738 const U32 nbBits = DInfo.nbBits; local 1188 int nbBits; local 1315 FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits) argument 1535 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX2; /* single-symbol decoding */ member in struct:__anon11018 1537 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX4; /* double-symbols decoding */ member in struct:__anon11019 1866 const U32 nbBits = nbBitsBaseline - weight; local 1900 const U32 nbBits = nbBitsBaseline - weight; local 2198 typedef struct { BYTE nbBits; BYTE nbBytes; } HUF_DDescX6; member in struct:__anon11021 2235 const int nbBits = nbBitsBaseline - weight; /* >= 1 (by construction) */ local 3074 U32 offsetCode, nbBits; local [all...] |
H A D | zstd_v04.c | 609 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits); 619 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits); 620 /* faster, but works only if nbBits >= 1 */ 700 MEM_STATIC size_t BIT_lookBits(BIT_DStream_t* bitD, U32 nbBits) argument 703 return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask); 707 * unsafe version; only works only if nbBits >= 1 */ 708 MEM_STATIC size_t BIT_lookBitsFast(BIT_DStream_t* bitD, U32 nbBits) argument 711 return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); 714 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) argument 716 bitD->bitsConsumed += nbBits; 719 BIT_readBits(BIT_DStream_t* bitD, U32 nbBits) argument 728 BIT_readBitsFast(BIT_DStream_t* bitD, U32 nbBits) argument 887 unsigned char nbBits; member in struct:__anon11055 902 const U32 nbBits = DInfo.nbBits; local 913 const U32 nbBits = DInfo.nbBits; local 1166 int nbBits; local 1294 FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits) argument 1685 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX2; /* single-symbol decoding */ member in struct:__anon11056 1687 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX4; /* double-symbols decoding */ member in struct:__anon11057 2014 const U32 nbBits = nbBitsBaseline - weight; local 2048 const U32 nbBits = nbBitsBaseline - weight; local 2837 U32 offsetCode, nbBits; local [all...] |
H A D | zstd_v05.c | 740 MEM_STATIC size_t BITv05_readBits(BITv05_DStream_t* bitD, unsigned nbBits); 748 MEM_STATIC size_t BITv05_readBitsFast(BITv05_DStream_t* bitD, unsigned nbBits); 749 /* faster, but works only if nbBits >= 1 */ 826 MEM_STATIC size_t BITv05_lookBits(BITv05_DStream_t* bitD, U32 nbBits) argument 829 return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask); 833 * unsafe version; only works only if nbBits >= 1 */ 834 MEM_STATIC size_t BITv05_lookBitsFast(BITv05_DStream_t* bitD, U32 nbBits) argument 837 return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); 840 MEM_STATIC void BITv05_skipBits(BITv05_DStream_t* bitD, U32 nbBits) argument 842 bitD->bitsConsumed += nbBits; 845 BITv05_readBits(BITv05_DStream_t* bitD, unsigned nbBits) argument 854 BITv05_readBitsFast(BITv05_DStream_t* bitD, unsigned nbBits) argument 1003 unsigned char nbBits; member in struct:__anon11073 1024 const U32 nbBits = DInfo.nbBits; local 1035 const U32 nbBits = DInfo.nbBits; local 1292 int nbBits; local 1402 FSEv05_buildDTable_raw(FSEv05_DTable* dt, unsigned nbBits) argument 1787 typedef struct { BYTE byte; BYTE nbBits; } HUFv05_DEltX2; /* single-symbol decoding */ member in struct:__anon11074 1789 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUFv05_DEltX4; /* double-symbols decoding */ member in struct:__anon11075 2140 const U32 nbBits = nbBitsBaseline - weight; local 2173 const U32 nbBits = nbBitsBaseline - weight; local 3179 U32 nbBits = offsetCode - 1; local [all...] |
H A D | zstd_v06.c | 843 MEM_STATIC size_t BITv06_readBits(BITv06_DStream_t* bitD, unsigned nbBits); 852 MEM_STATIC size_t BITv06_readBitsFast(BITv06_DStream_t* bitD, unsigned nbBits); 853 /* faster, but works only if nbBits >= 1 */ 928 MEM_STATIC size_t BITv06_lookBits(const BITv06_DStream_t* bitD, U32 nbBits) argument 931 return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask); 935 * unsafe version; only works only if nbBits >= 1 */ 936 MEM_STATIC size_t BITv06_lookBitsFast(const BITv06_DStream_t* bitD, U32 nbBits) argument 939 return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); 942 MEM_STATIC void BITv06_skipBits(BITv06_DStream_t* bitD, U32 nbBits) argument 944 bitD->bitsConsumed += nbBits; 947 BITv06_readBits(BITv06_DStream_t* bitD, U32 nbBits) argument 956 BITv06_readBitsFast(BITv06_DStream_t* bitD, U32 nbBits) argument 1109 unsigned char nbBits; member in struct:__anon11096 1130 U32 const nbBits = DInfo.nbBits; local 1138 U32 const nbBits = DInfo.nbBits; local 1151 U32 const nbBits = DInfo.nbBits; local 1273 int nbBits; local 1545 FSEv06_buildDTable_raw(FSEv06_DTable* dt, unsigned nbBits) argument 1996 typedef struct { BYTE byte; BYTE nbBits; } HUFv06_DEltX2; /* single-symbol decoding */ member in struct:__anon11097 1998 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUFv06_DEltX4; /* double-symbols decoding */ member in struct:__anon11098 2272 const U32 nbBits = nbBitsBaseline - weight; local 2305 const U32 nbBits = nbBitsBaseline - weight; local [all...] |
H A D | zstd_v07.c | 513 MEM_STATIC size_t BITv07_readBits(BITv07_DStream_t* bitD, unsigned nbBits); 522 MEM_STATIC size_t BITv07_readBitsFast(BITv07_DStream_t* bitD, unsigned nbBits); 523 /* faster, but works only if nbBits >= 1 */ 596 MEM_STATIC size_t BITv07_lookBits(const BITv07_DStream_t* bitD, U32 nbBits) argument 599 return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMask); 603 * unsafe version; only works only if nbBits >= 1 */ 604 MEM_STATIC size_t BITv07_lookBitsFast(const BITv07_DStream_t* bitD, U32 nbBits) argument 607 return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); 610 MEM_STATIC void BITv07_skipBits(BITv07_DStream_t* bitD, U32 nbBits) argument 612 bitD->bitsConsumed += nbBits; 615 BITv07_readBits(BITv07_DStream_t* bitD, U32 nbBits) argument 624 BITv07_readBitsFast(BITv07_DStream_t* bitD, U32 nbBits) argument 873 unsigned char nbBits; member in struct:__anon11113 894 U32 const nbBits = DInfo.nbBits; local 902 U32 const nbBits = DInfo.nbBits; local 915 U32 const nbBits = DInfo.nbBits; local 1217 int nbBits; local 1565 FSEv07_buildDTable_raw(FSEv07_DTable* dt, unsigned nbBits) argument 1778 typedef struct { BYTE byte; BYTE nbBits; } HUFv07_DEltX2; /* single-symbol decoding */ member in struct:__anon11115 2050 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUFv07_DEltX4; /* double-symbols decoding */ member in struct:__anon11116 2079 const U32 nbBits = nbBitsBaseline - weight; local 2112 const U32 nbBits = nbBitsBaseline - weight; local [all...] |
/freebsd-13-stable/sys/contrib/zstd/lib/decompress/ |
H A D | huf_decompress.c | 116 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1; /* single-symbol decoding */ member in struct:__anon10961 122 static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) { argument 125 D4 = symbol + (nbBits << 8); 127 D4 = (symbol << 8) + nbBits; 222 BYTE const nbBits = (BYTE)(tableLog + 1 - w); local 230 D.nbBits = nbBits; 239 D.nbBits = nbBits; 247 U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); 520 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2; /* double-symbols decoding */ member in struct:__anon10963 553 const U32 nbBits = nbBitsBaseline - weight; local 585 const U32 nbBits = nbBitsBaseline - weight; local [all...] |
H A D | zstd_decompress_internal.h | 70 BYTE nbBits; member in struct:__anon10972
|
H A D | zstd_decompress_block.c | 249 /* nextState, nbAddBits, nbBits, baseVal */ 287 /* nextState, nbAddBits, nbBits, baseVal */ 310 /* nextState, nbAddBits, nbBits, baseVal */ 355 cell->nbBits = 0; 478 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); 479 tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); 544 U32 const nbBits = nbAdditionalBits[symbol]; local 545 ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits); 915 U32 const nbBits = DInfo.nbBits; local 923 U32 const nbBits = DInfo.nbBits; local [all...] |
/freebsd-13-stable/sys/contrib/openzfs/module/zstd/lib/ |
H A D | zstd.c | 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]) << bit 1494 BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits) argument 1507 BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits) argument 1621 BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) argument 1629 BIT_getLowerBits(size_t bitContainer, U32 const nbBits) argument 1641 BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) argument 1657 BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits) argument 1664 BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) argument 1673 BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) argument 1682 BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) argument 2042 unsigned char nbBits; member in struct:__anon10681 2063 U32 const nbBits = DInfo.nbBits; local 2071 U32 const nbBits = DInfo.nbBits; local 2084 U32 const nbBits = DInfo.nbBits; local 2524 int nbBits; local 2903 FSE_buildDTable_raw(FSE_DTable* dt, unsigned nbBits) argument 7679 int nbBits; local 7977 FSE_buildCTable_raw(FSE_CTable* ct, unsigned nbBits) argument 8472 BYTE nbBits; member in struct:HUF_CElt_s 8576 BYTE nbBits; member in struct:nodeElt_s 8788 size_t nbBits = 0; local 21465 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1; /* single-symbol decoding */ member in struct:__anon10759 21809 typedef struct { U16 sequence; BYTE nbBits; BYTE length; } HUF_DEltX2; /* double-symbols decoding */ member in struct:__anon10760 21842 const U32 nbBits = nbBitsBaseline - weight; local 21874 const U32 nbBits = nbBitsBaseline - weight; local 22693 BYTE nbBits; member in struct:__anon10764 26840 U32 const nbBits = nbAdditionalBits[symbol]; local 27204 U32 const nbBits = DInfo.nbBits; local 27212 U32 const nbBits = DInfo.nbBits; local [all...] |