[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / common / audioStreamProc_params.h
2 /*
3 * Copyright (C) 2004-2014 Texas Instruments Incorporated - http://www.ti.com/
4 * All rights reserved.
5 *
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 //
38 // Performance Audio Framework Series 3 #2 -- Parameter Declarations
39 //
40 //
41 //
43 #ifndef _AS1_F2_PARAMS_H_
44 #define _AS1_F2_PARAMS_H_
46 //#include <ti/procsdk_audio/procsdk_audio_typ.h>
47 #include <procsdk_audio_typ.h>
48 #include <ti/sysbios/heaps/HeapMem.h>
50 #include <xdc/std.h>
51 #include <ti/xdais/ialg.h>
52 #include <sio.h>
54 #include <acp.h>
56 #include "alg.h"
57 #include "asp0.h"
59 #include <paftyp.h>
60 #include <inpbuf.h>
61 #include <pafdec.h>
62 #include <pafenc.h>
63 #include <pafvol.h>
64 #include <outbuf.h>
66 #include <as1-f2.h>
68 //
69 // Source Select Arrays -- algorithm keys & sio map
70 //
72 typedef struct PAF_ASP_AlgKey {
73 Int length;
74 PAF_ASP_AlphaCode code[PAF_SOURCE_N /* ostensibly */];
75 } PAF_ASP_AlgKey;
77 typedef struct PAF_ASP_SioMap {
78 Int length;
79 SmInt map[PAF_SOURCE_N /* ostensibly */];
80 } PAF_ASP_SioMap;
82 typedef struct PAF_ASP_outNumBufMap {
83 Int maxNumBuf;
84 Int length;
85 SmInt map[PAF_SOURCE_N];
86 } PAF_ASP_outNumBufMap;
88 typedef struct PAF_MetadataBufStatus {
89 Int bufSize; //Meta data buffer size
90 Int NumBuf; //Number of metadata buffers
91 Int alignment; //Buffer alignment
92 Int *pHeadIdSpace; //Int *pSpace; //Internal/external memory
93 } PAF_MetadataBufStatus;
95 typedef struct PAF_AudioFrameBufStatus {
96 IALG_MemSpace space[PAF_MAXNUMCHAN];
97 }PAF_AudioFrameBufStatus;
99 //
100 // Audio Framework Functions
101 //
103 struct PAF_AST_Params;
104 struct PAF_AST_Patchs;
105 struct PAF_AST_Config;
107 typedef struct PAF_AST_Fxns {
108 Int (*initPhase[8]) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
109 Int (*initFrame0) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
110 Int (*initFrame1) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
111 Int (*passProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
112 Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
113 Int (*autoProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, ALG_Handle);
115 // FL: Source select index takes place of ALG_Handle.
116 //Int (*decodeProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle);
117 //Int (*decodeProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle, Int);
118 Int (*decodeProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
120 Int (*decodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
121 Int (*encodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
123 // FL: Source select index takes place of ALG_Handle.
124 //Int (*decodeInit) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *);
125 //Int (*decodeInit) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int);
126 Int (*decodeInit) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
128 // FL: Source select index takes place of ALG_Handle.
129 //Int (*decodeInfo) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
130 Int (*decodeInfo) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
132 // FL: Source select index takes place of ALG_Handle.
133 //Int (*decodeInfo1) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
134 Int (*decodeInfo1) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
136 // FL: Source select index takes place of ALG_Handle.
137 //Int (*decodeInfo2) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
138 Int (*decodeInfo2) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
140 Int (*decodeCont) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
142 // FL: Source select index takes place of ALG_Handle.
143 //Int (*decodeDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
144 //Int (*decodeDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int, Int);
145 Int (*decodeDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
147 // FL: Source select index takes place of ALG_Handle.
148 //Int (*decodeStream) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
149 Int (*decodeStream) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
151 // FL: Source select index takes place of ALG_Handle.
152 //Int (*decodeEncode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
153 Int (*decodeEncode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
155 // FL: Source select index takes place of ALG_Handle.
156 //Int (*decodeFinalTest) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
157 Int (*decodeFinalTest) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
159 Int (*decodeComplete) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
160 Int (*selectDevices) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
161 Int (*sourceDecode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
163 Int (*startOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
164 //Int (*startOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, double);
166 Int (*stopOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
167 Int (*setCheckRateX) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
168 Int (*streamChainFunction) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
169 Int (*deviceAllocate) (SIO_Handle *, int, int, int, Ptr);
170 Int (*deviceSelect) (SIO_Handle *, int, int, Ptr);
172 // FL: change ALG_Handle to zone index
173 //Int (*computeFrameLength) (ALG_Handle, Int, Int);
174 Int (*computeFrameLength) (Int, Int, Int);
176 Int (*updateInputStatus) (SIO_Handle, PAF_InpBufStatus *, PAF_InpBufConfig *);
177 Int (*copy) (Uns, PAF_InpBufConfig *, Uns, PAF_OutBufConfig *);
179 #ifdef HSE
180 Int (*setPri) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
181 #endif
183 // For RAM_report
184 Void (*headerPrint)();
185 Int (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
186 Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
187 Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
188 //Void (*memStatusPrint)(Int internal, Int external, Int internal1);
189 Void (*memStatusPrint)(HeapMem_Handle hInternalHeap, HeapMem_Handle hInternal1Heap, HeapMem_Handle hExternalHeap, HeapMem_Handle hInternal1HeapShm);
191 // For ARC
192 //Int (*controlRate) (SIO_Handle, SIO_Handle, ACP_Handle);
193 //Int (*controlRate) (SIO_Handle, SIO_Handle, ACP_Handle, double);
195 } PAF_AST_Fxns;
197 //
198 // Audio Framework Parameters
199 //
201 typedef struct PAF_AST_Params {
202 const PAF_AST_Fxns *fxns;
203 struct {
204 SmInt master;
205 SmInt inputs;
206 SmInt input1;
207 SmInt inputN;
208 SmInt decodes;
209 SmInt decode1;
210 SmInt decodeN;
211 SmInt streams;
212 SmInt stream1; /* unused */
213 SmInt streamN; /* unused */
214 SmInt encodes;
215 SmInt encode1;
216 SmInt encodeN;
217 SmInt outputs;
218 SmInt output1;
219 SmInt outputN;
220 } zone;
221 const SmInt *inputsFromDecodes;
222 const SmInt *outputsFromEncodes;
223 struct {
224 int *pHeapIdIntern; //int *pIntern;
225 int *pHeapIdExtern; //int *pExtern;
226 int *pHeapIdInpbuf; //int *pInpbuf;
227 int *pHeapIdOutbuf; //int *pOutbuf;
228 int *pHeapIdFrmbuf; //int *pFrmbuf;
229 int *pHeapIdIntern1; //int *pIntern1;
230 int clear;
231 } heap;
232 struct {
233 const IALG_MemSpace *space;
234 } common;
235 const LgInt *z_rx_bufsiz;
236 const LgInt *z_tx_bufsiz;
237 const SmInt *z_numchan;
238 MdInt framelength;
239 const PAF_AudioFunctions *pAudioFrameFunctions;
240 const struct PAF_ASP_ChainFxns *pChainFxns;
241 const PAF_InpBufStatus *pInpBufStatus;
242 const PAF_DecodeStatus * const *z_pDecodeStatus;
243 const PAF_OutBufStatus *pOutBufStatus;
244 const PAF_EncodeStatus * const *z_pEncodeStatus;
245 const PAF_VolumeStatus *pVolumeStatus;
246 const PAF_ASP_AlgKey *pDecAlgKey;
247 const PAF_ASP_AlgKey *pEncAlgKey;
248 const PAF_ASP_SioMap *pDecSioMap;
249 const SmInt *streamsFromDecodes;
250 const SmInt *streamsFromEncodes;
251 const MdInt maxFramelength;
252 const SmInt *streamOrder;
253 const PAF_ASP_LinkInit * const (*i_inpLinkInit);
254 const PAF_ASP_LinkInit * const (*i_outLinkInit);
255 const PAF_ASP_outNumBufMap * const (*poutNumBufMap);
256 const PAF_MetadataBufStatus *pMetadataBufStatus;
257 const PAF_AudioFrameBufStatus *pAudioFrameBufStatus;
258 } PAF_AST_Params;
260 #endif /* _AS1_F2_PARAMS_H_ */