20#ifndef __OSMO_GMR1_CODEC_PRIVATE_H__
21#define __OSMO_GMR1_CODEC_PRIVATE_H__
105 int16_t *audio,
int N,
106 const uint8_t *frame,
int bad);
108 int16_t *audio,
int N);
118#define M_PIf (3.141592653589793f)
122void ambe_fdct(
float *out,
float *in,
int N,
int M);
123void ambe_idct(
float *out,
float *in,
int N,
int M);
124void ambe_fdft_fc(
float *out_i,
float *out_q,
float *in,
int N,
int M);
125void ambe_idft_cf(
float *out,
float *in_i,
float *in_q,
int N,
int M);
151 int16_t *audio,
int N,
const uint8_t *frame);
void ambe_idct(float *out, float *in, int N, int M)
Inverse Discrete Cosine Transform (iDCT)
Definition: math.c:99
const float ambe_sf0_perr58_tbl[32][4]
Prediction Error [5:8] for subframe 0.
Definition: tables.c:1099
ambe_frame_type
AMBE possible frame types.
Definition: private.h:40
void ambe_subframe_expand(struct ambe_subframe *sf)
Expands the decoded subframe params to prepare for synthesis.
Definition: frame.c:357
void ambe_synth_init(struct ambe_synth *synth)
Initialized Synthesizer state.
Definition: synth.c:297
const float ambe_prba57_tbl[128][3]
PRBA[5:7].
Definition: tables.c:555
const float ambe_sf0_perr14_tbl[64][4]
Prediction Error [1:4] for subframe 0.
Definition: tables.c:1031
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.
Definition: frame.c:309
void ambe_synth_enhance(struct ambe_synth *synth, struct ambe_subframe *sf)
Apply the spectral magnitude enhancement on the subframe.
Definition: synth.c:308
const float ambe_hoc3_tbl[64][4]
HOC for last frequency block.
Definition: tables.c:955
float cosf_fast(float angle)
Fast Cosinus approximation using a simple table.
Definition: math.c:51
const uint16_t ambe_v_uv_tbl[64]
V/UV decisions (subframe 0 = low byte. MSBs = low freq)
Definition: tables.c:343
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.
Definition: synth.c:378
void ambe_fdct(float *out, float *in, int N, int M)
Forward Discrete Cosine Transform (fDCT)
Definition: math.c:75
const float ambe_gain_tbl[256][2]
Gain (subframe 0, subframe 1)
Definition: tables.c:83
const float ambe_hoc2_tbl[64][4]
HOC for 3rd frequency block.
Definition: tables.c:887
void ambe_decode_fini(struct ambe_decoder *dec)
Release all resources associated with a decoder.
Definition: ambe.c:55
void ambe_frame_unpack_raw(struct ambe_raw_params *rp, const uint8_t *frame)
Unpack a frame into its raw encoded parameters.
Definition: frame.c:61
int ambe_decode_dtx(struct ambe_decoder *dec, int16_t *audio, int N)
Generates audio for DTX period.
Definition: ambe.c:155
const float ambe_hoc1_tbl[64][4]
HOC for 2nd frequency block.
Definition: tables.c:819
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.
Definition: ambe.c:129
void ambe_fdft_fc(float *out_i, float *out_q, float *in, int N, int M)
Forward Discrete Fourrier Transform (float->complex)
Definition: math.c:127
void ambe_decode_init(struct ambe_decoder *dec)
Initializes decoder state.
Definition: ambe.c:40
const float ambe_prba34_tbl[64][2]
PRBA[3:4].
Definition: tables.c:487
const float ambe_sf0_interp_tbl[4]
Interpolation ratios for subframe 0 magnitude prediction.
Definition: tables.c:1023
const float ambe_hoc0_tbl[128][4]
HOC for 1st frequency block.
Definition: tables.c:687
void ambe_idft_cf(float *out, float *in_i, float *in_q, int N, int M)
Inverse Discret Fourrier Transform (complex->float)
Definition: math.c:158
float sinf_fast(float angle)
Fast Sinus approximation using a simple table.
Definition: math.c:62
const float ambe_prba12_tbl[128][2]
PRBA[1:2].
Definition: tables.c:355
int ambe_decode_tone(struct ambe_decoder *dec, int16_t *audio, int N, const uint8_t *frame)
Decodes an AMBE tone frame.
Definition: tone.c:126
const uint8_t ambe_hpg_tbl[48][4]
Number of harmonics per group for a given L (starts at L=9)
Definition: tables.c:31
@ AMBE_SPEECH
Speech frame.
Definition: private.h:41
@ AMBE_TONE
Tone frame
Definition: private.h:43
@ AMBE_SILENCE
Silence indication frame.
Definition: private.h:42
AMBE decoder state.
Definition: private.h:91
struct ambe_subframe sf_prev
Previous subframe.
Definition: private.h:95
float tone_phase_f1
Phase frequency 1 for tone frames.
Definition: private.h:92
float tone_phase_f2
Phase frequency 2 for tone frames.
Definition: private.h:93
struct ambe_synth synth
Synthesizer state.
Definition: private.h:97
AMBE encoded frame raw parameters.
Definition: private.h:48
uint8_t sf1_prba57
sf1 PRBA[5,6,7] VQ
Definition: private.h:56
uint8_t sf1_prba34
sf1 PRBA[3,4] VQ
Definition: private.h:55
uint8_t pitch
Pitch.
Definition: private.h:49
uint8_t v_uv
V/UV decision VQ.
Definition: private.h:52
uint8_t pitch_interp
Pitch interpolation selection.
Definition: private.h:50
uint8_t sf1_hoc[4]
sf1 HOCs VQ
Definition: private.h:57
uint8_t sf0_mag_interp
sf0 mag interpolation selection
Definition: private.h:59
uint8_t sf0_perr_14
sf0 mag prediction error VQ [1,4]
Definition: private.h:60
uint8_t sf1_prba12
sf1 PRBA[1,2] VQ
Definition: private.h:54
uint8_t gain
Gain VQ.
Definition: private.h:51
uint8_t sf0_perr_58
sf0 mag prediction error VQ [5,8]
Definition: private.h:61
AMBE subframe parameters.
Definition: private.h:66
float f0log
log2(f0)
Definition: private.h:68
int Vl[56]
Per-harmonic voicing state.
Definition: private.h:73
float w0
fundamental frequency (rad/samp)
Definition: private.h:69
int L
Number of harmonics.
Definition: private.h:70
float Ml[56]
spectral magnitudes
Definition: private.h:76
float Mlog[56]
log spectral magnitudes
Definition: private.h:75
float f0
fundamental normalized frequency
Definition: private.h:67
int v_uv[8]
Voicing state.
Definition: private.h:72
float gain
Gain.
Definition: private.h:74
int Lb[4]
Harmonics per block.
Definition: private.h:71
AMBE synthesizer state.
Definition: private.h:81
int16_t u_prev
Last 'u' of previous subframe.
Definition: private.h:82
float phi[56]
Current phase for each harmonic.
Definition: private.h:85
float psi1
Current PSI angle for fundamental.
Definition: private.h:84
float uw_prev[121]
Unvoiced data from previous subframe.
Definition: private.h:83
float SE
Current energy parameter.
Definition: private.h:86