-
Notifications
You must be signed in to change notification settings - Fork 364
Expand file tree
/
Copy patheq_iir.h
More file actions
75 lines (58 loc) · 2.68 KB
/
Copy patheq_iir.h
File metadata and controls
75 lines (58 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2017 Intel Corporation. All rights reserved.
*
* Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
* Liam Girdwood <liam.r.girdwood@linux.intel.com>
* Keyon Jie <yang.jie@linux.intel.com>
*/
#ifndef __SOF_AUDIO_EQ_IIR_EQ_IIR_H__
#define __SOF_AUDIO_EQ_IIR_EQ_IIR_H__
#include <stdint.h>
#include <sof/audio/module_adapter/module/generic.h>
#include <sof/math/iir_df2t.h>
#include <sof/math/iir_df1.h>
/** \brief Macros to convert without division bytes count to samples count */
#define EQ_IIR_BYTES_TO_S16_SAMPLES(b) ((b) >> 1)
#define EQ_IIR_BYTES_TO_S32_SAMPLES(b) ((b) >> 2)
struct audio_stream;
struct comp_dev;
/** \brief Type definition for processing function select return value. */
typedef void (*eq_iir_func)(struct processing_module *mod, struct input_stream_buffer *bsource,
struct output_stream_buffer *bsink, uint32_t frames);
/** \brief IIR EQ processing functions map item. */
struct eq_iir_func_map {
uint8_t source; /**< source frame format */
uint8_t sink; /**< sink frame format */
eq_iir_func func; /**< processing function */
};
/* IIR component private data */
struct comp_data {
struct iir_state_df1 iir[PLATFORM_MAX_CHANNELS]; /**< filters state */
struct comp_data_blob_handler *model_handler;
struct sof_eq_iir_config *config;
int32_t *iir_delay; /**< pointer to allocated RAM */
size_t config_size; /**< configuration size */
size_t iir_delay_size; /**< allocated size */
eq_iir_func eq_iir_func; /**< processing function */
};
#ifdef UNIT_TEST
void sys_comp_module_eq_iir_interface_init(void);
#endif
void eq_iir_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource,
struct output_stream_buffer *bsink, uint32_t frames);
void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffer *bsource,
struct output_stream_buffer *bsink, uint32_t frames);
void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource,
struct output_stream_buffer *bsink, uint32_t frames);
int eq_iir_new_blob(struct processing_module *mod, enum sof_ipc_frame source_format,
enum sof_ipc_frame sink_format, int channels);
void eq_iir_set_passthrough_func(struct comp_data *cd,
enum sof_ipc_frame source_format,
enum sof_ipc_frame sink_format);
int eq_iir_prepare_sub(struct processing_module *mod);
void eq_iir_pass(struct processing_module *mod, struct input_stream_buffer *bsource,
struct output_stream_buffer *bsink, uint32_t frames);
int eq_iir_setup(struct processing_module *mod, int nch);
void eq_iir_free_delaylines(struct processing_module *mod);
#endif /* __SOF_AUDIO_EQ_IIR_EQ_IIR_H__ */