Skip to content

Commit f51925c

Browse files
committed
Audio: STFT Process: Remove unused fill_start_idx
This patch removes fill_start_idx member from struct stft_process_fft. It would have required another check for data align and samples amount for Xtensa HIFI SIMD code version. There is no need for different FFT padding types (left, center, right as in MFCC) in this component, so it's safe to remove. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent fbf6058 commit f51925c

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

src/audio/stft_process/stft_process-generic.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void stft_process_overlap_add_ifft_buffer(struct stft_process_state *state, int
1818
int i;
1919
int n;
2020
int samples_remain = fft->fft_size;
21-
int idx = fft->fft_fill_start_idx;
21+
int idx = 0;
2222

2323
while (samples_remain) {
2424
n = stft_process_buffer_samples_without_wrap(obuf, w);
@@ -49,12 +49,11 @@ void stft_process_apply_window(struct stft_process_state *state)
4949
{
5050
struct stft_process_fft *fft = &state->fft;
5151
int j;
52-
int i = fft->fft_fill_start_idx;
5352

5453
/* Multiply Q1.31 by Q1.15 gives Q2.46, shift right by 15 to get Q2.31, no saturate need */
5554
for (j = 0; j < fft->fft_size; j++)
56-
fft->fft_buf[i + j].real =
57-
sat_int32(Q_MULTSR_32X32((int64_t)fft->fft_buf[i + j].real,
55+
fft->fft_buf[j].real =
56+
sat_int32(Q_MULTSR_32X32((int64_t)fft->fft_buf[j].real,
5857
state->window[j], 31, 31, 31));
5958
}
6059
#endif /* SOF_USE_HIFI(NONE, COMP_STFT_PROCESS) */

src/audio/stft_process/stft_process-hifi3.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ void stft_process_apply_window(struct stft_process_state *state)
3737
ae_f32x2 win01, win23;
3838
ae_int32x2 d0, d1;
3939
int fft_size = fft->fft_size;
40-
int i = fft->fft_fill_start_idx;
4140
int j;
4241
int n4;
4342

@@ -52,7 +51,7 @@ void stft_process_apply_window(struct stft_process_state *state)
5251
* Stride for buf is sizeof(ae_int32x2) = 8 bytes per complex sample.
5352
* Stride for win is sizeof(ae_int32) = 4 bytes per scalar window value.
5453
*/
55-
buf = (ae_int32 *)&fft->fft_buf[i];
54+
buf = (ae_int32 *)fft->fft_buf;
5655
win = (const ae_int32x2 *)state->window;
5756

5857
assert(!(fft_size & 3));
@@ -109,7 +108,7 @@ void stft_process_overlap_add_ifft_buffer(struct stft_process_state *state, int
109108
ae_f32x2 fft_data;
110109
ae_f32x2 d0, d1;
111110
ae_f32x2 *w = (ae_f32x2 *)obuf->w_ptr;
112-
ae_f32 *fft_p = (ae_f32 *)&fft->fft_buf[fft->fft_fill_start_idx];
111+
ae_f32 *fft_p = (ae_f32 *)fft->fft_buf;
113112
int samples_remain = fft->fft_size;
114113
int i, n;
115114

src/audio/stft_process/stft_process.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ struct stft_process_fft {
6666
struct ipolar32 *fft_polar;
6767
struct fft_multi_plan *fft_plan;
6868
struct fft_multi_plan *ifft_plan;
69-
int fft_fill_start_idx; /**< Set to 0 for pad left, etc. */
7069
int fft_size;
7170
int fft_padded_size;
7271
int fft_hop_size;

src/audio/stft_process/stft_process_setup.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,6 @@ int stft_process_setup(struct processing_module *mod, int max_frames,
180180
/* Share the fft_out buffer for polar format */
181181
fft->fft_polar = (struct ipolar32 *)fft->fft_out;
182182

183-
fft->fft_fill_start_idx = 0; /* From config pad_type */
184-
185183
/* Setup FFT */
186184
fft->fft_plan = mod_fft_multi_plan_new(mod, fft->fft_buf, fft->fft_out,
187185
fft->fft_padded_size, 32);

0 commit comments

Comments
 (0)