Merge remote-tracking branch 'origin/dev_pasdk_frank_pasdk538UpdateIpcMessaging'...
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / itopo / params.c
2 /*
3 Copyright (c) 2017, 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 // PAF_DEVICE_VERSION Symbol Definitions
39 #define PAF_DEVICE_VERSION (PAF_DEVICE & 0xffff)
41 #include <xdc/cfg/global.h>
43 //#include <ti/procsdk_audio/procsdk_audio_typ.h>
44 #include <procsdk_audio_typ.h>
46 #include "paftyp.h"
47 #include "paf_ialg.h"
48 #include <stdasp.h>
49 #include <pafsio_ialg.h>
51 #include "paf_heapMgr.h"
53 #include "asp1.h"
54 #include "audioStreamProc_params.h"
55 #include "audioStreamInpProc.h"
56 #include "audioStreamOutProc.h"
58 #include "dbgBenchmark.h" // PCM high-sampling rate + SRC + CAR benchmarking
60 //
61 // Framework Declarations
62 //
64 //#define PAF_AST_params_fxnsPA PAF_AST_params_fxnsPA17
66 //
67 // Audio Data Representation Definitions
68 //
69 //   External declarations to patched IROM provide standard functionality.
70 //
72 /* audio frame "width" in channels */
74 const SmInt PAF_AST_params_numchan[1] =
75 {
76     32,
77 };
79 ///
80 // Audio Stream Processing Function Table Definition
81 //
83 const PAF_AudioFunctions PAF_AST_params_audioFrameFunctions =
84 {
85     &PAF_ASP_dB2ToLinear,
86     &PAF_ASP_channelMask,
87     &PAF_ASP_programFormat,
88     &PAF_ASP_sampleRateHz,
89     &PAF_ASP_delay,
90 };
92 //
93 // Source Select Array Declarations -- algorithm keys & sio map
94 //
95 //   External declarations to patched IROM provide standard functionality.
96 //
98 const PAF_ASP_AlgKey PAF_ASP_params_decAlgKey =
99 {
100     PAF_SOURCE_N,                                           // length
101     /* Relies on the fact that ACP_SERIES_* != 0 here */
102     0,                                                      // PAF_SOURCE_UNKNOWN
103     0,                                                      // PAF_SOURCE_NONE
104     0,                                                      // PAF_SOURCE_PASS
105     PAF_ASP_ALPHACODE (STD, SNG),                           // PAF_SOURCE_SNG
106     0,                                                      // PAF_SOURCE_AUTO
107     0,                                                      // PAF_SOURCE_BITSTREAM
108     PAF_ASP_ALPHACODE (STD, DTSUHDA),                         // PAF_SOURCE_DTSALL
109     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCMAUTO
110     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCM
111     PAF_ASP_ALPHACODE (STD, PCN),                           // PAF_SOURCE_PC8 /* unused */
112     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_AC3
113     PAF_ASP_ALPHACODE (STD, DTSUHDA),                         // PAF_SOURCE_DTS
114     PAF_ASP_ALPHACODE (STD, AAC),                           // PAF_SOURCE_AAC
115     PAF_ASP_ALPHACODE (STD, MPG),                           // PAF_SOURCE_MPEG /* unused */
116     PAF_ASP_ALPHACODE (STD, DTSUHDA),                         // PAF_SOURCE_DTS12
117     PAF_ASP_ALPHACODE (STD, DTSUHDA),                         // PAF_SOURCE_DTS13
118     PAF_ASP_ALPHACODE (STD, DTSUHDA),                         // PAF_SOURCE_DTS14
119     PAF_ASP_ALPHACODE (STD, DTSUHDA),                         // PAF_SOURCE_DTS16
120     0,                                                      // PAF_SOURCE_WMA9PRO
121     0,                                                      // PAF_SOURCE_MP3
122     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD1
123     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD2
124     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD3
125     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_DDP
126     PAF_ASP_ALPHACODE (STD, DTSUHDA),                       // PAF_SOURCE_DTSHD
127     PAF_ASP_ALPHACODE (STD, THD),                           // PAF_SOURCE_THD
128     PAF_ASP_ALPHACODE (STD, DXP),                           // PAF_SOURCE_DXP
129 };
131 const PAF_ASP_AlgKey PAF_ASP_params_encAlgKey =
133     PAF_SOURCE_N,                                           // length
134     /* Relies on the fact that ACP_SERIES_* != 0 here */
135     0,                                                      // PAF_SOURCE_UNKNOWN
136     0,                                                      // PAF_SOURCE_NONE
137     0,                                                      // PAF_SOURCE_PASS
138     0,                                                      // PAF_SOURCE_SNG
139     0,                                                      // PAF_SOURCE_AUTO
140     0,                                                      // PAF_SOURCE_BITSTREAM
141     0,                                                      // PAF_SOURCE_DTSALL
142     0,                                                      // PAF_SOURCE_PCMAUTO
143     PAF_ASP_ALPHACODE (STD, PCE),                           // PAF_SOURCE_PCM
144     0,                                                      // PAF_SOURCE_PC8
145     0,                                                      // PAF_SOURCE_AC3
146     0,                                                      // PAF_SOURCE_DTS
147     0,                                                      // PAF_SOURCE_AAC
148     0,                                                      // PAF_SOURCE_MPEG
149     0,                                                      // PAF_SOURCE_DTS12
150     0,                                                      // PAF_SOURCE_DTS13
151     0,                                                      // PAF_SOURCE_DTS14
152     0,                                                      // PAF_SOURCE_DTS16
153     0,                                                      // PAF_SOURCE_WMA9PRO
154     PAF_ASP_ALPHACODE (STD, MPE),                           // PAF_SOURCE_MP3
155     0,                                                      // PAF_SOURCE_DSD1
156     0,                                                      // PAF_SOURCE_DSD2
157     0                                                       // PAF_SOURCE_DSD3
158 };
160 const PAF_ASP_SioMap PAF_ASP_params_decSioMap =
162     PAF_SOURCE_N,                                           // length
163     PAF_SOURCE_UNKNOWN,                                     // PAF_SOURCE_UNKNOWN -> ...
164     PAF_SOURCE_NONE,                                        // PAF_SOURCE_NONE -> ...
165     PAF_SOURCE_PASS,                                        // PAF_SOURCE_PASS -> ...
166     PAF_SOURCE_PCM,                                         // PAF_SOURCE_SNG -> PCM
167     PAF_SOURCE_AUTO,                                        // PAF_SOURCE_AUTO -> ...
168     PAF_SOURCE_BITSTREAM,                                   // PAF_SOURCE_BITSTREAM -> ...
169     PAF_SOURCE_DTSALL,                                      // PAF_SOURCE_UNUSED1 -> ...
170     PAF_SOURCE_PCMAUTO,                                     // PAF_SOURCE_UNUSED2 -> ...
171     PAF_SOURCE_PCM,                                         // PAF_SOURCE_PCM -> ...
172     PAF_SOURCE_PC8,                                         // PAF_SOURCE_PC8 -> ...
173     PAF_SOURCE_AC3,                                         // PAF_SOURCE_AC3 -> ...
174     PAF_SOURCE_DTS,                                         // PAF_SOURCE_DTS -> ...
175     PAF_SOURCE_AAC,                                         // PAF_SOURCE_AAC -> ...
176     PAF_SOURCE_MPEG,                                        // PAF_SOURCE_MPEG -> ...
177     PAF_SOURCE_DTS12,                                       // PAF_SOURCE_DTS12 -> ...
178     PAF_SOURCE_DTS13,                                       // PAF_SOURCE_DTS13 -> ...
179     PAF_SOURCE_DTS14,                                       // PAF_SOURCE_DTS14 -> ...
180     PAF_SOURCE_DTS16,                                       // PAF_SOURCE_DTS16 -> ...
181     PAF_SOURCE_WMA9PRO,                                     // PAF_SOURCE_WMA9PRO -> ...
182     PAF_SOURCE_MP3,                                         // PAF_SOURCE_MP3 -> ...
183     PAF_SOURCE_DSD1,                                        // PAF_SOURCE_DSD1 -> ...
184     PAF_SOURCE_DSD2,                                        // PAF_SOURCE_DSD2 -> ...
185     PAF_SOURCE_DSD3,                                        // PAF_SOURCE_DSD3 -> ...
186     PAF_SOURCE_DDP,                                         // PAF_SOURCE_DDP -> ...
187     PAF_SOURCE_DTSHD,                                       // PAF_SOURCE_DTSHD -> ...
188     PAF_SOURCE_THD,                                         // PAF_SOURCE_THD -> ...
189     PAF_SOURCE_DXP,                                         // PAF_SOURCE_DXP -> ...
190 };
192 //
193 // Mapping Declarations -- from *coders to *puts
194 //
195 //   External declarations to patched IROM provide standard functionality.
196 //
197 const SmInt PAF_AST_streamsFromDecodes_std[DECODEN_MAX] =
199     0, 1, 2,
200 };
201 const SmInt PAF_AST_streamsFromEncodes_std[ENCODEN_MAX] =
203     0, 1, 2,
204 };
205 const SmInt PAF_AST_inputsFromDecodes_std[DECODEN_MAX] =
207     0, 1, 2,
208 };
209 extern const SmInt PAF_AST_outputsFromEncodes_std[ENCODEN_MAX];
210 #ifndef __TI_EABI__
211 asm ("_PAF_AST_outputsFromEncodes_std .set _PAF_AST_inputsFromDecodes_std");
212 #else
213 asm ("PAF_AST_outputsFromEncodes_std .set PAF_AST_inputsFromDecodes_std");
214 #endif
216 //
217 // Setting of audio stream order
218 //
220 const SmInt PAF_AST_streamOrder[1] =
222     0,
223 };
225 //
226 // Audio Framework Initialization Function Table Declarations
227 //
228 //   External declarations to patched IROM provide standard functionality.
229 //
231 extern const PAF_ASIT_Fxns PAF_ASIT_params_fxns;
233 //
234 // Audio Framework Status Initialization Declarations
235 //
236 //   External declarations to patched IROM provide standard functionality.
237 //
239 const PAF_InpBufStatus PAF_AST_params_inpBufStatus =
241     sizeof (PAF_InpBufStatus),                              // size
242     0,                                                      // mode
243     0,                                                      // sioSelect
244     0x80,                                                   // lockOverride = none
245     0,                                                      // unused
246     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateOverride
247     PAF_SAMPLERATE_NONE,                                    // sampleRateData
248     PAF_SAMPLERATE_NONE,                                    // sampleRateMeasured
249     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateStatus
250     PAF_IEC_AUDIOMODE_UNKNOWN,                              // nonaudio
251     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasisData
252     0,                                                      // emphasisOverride
253     PAF_IEC_PREEMPHASIS_NO,                                 // emphasisStatus
254     0,                                                      // lock
255     0,                                                      // scanAtHighSampleRateMode
256     0,                                                      // zeroRun
257     0,                                                      // rateTrackMode
258     24,                                                     // precisionDefault
259     -1,                                                     // precisionDetect
260     0,                                                      // precisionOverride
261     0,                                                      // precisionInput
262     100,                                                    // zeroRunTrigger
263     100,                                                    // zeroRunRestart
264     2048,                                                   // unknownTimeout
265     0,                                                      // lastFrameMask
266     0,                                                      // lastFrameFlag
267     0,                                                      // reportDTS16AsDTSForLargeSampleRate
268     0, 0                                                    // reserved
269 };
271 const PAF_OutBufStatus PAF_AST_params_outBufStatus =
273     sizeof (PAF_OutBufStatus),                              // size
274     1,                                                      // mode
275     0,                                                      // sioSelect
276     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
277     0,                                                      // audio
278     PAF_OB_CLOCK_INTERNAL,                                  // clock
279     PAF_OB_FLUSH_DISABLE,                                    // flush           !!! FLUSH_ENABLE not supported, yet !!!
280     0,                                                      // rateTrackMode // unused
281     PAF_OB_MARKER_DISABLED,                                 // markerMode
282     0,                                                      // maxNumBufOverride
283                                                             // this is the start of numBufOverride[PAF_SOURCE_N]                                                            
284     0,                                                      // PAF_SOURCE_UNKNOWN
285     0,                                                      // PAF_SOURCE_NONE
286     0,                                                      // PAF_SOURCE_PASS
287     0,                                                      // PAF_SOURCE_SNG
288     0,                                                      // PAF_SOURCE_AUTO
289     0,                                                      // PAF_SOURCE_BITSTREAM
290     0,                                                      // PAF_SOURCE_DTSALL
291     0,                                                      // PAF_SOURCE_PCMAUTO
292     0,                                                      // PAF_SOURCE_PCM
293     0,                                                      // PAF_SOURCE_PC8
294     0,                                                      // PAF_SOURCE_AC3
295     0,                                                      // PAF_SOURCE_DTS
296     0,                                                      // PAF_SOURCE_AAC
297     0,                                                      // PAF_SOURCE_MPEG
298     0,                                                      // PAF_SOURCE_DTS12
299     0,                                                      // PAF_SOURCE_DTS13
300     0,                                                      // PAF_SOURCE_DTS14
301     0,                                                      // PAF_SOURCE_DTS16
302     0,                                                      // PAF_SOURCE_WMA9PRO
303     0,                                                      // PAF_SOURCE_MP3
304     0,                                                      // PAF_SOURCE_DSD1,
305     0,                                                      // PAF_SOURCE_DSD2,
306     0,                                                      // PAF_SOURCE_DSD3,
307     0,                                                      // PAF_SOURCE_DDP
308     0,                                                      // PAF_SOURCE_DTSHD
309     0,                                                      // PAF_SOURCE_THD
310     0,                                                      // PAF_SOURCE_DXP                                                          
311 };
313 const PAF_EncodeStatus PAF_AST_params_encodeStatus_primary =
315     sizeof (PAF_EncodeStatus),                              // size
316     1,                                                      // mode
317     0,                                                      // command2
318     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
319     0,                                                      // channelCount
320     0, 0, 0, 0,                                             // Unused                                        
321     0, 0, 0, 0,                                             // Unused
322     0, 0, 0, 0,                                             // Unused
323     0, 0, 0, 0,                                             // Unused
324     0, 0, 0, 0,                                             // Unused
325     0,                                                      // frameLength
326     0,                                                      // encBypass
327     PAF_SOURCE_PCM,                                         // select
328     // channelConfigurationRequest.full
329     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0,0,0,0,0,
330     // channelConfigurationStream.full
331     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
332     // channelConfigurationEncode.full
333     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,    
334     0, 0, 0, 0,    0, 0, 0, 0,                              // Unused
335     -3,                                                     // channelMap.from[0]
336     -3,                                                     // channelMap.from[1]
337     -3,                                                     // channelMap.from[2]
338     -3,                                                     // channelMap.from[3]
339     -3,                                                     // channelMap.from[4]
340     -3,                                                     // channelMap.from[5]
341     -3,                                                     // channelMap.from[6]
342     -3,                                                     // channelMap.from[7]
343     -3,                                                     // channelMap.from[8]
344     -3,                                                     // channelMap.from[9]
345     -3,                                                     // channelMap.from[10]
346     -3,                                                     // channelMap.from[11]
347     -3,                                                     // channelMap.from[12]
348     -3,                                                     // channelMap.from[13]
349     -3,                                                     // channelMap.from[14]
350     -3,                                                     // channelMap.from[15]
351     -3,                                                     // channelMap.from[16]
352     -3,                                                     // channelMap.from[17]
353     -3,                                                     // channelMap.from[18]
354     -3,                                                     // channelMap.from[19]
355     -3,                                                     // channelMap.from[20]
356     -3,                                                     // channelMap.from[21]
357     -3,                                                     // channelMap.from[22]
358     -3,                                                     // channelMap.from[23]
359     -3,                                                     // channelMap.from[24]
360     -3,                                                     // channelMap.from[25]
361     -3,                                                     // channelMap.from[26]
362     -3,                                                     // channelMap.from[27]
363     -3,                                                     // channelMap.from[27]
364     -3,                                                     // channelMap.from[28]
365     -3,                                                     // channelMap.from[30]
366     -3,                                                     // channelMap.from[31]
367     -3,                                                     // channelMap.to[0]
368     -3,                                                     // channelMap.to[1]
369     -3,                                                     // channelMap.to[2]
370     -3,                                                     // channelMap.to[3]
371     -3,                                                     // channelMap.to[4]
372     -3,                                                     // channelMap.to[5]
373     -3,                                                     // channelMap.to[6]
374     -3,                                                     // channelMap.to[7]
375     -3,                                                     // channelMap.to[8]
376     -3,                                                     // channelMap.to[9]
377     -3,                                                     // channelMap.to[10]
378     -3,                                                     // channelMap.to[11]
379     -3,                                                     // channelMap.to[12]
380     -3,                                                     // channelMap.to[13]
381     -3,                                                     // channelMap.to[14]
382     -3,                                                     // channelMap.to[15]
383     -3,                                                     // channelMap.to[16]
384     -3,                                                     // channelMap.to[17]
385     -3,                                                     // channelMap.to[18]
386     -3,                                                     // channelMap.to[19]
387     -3,                                                     // channelMap.to[20]
388     -3,                                                     // channelMap.to[21]
389     -3,                                                     // channelMap.to[22]
390     -3,                                                     // channelMap.to[23]
391     -3,                                                     // channelMap.to[24]
392     -3,                                                     // channelMap.to[25]
393     -3,                                                     // channelMap.to[26]
394     -3,                                                     // channelMap.to[27]
395     -3,                                                     // channelMap.to[28]
396     -3,                                                     // channelMap.to[29]
397     -3,                                                     // channelMap.to[30]
398     -3,                                                     // channelMap.to[31]
399     1,                                                      // programFormat.mask
400     0,                                                      // programFormat.form
401     0,                                                      // listeningFormat.mask
402     0,                                                      // listeningFormat.form
403     0,                                                      // sampleProcess[0]
404     0, 0, 0, 0,                                             // Unused     
405     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,  // channelConfigurationCompact                                      
406     0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, //channelCompact[PAF_MAXNUMCHAN_HD]
407 };
408                                        
412 const PAF_EncodeStatus *const PAF_AST_params_encodeStatus[] =
414     &PAF_AST_params_encodeStatus_primary,
415 };
417 const PAF_VolumeStatus PAF_AST_params_volumeStatus =
419     sizeof (PAF_VolumeStatus),                              // size
420     1,                                                      // mode
421     PAF_MAXNUMCHAN,                                         // channelCount
422     0x0f,                                                   // implementation
423     0,                                                      // unused1
424     50,                                                     // rampTime: 50 msec/dB (20 dB/sec)
425     0,                                                      // unused2
426     0,                                                      // unused3
427     -2 * 20, 0, 0, 0,                                       // master
428     -2 * 0, 0, 0, 0,                                        // trim
429     -2 * 0, 0, 0, 0,                                        //
430     -2 * 0, 0, 0, 0,                                        //
431     -2 * 0, 0, 0, 0,                                        //
432     -2 * 0, 0, 0, 0,                                        //
433     -2 * 0, 0, 0, 0,                                        //
434     -2 * 0, 0, 0, 0,                                        //
435     -2 * 0, 0, 0, 0,                                        //
436     -2 * 0, 0, 0, 0,                                        //
437     -2 * 0, 0, 0, 0,                                        //
438     -2 * 0, 0, 0, 0,                                        //
439     -2 * 0, 0, 0, 0,                                        //
440     -2 * 0, 0, 0, 0,                                        //
441     -2 * 0, 0, 0, 0,                                        //
442     -2 * 0, 0, 0, 0,                                        //
443     -2 * 0, 0, 0, 0,                                        //  
444     -2 * 0, 0, 0, 0,                                        // trim - upper16
445     -2 * 0, 0, 0, 0,                                        //
446     -2 * 0, 0, 0, 0,                                        //
447     -2 * 0, 0, 0, 0,                                        //
448     -2 * 0, 0, 0, 0,                                        //
449     -2 * 0, 0, 0, 0,                                        //
450     -2 * 0, 0, 0, 0,                                        //
451     -2 * 0, 0, 0, 0,                                        //
452     -2 * 0, 0, 0, 0,                                        //
453     -2 * 0, 0, 0, 0,                                        //
454     -2 * 0, 0, 0, 0,                                        //
455     -2 * 0, 0, 0, 0,                                        //
456     -2 * 0, 0, 0, 0,                                        //
457     -2 * 0, 0, 0, 0,                                        //
458     -2 * 0, 0, 0, 0,                                        //
459     -2 * 0, 0, 0, 0,                                        //
461 };
463 //
464 // Common Space Parameter Declarations and Definitions
465 //
466 //   Local definitions in RAM provide non-standard functionality.
467 //   The NULL pointer provides standard functionality.
468 //
470 /* baseline definition - NULL equivalent */
471 /* May be used for overrides of IALG_MemSpace */
473 static const IALG_MemSpace params_memspace_PAi[] = {
474     PAF_IALG_NONE,                                          // Scratch
475     PAF_IALG_NONE,                                          // Persistant
476     PAF_IALG_NONE,                                          // Write once
477     PAF_IALG_NONE,                                          // Common 1
478     PAF_IALG_NONE,                                          // Common 2
479     PAF_IALG_NONE,                                          // Common 3
480     PAF_IALG_NONE,                                          // Common 4
481     PAF_IALG_NONE,                                          // Common 5
482     PAF_IALG_NONE,                                          // Common 6
483     PAF_IALG_NONE,                                          // Common 7
484     IALG_EXTERNAL,                                          // Common 8
485     PAF_IALG_NONE,                                          // Common 9
486     PAF_IALG_NONE,                                          // Common 10
487     PAF_IALG_NONE,                                          // Common 11
488     PAF_IALG_NONE,                                          // Common 12
489     PAF_IALG_NONE,                                          // Common 13
490     PAF_IALG_NONE,                                          // Common 14
491     PAF_IALG_NONE,                                          // Common 15
492 };
494 //
495 // Heap Declarations
496 //
498 //#include <pafhjt.h>
500 //extern int IRAM;
501 //extern int SDRAM;
502 //extern int L3RAM;
504 // .............................................................................
505 // DIB memory requirements
507 // primary input
508 // IALG_SARAM_SHM: MSMC shared memory heap
509 // IALG_EXTERNAL_SHM: DDR shared memory heap
510 const IALG_MemRec inpMemTabPrimary[] =
512     // SDRAM circular buffer
513     // 2 buffers * 256 samples/buffer * 8 words/sample * 3 bytes/word
514     {
515         (4 * 60 * 1024) + 2,                                    // size 184320 + 1 16-bit word for EDMA padding
516         //180 * 1024,                                           // size
517         //6 * 60 * 1024,                                        // size
518         128,                                                    // alignment
519                 IALG_SARAM_SHM, //IALG_EXTERNAL_SHM, //IALG_SARAM2, //IALG_SARAM1, //IALG_EXTERNAL,                           // space
520         IALG_PERSIST,                                           // attrs
521         NULL,                                                   // base
522      }
524 };
526 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
528     1,
529     inpMemTabPrimary
530 };
532 const PAF_ASP_LinkInit inpLinkInitPrimary[] =
534     PAF_ASP_LINKINITPARAMS (STD, IB, TIH, &inpSioAlgParamsPrimary),
535     PAF_ASP_LINKNONE
536 };
538 const PAF_ASP_LinkInit *const inpLinkInit[] =
540     inpLinkInitPrimary
541 };
543 // .............................................................................
544 // DOB memory requirements
546 // primary output
547 const IALG_MemRec outMemTabPrimary[] =
549     // SDRAM buffer
550     // 4 buffers * PAF_ASOT_MAX_FRAMELENGTH samples * 16 ch (assumed MAX) * 4 bytes
551         {
552             4 * PAF_ASOT_MAX_FRAMELENGTH * 16 * 4,                                      // size: note:
553             //6 * 256 * 32 * 4,                                      // size: note:
554             //16 * 256 * 32 * 4,                                      // size: note:
555             128,                                                   // alignment
556             IALG_SARAM,                                         // space
557             IALG_PERSIST,                                          // attrs
558             NULL,                                                  // base
559         }
560 };
563 const PAF_SIO_IALG_Params outSioAlgParamsPrimary =
565     1,
566     outMemTabPrimary
567 };
569 const PAF_ASP_LinkInit outLinkInitPrimary[] =
571     PAF_ASP_LINKINITPARAMS (STD, OB, TIH, &outSioAlgParamsPrimary),
572     PAF_ASP_LINKNONE
573 };
575 const PAF_ASP_LinkInit * const outLinkInit[] =
577     outLinkInitPrimary,
578 };
581 // .............................................................................
582 // sourceProgram mapped to DOB num of buffers
583 const PAF_ASP_outNumBufMap outPrimaryNumBufMap =
585     4,                                                      // maxNumBuf
586     PAF_SOURCE_N,                                           // length
587                                                             // this is the start of map[PAF_SOURCE_N]                                                            
588     0,                                                      // PAF_SOURCE_UNKNOWN
589     0,                                                      // PAF_SOURCE_NONE
590     2,                                                      // PAF_SOURCE_PASS
591     2,                                                      // PAF_SOURCE_SNG
592     0,                                                      // PAF_SOURCE_AUTO
593     0,                                                      // PAF_SOURCE_BITSTREAM
594     0,                                                      // PAF_SOURCE_DTSALL
595     0,                                                      // PAF_SOURCE_PCMAUTO
596     2,                                                      // PAF_SOURCE_PCM
597     0,                                                      // PAF_SOURCE_PC8
598     2,                                                      // PAF_SOURCE_AC3
599     2,                                                      // PAF_SOURCE_DTS
600     2,                                                      // PAF_SOURCE_AAC
601     0,                                                      // PAF_SOURCE_MPEG
602     2,                                                      // PAF_SOURCE_DTS12
603     2,                                                      // PAF_SOURCE_DTS13
604     2,                                                      // PAF_SOURCE_DTS14
605     2,                                                      // PAF_SOURCE_DTS16
606     0,                                                      // PAF_SOURCE_WMA9PRO
607     0,                                                      // PAF_SOURCE_MP3
608     2,                                                      // PAF_SOURCE_DSD1,
609     2,                                                      // PAF_SOURCE_DSD2,
610     2,                                                      // PAF_SOURCE_DSD3,
611     4,                                                      // PAF_SOURCE_DDP
612     4,                                                      // PAF_SOURCE_DTSHD
613     4,                                                      // PAF_SOURCE_THD
614     4,                                                      // PAF_SOURCE_DXP
615 };
617 const PAF_ASP_outNumBufMap *const outNumBufMap[] =
619     &outPrimaryNumBufMap,
620 };
622 // .............................................................................
623 const PAF_MetadataBufStatus PAF_AST_params_MetadataBufStatus[] =
625     PAF_MAX_PRIVATE_MD_SZ,  // bufSize
626     PAF_MAX_NUM_PRIVATE_MD, // NumBuf
627     128,                    // alignment
628     &gPafHeapIdExt          // pHeapIdMdbuf
629 };
631 // .............................................................................
632 //
633 // This structure defines the memory allocation of audio frame buffers (channel buffers). Users can customize this structure based
634 // on their requirement. IALG_SARAM specifies the audio frame buffer is allocated in IRAM and IALG_EXTERNAL
635 // specifies the audio frame buffer is allocated in SDRAM. By allocating few channel buffers in SDRAM, users can save internal memory
636 // but trading performance
637 // This structure defined for PAF_MAXNUMCHAN number of channels. But channel buffers will be allocated  for "PAF_AST_params_numchan"
638 // number of channels only.
639 //
641 const PAF_AudioFrameBufStatus    PAF_AST_params_AudioFrameBufStatus[PAF_MAXNUMCHAN] =
643     IALG_SARAM, // 0
644     IALG_SARAM,
645     IALG_SARAM,
646     IALG_SARAM,
647     IALG_SARAM,
648     IALG_SARAM,
649     IALG_SARAM,
650     IALG_SARAM,
651     IALG_SARAM,
652     IALG_SARAM,
653     IALG_SARAM,
654     IALG_SARAM,
655     IALG_SARAM,
656     IALG_SARAM,
657     IALG_SARAM,
658     IALG_SARAM,
659     IALG_SARAM, // 16
660     IALG_SARAM,
661     IALG_SARAM,
662     IALG_SARAM,
663     IALG_SARAM,
664     IALG_SARAM,
665     IALG_SARAM,
666     IALG_SARAM,
667     IALG_SARAM,
668     IALG_SARAM,
669     IALG_SARAM,
670     IALG_SARAM,
671     IALG_SARAM,
672     IALG_SARAM,
673     IALG_SARAM,
674     IALG_SARAM, // 31
675     //IALG_EXTERNAL, // 16
676     //IALG_EXTERNAL,
677     //IALG_EXTERNAL,
678     //IALG_EXTERNAL,
679     //IALG_EXTERNAL,
680     //IALG_EXTERNAL,
681     //IALG_EXTERNAL,
682     //IALG_EXTERNAL,
683     //IALG_EXTERNAL,
684     //IALG_EXTERNAL,
685     //IALG_EXTERNAL,
686     //IALG_EXTERNAL,
687     //IALG_EXTERNAL,
688     //IALG_EXTERNAL,
689     //IALG_EXTERNAL,
690     //IALG_EXTERNAL // 31
691 };
693 const PAF_AST_DecOpCircBufStatus PAF_AST_params_decOpCircBufStatus_primary =
695     sizeof(PAF_AST_DecOpCircBufStatus),
696     PAF_ASOT_FRAMELENGTH
697 };
699 const PAF_AST_DecOpCircBufStatus *const PAF_AST_params_decOpCircBufStatus[] =
701     &PAF_AST_params_decOpCircBufStatus_primary,
702 };
705 // Re-visit, remove unused members
706 // .............................................................................
707 //
708 // Audio Stream Parameter Definitions
709 //
710 //   Global definition in RAM provides standard & non-standard functionality.
711 //
713 const PAF_ASIT_Params asip_params_PAi =
715     &PAF_ASIT_params_fxns,                                  // fxns
716     {                                                       // zone
717         0,                                                  // zone.master
718         1,                                                  // zone.inputs
719         0,                                                  // zone.input1
720         1,                                                  // zone.inputN
721         1,                                                  // zone.decodes
722         0,                                                  // zone.decode1
723         1,                                                  // zone.decodeN
724         1,                                                  // zone.streams
725         0,                                                  // zone.stream1 /* unused */
726         1,                                                  // zone.streamN /* unused */
727         1,                                                  // zone.encodes
728         0,                                                  // zone.encode1
729         1,                                                  // zone.encodeN
730         1,                                                  // zone.outputs
731         0,                                                  // zone.output1
732         1,                                                  // zone.outputN
733     },
734     PAF_AST_inputsFromDecodes_std,
735     PAF_AST_outputsFromEncodes_std,
736     {                                                       // heap
737         &gPafHeapIdInt,                                     // heap.pHeapIdIntern
738         &gPafHeapIdExt,                                     // heap.pHeapIdExtern
739         &gPafHeapIdInt,                                     // heap.pHeapIdInpbuf
740         &gPafHeapIdInt,                                     // heap.pHeapIdOutbuf
741         &gPafHeapIdInt,                                     // heap.pHeapIdFrmbuf
742         &gPafHeapIdInt1,                                    // heap.pHeapIdIntern1
743         &gPafHeapIdInt1Shm,                                 // heap.pHeapIdInt1Shm
744         &gPafHeapIdExtShm,                                  // heap.pHeapIdExtShm
745         &gPafHeapIdExtNonCachedShm,                         // heap.pHeapIdExtNonCachedShm
746         1,                                                  // heap.clear
747     },
748     {                                                       // common
749         params_memspace_PAi,                                // common.space
750     },
751     NULL,                                                   // z_rx_bufsiz
752     NULL,                                                   // z_tx_bufsiz
753     PAF_AST_params_numchan,                                 // z_numchan
754     PAF_SYS_FRAMELENGTH,                                    // framelength
755     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
756     &PAF_ASP_chainFxns,                                     // pChainFxns
757     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
758     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
759     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
760     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
761     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
762     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
763     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
764     &PAF_ASP_params_decSioMap,                              // pDecSioMap
765     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
766     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
767     PAF_MAX_SYS_FRAMELENGTH,                                // maxFramelength
768     PAF_AST_streamOrder,                                    // streamOrder
769     inpLinkInit,                                            // i_inpLinkInit
770     outLinkInit,                                            // i_outLinkInit
771     outNumBufMap,                                           // poutNumBufMap
772     PAF_AST_params_MetadataBufStatus,                       // metadata buffer status
773     PAF_AST_params_AudioFrameBufStatus,                     // Audio frame buffer status
774     PAF_AST_params_decOpCircBufStatus                       // z_pDecOpCircBufStatus
775 };
777 extern const PAF_ASOT_Fxns PAF_ASOT_params_fxns;
779 // Re-visit, remove unused members
780 const PAF_ASOT_Params asop_params_PAi =
782     &PAF_ASOT_params_fxns,                                  // fxns
783     {                                                       // zone
784         0,                                                  // zone.master
785         1,                                                  // zone.inputs
786         0,                                                  // zone.input1
787         1,                                                  // zone.inputN
788         1,                                                  // zone.decodes
789         0,                                                  // zone.decode1
790         1,                                                  // zone.decodeN
791         1,                                                  // zone.streams
792         0,                                                  // zone.stream1 /* unused */
793         1,                                                  // zone.streamN /* unused */
794         1,                                                  // zone.encodes
795         0,                                                  // zone.encode1
796         1,                                                  // zone.encodeN
797         1,                                                  // zone.outputs
798         0,                                                  // zone.output1
799         1,                                                  // zone.outputN
800     },
801     PAF_AST_inputsFromDecodes_std,
802     PAF_AST_outputsFromEncodes_std,
803     {                                                       // heap
804         &gPafHeapIdInt,                                     // heap.pHeapIdIntern
805         &gPafHeapIdExt,                                     // heap.pHeapIdExtern
806         &gPafHeapIdInt,                                     // heap.pHeapIdInpbuf
807         &gPafHeapIdInt,                                     // heap.pHeapIdOutbuf
808         &gPafHeapIdInt,                                     // heap.pHeapIdFrmbuf
809         &gPafHeapIdInt1,                                    // heap.pHeapIdIntern1
810         &gPafHeapIdInt1Shm,                                 // heap.pHeapIdInt1Shm
811         &gPafHeapIdExtShm,                                  // heap.pHeapIdExtShm
812         &gPafHeapIdExtNonCachedShm,                         // heap.pHeapIdExtNonCachedShm
813         1,                                                  // heap.clear
814     },
815     {                                                       // common
816         params_memspace_PAi,                                // common.space
817     },
818     NULL,                                                   // z_rx_bufsiz
819     NULL,                                                   // z_tx_bufsiz
820     PAF_AST_params_numchan,                                 // z_numchan
821         PAF_ASOT_FRAMELENGTH,                                   // framelength
822     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
823     &PAF_ASP_chainFxns,                                     // pChainFxns
824     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
825     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
826     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
827     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
828     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
829     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
830     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
831     &PAF_ASP_params_decSioMap,                              // pDecSioMap
832     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
833     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
834         PAF_ASOT_MAX_FRAMELENGTH,                               // maxFramelength
835     PAF_AST_streamOrder,                                    // streamOrder
836     inpLinkInit,                                            // i_inpLinkInit
837     outLinkInit,                                            // i_outLinkInit
838     outNumBufMap,                                           // poutNumBufMap
839     PAF_AST_params_MetadataBufStatus,                       // metadata buffer status
840     PAF_AST_params_AudioFrameBufStatus                      // Audio frame buffer status
841 };
844 // EOF