ROHC compression/decompression library
Functions | Variables
lsb_decode.h File Reference

Least Significant Bits (LSB) encoding. More...

#include "interval.h"
#include "dllexport.h"
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for lsb_decode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct rohc_lsb_decode *ROHC_EXPORT rohc_lsb_new (const rohc_lsb_shift_t p)
 Create a new Least Significant Bits (LSB) decoding context.
void ROHC_EXPORT rohc_lsb_free (struct rohc_lsb_decode *const lsb) __attribute__((nonnull(1)))
 Destroy a given Least Significant Bits (LSB) decoding context.
bool ROHC_EXPORT rohc_lsb_decode32 (const struct rohc_lsb_decode *const lsb, const uint32_t m, const size_t k, uint32_t *const decoded) __attribute__((nonnull(1
bool ROHC_EXPORT bool ROHC_EXPORT rohc_lsb_decode16 (const struct rohc_lsb_decode *const lsb, const uint16_t m, const size_t k, uint16_t *const decoded) __attribute__((nonnull(1
void ROHC_EXPORT rohc_lsb_set_ref (struct rohc_lsb_decode *const lsb, const uint32_t v_ref_d) __attribute__((nonnull(1)))
 Update the LSB reference value.
uint32_t ROHC_EXPORT rohc_lsb_get_ref (struct rohc_lsb_decode *const lsb) __attribute__((nonnull(1)))
 Get the current LSB reference value.

Variables

bool ROHC_EXPORT bool ROHC_EXPORT warn_unused_result

Detailed Description

Least Significant Bits (LSB) encoding.

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
Didier Barvaux <didier@barvaux.org>
The hackers from ROHC for Linux

Function Documentation

bool ROHC_EXPORT bool ROHC_EXPORT rohc_lsb_decode16 ( const struct rohc_lsb_decode *const  lsb,
const uint16_t  m,
const size_t  k,
uint16_t *const  decoded 
)
bool ROHC_EXPORT rohc_lsb_decode32 ( const struct rohc_lsb_decode *const  lsb,
const uint32_t  m,
const size_t  k,
uint32_t *const  decoded 
)
void ROHC_EXPORT rohc_lsb_free ( struct rohc_lsb_decode *const  lsb)

Destroy a given Least Significant Bits (LSB) decoding context.

See 4.5.1 in the RFC 3095 for details about LSB encoding.

Parameters:
lsbThe LSB decoding context to destroy

Referenced by d_rtp_create(), d_udp_create(), d_udp_lite_create(), ip_id_offset_free(), and rohc_ts_scaled_free().

uint32_t ROHC_EXPORT rohc_lsb_get_ref ( struct rohc_lsb_decode *const  lsb)

Get the current LSB reference value.

Parameters:
lsbThe LSB object
Returns:
The current reference value

References rohc_lsb_decode::is_init, and rohc_lsb_decode::v_ref_d.

Referenced by d_generic_get_sn(), and ts_decode_scaled().

Create a new Least Significant Bits (LSB) decoding context.

See 4.5.1 in the RFC 3095 for details about LSB encoding.

Parameters:
pThe p value used to efficiently encode/decode the values
Returns:
The new LSB decoding context in case of success, NULL otherwise

References rohc_lsb_decode::is_init, and rohc_lsb_decode::p.

Referenced by d_create_sc(), d_ip_create(), d_rtp_create(), d_udp_create(), d_udp_lite_create(), and ip_id_offset_new().

void ROHC_EXPORT rohc_lsb_set_ref ( struct rohc_lsb_decode *const  lsb,
const uint32_t  v_ref_d 
)

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:
lsbThe LSB object
v_ref_dThe new reference value

References rohc_lsb_decode::is_init, and rohc_lsb_decode::v_ref_d.

Referenced by ip_id_offset_set_ref(), and ts_update_context().


Variable Documentation