cf9bfa36ac363f92874d0d36e26c2e7709c0b5d4
[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 Decoder Output Circular Buffer.
108 Int
109 PAF_ASIT_initPhaseDecOpCircBuf(
110 const PAF_AST_Params *pP,
111 const PAF_AST_Patchs *pQ,
112 PAF_AST_Config *pC
113 );
115 // Purpose: Audio Stream Input Task Function for initialization of Input Devices.
116 Int
117 PAF_ASIT_initPhaseDevice(
118 const PAF_AST_Params *pP,
119 const PAF_AST_Patchs *pQ,
120 PAF_AST_Config *pC
121 );
123 // Purpose: Audio Stream Task Function for initialization or reinitiali-
124 // zation of the Audio Frame(s) by loading of data values of a
125 // time-varying nature.
126 Int
127 PAF_AST_initFrame1(
128 const PAF_AST_Params *pP,
129 const PAF_AST_Patchs *pQ,
130 PAF_AST_Config *pC,
131 Int z,
132 Int apply
133 );
135 // Purpose: Audio Stream Task Function for processing audio data to
136 // determine the input type without output.
137 Int
138 PAF_ASIT_autoProcessing(
139 const PAF_AST_Params *pP,
140 const PAF_AST_Patchs *pQ,
141 PAF_AST_Config *pC,
142 Int inputTypeSelect,
143 ALG_Handle pcmAlgMaster);
145 // Purpose: Audio Stream Input Task Function for processing audio data.
146 //
147 Int
148 PAF_ASIT_decodeProcessing(
149 const PAF_AST_Params *pP,
150 const PAF_AST_Patchs *pQ,
151 PAF_AST_Config *pC,
152 Int sourceSelect
153 );
155 // Purpose: Decoding Function for processing Decode Commands.
156 Int
157 PAF_ASIT_decodeCommand(
158 const PAF_AST_Params *pP,
159 const PAF_AST_Patchs *pQ,
160 PAF_AST_Config *pC
161 );
163 // Purpose: Decoding Function for reinitializing the decoding process.
164 Int
165 PAF_ASIT_decodeInit(
166 const PAF_AST_Params *pP,
167 const PAF_AST_Patchs *pQ,
168 PAF_AST_Config *pC,
169 Int sourceSelect
170 );
172 // Purpose: Decoding Function for processing information in a manner that
173 // is common for both initial and subsequent frames of input data.
174 Int
175 PAF_ASIT_decodeInfo(
176 const PAF_AST_Params *pP,
177 const PAF_AST_Patchs *pQ,
178 PAF_AST_Config *pC,
179 Int frame,
180 Int block
181 );
183 // Purpose: Decoding Function for processing information in a manner that
184 // is unique to initial frames of input data.
185 Int
186 PAF_ASIT_decodeInfo1(
187 const PAF_AST_Params *pP,
188 const PAF_AST_Patchs *pQ,
189 PAF_AST_Config *pC,
190 Int frame,
191 Int block
192 );
194 // Purpose: Decoding Function for processing information in a manner that
195 // is unique to frames of input data other than the initial one.
196 Int
197 PAF_ASIT_decodeInfo2(
198 const PAF_AST_Params *pP,
199 const PAF_AST_Patchs *pQ,
200 PAF_AST_Config *pC,
201 Int frame,
202 Int block
203 );
205 // Purpose: Decoding Function for processing that occurs subsequent to
206 // information processing but antecedent to timing processing
207 // for frames of input data other than the initial one.
208 Int
209 PAF_AST_decodeCont(
210 const PAF_AST_Params *pP,
211 const PAF_AST_Patchs *pQ,
212 PAF_AST_Config *pC,
213 ALG_Handle decAlg[],
214 Int frame,
215 Int block
216 );
218 // Purpose: Decoding Function for processing of input data by the
219 // Decode Algorithm.
220 Int
221 PAF_ASIT_decodeDecode(
222 const PAF_AST_Params *pP,
223 const PAF_AST_Patchs *pQ,
224 PAF_AST_Config *pC,
225 Int sourceSelect,
226 Int frame,
227 Int block
228 );
230 // Purpose: Decoding Function for determining whether processing of the
231 // current frame is complete.
232 Int
233 PAF_ASIT_decodeFinalTest(
234 const PAF_AST_Params *pP,
235 const PAF_AST_Patchs *pQ,
236 PAF_AST_Config *pC,
237 Int frame,
238 Int block
239 );
241 // Purpose: Decoding Function for terminating the decoding process.
242 Int
243 PAF_ASIT_decodeComplete(
244 const PAF_AST_Params *pP,
245 const PAF_AST_Patchs *pQ,
246 PAF_AST_Config *pC,
247 ALG_Handle decAlg[],
248 Int frame,
249 Int block
250 );
252 // Purpose: Audio Stream Input Task Function for selecting the devices used
253 // for input.
254 Int
255 PAF_ASIT_selectDevices(
256 const PAF_AST_Params *pP,
257 const PAF_AST_Patchs *pQ,
258 PAF_AST_Config *pC
259 );
261 // Purpose: Audio Stream Input Task Function for selecting the sources used
262 // for decoding of input to output.
263 Int
264 PAF_ASIT_sourceDecode(
265 const PAF_AST_Params *pP,
266 const PAF_AST_Patchs *pQ,
267 PAF_AST_Config *pC,
268 Int x
269 );
271 // Purpose: Decoding Function for terminating output.
272 Int
273 PAF_AST_stopOutput(
274 const PAF_AST_Params *pP,
275 const PAF_AST_Patchs *pQ,
276 PAF_AST_Config *pC
277 );
279 // Purpose: Common Function for processing algorithm chains.
280 Int
281 PAF_AST_streamChainFunction(
282 const PAF_AST_Params *pP,
283 const PAF_AST_Patchs *pQ,
284 PAF_AST_Config *pC,
285 Int iChainFrameFxns,
286 Int abortOnError,
287 Int logArg
288 );
291 #endif /* _ASIP_H_ */