Lines Matching refs:nbBits
57 MEM_STATIC void BIT_addBits(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
97 MEM_STATIC size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
116 MEM_STATIC void BIT_addBitsFast(BIT_CStream_t* bitC, size_t value, unsigned nbBits);
122 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits);
185 size_t value, unsigned nbBits) in BIT_addBits() argument
188 assert(nbBits < BIT_MASK_SIZE); in BIT_addBits()
189 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_addBits()
190 bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos; in BIT_addBits()
191 bitC->bitPos += nbBits; in BIT_addBits()
198 size_t value, unsigned nbBits) in BIT_addBitsFast() argument
200 assert((value>>nbBits) == 0); in BIT_addBitsFast()
201 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_addBitsFast()
203 bitC->bitPos += nbBits; in BIT_addBitsFast()
311 … FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 const nbBits) in BIT_getMiddleBits() argument
315 assert(nbBits < BIT_MASK_SIZE); in BIT_getMiddleBits()
322 return (bitContainer >> (start & regMask)) & ((((U64)1) << nbBits) - 1); in BIT_getMiddleBits()
324 return (bitContainer >> (start & regMask)) & BIT_mask[nbBits]; in BIT_getMiddleBits()
328 MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getLowerBits(size_t bitContainer, U32 const nbBits) in BIT_getLowerBits() argument
330 assert(nbBits < BIT_MASK_SIZE); in BIT_getLowerBits()
331 return bitContainer & BIT_mask[nbBits]; in BIT_getLowerBits()
340 MEM_STATIC FORCE_INLINE_ATTR size_t BIT_lookBits(const BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBits() argument
346 …ddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed - nbBits, nbBits); in BIT_lookBits()
350 …return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMas… in BIT_lookBits()
356 MEM_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t* bitD, U32 nbBits) in BIT_lookBitsFast() argument
359 assert(nbBits >= 1); in BIT_lookBitsFast()
360 … return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); in BIT_lookBitsFast()
363 MEM_STATIC FORCE_INLINE_ATTR void BIT_skipBits(BIT_DStream_t* bitD, U32 nbBits) in BIT_skipBits() argument
365 bitD->bitsConsumed += nbBits; in BIT_skipBits()
372 MEM_STATIC FORCE_INLINE_ATTR size_t BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits) in BIT_readBits() argument
374 size_t const value = BIT_lookBits(bitD, nbBits); in BIT_readBits()
375 BIT_skipBits(bitD, nbBits); in BIT_readBits()
381 MEM_STATIC size_t BIT_readBitsFast(BIT_DStream_t* bitD, unsigned nbBits) in BIT_readBitsFast() argument
383 size_t const value = BIT_lookBitsFast(bitD, nbBits); in BIT_readBitsFast()
384 assert(nbBits >= 1); in BIT_readBitsFast()
385 BIT_skipBits(bitD, nbBits); in BIT_readBitsFast()