src/audio/eq_fir/eq_fir_hifi2ep.c
/* FIR for any number of frames */
FIR for any number of frames
FIR for any number of frames
void eq_fir_s16(struct fir_state_32x16 fir[], const struct audio_stream *source,
		struct audio_stream *sink, int frames, int nch)
{
	struct fir_state_32x16 *f;
	int16_t *src = (int16_t *)source->r_ptr;
	int16_t *snk = (int16_t *)sink->w_ptr;
	int16_t *x;
	int16_t *y;
	int32_t z;
	int ch;
	int i;
	int rshift;
	int lshift;
	for (ch = 0; ch < nch; ch++) {
		f = &fir[ch];
		fir_get_lrshifts(f, &lshift, &rshift);
		fir_hifiep_setup_circular(f);
		x = src++;
		y = snk++;
		for (i = 0; i < frames; i++) {
			fir_32x16_hifiep(f, *x << 16, &z, lshift, rshift);
			*y = sat_int16(Q_SHIFT_RND(z, 31, 15));
			x += nch;
			y += nch;
		}
	}
}
void eq_fir_s16 ( struct fir_state_32x16 fir [ ] , const struct audio_stream * source , struct audio_stream * sink , int frames , int nch ) { struct fir_state_32x16 * f ; int16_t * src = ( int16_t * ) source -> r_ptr ; int16_t * snk = ( int16_t * ) sink -> w_ptr ; int16_t * x ; int16_t * y ; int32_t z ; int ch ; int i ; int rshift ; int lshift ; for ( ch = 0 ; ch < nch ; ch ++ ) { f = & fir [ ch ] ; fir_get_lrshifts ( f , & lshift , & rshift ) ; fir_hifiep_setup_circular ( f ) ; x = src ++ ; y = snk ++ ; for ( i = 0 ; i < frames ; i ++ ) { fir_32x16_hifiep ( f , * x << 16 , & z , lshift , rshift ) ; * y = sat_int16 ( Q_SHIFT_RND ( z , 31 , 15 ) ) ; x += nch ; y += nch ; } } }
FIR for any number of frames
FIR for any number of frames
/* Get FIR instance and get shifts to e.g. apply mute
		 * without overhead.
		 */ /* Setup circular buffer for FIR input data delay */