libosmocodec  1.0.1.85-9f28
Osmocom codec library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
ecu_fr.c File Reference
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/codec/gsm610_bits.h>
#include <osmocom/codec/codec.h>
#include <osmocom/codec/ecu.h>

Macros

#define GSM610_XMAXC_REDUCE   4
 
#define GSM610_XMAXC_LEN   6
 

Functions

static bool reduce_xmaxcr (struct bitvec *frame_bitvec, const unsigned int index)
 Reduce the XMAXC field. More...
 
static bool reduce_xmaxcr_all (struct bitvec *frame_bitvec)
 Reduce all XMAXC fields in the frame. More...
 
static int conceal_frame (uint8_t *frame)
 
void osmo_ecu_fr_reset (struct osmo_ecu_fr_state *state, uint8_t *frame)
 To be called when a good frame is received. More...
 
int osmo_ecu_fr_conceal (struct osmo_ecu_fr_state *state, uint8_t *frame)
 To be called when a bad frame is received. More...
 

Macro Definition Documentation

#define GSM610_XMAXC_LEN   6

Referenced by reduce_xmaxcr().

#define GSM610_XMAXC_REDUCE   4

Referenced by reduce_xmaxcr().

Function Documentation

static int conceal_frame ( uint8_t *  frame)
static
int osmo_ecu_fr_conceal ( struct osmo_ecu_fr_state state,
uint8_t *  frame 
)

To be called when a bad frame is received.

This function will then generate a replacement frame that can be used to conceal the dropout.

References conceal_frame(), osmo_ecu_fr_state::frame_backup, GSM_FR_BYTES, and osmo_ecu_fr_state::subsequent_lost_frame.

void osmo_ecu_fr_reset ( struct osmo_ecu_fr_state state,
uint8_t *  frame 
)

To be called when a good frame is received.

This function will then create a backup of the frame and reset the internal state.

References osmo_ecu_fr_state::frame_backup, GSM_FR_BYTES, and osmo_ecu_fr_state::subsequent_lost_frame.

static bool reduce_xmaxcr ( struct bitvec frame_bitvec,
const unsigned int  index 
)
static

Reduce the XMAXC field.

When the XMAXC field reaches zero the function will return true.

References bitvec_read_field(), bitvec_write_field(), GSM610_XMAXC_LEN, and GSM610_XMAXC_REDUCE.

Referenced by reduce_xmaxcr_all().

static bool reduce_xmaxcr_all ( struct bitvec frame_bitvec)
static

Reduce all XMAXC fields in the frame.

When all XMAXC fields reach zero, then the function will return true.

References GSM610_RTP_XMAXC00, GSM610_RTP_XMAXC10, GSM610_RTP_XMAXC20, GSM610_RTP_XMAXC30, and reduce_xmaxcr().

Referenced by conceal_frame().