Lines Matching refs:bitContainer
49 size_t bitContainer; member
83 size_t bitContainer; member
172 bitC->bitContainer = 0; in BIT_initCStream()
176 bitC->endPtr = bitC->startPtr + dstCapacity - sizeof(bitC->bitContainer); in BIT_initCStream()
177 if (dstCapacity <= sizeof(bitC->bitContainer)) return ERROR(dstSize_tooSmall); in BIT_initCStream()
189 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_addBits()
190 bitC->bitContainer |= (value & BIT_mask[nbBits]) << bitC->bitPos; in BIT_addBits()
201 assert(nbBits + bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_addBitsFast()
202 bitC->bitContainer |= value << bitC->bitPos; in BIT_addBitsFast()
212 assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_flushBitsFast()
214 MEM_writeLEST(bitC->ptr, bitC->bitContainer); in BIT_flushBitsFast()
217 bitC->bitContainer >>= nbBytes*8; in BIT_flushBitsFast()
228 assert(bitC->bitPos < sizeof(bitC->bitContainer) * 8); in BIT_flushBits()
230 MEM_writeLEST(bitC->ptr, bitC->bitContainer); in BIT_flushBits()
234 bitC->bitContainer >>= nbBytes*8; in BIT_flushBits()
263 bitD->limitPtr = bitD->start + sizeof(bitD->bitContainer); in BIT_initDStream()
265 if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ in BIT_initDStream()
266 bitD->ptr = (const char*)srcBuffer + srcSize - sizeof(bitD->bitContainer); in BIT_initDStream()
267 bitD->bitContainer = MEM_readLEST(bitD->ptr); in BIT_initDStream()
273 bitD->bitContainer = *(const BYTE*)(bitD->start); in BIT_initDStream()
276 …case 7: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[6]) << (sizeof(bitD->bitContaine… in BIT_initDStream()
279 …case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContaine… in BIT_initDStream()
282 …case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContaine… in BIT_initDStream()
285 case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24; in BIT_initDStream()
288 case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16; in BIT_initDStream()
291 case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8; in BIT_initDStream()
300 bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize)*8; in BIT_initDStream()
306 MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getUpperBits(size_t bitContainer, U32 const start) in BIT_getUpperBits() argument
308 return bitContainer >> start; in BIT_getUpperBits()
311 MEM_STATIC FORCE_INLINE_ATTR size_t BIT_getMiddleBits(size_t bitContainer, U32 const start, U32 con… in BIT_getMiddleBits() argument
313 U32 const regMask = sizeof(bitContainer)*8 - 1; 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
331 return bitContainer & BIT_mask[nbBits]; in BIT_getLowerBits()
346 …return BIT_getMiddleBits(bitD->bitContainer, (sizeof(bitD->bitContainer)*8) - bitD->bitsConsumed -… in BIT_lookBits()
349 U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; in BIT_lookBits()
350 …return ((bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> 1) >> ((regMask-nbBits) & regMas… in BIT_lookBits()
358 U32 const regMask = sizeof(bitD->bitContainer)*8 - 1; in BIT_lookBitsFast()
360 … return (bitD->bitContainer << (bitD->bitsConsumed & regMask)) >> (((regMask+1)-nbBits) & regMask); in BIT_lookBitsFast()
399 assert(bitD->bitsConsumed <= sizeof(bitD->bitContainer)*8); in BIT_reloadDStreamFast()
402 bitD->bitContainer = MEM_readLEST(bitD->ptr); in BIT_reloadDStreamFast()
413 …if (bitD->bitsConsumed > (sizeof(bitD->bitContainer)*8)) /* overflow detected, like end of stream… in BIT_reloadDStream()
420 if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer; in BIT_reloadDStream()
432 …bitD->bitContainer = MEM_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD->bitContainer)… in BIT_reloadDStream()
442 …n ((DStream->ptr == DStream->start) && (DStream->bitsConsumed == sizeof(DStream->bitContainer)*8)); in BIT_endOfDStream()