Skip to content

Commit c30adfd

Browse files
committed
Revert "Use non in-place FFT for dft_speech()."
This reverts commit e2875ad.
1 parent e2875ad commit c30adfd

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/codec2.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,11 +2088,7 @@ void analyse_one_frame(struct CODEC2 *c2, MODEL *model, short speech[])
20882088
for(i=0; i<n_samp; i++)
20892089
c2->Sn[i+m_pitch-n_samp] = speech[i];
20902090

2091-
#if defined(STM32F40_41xxx)
20922091
dft_speech(&c2->c2const, c2->fft_fwd_cfg, Sw, c2->Sn, c2->w);
2093-
#else
2094-
dft_speech(&c2->c2const, c2->fftr_fwd_cfg, Sw, c2->Sn, c2->w);
2095-
#endif // STM32F40_41xxx
20962092

20972093
/* Estimate pitch */
20982094
nlp(c2->nlp, c2->Sn, n_samp, &pitch, Sw, c2->W, &c2->prev_f0_enc);

src/sine.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ float hpf(float x, float states[])
231231

232232
// TODO: we can either go for a faster FFT using fftr and some stack usage
233233
// or we can reduce stack usage to almost zero on STM32 by switching to fft_inplace
234-
#if defined(STM32F40_41xxx)
234+
#if 1
235235
void dft_speech(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, COMP Sw[], float Sn[], float w[])
236236
{
237237
int i;
@@ -259,12 +259,10 @@ void dft_speech(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, COMP Sw[], float S
259259
codec2_fft_inplace(fft_fwd_cfg, Sw);
260260
}
261261
#else
262-
void dft_speech(C2CONST* c2const, codec2_fftr_cfg fftr_fwd_cfg, COMP Sw[], float Sn[], float w[])
262+
void dft_speech(codec2_fftr_cfg fftr_fwd_cfg, COMP Sw[], float Sn[], float w[])
263263
{
264264
int i;
265265
float sw[FFT_ENC];
266-
int m_pitch = c2const->m_pitch;
267-
int nw = c2const->nw;
268266

269267
for(i=0; i<FFT_ENC; i++) {
270268
sw[i] = 0.0;

src/sine.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ C2CONST c2const_create(int Fs, float framelength_ms);
3636

3737
void make_analysis_window(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, float w[], float W[]);
3838
float hpf(float x, float states[]);
39-
#if defined(STM32F40_41xxx)
4039
void dft_speech(C2CONST *c2const, codec2_fft_cfg fft_fwd_cfg, COMP Sw[], float Sn[], float w[]);
41-
#else
42-
void dft_speech(C2CONST* c2const, codec2_fftr_cfg fftr_fwd_cfg, COMP Sw[], float Sn[], float w[]);
43-
#endif
4440
void two_stage_pitch_refinement(C2CONST *c2const, MODEL *model, COMP Sw[]);
4541
void estimate_amplitudes(MODEL *model, COMP Sw[], float W[], int est_phase);
4642
float est_voicing_mbe(C2CONST *c2const, MODEL *model, COMP Sw[], float W[]);

0 commit comments

Comments
 (0)