libosmocodec 1.9.0.196-9975
Osmocom codec library
ecu_fr.c File Reference
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <osmocom/core/prbs.h>
#include <osmocom/codec/codec.h>
#include <osmocom/codec/ecu.h>
#include <osmocom/core/linuxlist.h>

Data Structures

struct  fr_ecu_state
 

Macros

#define GSM611_XMAXC_REDUCE   4
 
#define SID_PREFIX_LEN   5
 

Enumerations

enum  ecu_principal_state {
  STATE_NO_DATA ,
  STATE_SPEECH ,
  STATE_SP_MUTING ,
  STATE_SID ,
  STATE_SID_MUTING
}
 

Functions

static void fr_ecu_input (struct fr_ecu_state *fr, const uint8_t *frame)
 
static bool reduce_xmaxc (uint8_t *frame)
 
static void random_grid_pos (struct fr_ecu_state *fr, uint8_t *frame)
 
static bool reduce_xmaxc_sid (struct fr_ecu_state *fr)
 
static void reemit_sid (struct fr_ecu_state *fr, uint8_t *frame)
 
static void fr_ecu_output (struct fr_ecu_state *fr, uint8_t *frame)
 
static struct osmo_ecu_stateecu_fr_init (void *ctx, enum osmo_ecu_codec codec)
 
static struct fr_ecu_state_osmo_ecu_state_get_fr (struct osmo_ecu_state *st)
 
static int ecu_fr_frame_in (struct osmo_ecu_state *st, bool bfi, const uint8_t *frame, unsigned int frame_bytes)
 
static int ecu_fr_frame_out (struct osmo_ecu_state *st, uint8_t *frame_out)
 
static bool ecu_fr_is_dtx_pause (struct osmo_ecu_state *st)
 
static __attribute__ ((constructor))
 

Variables

static const struct osmo_ecu_ops osmo_ecu_ops_fr
 

Macro Definition Documentation

◆ GSM611_XMAXC_REDUCE

#define GSM611_XMAXC_REDUCE   4

◆ SID_PREFIX_LEN

#define SID_PREFIX_LEN   5

Enumeration Type Documentation

◆ ecu_principal_state

Enumerator
STATE_NO_DATA 
STATE_SPEECH 
STATE_SP_MUTING 
STATE_SID 
STATE_SID_MUTING 

Function Documentation

◆ __attribute__()

static __attribute__ ( (constructor)  )
static

◆ _osmo_ecu_state_get_fr()

static struct fr_ecu_state * _osmo_ecu_state_get_fr ( struct osmo_ecu_state st)
inlinestatic

◆ ecu_fr_frame_in()

static int ecu_fr_frame_in ( struct osmo_ecu_state st,
bool  bfi,
const uint8_t *  frame,
unsigned int  frame_bytes 
)
static

◆ ecu_fr_frame_out()

static int ecu_fr_frame_out ( struct osmo_ecu_state st,
uint8_t *  frame_out 
)
static

◆ ecu_fr_init()

◆ ecu_fr_is_dtx_pause()

static bool ecu_fr_is_dtx_pause ( struct osmo_ecu_state st)
static

◆ fr_ecu_input()

◆ fr_ecu_output()

◆ random_grid_pos()

static void random_grid_pos ( struct fr_ecu_state fr,
uint8_t *  frame 
)
static

References osmo_prbs_get_ubit(), and fr_ecu_state::prng.

Referenced by fr_ecu_output().

◆ reduce_xmaxc()

static bool reduce_xmaxc ( uint8_t *  frame)
static

References GSM611_XMAXC_REDUCE.

Referenced by fr_ecu_output().

◆ reduce_xmaxc_sid()

static bool reduce_xmaxc_sid ( struct fr_ecu_state fr)
static

◆ reemit_sid()

static void reemit_sid ( struct fr_ecu_state fr,
uint8_t *  frame 
)
static

Variable Documentation

◆ osmo_ecu_ops_fr

const struct osmo_ecu_ops osmo_ecu_ops_fr
static
Initial value:
= {
.init = ecu_fr_init,
.frame_in = ecu_fr_frame_in,
.frame_out = ecu_fr_frame_out,
.is_dtx_pause = ecu_fr_is_dtx_pause,
}
static bool ecu_fr_is_dtx_pause(struct osmo_ecu_state *st)
Definition: ecu_fr.c:327
static int ecu_fr_frame_out(struct osmo_ecu_state *st, uint8_t *frame_out)
Definition: ecu_fr.c:319
static int ecu_fr_frame_in(struct osmo_ecu_state *st, bool bfi, const uint8_t *frame, unsigned int frame_bytes)
Definition: ecu_fr.c:303
static struct osmo_ecu_state * ecu_fr_init(void *ctx, enum osmo_ecu_codec codec)
Definition: ecu_fr.c:286

Referenced by __attribute__().