mirror of https://github.com/thesofproject/sof.git
Audio: EQ FIR: Remove unused FIR processing functions
The unused single frame processing functions can be removed to save code size. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
parent
4476171620
commit
32fa4ed037
|
@ -68,45 +68,6 @@ void eq_fir_2x_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bso
|
|||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
|
||||
/* FIR for any number of frames */
|
||||
void eq_fir_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource,
|
||||
struct output_stream_buffer *bsink,
|
||||
int frames, int nch)
|
||||
{
|
||||
struct audio_stream __sparse_cache *source = bsource->data;
|
||||
struct audio_stream __sparse_cache *sink = bsink->data;
|
||||
struct fir_state_32x16 *f;
|
||||
int32_t *src = (int32_t *)source->r_ptr;
|
||||
int32_t *snk = (int32_t *)sink->w_ptr;
|
||||
int32_t *x;
|
||||
int32_t *y;
|
||||
int ch;
|
||||
int i;
|
||||
int rshift;
|
||||
int lshift;
|
||||
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* Get FIR instance and get shifts to e.g. apply mute
|
||||
* without overhead.
|
||||
*/
|
||||
f = &fir[ch];
|
||||
fir_get_lrshifts(f, &lshift, &rshift);
|
||||
|
||||
/* Setup circular buffer for FIR input data delay */
|
||||
fir_hifiep_setup_circular(f);
|
||||
|
||||
x = src++;
|
||||
y = snk++;
|
||||
for (i = 0; i < frames; i++) {
|
||||
fir_32x16_hifiep(f, *x, y, lshift, rshift);
|
||||
x += nch;
|
||||
y += nch;
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S32LE */
|
||||
|
||||
#if CONFIG_FORMAT_S24LE
|
||||
|
@ -157,47 +118,6 @@ void eq_fir_2x_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bso
|
|||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
|
||||
/* FIR for any number of frames */
|
||||
void eq_fir_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource,
|
||||
struct output_stream_buffer *bsink,
|
||||
int frames, int nch)
|
||||
{
|
||||
struct audio_stream __sparse_cache *source = bsource->data;
|
||||
struct audio_stream __sparse_cache *sink = bsink->data;
|
||||
struct fir_state_32x16 *f;
|
||||
int32_t *src = (int32_t *)source->r_ptr;
|
||||
int32_t *snk = (int32_t *)sink->w_ptr;
|
||||
int32_t *x;
|
||||
int32_t *y;
|
||||
int32_t z;
|
||||
int ch;
|
||||
int i;
|
||||
int rshift;
|
||||
int lshift;
|
||||
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* Get FIR instance and get shifts to e.g. apply mute
|
||||
* without overhead.
|
||||
*/
|
||||
f = &fir[ch];
|
||||
fir_get_lrshifts(f, &lshift, &rshift);
|
||||
|
||||
/* Setup circular buffer for FIR input data delay */
|
||||
fir_hifiep_setup_circular(f);
|
||||
|
||||
x = src++;
|
||||
y = snk++;
|
||||
for (i = 0; i < frames; i++) {
|
||||
fir_32x16_hifiep(f, *x << 8, &z, lshift, rshift);
|
||||
*y = sat_int24(Q_SHIFT_RND(z, 31, 23));
|
||||
x += nch;
|
||||
y += nch;
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S24LE */
|
||||
|
||||
#if CONFIG_FORMAT_S16LE
|
||||
|
@ -248,47 +168,6 @@ void eq_fir_2x_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bso
|
|||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
|
||||
/* FIR for any number of frames */
|
||||
void eq_fir_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource,
|
||||
struct output_stream_buffer *bsink,
|
||||
int frames, int nch)
|
||||
{
|
||||
struct audio_stream __sparse_cache *source = bsource->data;
|
||||
struct audio_stream __sparse_cache *sink = bsink->data;
|
||||
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++) {
|
||||
/* Get FIR instance and get shifts to e.g. apply mute
|
||||
* without overhead.
|
||||
*/
|
||||
f = &fir[ch];
|
||||
fir_get_lrshifts(f, &lshift, &rshift);
|
||||
|
||||
/* Setup circular buffer for FIR input data delay */
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S16LE */
|
||||
|
||||
#endif /* FIR_HIFIEP */
|
||||
|
|
|
@ -86,67 +86,6 @@ void eq_fir_2x_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bso
|
|||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
|
||||
/* FIR for any number of frames */
|
||||
void eq_fir_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource,
|
||||
struct output_stream_buffer *bsink,
|
||||
int frames, int nch)
|
||||
{
|
||||
struct audio_stream __sparse_cache *source = bsource->data;
|
||||
struct audio_stream __sparse_cache *sink = bsink->data;
|
||||
struct fir_state_32x16 *f;
|
||||
ae_int32x2 in = 0;
|
||||
ae_int32 out;
|
||||
ae_int32 *x;
|
||||
ae_int32 *y;
|
||||
ae_int32 *src = (ae_int32 *)source->r_ptr;
|
||||
ae_int32 *snk = (ae_int32 *)sink->w_ptr;
|
||||
int ch;
|
||||
int i;
|
||||
int rshift;
|
||||
int lshift;
|
||||
int shift;
|
||||
int inc = nch * sizeof(int32_t);
|
||||
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* Get FIR instance and get shifts to e.g. apply mute
|
||||
* without overhead.
|
||||
*/
|
||||
f = &fir[ch];
|
||||
fir_get_lrshifts(f, &lshift, &rshift);
|
||||
shift = lshift - rshift;
|
||||
|
||||
/* Copy src to x and advance src to next channel with
|
||||
* dummy load.
|
||||
*/
|
||||
fir_comp_setup_circular(source);
|
||||
x = src;
|
||||
AE_L32_XC(in, src, sizeof(int32_t));
|
||||
|
||||
/* Copy snk to y and advance snk to next channel with
|
||||
* dummy load.
|
||||
*/
|
||||
fir_comp_setup_circular(sink);
|
||||
y = snk;
|
||||
AE_L32_XC(in, snk, sizeof(int32_t));
|
||||
|
||||
for (i = 0; i < frames; i++) {
|
||||
/* Load input sample */
|
||||
fir_comp_setup_circular(source);
|
||||
AE_L32_XC(in, x, inc);
|
||||
|
||||
/* Compute FIR */
|
||||
fir_core_setup_circular(f);
|
||||
fir_32x16_hifi3(f, in, &out, shift);
|
||||
|
||||
/* Store output sample */
|
||||
fir_comp_setup_circular(sink);
|
||||
AE_S32_L_XC((ae_int32x2)out, y, inc);
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S32LE */
|
||||
|
||||
#if CONFIG_FORMAT_S24LE
|
||||
|
@ -220,75 +159,6 @@ void eq_fir_2x_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bso
|
|||
AE_S32_L_XC(d1, y, inc_nch_s);
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
|
||||
void eq_fir_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource,
|
||||
struct output_stream_buffer *bsink,
|
||||
int frames, int nch)
|
||||
{
|
||||
struct audio_stream __sparse_cache *source = bsource->data;
|
||||
struct audio_stream __sparse_cache *sink = bsink->data;
|
||||
struct fir_state_32x16 *f;
|
||||
ae_int32 in;
|
||||
ae_int32 out;
|
||||
ae_int32x2 d = 0;
|
||||
ae_int32 *x;
|
||||
ae_int32 *y;
|
||||
ae_int32 *src = (ae_int32 *)source->r_ptr;
|
||||
ae_int32 *snk = (ae_int32 *)sink->w_ptr;
|
||||
int ch;
|
||||
int i;
|
||||
int rshift;
|
||||
int lshift;
|
||||
int shift;
|
||||
int inc = nch * sizeof(int32_t);
|
||||
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* Get FIR instance and get shifts to e.g. apply mute
|
||||
* without overhead.
|
||||
*/
|
||||
f = &fir[ch];
|
||||
fir_get_lrshifts(f, &lshift, &rshift);
|
||||
shift = lshift - rshift;
|
||||
|
||||
/* Copy src to x and advance src to next channel with
|
||||
* dummy load.
|
||||
*/
|
||||
fir_comp_setup_circular(source);
|
||||
x = src;
|
||||
AE_L32_XC(d, src, sizeof(int32_t));
|
||||
|
||||
/* Copy snk to y and advance snk to next channel with
|
||||
* dummy load.
|
||||
*/
|
||||
fir_comp_setup_circular(sink);
|
||||
y = snk;
|
||||
AE_L32_XC(d, snk, sizeof(int32_t));
|
||||
|
||||
for (i = 0; i < frames; i++) {
|
||||
/* Load input sample and convert with shift left
|
||||
* to Q1.31 compatible format.
|
||||
*/
|
||||
fir_comp_setup_circular(source);
|
||||
AE_L32_XC(d, x, inc);
|
||||
in = AE_SLAA32(d, 8);
|
||||
|
||||
/* Compute FIR */
|
||||
fir_core_setup_circular(f);
|
||||
fir_32x16_hifi3(f, in, &out, shift);
|
||||
|
||||
/* Round to Q1.23 and store output sample */
|
||||
fir_comp_setup_circular(sink);
|
||||
d = AE_SRAI32R(out, 8);
|
||||
d = AE_SLAI32S(d, 8);
|
||||
d = AE_SRAI32(d, 8);
|
||||
AE_S32_L_XC(d, y, inc);
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S24LE */
|
||||
|
||||
|
@ -365,69 +235,6 @@ void eq_fir_2x_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bso
|
|||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
|
||||
void eq_fir_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource,
|
||||
struct output_stream_buffer *bsink,
|
||||
int frames, int nch)
|
||||
{
|
||||
struct audio_stream __sparse_cache *source = bsource->data;
|
||||
struct audio_stream __sparse_cache *sink = bsink->data;
|
||||
struct fir_state_32x16 *f;
|
||||
ae_f16x4 d = AE_ZERO16();
|
||||
ae_int32 in;
|
||||
ae_int32 out;
|
||||
ae_int16 *x;
|
||||
ae_int16 *y;
|
||||
ae_int16 *src = (ae_int16 *)source->r_ptr;
|
||||
ae_int16 *snk = (ae_int16 *)sink->w_ptr;
|
||||
int ch;
|
||||
int i;
|
||||
int rshift;
|
||||
int lshift;
|
||||
int shift;
|
||||
int inc = nch * sizeof(int16_t);
|
||||
|
||||
for (ch = 0; ch < nch; ch++) {
|
||||
/* Get FIR instance and get shifts to e.g. apply mute
|
||||
* without overhead.
|
||||
*/
|
||||
f = &fir[ch];
|
||||
fir_get_lrshifts(f, &lshift, &rshift);
|
||||
shift = lshift - rshift;
|
||||
|
||||
/* Copy src to x and advance src to next channel with
|
||||
* dummy load.
|
||||
*/
|
||||
fir_comp_setup_circular(source);
|
||||
x = src;
|
||||
AE_L16_XC(d, src, sizeof(int16_t));
|
||||
|
||||
/* Copy snk to y and advance snk to next channel with
|
||||
* dummy load.
|
||||
*/
|
||||
fir_comp_setup_circular(sink);
|
||||
y = snk;
|
||||
AE_L16_XC(d, snk, sizeof(int16_t));
|
||||
|
||||
for (i = 0; i < frames; i++) {
|
||||
/* Load input sample and convert to Q1.31 */
|
||||
fir_comp_setup_circular(source);
|
||||
AE_L16_XC(d, x, inc);
|
||||
in = AE_CVT32X2F16_32(d);
|
||||
|
||||
/* Compute FIR */
|
||||
fir_core_setup_circular(f);
|
||||
fir_32x16_hifi3(f, in, &out, shift);
|
||||
|
||||
/* Round to Q1.15 and store output sample */
|
||||
fir_comp_setup_circular(sink);
|
||||
d = AE_ROUND16X4F32SSYM(out, out);
|
||||
AE_S16_0_XC(d, y, inc);
|
||||
}
|
||||
}
|
||||
|
||||
module_update_buffer_position(bsource, bsink, frames);
|
||||
}
|
||||
#endif /* CONFIG_FORMAT_S16LE */
|
||||
|
||||
#endif /* FIR_HIFI3 */
|
||||
|
|
Loading…
Reference in New Issue