OI_BITSTREAM_READUINT macro
This is declared here as a macro because decoder.c breaks the bitsream encapsulation for efficiency reasons.
Syntax
#define OI_BITSTREAM_READUINT(result, bits, ptr, value, bitPtr) \
do { \
OI_ASSERT((bits) <= 16); \
OI_ASSERT((bitPtr) < 16); \
OI_ASSERT((bitPtr) >= 8); \
\
result = (value) << (bitPtr); \
result >>= 32 - (bits); \
\
bitPtr += (bits); \
while (bitPtr >= 16) { \
value = ((value) << 8) | *ptr++; \
bitPtr -= 8; \
} \
OI_ASSERT((bits == 0) || (result < (1u << (bits)))); \
} while (0)