[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / audioStreamInpProc.h
2 /*
3 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 /*
37 * ======== audioStreamInpProc.h ========
38 */
40 #ifndef _ASIP_H_
41 #define _ASIP_H_
43 #include <xdc/std.h>
45 #include "audioStreamProc_params.h"
46 #include "audioStreamProc_patchs.h"
47 #include "audioStreamProc_config.h"
49 // Global debug counter */
50 extern Uint32 gTaskAsipCnt; // debug counter for ASP task
52 // Purpose: Audio Stream Input Task Function for initialization of data pointers
53 // by allocation of memory.
54 Int
55 PAF_ASIT_initPhaseMalloc(
56 const PAF_AST_Params *pP,
57 const PAF_AST_Patchs *pQ,
58 PAF_AST_Config *pC
59 );
61 // Purpose: Audio Stream Input Task Function for initialization of data values
62 // from parameters.
63 Int
64 PAF_ASIT_initPhaseConfig(
65 const PAF_AST_Params *pP,
66 const PAF_AST_Patchs *pQ,
67 PAF_AST_Config *pC
68 );
70 // Purpose: Audio Stream Input Task Function for initialization of ACP by
71 // instantiation of the algorithm.
72 Int
73 PAF_ASIT_initPhaseAcpAlg(
74 const PAF_AST_Params *pP,
75 const PAF_AST_Patchs *pQ,
76 PAF_AST_Config *pC
77 );
79 // (***) FL: ASIT/ASOT currently consider common memory independently.
80 // Should simultaneously consider all algs in ASIT/ASOT.
81 // Purpose: Audio Stream Input Task Function for allocation of common memory.
82 Int
83 PAF_ASIT_initPhaseCommon(
84 const PAF_AST_Params *pP,
85 const PAF_AST_Patchs *pQ,
86 PAF_AST_Config *pC
87 );
89 // Purpose: Audio Stream Input Task Function for initialization of ASP algorithms.
90 Int
91 PAF_ASIT_initPhaseAspAlg(
92 const PAF_AST_Params *pP,
93 const PAF_AST_Patchs *pQ,
94 PAF_AST_Config *pC
95 );
98 // Purpose: Audio Stream Input Task Function for initialization of data values
99 // from parameters for Algorithm Keys.
100 Int
101 PAF_ASIT_initPhaseAlgKey(
102 const PAF_AST_Params *pP,
103 const PAF_AST_Patchs *pQ,
104 PAF_AST_Config *pC
105 );
107 // Purpose: Audio Stream Input Task Function for initialization of Input Devices.
108 Int
109 PAF_ASIT_initPhaseDevice(
110 const PAF_AST_Params *pP,
111 const PAF_AST_Patchs *pQ,
112 PAF_AST_Config *pC
113 );
115 // Purpose: Audio Stream Task Function for initialization or reinitiali-
116 // zation of the Audio Frame(s) by loading of data values of a
117 // time-varying nature.
118 Int
119 PAF_AST_initFrame1(
120 const PAF_AST_Params *pP,
121 const PAF_AST_Patchs *pQ,
122 PAF_AST_Config *pC,
123 Int z,
124 Int apply
125 );
127 // Purpose: Audio Stream Task Function for processing audio data to
128 // determine the input type without output.
129 Int
130 PAF_ASIT_autoProcessing(
131 const PAF_AST_Params *pP,
132 const PAF_AST_Patchs *pQ,
133 PAF_AST_Config *pC,
134 Int inputTypeSelect,
135 ALG_Handle pcmAlgMaster);
137 // Purpose: Audio Stream Input Task Function for processing audio data.
138 //
139 Int
140 PAF_ASIT_decodeProcessing(
141 const PAF_AST_Params *pP,
142 const PAF_AST_Patchs *pQ,
143 PAF_AST_Config *pC,
144 Int sourceSelect
145 );
147 // Purpose: Decoding Function for processing Decode Commands.
148 Int
149 PAF_ASIT_decodeCommand(
150 const PAF_AST_Params *pP,
151 const PAF_AST_Patchs *pQ,
152 PAF_AST_Config *pC
153 );
155 // Purpose: Decoding Function for reinitializing the decoding process.
156 Int
157 PAF_ASIT_decodeInit(
158 const PAF_AST_Params *pP,
159 const PAF_AST_Patchs *pQ,
160 PAF_AST_Config *pC,
161 Int sourceSelect
162 );
164 // Purpose: Decoding Function for processing information in a manner that
165 // is common for both initial and subsequent frames of input data.
166 Int
167 PAF_ASIT_decodeInfo(
168 const PAF_AST_Params *pP,
169 const PAF_AST_Patchs *pQ,
170 PAF_AST_Config *pC,
171 Int frame,
172 Int block
173 );
175 // Purpose: Decoding Function for processing information in a manner that
176 // is unique to initial frames of input data.
177 Int
178 PAF_ASIT_decodeInfo1(
179 const PAF_AST_Params *pP,
180 const PAF_AST_Patchs *pQ,
181 PAF_AST_Config *pC,
182 Int frame,
183 Int block
184 );
186 // Purpose: Decoding Function for processing information in a manner that
187 // is unique to frames of input data other than the initial one.
188 Int
189 PAF_ASIT_decodeInfo2(
190 const PAF_AST_Params *pP,
191 const PAF_AST_Patchs *pQ,
192 PAF_AST_Config *pC,
193 Int frame,
194 Int block
195 );
197 // Purpose: Decoding Function for processing that occurs subsequent to
198 // information processing but antecedent to timing processing
199 // for frames of input data other than the initial one.
200 Int
201 PAF_AST_decodeCont(
202 const PAF_AST_Params *pP,
203 const PAF_AST_Patchs *pQ,
204 PAF_AST_Config *pC,
205 ALG_Handle decAlg[],
206 Int frame,
207 Int block
208 );
210 // Purpose: Decoding Function for processing of input data by the
211 // Decode Algorithm.
212 Int
213 PAF_ASIT_decodeDecode(
214 const PAF_AST_Params *pP,
215 const PAF_AST_Patchs *pQ,
216 PAF_AST_Config *pC,
217 Int sourceSelect,
218 Int frame,
219 Int block
220 );
222 // Purpose: Decoding Function for determining whether processing of the
223 // current frame is complete.
224 Int
225 PAF_ASIT_decodeFinalTest(
226 const PAF_AST_Params *pP,
227 const PAF_AST_Patchs *pQ,
228 PAF_AST_Config *pC,
229 Int frame,
230 Int block
231 );
233 // Purpose: Decoding Function for terminating the decoding process.
234 Int
235 PAF_ASIT_decodeComplete(
236 const PAF_AST_Params *pP,
237 const PAF_AST_Patchs *pQ,
238 PAF_AST_Config *pC,
239 ALG_Handle decAlg[],
240 Int frame,
241 Int block
242 );
244 // Purpose: Audio Stream Input Task Function for selecting the devices used
245 // for input.
246 Int
247 PAF_ASIT_selectDevices(
248 const PAF_AST_Params *pP,
249 const PAF_AST_Patchs *pQ,
250 PAF_AST_Config *pC
251 );
253 // Purpose: Audio Stream Input Task Function for selecting the sources used
254 // for decoding of input to output.
255 Int
256 PAF_ASIT_sourceDecode(
257 const PAF_AST_Params *pP,
258 const PAF_AST_Patchs *pQ,
259 PAF_AST_Config *pC,
260 Int x
261 );
263 // Purpose: Decoding Function for terminating output.
264 Int
265 PAF_AST_stopOutput(
266 const PAF_AST_Params *pP,
267 const PAF_AST_Patchs *pQ,
268 PAF_AST_Config *pC
269 );
271 // Purpose: Common Function for processing algorithm chains.
272 Int
273 PAF_AST_streamChainFunction(
274 const PAF_AST_Params *pP,
275 const PAF_AST_Patchs *pQ,
276 PAF_AST_Config *pC,
277 Int iChainFrameFxns,
278 Int abortOnError,
279 Int logArg
280 );
283 #endif /* _ASIP_H_ */