1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2017 Intel Corporation. All rights reserved.
4  *
5  * Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
6  *         Liam Girdwood <liam.r.girdwood@linux.intel.com>
7  *         Keyon Jie <yang.jie@linux.intel.com>
8  */
9 
10 #ifndef __SOF_AUDIO_EQ_IIR_EQ_IIR_H__
11 #define __SOF_AUDIO_EQ_IIR_EQ_IIR_H__
12 
13 #include <stdint.h>
14 #include <sof/audio/module_adapter/module/generic.h>
15 #include <sof/math/iir_df2t.h>
16 
17 /** \brief Macros to convert without division bytes count to samples count */
18 #define EQ_IIR_BYTES_TO_S16_SAMPLES(b)	((b) >> 1)
19 #define EQ_IIR_BYTES_TO_S32_SAMPLES(b)	((b) >> 2)
20 
21 struct audio_stream;
22 struct comp_dev;
23 
24 /** \brief Type definition for processing function select return value. */
25 typedef void (*eq_iir_func)(struct processing_module *mod, struct input_stream_buffer *bsource,
26 			   struct output_stream_buffer *bsink, uint32_t frames);
27 
28 /** \brief IIR EQ processing functions map item. */
29 struct eq_iir_func_map {
30 	uint8_t source;				/**< source frame format */
31 	uint8_t sink;				/**< sink frame format */
32 	eq_iir_func func;			/**< processing function */
33 };
34 
35 #ifdef UNIT_TEST
36 void sys_comp_module_eq_iir_interface_init(void);
37 #endif
38 
39 #endif /* __SOF_AUDIO_EQ_IIR_EQ_IIR_H__ */
40