Lines Matching refs:n_bits
59 uint8_t n_bits; member
322 int n_bits) in extract_bits() argument
326 int n_bits_in_byte = MIN2(n_bits, 8 - bit_index); in extract_bits()
334 n_bits -= n_bits_in_byte; in extract_bits()
336 if (n_bits <= 0) in extract_bits()
342 n_bits_in_byte = MIN2(n_bits, 8); in extract_bits()
348 int n_bits) in expand_component() argument
353 return byte << (8 - n_bits) | (byte >> (2 * n_bits - 8)); in expand_component()
703 int n_bits) in sign_extend() argument
705 if ((value & (1 << (n_bits - 1)))) { in sign_extend()
706 value |= (~(int32_t) 0) << n_bits; in sign_extend()
777 value = extract_bits(block, bit_offset, bitfield->n_bits); in extract_float_endpoints()
778 bit_offset += bitfield->n_bits; in extract_float_endpoints()
781 for (i = 0; i < bitfield->n_bits; i++) { in extract_float_endpoints()
784 1 << ((bitfield->n_bits - 1 - i) + bitfield->offset); in extract_float_endpoints()
970 write_bits(struct bit_writer *writer, int n_bits, int value) in write_bits() argument
973 if (n_bits + writer->pos >= 8) { in write_bits()
977 n_bits -= (8 - writer->pos); in write_bits()
981 writer->pos += n_bits; in write_bits()
984 } while (n_bits > 0); in write_bits()