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