Merge remote-tracking branch 'origin/dev_pasdk_govind_pasdk53IpDataDebug' into dev_pa...
[processor-sdk/performance-audio-sr.git] / pasdk / test_dsp / framework / itopo / params.c
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 // 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 //
59 // Framework Declarations
60 //
62 //#define PAF_AST_params_fxnsPA PAF_AST_params_fxnsPA17
64 //
65 // Audio Data Representation Definitions
66 //
67 //   External declarations to patched IROM provide standard functionality.
68 //
70 /* audio frame "width" in channels */
72 const SmInt PAF_AST_params_numchan[1] =
73 {
74     32,
75 };
77 ///
78 // Audio Stream Processing Function Table Definition
79 //
81 const PAF_AudioFunctions PAF_AST_params_audioFrameFunctions =
82 {
83     &PAF_ASP_dB2ToLinear,
84     &PAF_ASP_channelMask,
85     &PAF_ASP_programFormat,
86     &PAF_ASP_sampleRateHz,
87     &PAF_ASP_delay,
88 };
90 //
91 // Source Select Array Declarations -- algorithm keys & sio map
92 //
93 //   External declarations to patched IROM provide standard functionality.
94 //
96 const PAF_ASP_AlgKey PAF_ASP_params_decAlgKey =
97 {
98     PAF_SOURCE_N,                                           // length
99     /* Relies on the fact that ACP_SERIES_* != 0 here */
100     0,                                                      // PAF_SOURCE_UNKNOWN
101     0,                                                      // PAF_SOURCE_NONE
102     0,                                                      // PAF_SOURCE_PASS
103     PAF_ASP_ALPHACODE (STD, SNG),                           // PAF_SOURCE_SNG
104     0,                                                      // PAF_SOURCE_AUTO
105     0,                                                      // PAF_SOURCE_BITSTREAM
106     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTSALL
107     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCMAUTO
108     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCM
109     PAF_ASP_ALPHACODE (STD, PCN),                           // PAF_SOURCE_PC8 /* unused */
110     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_AC3
111     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS
112     PAF_ASP_ALPHACODE (STD, AAC),                           // PAF_SOURCE_AAC
113     PAF_ASP_ALPHACODE (STD, MPG),                           // PAF_SOURCE_MPEG /* unused */
114     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS12
115     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS13
116     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS14
117     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS16
118     0,                                                      // PAF_SOURCE_WMA9PRO
119     0,                                                      // PAF_SOURCE_MP3
120     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD1
121     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD2
122     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD3
123     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_DDP
124     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTSHD
125     PAF_ASP_ALPHACODE (STD, THD),                           // PAF_SOURCE_THD
126     PAF_ASP_ALPHACODE (STD, DXP),                           // PAF_SOURCE_DXP
127 };
129 const PAF_ASP_AlgKey PAF_ASP_params_encAlgKey =
131     PAF_SOURCE_N,                                           // length
132     /* Relies on the fact that ACP_SERIES_* != 0 here */
133     0,                                                      // PAF_SOURCE_UNKNOWN
134     0,                                                      // PAF_SOURCE_NONE
135     0,                                                      // PAF_SOURCE_PASS
136     0,                                                      // PAF_SOURCE_SNG
137     0,                                                      // PAF_SOURCE_AUTO
138     0,                                                      // PAF_SOURCE_BITSTREAM
139     0,                                                      // PAF_SOURCE_DTSALL
140     0,                                                      // PAF_SOURCE_PCMAUTO
141     PAF_ASP_ALPHACODE (STD, PCE),                           // PAF_SOURCE_PCM
142     0,                                                      // PAF_SOURCE_PC8
143     0,                                                      // PAF_SOURCE_AC3
144     0,                                                      // PAF_SOURCE_DTS
145     0,                                                      // PAF_SOURCE_AAC
146     0,                                                      // PAF_SOURCE_MPEG
147     0,                                                      // PAF_SOURCE_DTS12
148     0,                                                      // PAF_SOURCE_DTS13
149     0,                                                      // PAF_SOURCE_DTS14
150     0,                                                      // PAF_SOURCE_DTS16
151     0,                                                      // PAF_SOURCE_WMA9PRO
152     PAF_ASP_ALPHACODE (STD, MPE),                           // PAF_SOURCE_MP3
153     0,                                                      // PAF_SOURCE_DSD1
154     0,                                                      // PAF_SOURCE_DSD2
155     0                                                       // PAF_SOURCE_DSD3
156 };
158 const PAF_ASP_SioMap PAF_ASP_params_decSioMap =
160     PAF_SOURCE_N,                                           // length
161     PAF_SOURCE_UNKNOWN,                                     // PAF_SOURCE_UNKNOWN -> ...
162     PAF_SOURCE_NONE,                                        // PAF_SOURCE_NONE -> ...
163     PAF_SOURCE_PASS,                                        // PAF_SOURCE_PASS -> ...
164     PAF_SOURCE_PCM,                                         // PAF_SOURCE_SNG -> PCM
165     PAF_SOURCE_AUTO,                                        // PAF_SOURCE_AUTO -> ...
166     PAF_SOURCE_BITSTREAM,                                   // PAF_SOURCE_BITSTREAM -> ...
167     PAF_SOURCE_DTSALL,                                      // PAF_SOURCE_UNUSED1 -> ...
168     PAF_SOURCE_PCMAUTO,                                     // PAF_SOURCE_UNUSED2 -> ...
169     PAF_SOURCE_PCM,                                         // PAF_SOURCE_PCM -> ...
170     PAF_SOURCE_PC8,                                         // PAF_SOURCE_PC8 -> ...
171     PAF_SOURCE_AC3,                                         // PAF_SOURCE_AC3 -> ...
172     PAF_SOURCE_DTS,                                         // PAF_SOURCE_DTS -> ...
173     PAF_SOURCE_AAC,                                         // PAF_SOURCE_AAC -> ...
174     PAF_SOURCE_MPEG,                                        // PAF_SOURCE_MPEG -> ...
175     PAF_SOURCE_DTS12,                                       // PAF_SOURCE_DTS12 -> ...
176     PAF_SOURCE_DTS13,                                       // PAF_SOURCE_DTS13 -> ...
177     PAF_SOURCE_DTS14,                                       // PAF_SOURCE_DTS14 -> ...
178     PAF_SOURCE_DTS16,                                       // PAF_SOURCE_DTS16 -> ...
179     PAF_SOURCE_WMA9PRO,                                     // PAF_SOURCE_WMA9PRO -> ...
180     PAF_SOURCE_MP3,                                         // PAF_SOURCE_MP3 -> ...
181     PAF_SOURCE_DSD1,                                        // PAF_SOURCE_DSD1 -> ...
182     PAF_SOURCE_DSD2,                                        // PAF_SOURCE_DSD2 -> ...
183     PAF_SOURCE_DSD3,                                        // PAF_SOURCE_DSD3 -> ...
184     PAF_SOURCE_DDP,                                         // PAF_SOURCE_DDP -> ...
185     PAF_SOURCE_DTSHD,                                       // PAF_SOURCE_DTSHD -> ...
186     PAF_SOURCE_THD,                                         // PAF_SOURCE_THD -> ...
187     PAF_SOURCE_DXP,                                         // PAF_SOURCE_DXP -> ...
188 };
190 //
191 // Mapping Declarations -- from *coders to *puts
192 //
193 //   External declarations to patched IROM provide standard functionality.
194 //
195 const SmInt PAF_AST_streamsFromDecodes_std[DECODEN_MAX] =
197     0, 1, 2,
198 };
199 const SmInt PAF_AST_streamsFromEncodes_std[ENCODEN_MAX] =
201     0, 1, 2,
202 };
203 const SmInt PAF_AST_inputsFromDecodes_std[DECODEN_MAX] =
205     0, 1, 2,
206 };
207 extern const SmInt PAF_AST_outputsFromEncodes_std[ENCODEN_MAX];
208 #ifndef __TI_EABI__
209 asm ("_PAF_AST_outputsFromEncodes_std .set _PAF_AST_inputsFromDecodes_std");
210 #else
211 asm ("PAF_AST_outputsFromEncodes_std .set PAF_AST_inputsFromDecodes_std");
212 #endif
214 //
215 // Setting of audio stream order
216 //
218 const SmInt PAF_AST_streamOrder[1] =
220     0,
221 };
223 //
224 // Audio Framework Initialization Function Table Declarations
225 //
226 //   External declarations to patched IROM provide standard functionality.
227 //
229 extern const PAF_ASIT_Fxns PAF_ASIT_params_fxns;
231 //
232 // Audio Framework Status Initialization Declarations
233 //
234 //   External declarations to patched IROM provide standard functionality.
235 //
237 const PAF_InpBufStatus PAF_AST_params_inpBufStatus =
239     sizeof (PAF_InpBufStatus),                              // size
240     0,                                                      // mode
241     0,                                                      // sioSelect
242     0x80,                                                   // lockOverride = none
243     0,                                                      // unused
244     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateOverride
245     PAF_SAMPLERATE_NONE,                                    // sampleRateData
246     PAF_SAMPLERATE_NONE,                                    // sampleRateMeasured
247     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateStatus
248     PAF_IEC_AUDIOMODE_UNKNOWN,                              // nonaudio
249     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasisData
250     0,                                                      // emphasisOverride
251     PAF_IEC_PREEMPHASIS_NO,                                 // emphasisStatus
252     0,                                                      // lock
253     0,                                                      // scanAtHighSampleRateMode
254     0,                                                      // zeroRun
255     0,                                                      // unused2[1] // FL: rateTrackMode
256     24,                                                     // precisionDefault
257     -1,                                                     // precisionDetect
258     0,                                                      // precisionOverride
259     0,                                                      // precisionInput
260     100,                                                    // zeroRunTrigger
261     100,                                                    // zeroRunRestart
262     2048,                                                   // unknownTimeout
263     0,                                                      // lastFrameMask
264     0,                                                      // lastFrameFlag
265     0,                                                      // reportDTS16AsDTSForLargeSampleRate
266     0, 0                                                    // reserved
267 };
269 #if 0 // FL: slave
270 const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary =
272     sizeof (PAF_DecodeStatus),                              // size
273     1,                                                      // mode
274     0,                                                      // unused1
275     0,                                                      // command.action
276     0,                                                      // command.result
277     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
278     PAF_SOURCE_NONE,                                        // sourceSelect
279     PAF_SOURCE_UNKNOWN,                                     // sourceProgram
280     PAF_SOURCE_UNKNOWN,                                     // sourceDecode
281     PAF_SOURCE_DUAL_STEREO,                                 // sourceDual
282     4,                                                      // sourceKaraoke: both
283     0,                                                      // aspGearControl: unused
284     0,                                                      // aspGearStatus: unused
285     0, 0, 0, 0,                                             // Unused
286     0, 0, 0, 0,                                             // Unused
287     0, 0, 0, 0,                                             // Unused
288     0, 0, 0, 0,                                             // Unused
289     0, 0, 0, 0,                                             // Unused
290     0,                                                      // frameCount
291     0x40,                                                   // karaoka: Vocal 1 Level
292     0x40,                                                   // karaoka: Vocal 1 Pan
293     0x40,                                                   // karaoka: Vocal 2 Level
294     0xc0,                                                   // karaoka: Vocal 2 Pan
295     0x40,                                                   // karaoka: Melody Level
296     0x00,                                                   // karaoka: Melody Pan
297     0,                                                      // decBypass
298     0,                                                      // unused
299     0,                                                      // frameLength: reset later
300     1,                                                      // bufferRatio: unity
301     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasis
302     0,                                                      // bufferDrift
303     0, 0,
304     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0, 0, 0, 0, 0,    
305     // channelConfigurationRequest.full
306     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
307     // channelConfigurationProgram.full
308     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
309     // channelConfigurationDecode.full
310     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
311     // channelConfigurationDownmix.full
312     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
313     // channelConfigurationOverride.full 
314     -3,                                                     // channelMap.from[0]
315     -3,                                                     // channelMap.from[1]
316     -3,                                                     // channelMap.from[2]
317     -3,                                                     // channelMap.from[3]
318     -3,                                                     // channelMap.from[4]
319     -3,                                                     // channelMap.from[5]
320     -3,                                                     // channelMap.from[6]
321     -3,                                                     // channelMap.from[7]
322     -3,                                                     // channelMap.from[8]
323     -3,                                                     // channelMap.from[9]
324     -3,                                                     // channelMap.from[10]
325     -3,                                                     // channelMap.from[11]
326     -3,                                                     // channelMap.from[12]
327     -3,                                                     // channelMap.from[13]
328     -3,                                                     // channelMap.from[14]
329     -3,                                                     // channelMap.from[15]
330     -3,                                                     // channelMap.from[16]
331     -3,                                                     // channelMap.from[17]
332     -3,                                                     // channelMap.from[18]
333     -3,                                                     // channelMap.from[19]
334     -3,                                                     // channelMap.from[20]
335     -3,                                                     // channelMap.from[21]
336     -3,                                                     // channelMap.from[22]
337     -3,                                                     // channelMap.from[23]
338     -3,                                                     // channelMap.from[24]
339     -3,                                                     // channelMap.from[25]
340     -3,                                                     // channelMap.from[26]
341     -3,                                                     // channelMap.from[27]
342     -3,                                                     // channelMap.from[28]
343     -3,                                                     // channelMap.from[29]
344     -3,                                                     // channelMap.from[30]
345     -3,                                                     // channelMap.from[31]
346     -3,                                                     // channelMap.to[0]
347     -3,                                                     // channelMap.to[1]
348     -3,                                                     // channelMap.to[2]
349     -3,                                                     // channelMap.to[3]
350     -3,                                                     // channelMap.to[4]
351     -3,                                                     // channelMap.to[5]
352     -3,                                                     // channelMap.to[6]
353     -3,                                                     // channelMap.to[7]
354     -3,                                                     // channelMap.to[8]
355     -3,                                                     // channelMap.to[9]
356     -3,                                                     // channelMap.to[10]
357     -3,                                                     // channelMap.to[11]
358     -3,                                                     // channelMap.to[12]
359     -3,                                                     // channelMap.to[13]
360     -3,                                                     // channelMap.to[14]
361     -3,                                                     // channelMap.to[15]
362     -3,                                                     // channelMap.to[16]
363     -3,                                                     // channelMap.to[17]
364     -3,                                                     // channelMap.to[18]
365     -3,                                                     // channelMap.to[19]
366     -3,                                                     // channelMap.to[20]
367     -3,                                                     // channelMap.to[21]
368     -3,                                                     // channelMap.to[22]
369     -3,                                                     // channelMap.to[23]
370     -3,                                                     // channelMap.to[24]
371     -3,                                                     // channelMap.to[25]
372     -3,                                                     // channelMap.to[26]
373     -3,                                                     // channelMap.to[27]
374     -3,                                                     // channelMap.to[28]
375     -3,                                                     // channelMap.to[29]
376     -3,                                                     // channelMap.to[30]
377     -3,                                                     // channelMap.to[31]
378     0,                                                      // programFormat.mask
379     0,                                                      // programFormat.form
380    
381 };
382 const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[] =
384     &PAF_AST_params_decodeStatus_primary,
385 };
386 #endif // #if 0
388 const PAF_OutBufStatus PAF_AST_params_outBufStatus =
390     sizeof (PAF_OutBufStatus),                              // size
391     1,                                                      // mode
392     0,                                                      // sioSelect
393     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
394     0,                                                      // audio
395     PAF_OB_CLOCK_INTERNAL,                                  // clock
396     PAF_OB_FLUSH_ENABLE,                                    // flush
397     0,                                                      // unused[2] // FL: rateTrackMode
398     0,                                                      // PAF_OB_MARKER_ENABLED // FL: markerMode
399     0                                                       // FL: maxNumBufOverride
400                                                             // FL: (*** ?) missing init. values for numBufOverride[PAF_SOURCE_N]
401 };
403 const PAF_EncodeStatus PAF_AST_params_encodeStatus_primary =
405     sizeof (PAF_EncodeStatus),                              // size
406     1,                                                      // mode
407     0,                                                      // unused1
408     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
409     0,                                                      // channelCount
410     0, 0, 0, 0,                                             // Unused                                        
411     0, 0, 0, 0,                                             // Unused
412     0, 0, 0, 0,                                             // Unused
413     0, 0, 0, 0,                                             // Unused
414     0, 0, 0, 0,                                             // Unused
415     0,                                                      // frameLength
416     0,                                                      // encBypass
417     PAF_SOURCE_PCM,                                         // select
418     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0,0,0,0,0,
419     // channelConfigurationRequest.full
420     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
421     // channelConfigurationStream.full
422     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
423     // channelConfigurationEncode.full
424     0, 0, 0, 0,    0, 0, 0, 0,                              // Unused
425     -3,                                                     // channelMap.from[0]
426     -3,                                                     // channelMap.from[1]
427     -3,                                                     // channelMap.from[2]
428     -3,                                                     // channelMap.from[3]
429     -3,                                                     // channelMap.from[4]
430     -3,                                                     // channelMap.from[5]
431     -3,                                                     // channelMap.from[6]
432     -3,                                                     // channelMap.from[7]
433     -3,                                                     // channelMap.from[8]
434     -3,                                                     // channelMap.from[9]
435     -3,                                                     // channelMap.from[10]
436     -3,                                                     // channelMap.from[11]
437     -3,                                                     // channelMap.from[12]
438     -3,                                                     // channelMap.from[13]
439     -3,                                                     // channelMap.from[14]
440     -3,                                                     // channelMap.from[15]
441     -3,                                                     // channelMap.to[0]
442     -3,                                                     // channelMap.to[1]
443     -3,                                                     // channelMap.to[2]
444     -3,                                                     // channelMap.to[3]
445     -3,                                                     // channelMap.to[4]
446     -3,                                                     // channelMap.to[5]
447     -3,                                                     // channelMap.to[6]
448     -3,                                                     // channelMap.to[7]
449     -3,                                                     // channelMap.to[8]
450     -3,                                                     // channelMap.to[9]
451     -3,                                                     // channelMap.to[10]
452     -3,                                                     // channelMap.to[11]
453     -3,                                                     // channelMap.to[12]
454     -3,                                                     // channelMap.to[13]
455     -3,                                                     // channelMap.to[14]
456     -3,                                                     // channelMap.to[15]
457     -3,                                                     // channelMap.from[0]
458     -3,                                                     // channelMap.from[1]
459     -3,                                                     // channelMap.from[2]
460     -3,                                                     // channelMap.from[3]
461     -3,                                                     // channelMap.from[4]
462     -3,                                                     // channelMap.from[5]
463     -3,                                                     // channelMap.from[6]
464     -3,                                                     // channelMap.from[7]
465     -3,                                                     // channelMap.from[8]
466     -3,                                                     // channelMap.from[9]
467     -3,                                                     // channelMap.from[10]
468     -3,                                                     // channelMap.from[11]
469     -3,                                                     // channelMap.from[12]
470     -3,                                                     // channelMap.from[13]
471     -3,                                                     // channelMap.from[14]
472     -3,                                                     // channelMap.from[15]
473     -3,                                                     // channelMap.to[0]
474     -3,                                                     // channelMap.to[1]
475     -3,                                                     // channelMap.to[2]
476     -3,                                                     // channelMap.to[3]
477     -3,                                                     // channelMap.to[4]
478     -3,                                                     // channelMap.to[5]
479     -3,                                                     // channelMap.to[6]
480     -3,                                                     // channelMap.to[7]
481     -3,                                                     // channelMap.to[8]
482     -3,                                                     // channelMap.to[9]
483     -3,                                                     // channelMap.to[10]
484     -3,                                                     // channelMap.to[11]
485     -3,                                                     // channelMap.to[12]
486     -3,                                                     // channelMap.to[13]
487     -3,                                                     // channelMap.to[14]
488     -3,                                                     // channelMap.to[15]
489     0,                                                      // programFormat.mask
490     0,                                                      // programFormat.form
491     0,                                                      // sampleProcess[0]
492 };
496 const PAF_EncodeStatus *const PAF_AST_params_encodeStatus[] =
498     &PAF_AST_params_encodeStatus_primary,
499 };
501 const PAF_VolumeStatus PAF_AST_params_volumeStatus =
503     sizeof (PAF_VolumeStatus),                              // size
504     1,                                                      // mode
505     PAF_MAXNUMCHAN,                                         // channelCount
506     0x0f,                                                   // implementation
507     0,                                                      // unused1
508     50,                                                     // rampTime: 50 msec/dB (20 dB/sec)
509     0,                                                      // unused2
510     0,                                                      // unused3
511     -2 * 20, 0, 0, 0,                                       // master
512     -2 * 0, 0, 0, 0,                                        // trim
513     -2 * 0, 0, 0, 0,                                        //
514     -2 * 0, 0, 0, 0,                                        //
515     -2 * 0, 0, 0, 0,                                        //
516     -2 * 0, 0, 0, 0,                                        //
517     -2 * 0, 0, 0, 0,                                        //
518     -2 * 0, 0, 0, 0,                                        //
519     -2 * 0, 0, 0, 0,                                        //
520     -2 * 0, 0, 0, 0,                                        //
521     -2 * 0, 0, 0, 0,                                        //
522     -2 * 0, 0, 0, 0,                                        //
523     -2 * 0, 0, 0, 0,                                        //
524     -2 * 0, 0, 0, 0,                                        //
525     -2 * 0, 0, 0, 0,                                        //
526     -2 * 0, 0, 0, 0,                                        //
527     -2 * 0, 0, 0, 0,                                        //  
528     -2 * 0, 0, 0, 0,                                        // trim - upper16
529     -2 * 0, 0, 0, 0,                                        //
530     -2 * 0, 0, 0, 0,                                        //
531     -2 * 0, 0, 0, 0,                                        //
532     -2 * 0, 0, 0, 0,                                        //
533     -2 * 0, 0, 0, 0,                                        //
534     -2 * 0, 0, 0, 0,                                        //
535     -2 * 0, 0, 0, 0,                                        //
536     -2 * 0, 0, 0, 0,                                        //
537     -2 * 0, 0, 0, 0,                                        //
538     -2 * 0, 0, 0, 0,                                        //
539     -2 * 0, 0, 0, 0,                                        //
540     -2 * 0, 0, 0, 0,                                        //
541     -2 * 0, 0, 0, 0,                                        //
542     -2 * 0, 0, 0, 0,                                        //
543     -2 * 0, 0, 0, 0,                                        //
545 };
547 //
548 // Common Space Parameter Declarations and Definitions
549 //
550 //   Local definitions in RAM provide non-standard functionality.
551 //   The NULL pointer provides standard functionality.
552 //
554 /* baseline definition - NULL equivalent */
555 /* May be used for overrides of IALG_MemSpace */
557 static const IALG_MemSpace params_memspace_PAi[] = {
558     PAF_IALG_NONE,                                          // Scratch
559     PAF_IALG_NONE,                                          // Persistant
560     PAF_IALG_NONE,                                          // Write once
561     PAF_IALG_NONE,                                          // Common 1
562     PAF_IALG_NONE,                                          // Common 2
563     PAF_IALG_NONE,                                          // Common 3
564     PAF_IALG_NONE,                                          // Common 4
565     PAF_IALG_NONE,                                          // Common 5
566     PAF_IALG_NONE,                                          // Common 6
567     PAF_IALG_NONE,                                          // Common 7
568     IALG_EXTERNAL,                                          // Common 8
569     PAF_IALG_NONE,                                          // Common 9
570     PAF_IALG_NONE,                                          // Common 10
571     PAF_IALG_NONE,                                          // Common 11
572     PAF_IALG_NONE,                                          // Common 12
573     PAF_IALG_NONE,                                          // Common 13
574     PAF_IALG_NONE,                                          // Common 14
575     PAF_IALG_NONE,                                          // Common 15
576 };
578 //
579 // Heap Declarations
580 //
582 //#include <pafhjt.h>
584 //extern int IRAM;
585 //extern int SDRAM;
586 //extern int L3RAM;
588 // .............................................................................
589 // DIB memory requirements
591 // primary input
592 // IALG_SARAM_SHM: MSMC shared memory heap
593 // IALG_EXTERNAL_SHM: DDR shared memory heap
594 const IALG_MemRec inpMemTabPrimary[] =
596     // SDRAM circular buffer
597     // 2 buffers * 256 samples/buffer * 8 words/sample * 3 bytes/word
598     {
599         (3 * 60 * 1024) + 2,                                    // size 184320 + 1 16-bit word for EDMA padding // GJ Debug.
600         //180 * 1024,                                           // size
601         //6 * 60 * 1024,                                        // size
602         128,                                                    // alignment
603                 IALG_SARAM_SHM, //IALG_EXTERNAL_SHM, //IALG_SARAM2, //IALG_SARAM1, //IALG_EXTERNAL,                           // space
604         IALG_PERSIST,                                           // attrs
605         NULL,                                                   // base
606      },
608          // GJ Debug: The below is not required; hence 0
610 #if 0
611         // IRAM scratch memory for autodetection and stereo PCM input
612     // High watermark needs are set by the latter:
613     // double buffer stereo 32bit PCM input 512 max frame size
614     // 1 buffers * 512 samples/buffer * 2 words/sample * 4 bytes/word
615     {
616         0 * 1024,                                              // size
617         128,                                                   // alignment
618                 IALG_EXTERNAL_SHM,                                            // space
619         IALG_SCRATCH,                                          // attrs
620         NULL,                                                  // base
621     }
622 #endif
624 };
626 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
628     1,
629     inpMemTabPrimary
630 };
632 const PAF_ASP_LinkInit inpLinkInitPrimary[] =
634     PAF_ASP_LINKINITPARAMS (STD, IB, TIH, &inpSioAlgParamsPrimary),
635     PAF_ASP_LINKNONE
636 };
638 const PAF_ASP_LinkInit *const inpLinkInit[] =
640     inpLinkInitPrimary
641 };
643 // .............................................................................
644 // DOB memory requirements
646 // primary output
647 const IALG_MemRec outMemTabPrimary[] =
649     // SDRAM buffer
650     // 4 buffers * 256 samples * 32 ch * 4 bytes
651         {
652             4 * 256 * 32 * 4,                                      // size: note:
653             //6 * 256 * 32 * 4,                                      // size: note:
654             //16 * 256 * 32 * 4,                                      // size: note:
655             128,                                                   // alignment
656             IALG_EXTERNAL,                                         // space
657             IALG_PERSIST,                                          // attrs
658             NULL,                                                  // base
659         }
660 };
663 const PAF_SIO_IALG_Params outSioAlgParamsPrimary =
665     1,
666     outMemTabPrimary
667 };
669 const PAF_ASP_LinkInit outLinkInitPrimary[] =
671     PAF_ASP_LINKINITPARAMS (STD, OB, TIH, &outSioAlgParamsPrimary),
672     PAF_ASP_LINKNONE
673 };
675 const PAF_ASP_LinkInit * const outLinkInit[] =
677     outLinkInitPrimary,
678 };
681 // .............................................................................
682 // sourceProgram mapped to DOB num of buffers
683 const PAF_ASP_outNumBufMap outPrimaryNumBufMap =
685     4,                                                      // maxNumBuf
686 //    6,                                                      // maxNumBuf
687 //    16,                                                      // maxNumBuf
688     PAF_SOURCE_N,                                           // length
689     0,                                                      // PAF_SOURCE_UNKNOWN
690     0,                                                      // PAF_SOURCE_NONE
691     2,                                                      // PAF_SOURCE_PASS
692     2,                                                      // PAF_SOURCE_SNG
693     0,                                                      // PAF_SOURCE_AUTO
694     0,                                                      // PAF_SOURCE_BITSTREAM
695     0,                                                      // PAF_SOURCE_DTSALL
696     0,                                                      // PAF_SOURCE_PCMAUTO
697     2,                                                      // PAF_SOURCE_PCM
698     0,                                                      // PAF_SOURCE_PC8
699     2,                                                      // PAF_SOURCE_AC3
700     2,                                                      // PAF_SOURCE_DTS
701     2,                                                      // PAF_SOURCE_AAC
702     0,                                                      // PAF_SOURCE_MPEG
703     2,                                                      // PAF_SOURCE_DTS12
704     2,                                                      // PAF_SOURCE_DTS13
705     2,                                                      // PAF_SOURCE_DTS14
706     2,                                                      // PAF_SOURCE_DTS16
707     0,                                                      // PAF_SOURCE_WMA9PRO
708     0,                                                      // PAF_SOURCE_MP3
709     2,                                                      // PAF_SOURCE_DSD1,
710     2,                                                      // PAF_SOURCE_DSD2,
711     2,                                                      // PAF_SOURCE_DSD3,
712     4,                                                      // PAF_SOURCE_DDP
713     4,                                                      // PAF_SOURCE_DTSHD
714     4,                                                      // PAF_SOURCE_THD
715 //    6,                                                      // PAF_SOURCE_THD
716 //    16,                                                      // PAF_SOURCE_THD
717     4,                                                      // PAF_SOURCE_DXP
719 };
721 const PAF_ASP_outNumBufMap *const outNumBufMap[] =
723     &outPrimaryNumBufMap,
724 };
726 // .............................................................................
727 const PAF_MetadataBufStatus PAF_AST_params_MetadataBufStatus[] =
729     PAF_MAX_PRIVATE_MD_SZ,  // bufSize
730     PAF_MAX_NUM_PRIVATE_MD, // NumBuf
731     128,                    // alignment
732     &gPafHeapIdExt //&SDRAM // &IRAM,        // pSpace
733 };
735 // .............................................................................
736 //
737 // This structure defines the memory allocation of audio frame buffers (channel buffers). Users can customize this structure based
738 // on their requirement. IALG_SARAM specifies the audio frame buffer is allocated in IRAM and IALG_EXTERNAL
739 // specifies the audio frame buffer is allocated in SDRAM. By allocating few channel buffers in SDRAM, users can save internal memory
740 // but trading performance
741 // This structure defined for PAF_MAXNUMCHAN number of channels. But channel buffers will be allocated  for "PAF_AST_params_numchan"
742 // number of channels only.
743 //
745 const PAF_AudioFrameBufStatus    PAF_AST_params_AudioFrameBufStatus[PAF_MAXNUMCHAN] =
747     IALG_SARAM, // 0
748     IALG_SARAM,
749     IALG_SARAM,
750     IALG_SARAM,
751     IALG_SARAM,
752     IALG_SARAM,
753     IALG_SARAM,
754     IALG_SARAM,
755     IALG_SARAM,
756     IALG_SARAM,
757     IALG_SARAM,
758     IALG_SARAM,
759     IALG_SARAM,
760     IALG_SARAM,
761     IALG_SARAM,
762     IALG_SARAM,
763     IALG_SARAM, // 16
764     IALG_SARAM,
765     IALG_SARAM,
766     IALG_SARAM,
767     IALG_SARAM,
768     IALG_SARAM,
769     IALG_SARAM,
770     IALG_SARAM,
771     IALG_SARAM,
772     IALG_SARAM,
773     IALG_SARAM,
774     IALG_SARAM,
775     IALG_SARAM,
776     IALG_SARAM,
777     IALG_SARAM,
778     IALG_SARAM, // 31
779     //IALG_EXTERNAL, // 16
780     //IALG_EXTERNAL,
781     //IALG_EXTERNAL,
782     //IALG_EXTERNAL,
783     //IALG_EXTERNAL,
784     //IALG_EXTERNAL,
785     //IALG_EXTERNAL,
786     //IALG_EXTERNAL,
787     //IALG_EXTERNAL,
788     //IALG_EXTERNAL,
789     //IALG_EXTERNAL,
790     //IALG_EXTERNAL,
791     //IALG_EXTERNAL,
792     //IALG_EXTERNAL,
793     //IALG_EXTERNAL,
794     //IALG_EXTERNAL // 31
795 };
797 //(***) FL: re-visit, clean this up (remove unused members)
798 // .............................................................................
799 //
800 // Audio Stream Parameter Definitions
801 //
802 //   Global definition in RAM provides standard & non-standard functionality.
803 //
805 const PAF_ASIT_Params asip_params_PAi =
807     &PAF_ASIT_params_fxns,                                     // fxns
808     {                                                          // zone
809         0,                                                     // master
810         1,                                                     // inputs
811         0,                                                     // input1
812         1,                                                     // inputN
813         1,                                                     // decodes
814         0,                                                     // decode1
815         1,                                                     // decodeN
816         1,                                                     // streams
817         0,                                                     // stream1 /* unused */
818         1,                                                     // streamN /* unused */
819         1,                                                     // encodes
820         0,                                                     // encode1
821         1,                                                     // encodeN
822         1,                                                     // outputs
823         0,                                                     // output1
824         1,                                                     // outputN
825     },
826     PAF_AST_inputsFromDecodes_std,
827     PAF_AST_outputsFromEncodes_std,
828     {                                                       // heap
829         &gPafHeapIdInt,    //&IRAM,                         // pIntern
830         &gPafHeapIdExt,    //&SDRAM,                        // pExtern
831         &gPafHeapIdInt,    //&IRAM,                         // pInpbuf
832         &gPafHeapIdInt,    //&IRAM,                         // pOutbuf
833         &gPafHeapIdInt,    //&IRAM,                         // pFrmbuf
834         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
835         1,                                                  // clear
836     },
837     {                                                       // common
838         params_memspace_PAi,                                // space
839     },
840     NULL,                                                   // z_rx_bufsiz
841     NULL,                                                   // z_tx_bufsiz
842     PAF_AST_params_numchan,                                 // z_numchan
843     256,                                                    // framelength
844     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
845     &PAF_ASP_chainFxns,                                     // pChainFxns
846     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
847     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
848     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
849     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
850     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
851     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
852     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
853     &PAF_ASP_params_decSioMap,                              // pDecSioMap
854     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
855     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
856     256,                                                    // maxFramelength
857     PAF_AST_streamOrder,                                    // streamOrder
858     inpLinkInit,                                            // i_inpLinkInit
859     outLinkInit,                                            // i_outLinkInit
860     outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
861     PAF_AST_params_MetadataBufStatus,                       //metadata buffer status
862     PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
863 };
865 extern const PAF_ASOT_Fxns PAF_ASOT_params_fxns;
867 //(***) FL: initially a copy of asip
868 //(***) FL: re-visit, clean this up (remove unused members)
869 const PAF_ASOT_Params asop_params_PAi =
871     &PAF_ASOT_params_fxns,                                     // fxns
872     {                                                          // zone
873         0,                                                     // master
874         1,                                                     // inputs
875         0,                                                     // input1
876         1,                                                     // inputN
877         1,                                                     // decodes
878         0,                                                     // decode1
879         1,                                                     // decodeN
880         1,                                                     // streams
881         0,                                                     // stream1 /* unused */
882         1,                                                     // streamN /* unused */
883         1,                                                     // encodes
884         0,                                                     // encode1
885         1,                                                     // encodeN
886         1,                                                     // outputs
887         0,                                                     // output1
888         1,                                                     // outputN
889     },
890     PAF_AST_inputsFromDecodes_std,
891     PAF_AST_outputsFromEncodes_std,
892     {                                                       // heap
893         &gPafHeapIdInt,    //&IRAM,                         // pIntern
894         &gPafHeapIdExt,    //&SDRAM,                        // pExtern
895         &gPafHeapIdInt,    //&IRAM,                         // pInpbuf
896         &gPafHeapIdInt,    //&IRAM,                         // pOutbuf
897         &gPafHeapIdInt,    //&IRAM,                         // pFrmbuf
898         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
899         1,                                                  // clear
900     },
901     {                                                       // common
902         params_memspace_PAi,                                // space
903     },
904     NULL,                                                   // z_rx_bufsiz
905     NULL,                                                   // z_tx_bufsiz
906     PAF_AST_params_numchan,                                 // z_numchan
907     256,                                                    // framelength
908     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
909     &PAF_ASP_chainFxns,                                     // pChainFxns
910     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
911     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
912     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
913     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
914     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
915     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
916     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
917     &PAF_ASP_params_decSioMap,                              // pDecSioMap
918     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
919     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
920     256,                                                    // maxFramelength
921     PAF_AST_streamOrder,                                    // streamOrder
922     inpLinkInit,                                            // i_inpLinkInit
923     outLinkInit,                                            // i_outLinkInit
924     outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
925     PAF_AST_params_MetadataBufStatus,                       //metadata buffer status
926     PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
927 };
930 // EOF