ROHC compression/decompression library
Functions
interval.c File Reference

Compute the interpretation interval for LSB and W-LSB encoding. More...

#include "interval.h"
#include <assert.h>
Include dependency graph for interval.c:

Functions

struct rohc_interval32 rohc_f_32bits (const uint32_t v_ref, const size_t k, const rohc_lsb_shift_t p)
 The f function as defined in LSB encoding for 32-bit fields. More...
 
int32_t rohc_interval_get_rfc5225_msn_p (const size_t k, rohc_reordering_offset_t reorder_ratio)
 Get shift parameter p from number of bytes k and reorder ratio. More...
 
int32_t rohc_interval_get_rfc5225_id_id_p (const size_t k)
 Get shift parameter p from number of bytes k for ip_id_lsb. More...
 

Detailed Description

Compute the interpretation interval for LSB and W-LSB encoding.

Author
Didier Barvaux didie.nosp@m.r.ba.nosp@m.rvaux.nosp@m.@tou.nosp@m.louse.nosp@m..viv.nosp@m.eris..nosp@m.com
Didier Barvaux didie.nosp@m.r@ba.nosp@m.rvaux.nosp@m..org
David Moreau from TAS

Function Documentation

◆ rohc_f_32bits()

struct rohc_interval32 rohc_f_32bits ( const uint32_t  v_ref,
const size_t  k,
const rohc_lsb_shift_t  p 
)

The f function as defined in LSB encoding for 32-bit fields.

Find out the interval [v_ref - p, v_ref + (2^k - 1) - p] for a given k. See 4.5.1 in the RFC 3095 for details.

As stated RFC, the values to be encoded have a finite range and the interpretation interval can straddle the wraparound boundary. So, the min value may be greater than the max value!

Parameters
v_refThe reference value
kThe number of least significant bits of the value that are transmitted
pThe shift parameter (may be negative)
Returns
The computed interval

◆ rohc_interval_get_rfc5225_id_id_p()

int32_t rohc_interval_get_rfc5225_id_id_p ( const size_t  k)

Get shift parameter p from number of bytes k for ip_id_lsb.

Parameters
kThe number of least significant bits of the value that are transmitted
Returns
The shift parameter p

◆ rohc_interval_get_rfc5225_msn_p()

int32_t rohc_interval_get_rfc5225_msn_p ( const size_t  k,
rohc_reordering_offset_t  reorder_ratio 
)

Get shift parameter p from number of bytes k and reorder ratio.

Parameters
kThe number of least significant bits of the value that are transmitted
reorder_ratioThe reordering ratio
Returns
The shift parameter p