2bbf88696f0a171a6ba0be54f470bc3677de5288
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_arm / 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>
42 //#include <ti/procsdk_audio/procsdk_audio_typ.h>
43 #include <procsdk_audio_typ.h>
45 #include <stdasp.h>
46 #include <pafsio_ialg.h>
48 #include "paf_heapMgr.h"
50 #include "asp1.h"
51 #include "audioStreamProc_params.h"
53 //
54 // Framework Declarations
55 //
57 //#define PAF_AST_params_fxnsPA PAF_AST_params_fxnsPA17
59 //
60 // Audio Data Representation Definitions
61 //
62 //   External declarations to patched IROM provide standard functionality.
63 //
65 #if 1
66 // FL: extern this, making it look like shared information between ARM/DSP.
67 // FL: Note could just define the same thing in separate file for ARM application (i.e. add "Slave" at end of identifier).
68 /* audio frame "width" in channels */
69 const SmInt PAF_AST_params_numchan[1] =
70 {
71     32,
72 };
73 #else
74 extern const SmInt PAF_AST_params_numchan[];
75 #endif
77 ///
78 // Audio Stream Processing Function Table Definition
79 //
81 const PAF_AudioFunctions PAF_ASDT_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 #if 1
97 // FL: extern this, making it look like shared information between ARM/DSP.
98 // FL: Note could just define the same thing in separate file for ARM application (i.e. add "Slave" at end of identifier).
99 const PAF_ASP_AlgKey PAF_ASP_params_decAlgKey =
101     PAF_SOURCE_N,                                           // length
102     /* Relies on the fact that ACP_SERIES_* != 0 here */
103     0,                                                      // PAF_SOURCE_UNKNOWN
104     0,                                                      // PAF_SOURCE_NONE
105     0,                                                      // PAF_SOURCE_PASS
106     PAF_ASP_ALPHACODE (STD, SNG),                           // PAF_SOURCE_SNG
107     0,                                                      // PAF_SOURCE_AUTO
108     0,                                                      // PAF_SOURCE_BITSTREAM
109     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTSALL
110     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCMAUTO
111     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCM
112     PAF_ASP_ALPHACODE (STD, PCN),                           // PAF_SOURCE_PC8 /* unused */
113     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_AC3
114     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS
115     PAF_ASP_ALPHACODE (STD, AAC),                           // PAF_SOURCE_AAC
116     PAF_ASP_ALPHACODE (STD, MPG),                           // PAF_SOURCE_MPEG /* unused */
117     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS12
118     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS13
119     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS14
120     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS16
121     0,                                                      // PAF_SOURCE_WMA9PRO
122     0,                                                      // PAF_SOURCE_MP3
123     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD1
124     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD2
125     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD3
126     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_DDP
127     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTSHD
128     PAF_ASP_ALPHACODE (STD, THD),                           // PAF_SOURCE_THD
129     PAF_ASP_ALPHACODE (STD, DXP),                           // PAF_SOURCE_DXP
130 };
131 #else
132 extern const PAF_ASP_AlgKey PAF_ASP_params_decAlgKey;
133 #endif
135 #if 0
136 const PAF_ASP_AlgKey PAF_ASP_params_encAlgKey =
138     PAF_SOURCE_N,                                           // length
139     /* Relies on the fact that ACP_SERIES_* != 0 here */
140     0,                                                      // PAF_SOURCE_UNKNOWN
141     0,                                                      // PAF_SOURCE_NONE
142     0,                                                      // PAF_SOURCE_PASS
143     0,                                                      // PAF_SOURCE_SNG
144     0,                                                      // PAF_SOURCE_AUTO
145     0,                                                      // PAF_SOURCE_BITSTREAM
146     0,                                                      // PAF_SOURCE_DTSALL
147     0,                                                      // PAF_SOURCE_PCMAUTO
148     PAF_ASP_ALPHACODE (STD, PCE),                           // PAF_SOURCE_PCM
149     0,                                                      // PAF_SOURCE_PC8
150     0,                                                      // PAF_SOURCE_AC3
151     0,                                                      // PAF_SOURCE_DTS
152     0,                                                      // PAF_SOURCE_AAC
153     0,                                                      // PAF_SOURCE_MPEG
154     0,                                                      // PAF_SOURCE_DTS12
155     0,                                                      // PAF_SOURCE_DTS13
156     0,                                                      // PAF_SOURCE_DTS14
157     0,                                                      // PAF_SOURCE_DTS16
158     0,                                                      // PAF_SOURCE_WMA9PRO
159     PAF_ASP_ALPHACODE (STD, MPE),                           // PAF_SOURCE_MP3
160     0,                                                      // PAF_SOURCE_DSD1
161     0,                                                      // PAF_SOURCE_DSD2
162     0                                                       // PAF_SOURCE_DSD3
163 };
164 #endif // FL: #if 0
166 #if 0
167 const PAF_ASP_SioMap PAF_ASP_params_decSioMap =
169     PAF_SOURCE_N,                                           // length
170     PAF_SOURCE_UNKNOWN,                                     // PAF_SOURCE_UNKNOWN -> ...
171     PAF_SOURCE_NONE,                                        // PAF_SOURCE_NONE -> ...
172     PAF_SOURCE_PASS,                                        // PAF_SOURCE_PASS -> ...
173     PAF_SOURCE_PCM,                                         // PAF_SOURCE_SNG -> PCM
174     PAF_SOURCE_AUTO,                                        // PAF_SOURCE_AUTO -> ...
175     PAF_SOURCE_BITSTREAM,                                   // PAF_SOURCE_BITSTREAM -> ...
176     PAF_SOURCE_DTSALL,                                      // PAF_SOURCE_UNUSED1 -> ...
177     PAF_SOURCE_PCMAUTO,                                     // PAF_SOURCE_UNUSED2 -> ...
178     PAF_SOURCE_PCM,                                         // PAF_SOURCE_PCM -> ...
179     PAF_SOURCE_PC8,                                         // PAF_SOURCE_PC8 -> ...
180     PAF_SOURCE_AC3,                                         // PAF_SOURCE_AC3 -> ...
181     PAF_SOURCE_DTS,                                         // PAF_SOURCE_DTS -> ...
182     PAF_SOURCE_AAC,                                         // PAF_SOURCE_AAC -> ...
183     PAF_SOURCE_MPEG,                                        // PAF_SOURCE_MPEG -> ...
184     PAF_SOURCE_DTS12,                                       // PAF_SOURCE_DTS12 -> ...
185     PAF_SOURCE_DTS13,                                       // PAF_SOURCE_DTS13 -> ...
186     PAF_SOURCE_DTS14,                                       // PAF_SOURCE_DTS14 -> ...
187     PAF_SOURCE_DTS16,                                       // PAF_SOURCE_DTS16 -> ...
188     PAF_SOURCE_WMA9PRO,                                     // PAF_SOURCE_WMA9PRO -> ...
189     PAF_SOURCE_MP3,                                         // PAF_SOURCE_MP3 -> ...
190     PAF_SOURCE_DSD1,                                        // PAF_SOURCE_DSD1 -> ...
191     PAF_SOURCE_DSD2,                                        // PAF_SOURCE_DSD2 -> ...
192     PAF_SOURCE_DSD3,                                        // PAF_SOURCE_DSD3 -> ...
193     PAF_SOURCE_DDP,                                         // PAF_SOURCE_DDP -> ...
194     PAF_SOURCE_DTSHD,                                       // PAF_SOURCE_DTSHD -> ...
195     PAF_SOURCE_THD,                                         // PAF_SOURCE_THD -> ...
196     PAF_SOURCE_DXP,                                         // PAF_SOURCE_DXP -> ...
197 };
198 #endif // FL: #if 0
200 #if 1
201 // FL: This MUST be shared between ARM/DSP.
202 // FL: extern this, making it look like shared information between ARM/DSP.
203 //
204 // Mapping Declarations -- from *coders to *puts
205 //
206 //   External declarations to patched IROM provide standard functionality.
207 //
208 const SmInt PAF_AST_streamsFromDecodes_std[DECODEN_MAX] =
210     0, 1, 2,
211 };
212 #else
213 extern const SmInt PAF_AST_streamsFromDecodes_std[DECODEN_MAX];
214 #endif
216 #if 0
217 const SmInt PAF_AST_streamsFromEncodes_std[ENCODEN_MAX] =
219     0, 1, 2,
220 };
221 #endif
223 const SmInt PAF_AST_inputsFromDecodes_std[DECODEN_MAX] =
225     0, 1, 2,
226 };
228 #if 0
229 extern const SmInt PAF_AST_outputsFromEncodes_std[ENCODEN_MAX];
230 #ifndef __TI_EABI__
231 asm ("_PAF_AST_outputsFromEncodes_std .set _PAF_AST_inputsFromDecodes_std");
232 #else
233 asm ("PAF_AST_outputsFromEncodes_std .set PAF_AST_inputsFromDecodes_std");
234 #endif
236 #endif // FL: #if 0
238 #if 0
239 //
240 // Setting of audio stream order
241 //
243 const SmInt PAF_AST_streamOrder[1] =
245     0,
246 };
247 #endif // FL: #if 0
249 //
250 // Audio Framework Initialization Function Table Declarations
251 //
252 //   External declarations to patched IROM provide standard functionality.
253 //
255 extern const PAF_AST_Fxns PAF_ASDT_params_fxns;
257 #if 0
258 //
259 // Audio Framework Status Initialization Declarations
260 //
261 //   External declarations to patched IROM provide standard functionality.
262 //
264 const PAF_InpBufStatus PAF_AST_params_inpBufStatus =
266     sizeof (PAF_InpBufStatus),                              // size
267     0,                                                      // mode
268     0,                                                      // sioSelect
269     0x80,                                                   // lockOverride = none
270     0,                                                      // unused
271     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateOverride
272     PAF_SAMPLERATE_NONE,                                    // sampleRateData
273     PAF_SAMPLERATE_NONE,                                    // sampleRateMeasured
274     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateStatus
275     PAF_IEC_AUDIOMODE_UNKNOWN,                              // nonaudio
276     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasisData
277     0,                                                      // emphasisOverride
278     PAF_IEC_PREEMPHASIS_NO,                                 // emphasisStatus
279     0,                                                      // lock
280     0,                                                      // scanAtHighSampleRateMode
281     0,                                                      // zeroRun
282     0,                                                      // unused2[1] // FL: rateTrackMode
283     24,                                                     // precisionDefault
284     -1,                                                     // precisionDetect
285     0,                                                      // precisionOverride
286     0,                                                      // precisionInput
287     100,                                                    // zeroRunTrigger
288     100,                                                    // zeroRunRestart
289     2048,                                                   // unknownTimeout
290     0,                                                      // lastFrameMask
291     0,                                                      // lastFrameFlag
292     0,                                                      // reportDTS16AsDTSForLargeSampleRate
293     0, 0                                                    // reserved
294 };
295 #endif // FL: #if 0
297 #if 1
298 // FL: This MUST be shared between ARM/DSP.
299 // FL: extern this, making it look like shared information between ARM/DSP.
300 const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary =
302     sizeof (PAF_DecodeStatus),                              // size
303     1,                                                      // mode
304     0,                                                      // unused1
305     0,                                                      // command.action
306     0,                                                      // command.result
307     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
308     PAF_SOURCE_NONE,                                        // sourceSelect
309     PAF_SOURCE_UNKNOWN,                                     // sourceProgram
310     PAF_SOURCE_UNKNOWN,                                     // sourceDecode
311     PAF_SOURCE_DUAL_STEREO,                                 // sourceDual
312     4,                                                      // sourceKaraoke: both
313     0,                                                      // aspGearControl: unused
314     0,                                                      // aspGearStatus: unused
315     0, 0, 0, 0,                                                // Unused
316     0, 0, 0, 0,                                                // Unused
317     0, 0, 0, 0,                                                // Unused
318     0, 0, 0, 0,                                                // Unused
319     0, 0, 0, 0,                                                // Unused
320     0,                                                      // frameCount
321     0x40,                                                   // karaoka: Vocal 1 Level
322     0x40,                                                   // karaoka: Vocal 1 Pan
323     0x40,                                                   // karaoka: Vocal 2 Level
324     0xc0,                                                   // karaoka: Vocal 2 Pan
325     0x40,                                                   // karaoka: Melody Level
326     0x00,                                                   // karaoka: Melody Pan
327     0,                                                      // decBypass
328     0,                                                      // unused
329     0,                                                         // frameLength: reset later
330     1,                                                      // bufferRatio: unity
331     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasis
332     0,                                                        // bufferDrift
333     0, 0,
334     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0, 0, 0, 0, 0,    
335     // channelConfigurationRequest.full
336     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
337     // channelConfigurationProgram.full
338     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
339     // channelConfigurationDecode.full
340     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
341     // channelConfigurationDownmix.full
342     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
343     // channelConfigurationOverride.full 
344     -3,                                                     // channelMap.from[0]
345     -3,                                                     // channelMap.from[1]
346     -3,                                                     // channelMap.from[2]
347     -3,                                                     // channelMap.from[3]
348     -3,                                                     // channelMap.from[4]
349     -3,                                                     // channelMap.from[5]
350     -3,                                                     // channelMap.from[6]
351     -3,                                                     // channelMap.from[7]
352     -3,                                                     // channelMap.from[8]
353     -3,                                                     // channelMap.from[9]
354     -3,                                                     // channelMap.from[10]
355     -3,                                                     // channelMap.from[11]
356     -3,                                                     // channelMap.from[12]
357     -3,                                                     // channelMap.from[13]
358     -3,                                                     // channelMap.from[14]
359     -3,                                                     // channelMap.from[15]
360     -3,                                                     // channelMap.from[16]
361     -3,                                                     // channelMap.from[17]
362     -3,                                                     // channelMap.from[18]
363     -3,                                                     // channelMap.from[19]
364     -3,                                                     // channelMap.from[20]
365     -3,                                                     // channelMap.from[21]
366     -3,                                                     // channelMap.from[22]
367     -3,                                                     // channelMap.from[23]
368     -3,                                                     // channelMap.from[24]
369     -3,                                                     // channelMap.from[25]
370     -3,                                                     // channelMap.from[26]
371     -3,                                                     // channelMap.from[27]
372     -3,                                                     // channelMap.from[28]
373     -3,                                                     // channelMap.from[29]
374     -3,                                                     // channelMap.from[30]
375     -3,                                                     // channelMap.from[31]
376     -3,                                                     // channelMap.to[0]
377     -3,                                                     // channelMap.to[1]
378     -3,                                                     // channelMap.to[2]
379     -3,                                                     // channelMap.to[3]
380     -3,                                                     // channelMap.to[4]
381     -3,                                                     // channelMap.to[5]
382     -3,                                                     // channelMap.to[6]
383     -3,                                                     // channelMap.to[7]
384     -3,                                                     // channelMap.to[8]
385     -3,                                                     // channelMap.to[9]
386     -3,                                                     // channelMap.to[10]
387     -3,                                                     // channelMap.to[11]
388     -3,                                                     // channelMap.to[12]
389     -3,                                                     // channelMap.to[13]
390     -3,                                                     // channelMap.to[14]
391     -3,                                                     // channelMap.to[15]
392     -3,                                                     // channelMap.to[16]
393     -3,                                                     // channelMap.to[17]
394     -3,                                                     // channelMap.to[18]
395     -3,                                                     // channelMap.to[19]
396     -3,                                                     // channelMap.to[20]
397     -3,                                                     // channelMap.to[21]
398     -3,                                                     // channelMap.to[22]
399     -3,                                                     // channelMap.to[23]
400     -3,                                                     // channelMap.to[24]
401     -3,                                                     // channelMap.to[25]
402     -3,                                                     // channelMap.to[26]
403     -3,                                                     // channelMap.to[27]
404     -3,                                                     // channelMap.to[28]
405     -3,                                                     // channelMap.to[29]
406     -3,                                                     // channelMap.to[30]
407     -3,                                                     // channelMap.to[31]
408     0,                                                      // programFormat.mask
409     0,                                                      // programFormat.form
410    
411 };
412 #else
413 //extern const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary;
414 #endif
416 #if 1
417 // FL: extern this, making it look like shared information between ARM/DSP.
418 // FL: Note could just define the same thing in separate file for ARM application (i.e. add "Slave" at end of identifier).
419 /* audio frame "width" in channels */
420 const PAF_DecodeStatus *const PAF_ASDT_params_decodeStatus[] =
422     &PAF_AST_params_decodeStatus_primary,
423 };
424 #else   
425 //extern const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[];
426 #endif // FL: #if 0
428 #if 0
429 const PAF_OutBufStatus PAF_AST_params_outBufStatus =
431     sizeof (PAF_OutBufStatus),                              // size
432     1,                                                      // mode
433     0,                                                      // sioSelect
434     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
435     0,                                                      // audio
436     PAF_OB_CLOCK_INTERNAL,                                  // clock
437     PAF_OB_FLUSH_ENABLE,                                    // flush
438     0,                                                      // unused[2] // FL: rateTrackMode
439     0,                                                      // PAF_OB_MARKER_ENABLED // FL: markerMode
440     0                                                       // FL: maxNumBufOverride
441                                                             // FL: (*** ?) missing init. values for numBufOverride[PAF_SOURCE_N]
442 };
443 #endif // FL: #if 0
445 #if 0
446 const PAF_EncodeStatus PAF_AST_params_encodeStatus_primary =
448     sizeof (PAF_EncodeStatus),                              // size
449     1,                                                      // mode
450     0,                                                      // unused1
451     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
452     0,                                                      // channelCount
453     0, 0, 0, 0,                                                //Unused                                        
454     0, 0, 0, 0,                                                //Unused
455     0, 0, 0, 0,                                             //Unused
456     0, 0, 0, 0,                                                //Unused
457     0, 0, 0, 0,                                             //Unused
458     0,                                                      // frameLength
459     0,                                                      // encBypass
460     PAF_SOURCE_PCM,                                         // select
461     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0,0,0,0,0,
462     // channelConfigurationRequest.full
463     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
464     // channelConfigurationStream.full
465     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
466     // channelConfigurationEncode.full
467     0, 0, 0, 0,    0, 0, 0, 0,                                 //Unused
468     -3,                                                     // channelMap.from[0]
469     -3,                                                     // channelMap.from[1]
470     -3,                                                     // channelMap.from[2]
471     -3,                                                     // channelMap.from[3]
472     -3,                                                     // channelMap.from[4]
473     -3,                                                     // channelMap.from[5]
474     -3,                                                     // channelMap.from[6]
475     -3,                                                     // channelMap.from[7]
476     -3,                                                     // channelMap.from[8]
477     -3,                                                     // channelMap.from[9]
478     -3,                                                     // channelMap.from[10]
479     -3,                                                     // channelMap.from[11]
480     -3,                                                     // channelMap.from[12]
481     -3,                                                     // channelMap.from[13]
482     -3,                                                     // channelMap.from[14]
483     -3,                                                     // channelMap.from[15]
484     -3,                                                     // channelMap.to[0]
485     -3,                                                     // channelMap.to[1]
486     -3,                                                     // channelMap.to[2]
487     -3,                                                     // channelMap.to[3]
488     -3,                                                     // channelMap.to[4]
489     -3,                                                     // channelMap.to[5]
490     -3,                                                     // channelMap.to[6]
491     -3,                                                     // channelMap.to[7]
492     -3,                                                     // channelMap.to[8]
493     -3,                                                     // channelMap.to[9]
494     -3,                                                     // channelMap.to[10]
495     -3,                                                     // channelMap.to[11]
496     -3,                                                     // channelMap.to[12]
497     -3,                                                     // channelMap.to[13]
498     -3,                                                     // channelMap.to[14]
499     -3,                                                     // channelMap.to[15]
500     -3,                                                     // channelMap.from[0]
501     -3,                                                     // channelMap.from[1]
502     -3,                                                     // channelMap.from[2]
503     -3,                                                     // channelMap.from[3]
504     -3,                                                     // channelMap.from[4]
505     -3,                                                     // channelMap.from[5]
506     -3,                                                     // channelMap.from[6]
507     -3,                                                     // channelMap.from[7]
508     -3,                                                     // channelMap.from[8]
509     -3,                                                     // channelMap.from[9]
510     -3,                                                     // channelMap.from[10]
511     -3,                                                     // channelMap.from[11]
512     -3,                                                     // channelMap.from[12]
513     -3,                                                     // channelMap.from[13]
514     -3,                                                     // channelMap.from[14]
515     -3,                                                     // channelMap.from[15]
516     -3,                                                     // channelMap.to[0]
517     -3,                                                     // channelMap.to[1]
518     -3,                                                     // channelMap.to[2]
519     -3,                                                     // channelMap.to[3]
520     -3,                                                     // channelMap.to[4]
521     -3,                                                     // channelMap.to[5]
522     -3,                                                     // channelMap.to[6]
523     -3,                                                     // channelMap.to[7]
524     -3,                                                     // channelMap.to[8]
525     -3,                                                     // channelMap.to[9]
526     -3,                                                     // channelMap.to[10]
527     -3,                                                     // channelMap.to[11]
528     -3,                                                     // channelMap.to[12]
529     -3,                                                     // channelMap.to[13]
530     -3,                                                     // channelMap.to[14]
531     -3,                                                     // channelMap.to[15]
532     0,                                                      // programFormat.mask
533     0,                                                      // programFormat.form
534     0,                                                      // sampleProcess[0]
535 };
536 #endif // FL: #if 0
538 #if 0
539 const PAF_EncodeStatus *const PAF_AST_params_encodeStatus[] =
541     &PAF_AST_params_encodeStatus_primary,
542 };
543 #endif // FL: #if 0
545 #if 0
546 const PAF_VolumeStatus PAF_AST_params_volumeStatus =
548     sizeof (PAF_VolumeStatus),                              // size
549     1,                                                      // mode
550     PAF_MAXNUMCHAN,                                         // channelCount
551     0x0f,                                                   // implementation
552     0,                                                      // unused1
553     50,                                                     // rampTime: 50 msec/dB (20 dB/sec)
554     0,                                                      // unused2
555     0,                                                      // unused3
556     -2 * 20, 0, 0, 0,                                       // master
557     -2 * 0, 0, 0, 0,                                        // trim
558     -2 * 0, 0, 0, 0,                                        //
559     -2 * 0, 0, 0, 0,                                        //
560     -2 * 0, 0, 0, 0,                                        //
561     -2 * 0, 0, 0, 0,                                        //
562     -2 * 0, 0, 0, 0,                                        //
563     -2 * 0, 0, 0, 0,                                        //
564     -2 * 0, 0, 0, 0,                                        //
565     -2 * 0, 0, 0, 0,                                        //
566     -2 * 0, 0, 0, 0,                                        //
567     -2 * 0, 0, 0, 0,                                        //
568     -2 * 0, 0, 0, 0,                                        //
569     -2 * 0, 0, 0, 0,                                        //
570     -2 * 0, 0, 0, 0,                                        //
571     -2 * 0, 0, 0, 0,                                        //
572     -2 * 0, 0, 0, 0,                                        //  
573     -2 * 0, 0, 0, 0,                                        // trim - upper16
574     -2 * 0, 0, 0, 0,                                        //
575     -2 * 0, 0, 0, 0,                                        //
576     -2 * 0, 0, 0, 0,                                        //
577     -2 * 0, 0, 0, 0,                                        //
578     -2 * 0, 0, 0, 0,                                        //
579     -2 * 0, 0, 0, 0,                                        //
580     -2 * 0, 0, 0, 0,                                        //
581     -2 * 0, 0, 0, 0,                                        //
582     -2 * 0, 0, 0, 0,                                        //
583     -2 * 0, 0, 0, 0,                                        //
584     -2 * 0, 0, 0, 0,                                        //
585     -2 * 0, 0, 0, 0,                                        //
586     -2 * 0, 0, 0, 0,                                        //
587     -2 * 0, 0, 0, 0,                                        //
588     -2 * 0, 0, 0, 0,                                        //
590 };
591 #endif // FL: #if 0
593 //
594 // Common Space Parameter Declarations and Definitions
595 //
596 //   Local definitions in RAM provide non-standard functionality.
597 //   The NULL pointer provides standard functionality.
598 //
600 /* baseline definition - NULL equivalent */
601 /* May be used for overrides of IALG_MemSpace */
603 static const IALG_MemSpace params_memspace_PAi_Slave[] = {
604     PAF_IALG_NONE,                                          // Scratch
605     PAF_IALG_NONE,                                          // Persistant
606     PAF_IALG_NONE,                                          // Write once
607     PAF_IALG_NONE,                                          // Common 1
608     PAF_IALG_NONE,                                          // Common 2
609     PAF_IALG_NONE,                                          // Common 3
610     PAF_IALG_NONE,                                          // Common 4
611     PAF_IALG_NONE,                                          // Common 5
612     PAF_IALG_NONE,                                          // Common 6
613     PAF_IALG_NONE,                                          // Common 7
614     IALG_EXTERNAL,                                          // Common 8
615     PAF_IALG_NONE,                                          // Common 9
616     PAF_IALG_NONE,                                          // Common 10
617     PAF_IALG_NONE,                                          // Common 11
618     PAF_IALG_NONE,                                          // Common 12
619     PAF_IALG_NONE,                                          // Common 13
620     PAF_IALG_NONE,                                          // Common 14
621     PAF_IALG_NONE,                                          // Common 15
622 };
624 //
625 // Heap Declarations
626 //
628 //#include <pafhjt.h>
630 //extern int IRAM;
631 //extern int SDRAM;
632 //extern int L3RAM;
634 #if 0
635 // .............................................................................
636 // DIB memory requirements
638 // primary input
639 const IALG_MemRec inpMemTabPrimary[] =
641     // SDRAM circular buffer
642     // 2 buffers * 256 samples/buffer * 8 words/sample * 3 bytes/word
643     {
644         3 * 60 * 1024,                                          // size
645         //180 * 1024,                                           // size
646         //6 * 60 * 1024,                                        // size
647         128,                                                    // alignment
648         IALG_SARAM1, //IALG_EXTERNAL,                           // space
649         IALG_PERSIST,                                           // attrs
650         NULL,                                                   // base
651      },
653     // IRAM scratch memory for autodetection and stereo PCM input
654     // High watermark needs are set by the latter:
655     // double buffer stereo 32bit PCM input 512 max frame size
656     // 1 buffers * 512 samples/buffer * 2 words/sample * 4 bytes/word
657     {
658         8 * 1024,                                              // size
659         128,                                                   // alignment
660         IALG_SARAM,                                            // space
661         IALG_SCRATCH,                                          // attrs
662         NULL,                                                  // base
663     }
664 };
666 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
668     2,
669     inpMemTabPrimary
670 };
672 const PAF_ASP_LinkInit inpLinkInitPrimary[] =
674     PAF_ASP_LINKINITPARAMS (STD, IB, TIH, &inpSioAlgParamsPrimary),
675     PAF_ASP_LINKNONE
676 };
678 const PAF_ASP_LinkInit *const inpLinkInit[] =
680     inpLinkInitPrimary
681 };
683 // .............................................................................
684 // DOB memory requirements
686 // primary output
687 const IALG_MemRec outMemTabPrimary[] =
689     // SDRAM buffer
690     // 4 buffers * 256 samples * 32 ch * 4 bytes
691         {
692             4 * 256 * 32 * 4,                                      // size: note:
693             //6 * 256 * 32 * 4,                                      // size: note:
694             //16 * 256 * 32 * 4,                                      // size: note:
695             128,                                                   // alignment
696             IALG_EXTERNAL,                                         // space
697             IALG_PERSIST,                                          // attrs
698             NULL,                                                  // base
699         }
700 };
703 const PAF_SIO_IALG_Params outSioAlgParamsPrimary =
705     1,
706     outMemTabPrimary
707 };
709 const PAF_ASP_LinkInit outLinkInitPrimary[] =
711     PAF_ASP_LINKINITPARAMS (STD, OB, TIH, &outSioAlgParamsPrimary),
712     PAF_ASP_LINKNONE
713 };
715 const PAF_ASP_LinkInit * const outLinkInit[] =
717     outLinkInitPrimary,
718 };
721 // .............................................................................
722 // sourceProgram mapped to DOB num of buffers
723 const PAF_ASP_outNumBufMap outPrimaryNumBufMap =
725     4,                                                      // maxNumBuf
726 //    6,                                                      // maxNumBuf
727 //    16,                                                      // maxNumBuf
728     PAF_SOURCE_N,                                           // length
729     0,                                                      // PAF_SOURCE_UNKNOWN
730     0,                                                      // PAF_SOURCE_NONE
731     2,                                                      // PAF_SOURCE_PASS
732     2,                                                      // PAF_SOURCE_SNG
733     0,                                                      // PAF_SOURCE_AUTO
734     0,                                                      // PAF_SOURCE_BITSTREAM
735     0,                                                      // PAF_SOURCE_DTSALL
736     0,                                                      // PAF_SOURCE_PCMAUTO
737     2,                                                      // PAF_SOURCE_PCM
738     0,                                                      // PAF_SOURCE_PC8
739     2,                                                      // PAF_SOURCE_AC3
740     2,                                                      // PAF_SOURCE_DTS
741     2,                                                      // PAF_SOURCE_AAC
742     0,                                                      // PAF_SOURCE_MPEG
743     2,                                                      // PAF_SOURCE_DTS12
744     2,                                                      // PAF_SOURCE_DTS13
745     2,                                                      // PAF_SOURCE_DTS14
746     2,                                                      // PAF_SOURCE_DTS16
747     0,                                                      // PAF_SOURCE_WMA9PRO
748     0,                                                      // PAF_SOURCE_MP3
749     2,                                                      // PAF_SOURCE_DSD1,
750     2,                                                      // PAF_SOURCE_DSD2,
751     2,                                                      // PAF_SOURCE_DSD3,
752     4,                                                      // PAF_SOURCE_DDP
753     4,                                                      // PAF_SOURCE_DTSHD
754     4,                                                      // PAF_SOURCE_THD
755 //    6,                                                      // PAF_SOURCE_THD
756 //    16,                                                      // PAF_SOURCE_THD
757     4,                                                      // PAF_SOURCE_DXP
759 };
761 const PAF_ASP_outNumBufMap *const outNumBufMap[] =
763     &outPrimaryNumBufMap,
764 };
765 #endif // FL: #if 0
767 // .............................................................................
768 const PAF_MetadataBufStatus PAF_ASDT_params_MetadataBufStatus[] =
770     4 * 1024,               // bufSize
771     PAF_MAX_NUM_PRIVATE_MD, // NumBuf
772     128,                    // alignment
773     &gPafHeapIdExt //&SDRAM // &IRAM,        // pSpace
774 };
776 #if 0 // FL: maybe needed on ARM if there's an audio frame buffer defined for decode (and possible stream)
777 // .............................................................................
778 //
779 // This structure defines the memory allocation of audio frame buffers (channel buffers). Users can customize this structure based
780 // on their requirement. IALG_SARAM specifies the audio frame buffer is allocated in IRAM and IALG_EXTERNAL
781 // specifies the audio frame buffer is allocated in SDRAM. By allocating few channel buffers in SDRAM, users can save internal memory
782 // but trading performance
783 // This structure defined for PAF_MAXNUMCHAN number of channels. But channel buffers will be allocated  for "PAF_AST_params_numchan"
784 // number of channels only.
785 //
787 const PAF_AudioFrameBufStatus    PAF_AST_params_AudioFrameBufStatus[PAF_MAXNUMCHAN] =
789     IALG_SARAM, // 0
790     IALG_SARAM,
791     IALG_SARAM,
792     IALG_SARAM,
793     IALG_SARAM,
794     IALG_SARAM,
795     IALG_SARAM,
796     IALG_SARAM,
797     IALG_SARAM,
798     IALG_SARAM,
799     IALG_SARAM,
800     IALG_SARAM,
801     IALG_SARAM,
802     IALG_SARAM,
803     IALG_SARAM,
804     IALG_SARAM,
805     IALG_SARAM, // 16
806     IALG_SARAM,
807     IALG_SARAM,
808     IALG_SARAM,
809     IALG_SARAM,
810     IALG_SARAM,
811     IALG_SARAM,
812     IALG_SARAM,
813     IALG_SARAM,
814     IALG_SARAM,
815     IALG_SARAM,
816     IALG_SARAM,
817     IALG_SARAM,
818     IALG_SARAM,
819     IALG_SARAM,
820     IALG_SARAM, // 31
821     //IALG_EXTERNAL, // 16
822     //IALG_EXTERNAL,
823     //IALG_EXTERNAL,
824     //IALG_EXTERNAL,
825     //IALG_EXTERNAL,
826     //IALG_EXTERNAL,
827     //IALG_EXTERNAL,
828     //IALG_EXTERNAL,
829     //IALG_EXTERNAL,
830     //IALG_EXTERNAL,
831     //IALG_EXTERNAL,
832     //IALG_EXTERNAL,
833     //IALG_EXTERNAL,
834     //IALG_EXTERNAL,
835     //IALG_EXTERNAL,
836     //IALG_EXTERNAL // 31
837 };
838 #endif // FL: #if 0
840 // .............................................................................
841 //
842 // Audio Stream Parameter Definitions
843 //
844 //   Global definition in RAM provides standard & non-standard functionality.
845 //
847 const PAF_AST_Params asdp_params_PAi =
849     &PAF_ASDT_params_fxns,                                     // fxns
850     {                                                          // zone
851         0,                                                     // master
852         1,                                                     // inputs
853         0,                                                     // input1
854         1,                                                     // inputN
855         1,                                                     // decodes
856         0,                                                     // decode1
857         1,                                                     // decodeN
858         1,                                                     // streams
859         0,                                                     // stream1 /* unused */
860         1,                                                     // streamN /* unused */
861         1,                                                     // encodes
862         0,                                                     // encode1
863         1,                                                     // encodeN
864         1,                                                     // outputs
865         0,                                                     // output1
866         1,                                                     // outputN
867     },
868     PAF_AST_inputsFromDecodes_std,
869     NULL, //PAF_AST_outputsFromEncodes_std,
870     {                                                       // heap
871         &gPafHeapIdInt1,    //&IRAM                         // pIntern
872         &gPafHeapIdExt,     //&SDRAM,                       // pExtern
873         NULL,               //&IRAM,                        // pInpbuf
874         NULL,               //&IRAM,                        // pOutbuf
875         &gPafHeapIdInt1,    //&IRAM,                        // pFrmbuf
876         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
877         1,                                                  // clear
878     },
879     {                                                       // common
880         params_memspace_PAi_Slave,                          // space
881     },
882     NULL,                                                   // z_rx_bufsiz
883     NULL,                                                   // z_tx_bufsiz
884     PAF_AST_params_numchan,                                 // z_numchan
885     256,                                                    // framelength
886     &PAF_ASDT_params_audioFrameFunctions,                   // pAudioFrameFunctions
887     &PAF_ASP_chainFxns,                                     // pChainFxns
888     NULL, //&PAF_AST_params_inpBufStatus,                           // pInpBufStatus
889     PAF_ASDT_params_decodeStatus,                           // z_pDecodeStatus
890     NULL, //&PAF_AST_params_outBufStatus,                           // pOutBufStatus
891     NULL, //PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
892     NULL, //&PAF_AST_params_volumeStatus,                           // pVolumeStatus
893     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
894     NULL, //&PAF_ASP_params_encAlgKey,                              // pEncAlgKey
895     NULL, //&PAF_ASP_params_decSioMap,                              // pDecSioMap
896     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
897     NULL, //PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
898     1536,                                                   // maxFramelength
899     NULL, //PAF_AST_streamOrder,                                    // streamOrder
900     NULL, //inpLinkInit,                                            // i_inpLinkInit
901     NULL, //outLinkInit,                                            // i_outLinkInit
902     NULL, //outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
903     PAF_ASDT_params_MetadataBufStatus,                      //metadata buffer status
904     NULL, //PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
905 };
907 // EOF