Window-based Least Significant Bits (W-LSB) decoding.
More...
#include "decomp_wlsb.h"
#include "interval.h"
#include <string.h>
#include <assert.h>
|
static bool | rohc_lsb_decode32 (const struct rohc_lsb_decode *const lsb, const rohc_lsb_ref_t ref_type, const uint32_t v_ref_d_offset, const uint32_t m, const size_t k, const rohc_lsb_shift_t p, uint32_t *const decoded) |
| Decode a 32-bit LSB-encoded value. More...
|
|
static bool | rohc_lsb_decode16 (const struct rohc_lsb_decode *const lsb, const rohc_lsb_ref_t ref_type, const uint16_t v_ref_d_offset, const uint16_t m, const size_t k, const rohc_lsb_shift_t p, uint16_t *const decoded) |
| Decode a 16-bit LSB-encoded value. More...
|
|
static bool | rohc_lsb_decode8 (const struct rohc_lsb_decode *const lsb, const rohc_lsb_ref_t ref_type, const uint8_t v_ref_d_offset, const uint8_t m, const size_t k, const rohc_lsb_shift_t p, uint8_t *const decoded) |
| Decode a 8-bit LSB-encoded value. More...
|
|
void | rohc_lsb_init (struct rohc_lsb_decode *const lsb, const size_t max_len) |
| Initialize a given Least Significant Bits (LSB) decoding context. More...
|
|
bool | rohc_lsb_is_ready (const struct rohc_lsb_decode *const lsb) |
| Is the LSB decoding context ready to decode a compressed value. More...
|
|
bool | rohc_lsb_decode (const struct rohc_lsb_decode *const lsb, const rohc_lsb_ref_t ref_type, const uint32_t v_ref_d_offset, const uint32_t m, const size_t k, const rohc_lsb_shift_t p, uint32_t *const decoded) |
| Decode a LSB-encoded value. More...
|
|
void | rohc_lsb_set_ref (struct rohc_lsb_decode *const lsb, const uint32_t v_ref_d, const bool keep_ref_minus_1) |
| Update the LSB reference value. More...
|
|
uint32_t | rohc_lsb_get_ref (const struct rohc_lsb_decode *const lsb, const rohc_lsb_ref_t ref_type) |
| Get the current LSB reference value (ref 0) More...
|
|
◆ rohc_lsb_decode()
Decode a LSB-encoded value.
See 4.5.1 in the RFC 3095 for details about LSB encoding.
- Parameters
-
lsb | The LSB object used to decode |
ref_type | The reference value to use to decode (used for context repair upon CRC failure) |
v_ref_d_offset | The offset to apply on v_ref_d (used for context repair upon CRC failure) |
m | The LSB value to decode |
k | The length of the LSB value to decode |
p | The shift value p used to efficiently encode/decode the values |
decoded | OUT: The decoded value |
- Returns
- true in case of success, false otherwise
◆ rohc_lsb_decode16()
Decode a 16-bit LSB-encoded value.
See rohc_lsb_decode32 for details.
- Parameters
-
lsb | The LSB object used to decode |
ref_type | The reference value to use to decode (used for context repair upon CRC failure) |
v_ref_d_offset | The offset to apply on v_ref_d (used for context repair upon CRC failure) |
m | The LSB value to decode |
k | The length of the LSB value to decode |
p | The shift value p used to efficiently encode/decode the values |
decoded | OUT: The decoded value |
- Returns
- true in case of success, false otherwise
◆ rohc_lsb_decode32()
Decode a 32-bit LSB-encoded value.
See 4.5.1 in the RFC 3095 for details about LSB encoding.
- Parameters
-
lsb | The LSB object used to decode |
ref_type | The reference value to use to decode (used for context repair upon CRC failure) |
v_ref_d_offset | The offset to apply on v_ref_d (used for context repair upon CRC failure) |
m | The LSB value to decode |
k | The length of the LSB value to decode |
p | The shift value p used to efficiently encode/decode the values |
decoded | OUT: The decoded value |
- Returns
- true in case of success, false otherwise
◆ rohc_lsb_decode8()
Decode a 8-bit LSB-encoded value.
See rohc_lsb_decode32 for details.
- Parameters
-
lsb | The LSB object used to decode |
ref_type | The reference value to use to decode (used for context repair upon CRC failure) |
v_ref_d_offset | The offset to apply on v_ref_d (used for context repair upon CRC failure) |
m | The LSB value to decode |
k | The length of the LSB value to decode |
p | The shift value p used to efficiently encode/decode the values |
decoded | OUT: The decoded value |
- Returns
- true in case of success, false otherwise
◆ rohc_lsb_get_ref()
Get the current LSB reference value (ref 0)
- Parameters
-
lsb | The LSB object |
ref_type | The reference value to retrieve |
- Returns
- The current reference value
◆ rohc_lsb_init()
void rohc_lsb_init |
( |
struct rohc_lsb_decode *const |
lsb, |
|
|
const size_t |
max_len |
|
) |
| |
Initialize a given Least Significant Bits (LSB) decoding context.
See 4.5.1 in the RFC 3095 for details about LSB encoding.
- Parameters
-
[in,out] | lsb | The LSB decoding context to init |
| max_len | The max length (in bits) of the non-compressed field |
◆ rohc_lsb_is_ready()
Is the LSB decoding context ready to decode a compressed value.
- Parameters
-
lsb | The LSB object used to decode |
- Returns
- Whether the LSB decoding context is ready to decode a value
◆ rohc_lsb_set_ref()
void rohc_lsb_set_ref |
( |
struct rohc_lsb_decode *const |
lsb, |
|
|
const uint32_t |
v_ref_d, |
|
|
const bool |
keep_ref_minus_1 |
|
) |
| |
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.
- Parameters
-
lsb | The LSB object |
v_ref_d | The new reference value |
keep_ref_minus_1 | Keep ref -1 unchanged (used for SN context repair after CRC failure, see RFC3095 ยง5.3.2.2.5) |