ROHC compression/decompression library
Functions
ts_sc_decomp.h File Reference

Scaled RTP Timestamp decoding. More...

#include "lsb_decode.h"
#include "dllexport.h"
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for ts_sc_decomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct ts_sc_decomp *ROHC_EXPORT d_create_sc (void)
 Create the scaled RTP Timestamp decoding context.
void ROHC_EXPORT rohc_ts_scaled_free (struct ts_sc_decomp *const ts_scaled) __attribute__((nonnull(1)))
 Destroy the given ts_sc_decomp object.
void ROHC_EXPORT ts_update_context (struct ts_sc_decomp *const ts_sc, const uint32_t ts, const uint16_t sn)
 Store a new timestamp.
void ROHC_EXPORT d_record_ts_stride (struct ts_sc_decomp *const ts_sc, const uint32_t ts_stride)
 Store the newly-parsed TS_STRIDE value.
bool ROHC_EXPORT ts_decode_scaled (struct ts_sc_decomp *const ts_sc, const uint32_t ts_scaled, const size_t bits_nr, uint32_t *const decoded_ts)
 Decode timestamp (TS) value with TS_SCALED value.
uint32_t ROHC_EXPORT ts_decode_unscaled (struct ts_sc_decomp *const ts_sc, const uint32_t ts_bits)
 Decode timestamp (TS) value with unscaled value.
uint32_t ROHC_EXPORT 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>

Function Documentation

struct ts_sc_decomp* ROHC_EXPORT d_create_sc ( void  ) [read]
void ROHC_EXPORT 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

References ts_sc_decomp::new_ts_stride, rohc_debugf, and ts_sc_decomp::ts_stride.

void ROHC_EXPORT 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

References ts_sc_decomp::lsb_ts_scaled, and rohc_lsb_free().

bool ROHC_EXPORT ts_decode_scaled ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts_scaled,
const size_t  bits_nr,
uint32_t *const  decoded_ts 
)

Decode timestamp (TS) value with 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_scaledThe W-LSB-encoded TS_SCALED value
bits_nrThe number of bits of TS_SCALED (W-LSB)
decoded_tsOUT: The decoded TS
Returns:
true in case of success, false otherwise

References ts_sc_decomp::lsb_ts_scaled, ts_sc_decomp::new_ts_offset, ts_sc_decomp::new_ts_scaled, ts_sc_decomp::new_ts_stride, rohc_debugf, rohc_lsb_decode32(), rohc_lsb_get_ref(), ts_sc_decomp::ts_offset, and ts_sc_decomp::ts_stride.

uint32_t ROHC_EXPORT ts_decode_unscaled ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts_bits 
)

Decode timestamp (TS) value with 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_bitsThe unscaled TS bits
Returns:
The decoded TS

References ts_sc_decomp::new_ts_offset, ts_sc_decomp::new_ts_scaled, ts_sc_decomp::new_ts_stride, rohc_debugf, and ts_sc_decomp::ts_stride.

uint32_t ROHC_EXPORT 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

References ts_sc_decomp::new_ts_offset, ts_sc_decomp::new_ts_scaled, ts_sc_decomp::new_ts_stride, rohc_debugf, ts_sc_decomp::sn, ts_sc_decomp::ts_offset, ts_sc_decomp::ts_scaled, and ts_sc_decomp::ts_stride.

void ROHC_EXPORT ts_update_context ( struct ts_sc_decomp *const  ts_sc,
const uint32_t  ts,
const uint16_t  sn 
)