diff options
Diffstat (limited to 'gr-vocoder/lib/codec2/codec2_internal.h')
-rw-r--r-- | gr-vocoder/lib/codec2/codec2_internal.h | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/gr-vocoder/lib/codec2/codec2_internal.h b/gr-vocoder/lib/codec2/codec2_internal.h index 3aa5300b10..246d1ae6af 100644 --- a/gr-vocoder/lib/codec2/codec2_internal.h +++ b/gr-vocoder/lib/codec2/codec2_internal.h @@ -2,15 +2,15 @@ FILE........: codec2_internal.h AUTHOR......: David Rowe - DATE CREATED: 22 March 2011 + DATE CREATED: April 16 2012 - Some internal structures and states broken out here as they are useful for - testing and development. + Header file for Codec2 internal states, exposed via this header + file to assist in testing. \*---------------------------------------------------------------------------*/ /* - Copyright (C) 2011 David Rowe + Copyright (C) 2012 David Rowe All rights reserved. @@ -27,37 +27,36 @@ */ #ifndef __CODEC2_INTERNAL__ -#define __CODEC2_INTERNAL__ - -/*---------------------------------------------------------------------------*\ - - STATES - -\*---------------------------------------------------------------------------*/ - -typedef struct { - float w[M]; /* time domain hamming window */ - COMP W[FFT_ENC]; /* DFT of w[] */ - float Pn[2*N]; /* trapezoidal synthesis window */ - float Sn[M]; /* input speech */ - float hpf_states[2]; /* high pass filter states */ - void *nlp; /* pitch predictor states */ - float Sn_[2*N]; /* synthesised output speech */ - float ex_phase; /* excitation model phase track */ - float bg_est; /* background noise estimate for post filter */ - float prev_Wo; /* previous frame's pitch estimate */ - MODEL prev_model; /* previous frame's model parameters */ - float prev_lsps[LPC_ORD]; /* previous frame's LSPs */ - float prev_energy; /* previous frame's LPC energy */ -} CODEC2; - -/*---------------------------------------------------------------------------*\ - - FUNCTION HEADERS - -\*---------------------------------------------------------------------------*/ - -void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]); -void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model,float ak[]); +#define __CODEC2_INTERNAL__ + +struct CODEC2 { + int mode; + kiss_fft_cfg fft_fwd_cfg; /* forward FFT config */ + float w[M]; /* time domain hamming window */ + COMP W[FFT_ENC]; /* DFT of w[] */ + float Pn[2*N]; /* trapezoidal synthesis window */ + float Sn[M]; /* input speech */ + float hpf_states[2]; /* high pass filter states */ + void *nlp; /* pitch predictor states */ + + kiss_fft_cfg fft_inv_cfg; /* inverse FFT config */ + float Sn_[2*N]; /* synthesised output speech */ + float ex_phase; /* excitation model phase track */ + float bg_est; /* background noise estimate for post filter */ + float prev_Wo_enc; /* previous frame's pitch estimate */ + MODEL prev_model_dec; /* previous frame's model parameters */ + float prev_lsps_dec[LPC_ORD]; /* previous frame's LSPs */ + float prev_e_dec; /* previous frame's LPC energy */ + + int lpc_pf; /* LPC post filter on */ + int bass_boost; /* LPC post filter bass boost */ + float beta; /* LPC post filter parameters */ + float gamma; + + float xq_enc[2]; /* joint pitch and energy VQ states */ + float xq_dec[2]; + + int smoothing; /* enable smoothing for channels with errors */ +}; #endif |