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

Scaled RTP Timestamp decoding. More...

#include "scaled_rtp_ts.h"
#include "wlsb.h"
#include "rohc_traces_internal.h"
#include <assert.h>
Include dependency graph for decomp/schemes/scaled_rtp_ts.c:

Data Structures

struct  ts_sc_decomp
 The scaled RTP Timestamp decoding context. More...

Defines

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

Functions

struct ts_sc_decompd_create_sc (rohc_trace_callback_t trace_cb, rohc_trace_callback2_t trace_cb2, void *const trace_cb_priv)
 Create the scaled RTP Timestamp decoding context.
void rohc_ts_scaled_free (struct ts_sc_decomp *const ts_sc)
 Destroy the given ts_sc_decomp object.
void ts_update_context (struct ts_sc_decomp *const ts_sc, const uint32_t ts, const uint16_t sn)
 Store a new timestamp.
void d_record_ts_stride (struct ts_sc_decomp *const ts_sc, const uint32_t ts_stride)
 Store the newly-parsed TS_STRIDE value.
bool ts_decode_unscaled_bits (struct ts_sc_decomp *const ts_sc, const uint32_t ts_unscaled_bits, const size_t ts_unscaled_bits_nr, uint32_t *const decoded_ts, const bool compat_1_6_x)
 Decode timestamp (TS) value with some LSB bits of the unscaled value.
bool ts_decode_scaled_bits (struct ts_sc_decomp *const ts_sc, const uint32_t ts_scaled_bits, const size_t ts_scaled_bits_nr, uint32_t *const decoded_ts)
 Decode timestamp (TS) value with some LSB bits of the TS_SCALED value.
uint32_t ts_deduce_from_sn (struct ts_sc_decomp *const ts_sc, const uint16_t sn)
 Deduct timestamp (TS) from Sequence Number (SN)

Detailed Description

Scaled RTP Timestamp decoding.

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

Define Documentation

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

Print debug messages for the ts_sc_decomp module


Function Documentation

struct ts_sc_decomp* d_create_sc ( rohc_trace_callback_t  trace_cb,
rohc_trace_callback2_t  trace_cb2,
void *const  trace_cb_priv 
) [read]

Create the scaled RTP Timestamp decoding context.

Parameters:
trace_cbThe old trace callback
trace_cb2The new trace callback
trace_cb_privAn optional private context for the trace
Returns:
The scaled RTP Timestamp decoding context in case of success, NULL otherwise
void d_record_ts_stride ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts_stride 
)

Store the newly-parsed TS_STRIDE value.

Parameters:
ts_scThe ts_sc_decomp object
ts_strideThe TS_STRIDE value to add
void rohc_ts_scaled_free ( struct ts_sc_decomp *const  ts_sc)

Destroy the given ts_sc_decomp object.

Parameters:
ts_scThe ts_sc_decomp object to destroy
bool ts_decode_scaled_bits ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts_scaled_bits,
const size_t  ts_scaled_bits_nr,
uint32_t *const  decoded_ts 
)

Decode timestamp (TS) value with some LSB bits of the TS_SCALED value.

Use the given TS and TS_SCALED bits. Use the TS_STRIDE and TS_OFFSET values found in context.

Parameters:
ts_scThe ts_sc_decomp object
ts_scaled_bitsThe W-LSB-encoded TS_SCALED value
ts_scaled_bits_nrThe number of bits of TS_SCALED (W-LSB)
decoded_tsOUT: The decoded TS
Returns:
true in case of success, false otherwise
bool ts_decode_unscaled_bits ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts_unscaled_bits,
const size_t  ts_unscaled_bits_nr,
uint32_t *const  decoded_ts,
const bool  compat_1_6_x 
)

Decode timestamp (TS) value with some LSB bits of the unscaled value.

Use the given unscaled TS bits. If the TS_STRIDE value was updated by the current packet, compute new TS_SCALED and TS_OFFSET values from the new TS_STRIDE value.

Parameters:
ts_scThe ts_sc_decomp object
ts_unscaled_bitsThe W-LSB-encoded TS value
ts_unscaled_bits_nrThe number of bits of TS_SCALED (W-LSB)
decoded_tsOUT: The decoded TS
compat_1_6_xKeep the behaviour of <= 1.6.x versions
Returns:
true in case of success, false otherwise
uint32_t ts_deduce_from_sn ( struct ts_sc_decomp *const  ts_sc,
const uint16_t  sn 
)

Deduct timestamp (TS) from Sequence Number (SN)

Use the given SN bits to compute the new TS_SCALED value. Use the TS_STRIDE and TS_OFFSET values found in context.

Parameters:
ts_scThe ts_sc_decomp object
snThe SN
Returns:
The decoded TS
void ts_update_context ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts,
const uint16_t  sn 
)

Store a new timestamp.

Parameters:
ts_scThe ts_sc_decomp object
tsThe new decoded TimeStamp (TS)
snThe new decoded Sequence Number (SN)