ROHC compression/decompression library
|
Self-Describing Variable-Length (SDVL) encoding. More...
Enumerations | |
enum | rohc_sdvl_max_value_t { ROHC_SDVL_MAX_VALUE_IN_1_BYTE = ((1 << ROHC_SDVL_MAX_BITS_IN_1_BYTE) - 1), ROHC_SDVL_MAX_VALUE_IN_2_BYTES = ((1 << ROHC_SDVL_MAX_BITS_IN_2_BYTES) - 1), ROHC_SDVL_MAX_VALUE_IN_3_BYTES = ((1 << ROHC_SDVL_MAX_BITS_IN_3_BYTES) - 1), ROHC_SDVL_MAX_VALUE_IN_4_BYTES = ((1 << ROHC_SDVL_MAX_BITS_IN_4_BYTES) - 1) } |
Functions | |
bool | sdvl_can_value_be_encoded (const uint32_t value) |
Can the given value be encoded with SDVL? | |
bool | sdvl_can_length_be_encoded (const size_t bits_nr) |
Is the given length (in bits) compatible with SDVL? | |
size_t | sdvl_get_min_len (const size_t nr_min_required, const size_t nr_encoded) |
Find out how many SDVL bits are needed to represent a value. | |
size_t | sdvl_get_encoded_len (const uint32_t value) |
Find out how many bytes are needed to represent the value using Self-Describing Variable-Length (SDVL) encoding. | |
bool | sdvl_encode (uint8_t *const sdvl_bytes, const size_t sdvl_bytes_max_nr, size_t *const sdvl_bytes_nr, const uint32_t value, const size_t bits_nr) |
Encode a value using Self-Describing Variable-Length (SDVL) encoding. | |
bool | sdvl_encode_full (uint8_t *const sdvl_bytes, const size_t sdvl_bytes_max_nr, size_t *const sdvl_bytes_nr, const uint32_t value) |
Encode a value using Self-Describing Variable-Length (SDVL) encoding. | |
size_t | sdvl_decode (const uint8_t *const data, const size_t length, uint32_t *const value, size_t *const bits_nr) |
Decode a Self-Describing Variable-Length (SDVL) value. |
Self-Describing Variable-Length (SDVL) encoding.
The maximum values that can be SDVL-encoded in 1, 2, 3 and 4 bytes
bool sdvl_can_length_be_encoded | ( | const size_t | bits_nr | ) |
Is the given length (in bits) compatible with SDVL?
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
bits_nr | The length (in bits) of the value to encode |
bool sdvl_can_value_be_encoded | ( | const uint32_t | value | ) |
Can the given value be encoded with SDVL?
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
value | The value to encode |
size_t sdvl_decode | ( | const uint8_t *const | data, |
const size_t | length, | ||
uint32_t *const | value, | ||
size_t *const | bits_nr | ||
) |
Decode a Self-Describing Variable-Length (SDVL) value.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
data | The SDVL data to decode |
length | The maximum data length available (in bytes) |
value | OUT: The decoded value |
bits_nr | OUT: The number of useful bits |
bool sdvl_encode | ( | uint8_t *const | sdvl_bytes, |
const size_t | sdvl_bytes_max_nr, | ||
size_t *const | sdvl_bytes_nr, | ||
const uint32_t | value, | ||
const size_t | bits_nr | ||
) |
Encode a value using Self-Describing Variable-Length (SDVL) encoding.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
Encoding failures may be due to a value greater than 2^29.
sdvl_bytes | IN/OUT: The SDVL-encoded bytes |
sdvl_bytes_max_nr | The maximum available free bytes for SDVL |
sdvl_bytes_nr | OUT: The number of SDVL bytes written |
value | The value to encode |
bits_nr | The number of bits to encode |
bool sdvl_encode_full | ( | uint8_t *const | sdvl_bytes, |
const size_t | sdvl_bytes_max_nr, | ||
size_t *const | sdvl_bytes_nr, | ||
const uint32_t | value | ||
) |
Encode a value using Self-Describing Variable-Length (SDVL) encoding.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
Encoding failures may be due to a value greater than 2^29.
sdvl_bytes | IN/OUT: The SDVL-encoded bytes |
sdvl_bytes_max_nr | The maximum available free bytes for SDVL |
sdvl_bytes_nr | OUT: The number of SDVL bytes written |
value | The value to encode |
size_t sdvl_get_encoded_len | ( | const uint32_t | value | ) |
Find out how many bytes are needed to represent the value using Self-Describing Variable-Length (SDVL) encoding.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
value | The value to encode |
size_t sdvl_get_min_len | ( | const size_t | nr_min_required, |
const size_t | nr_encoded | ||
) |
Find out how many SDVL bits are needed to represent a value.
The number of bits already encoded in another field may be specified.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
nr_min_required | The minimum required number of bits to encode |
nr_encoded | The number of bits already encoded in another field |