FastLED 3.9.15
Loading...
Searching...
No Matches

◆ RefillBitstreamCache()

static __inline void fl::third_party::RefillBitstreamCache ( BitStreamInfo * bsi)
static

Definition at line 92 of file bitstream.hpp.

93{
94 int32_t nBytes = bsi->nBytes;
95
96 /* optimize for common case, independent of machine endian-ness */
97 if (nBytes >= 4) {
98 bsi->iCache = ((uint32_t)(*bsi->bytePtr++)) << 24;
99 bsi->iCache |= ((uint32_t)(*bsi->bytePtr++)) << 16;
100 bsi->iCache |= ((uint32_t)(*bsi->bytePtr++)) << 8;
101 bsi->iCache |= ((uint32_t)(*bsi->bytePtr++));
102 bsi->cachedBits = 32;
103 bsi->nBytes -= 4;
104 } else {
105 bsi->iCache = 0;
106 while (nBytes--) {
107 bsi->iCache |= (*bsi->bytePtr++);
108 bsi->iCache <<= 8;
109 }
110 bsi->iCache <<= ((3 - bsi->nBytes)*8);
111 bsi->cachedBits = 8*bsi->nBytes;
112 bsi->nBytes = 0;
113 }
114}
fl::u32 uint32_t
Definition coder.h:219
fl::i32 int32_t
Definition coder.h:220
const unsigned char * bytePtr
Definition coder.h:154

References FL_NOEXCEPT.

Referenced by GetBits().

+ Here is the caller graph for this function: