Skip to content

Commit a7d79d7

Browse files
singalsukv2019i
authored andcommitted
Audio: Crossover: User simpler iir_df1_4th() IIR function
This patch changes crossover component to use the optimized 4th order IIR function. The LR4 (Linkwitz-Riley 4th order) filter bank is hard-coded to 4th order, so this change does no add restrictions. The filter bank is used by multiband DRC component. The saving in three bands configuration in a HiFi5 platform is 5.2 MCPS, from 90.36 MCPS to 85.17 MCPS. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent f03b43b commit a7d79d7

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/audio/crossover/crossover.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ static int crossover_init_coef_lr4(struct sof_eq_iir_biquad *coef,
161161
{
162162
int ret;
163163

164+
/* Ensure the LR4 can be processed with the simplified 4th order IIR */
165+
if (CROSSOVER_LR4_NUM_BIQUADS != SOF_IIR_DF1_4TH_NUM_BIQUADS)
166+
return -EINVAL;
167+
164168
/* Only one set of coefficients is stored in config for both biquads
165169
* in series due to identity. To maintain the structure of
166170
* iir_state_df1, it requires two copies of coefficients in a row.
@@ -190,8 +194,8 @@ static int crossover_init_coef_lr4(struct sof_eq_iir_biquad *coef,
190194
if (!lr4->delay)
191195
return -ENOMEM;
192196

193-
lr4->biquads = 2;
194-
lr4->biquads_in_series = 2;
197+
lr4->biquads = CROSSOVER_LR4_NUM_BIQUADS;
198+
lr4->biquads_in_series = CROSSOVER_LR4_NUM_BIQUADS;
195199

196200
return 0;
197201
}

src/audio/crossover/crossover.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include "crossover_user.h"
1717

18+
#define CROSSOVER_LR4_NUM_BIQUADS 2
19+
1820
struct comp_buffer;
1921
struct comp_dev;
2022

@@ -122,7 +124,7 @@ static inline int32_t crossover_generic_process_lr4(int32_t in,
122124
struct iir_state_df1 *lr4)
123125
{
124126
/* Cascade two biquads with same coefficients in series. */
125-
return iir_df1(lr4, in);
127+
return iir_df1_4th(lr4, in);
126128
}
127129

128130
static inline void crossover_free_config(struct sof_crossover_config **config)

0 commit comments

Comments
 (0)