]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - pasdk/test_arm/framework/audioStreamDecodeProc.h
3ee071d802cb227150f39e97c5f5521db151989d
[processor-sdk/performance-audio-sr.git] / pasdk / test_arm / framework / audioStreamDecodeProc.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  *  ======== audioStreamDecdeProc.h ========
38  */
40 #ifndef _ASDP_H_
41 #define _ASDP_H_
42  
43 #include <xdc/std.h>
44 #include <ti/sysbios/knl/Task.h>
46 #include "audioStreamProc_params.h"
47 #include "audioStreamProc_patchs.h"
48 #include "audioStreamProc_config.h"
49 #include "aspDecOpCircBuf_common.h"
51 struct PAF_ASDT_Params;
52 struct PAF_ASDT_Patchs;
53 struct PAF_ASDT_Config;
55 // Audio Stream Decode Task (ASDT) parameters, functions
56 typedef struct PAF_ASDT_Fxns {
57     Int (*initPhase[8]) (const struct PAF_ASDT_Params *, const struct PAF_ASDT_Patchs *, struct PAF_ASDT_Config *);
58     Int (*initFrame0) (const struct PAF_ASDT_Params *, const struct PAF_ASDT_Patchs *, struct PAF_ASDT_Config *, Int);
59     Int (*initFrame1) (const struct PAF_ASDT_Params *, const struct PAF_ASDT_Patchs *, struct PAF_ASDT_Config *, Int, Int);
61     // For RAM_report
62     Void (*headerPrint)();
63     Int  (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
64     Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
65     Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
66     Void (*memStatusPrint)(
67         CString header, 
68         HeapMem_Handle hInternalHeap, 
69         HeapMem_Handle hInternal1Heap, 
70         HeapMem_Handle hExternalHeap, 
71         HeapMem_Handle hInternal1HeapShm,
72         HeapMem_Handle hExternalHeapShm,
73         HeapMem_Handle hExternalNonCachedHeapShm);
74 } PAF_ASDT_Fxns;
76 // Audio Stream Decode Task (ASDT) parameters
77 typedef struct PAF_ASDT_Params {
78     const PAF_ASDT_Fxns *fxns;
79     struct {
80         SmInt master;
81         SmInt decodes;
82         SmInt decode1;
83         SmInt decodeN;
84         SmInt streams;
85     } zone;
86     const SmInt *inputsFromDecodes;
87     struct {
88         int *pHeapIdIntern;             // INT memory heap ID
89         int *pHeapIdExtern;             // EXT memory heap ID
90         int *pHeapIdFrmbuf;             // Frame buffer heap ID
91         int *pHeapIdIntern1;            // INT1 memory heap ID
92         int *pHeapIdInt1Shm;            // INT1 SHared Memory heap ID
93         int *pHeapIdExtShm;             // EXT SHared Memory heap ID
94         int *pHeapIdExtNonCachedShm;    // EXT Non-Cached SHared Memory heap ID
95         int clear; 
96     } heap;
97     struct {
98         const IALG_MemSpace *space;
99     } common;
100     const SmInt *z_numchan;
101     MdInt framelength;
102     const PAF_AudioFunctions *pAudioFrameFunctions;
103     const struct PAF_ASP_ChainFxns *pChainFxns;
104     const PAF_DecodeStatus * const *z_pDecodeStatus;
105     const PAF_ASP_AlgKey *pDecAlgKey;
106     const SmInt *streamsFromDecodes;
107     const MdInt maxFramelength;
108     const PAF_MetadataBufStatus *pMetadataBufStatus;
109     const PAF_AudioFrameBufStatus *pAudioFrameBufStatus;
110 } PAF_ASDT_Params;
112 // Audio Stream Decode Task (ASDT) patchs
113 typedef struct PAF_ASDT_Patchs {
114     const PAF_ASP_LinkInit * const (*i_decLinkInit);
115     //const PAF_ASP_LinkInit * const (*i_aspLinkInit)[GEARS];
116 } PAF_ASDT_Patchs;
118 // Audio Stream Decode Task (ASDT) configuration
119 typedef struct PAF_ASDT_Config 
121     Task_Handle taskHandle;                     // ASDT handle
122     ACP_Handle acp;                             // ASDT local ACP handle
123     PAF_AST_DecOpCircBufCtl decOpCircBufCtl;    // decoder output circular buffer control
124     PAF_AST_Config *pAstCfg;                    // ASIT/ASOT/ASDT shared configuration
125 } PAF_ASDT_Config;
128 //   Purpose:   Audio Stream Decode Task Function for initialization of data pointers
129 //              by allocation of memory.
130 Int
131 PAF_ASDT_initPhaseMalloc(
132     const PAF_ASDT_Params *pP, 
133     const PAF_ASDT_Patchs *pQ, 
134     PAF_ASDT_Config *pC
135 );
137 //   Purpose:   Audio Stream Decode Task Function for initialization of data values
138 //              from parameters.
139 Int
140 PAF_ASDT_initPhaseConfig(
141     const PAF_ASDT_Params *pP, 
142     const PAF_ASDT_Patchs *pQ, 
143     PAF_ASDT_Config *pC
144 );
146 //   Purpose:   Audio Stream Decode Task Function for initialization of ACP by
147 //              instantiation of the algorithm.
148 Int
149 PAF_ASDT_initPhaseAcpAlg(
150     const PAF_ASDT_Params *pP, 
151     const PAF_ASDT_Patchs *pQ, 
152     PAF_ASDT_Config *pC
153 );
155 //   Purpose:   Audio Stream Decode Task Function for initialization of data pointers
156 //              by allocation for common memory and by instantiation for
157 //              algorithms.
158 Int
159 PAF_ASDT_initPhaseCommon(
160     const PAF_ASDT_Params *pP, 
161     const PAF_ASDT_Patchs *pQ, 
162     PAF_ASDT_Config *pC
163 );
165 //   Purpose:   Audio Stream Decode Task Function for initialization of data values
166 //              from parameters for Algorithm Keys.
167 Int 
168 PAF_ASDT_initPhaseAlgKey(
169     const PAF_ASDT_Params *pP, 
170     const PAF_ASDT_Patchs *pQ, 
171     PAF_ASDT_Config *pC
172 );
174 //   Purpose:   Audio Stream Decode Task Function for initialization of the Audio
175 //              Frame(s) by memory allocation and loading of data pointers
176 //              and values.
177 Int
178 PAF_ASDT_initFrame0(
179     const PAF_ASDT_Params *pP, 
180     const PAF_ASDT_Patchs *pQ, 
181     PAF_ASDT_Config *pC, 
182     Int z
183 );
185 //   Purpose:   Audio Stream Task Function for initialization or reinitialization
186 //              of the Audio Frame(s) by loading of data values of a
187 //              time-varying nature.
188 Int
189 PAF_ASDT_initFrame1(
190     const PAF_ASDT_Params *pP, 
191     const PAF_ASDT_Patchs *pQ, 
192     PAF_ASDT_Config *pC, 
193     Int z, 
194     Int sourceSelect
195 );
197 // Reset AF, invoked during activate (INIT stage from Master)
198 Int resetAf(
199     const PAF_ASDT_Params *pP, 
200     Int z, 
201     Int sourceSelect
202 );
204 // Reset AF samsiz, invoked during DECODE
205 Int resetAfSamsiz(
206     Int z
207 );
209 extern PAF_ASDT_Config gPAF_ASDT_config;
211 #endif /* _ASDP_H_ */