Skip to content

Commit

Permalink
Audio: Multiband DRC: Change emphasis filter to iir_df1_4th()
Browse files Browse the repository at this point in the history
This patch changes in multiband DRC component the emphasis and
de-emphasis IIR filters to use the optimized 4th order IIR code.

The patch for crossover already covered the bands filter bank.
This change saves additional 2 MCPS in a HiFi5 build of the
component. From 85.17 MCPS to  83.44 MCPS.

The change is not restricting configuration. The existing filters
are hard-coded to 4th order (SOF_EMP_DEEMP_BIQUADS).

Signed-off-by: Seppo Ingalsuo <[email protected]>
  • Loading branch information
singalsu committed Feb 5, 2025
1 parent 6389eff commit c07023d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/audio/multiband_drc/multiband_drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ static int multiband_drc_eq_init_coef_ch(struct sof_eq_iir_biquad *coef,
{
int ret;

/* Ensure the LR4 can be processed with the simplified 4th order IIR */
if (SOF_EMP_DEEMP_BIQUADS != SOF_IIR_DF1_4TH_NUM_BIQUADS)
return -EINVAL;

eq->coef = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
sizeof(struct sof_eq_iir_biquad) * SOF_EMP_DEEMP_BIQUADS);
if (!eq->coef)
Expand Down
4 changes: 2 additions & 2 deletions src/audio/multiband_drc/multiband_drc_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static void multiband_drc_process_emp_crossover(struct multiband_drc_state *stat
crossover_s = &state->crossover[ch];

if (enable_emp)
emp_out = iir_df1(emp_s, *buf_src);
emp_out = iir_df1_4th(emp_s, *buf_src);
else
emp_out = *buf_src;

Expand Down Expand Up @@ -178,7 +178,7 @@ static void multiband_drc_process_deemp(struct multiband_drc_state *state,
}

if (enable_deemp)
*buf_sink = iir_df1(deemp_s, mix_out);
*buf_sink = iir_df1_4th(deemp_s, mix_out);
else
*buf_sink = mix_out;

Expand Down

0 comments on commit c07023d

Please sign in to comment.