@@ -46,162 +46,6 @@ DECLARE_SOF_RT_UUID("eq-fir", eq_fir_uuid, 0x43a90ce7, 0xf3a5, 0x41df,
4646
4747DECLARE_TR_CTX (eq_fir_tr , SOF_UUID (eq_fir_uuid ), LOG_LEVEL_INFO );
4848
49- /* src component private data */
50- struct comp_data {
51- struct fir_state_32x16 fir [PLATFORM_MAX_CHANNELS ]; /**< filters state */
52- struct comp_data_blob_handler * model_handler ;
53- struct sof_eq_fir_config * config ;
54- int32_t * fir_delay ; /**< pointer to allocated RAM */
55- size_t fir_delay_size ; /**< allocated size */
56- void (* eq_fir_func )(struct fir_state_32x16 fir [],
57- struct input_stream_buffer * bsource ,
58- struct output_stream_buffer * bsink ,
59- int frames );
60- int nch ;
61- };
62-
63- /*
64- * The optimized FIR functions variants need to be updated into function
65- * set_fir_func.
66- */
67-
68- #if FIR_HIFI3 || FIR_HIFIEP
69- #if CONFIG_FORMAT_S16LE
70- static inline void set_s16_fir (struct comp_data * cd )
71- {
72- cd -> eq_fir_func = eq_fir_2x_s16 ;
73- }
74- #endif /* CONFIG_FORMAT_S16LE */
75- #if CONFIG_FORMAT_S24LE
76- static inline void set_s24_fir (struct comp_data * cd )
77- {
78- cd -> eq_fir_func = eq_fir_2x_s24 ;
79- }
80- #endif /* CONFIG_FORMAT_S24LE */
81- #if CONFIG_FORMAT_S32LE
82- static inline void set_s32_fir (struct comp_data * cd )
83- {
84- cd -> eq_fir_func = eq_fir_2x_s32 ;
85- }
86- #endif /* CONFIG_FORMAT_S32LE */
87-
88- #else
89- /* FIR_GENERIC */
90- #if CONFIG_FORMAT_S16LE
91- static inline void set_s16_fir (struct comp_data * cd )
92- {
93- cd -> eq_fir_func = eq_fir_s16 ;
94- }
95- #endif /* CONFIG_FORMAT_S16LE */
96- #if CONFIG_FORMAT_S24LE
97- static inline void set_s24_fir (struct comp_data * cd )
98- {
99- cd -> eq_fir_func = eq_fir_s24 ;
100- }
101- #endif /* CONFIG_FORMAT_S24LE */
102- #if CONFIG_FORMAT_S32LE
103- static inline void set_s32_fir (struct comp_data * cd )
104- {
105- cd -> eq_fir_func = eq_fir_s32 ;
106- }
107- #endif /* CONFIG_FORMAT_S32LE */
108- #endif
109-
110- #if CONFIG_IPC_MAJOR_3
111- static inline int set_fir_func (struct processing_module * mod , enum sof_ipc_frame fmt )
112- {
113- struct comp_data * cd = module_get_private_data (mod );
114-
115- switch (fmt ) {
116- #if CONFIG_FORMAT_S16LE
117- case SOF_IPC_FRAME_S16_LE :
118- comp_dbg (mod -> dev , "set_fir_func(), SOF_IPC_FRAME_S16_LE" );
119- set_s16_fir (cd );
120- break ;
121- #endif /* CONFIG_FORMAT_S16LE */
122- #if CONFIG_FORMAT_S24LE
123- case SOF_IPC_FRAME_S24_4LE :
124- comp_dbg (mod -> dev , "set_fir_func(), SOF_IPC_FRAME_S24_4LE" );
125- set_s24_fir (cd );
126- break ;
127- #endif /* CONFIG_FORMAT_S24LE */
128- #if CONFIG_FORMAT_S32LE
129- case SOF_IPC_FRAME_S32_LE :
130- comp_dbg (mod -> dev , "set_fir_func(), SOF_IPC_FRAME_S32_LE" );
131- set_s32_fir (cd );
132- break ;
133- #endif /* CONFIG_FORMAT_S32LE */
134- default :
135- comp_err (mod -> dev , "set_fir_func(), invalid frame_fmt" );
136- return - EINVAL ;
137- }
138- return 0 ;
139- }
140- #endif /* CONFIG_IPC_MAJOR_3 */
141-
142- #if CONFIG_IPC_MAJOR_4
143- static inline int set_fir_func (struct processing_module * mod , enum sof_ipc_frame fmt )
144- {
145- struct comp_data * cd = module_get_private_data (mod );
146- unsigned int valid_bit_depth = mod -> priv .cfg .base_cfg .audio_fmt .valid_bit_depth ;
147-
148- comp_dbg (mod -> dev , "set_fir_func(): valid_bit_depth %d" , valid_bit_depth );
149- switch (valid_bit_depth ) {
150- #if CONFIG_FORMAT_S16LE
151- case IPC4_DEPTH_16BIT :
152- set_s16_fir (cd );
153- break ;
154- #endif /* CONFIG_FORMAT_S16LE */
155- #if CONFIG_FORMAT_S24LE
156- case IPC4_DEPTH_24BIT :
157- set_s24_fir (cd );
158- break ;
159- #endif /* CONFIG_FORMAT_S24LE */
160- #if CONFIG_FORMAT_S32LE
161- case IPC4_DEPTH_32BIT :
162- set_s32_fir (cd );
163- break ;
164- #endif /* CONFIG_FORMAT_S32LE */
165- default :
166- comp_err (mod -> dev , "set_fir_func(), invalid valid_bith_depth" );
167- return - EINVAL ;
168- }
169- return 0 ;
170- }
171-
172- static int eq_fir_params (struct processing_module * mod )
173- {
174- struct sof_ipc_stream_params * params = mod -> stream_params ;
175- struct sof_ipc_stream_params comp_params ;
176- struct comp_dev * dev = mod -> dev ;
177- struct comp_buffer * sinkb ;
178- enum sof_ipc_frame valid_fmt , frame_fmt ;
179- int i , ret ;
180-
181- comp_dbg (dev , "eq_fir_params()" );
182-
183- comp_params = * params ;
184- comp_params .channels = mod -> priv .cfg .base_cfg .audio_fmt .channels_count ;
185- comp_params .rate = mod -> priv .cfg .base_cfg .audio_fmt .sampling_frequency ;
186- comp_params .buffer_fmt = mod -> priv .cfg .base_cfg .audio_fmt .interleaving_style ;
187-
188- audio_stream_fmt_conversion (mod -> priv .cfg .base_cfg .audio_fmt .depth ,
189- mod -> priv .cfg .base_cfg .audio_fmt .valid_bit_depth ,
190- & frame_fmt , & valid_fmt ,
191- mod -> priv .cfg .base_cfg .audio_fmt .s_type );
192-
193- comp_params .frame_fmt = valid_fmt ;
194-
195- for (i = 0 ; i < SOF_IPC_MAX_CHANNELS ; i ++ )
196- comp_params .chmap [i ] = (mod -> priv .cfg .base_cfg .audio_fmt .ch_map >> i * 4 ) & 0xf ;
197-
198- component_set_nearest_period_frames (dev , comp_params .rate );
199- sinkb = list_first_item (& dev -> bsink_list , struct comp_buffer , source_list );
200- ret = buffer_set_params (sinkb , & comp_params , true);
201- return ret ;
202- }
203- #endif /* CONFIG_IPC_MAJOR_4 */
204-
20549/* Pass-through functions to replace FIR core while not configured for
20650 * response.
20751 */
@@ -575,13 +419,11 @@ static int eq_fir_prepare(struct processing_module *mod,
575419
576420 comp_dbg (dev , "eq_fir_prepare()" );
577421
578- #if CONFIG_IPC_MAJOR_4
579422 ret = eq_fir_params (mod );
580423 if (ret < 0 ) {
581424 comp_set_state (dev , COMP_TRIGGER_RESET );
582425 return ret ;
583426 }
584- #endif
585427
586428 /* EQ component will only ever have 1 source and 1 sink buffer. */
587429 sourceb = list_first_item (& dev -> bsource_list , struct comp_buffer , sink_list );
0 commit comments