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

void rohc_f_16bits (const uint16_t v_ref, const size_t k, const rohc_lsb_shift_t p, uint16_t *const min, uint16_t *const max)
 The f function as defined in LSB encoding for 16-bit fields.
void rohc_f_32bits (const uint32_t v_ref, const size_t k, const rohc_lsb_shift_t p, uint32_t *const min, uint32_t *const max)
 The f function as defined in LSB encoding for 32-bit fields.

Detailed Description

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

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

Function Documentation

void rohc_f_16bits ( const uint16_t  v_ref,
const size_t  k,
const rohc_lsb_shift_t  p,
uint16_t *const  min,
uint16_t *const  max 
)

The f function as defined in LSB encoding for 16-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)
minOUT: The lower limit of the interval
maxOUT: The upper limit of the interval

References rohc_f_32bits().

void rohc_f_32bits ( const uint32_t  v_ref,
const size_t  k,
const rohc_lsb_shift_t  p,
uint32_t *const  min,
uint32_t *const  max 
)

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)
minOUT: The lower limit of the interval
maxOUT: The upper limit of the interval

References ROHC_LSB_SHIFT_RTP_SN, and ROHC_LSB_SHIFT_RTP_TS.

Referenced by rohc_f_16bits(), and rohc_lsb_decode32().