ROHC compression/decompression library
Data Structures | Enumerations | Functions
comp_scaled_rtp_ts.h File Reference

Scaled RTP Timestamp encoding. More...

#include "comp_wlsb.h"
#include "rohc_traces.h"
#include <stdbool.h>
Include dependency graph for comp_scaled_rtp_ts.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ts_sc_comp
 Scaled RTP Timestamp encoding object. More...
 

Enumerations

enum  ts_sc_state { INIT_TS = 1, INIT_STRIDE = 2, SEND_SCALED = 3 }
 State of scaled RTP Timestamp encoding. More...
 

Functions

bool c_create_sc (struct ts_sc_comp *const ts_sc, const size_t wlsb_window_width, rohc_trace_callback2_t trace_cb, void *const trace_cb_priv)
 Create the ts_sc_comp object. More...
 
void c_destroy_sc (struct ts_sc_comp *const ts_sc)
 Destroy the ts_sc_comp object. More...
 
void c_add_ts (struct ts_sc_comp *const ts_sc, const uint32_t ts, const uint16_t sn)
 Store the new TS, calculate new values and update the state. More...
 
void nb_bits_unscaled (const struct ts_sc_comp *const ts_sc, size_t *const bits_nr_less_equal_than_2, size_t *const bits_nr_more_than_2)
 Return the number of bits needed to encode unscaled TS. More...
 
void add_unscaled (const struct ts_sc_comp *const ts_sc, const uint16_t sn)
 Add a new unscaled TS value to the ts_sc_comp object. More...
 
void nb_bits_scaled (const struct ts_sc_comp *const ts_sc, size_t *const bits_nr_less_equal_than_2, size_t *const bits_nr_more_than_2)
 Return the number of bits needed to encode TS_SCALED. More...
 
void add_scaled (const struct ts_sc_comp *const ts_sc, const uint16_t sn)
 Add a new TS_SCALED value to the ts_sc_comp object. More...
 
uint32_t get_ts_stride (const struct ts_sc_comp *const ts_sc)
 Return the TS_STRIDE value. More...
 
uint32_t get_ts_scaled (const struct ts_sc_comp *const ts_sc)
 Return the TS_SCALED value. More...
 
uint32_t get_ts_unscaled (const struct ts_sc_comp *const ts_sc)
 Return the unscaled TS value. More...
 
bool rohc_ts_sc_is_deducible (const struct ts_sc_comp *const ts_sc)
 Whether TimeStamp (TS) is deducible from the Sequence Number (SN) or not. More...
 

Detailed Description

Scaled RTP Timestamp encoding.

Author
David Moreau from TAS
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

See section 4.5.3 of RFC 3095 for details about Scaled RTP Timestamp encoding.

Enumeration Type Documentation

State of scaled RTP Timestamp encoding.

See section 4.5.3 of RFC 3095 for details about Scaled RTP Timestamp encoding.

Enumerator
INIT_TS 

Initialization state (TS_STRIDE value not yet computed)

INIT_STRIDE 

Initialization state (TS_STRIDE value computed and sent)

SEND_SCALED 

Compression state (TS_SCALED value computed and sent)

Function Documentation

void add_scaled ( const struct ts_sc_comp *const  ts_sc,
const uint16_t  sn 
)

Add a new TS_SCALED value to the ts_sc_comp object.

Parameters
ts_scThe ts_sc_comp object
snThe Sequence Number
void add_unscaled ( const struct ts_sc_comp *const  ts_sc,
const uint16_t  sn 
)

Add a new unscaled TS value to the ts_sc_comp object.

Parameters
ts_scThe ts_sc_comp object
snThe Sequence Number
void c_add_ts ( struct ts_sc_comp *const  ts_sc,
const uint32_t  ts,
const uint16_t  sn 
)

Store the new TS, calculate new values and update the state.

Parameters
ts_scThe ts_sc_comp object
tsThe timestamp to add
snThe sequence number of the RTP packet
bool c_create_sc ( struct ts_sc_comp *const  ts_sc,
const size_t  wlsb_window_width,
rohc_trace_callback2_t  trace_cb,
void *const  trace_cb_priv 
)

Create the ts_sc_comp object.

Parameters
ts_scThe ts_sc_comp object to create
wlsb_window_widthThe width of the W-LSB sliding window to use for TS_STRIDE (must be > 0)
trace_cbThe trace callback
trace_cb_privAn optional private context for the trace callback, may be NULL
Returns
true if creation is successful, false otherwise
void c_destroy_sc ( struct ts_sc_comp *const  ts_sc)

Destroy the ts_sc_comp object.

Parameters
ts_scThe ts_sc_comp object to destroy
uint32_t get_ts_scaled ( const struct ts_sc_comp *const  ts_sc)

Return the TS_SCALED value.

Parameters
ts_scThe ts_sc_comp object
Returns
The TS_SCALED value
uint32_t get_ts_stride ( const struct ts_sc_comp *const  ts_sc)

Return the TS_STRIDE value.

Parameters
ts_scThe ts_sc_comp object
Returns
TS_STRIDE value
uint32_t get_ts_unscaled ( const struct ts_sc_comp *const  ts_sc)

Return the unscaled TS value.

Parameters
ts_scThe ts_sc_comp object
Returns
The unscaled TS value
void nb_bits_scaled ( const struct ts_sc_comp *const  ts_sc,
size_t *const  bits_nr_less_equal_than_2,
size_t *const  bits_nr_more_than_2 
)

Return the number of bits needed to encode TS_SCALED.

Parameters
ts_scThe ts_sc_comp object
[out]bits_nr_less_equal_than_2The number of bits needed to encode TS_SCALED in a field that is smaller than or equal to 2 bits
[out]bits_nr_more_than_2The number of bits needed to encode TS_SCALED in a field that is strictly larger than to 2 bits
void nb_bits_unscaled ( const struct ts_sc_comp *const  ts_sc,
size_t *const  bits_nr_less_equal_than_2,
size_t *const  bits_nr_more_than_2 
)

Return the number of bits needed to encode unscaled TS.

Parameters
ts_scThe ts_sc_comp object
[out]bits_nr_less_equal_than_2The number of bits needed to encode TS_SCALED in a field that is smaller than or equal to 2 bits
[out]bits_nr_more_than_2The number of bits needed to encode TS_SCALED in a field that is strictly larger than to 2 bits
bool rohc_ts_sc_is_deducible ( const struct ts_sc_comp *const  ts_sc)

Whether TimeStamp (TS) is deducible from the Sequence Number (SN) or not.

Parameters
ts_scThe TS SCALED compression context
Returns
true if TS is deducible from SN, false otherwise