27 #ifndef ROHC_COMP_SCHEMES_WLSB_H 28 #define ROHC_COMP_SCHEMES_WLSB_H 53 #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ 54 (defined(__GNUC__) && defined(__GNUC_MINOR__) && \ 55 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))) 56 _Static_assert((offsetof(
struct c_window, sn) % 8) == 0,
57 "sn in c_window should be aligned on 8 bytes");
58 _Static_assert((offsetof(
struct c_window, value) % 4) == 0,
59 "value in c_window should be aligned on 4 bytes");
60 _Static_assert((
sizeof(
struct c_window) % 8) == 0,
61 "c_window length should be multiple of 8 bytes");
85 #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ 86 (defined(__GNUC__) && defined(__GNUC_MINOR__) && \ 87 (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))) 88 _Static_assert((offsetof(
struct c_wlsb, window) % 8) == 0,
89 "window in c_wlsb should be aligned on 8 bytes");
90 _Static_assert((
sizeof(
struct c_wlsb) % 8) == 0,
91 "c_wlsb length should be multiple of 8 bytes");
101 const size_t window_width)
102 __attribute__((warn_unused_result,
nonnull(1)));
104 const struct c_wlsb *
const src)
105 __attribute__((warn_unused_result,
nonnull(1, 2)));
111 const uint32_t
value)
118 __attribute__((warn_unused_result,
nonnull(1)));
121 const uint16_t
value,
124 __attribute__((warn_unused_result,
nonnull(1)));
127 const uint32_t
value,
130 __attribute__((warn_unused_result,
nonnull(1)));
133 const uint32_t sn_bits,
134 const size_t sn_bits_nr)
135 __attribute__((warn_unused_result,
nonnull(1)));
138 __attribute__((warn_unused_result,
nonnull(1)));
rohc_lsb_shift_t
the different values of the shift parameter of the LSB algorithm
Definition: interval.h:47
struct c_window * window
Definition: comp_wlsb.h:71
void wlsb_free(struct c_wlsb *const wlsb)
Destroy a Window-based LSB (W-LSB) encoding object.
Definition: comp_wlsb.c:116
uint8_t window_width
Definition: comp_wlsb.h:74
bool wlsb_new(struct c_wlsb *const wlsb, const size_t window_width)
Create a new Window-based Least Significant Bits (W-LSB) encoding object.
Definition: comp_wlsb.c:56
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)
Definition: comp_wlsb.c:394
uint32_t value
Definition: comp_wlsb.h:49
bool wlsb_is_kp_possible_16bits(const struct c_wlsb *const wlsb, const uint16_t value, const size_t k, const rohc_lsb_shift_t p)
Find out whether the given number of bits is enough to encode value.
Definition: comp_wlsb.c:240
uint32_t sn
Definition: comp_wlsb.h:47
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.
Definition: comp_wlsb.c:129
uint8_t next
Definition: comp_wlsb.h:77
bool wlsb_is_kp_possible_8bits(const struct c_wlsb *const wlsb, const uint8_t value, const size_t k, const rohc_lsb_shift_t p)
Find out whether the given number of bits is enough to encode value.
Definition: comp_wlsb.c:164
One W-LSB encoding object.
Definition: comp_wlsb.h:68
bool wlsb_is_sn_present(struct c_wlsb *const wlsb, const uint32_t sn)
Whether the given SN is present in the given WLSB window.
Definition: comp_wlsb.c:446
bool wlsb_copy(struct c_wlsb *const dst, const struct c_wlsb *const src)
Create a new Window-based Least Significant Bits (W-LSB) encoding object from another.
Definition: comp_wlsb.c:88
uint8_t count
Definition: comp_wlsb.h:80
One W-LSB window entry.
Definition: comp_wlsb.h:45
bool wlsb_is_kp_possible_32bits(const struct c_wlsb *const wlsb, const uint32_t value, const size_t k, const rohc_lsb_shift_t p)
Find out whether the given number of bits is enough to encode value.
Definition: comp_wlsb.c:318
Compute the interpretation interval for LSB and W-LSB encoding.