MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / read_bits

Function read_bits

Source/astcenc_integer_sequence.cpp:478–490  ·  view source on GitHub ↗

* @brief Read up to 16 bits from two bytes. * * This function reads a packed N-bit field from two bytes in memory. The stored value must exist * within the two bytes, but can start at an arbitrary bit offset and span the two bytes in memory. * * @param bitcount The number of bits to read. * @param bitoffset The bit offset to read from, between 0 and 7. * @param[in,out]

Source from the content-addressed store, hash-verified

476 * @return The read value.
477 */
478static inline unsigned int read_bits(
479 unsigned int bitcount,
480 unsigned int bitoffset,
481 const uint8_t* ptr
482) {
483 unsigned int mask = (1 << bitcount) - 1;
484 ptr += bitoffset >> 3;
485 bitoffset &= 7;
486 unsigned int value = ptr[0] | (ptr[1] << 8);
487 value >>= bitoffset;
488 value &= mask;
489 return value;
490}
491
492/* See header for documentation. */
493void encode_ise(

Callers 1

decode_iseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected