Add support for DDR shared heap. Note:algs use IALG_EXTERNAL_SHM, which is IALG_ESDATA.
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / 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
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     // IRAM scratch memory for autodetection and stereo PCM input
609     // High watermark needs are set by the latter:
610     // double buffer stereo 32bit PCM input 512 max frame size
611     // 1 buffers * 512 samples/buffer * 2 words/sample * 4 bytes/word
612     {
613         8 * 1024,                                              // size
614         128,                                                   // alignment
615         IALG_SARAM,                                            // space
616         IALG_SCRATCH,                                          // attrs
617         NULL,                                                  // base
618     }
619 };
621 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
623     2,
624     inpMemTabPrimary
625 };
627 const PAF_ASP_LinkInit inpLinkInitPrimary[] =
629     PAF_ASP_LINKINITPARAMS (STD, IB, TIH, &inpSioAlgParamsPrimary),
630     PAF_ASP_LINKNONE
631 };
633 const PAF_ASP_LinkInit *const inpLinkInit[] =
635     inpLinkInitPrimary
636 };
638 // .............................................................................
639 // DOB memory requirements
641 // primary output
642 const IALG_MemRec outMemTabPrimary[] =
644     // SDRAM buffer
645     // 4 buffers * 256 samples * 32 ch * 4 bytes
646         {
647             4 * 256 * 32 * 4,                                      // size: note:
648             //6 * 256 * 32 * 4,                                      // size: note:
649             //16 * 256 * 32 * 4,                                      // size: note:
650             128,                                                   // alignment
651             IALG_EXTERNAL,                                         // space
652             IALG_PERSIST,                                          // attrs
653             NULL,                                                  // base
654         }
655 };
658 const PAF_SIO_IALG_Params outSioAlgParamsPrimary =
660     1,
661     outMemTabPrimary
662 };
664 const PAF_ASP_LinkInit outLinkInitPrimary[] =
666     PAF_ASP_LINKINITPARAMS (STD, OB, TIH, &outSioAlgParamsPrimary),
667     PAF_ASP_LINKNONE
668 };
670 const PAF_ASP_LinkInit * const outLinkInit[] =
672     outLinkInitPrimary,
673 };
676 // .............................................................................
677 // sourceProgram mapped to DOB num of buffers
678 const PAF_ASP_outNumBufMap outPrimaryNumBufMap =
680     4,                                                      // maxNumBuf
681 //    6,                                                      // maxNumBuf
682 //    16,                                                      // maxNumBuf
683     PAF_SOURCE_N,                                           // length
684     0,                                                      // PAF_SOURCE_UNKNOWN
685     0,                                                      // PAF_SOURCE_NONE
686     2,                                                      // PAF_SOURCE_PASS
687     2,                                                      // PAF_SOURCE_SNG
688     0,                                                      // PAF_SOURCE_AUTO
689     0,                                                      // PAF_SOURCE_BITSTREAM
690     0,                                                      // PAF_SOURCE_DTSALL
691     0,                                                      // PAF_SOURCE_PCMAUTO
692     2,                                                      // PAF_SOURCE_PCM
693     0,                                                      // PAF_SOURCE_PC8
694     2,                                                      // PAF_SOURCE_AC3
695     2,                                                      // PAF_SOURCE_DTS
696     2,                                                      // PAF_SOURCE_AAC
697     0,                                                      // PAF_SOURCE_MPEG
698     2,                                                      // PAF_SOURCE_DTS12
699     2,                                                      // PAF_SOURCE_DTS13
700     2,                                                      // PAF_SOURCE_DTS14
701     2,                                                      // PAF_SOURCE_DTS16
702     0,                                                      // PAF_SOURCE_WMA9PRO
703     0,                                                      // PAF_SOURCE_MP3
704     2,                                                      // PAF_SOURCE_DSD1,
705     2,                                                      // PAF_SOURCE_DSD2,
706     2,                                                      // PAF_SOURCE_DSD3,
707     4,                                                      // PAF_SOURCE_DDP
708     4,                                                      // PAF_SOURCE_DTSHD
709     4,                                                      // PAF_SOURCE_THD
710 //    6,                                                      // PAF_SOURCE_THD
711 //    16,                                                      // PAF_SOURCE_THD
712     4,                                                      // PAF_SOURCE_DXP
714 };
716 const PAF_ASP_outNumBufMap *const outNumBufMap[] =
718     &outPrimaryNumBufMap,
719 };
721 // .............................................................................
722 const PAF_MetadataBufStatus PAF_AST_params_MetadataBufStatus[] =
724     PAF_MAX_PRIVATE_MD_SZ,  // bufSize
725     PAF_MAX_NUM_PRIVATE_MD, // NumBuf
726     128,                    // alignment
727     &gPafHeapIdExt //&SDRAM // &IRAM,        // pSpace
728 };
730 // .............................................................................
731 //
732 // This structure defines the memory allocation of audio frame buffers (channel buffers). Users can customize this structure based
733 // on their requirement. IALG_SARAM specifies the audio frame buffer is allocated in IRAM and IALG_EXTERNAL
734 // specifies the audio frame buffer is allocated in SDRAM. By allocating few channel buffers in SDRAM, users can save internal memory
735 // but trading performance
736 // This structure defined for PAF_MAXNUMCHAN number of channels. But channel buffers will be allocated  for "PAF_AST_params_numchan"
737 // number of channels only.
738 //
740 const PAF_AudioFrameBufStatus    PAF_AST_params_AudioFrameBufStatus[PAF_MAXNUMCHAN] =
742     IALG_SARAM, // 0
743     IALG_SARAM,
744     IALG_SARAM,
745     IALG_SARAM,
746     IALG_SARAM,
747     IALG_SARAM,
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, // 16
759     IALG_SARAM,
760     IALG_SARAM,
761     IALG_SARAM,
762     IALG_SARAM,
763     IALG_SARAM,
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, // 31
774     //IALG_EXTERNAL, // 16
775     //IALG_EXTERNAL,
776     //IALG_EXTERNAL,
777     //IALG_EXTERNAL,
778     //IALG_EXTERNAL,
779     //IALG_EXTERNAL,
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 // 31
790 };
792 //(***) FL: re-visit, clean this up (remove unused members)
793 // .............................................................................
794 //
795 // Audio Stream Parameter Definitions
796 //
797 //   Global definition in RAM provides standard & non-standard functionality.
798 //
800 const PAF_ASIT_Params asip_params_PAi =
802     &PAF_ASIT_params_fxns,                                     // fxns
803     {                                                          // zone
804         0,                                                     // master
805         1,                                                     // inputs
806         0,                                                     // input1
807         1,                                                     // inputN
808         1,                                                     // decodes
809         0,                                                     // decode1
810         1,                                                     // decodeN
811         1,                                                     // streams
812         0,                                                     // stream1 /* unused */
813         1,                                                     // streamN /* unused */
814         1,                                                     // encodes
815         0,                                                     // encode1
816         1,                                                     // encodeN
817         1,                                                     // outputs
818         0,                                                     // output1
819         1,                                                     // outputN
820     },
821     PAF_AST_inputsFromDecodes_std,
822     PAF_AST_outputsFromEncodes_std,
823     {                                                       // heap
824         &gPafHeapIdInt,    //&IRAM,                         // pIntern
825         &gPafHeapIdExt,    //&SDRAM,                        // pExtern
826         &gPafHeapIdInt,    //&IRAM,                         // pInpbuf
827         &gPafHeapIdInt,    //&IRAM,                         // pOutbuf
828         &gPafHeapIdInt,    //&IRAM,                         // pFrmbuf
829         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
830         1,                                                  // clear
831     },
832     {                                                       // common
833         params_memspace_PAi,                                // space
834     },
835     NULL,                                                   // z_rx_bufsiz
836     NULL,                                                   // z_tx_bufsiz
837     PAF_AST_params_numchan,                                 // z_numchan
838     256,                                                    // framelength
839     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
840     &PAF_ASP_chainFxns,                                     // pChainFxns
841     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
842     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
843     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
844     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
845     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
846     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
847     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
848     &PAF_ASP_params_decSioMap,                              // pDecSioMap
849     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
850     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
851     256,                                                    // maxFramelength
852     PAF_AST_streamOrder,                                    // streamOrder
853     inpLinkInit,                                            // i_inpLinkInit
854     outLinkInit,                                            // i_outLinkInit
855     outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
856     PAF_AST_params_MetadataBufStatus,                       //metadata buffer status
857     PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
858 };
860 extern const PAF_ASOT_Fxns PAF_ASOT_params_fxns;
862 //(***) FL: initially a copy of asip
863 //(***) FL: re-visit, clean this up (remove unused members)
864 const PAF_ASOT_Params asop_params_PAi =
866     &PAF_ASOT_params_fxns,                                     // fxns
867     {                                                          // zone
868         0,                                                     // master
869         1,                                                     // inputs
870         0,                                                     // input1
871         1,                                                     // inputN
872         1,                                                     // decodes
873         0,                                                     // decode1
874         1,                                                     // decodeN
875         1,                                                     // streams
876         0,                                                     // stream1 /* unused */
877         1,                                                     // streamN /* unused */
878         1,                                                     // encodes
879         0,                                                     // encode1
880         1,                                                     // encodeN
881         1,                                                     // outputs
882         0,                                                     // output1
883         1,                                                     // outputN
884     },
885     PAF_AST_inputsFromDecodes_std,
886     PAF_AST_outputsFromEncodes_std,
887     {                                                       // heap
888         &gPafHeapIdInt,    //&IRAM,                         // pIntern
889         &gPafHeapIdExt,    //&SDRAM,                        // pExtern
890         &gPafHeapIdInt,    //&IRAM,                         // pInpbuf
891         &gPafHeapIdInt,    //&IRAM,                         // pOutbuf
892         &gPafHeapIdInt,    //&IRAM,                         // pFrmbuf
893         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
894         1,                                                  // clear
895     },
896     {                                                       // common
897         params_memspace_PAi,                                // space
898     },
899     NULL,                                                   // z_rx_bufsiz
900     NULL,                                                   // z_tx_bufsiz
901     PAF_AST_params_numchan,                                 // z_numchan
902     256,                                                    // framelength
903     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
904     &PAF_ASP_chainFxns,                                     // pChainFxns
905     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
906     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
907     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
908     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
909     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
910     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
911     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
912     &PAF_ASP_params_decSioMap,                              // pDecSioMap
913     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
914     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
915     256,                                                    // maxFramelength
916     PAF_AST_streamOrder,                                    // streamOrder
917     inpLinkInit,                                            // i_inpLinkInit
918     outLinkInit,                                            // i_outLinkInit
919     outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
920     PAF_AST_params_MetadataBufStatus,                       //metadata buffer status
921     PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
922 };
925 // EOF