ROHC compression/decompression library
|
Compute the interpretation interval for LSB and W-LSB encoding. More...
#include <stdlib.h>
#include <stdint.h>
Go to the source code of this file.
Enumerations | |
enum | rohc_lsb_shift_t { ROHC_LSB_SHIFT_IP_ID = 0, ROHC_LSB_SHIFT_RTP_TS = 2, ROHC_LSB_SHIFT_RTP_SN = 3, ROHC_LSB_SHIFT_ESP_SN = 3, ROHC_LSB_SHIFT_SN = -1, ROHC_LSB_SHIFT_STATS = -1 } |
the different values of the shift parameter of the LSB algorithm More... | |
Functions | |
void | rohc_f_16bits (const uint16_t v_ref, const size_t k, const rohc_lsb_shift_t p, uint16_t *const min, uint16_t *const max) |
The f function as defined in LSB encoding for 16-bit fields. | |
void | rohc_f_32bits (const uint32_t v_ref, const size_t k, const rohc_lsb_shift_t p, uint32_t *const min, uint32_t *const max) |
The f function as defined in LSB encoding for 32-bit fields. |
Compute the interpretation interval for LSB and W-LSB encoding.
enum rohc_lsb_shift_t |
the different values of the shift parameter of the LSB algorithm
The shift parameter is also named 'p' in some RFCs.
Some values are the real values to use directly. Some others are code that means that the real value to use shall be computed from the number of least significant bits that are transmitted.
void rohc_f_16bits | ( | const uint16_t | v_ref, |
const size_t | k, | ||
const rohc_lsb_shift_t | p, | ||
uint16_t *const | min, | ||
uint16_t *const | max | ||
) |
The f function as defined in LSB encoding for 16-bit fields.
Find out the interval for a given k. See 4.5.1 in the RFC 3095 for details.
As stated RFC, the values to be encoded have a finite range and the interpretation interval can straddle the wraparound boundary. So, the min value may be greater than the max value!
v_ref | The reference value |
k | The number of least significant bits of the value that are transmitted |
p | The shift parameter (may be negative) |
min | OUT: The lower limit of the interval |
max | OUT: The upper limit of the interval |
References rohc_f_32bits().
void rohc_f_32bits | ( | const uint32_t | v_ref, |
const size_t | k, | ||
const rohc_lsb_shift_t | p, | ||
uint32_t *const | min, | ||
uint32_t *const | max | ||
) |
The f function as defined in LSB encoding for 32-bit fields.
Find out the interval for a given k. See 4.5.1 in the RFC 3095 for details.
As stated RFC, the values to be encoded have a finite range and the interpretation interval can straddle the wraparound boundary. So, the min value may be greater than the max value!
v_ref | The reference value |
k | The number of least significant bits of the value that are transmitted |
p | The shift parameter (may be negative) |
min | OUT: The lower limit of the interval |
max | OUT: The upper limit of the interval |
References ROHC_LSB_SHIFT_RTP_SN, and ROHC_LSB_SHIFT_RTP_TS.
Referenced by rohc_f_16bits(), and rohc_lsb_decode32().