src/audio/eq_fir/eq_fir_hifi3.c
/* For even frame lengths use FIR filter that processes two sequential
 * sample per call.
 */
For even frame lengths use FIR filter that processes two sequential
sample per call.
For even frame lengths use FIR filter that processes two sequential sample per call .
void eq_fir_2x_s32(struct fir_state_32x16 fir[], const struct audio_stream *source,
		   struct audio_stream *sink, int frames, int nch)
{
	struct fir_state_32x16 *f;
	ae_int32x2 d0 = 0;
	ae_int32x2 d1 = 0;
	ae_int32 *src = (ae_int32 *)source->r_ptr;
	ae_int32 *snk = (ae_int32 *)sink->w_ptr;
	ae_int32 *x;
	ae_int32 *y0;
	ae_int32 *y1;
	int ch;
	int i;
	int rshift;
	int lshift;
	int shift;
	int inc_nch_s = nch * sizeof(int32_t);
	int inc_2nch_s = 2 * inc_nch_s;
	for (ch = 0; ch < nch; ch++) {
		f = &fir[ch];
		fir_get_lrshifts(f, &lshift, &rshift);
		shift = lshift - rshift;
		fir_comp_setup_circular(source);
		x = src;
		AE_L32_XC(d0, src, sizeof(int32_t));
		fir_comp_setup_circular(sink);
		y0 = snk;
		y1 = snk;
		AE_L32_XC(d0, snk, sizeof(int32_t));
		AE_L32_XC(d1, y1, inc_nch_s);
		for (i = 0; i < (frames >> 1); i++) {
			fir_comp_setup_circular(source);
			AE_L32_XC(d0, x, inc_nch_s);
			AE_L32_XC(d1, x, inc_nch_s);
			fir_core_setup_circular(f);
			fir_32x16_2x_hifi3(f, d0, d1, y0, y1, shift);
			fir_comp_setup_circular(sink);
			AE_L32_XC(d0, y0, inc_2nch_s);
			AE_L32_XC(d1, y1, inc_2nch_s);
		}
	}
}
void eq_fir_2x_s32 ( struct fir_state_32x16 fir [ ] , const struct audio_stream * source , struct audio_stream * sink , int frames , int nch ) { struct fir_state_32x16 * f ; ae_int32x2 d0 = 0 ; ae_int32x2 d1 = 0 ; ae_int32 * src = ( ae_int32 * ) source -> r_ptr ; ae_int32 * snk = ( ae_int32 * ) sink -> w_ptr ; ae_int32 * x ; ae_int32 * y0 ; ae_int32 * y1 ; int ch ; int i ; int rshift ; int lshift ; int shift ; int inc_nch_s = nch * sizeof ( int32_t ) ; int inc_2nch_s = 2 * inc_nch_s ; for ( ch = 0 ; ch < nch ; ch ++ ) { f = & fir [ ch ] ; fir_get_lrshifts ( f , & lshift , & rshift ) ; shift = lshift - rshift ; fir_comp_setup_circular ( source ) ; x = src ; AE_L32_XC ( d0 , src , sizeof ( int32_t ) ) ; fir_comp_setup_circular ( sink ) ; y0 = snk ; y1 = snk ; AE_L32_XC ( d0 , snk , sizeof ( int32_t ) ) ; AE_L32_XC ( d1 , y1 , inc_nch_s ) ; for ( i = 0 ; i < ( frames >> 1 ) ; i ++ ) { fir_comp_setup_circular ( source ) ; AE_L32_XC ( d0 , x , inc_nch_s ) ; AE_L32_XC ( d1 , x , inc_nch_s ) ; fir_core_setup_circular ( f ) ; fir_32x16_2x_hifi3 ( f , d0 , d1 , y0 , y1 , shift ) ; fir_comp_setup_circular ( sink ) ; AE_L32_XC ( d0 , y0 , inc_2nch_s ) ; AE_L32_XC ( d1 , y1 , inc_2nch_s ) ; } } }
For even frame lengths use FIR filter that processes two sequential
 sample per call.
For even frame lengths use FIR filter that processes two sequential sample per call .
/* Get FIR instance and get shifts.
		 */ /* Copy src to x and advance src with dummy load */ /* Copy snk to y0 and advance snk with dummy load. Pointer
		 * y1 is set to be ahead of y0 with one frame.
		 */ /* Load two input samples via input pointer x */ /* Compute FIR */ /* Update output pointers y0 and y1 with dummy loads */