bitD 118 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_initDStream(BIT_DStream_t *bitD, const void *srcBuffer, size_t srcSize); bitD 119 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_readBits(BIT_DStream_t *bitD, unsigned nbBits); bitD 120 lib/zstd/bitstream.h ZSTD_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t *bitD); bitD 121 lib/zstd/bitstream.h ZSTD_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t *bitD); bitD 142 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_readBitsFast(BIT_DStream_t *bitD, unsigned nbBits); bitD 239 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_initDStream(BIT_DStream_t *bitD, const void *srcBuffer, size_t srcSize) bitD 242 lib/zstd/bitstream.h memset(bitD, 0, sizeof(*bitD)); bitD 246 lib/zstd/bitstream.h if (srcSize >= sizeof(bitD->bitContainer)) { /* normal case */ bitD 247 lib/zstd/bitstream.h bitD->start = (const char *)srcBuffer; bitD 248 lib/zstd/bitstream.h bitD->ptr = (const char *)srcBuffer + srcSize - sizeof(bitD->bitContainer); bitD 249 lib/zstd/bitstream.h bitD->bitContainer = ZSTD_readLEST(bitD->ptr); bitD 252 lib/zstd/bitstream.h bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; /* ensures bitsConsumed is always set */ bitD 257 lib/zstd/bitstream.h bitD->start = (const char *)srcBuffer; bitD 258 lib/zstd/bitstream.h bitD->ptr = bitD->start; bitD 259 lib/zstd/bitstream.h bitD->bitContainer = *(const BYTE *)(bitD->start); bitD 261 lib/zstd/bitstream.h case 7: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[6]) << (sizeof(bitD->bitContainer) * 8 - 16); bitD 263 lib/zstd/bitstream.h case 6: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[5]) << (sizeof(bitD->bitContainer) * 8 - 24); bitD 265 lib/zstd/bitstream.h case 5: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[4]) << (sizeof(bitD->bitContainer) * 8 - 32); bitD 267 lib/zstd/bitstream.h case 4: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[3]) << 24; bitD 269 lib/zstd/bitstream.h case 3: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[2]) << 16; bitD 271 lib/zstd/bitstream.h case 2: bitD->bitContainer += (size_t)(((const BYTE *)(srcBuffer))[1]) << 8; bitD 276 lib/zstd/bitstream.h bitD->bitsConsumed = lastByte ? 8 - BIT_highbit32(lastByte) : 0; bitD 280 lib/zstd/bitstream.h bitD->bitsConsumed += (U32)(sizeof(bitD->bitContainer) - srcSize) * 8; bitD 299 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_lookBits(const BIT_DStream_t *bitD, U32 nbBits) bitD 301 lib/zstd/bitstream.h U32 const bitMask = sizeof(bitD->bitContainer) * 8 - 1; bitD 302 lib/zstd/bitstream.h return ((bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> 1) >> ((bitMask - nbBits) & bitMask); bitD 307 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_lookBitsFast(const BIT_DStream_t *bitD, U32 nbBits) bitD 309 lib/zstd/bitstream.h U32 const bitMask = sizeof(bitD->bitContainer) * 8 - 1; bitD 310 lib/zstd/bitstream.h return (bitD->bitContainer << (bitD->bitsConsumed & bitMask)) >> (((bitMask + 1) - nbBits) & bitMask); bitD 313 lib/zstd/bitstream.h ZSTD_STATIC void BIT_skipBits(BIT_DStream_t *bitD, U32 nbBits) { bitD->bitsConsumed += nbBits; } bitD 320 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_readBits(BIT_DStream_t *bitD, U32 nbBits) bitD 322 lib/zstd/bitstream.h size_t const value = BIT_lookBits(bitD, nbBits); bitD 323 lib/zstd/bitstream.h BIT_skipBits(bitD, nbBits); bitD 329 lib/zstd/bitstream.h ZSTD_STATIC size_t BIT_readBitsFast(BIT_DStream_t *bitD, U32 nbBits) bitD 331 lib/zstd/bitstream.h size_t const value = BIT_lookBitsFast(bitD, nbBits); bitD 332 lib/zstd/bitstream.h BIT_skipBits(bitD, nbBits); bitD 341 lib/zstd/bitstream.h ZSTD_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t *bitD) bitD 343 lib/zstd/bitstream.h if (bitD->bitsConsumed > (sizeof(bitD->bitContainer) * 8)) /* should not happen => corruption detected */ bitD 346 lib/zstd/bitstream.h if (bitD->ptr >= bitD->start + sizeof(bitD->bitContainer)) { bitD 347 lib/zstd/bitstream.h bitD->ptr -= bitD->bitsConsumed >> 3; bitD 348 lib/zstd/bitstream.h bitD->bitsConsumed &= 7; bitD 349 lib/zstd/bitstream.h bitD->bitContainer = ZSTD_readLEST(bitD->ptr); bitD 352 lib/zstd/bitstream.h if (bitD->ptr == bitD->start) { bitD 353 lib/zstd/bitstream.h if (bitD->bitsConsumed < sizeof(bitD->bitContainer) * 8) bitD 358 lib/zstd/bitstream.h U32 nbBytes = bitD->bitsConsumed >> 3; bitD 360 lib/zstd/bitstream.h if (bitD->ptr - nbBytes < bitD->start) { bitD 361 lib/zstd/bitstream.h nbBytes = (U32)(bitD->ptr - bitD->start); /* ptr > start */ bitD 364 lib/zstd/bitstream.h bitD->ptr -= nbBytes; bitD 365 lib/zstd/bitstream.h bitD->bitsConsumed -= nbBytes * 8; bitD 366 lib/zstd/bitstream.h bitD->bitContainer = ZSTD_readLEST(bitD->ptr); /* reminder : srcSize > sizeof(bitD) */ bitD 358 lib/zstd/fse.h static void FSE_initDState(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD, const FSE_DTable *dt); bitD 360 lib/zstd/fse.h static unsigned char FSE_decodeSymbol(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD); bitD 416 lib/zstd/fse.h static unsigned char FSE_decodeSymbolFast(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD); bitD 481 lib/zstd/fse.h ZSTD_STATIC void FSE_initDState(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD, const FSE_DTable *dt) bitD 485 lib/zstd/fse.h DStatePtr->state = BIT_readBits(bitD, DTableH->tableLog); bitD 486 lib/zstd/fse.h BIT_reloadDStream(bitD); bitD 496 lib/zstd/fse.h ZSTD_STATIC void FSE_updateState(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD) bitD 500 lib/zstd/fse.h size_t const lowBits = BIT_readBits(bitD, nbBits); bitD 504 lib/zstd/fse.h ZSTD_STATIC BYTE FSE_decodeSymbol(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD) bitD 509 lib/zstd/fse.h size_t const lowBits = BIT_readBits(bitD, nbBits); bitD 517 lib/zstd/fse.h ZSTD_STATIC BYTE FSE_decodeSymbolFast(FSE_DState_t *DStatePtr, BIT_DStream_t *bitD) bitD 522 lib/zstd/fse.h size_t const lowBits = BIT_readBitsFast(bitD, nbBits); bitD 222 lib/zstd/fse_decompress.c BIT_DStream_t bitD; bitD 227 lib/zstd/fse_decompress.c CHECK_F(BIT_initDStream(&bitD, cSrc, cSrcSize)); bitD 229 lib/zstd/fse_decompress.c FSE_initDState(&state1, &bitD, dt); bitD 230 lib/zstd/fse_decompress.c FSE_initDState(&state2, &bitD, dt); bitD 232 lib/zstd/fse_decompress.c #define FSE_GETSYMBOL(statePtr) fast ? FSE_decodeSymbolFast(statePtr, &bitD) : FSE_decodeSymbol(statePtr, &bitD) bitD 235 lib/zstd/fse_decompress.c for (; (BIT_reloadDStream(&bitD) == BIT_DStream_unfinished) & (op < olimit); op += 4) { bitD 238 lib/zstd/fse_decompress.c if (FSE_MAX_TABLELOG * 2 + 7 > sizeof(bitD.bitContainer) * 8) /* This test must be static */ bitD 239 lib/zstd/fse_decompress.c BIT_reloadDStream(&bitD); bitD 243 lib/zstd/fse_decompress.c if (FSE_MAX_TABLELOG * 4 + 7 > sizeof(bitD.bitContainer) * 8) /* This test must be static */ bitD 245 lib/zstd/fse_decompress.c if (BIT_reloadDStream(&bitD) > BIT_DStream_unfinished) { bitD 253 lib/zstd/fse_decompress.c if (FSE_MAX_TABLELOG * 2 + 7 > sizeof(bitD.bitContainer) * 8) /* This test must be static */ bitD 254 lib/zstd/fse_decompress.c BIT_reloadDStream(&bitD); bitD 265 lib/zstd/fse_decompress.c if (BIT_reloadDStream(&bitD) == BIT_DStream_overflow) { bitD 273 lib/zstd/fse_decompress.c if (BIT_reloadDStream(&bitD) == BIT_DStream_overflow) { bitD 205 lib/zstd/huf_decompress.c BIT_DStream_t bitD; bitD 210 lib/zstd/huf_decompress.c size_t const errorCode = BIT_initDStream(&bitD, cSrc, cSrcSize); bitD 215 lib/zstd/huf_decompress.c HUF_decodeStreamX2(op, &bitD, oend, dt, dtLog); bitD 218 lib/zstd/huf_decompress.c if (!BIT_endOfDStream(&bitD)) bitD 657 lib/zstd/huf_decompress.c BIT_DStream_t bitD; bitD 661 lib/zstd/huf_decompress.c size_t const errorCode = BIT_initDStream(&bitD, cSrc, cSrcSize); bitD 673 lib/zstd/huf_decompress.c HUF_decodeStreamX4(ostart, &bitD, oend, dt, dtd.tableLog); bitD 677 lib/zstd/huf_decompress.c if (!BIT_endOfDStream(&bitD))