Window-based Least Significant Bits (W-LSB) encoding.
More...
#include "interval.h"
#include "dllexport.h"
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Functions |
struct c_wlsb *ROHC_EXPORT | 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 ROHC_EXPORT | c_destroy_wlsb (struct c_wlsb *s) |
| Destroy a Window-based LSB (W-LSB) encoding object.
|
void ROHC_EXPORT | 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.
|
bool ROHC_EXPORT | wlsb_get_k_16bits (const struct c_wlsb *const wlsb, const uint16_t value, size_t *const bits_nr) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
|
bool ROHC_EXPORT | wlsb_get_k_32bits (const struct c_wlsb *const wlsb, const uint32_t value, size_t *const bits_nr) |
| Find out the minimal number of bits of the to-be-encoded value required to be able to uniquely recreate it given the window.
|
bool ROHC_EXPORT | wlsb_get_kp_32bits (const struct c_wlsb *const wlsb, const uint32_t value, const rohc_lsb_shift_t p, size_t *const bits_nr) |
| 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 ROHC_EXPORT | c_ack_sn_wlsb (struct c_wlsb *const s, const uint32_t sn) |
| Acknowledge based on the Sequence Number (SN)
|
Detailed Description
Window-based Least Significant Bits (W-LSB) encoding.
- Author:
- Didier Barvaux <didier.barvaux@toulouse.viveris.com>
-
David Moreau from TAS
Function Documentation
Acknowledge based on the Sequence Number (SN)
Removes all entries older than the given SN in the window.
- Parameters:
-
s | The W-LSB object |
sn | The SN to acknowledge |
Add a value into a W-LSB encoding object.
- Parameters:
-
wlsb | The W-LSB object |
sn | The Sequence Number (SN) for the new entry |
value | The value to base the LSB coding on |
Create a new Window-based Least Significant Bits (W-LSB) encoding object.
- Parameters:
-
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) |
- Returns:
- The newly-created W-LSB encoding object
Destroy a Window-based LSB (W-LSB) encoding object.
- Parameters:
-
wlsb | The W-LSB object to destroy |
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.
- Parameters:
-
wlsb | The W-LSB object |
value | The value to encode using the LSB algorithm |
bits_nr | OUT: The number of bits required to uniquely recreate the value |
- Returns:
- true in case of success, false if the minimal number of bits can not be found
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.
- Parameters:
-
wlsb | The W-LSB object |
value | The value to encode using the LSB algorithm |
bits_nr | OUT: The number of bits required to uniquely recreate the value |
- Returns:
- true in case of success, false if the minimal number of bits can not be found
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.
- Parameters:
-
wlsb | The W-LSB object |
value | The value to encode using the LSB algorithm |
p | The shift parameter p |
bits_nr | OUT: The number of bits required to uniquely recreate the value |
- Returns:
- true in case of success, false if the minimal number of bits can not be found