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