Skip to content

Commit 11055e0

Browse files
committed
Audio: ASRC: Optimize for HiFi5 impulse response calculations
This patch optimizes for HiFi5 the polynomials evaluations to calculate rate conversion FIR impulse responses. The functions asrc_calc_impulse_response_n[4-7]() calculate with Horner's method each coefficient of the FIR with 3th to 5th order polynomial. The header files with polynomials coefficients are re-ordered for for direct 128 bits int32x4 loads. The loop is modified to calculate four FIR coefficients per loop. Since there is no suitable quad-MAC instruction found, the previous dual-MAC is used twice. The saving is 11.6 MCPS, from 38.75 to 27.20 MCPS for 32 bits stereo 44.1 to 48 kHz conversion, push mode. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 35cb65b commit 11055e0

File tree

2 files changed

+185
-112
lines changed

2 files changed

+185
-112
lines changed

src/audio/asrc/asrc_farrow.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,51 @@ static const struct asrc_filter_params c_filter_params[CR_NUM] = {
145145
* coefficients will be attached to the _Src_farrow struct via the
146146
* initialise_filter function.
147147
*/
148+
149+
#if SOF_USE_MIN_HIFI(5, ASRC)
150+
#include "coef/asrc_farrow_coeff_4x_44100Hz_to_48000Hz.h"
151+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_48000Hz.h"
152+
153+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_24000_TO_08000)
154+
#include "coef/asrc_farrow_coeff_4x_24000Hz_to_08000Hz.h"
155+
#endif
156+
157+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_24000_TO_16000)
158+
#include "coef/asrc_farrow_coeff_4x_24000Hz_to_16000Hz.h"
159+
#endif
160+
161+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_08000)
162+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_08000Hz.h"
163+
#endif
164+
165+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_11025)
166+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_11025Hz.h"
167+
#endif
168+
169+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_12000)
170+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_12000Hz.h"
171+
#endif
172+
173+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_16000)
174+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_16000Hz.h"
175+
#endif
176+
177+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_22050)
178+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_22050Hz.h"
179+
#endif
180+
181+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_24000)
182+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_24000Hz.h"
183+
#endif
184+
185+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_32000)
186+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_32000Hz.h"
187+
#endif
188+
189+
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_44100)
190+
#include "coef/asrc_farrow_coeff_4x_48000Hz_to_44100Hz.h"
191+
#endif
192+
#else
148193
#include "coef/asrc_farrow_coeff_44100Hz_to_48000Hz.h"
149194

150195
#include "coef/asrc_farrow_coeff_48000Hz_to_48000Hz.h"
@@ -188,6 +233,7 @@ static const struct asrc_filter_params c_filter_params[CR_NUM] = {
188233
#if (CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_44100)
189234
#include "coef/asrc_farrow_coeff_48000Hz_to_44100Hz.h"
190235
#endif
236+
#endif
191237

192238
/*
193239
* FUNCTION DECLARATIONS

0 commit comments

Comments
 (0)