[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / audioStreamOutProc.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 * ======== audioStreamOutProc.h ========
38 */
40 #ifndef _ASOP_H_
41 #define _ASOP_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 gTaskAsopCnt; // debug counter for ASOP task
52 // Purpose: Audio Stream Outpu Task Function for initialization of data pointers
53 // by allocation of memory.
54 Int
55 PAF_ASOT_initPhaseMalloc(
56 const PAF_AST_Params *pP,
57 const PAF_AST_Patchs *pQ,
58 PAF_AST_Config *pC
59 );
61 // Purpose: Audio Stream Output Task Function for initialization of data values
62 // from parameters.
63 Int
64 PAF_ASOT_initPhaseConfig(
65 const PAF_AST_Params *pP,
66 const PAF_AST_Patchs *pQ,
67 PAF_AST_Config *pC
68 );
70 // Purpose: Audio Stream Output Task Function for initialization of ACP by
71 // instantiation of the algorithm.
72 Int
73 PAF_ASOT_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 Output Task Function for allocation of common memory.
82 Int
83 PAF_ASOT_initPhaseCommon(
84 const PAF_AST_Params *pP,
85 const PAF_AST_Patchs *pQ,
86 PAF_AST_Config *pC
87 );
89 // Purpose: Audio Stream Output Task Function for initialization of ASP algorithms.
90 Int
91 PAF_ASOT_initPhaseAspAlg(
92 const PAF_AST_Params *pP,
93 const PAF_AST_Patchs *pQ,
94 PAF_AST_Config *pC
95 );
97 // Purpose: Audio Stream Output Task Function for initialization of data values
98 // from parameters for Algorithm Keys.
99 Int
100 PAF_ASOT_initPhaseAlgKey(
101 const PAF_AST_Params *pP,
102 const PAF_AST_Patchs *pQ,
103 PAF_AST_Config *pC
104 );
106 // Purpose: Audio Stream Output Task Function for initialization of Input Devices.
107 Int
108 PAF_ASOT_initPhaseDevice(
109 const PAF_AST_Params *pP,
110 const PAF_AST_Patchs *pQ,
111 PAF_AST_Config *pC
112 );
114 // Purpose: Audio Stream Output Task Function for initialization of the Audio
115 // Frame(s) by memory allocation and loading of data pointers
116 // and values.
117 Int
118 PAF_ASOT_initFrame0(
119 const PAF_AST_Params *pP,
120 const PAF_AST_Patchs *pQ,
121 PAF_AST_Config *pC,
122 Int z
123 );
125 // Purpose: Audio Stream Task Function for initialization or reinitiali-
126 // zation of the Audio Frame(s) by loading of data values of a
127 // time-varying nature.
128 Int
129 PAF_ASOT_initFrame1(
130 const PAF_AST_Params *pP,
131 const PAF_AST_Patchs *pQ,
132 PAF_AST_Config *pC,
133 Int z,
134 Int apply
135 );
137 // Purpose: Audio Stream Output Task Function for selecting the devices used
138 // for output.
139 Int
140 PAF_ASOT_selectDevices(
141 const PAF_AST_Params *pP,
142 const PAF_AST_Patchs *pQ,
143 PAF_AST_Config *pC
144 );
146 // Purpose: Audio Stream Output Task Function for processing audio data.
147 //
148 Int
149 PAF_ASOT_decodeProcessing(
150 const PAF_AST_Params *pP,
151 const PAF_AST_Patchs *pQ,
152 PAF_AST_Config *pC,
153 Int sourceSelect
154 );
156 // Purpose: Decoding Function for processing Encode Commands.
157 Int
158 PAF_ASOT_encodeCommand(
159 const PAF_AST_Params *pP,
160 const PAF_AST_Patchs *pQ,
161 PAF_AST_Config *pC
162 );
164 // Purpose: Decoding Function for reinitializing the decoding process.
165 Int
166 PAF_ASOT_decodeInit(
167 const PAF_AST_Params *pP,
168 const PAF_AST_Patchs *pQ,
169 PAF_AST_Config *pC,
170 Int sourceSelect
171 );
173 // Purpose: Decoding Function for processing information in a manner that
174 // is unique to initial frames of input data.
175 Int
176 PAF_ASOT_decodeInfo(
177 const PAF_AST_Params *pP,
178 const PAF_AST_Patchs *pQ,
179 PAF_AST_Config *pC,
180 Int frame,
181 Int block
182 );
184 // Purpose: Decoding Function for processing information in a manner that
185 // is unique to initial frames of input data.
186 Int
187 PAF_ASOT_decodeInfo1(
188 const PAF_AST_Params *pP,
189 const PAF_AST_Patchs *pQ,
190 PAF_AST_Config *pC,
191 Int frame,
192 Int block
193 );
195 // Purpose: Decoding Function for processing information in a manner that
196 // is unique to frames of input data other than the initial one.
197 Int
198 PAF_ASOT_decodeInfo2(
199 const PAF_AST_Params *pP,
200 const PAF_AST_Patchs *pQ,
201 PAF_AST_Config *pC,
202 Int frame,
203 Int block
204 );
206 // Purpose: Decoding Function for processing of audio frame data by the
207 // ASP Algorithms.
208 Int
209 PAF_ASOT_decodeStream(
210 const PAF_AST_Params *pP,
211 const PAF_AST_Patchs *pQ,
212 PAF_AST_Config *pC,
213 Int frame,
214 Int block
215 );
217 // Purpose: Decoding Function for processing of audio frame data by the
218 // Encode Algorithm.
219 Int
220 PAF_ASOT_decodeEncode(
221 const PAF_AST_Params *pP,
222 const PAF_AST_Patchs *pQ,
223 PAF_AST_Config *pC,
224 Int frame,
225 Int block
226 );
228 // Purpose: Decoding Function for terminating the decoding process.
229 Int
230 PAF_ASOT_decodeComplete(
231 const PAF_AST_Params *pP,
232 const PAF_AST_Patchs *pQ,
233 PAF_AST_Config *pC,
234 ALG_Handle decAlg[],
235 Int frame,
236 Int block
237 );
239 // Purpose: Decoding Function for initiating output.
240 Int
241 PAF_ASOT_startOutput(
242 const PAF_AST_Params *pP,
243 const PAF_AST_Patchs *pQ,
244 PAF_AST_Config *pC
245 );
247 // Purpose: Decoding Function for terminating output.
248 Int
249 PAF_ASOT_stopOutput(
250 const PAF_AST_Params *pP,
251 const PAF_AST_Patchs *pQ,
252 PAF_AST_Config *pC
253 );
255 // Purpose: Decoding Function for re-initiating output.
256 Int
257 PAF_ASOT_setCheckRateX(
258 const PAF_AST_Params *pP,
259 const PAF_AST_Patchs *pQ,
260 PAF_AST_Config *pC,
261 Int check
262 );
264 // Purpose: Common Function for processing algorithm chains.
265 Int
266 PAF_ASOT_streamChainFunction(
267 const PAF_AST_Params *pP,
268 const PAF_AST_Patchs *pQ,
269 PAF_AST_Config *pC,
270 Int iChainFrameFxns,
271 Int abortOnError,
272 Int logArg
273 );
275 #endif /* _ASOP_H_ */