Avoid FFTW re-planning if no DFT change is required

This commit is contained in:
Xavier Arteaga 2021-02-16 12:06:55 +01:00 committed by Xavier Arteaga
parent 596c8f52a9
commit 2fd618a295
1 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,11 @@ int srslte_dft_replan_c(srslte_dft_plan_t* plan, const int new_dft_points)
{
int sign = (plan->dir == SRSLTE_DFT_FORWARD) ? FFTW_FORWARD : FFTW_BACKWARD;
// No change in size, skip re-planning
if (plan->size == new_dft_points) {
return 0;
}
pthread_mutex_lock(&fft_mutex);
if (plan->p) {
fftwf_destroy_plan(plan->p);