interval.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  rohc_interval8
 An interval of 8-bit values. More...
struct  rohc_interval16
 An interval of 16-bit values. More...
struct  rohc_interval32
 An interval of 32-bit values. More...

Defines

#define ROHC_LSB_SHIFT_TCP_TS_1B   ROHC_LSB_SHIFT_SN
#define ROHC_LSB_SHIFT_TCP_TS_2B   ROHC_LSB_SHIFT_SN
#define ROHC_LSB_SHIFT_TCP_ACK_SCALED   ROHC_LSB_SHIFT_TCP_TTL

Enumerations

enum  rohc_lsb_shift_t { ROHC_LSB_SHIFT_SN = -1 }
 

the different values of the shift parameter of the LSB algorithm

More...

Functions

static int32_t rohc_interval_compute_p (const size_t k, const rohc_lsb_shift_t p)
 Compute the shift parameter p for the f function.
struct rohc_interval8 rohc_f_8bits (const uint8_t v_ref, const size_t k, const rohc_lsb_shift_t p)
 The f function as defined in LSB encoding for 8-bit fields.
struct rohc_interval16 rohc_f_16bits (const uint16_t v_ref, const size_t k, const rohc_lsb_shift_t p)
 The f function as defined in LSB encoding for 16-bit fields.
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.

Detailed Description

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

Author:
Didier Barvaux <didier.barvaux@toulouse.viveris.com>

Define Documentation

#define ROHC_LSB_SHIFT_TCP_ACK_SCALED   ROHC_LSB_SHIFT_TCP_TTL
#define ROHC_LSB_SHIFT_TCP_TS_1B   ROHC_LSB_SHIFT_SN

real value for TCP TS

#define ROHC_LSB_SHIFT_TCP_TS_2B   ROHC_LSB_SHIFT_SN

real value for TCP TS


Enumeration Type Documentation

the different values of the shift parameter of the LSB algorithm

The shift parameter is also named 'p' in some RFCs.

Some values are the real values to use directly. Some others are code that means that the real value to use shall be computed from the number of least significant bits that are transmitted.

Enumerator:
ROHC_LSB_SHIFT_SN 

real value for non-RTP SN


Function Documentation

struct rohc_interval16 rohc_f_16bits ( const uint16_t  v_ref,
const size_t  k,
const rohc_lsb_shift_t  p 
) [read]

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_ref The reference value
k The number of least significant bits of the value that are transmitted
p The shift parameter (may be negative)
Returns:
The computed interval
struct rohc_interval32 rohc_f_32bits ( const uint32_t  v_ref,
const size_t  k,
const rohc_lsb_shift_t  p 
) [read]

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_ref The reference value
k The number of least significant bits of the value that are transmitted
p The shift parameter (may be negative)
Returns:
The computed interval
struct rohc_interval8 rohc_f_8bits ( const uint8_t  v_ref,
const size_t  k,
const rohc_lsb_shift_t  p 
) [read]

The f function as defined in LSB encoding for 8-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_ref The reference value
k The number of least significant bits of the value that are transmitted
p The shift parameter (may be negative)
Returns:
The computed interval
static int32_t rohc_interval_compute_p ( const size_t  k,
const rohc_lsb_shift_t  p 
) [inline, static]

Compute the shift parameter p for the f function.

Parameters:
k The number of least significant bits of the value that are transmitted
p The shift parameter (may be negative)
Returns:
The computed shift parameter p

Generated on 4 Jul 2018 for ROHC compression/decompression library by  doxygen 1.6.1