bits.c File Reference
soft, unpacked and packed bits
`#include <stdint.h>`
`#include <osmocom/core/bits.h>`

## Functions

int | osmo_ubit2pbit (pbit_t *out, const ubit_t *in, unsigned int num_bits)
| convert unpacked bits to packed bits, return length in bytes More...
void | osmo_nibble_shift_right (uint8_t *out, const uint8_t *in, unsigned int num_nibbles)
| Shift unaligned input to octet-aligned output. More...
void | osmo_nibble_shift_left_unal (uint8_t *out, const uint8_t *in, unsigned int num_nibbles)
| Shift unaligned input to octet-aligned output. More...
void | osmo_ubit2sbit (sbit_t *out, const ubit_t *in, unsigned int num_bits)
| convert unpacked bits to soft bits More...
void | osmo_sbit2ubit (ubit_t *out, const sbit_t *in, unsigned int num_bits)
| convert soft bits to unpacked bits More...
int | osmo_pbit2ubit (ubit_t *out, const pbit_t *in, unsigned int num_bits)
| convert packed bits to unpacked bits, return length in bytes More...
int | osmo_ubit2pbit_ext (pbit_t *out, unsigned int out_ofs, const ubit_t *in, unsigned int in_ofs, unsigned int num_bits, int lsb_mode)
| convert unpacked bits to packed bits (extended options) More...
int | osmo_pbit2ubit_ext (ubit_t *out, unsigned int out_ofs, const pbit_t *in, unsigned int in_ofs, unsigned int num_bits, int lsb_mode)
| convert packed bits to unpacked bits (extended options) More...
uint32_t | osmo_bit_reversal (uint32_t x, enum osmo_br_mode k)
| generalized bit reversal function More...
uint32_t | osmo_revbytebits_32 (uint32_t x)
| reverse the bit-order in each byte of a dword More...
uint32_t | osmo_revbytebits_8 (uint8_t x)
| reverse the bit order in a byte More...
void | osmo_revbytebits_buf (uint8_t *buf, int len)
| reverse bit-order of each byte in a buffer More...

## Variables

static const uint8_t | flip_table [256]