libosmocodec 1.13.1.1-afb4 Osmocom codec library

Data Structures | Macros | Enumerations | Functions | Variables
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_state * | ecu_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

enum ecu_principal_state

Enumerator
STATE_NO_DATA |
STATE_SPEECH |
STATE_SP_MUTING |
STATE_SID |
STATE_SID_MUTING |

## Function Documentation

## ◆ __attribute__()

static __attribute__ | ( | (constructor) |  | ) |
| static

References OSMO_ECU_CODEC_FR, osmo_ecu_ops_fr, and osmo_ecu_register().

## ◆ _osmo_ecu_state_get_fr()

static struct fr_ecu_state * _osmo_ecu_state_get_fr | ( | struct osmo_ecu_state * | st | ) |
| inline static

References container_of, and fr_ecu_state::ecu_state.

Referenced by ecu_fr_frame_in(), ecu_fr_frame_out(), and ecu_fr_is_dtx_pause().

## ◆ 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

References _osmo_ecu_state_get_fr(), fr_ecu_input(), and GSM_FR_BYTES.

## ◆ ecu_fr_frame_out()

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

References _osmo_ecu_state_get_fr(), fr_ecu_output(), and GSM_FR_BYTES.

## ◆ ecu_fr_init()

static struct osmo_ecu_state * ecu_fr_init | ( | void * | ctx,
|  | enum osmo_ecu_codec | codec
| ) |  |
| static

References osmo_ecu_state::codec, fr_ecu_state::ecu_state, osmo_prbs15, osmo_prbs_state_init(), fr_ecu_state::pr_state, fr_ecu_state::prng, and STATE_NO_DATA.

## ◆ ecu_fr_is_dtx_pause()

static bool ecu_fr_is_dtx_pause | ( | struct osmo_ecu_state * | st | ) |
| static

References _osmo_ecu_state_get_fr(), and fr_ecu_state::last_input_was_sid.

## ◆ fr_ecu_input()

static void fr_ecu_input | ( | struct fr_ecu_state * | fr,
|  | const uint8_t * | frame
| ) |  |
| static

References GSM_FR_BYTES, fr_ecu_state::last_input_was_sid, OSMO_ASSERT, osmo_fr_sid_classify(), OSMO_GSM631_SID_CLASS_INVALID, OSMO_GSM631_SID_CLASS_SPEECH, OSMO_GSM631_SID_CLASS_VALID, fr_ecu_state::pr_state, fr_ecu_state::sid_prefix, SID_PREFIX_LEN, fr_ecu_state::sid_reemit_count, fr_ecu_state::sid_xmaxc, fr_ecu_state::speech_frame, STATE_SID, and STATE_SPEECH.

Referenced by ecu_fr_frame_in().

## ◆ fr_ecu_output()

static void fr_ecu_output | ( | struct fr_ecu_state * | fr,
|  | uint8_t * | frame
| ) |  |
| static

References GSM_FR_BYTES, OSMO_ASSERT, osmo_gsm611_silence_frame, fr_ecu_state::pr_state, random_grid_pos(), reduce_xmaxc(), reduce_xmaxc_sid(), reemit_sid(), fr_ecu_state::sid_reemit_count, fr_ecu_state::speech_frame, STATE_NO_DATA, STATE_SID, STATE_SID_MUTING, STATE_SP_MUTING, and STATE_SPEECH.

Referenced by ecu_fr_frame_out().

## ◆ 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

References GSM611_XMAXC_REDUCE, and fr_ecu_state::sid_xmaxc.

Referenced by fr_ecu_output().

## ◆ reemit_sid()

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

References fr_ecu_state::sid_prefix, SID_PREFIX_LEN, and fr_ecu_state::sid_xmaxc.

Referenced by fr_ecu_output().

## 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,
}
ecu_fr_is_dtx_pause
static bool ecu_fr_is_dtx_pause(struct osmo_ecu_state *st)
Definition: ecu_fr.c:327
ecu_fr_frame_out
static int ecu_fr_frame_out(struct osmo_ecu_state *st, uint8_t *frame_out)
Definition: ecu_fr.c:319
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)
Definition: ecu_fr.c:303
ecu_fr_init
static struct osmo_ecu_state * ecu_fr_init(void *ctx, enum osmo_ecu_codec codec)
Definition: ecu_fr.c:286

Referenced by __attribute__().