ROHC compression/decompression library
|
Window-based Least Significant Bits (W-LSB) encoding. More...
Functions | |
void | c_ack_remove (struct c_wlsb *s, int index, int by_time) |
Removes all W-LSB window entries prior to the given index. | |
struct c_wlsb * | c_create_wlsb (int bits, int window_width, int p) |
Create a new Window-based Least Significant Bits (W-LSB) encoding object. | |
void | c_destroy_wlsb (struct c_wlsb *s) |
Destroy a Window-based LSB (W-LSB) encoding object. | |
void | print_wlsb_stats (struct c_wlsb *s) |
Print statistics about a W-LSB encoding object. | |
void | c_add_wlsb (struct c_wlsb *s, int sn, int time, int value) |
Add a value into a W-LSB encoding object. | |
void | f (int v_ref, int k, int p, int *min, int *max) |
The f function as defined in the LSB calculation algorithm. | |
int | g (int v_ref, int v, int p, int bits) |
The g function as defined in the LSB calculation algorithm. | |
int | c_get_k_wlsb (struct c_wlsb *s, int value) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
void | c_ack_sn_wlsb (struct c_wlsb *s, int sn) |
Acknowledge based on the Sequence Number (SN) | |
void | c_ack_time_wlsb (struct c_wlsb *s, int time) |
Acknowledge based on the time stamp. | |
int | c_sum_wlsb (struct c_wlsb *s) |
Compute the sum of all the values stored in the W-LSB window. | |
int | c_mean_wlsb (struct c_wlsb *s) |
Compute the mean of all the values stored in the W-LSB window. |
Window-based Least Significant Bits (W-LSB) encoding.
void c_ack_remove | ( | struct c_wlsb * | s, |
int | index, | ||
int | by_time | ||
) |
Removes all W-LSB window entries prior to the given index.
s | The W-LSB object |
index | The position to set as the oldest |
by_time | Whether the function is called by SN or time acknowledgement |
References c_wlsb::next, c_wlsb::oldest, rohc_debugf, ROHC_FALSE, ROHC_TRUE, c_window::time, c_window::used, c_wlsb::window, and c_wlsb::window_width.
Referenced by c_ack_sn_wlsb(), and c_ack_time_wlsb().
void c_ack_sn_wlsb | ( | struct c_wlsb * | s, |
int | sn | ||
) |
Acknowledge based on the Sequence Number (SN)
Removes all entries older than the given SN in the window.
s | The W-LSB object |
sn | The SN to acknowledge |
References c_ack_remove(), c_wlsb::oldest, ROHC_TRUE, c_window::sn, c_window::used, and c_wlsb::window.
Referenced by c_generic_feedback().
void c_ack_time_wlsb | ( | struct c_wlsb * | s, |
int | time | ||
) |
Acknowledge based on the time stamp.
Removes all entries older than the given time stamp in the window.
s | The W-LSB object |
time | The time stamp to acknowledge |
References c_ack_remove(), c_wlsb::oldest, ROHC_TRUE, c_window::time, c_window::used, c_wlsb::window, and c_wlsb::window_width.
void c_add_wlsb | ( | struct c_wlsb * | s, |
int | sn, | ||
int | time, | ||
int | value | ||
) |
Add a value into a W-LSB encoding object.
s | The W-LSB object |
sn | The Sequence Number (SN) for the new entry |
time | The time stamp for the new entry |
value | The value to base the LSB coding on (i.e. sn) |
References c_wlsb::next, c_wlsb::oldest, rohc_debugf, ROHC_TRUE, c_window::sn, sn, c_window::time, c_window::used, c_window::value, c_wlsb::window, and c_wlsb::window_width.
Referenced by add_scaled(), d_generic_decode_ir(), decode_irdyn(), decode_uo0(), decode_uo1(), decode_uor2(), rohc_compress(), rohc_decompress(), and update_variables().
struct c_wlsb* c_create_wlsb | ( | int | bits, |
int | window_width, | ||
int | p | ||
) | [read] |
Create a new Window-based Least Significant Bits (W-LSB) encoding object.
bits | The maximal number of bits for representing a value |
window_width | The number of entries in the window |
p | Shift parameter (see 4.5.2 in the RFC 3095) |
References c_wlsb::bits, c_wlsb::next, c_wlsb::oldest, c_wlsb::p, rohc_debugf, ROHC_FALSE, c_window::time, c_window::used, c_wlsb::window, c_wlsb::window_width, and zfree.
Referenced by c_alloc_contexts(), c_create_sc(), c_generic_create(), c_init_header_info(), c_rtp_create(), and context_create().
void c_destroy_wlsb | ( | struct c_wlsb * | s | ) |
Destroy a Window-based LSB (W-LSB) encoding object.
s | The W-LSB object to destory |
References c_wlsb::window, and zfree.
Referenced by c_destroy_contexts(), c_destroy_sc(), c_generic_destroy(), context_create(), and context_free().
int c_get_k_wlsb | ( | struct c_wlsb * | s, |
int | value | ||
) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
s | The W-LSB object |
value | The value to encode using the LSB algorithm |
References c_wlsb::bits, g(), c_wlsb::p, rohc_debugf, ROHC_TRUE, c_window::used, c_window::value, c_wlsb::window, and c_wlsb::window_width.
Referenced by nb_bits_scaled(), and update_variables().
int c_mean_wlsb | ( | struct c_wlsb * | s | ) |
Compute the mean of all the values stored in the W-LSB window.
This function is used for statistics.
s | The W-LSB object |
References ROHC_TRUE, c_window::used, c_window::value, c_wlsb::window, and c_wlsb::window_width.
Referenced by rohc_c_context(), and rohc_d_context().
int c_sum_wlsb | ( | struct c_wlsb * | s | ) |
Compute the sum of all the values stored in the W-LSB window.
This function is used for statistics.
s | The W-LSB object |
References ROHC_TRUE, c_window::used, c_window::value, c_wlsb::window, and c_wlsb::window_width.
Referenced by rohc_c_context(), and rohc_d_context().
void f | ( | int | v_ref, |
int | k, | ||
int | p, | ||
int * | min, | ||
int * | max | ||
) |
The f function as defined in the LSB calculation algorithm.
Find out the interval for a given k. See 4.5.1 in the RFC 3095.
v_ref | The reference value |
k | The number of least significant bits of the value that are transmitted |
p | The shift parameter |
min | The lower limit of the interval |
max | The upper limit of the interval |
Referenced by d_ip_id_decode(), d_lsb_decode(), and g().
int g | ( | int | v_ref, |
int | v, | ||
int | p, | ||
int | bits | ||
) |
The g function as defined in the LSB calculation algorithm.
Find the minimal k value so that v falls into the interval given by . See 4.5.1 in the RFC 3095.
v_ref | The reference value |
v | The value to encode |
p | The shift parameter |
bits | The number of bits that may be used to represent the LSB-encoded value |
References f().
Referenced by c_get_k_wlsb().
void print_wlsb_stats | ( | struct c_wlsb * | s | ) |
Print statistics about a W-LSB encoding object.
This function is a debug function.
s | The W-LSB object to print stats about |
References c_wlsb::next, c_wlsb::oldest, rohc_debugf, ROHC_TRUE, c_window::sn, c_window::time, c_window::used, c_window::value, c_wlsb::window, and c_wlsb::window_width.