ROHC compression/decompression library
|
Least Significant Bits (LSB) encoding. More...
#include "lsb.h"
Functions | |
void | d_lsb_init (struct d_lsb_decode *s, int v_ref_d, int p) |
Initialize a Least Significant Bits (LSB) encoding object. | |
int | d_lsb_decode (struct d_lsb_decode *s, int m, int k) |
Decode a LSB-encoded value. | |
void | d_lsb_update (struct d_lsb_decode *s, int v_ref_d) |
Update the LSB reference value. | |
void | d_lsb_sync_ref (struct d_lsb_decode *s) |
Replace the previous LSB reference value with the current one. | |
int | d_get_lsb_old_ref (struct d_lsb_decode *s) |
Get the previous LSB reference value. | |
int | d_get_lsb_ref (struct d_lsb_decode *s) |
Get the current LSB reference value. |
Least Significant Bits (LSB) encoding.
int d_get_lsb_old_ref | ( | struct d_lsb_decode * | s | ) |
Get the previous LSB reference value.
s | The LSB object |
References d_lsb_decode::old_v_ref_d.
Referenced by act_on_crc_failure().
int d_get_lsb_ref | ( | struct d_lsb_decode * | s | ) |
Get the current LSB reference value.
s | The LSB object |
References d_lsb_decode::v_ref_d.
Referenced by act_on_crc_failure(), d_decode_ts(), and d_generic_get_sn().
int d_lsb_decode | ( | struct d_lsb_decode * | s, |
int | m, | ||
int | k | ||
) |
Decode a LSB-encoded value.
See 4.5.1 in the RFC 3095 for details about LSB encoding.
s | The LSB object used to decode |
m | The LSB value to decode |
k | The length of the LSB value to decode |
References f(), d_lsb_decode::p, and d_lsb_decode::v_ref_d.
Referenced by act_on_crc_failure(), d_decode_ts(), decode_extension3(), and do_decode_uor2().
void d_lsb_init | ( | struct d_lsb_decode * | s, |
int | v_ref_d, | ||
int | p | ||
) |
Initialize a Least Significant Bits (LSB) encoding object.
See 4.5.1 in the RFC 3095 for details about LSB encoding.
s | The LSB object to initialize |
v_ref_d | The reference value |
p | The p value used to efficiently encode the values |
References d_lsb_decode::old_v_ref_d, d_lsb_decode::p, and d_lsb_decode::v_ref_d.
Referenced by ip_decode_dynamic_ip(), and rtp_decode_dynamic_rtp().
void d_lsb_sync_ref | ( | struct d_lsb_decode * | s | ) |
Replace the previous LSB reference value with the current one.
s | The LSB object |
References d_lsb_decode::old_v_ref_d, and d_lsb_decode::v_ref_d.
Referenced by act_on_crc_failure(), decode_uo0(), decode_uo1(), decode_uor2(), and update_ts_sc().
void d_lsb_update | ( | struct d_lsb_decode * | s, |
int | v_ref_d | ||
) |
Update the LSB reference value.
This function is called after a CRC success to update the last decoded value (for example, the SN value). See 4.5.1 in the RFC 3095 for details about LSB encoding.
s | The LSB object |
v_ref_d | The new reference value |
References d_lsb_decode::v_ref_d.
Referenced by act_on_crc_failure(), decode_uo0(), decode_uo1(), decode_uor2(), and update_ts_sc().