uint32_t read_entity_header(uint32_t *base, Bitstream &stream) { uint32_t value = stream.get_bits(6); if (value & 0x30) { uint32_t a = (value >> 4) & 3; uint32_t b = (a == 3) ? 16 : 0; value = stream.get_bits(4 * a + b) << 4 | (value & 0xF); }