@@ -44,7 +44,6 @@ struct fir_state_32x16 {
4444 ae_p24f * delay ; /* Pointer to FIR delay line */
4545 ae_p24f * delay_end ; /* Pointer to FIR delay line end */
4646 ae_p16x2s * coef ; /* Pointer to FIR coefficients */
47- int mute ; /* Set to 1 to mute EQ output, 0 otherwise */
4847 int taps ; /* Number of FIR taps */
4948 int length ; /* Number of FIR taps plus input length (even) */
5049 int in_shift ; /* Amount of right shifts at input */
@@ -53,7 +52,8 @@ struct fir_state_32x16 {
5352
5453void fir_reset (struct fir_state_32x16 * fir );
5554
56- int fir_init_coef (struct fir_state_32x16 * fir , int16_t config []);
55+ size_t fir_init_coef (struct fir_state_32x16 * fir ,
56+ struct sof_eq_fir_coef_data * config );
5757
5858void fir_init_delay (struct fir_state_32x16 * fir , int32_t * * data );
5959
@@ -65,18 +65,6 @@ void eq_fir_2x_s32_hifiep(struct fir_state_32x16 fir[],
6565void eq_fir_s32_hifiep (struct fir_state_32x16 fir [], struct comp_buffer * source ,
6666 struct comp_buffer * sink , int frames , int nch );
6767
68- /* The next trivial functions are inlined */
69-
70- static inline void fir_mute (struct fir_state_32x16 * fir )
71- {
72- fir -> mute = 1 ;
73- }
74-
75- static inline void fir_unmute (struct fir_state_32x16 * fir )
76- {
77- fir -> mute = 0 ;
78- }
79-
8068/* Setup circular buffer for FIR input data delay */
8169static inline void fir_hifiep_setup_circular (struct fir_state_32x16 * fir )
8270{
@@ -114,6 +102,12 @@ static inline void fir_32x16_hifiep(struct fir_state_32x16 *fir, int32_t *x,
114102 const int taps_div_4 = fir -> taps >> 2 ;
115103 const int inc = sizeof (int32_t );
116104
105+ /* Bypass samples if taps count is zero. */
106+ if (!taps_div_4 ) {
107+ * y = * x ;
108+ return ;
109+ }
110+
117111 /* Write sample to delay */
118112 a = AE_LQ32F_I ((ae_q32s * )x , 0 );
119113 AE_SQ32F_C (a , (ae_q32s * )fir -> rwp , - sizeof (int32_t ));
@@ -184,6 +178,13 @@ static inline void fir_32x16_2x_hifiep(struct fir_state_32x16 *fir, int32_t *x0,
184178 const int taps_div_4 = fir -> taps >> 2 ;
185179 const int inc = 2 * sizeof (int32_t );
186180
181+ /* Bypass samples if taps count is zero. */
182+ if (!taps_div_4 ) {
183+ * y0 = * x0 ;
184+ * y1 = * x1 ;
185+ return ;
186+ }
187+
187188 /* Write samples to delay */
188189 a = AE_LQ32F_I ((ae_q32s * )x0 , 0 );
189190 AE_SQ32F_C (a , (ae_q32s * )fir -> rwp , - sizeof (int32_t ));
0 commit comments