Window-based Least Significant Bits (W-LSB) encoding. More...
#include "comp_wlsb.h"#include "interval.h"#include <string.h>#include <assert.h>
Data Structures | |
| struct | c_window |
| Define a W-LSB window entry. More... | |
| struct | c_wlsb |
| Defines a W-LSB encoding object. More... | |
Functions | |
| static size_t | wlsb_get_next_older (const size_t entry, const size_t max) |
| Get the next older entry. | |
| static size_t | wlsb_ack_remove (struct c_wlsb *const wlsb, const size_t pos) |
| Removes all W-LSB window entries prior to the given position. | |
| static size_t | rohc_g_8bits (const uint8_t v_ref, const uint8_t v, const rohc_lsb_shift_t p, const size_t bits_nr) |
| The g function as defined in LSB encoding for 8-bit fields. | |
| static size_t | rohc_g_16bits (const uint16_t v_ref, const uint16_t v, const size_t min_k, const rohc_lsb_shift_t p, const size_t bits_nr) |
| The g function as defined in LSB encoding for 16-bit fields. | |
| static size_t | rohc_g_32bits (const uint32_t v_ref, const uint32_t v, const size_t min_k, const rohc_lsb_shift_t p, const size_t bits_nr) |
| The g function as defined in LSB encoding for 32-bit fields. | |
| struct c_wlsb * | c_create_wlsb (const size_t bits, const size_t window_width, const rohc_lsb_shift_t p) |
| Create a new Window-based Least Significant Bits (W-LSB) encoding object. | |
| void | c_destroy_wlsb (struct c_wlsb *const wlsb) |
| Destroy a Window-based LSB (W-LSB) encoding object. | |
| void | c_add_wlsb (struct c_wlsb *const wlsb, const uint32_t sn, const uint32_t value) |
| Add a value into a W-LSB encoding object. | |
| size_t | wlsb_get_k_8bits (const struct c_wlsb *const wlsb, const uint8_t 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. | |
| size_t | wlsb_get_kp_8bits (const struct c_wlsb *const wlsb, const uint8_t value, const rohc_lsb_shift_t p) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_get_k_16bits (const struct c_wlsb *const wlsb, const uint16_t 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. | |
| size_t | wlsb_get_mink_16bits (const struct c_wlsb *const wlsb, const uint16_t value, const size_t min_k) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_get_kp_16bits (const struct c_wlsb *const wlsb, const uint16_t value, const rohc_lsb_shift_t p) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_get_minkp_16bits (const struct c_wlsb *const wlsb, const uint16_t value, const size_t min_k, const rohc_lsb_shift_t p) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_get_k_32bits (const struct c_wlsb *const wlsb, const uint32_t 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. | |
| size_t | wlsb_get_mink_32bits (const struct c_wlsb *const wlsb, const uint32_t value, const size_t min_k) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_get_kp_32bits (const struct c_wlsb *const wlsb, const uint32_t value, const rohc_lsb_shift_t p) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_get_minkp_32bits (const struct c_wlsb *const wlsb, const uint32_t value, const size_t min_k, const rohc_lsb_shift_t p) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window. | |
| size_t | wlsb_ack (struct c_wlsb *const wlsb, const uint32_t sn_bits, const size_t sn_bits_nr) |
| Acknowledge based on the Sequence Number (SN). | |
Window-based Least Significant Bits (W-LSB) encoding.
| void c_add_wlsb | ( | struct c_wlsb *const | wlsb, | |
| const uint32_t | sn, | |||
| const uint32_t | value | |||
| ) |
Add a value into a W-LSB encoding object.
| wlsb | The W-LSB object | |
| sn | The Sequence Number (SN) for the new entry | |
| value | The value to base the LSB coding on |
| struct c_wlsb* c_create_wlsb | ( | const size_t | bits, | |
| const size_t | window_width, | |||
| const rohc_lsb_shift_t | 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 (power of 2) | |
| p | Shift parameter (see 4.5.2 in the RFC 3095) |
| void c_destroy_wlsb | ( | struct c_wlsb *const | wlsb | ) |
Destroy a Window-based LSB (W-LSB) encoding object.
| wlsb | The W-LSB object to destroy |
| static size_t rohc_g_16bits | ( | const uint16_t | v_ref, | |
| const uint16_t | v, | |||
| const size_t | min_k, | |||
| const rohc_lsb_shift_t | p, | |||
| const size_t | bits_nr | |||
| ) | [static] |
The g function as defined in LSB encoding for 16-bit fields.
Find the minimal k value so that v falls into the interval given by f(v_ref, k). See 4.5.1 in the RFC 3095.
| v_ref | The reference value | |
| v | The value to encode | |
| min_k | The minimum number of bits to find out | |
| p | The shift parameter | |
| bits_nr | The number of bits that may be used to represent the LSB-encoded value |
| static size_t rohc_g_32bits | ( | const uint32_t | v_ref, | |
| const uint32_t | v, | |||
| const size_t | min_k, | |||
| const rohc_lsb_shift_t | p, | |||
| const size_t | bits_nr | |||
| ) | [static] |
The g function as defined in LSB encoding for 32-bit fields.
Find the minimal k value so that v falls into the interval given by f(v_ref, k). See 4.5.1 in the RFC 3095.
| v_ref | The reference value | |
| v | The value to encode | |
| min_k | The minimum number of bits to find out | |
| p | The shift parameter | |
| bits_nr | The number of bits that may be used to represent the LSB-encoded value |
| static size_t rohc_g_8bits | ( | const uint8_t | v_ref, | |
| const uint8_t | v, | |||
| const rohc_lsb_shift_t | p, | |||
| const size_t | bits_nr | |||
| ) | [static] |
The g function as defined in LSB encoding for 8-bit fields.
Find the minimal k value so that v falls into the interval given by f(v_ref, k). See 4.5.1 in the RFC 3095.
| v_ref | The reference value | |
| v | The value to encode | |
| p | The shift parameter | |
| bits_nr | The number of bits that may be used to represent the LSB-encoded value |
| size_t wlsb_ack | ( | struct c_wlsb *const | wlsb, | |
| const uint32_t | sn_bits, | |||
| const size_t | sn_bits_nr | |||
| ) |
Acknowledge based on the Sequence Number (SN).
Removes all window entries older (and including) than the one that matches the given SN bits.
| wlsb | The W-LSB object | |
| sn_bits | The LSB of the SN to acknowledge | |
| sn_bits_nr | The number of LSB of the SN to acknowledge |
| static size_t wlsb_ack_remove | ( | struct c_wlsb *const | wlsb, | |
| const size_t | pos | |||
| ) | [static] |
Removes all W-LSB window entries prior to the given position.
| wlsb | The W-LSB object | |
| pos | The position to set as the oldest |
| size_t wlsb_get_k_16bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint16_t | 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.
The function is dedicated to 16-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm |
| size_t wlsb_get_k_32bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint32_t | 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.
The function is dedicated to 32-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm |
| size_t wlsb_get_k_8bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint8_t | 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.
The function is dedicated to 8-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm |
| size_t wlsb_get_kp_16bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint16_t | value, | |||
| const rohc_lsb_shift_t | p | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 16-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| p | The shift parameter p |
| size_t wlsb_get_kp_32bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint32_t | value, | |||
| const rohc_lsb_shift_t | p | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 32-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| p | The shift parameter p |
| size_t wlsb_get_kp_8bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint8_t | value, | |||
| const rohc_lsb_shift_t | p | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 8-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| p | The shift parameter p |
| size_t wlsb_get_mink_16bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint16_t | value, | |||
| const size_t | min_k | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 16-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| min_k | The minimum number of bits to find out |
| size_t wlsb_get_mink_32bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint32_t | value, | |||
| const size_t | min_k | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 32-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| min_k | The minimum number of bits to find out |
| size_t wlsb_get_minkp_16bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint16_t | value, | |||
| const size_t | min_k, | |||
| const rohc_lsb_shift_t | p | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 16-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| min_k | The minimum number of bits to find out | |
| p | The shift parameter p |
| size_t wlsb_get_minkp_32bits | ( | const struct c_wlsb *const | wlsb, | |
| const uint32_t | value, | |||
| const size_t | min_k, | |||
| const rohc_lsb_shift_t | p | |||
| ) |
Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
The function is dedicated to 32-bit fields.
| wlsb | The W-LSB object | |
| value | The value to encode using the LSB algorithm | |
| min_k | The minimum number of bits to find out | |
| p | The shift parameter p |
| static size_t wlsb_get_next_older | ( | const size_t | entry, | |
| const size_t | max | |||
| ) | [static] |
Get the next older entry.
| entry | The entry for which to get the next older entry | |
| max | The max entry value |
1.6.1