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

Scaled RTP Timestamp encoding. More...

#include "wlsb.h"
Include dependency graph for ts_sc_comp.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

int c_create_sc (struct ts_sc_comp *const ts_sc)
 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.
int nb_bits_scaled (const struct ts_sc_comp 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, 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 ts_sc)
 Return the TS_STRIDE value.
uint32_t get_ts_scaled (const struct ts_sc_comp ts_sc)
 Return the TS_SCALED value.
int is_ts_constant (const struct ts_sc_comp ts_sc)
 Whether TimeStamp (TS) did not change 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>

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,
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

References c_add_wlsb(), ts_sc_comp::scaled_window, and ts_sc_comp::ts_scaled.

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

References INIT_STRIDE, INIT_TS, ts_sc_comp::is_deductible, ts_sc_comp::nr_init_stride_packets, ts_sc_comp::old_sn, ts_sc_comp::old_ts, rohc_debugf, sdvl_can_value_be_encoded(), SEND_SCALED, ts_sc_comp::sn, sn, ts_sc_comp::state, ts_sc_comp::ts, ts_sc_comp::ts_delta, ts_sc_comp::ts_offset, ts_sc_comp::ts_scaled, and ts_sc_comp::ts_stride.

Referenced by c_generic_encode().

int c_create_sc ( struct ts_sc_comp *const  ts_sc)
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

References c_destroy_wlsb(), and ts_sc_comp::scaled_window.

Referenced by c_rtp_destroy().

uint32_t get_ts_scaled ( const struct ts_sc_comp  ts_sc)

Return the TS_SCALED value.

Parameters:
ts_scThe ts_sc_comp object
Returns:
The TS_SCALED value

References ts_sc_comp::ts_scaled.

uint32_t get_ts_stride ( const struct ts_sc_comp  ts_sc)

Return the TS_STRIDE value.

Parameters:
ts_scThe ts_sc_comp object
Returns:
TS_STRIDE value

References ts_sc_comp::ts_stride.

Referenced by rtp_code_dynamic_rtp_part(), and rtp_header_flags_and_fields().

int is_ts_constant ( const struct ts_sc_comp  ts_sc)

Whether TimeStamp (TS) did not change or not.

Parameters:
ts_scThe ts_sc_comp object
Returns:
1 if TS did not change, 0 otherwise

References ts_sc_comp::ts_delta.

Referenced by code_EXT3_packet(), rtp_code_dynamic_rtp_part(), and rtp_decide_state().

int nb_bits_scaled ( const struct ts_sc_comp  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:
1 in case of success, 0 if the minimal number of bits can not be found

References c_get_k_wlsb(), ts_sc_comp::is_deductible, ts_sc_comp::scaled_window, and ts_sc_comp::ts_scaled.