ROHC compression/decompression library
Defines | Functions
scaled_rtp_ts.c File Reference

Scaled RTP Timestamp encoding. More...

#include "scaled_rtp_ts.h"
#include "sdvl.h"
#include "rohc_traces_internal.h"
#include <stdlib.h>
#include <assert.h>
Include dependency graph for comp/schemes/scaled_rtp_ts.c:

Defines

#define ts_debug(entity_struct, format,...)

Functions

bool c_create_sc (struct ts_sc_comp *const ts_sc, const size_t wlsb_window_width, rohc_trace_callback_t trace_cb, rohc_trace_callback2_t trace_cb2, void *const trace_cb_priv)
 Create the ts_sc_comp object.
void c_destroy_sc (struct ts_sc_comp *const ts_sc)
 Destroy the ts_sc_comp object.
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.
bool nb_bits_unscaled (const struct ts_sc_comp *const ts_sc, size_t *const bits_nr)
 Return the number of bits needed to encode unscaled TS.
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.
bool nb_bits_scaled (const struct ts_sc_comp *const ts_sc, size_t *const bits_nr)
 Return the number of bits needed to encode TS_SCALED.
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.
uint32_t get_ts_stride (const struct ts_sc_comp *const ts_sc)
 Return the TS_STRIDE value.
uint32_t get_ts_scaled (const struct ts_sc_comp *const ts_sc)
 Return the TS_SCALED value.
uint32_t get_ts_unscaled (const struct ts_sc_comp *const ts_sc)
 Return the unscaled TS value.
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.

Detailed Description

Scaled RTP Timestamp encoding.

Author:
David Moreau from TAS
Didier Barvaux <didier.barvaux@toulouse.viveris.com>
Didier Barvaux <didier@barvaux.org>

Define Documentation

#define ts_debug (   entity_struct,
  format,
  ... 
)
Value:
rohc_debug(entity_struct, ROHC_TRACE_COMP, ROHC_PROFILE_GENERAL, \
                   format, ##__VA_ARGS__)

Print debug messages for the ts_sc_comp module


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_callback_t  trace_cb,
rohc_trace_callback2_t  trace_cb2,
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 old trace callback
trace_cb2The new 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
bool nb_bits_scaled ( const struct ts_sc_comp *const  ts_sc,
size_t *const  bits_nr 
)

Return the number of bits needed to encode TS_SCALED.

Parameters:
ts_scThe ts_sc_comp object
bits_nrOUT: The number of bits needed
Returns:
true in case of success, false if the minimal number of bits can not be found
bool nb_bits_unscaled ( const struct ts_sc_comp *const  ts_sc,
size_t *const  bits_nr 
)

Return the number of bits needed to encode unscaled TS.

Parameters:
ts_scThe ts_sc_comp object
bits_nrOUT: The number of bits needed
Returns:
true in case of success, false if the minimal number of bits can not be found
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