]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_common.h
Change root folder name, create pasdk subfolder
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / common / audioStreamProc_common.h
1 /*
2  *  ======== audioStreamProc_common.h ========
3  */
5 #ifndef _ASP_COMMON_H_
6 #define _ASP_COMMON_H_
7  
8 #include <xdc/std.h>
9 #include "audioStreamProc_config.h"
10 #include "paf_heapMgr.h"
12 // .............................................................................
14 /* ---------------------------------------------------------------- */
15 /* For historical reasons, macro definitions (#define ...) are used */
16 /* to hide parameter references (pP->...) throughout this file, but */
17 /* only for select quantities and not for all parameter elements.   */
18 /*                                                                  */
19 /*             Parameter macro definitions start here.              */
20 /* ---------------------------------------------------------------- */
22 //
23 // Audio Topology (Zone) Definitions
24 //
25 //   The ZONE, a historical term here, is a letter identifying the Audio
26 //   Topology with a single letter or "*" for a variable quantization of
27 //   same.
28 //
29 //   The Zone Elements listed here indicate the cardinality of the corre-
30 //   sponding element:
31 //
32 //     INPUTS   Number of inputs.
33 //     DECODES  Number of decodes.
34 //     STREAMS  Number of streams.
35 //     ENCODES  Number of encodes.
36 //     OUTPUTS  Number of outputs.
37 //
38 //   The Zone Element Counts listed here indicate the first (1) and after-
39 //   last (N) values suitable for use in a loop:
40 //
41 //     INPUTS[1N]  for inputs.
42 //     DECODES[1N] for decodes.
43 //     STREAMS[1N] for streams.
44 //     ENCODES[1N] for encodes.
45 //     OUTPUTS[1N] for outputs.
46 //
47 //   The Zone Element Count Limits listed here establish array sizes:
48 //
49 //     DECODEN_MAX for decodes.
50 //     STREAMN_MAX for streams.
51 //     ENCODEN_MAX for encodes.
52 //
53 //   The Zone Master is important in multi-input frameworks:
54 //
55 //     MASTER   In a uni-input zone, the count of the input.
56 //              In a multi-input zone, the count of the primary which controls
57 //              the secondary or secondaries.
58 //
60 #ifndef ZONE
62 #define ZONE "*" /* 19.53 kB of 38.80 kB FW */
63 //
64 //#define MASTER  pP->zone.master
65 //#define INPUTS  pP->zone.inputs
66 //#define DECODES pP->zone.decodes
67 #define STREAMS pP->zone.streams
68 //#define ENCODES pP->zone.encodes
69 //#define OUTPUTS pP->zone.outputs
71 #endif /* ZONE */
73 #ifndef ZONE
75 #define ZONE "I" /* ~2.5 kB less than above */
77 #define MASTER  0
78 #define INPUTS  1
79 #define DECODES 1
80 #define STREAMS 1
81 #define ENCODES 1
82 #define OUTPUTS 1
84 #endif /* ZONE */
86 #define INPUT1  pP->zone.input1
87 #define INPUTN  pP->zone.inputN
88 //
89 #define DECODE1 pP->zone.decode1
90 #define DECODEN pP->zone.decodeN
91 //#define DECODEN_MAX 3
92 //
93 #define STREAM1 0
94 #define STREAMN STREAMS
95 //#define STREAMN_MAX 5
96 //
97 #define ENCODE1 pP->zone.encode1
98 #define ENCODEN pP->zone.encodeN
99 //#define ENCODEN_MAX 3
100 //
101 #define OUTPUT1 pP->zone.output1
102 #define OUTPUTN pP->zone.outputN
104 //
105 // Audio Data Representation Definitions
106 //
108 /* audio frame "width" in channels */
109 #define numchan pP->z_numchan
111 /* audio frame "length" in samples */
112 #define FRAMELENGTH pP->framelength
114 #define PA_MODULO       8   // also defined independently in ARC2 code, and may be hard coded other places.
117 // .............................................................................
119 //
120 // Heap & Memory Allocation Definitions
121 //
122 #define HEAP_ID_INTERNAL        *pP->heap.pHeapIdIntern     //*pP->heap.pIntern
123 #define HEAP_ID_INTERNAL1       *pP->heap.pHeapIdIntern1    //*pP->heap.pIntern1
124 #define HEAP_ID_EXTERNAL        *pP->heap.pHeapIdExtern     //*pP->heap.pExtern
125 #define HEAP_ID_INTERNAL1_SHM   gPafHeapIdInt1Shm
126 #define HEAP_INTERNAL           (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL)
127 #define HEAP_INTERNAL1          (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1)
128 #define HEAP_EXTERNAL           (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_EXTERNAL)
129 #define HEAP_INTERNAL1_SHM      (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INTERNAL1_SHM)
130 #define HEAP_CLEAR              pP->heap.clear
132 #define HEAP_ID_INPBUF      *pP->heap.pHeapIdInpbuf     //*pP->heap.pInpbuf
133 #define HEAP_ID_OUTBUF      *pP->heap.pHeapIdOutbuf     //*pP->heap.pOutbuf
134 #define HEAP_ID_FRMBUF      *pP->heap.pHeapIdFrmbuf     //*pP->heap.pFrmbuf
135 #define HEAP_INPBUF         (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_INPBUF)
136 #define HEAP_OUTBUF         (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_OUTBUF)
137 #define HEAP_FRMBUF         (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_FRMBUF)
139 #define HEAP_ID_MDBUF       *pP->pMetadataBufStatus->pHeadIdSpace
140 #define HEAP_MDBUF          (HeapMem_Handle)pafHeapMgr_readHeapHandle(HEAP_ID_MDBUF)
142 #define COMMONSPACE         pP->common.space
144 // .............................................................................
146 // -----------------------------------------------------------------------------
147 // Debugging Trace Control
148 //#define TRACE_TERSE(a)              LOG_printf a
149 #define TRACE_TERSE0(a)             Log_info0(a)
150 #define TRACE_TERSE1(a,b)           Log_info1(a,b)
151 #define TRACE_TERSE2(a,b,c)         Log_info2(a,b,c)
152 #define TRACE_TERSE3(a,b,c,d)       Log_info3(a,b,c,d)
153 #define TRACE_TERSE4(a,b,c,d,e)     Log_info4(a,b,c,d,e)
155 //#define TRACE_GEN(a)                LOG_printf a
156 #define TRACE_GEN0(a)               Log_info0(a)
157 #define TRACE_GEN1(a,b)             Log_info1(a,b)
158 #define TRACE_GEN2(a,b,c)           Log_info2(a,b,c)
159 #define TRACE_GEN3(a,b,c,d)         Log_info3(a,b,c,d)
160 #define TRACE_GEN4(a,b,c,d,e)       Log_info4(a,b,c,d,e)
162 //#define TRACE_VERBOSE(a)            LOG_printf a
163 #define TRACE_VERBOSE0(a)           Log_info0(a)
164 #define TRACE_VERBOSE1(a,b)         Log_info1(a,b)
165 #define TRACE_VERBOSE2(a,b,c)       Log_info2(a,b,c)
166 #define TRACE_VERBOSE3(a,b,c,d)     Log_info3(a,b,c,d)
167 #define TRACE_VERBOSE4(a,b,c,d,e)   Log_info4(a,b,c,d,e)
169 #define TRACE_MSG0(a)               Log_info0(a)
170 #define TRACE_MSG1(a,b)             Log_info1(a,b)
171 #define TRACE_MSG2(a,b,c)           Log_info2(a,b,c)
172 #define TRACE_MSG3(a,b,c,d)         Log_info3(a,b,c,d)
173 #define TRACE_MSG4(a,b,c,d,e)       Log_info4(a,b,c,d,e)
176 #define DEC_Handle PCM_Handle /* works for all: SNG, PCM, AC3, DTS, AAC */
179 /* Global configuration */
180 extern PAF_AST_Config gPAF_AST_config;
181 extern far PAF_AST_Config *pC;
183 // Temporary
184 //extern Bool gAspInitDone;
187 #endif /* _ASP_COMMON_H_ */