| ROHC compression/decompression library
   
    | 
Self-Describing Variable-Length (SDVL) encoding. More...


Go to the source code of this file.
| Enumerations | |
| enum | rohc_sdvl_max_bits_t { ROHC_SDVL_MAX_BITS_IN_1_BYTE = 7U, ROHC_SDVL_MAX_BITS_IN_2_BYTES = 14U, ROHC_SDVL_MAX_BITS_IN_3_BYTES = 21U, ROHC_SDVL_MAX_BITS_IN_4_BYTES = 29U } | 
| Functions | |
| bool ROHC_EXPORT | sdvl_can_value_be_encoded (uint32_t value) | 
| Can the given value be encoded with SDVL? | |
| bool ROHC_EXPORT | sdvl_can_length_be_encoded (size_t bits_nr) | 
| Is the given length (in bits) compatible with SDVL? | |
| size_t ROHC_EXPORT | 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 ROHC_EXPORT | c_bytesSdvl (uint32_t value, size_t length) | 
| Find out how many bytes are needed to represent the value using Self-Describing Variable-Length (SDVL) encoding. | |
| int ROHC_EXPORT | c_encodeSdvl (unsigned char *dest, uint32_t value, size_t length) | 
| Encode a value using Self-Describing Variable-Length (SDVL) encoding. | |
| int ROHC_EXPORT | d_sdvalue_size (const unsigned char *data) | 
| Find out a size of the Self-Describing Variable-Length (SDVL) value. | |
| size_t ROHC_EXPORT | sdvl_decode (const unsigned char *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.
| enum rohc_sdvl_max_bits_t | 
The maximum numbers of bits that can be SDVL-encoded in 1, 2, 3 and 4 bytes
| size_t ROHC_EXPORT c_bytesSdvl | ( | uint32_t | value, | 
| size_t | length | ||
| ) | 
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 | 
| length | The length of the value to encode (0 to let the SDVL encoding find the length itself) | 
References rohc_debugf, ROHC_SDVL_MAX_BITS_IN_1_BYTE, ROHC_SDVL_MAX_BITS_IN_2_BYTES, ROHC_SDVL_MAX_BITS_IN_3_BYTES, ROHC_SDVL_MAX_BITS_IN_4_BYTES, ROHC_SDVL_MAX_VALUE_IN_1_BYTE, ROHC_SDVL_MAX_VALUE_IN_2_BYTES, ROHC_SDVL_MAX_VALUE_IN_3_BYTES, and ROHC_SDVL_MAX_VALUE_IN_4_BYTES.
Referenced by c_encodeSdvl(), code_cid_values(), code_EXT3_packet(), f_append_cid(), rtp_code_dynamic_rtp_part(), and rtp_header_flags_and_fields().
| int ROHC_EXPORT c_encodeSdvl | ( | unsigned char * | dest, | 
| uint32_t | value, | ||
| size_t | length | ||
| ) | 
Encode a value using Self-Describing Variable-Length (SDVL) encoding.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
| dest | The destination to write the SDVL-encoded to | 
| value | The value to encode | 
| length | The length of the value to encode (0 to let the SDVL encoding find the length itself) | 
References c_bytesSdvl(), and rohc_debugf.
Referenced by code_cid_values(), code_EXT3_packet(), f_append_cid(), rtp_code_dynamic_rtp_part(), and rtp_header_flags_and_fields().
| int ROHC_EXPORT d_sdvalue_size | ( | const unsigned char * | data | ) | 
Find out a size of the Self-Describing Variable-Length (SDVL) value.
See 4.5.6 in the RFC 3095 for details about SDVL encoding.
| data | The SDVL data to analyze | 
References GET_BIT_5_7, GET_BIT_6_7, GET_BIT_7, and rohc_debugf.
| bool ROHC_EXPORT sdvl_can_length_be_encoded | ( | 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 | 
References ROHC_SDVL_MAX_BITS_IN_4_BYTES.
| bool ROHC_EXPORT sdvl_can_value_be_encoded | ( | 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 | 
References ROHC_SDVL_MAX_VALUE_IN_4_BYTES.
Referenced by c_add_ts().
| size_t ROHC_EXPORT sdvl_decode | ( | const unsigned char * | 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 | 
References GET_BIT_0_4, GET_BIT_0_5, GET_BIT_0_6, GET_BIT_0_7, GET_BIT_5_7, GET_BIT_6_7, GET_BIT_7, rohc_debugf, ROHC_SDVL_MAX_BITS_IN_1_BYTE, ROHC_SDVL_MAX_BITS_IN_2_BYTES, ROHC_SDVL_MAX_BITS_IN_3_BYTES, and ROHC_SDVL_MAX_BITS_IN_4_BYTES.
Referenced by c_deliver_feedback().
| size_t ROHC_EXPORT 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 | 
References ROHC_SDVL_MAX_BITS_IN_1_BYTE, ROHC_SDVL_MAX_BITS_IN_2_BYTES, ROHC_SDVL_MAX_BITS_IN_3_BYTES, and ROHC_SDVL_MAX_BITS_IN_4_BYTES.
Referenced by code_UOR2_ID_bytes(), code_UOR2_RTP_bytes(), and code_UOR2_TS_bytes().
 1.7.6.1
 1.7.6.1