Home
last modified time | relevance | path

Searched refs:nbBits (Results 1 – 20 of 20) sorted by relevance

/external/zstd/lib/common/
Dbitstream.h67 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);
132 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);
204 size_t value, unsigned nbBits) in BIT_addBits() argument
207 assert(nbBits < BIT_MASK_SIZE); in BIT_addBits()
208 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_addBits()
209 bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos; in BIT_addBits()
210 bitC->bitPos += nbBits; in BIT_addBits()
217 size_t value, unsigned nbBits) in BIT_addBitsFast() argument
[all …]
Dentropy_common.c70 int nbBits; in FSE_readNCount_body() local
94 nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */ in FSE_readNCount_body()
95 if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return ERROR(tableLog_tooLarge); in FSE_readNCount_body()
98 *tableLogPtr = nbBits; in FSE_readNCount_body()
99 remaining = (1<<nbBits)+1; in FSE_readNCount_body()
100 threshold = 1<<nbBits; in FSE_readNCount_body()
101 nbBits++; in FSE_readNCount_body()
159 bitCount += nbBits-1; in FSE_readNCount_body()
163 bitCount += nbBits; in FSE_readNCount_body()
186 nbBits = BIT_highbit32(remaining) + 1; in FSE_readNCount_body()
[all …]
Dfse.h330 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits);
348 size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits);
598 unsigned char nbBits; member
619 U32 const nbBits = DInfo.nbBits; in FSE_updateState() local
620 size_t const lowBits = BIT_readBits(bitD, nbBits); in FSE_updateState()
627 U32 const nbBits = DInfo.nbBits; in FSE_decodeSymbol() local
629 size_t const lowBits = BIT_readBits(bitD, nbBits); in FSE_decodeSymbol()
640 U32 const nbBits = DInfo.nbBits; in FSE_decodeSymbolFast() local
642 size_t const lowBits = BIT_readBitsFast(bitD, nbBits); in FSE_decodeSymbolFast()
Dfse_decompress.c169 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in FSE_buildDTable_internal()
170 tableDecode[u].newState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); in FSE_buildDTable_internal()
199 cell->nbBits = 0; in FSE_buildDTable_rle()
205 size_t FSE_buildDTable_raw (FSE_DTable* dt, unsigned nbBits) in FSE_buildDTable_raw() argument
211 const unsigned tableSize = 1 << nbBits; in FSE_buildDTable_raw()
217 if (nbBits < 1) return ERROR(GENERIC); /* min size */ in FSE_buildDTable_raw()
220 DTableH->tableLog = (U16)nbBits; in FSE_buildDTable_raw()
225 dinfo[s].nbBits = (BYTE)nbBits; in FSE_buildDTable_raw()
Dhuf.h141 BYTE nbBits; member
/external/zstd/lib/compress/
Dhuf_compress.c124 huffWeight[n] = bitsToWeight[CTable[n].nbBits]; in HUF_writeCTable()
170 CTable[n].nbBits = (BYTE)(tableLog + 1 - w) & -(w != 0); in HUF_readCTable()
176 { U32 n; for (n=0; n<nbSymbols; n++) nbPerRank[CTable[n].nbBits]++; } in HUF_readCTable()
186 { U32 n; for (n=0; n<nbSymbols; n++) CTable[n].val = valPerRank[CTable[n].nbBits]++; } in HUF_readCTable()
197 return table[symbolValue].nbBits; in HUF_getNbBits()
205 BYTE nbBits; member
230 const U32 largestBits = huffNode[lastNonNull].nbBits; in HUF_setMaxHeight()
243 while (huffNode[n].nbBits > maxNbBits) { in HUF_setMaxHeight()
244 totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits)); in HUF_setMaxHeight()
245 huffNode[n].nbBits = (BYTE)maxNbBits; in HUF_setMaxHeight()
[all …]
Dfse_compress.c204 int nbBits; in FSE_writeNCount_generic() local
221 nbBits = tableLog+1; in FSE_writeNCount_generic()
261 bitCount += nbBits; in FSE_writeNCount_generic()
265 while (remaining<threshold) { nbBits--; threshold>>=1; } in FSE_writeNCount_generic()
501 size_t FSE_buildCTable_raw (FSE_CTable* ct, unsigned nbBits) in FSE_buildCTable_raw() argument
503 const unsigned tableSize = 1 << nbBits; in FSE_buildCTable_raw()
513 if (nbBits < 1) return ERROR(GENERIC); /* min size */ in FSE_buildCTable_raw()
516 tableU16[-2] = (U16) nbBits; in FSE_buildCTable_raw()
524 { const U32 deltaNbBits = (nbBits << 16) - (1 << nbBits); in FSE_buildCTable_raw()
/external/zstd/lib/legacy/
Dzstd_v03.c339 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);
435 MEM_STATIC size_t BIT_lookBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBits() argument
438 …return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMas… in BIT_lookBits()
443 MEM_STATIC size_t BIT_lookBitsFast(BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBitsFast() argument
446 … return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); in BIT_lookBitsFast()
449 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_skipBits() argument
451 bitD->bitsConsumed += nbBits; in BIT_skipBits()
454 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_readBits() argument
456 size_t value = BIT_lookBits(bitD, nbBits); in BIT_readBits()
[all …]
Dzstd_v01.c129 unsigned char nbBits; member
456 tableDecode[i].nbBits = (BYTE) (tableLog - FSE_highbit32 ((U32)nextState) ); in FSE_buildDTable()
457 tableDecode[i].newState = (U16) ( (nextState << tableDecode[i].nbBits) - tableSize); in FSE_buildDTable()
488 int nbBits; in FSE_readNCount() local
498 nbBits = (bitStream & 0xF) + FSE_MIN_TABLELOG; /* extract tableLog */ in FSE_readNCount()
499 if (nbBits > FSE_TABLELOG_ABSOLUTE_MAX) return (size_t)-FSE_ERROR_tableLog_tooLarge; in FSE_readNCount()
502 *tableLogPtr = nbBits; in FSE_readNCount()
503 remaining = (1<<nbBits)+1; in FSE_readNCount()
504 threshold = 1<<nbBits; in FSE_readNCount()
505 nbBits++; in FSE_readNCount()
[all …]
Dzstd_v02.c337 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);
433 MEM_STATIC size_t BIT_lookBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBits() argument
436 …return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMas… in BIT_lookBits()
441 MEM_STATIC size_t BIT_lookBitsFast(BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBitsFast() argument
444 … return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); in BIT_lookBitsFast()
447 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_skipBits() argument
449 bitD->bitsConsumed += nbBits; in BIT_skipBits()
452 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_readBits() argument
454 size_t value = BIT_lookBits(bitD, nbBits); in BIT_readBits()
[all …]
Dzstd_v04.c609 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);
700 MEM_STATIC size_t BIT_lookBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBits() argument
703 …return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMas… in BIT_lookBits()
708 MEM_STATIC size_t BIT_lookBitsFast(BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBitsFast() argument
711 … return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); in BIT_lookBitsFast()
714 MEM_STATIC void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_skipBits() argument
716 bitD->bitsConsumed += nbBits; in BIT_skipBits()
719 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_readBits() argument
721 size_t value = BIT_lookBits(bitD, nbBits); in BIT_readBits()
[all …]
Dzstd_v05.c740 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);
826 MEM_STATIC size_t BITv05_lookBits(BITv05_DStream_t* bitD, U32 nbBits) in BITv05_lookBits() argument
829 …return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMas… in BITv05_lookBits()
834 MEM_STATIC size_t BITv05_lookBitsFast(BITv05_DStream_t* bitD, U32 nbBits) in BITv05_lookBitsFast() argument
837 … return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); in BITv05_lookBitsFast()
840 MEM_STATIC void BITv05_skipBits(BITv05_DStream_t* bitD, U32 nbBits) in BITv05_skipBits() argument
842 bitD->bitsConsumed += nbBits; in BITv05_skipBits()
845 MEM_STATIC size_t BITv05_readBits(BITv05_DStream_t* bitD, unsigned nbBits) in BITv05_readBits() argument
847 size_t value = BITv05_lookBits(bitD, nbBits); in BITv05_readBits()
[all …]
Dzstd_v06.c843 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);
928 MEM_STATIC size_t BITv06_lookBits(const BITv06_DStream_t* bitD, U32 nbBits) in BITv06_lookBits() argument
931 …return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMas… in BITv06_lookBits()
936 MEM_STATIC size_t BITv06_lookBitsFast(const BITv06_DStream_t* bitD, U32 nbBits) in BITv06_lookBitsFast() argument
939 … return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); in BITv06_lookBitsFast()
942 MEM_STATIC void BITv06_skipBits(BITv06_DStream_t* bitD, U32 nbBits) in BITv06_skipBits() argument
944 bitD->bitsConsumed += nbBits; in BITv06_skipBits()
947 MEM_STATIC size_t BITv06_readBits(BITv06_DStream_t* bitD, U32 nbBits) in BITv06_readBits() argument
949 size_t const value = BITv06_lookBits(bitD, nbBits); in BITv06_readBits()
[all …]
Dzstd_v07.c513 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);
596 MEM_STATIC size_t BITv07_lookBits(const BITv07_DStream_t* bitD, U32 nbBits) in BITv07_lookBits() argument
599 …return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask-nbBits) & bitMas… in BITv07_lookBits()
604 MEM_STATIC size_t BITv07_lookBitsFast(const BITv07_DStream_t* bitD, U32 nbBits) in BITv07_lookBitsFast() argument
607 … return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask+1)-nbBits) & bitMask); in BITv07_lookBitsFast()
610 MEM_STATIC void BITv07_skipBits(BITv07_DStream_t* bitD, U32 nbBits) in BITv07_skipBits() argument
612 bitD->bitsConsumed += nbBits; in BITv07_skipBits()
615 MEM_STATIC size_t BITv07_readBits(BITv07_DStream_t* bitD, U32 nbBits) in BITv07_readBits() argument
617 size_t const value = BITv07_lookBits(bitD, nbBits); in BITv07_readBits()
[all …]
/external/zstd/lib/decompress/
Dhuf_decompress.c116 typedef struct { BYTE byte; BYTE nbBits; } HUF_DEltX1; /* single-symbol decoding */ member
122 static U64 HUF_DEltX1_set4(BYTE symbol, BYTE nbBits) { in HUF_DEltX1_set4() argument
125 D4 = symbol + (nbBits << 8); in HUF_DEltX1_set4()
127 D4 = (symbol << 8) + nbBits; in HUF_DEltX1_set4()
222 BYTE const nbBits = (BYTE)(tableLog + 1 - w); in HUF_readDTableX1_wksp_bmi2() local
230 D.nbBits = nbBits; in HUF_readDTableX1_wksp_bmi2()
239 D.nbBits = nbBits; in HUF_readDTableX1_wksp_bmi2()
247 U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); in HUF_readDTableX1_wksp_bmi2()
254 U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); in HUF_readDTableX1_wksp_bmi2()
262 U64 const D4 = HUF_DEltX1_set4(wksp->symbols[symbol + s], nbBits); in HUF_readDTableX1_wksp_bmi2()
[all …]
Dzstd_decompress_block.c355 cell->nbBits = 0; in ZSTD_buildSeqTable_rle()
478 tableDecode[u].nbBits = (BYTE) (tableLog - BIT_highbit32(nextState) ); in ZSTD_buildFSETable_body()
479 tableDecode[u].nextState = (U16) ( (nextState << tableDecode[u].nbBits) - tableSize); in ZSTD_buildFSETable_body()
544 U32 const nbBits = nbAdditionalBits[symbol]; in ZSTD_buildSeqTable() local
545 ZSTD_buildSeqTable_rle(DTableSpace, baseline, nbBits); in ZSTD_buildSeqTable()
915 U32 const nbBits = DInfo.nbBits; in ZSTD_updateFseState() local
916 size_t const lowBits = BIT_readBits(bitD, nbBits); in ZSTD_updateFseState()
923 U32 const nbBits = DInfo.nbBits; in ZSTD_updateFseStateWithDInfo() local
924 size_t const lowBits = BIT_readBits(bitD, nbBits); in ZSTD_updateFseStateWithDInfo()
Dzstd_decompress_internal.h70 BYTE nbBits; member
/external/lz4/tests/
Dframetest.c160 unsigned nbBits = 0; in FUZ_highbit() local
162 while (v32) {v32 >>= 1; nbBits ++;} in FUZ_highbit()
163 return nbBits; in FUZ_highbit()
384 unsigned const nbBits = FUZ_rand(&randState) % maxBits; in basicTests() local
385 size_t iSize = (FUZ_rand(&randState) & ((1<<nbBits)-1)) + 1; in basicTests()
704 unsigned nbBits = FUZ_rand(&randState) % maxBits; in basicTests() local
705 size_t iSize = (FUZ_rand(&randState) & ((1<<nbBits)-1)) + 1; in basicTests()
723 unsigned const nbBits = FUZ_rand(&randState) % maxBits; in basicTests() local
724 size_t iSize = (FUZ_rand(&randState) & ((1<<nbBits)-1)) + 1; in basicTests()
1050 { U32 const nbBits = FUZ_rand(&randState) % maxNbBits; in fuzzerTests() local
[all …]
Dfuzzer.c120 static U32 FUZ_rotl32(U32 u32, U32 nbBits) in FUZ_rotl32() argument
122 return ((u32 << nbBits) | (u32 >> (32 - nbBits))); in FUZ_rotl32()
127 unsigned nbBits = 0; in FUZ_highbit32() local
129 while (v32) { v32 >>= 1; nbBits++; } in FUZ_highbit32()
130 return nbBits; in FUZ_highbit32()
573 { U32 const nbBits = FUZ_rand(&randState) % maxNbBits; in FUZ_test() local
574 size_t const mask = (1<<nbBits) - 1; in FUZ_test()
581 U32 const nbBits = nbBitsCodes ? nbBitsCodes-1 : 0; in FUZ_test() local
582 size_t const mask = (1<<nbBits) - 1; in FUZ_test()
/external/zstd/tests/
Dfuzzer.c109 unsigned nbBits = 0; in FUZ_highbit32() local
111 while (v32) v32 >>= 1, nbBits++; in FUZ_highbit32()
112 return nbBits; in FUZ_highbit32()
3477 { U32 const nbBits = FUZ_rand(&lseed) % maxNbBits; in fuzzerTests() local
3478 size_t const mask = (1<<nbBits) - 1; in fuzzerTests()
3485 U32 const nbBits = nbBitsCodes ? nbBitsCodes-1 : 0; in fuzzerTests() local
3486 size_t const mask = (1<<nbBits) - 1; in fuzzerTests()