3
3
FILE........: codec2_internal.h
4
4
AUTHOR......: David Rowe
5
DATE CREATED: April 16 2012
5
DATE CREATED: 22 March 2011
7
Header file for Codec2 internal states, exposed via this header
8
file to assist in testing.
7
Some internal structures and states broken out here as they are useful for
8
testing and development.
10
10
\*---------------------------------------------------------------------------*/
13
Copyright (C) 2012 David Rowe
13
Copyright (C) 2011 David Rowe
15
15
All rights reserved.
29
29
#ifndef __CODEC2_INTERNAL__
30
#define __CODEC2_INTERNAL__
34
kiss_fft_cfg fft_fwd_cfg; /* forward FFT config */
35
float w[M]; /* time domain hamming window */
36
COMP W[FFT_ENC]; /* DFT of w[] */
37
float Pn[2*N]; /* trapezoidal synthesis window */
38
float Sn[M]; /* input speech */
39
float hpf_states[2]; /* high pass filter states */
40
void *nlp; /* pitch predictor states */
42
kiss_fft_cfg fft_inv_cfg; /* inverse FFT config */
43
float Sn_[2*N]; /* synthesised output speech */
44
float ex_phase; /* excitation model phase track */
45
float bg_est; /* background noise estimate for post filter */
46
float prev_Wo_enc; /* previous frame's pitch estimate */
47
MODEL prev_model_dec; /* previous frame's model parameters */
48
float prev_lsps_dec[LPC_ORD]; /* previous frame's LSPs */
49
float prev_e_dec; /* previous frame's LPC energy */
51
int lpc_pf; /* LPC post filter on */
52
int bass_boost; /* LPC post filter bass boost */
53
float beta; /* LPC post filter parameters */
56
float xq_enc[2]; /* joint pitch and energy VQ states */
59
int smoothing; /* enable smoothing for channels with errors */
30
#define __CODEC2_INTERNAL__
32
/*---------------------------------------------------------------------------*\
36
\*---------------------------------------------------------------------------*/
39
float w[M]; /* time domain hamming window */
40
COMP W[FFT_ENC]; /* DFT of w[] */
41
float Pn[2*N]; /* trapezoidal synthesis window */
42
float Sn[M]; /* input speech */
43
float hpf_states[2]; /* high pass filter states */
44
void *nlp; /* pitch predictor states */
45
float Sn_[2*N]; /* synthesised output speech */
46
float ex_phase; /* excitation model phase track */
47
float bg_est; /* background noise estimate for post filter */
48
float prev_Wo; /* previous frame's pitch estimate */
49
MODEL prev_model; /* previous frame's model parameters */
50
float prev_lsps[LPC_ORD]; /* previous frame's LSPs */
51
float prev_energy; /* previous frame's LPC energy */
54
/*---------------------------------------------------------------------------*\
58
\*---------------------------------------------------------------------------*/
60
void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]);
61
void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model,float ak[]);