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