osmo-gmr: AMBE vocoder

osmo-gmr 0.2.104-2b98 Osmocom GMR-1

Modules | Files | Data Structures | Functions
AMBE vocoder

## Modules
| AMBE vocoder - internal API

## Files
file | codec.h
| Osmocom GMR-1 AMBE vocoder header.
file | codec.c
| Osmocom GMR-1 AMBE vocoder public API implementation.

## Data Structures
struct | gmr1_codec
| Structure for GMR1 codec state. More...

## Functions
struct gmr1_codec * | gmr1_codec_alloc (void)
| Allocates and inits a codec object. More...
void | gmr1_codec_release (struct gmr1_codec *codec)
| Release a codec object created by gmr1_codec_alloc. More...
int | gmr1_codec_decode_frame (struct gmr1_codec *codec, int16_t *audio, int N, const uint8_t *frame, int bad)
| Decodes an AMBE frame to audio. More...
int | gmr1_codec_decode_dtx (struct gmr1_codec *codec, int16_t *audio, int N)
| Generates audio for DTX period. More...

## Detailed Description

## Function Documentation

## ◆ gmr1_codec_alloc()

struct gmr1_codec * gmr1_codec_alloc | ( | void |  | ) |

Allocates and inits a codec object.

Returns
  A newly allocated codec, to be freed with gmr1_codec_release

References ambe_decode_init(), and gmr1_codec::dec.

## ◆ gmr1_codec_decode_dtx()

int gmr1_codec_decode_dtx | ( | struct gmr1_codec * | codec,
|  | int16_t * | audio,
|  | int | N
| ) |  |

Generates audio for DTX period.

Parameters

  [in] | codec | Codec object
  [out] | audio | Output audio buffer
  [in] | N | number of audio samples to produce (152..168)

References ambe_decode_dtx(), and gmr1_codec::dec.

## ◆ gmr1_codec_decode_frame()

int gmr1_codec_decode_frame | ( | struct gmr1_codec * | codec,
|  | int16_t * | audio,
|  | int | N,
|  | const uint8_t * | frame,
|  | int | bad
| ) |  |

Decodes an AMBE frame to audio.

Parameters

  [in] | codec | Codec object
  [out] | audio | Output audio buffer
  [in] | N | number of audio samples to produce (152..168)
  [in] | frame | Frame data (10 bytes = 80 bits)
  [in] | bad | Bad Frame Indicator. Set to 1 if frame is corrupt

Returns
  0 for success. Negative error code otherwise.

References ambe_decode_frame(), and gmr1_codec::dec.

## ◆ gmr1_codec_release()

void gmr1_codec_release | ( | struct gmr1_codec * | codec | ) |

Release a codec object created by gmr1_codec_alloc.

Parameters

  [in] | codec | The codec object to release

References ambe_decode_fini(), and gmr1_codec::dec.