osmo-gmr 0.2.104-2b98
Osmocom GMR-1
private.h File Reference

Osmocom GMR-1 AMBE vocoder private header. More...

#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  ambe_raw_params
 AMBE encoded frame raw parameters. More...
 
struct  ambe_subframe
 AMBE subframe parameters. More...
 
struct  ambe_synth
 AMBE synthesizer state. More...
 
struct  ambe_decoder
 AMBE decoder state. More...
 

Macros

#define AMBE_RATE   8000
 AMBE sample rate (Hz)
 
#define M_PIf   (3.141592653589793f)
 Value of pi as a float.
 

Enumerations

enum  ambe_frame_type { AMBE_SPEECH , AMBE_SILENCE , AMBE_TONE }
 AMBE possible frame types. More...
 

Functions

void ambe_decode_init (struct ambe_decoder *dec)
 Initializes decoder state. More...
 
void ambe_decode_fini (struct ambe_decoder *dec)
 Release all resources associated with a decoder. More...
 
int ambe_decode_frame (struct ambe_decoder *dec, int16_t *audio, int N, const uint8_t *frame, int bad)
 Decodes an AMBE frame to audio. More...
 
int ambe_decode_dtx (struct ambe_decoder *dec, int16_t *audio, int N)
 Generates audio for DTX period. More...
 
void ambe_frame_unpack_raw (struct ambe_raw_params *rp, const uint8_t *frame)
 Unpack a frame into its raw encoded parameters. More...
 
void ambe_frame_decode_params (struct ambe_subframe *sf, struct ambe_subframe *sf_prev, struct ambe_raw_params *rp)
 Decodes the speech parameters for both subframes from raw params. More...
 
void ambe_subframe_expand (struct ambe_subframe *sf)
 Expands the decoded subframe params to prepare for synthesis. More...
 
float cosf_fast (float angle)
 Fast Cosinus approximation using a simple table. More...
 
float sinf_fast (float angle)
 Fast Sinus approximation using a simple table. More...
 
void ambe_fdct (float *out, float *in, int N, int M)
 Forward Discrete Cosine Transform (fDCT) More...
 
void ambe_idct (float *out, float *in, int N, int M)
 Inverse Discrete Cosine Transform (iDCT) More...
 
void ambe_fdft_fc (float *out_i, float *out_q, float *in, int N, int M)
 Forward Discrete Fourrier Transform (float->complex) More...
 
void ambe_idft_cf (float *out, float *in_i, float *in_q, int N, int M)
 Inverse Discret Fourrier Transform (complex->float) More...
 
void ambe_synth_init (struct ambe_synth *synth)
 Initialized Synthesizer state. More...
 
void ambe_synth_enhance (struct ambe_synth *synth, struct ambe_subframe *sf)
 Apply the spectral magnitude enhancement on the subframe. More...
 
void ambe_synth_audio (struct ambe_synth *synth, int16_t *audio, struct ambe_subframe *sf, struct ambe_subframe *sf_prev)
 Generate audio for a given subframe. More...
 
int ambe_decode_tone (struct ambe_decoder *dec, int16_t *audio, int N, const uint8_t *frame)
 Decodes an AMBE tone frame. More...
 

Variables

const uint8_t ambe_hpg_tbl [48][4]
 Number of harmonics per group for a given L (starts at L=9)
 
const float ambe_gain_tbl [256][2]
 Gain (subframe 0, subframe 1)
 
const uint16_t ambe_v_uv_tbl [64]
 V/UV decisions (subframe 0 = low byte. MSBs = low freq)
 
const float ambe_prba12_tbl [128][2]
 PRBA[1:2].
 
const float ambe_prba34_tbl [64][2]
 PRBA[3:4].
 
const float ambe_prba57_tbl [128][3]
 PRBA[5:7].
 
const float ambe_hoc0_tbl [128][4]
 HOC for 1st frequency block.
 
const float ambe_hoc1_tbl [64][4]
 HOC for 2nd frequency block.
 
const float ambe_hoc2_tbl [64][4]
 HOC for 3rd frequency block.
 
const float ambe_hoc3_tbl [64][4]
 HOC for last frequency block.
 
const float ambe_sf0_interp_tbl [4]
 Interpolation ratios for subframe 0 magnitude prediction.
 
const float ambe_sf0_perr14_tbl [64][4]
 Prediction Error [1:4] for subframe 0.
 
const float ambe_sf0_perr58_tbl [32][4]
 Prediction Error [5:8] for subframe 0.
 

Detailed Description

Osmocom GMR-1 AMBE vocoder private header.