2bbd9e5d213a01d28196d8cd55ab7dc3821d3bc3
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / itopo / params.c
2 /*
3 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without 
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 //
37 // PAF_DEVICE_VERSION Symbol Definitions
39 #define PAF_DEVICE_VERSION (PAF_DEVICE & 0xffff)
41 #include <xdc/cfg/global.h>
43 //#include <ti/procsdk_audio/procsdk_audio_typ.h>
44 #include <procsdk_audio_typ.h>
46 #include <stdasp.h>
47 #include <pafsio_ialg.h>
49 #include "paf_heapMgr.h"
51 #include "asp1.h"
52 #include "audioStreamProc_params.h"
53 #include "audioStreamInpProc.h"
54 #include "audioStreamOutProc.h"
56 //
57 // Framework Declarations
58 //
60 //#define PAF_AST_params_fxnsPA PAF_AST_params_fxnsPA17
62 //
63 // Audio Data Representation Definitions
64 //
65 //   External declarations to patched IROM provide standard functionality.
66 //
68 /* audio frame "width" in channels */
70 const SmInt PAF_AST_params_numchan[1] =
71 {
72     32,
73 };
75 ///
76 // Audio Stream Processing Function Table Definition
77 //
79 const PAF_AudioFunctions PAF_AST_params_audioFrameFunctions =
80 {
81     &PAF_ASP_dB2ToLinear,
82     &PAF_ASP_channelMask,
83     &PAF_ASP_programFormat,
84     &PAF_ASP_sampleRateHz,
85     &PAF_ASP_delay,
86 };
88 //
89 // Source Select Array Declarations -- algorithm keys & sio map
90 //
91 //   External declarations to patched IROM provide standard functionality.
92 //
94 const PAF_ASP_AlgKey PAF_ASP_params_decAlgKey =
95 {
96     PAF_SOURCE_N,                                           // length
97     /* Relies on the fact that ACP_SERIES_* != 0 here */
98     0,                                                      // PAF_SOURCE_UNKNOWN
99     0,                                                      // PAF_SOURCE_NONE
100     0,                                                      // PAF_SOURCE_PASS
101     PAF_ASP_ALPHACODE (STD, SNG),                           // PAF_SOURCE_SNG
102     0,                                                      // PAF_SOURCE_AUTO
103     0,                                                      // PAF_SOURCE_BITSTREAM
104     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTSALL
105     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCMAUTO
106     PAF_ASP_ALPHACODE (STD, PCM),                           // PAF_SOURCE_PCM
107     PAF_ASP_ALPHACODE (STD, PCN),                           // PAF_SOURCE_PC8 /* unused */
108     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_AC3
109     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS
110     PAF_ASP_ALPHACODE (STD, AAC),                           // PAF_SOURCE_AAC
111     PAF_ASP_ALPHACODE (STD, MPG),                           // PAF_SOURCE_MPEG /* unused */
112     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS12
113     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS13
114     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS14
115     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTS16
116     0,                                                      // PAF_SOURCE_WMA9PRO
117     0,                                                      // PAF_SOURCE_MP3
118     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD1
119     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD2
120     PAF_ASP_ALPHACODE (STD, DSD),                           // PAF_SOURCE_DSD3
121     PAF_ASP_ALPHACODE (STD, DDP),                           // PAF_SOURCE_DDP
122     PAF_ASP_ALPHACODE (STD, DTSHD),                         // PAF_SOURCE_DTSHD
123     PAF_ASP_ALPHACODE (STD, THD),                           // PAF_SOURCE_THD
124     PAF_ASP_ALPHACODE (STD, DXP),                           // PAF_SOURCE_DXP
125 };
127 const PAF_ASP_AlgKey PAF_ASP_params_encAlgKey =
129     PAF_SOURCE_N,                                           // length
130     /* Relies on the fact that ACP_SERIES_* != 0 here */
131     0,                                                      // PAF_SOURCE_UNKNOWN
132     0,                                                      // PAF_SOURCE_NONE
133     0,                                                      // PAF_SOURCE_PASS
134     0,                                                      // PAF_SOURCE_SNG
135     0,                                                      // PAF_SOURCE_AUTO
136     0,                                                      // PAF_SOURCE_BITSTREAM
137     0,                                                      // PAF_SOURCE_DTSALL
138     0,                                                      // PAF_SOURCE_PCMAUTO
139     PAF_ASP_ALPHACODE (STD, PCE),                           // PAF_SOURCE_PCM
140     0,                                                      // PAF_SOURCE_PC8
141     0,                                                      // PAF_SOURCE_AC3
142     0,                                                      // PAF_SOURCE_DTS
143     0,                                                      // PAF_SOURCE_AAC
144     0,                                                      // PAF_SOURCE_MPEG
145     0,                                                      // PAF_SOURCE_DTS12
146     0,                                                      // PAF_SOURCE_DTS13
147     0,                                                      // PAF_SOURCE_DTS14
148     0,                                                      // PAF_SOURCE_DTS16
149     0,                                                      // PAF_SOURCE_WMA9PRO
150     PAF_ASP_ALPHACODE (STD, MPE),                           // PAF_SOURCE_MP3
151     0,                                                      // PAF_SOURCE_DSD1
152     0,                                                      // PAF_SOURCE_DSD2
153     0                                                       // PAF_SOURCE_DSD3
154 };
156 const PAF_ASP_SioMap PAF_ASP_params_decSioMap =
158     PAF_SOURCE_N,                                           // length
159     PAF_SOURCE_UNKNOWN,                                     // PAF_SOURCE_UNKNOWN -> ...
160     PAF_SOURCE_NONE,                                        // PAF_SOURCE_NONE -> ...
161     PAF_SOURCE_PASS,                                        // PAF_SOURCE_PASS -> ...
162     PAF_SOURCE_PCM,                                         // PAF_SOURCE_SNG -> PCM
163     PAF_SOURCE_AUTO,                                        // PAF_SOURCE_AUTO -> ...
164     PAF_SOURCE_BITSTREAM,                                   // PAF_SOURCE_BITSTREAM -> ...
165     PAF_SOURCE_DTSALL,                                      // PAF_SOURCE_UNUSED1 -> ...
166     PAF_SOURCE_PCMAUTO,                                     // PAF_SOURCE_UNUSED2 -> ...
167     PAF_SOURCE_PCM,                                         // PAF_SOURCE_PCM -> ...
168     PAF_SOURCE_PC8,                                         // PAF_SOURCE_PC8 -> ...
169     PAF_SOURCE_AC3,                                         // PAF_SOURCE_AC3 -> ...
170     PAF_SOURCE_DTS,                                         // PAF_SOURCE_DTS -> ...
171     PAF_SOURCE_AAC,                                         // PAF_SOURCE_AAC -> ...
172     PAF_SOURCE_MPEG,                                        // PAF_SOURCE_MPEG -> ...
173     PAF_SOURCE_DTS12,                                       // PAF_SOURCE_DTS12 -> ...
174     PAF_SOURCE_DTS13,                                       // PAF_SOURCE_DTS13 -> ...
175     PAF_SOURCE_DTS14,                                       // PAF_SOURCE_DTS14 -> ...
176     PAF_SOURCE_DTS16,                                       // PAF_SOURCE_DTS16 -> ...
177     PAF_SOURCE_WMA9PRO,                                     // PAF_SOURCE_WMA9PRO -> ...
178     PAF_SOURCE_MP3,                                         // PAF_SOURCE_MP3 -> ...
179     PAF_SOURCE_DSD1,                                        // PAF_SOURCE_DSD1 -> ...
180     PAF_SOURCE_DSD2,                                        // PAF_SOURCE_DSD2 -> ...
181     PAF_SOURCE_DSD3,                                        // PAF_SOURCE_DSD3 -> ...
182     PAF_SOURCE_DDP,                                         // PAF_SOURCE_DDP -> ...
183     PAF_SOURCE_DTSHD,                                       // PAF_SOURCE_DTSHD -> ...
184     PAF_SOURCE_THD,                                         // PAF_SOURCE_THD -> ...
185     PAF_SOURCE_DXP,                                         // PAF_SOURCE_DXP -> ...
186 };
188 //
189 // Mapping Declarations -- from *coders to *puts
190 //
191 //   External declarations to patched IROM provide standard functionality.
192 //
193 const SmInt PAF_AST_streamsFromDecodes_std[DECODEN_MAX] =
195     0, 1, 2,
196 };
197 const SmInt PAF_AST_streamsFromEncodes_std[ENCODEN_MAX] =
199     0, 1, 2,
200 };
201 const SmInt PAF_AST_inputsFromDecodes_std[DECODEN_MAX] =
203     0, 1, 2,
204 };
205 extern const SmInt PAF_AST_outputsFromEncodes_std[ENCODEN_MAX];
206 #ifndef __TI_EABI__
207 asm ("_PAF_AST_outputsFromEncodes_std .set _PAF_AST_inputsFromDecodes_std");
208 #else
209 asm ("PAF_AST_outputsFromEncodes_std .set PAF_AST_inputsFromDecodes_std");
210 #endif
212 //
213 // Setting of audio stream order
214 //
216 const SmInt PAF_AST_streamOrder[1] =
218     0,
219 };
221 //
222 // Audio Framework Initialization Function Table Declarations
223 //
224 //   External declarations to patched IROM provide standard functionality.
225 //
227 extern const PAF_ASIT_Fxns PAF_ASIT_params_fxns;
229 //
230 // Audio Framework Status Initialization Declarations
231 //
232 //   External declarations to patched IROM provide standard functionality.
233 //
235 const PAF_InpBufStatus PAF_AST_params_inpBufStatus =
237     sizeof (PAF_InpBufStatus),                              // size
238     0,                                                      // mode
239     0,                                                      // sioSelect
240     0x80,                                                   // lockOverride = none
241     0,                                                      // unused
242     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateOverride
243     PAF_SAMPLERATE_NONE,                                    // sampleRateData
244     PAF_SAMPLERATE_NONE,                                    // sampleRateMeasured
245     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRateStatus
246     PAF_IEC_AUDIOMODE_UNKNOWN,                              // nonaudio
247     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasisData
248     0,                                                      // emphasisOverride
249     PAF_IEC_PREEMPHASIS_NO,                                 // emphasisStatus
250     0,                                                      // lock
251     0,                                                      // scanAtHighSampleRateMode
252     0,                                                      // zeroRun
253     0,                                                      // unused2[1] // FL: rateTrackMode
254     24,                                                     // precisionDefault
255     -1,                                                     // precisionDetect
256     0,                                                      // precisionOverride
257     0,                                                      // precisionInput
258     100,                                                    // zeroRunTrigger
259     100,                                                    // zeroRunRestart
260     2048,                                                   // unknownTimeout
261     0,                                                      // lastFrameMask
262     0,                                                      // lastFrameFlag
263     0,                                                      // reportDTS16AsDTSForLargeSampleRate
264     0, 0                                                    // reserved
265 };
267 #if 0 // FL: slave
268 const PAF_DecodeStatus PAF_AST_params_decodeStatus_primary =
270     sizeof (PAF_DecodeStatus),                              // size
271     1,                                                      // mode
272     0,                                                      // unused1
273     0,                                                      // command.action
274     0,                                                      // command.result
275     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
276     PAF_SOURCE_NONE,                                        // sourceSelect
277     PAF_SOURCE_UNKNOWN,                                     // sourceProgram
278     PAF_SOURCE_UNKNOWN,                                     // sourceDecode
279     PAF_SOURCE_DUAL_STEREO,                                 // sourceDual
280     4,                                                      // sourceKaraoke: both
281     0,                                                      // aspGearControl: unused
282     0,                                                      // aspGearStatus: unused
283     0, 0, 0, 0,                                             // Unused
284     0, 0, 0, 0,                                             // Unused
285     0, 0, 0, 0,                                             // Unused
286     0, 0, 0, 0,                                             // Unused
287     0, 0, 0, 0,                                             // Unused
288     0,                                                      // frameCount
289     0x40,                                                   // karaoka: Vocal 1 Level
290     0x40,                                                   // karaoka: Vocal 1 Pan
291     0x40,                                                   // karaoka: Vocal 2 Level
292     0xc0,                                                   // karaoka: Vocal 2 Pan
293     0x40,                                                   // karaoka: Melody Level
294     0x00,                                                   // karaoka: Melody Pan
295     0,                                                      // decBypass
296     0,                                                      // unused
297     0,                                                      // frameLength: reset later
298     1,                                                      // bufferRatio: unity
299     PAF_IEC_PREEMPHASIS_UNKNOWN,                            // emphasis
300     0,                                                      // bufferDrift
301     0, 0,
302     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0, 0, 0, 0, 0,    
303     // channelConfigurationRequest.full
304     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
305     // channelConfigurationProgram.full
306     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
307     // channelConfigurationDecode.full
308     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
309     // channelConfigurationDownmix.full
310     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0,    
311     // channelConfigurationOverride.full 
312     -3,                                                     // channelMap.from[0]
313     -3,                                                     // channelMap.from[1]
314     -3,                                                     // channelMap.from[2]
315     -3,                                                     // channelMap.from[3]
316     -3,                                                     // channelMap.from[4]
317     -3,                                                     // channelMap.from[5]
318     -3,                                                     // channelMap.from[6]
319     -3,                                                     // channelMap.from[7]
320     -3,                                                     // channelMap.from[8]
321     -3,                                                     // channelMap.from[9]
322     -3,                                                     // channelMap.from[10]
323     -3,                                                     // channelMap.from[11]
324     -3,                                                     // channelMap.from[12]
325     -3,                                                     // channelMap.from[13]
326     -3,                                                     // channelMap.from[14]
327     -3,                                                     // channelMap.from[15]
328     -3,                                                     // channelMap.from[16]
329     -3,                                                     // channelMap.from[17]
330     -3,                                                     // channelMap.from[18]
331     -3,                                                     // channelMap.from[19]
332     -3,                                                     // channelMap.from[20]
333     -3,                                                     // channelMap.from[21]
334     -3,                                                     // channelMap.from[22]
335     -3,                                                     // channelMap.from[23]
336     -3,                                                     // channelMap.from[24]
337     -3,                                                     // channelMap.from[25]
338     -3,                                                     // channelMap.from[26]
339     -3,                                                     // channelMap.from[27]
340     -3,                                                     // channelMap.from[28]
341     -3,                                                     // channelMap.from[29]
342     -3,                                                     // channelMap.from[30]
343     -3,                                                     // channelMap.from[31]
344     -3,                                                     // channelMap.to[0]
345     -3,                                                     // channelMap.to[1]
346     -3,                                                     // channelMap.to[2]
347     -3,                                                     // channelMap.to[3]
348     -3,                                                     // channelMap.to[4]
349     -3,                                                     // channelMap.to[5]
350     -3,                                                     // channelMap.to[6]
351     -3,                                                     // channelMap.to[7]
352     -3,                                                     // channelMap.to[8]
353     -3,                                                     // channelMap.to[9]
354     -3,                                                     // channelMap.to[10]
355     -3,                                                     // channelMap.to[11]
356     -3,                                                     // channelMap.to[12]
357     -3,                                                     // channelMap.to[13]
358     -3,                                                     // channelMap.to[14]
359     -3,                                                     // channelMap.to[15]
360     -3,                                                     // channelMap.to[16]
361     -3,                                                     // channelMap.to[17]
362     -3,                                                     // channelMap.to[18]
363     -3,                                                     // channelMap.to[19]
364     -3,                                                     // channelMap.to[20]
365     -3,                                                     // channelMap.to[21]
366     -3,                                                     // channelMap.to[22]
367     -3,                                                     // channelMap.to[23]
368     -3,                                                     // channelMap.to[24]
369     -3,                                                     // channelMap.to[25]
370     -3,                                                     // channelMap.to[26]
371     -3,                                                     // channelMap.to[27]
372     -3,                                                     // channelMap.to[28]
373     -3,                                                     // channelMap.to[29]
374     -3,                                                     // channelMap.to[30]
375     -3,                                                     // channelMap.to[31]
376     0,                                                      // programFormat.mask
377     0,                                                      // programFormat.form
378    
379 };
380 const PAF_DecodeStatus *const PAF_AST_params_decodeStatus[] =
382     &PAF_AST_params_decodeStatus_primary,
383 };
384 #endif // #if 0
386 const PAF_OutBufStatus PAF_AST_params_outBufStatus =
388     sizeof (PAF_OutBufStatus),                              // size
389     1,                                                      // mode
390     0,                                                      // sioSelect
391     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
392     0,                                                      // audio
393     PAF_OB_CLOCK_INTERNAL,                                  // clock
394     PAF_OB_FLUSH_ENABLE,                                    // flush
395     0,                                                      // unused[2] // FL: rateTrackMode
396     0,                                                      // PAF_OB_MARKER_ENABLED // FL: markerMode
397     0                                                       // FL: maxNumBufOverride
398                                                             // FL: (*** ?) missing init. values for numBufOverride[PAF_SOURCE_N]
399 };
401 const PAF_EncodeStatus PAF_AST_params_encodeStatus_primary =
403     sizeof (PAF_EncodeStatus),                              // size
404     1,                                                      // mode
405     0,                                                      // unused1
406     PAF_SAMPLERATE_UNKNOWN,                                 // sampleRate
407     0,                                                      // channelCount
408     0, 0, 0, 0,                                             // Unused                                        
409     0, 0, 0, 0,                                             // Unused
410     0, 0, 0, 0,                                             // Unused
411     0, 0, 0, 0,                                             // Unused
412     0, 0, 0, 0,                                             // Unused
413     0,                                                      // frameLength
414     0,                                                      // encBypass
415     PAF_SOURCE_PCM,                                         // select
416     PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0,0,0,0,0,
417     // channelConfigurationRequest.full
418     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
419     // channelConfigurationStream.full
420     PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
421     // channelConfigurationEncode.full
422     0, 0, 0, 0,    0, 0, 0, 0,                              // Unused
423     -3,                                                     // channelMap.from[0]
424     -3,                                                     // channelMap.from[1]
425     -3,                                                     // channelMap.from[2]
426     -3,                                                     // channelMap.from[3]
427     -3,                                                     // channelMap.from[4]
428     -3,                                                     // channelMap.from[5]
429     -3,                                                     // channelMap.from[6]
430     -3,                                                     // channelMap.from[7]
431     -3,                                                     // channelMap.from[8]
432     -3,                                                     // channelMap.from[9]
433     -3,                                                     // channelMap.from[10]
434     -3,                                                     // channelMap.from[11]
435     -3,                                                     // channelMap.from[12]
436     -3,                                                     // channelMap.from[13]
437     -3,                                                     // channelMap.from[14]
438     -3,                                                     // channelMap.from[15]
439     -3,                                                     // channelMap.to[0]
440     -3,                                                     // channelMap.to[1]
441     -3,                                                     // channelMap.to[2]
442     -3,                                                     // channelMap.to[3]
443     -3,                                                     // channelMap.to[4]
444     -3,                                                     // channelMap.to[5]
445     -3,                                                     // channelMap.to[6]
446     -3,                                                     // channelMap.to[7]
447     -3,                                                     // channelMap.to[8]
448     -3,                                                     // channelMap.to[9]
449     -3,                                                     // channelMap.to[10]
450     -3,                                                     // channelMap.to[11]
451     -3,                                                     // channelMap.to[12]
452     -3,                                                     // channelMap.to[13]
453     -3,                                                     // channelMap.to[14]
454     -3,                                                     // channelMap.to[15]
455     -3,                                                     // channelMap.from[0]
456     -3,                                                     // channelMap.from[1]
457     -3,                                                     // channelMap.from[2]
458     -3,                                                     // channelMap.from[3]
459     -3,                                                     // channelMap.from[4]
460     -3,                                                     // channelMap.from[5]
461     -3,                                                     // channelMap.from[6]
462     -3,                                                     // channelMap.from[7]
463     -3,                                                     // channelMap.from[8]
464     -3,                                                     // channelMap.from[9]
465     -3,                                                     // channelMap.from[10]
466     -3,                                                     // channelMap.from[11]
467     -3,                                                     // channelMap.from[12]
468     -3,                                                     // channelMap.from[13]
469     -3,                                                     // channelMap.from[14]
470     -3,                                                     // channelMap.from[15]
471     -3,                                                     // channelMap.to[0]
472     -3,                                                     // channelMap.to[1]
473     -3,                                                     // channelMap.to[2]
474     -3,                                                     // channelMap.to[3]
475     -3,                                                     // channelMap.to[4]
476     -3,                                                     // channelMap.to[5]
477     -3,                                                     // channelMap.to[6]
478     -3,                                                     // channelMap.to[7]
479     -3,                                                     // channelMap.to[8]
480     -3,                                                     // channelMap.to[9]
481     -3,                                                     // channelMap.to[10]
482     -3,                                                     // channelMap.to[11]
483     -3,                                                     // channelMap.to[12]
484     -3,                                                     // channelMap.to[13]
485     -3,                                                     // channelMap.to[14]
486     -3,                                                     // channelMap.to[15]
487     0,                                                      // programFormat.mask
488     0,                                                      // programFormat.form
489     0,                                                      // sampleProcess[0]
490 };
494 const PAF_EncodeStatus *const PAF_AST_params_encodeStatus[] =
496     &PAF_AST_params_encodeStatus_primary,
497 };
499 const PAF_VolumeStatus PAF_AST_params_volumeStatus =
501     sizeof (PAF_VolumeStatus),                              // size
502     1,                                                      // mode
503     PAF_MAXNUMCHAN,                                         // channelCount
504     0x0f,                                                   // implementation
505     0,                                                      // unused1
506     50,                                                     // rampTime: 50 msec/dB (20 dB/sec)
507     0,                                                      // unused2
508     0,                                                      // unused3
509     -2 * 20, 0, 0, 0,                                       // master
510     -2 * 0, 0, 0, 0,                                        // trim
511     -2 * 0, 0, 0, 0,                                        //
512     -2 * 0, 0, 0, 0,                                        //
513     -2 * 0, 0, 0, 0,                                        //
514     -2 * 0, 0, 0, 0,                                        //
515     -2 * 0, 0, 0, 0,                                        //
516     -2 * 0, 0, 0, 0,                                        //
517     -2 * 0, 0, 0, 0,                                        //
518     -2 * 0, 0, 0, 0,                                        //
519     -2 * 0, 0, 0, 0,                                        //
520     -2 * 0, 0, 0, 0,                                        //
521     -2 * 0, 0, 0, 0,                                        //
522     -2 * 0, 0, 0, 0,                                        //
523     -2 * 0, 0, 0, 0,                                        //
524     -2 * 0, 0, 0, 0,                                        //
525     -2 * 0, 0, 0, 0,                                        //  
526     -2 * 0, 0, 0, 0,                                        // trim - upper16
527     -2 * 0, 0, 0, 0,                                        //
528     -2 * 0, 0, 0, 0,                                        //
529     -2 * 0, 0, 0, 0,                                        //
530     -2 * 0, 0, 0, 0,                                        //
531     -2 * 0, 0, 0, 0,                                        //
532     -2 * 0, 0, 0, 0,                                        //
533     -2 * 0, 0, 0, 0,                                        //
534     -2 * 0, 0, 0, 0,                                        //
535     -2 * 0, 0, 0, 0,                                        //
536     -2 * 0, 0, 0, 0,                                        //
537     -2 * 0, 0, 0, 0,                                        //
538     -2 * 0, 0, 0, 0,                                        //
539     -2 * 0, 0, 0, 0,                                        //
540     -2 * 0, 0, 0, 0,                                        //
541     -2 * 0, 0, 0, 0,                                        //
543 };
545 //
546 // Common Space Parameter Declarations and Definitions
547 //
548 //   Local definitions in RAM provide non-standard functionality.
549 //   The NULL pointer provides standard functionality.
550 //
552 /* baseline definition - NULL equivalent */
553 /* May be used for overrides of IALG_MemSpace */
555 static const IALG_MemSpace params_memspace_PAi[] = {
556     PAF_IALG_NONE,                                          // Scratch
557     PAF_IALG_NONE,                                          // Persistant
558     PAF_IALG_NONE,                                          // Write once
559     PAF_IALG_NONE,                                          // Common 1
560     PAF_IALG_NONE,                                          // Common 2
561     PAF_IALG_NONE,                                          // Common 3
562     PAF_IALG_NONE,                                          // Common 4
563     PAF_IALG_NONE,                                          // Common 5
564     PAF_IALG_NONE,                                          // Common 6
565     PAF_IALG_NONE,                                          // Common 7
566     IALG_EXTERNAL,                                          // Common 8
567     PAF_IALG_NONE,                                          // Common 9
568     PAF_IALG_NONE,                                          // Common 10
569     PAF_IALG_NONE,                                          // Common 11
570     PAF_IALG_NONE,                                          // Common 12
571     PAF_IALG_NONE,                                          // Common 13
572     PAF_IALG_NONE,                                          // Common 14
573     PAF_IALG_NONE,                                          // Common 15
574 };
576 //
577 // Heap Declarations
578 //
580 //#include <pafhjt.h>
582 //extern int IRAM;
583 //extern int SDRAM;
584 //extern int L3RAM;
586 // .............................................................................
587 // DIB memory requirements
589 // primary input
590 const IALG_MemRec inpMemTabPrimary[] =
592     // SDRAM circular buffer
593     // 2 buffers * 256 samples/buffer * 8 words/sample * 3 bytes/word
594     {
595         (3 * 60 * 1024) + 2,                                    // size 184320 + 1 16-bit word for EDMA padding
596         //180 * 1024,                                           // size
597         //6 * 60 * 1024,                                        // size
598         128,                                                    // alignment
599         IALG_SARAM2, //IALG_SARAM1, //IALG_EXTERNAL,                           // space
600         IALG_PERSIST,                                           // attrs
601         NULL,                                                   // base
602      },
604     // IRAM scratch memory for autodetection and stereo PCM input
605     // High watermark needs are set by the latter:
606     // double buffer stereo 32bit PCM input 512 max frame size
607     // 1 buffers * 512 samples/buffer * 2 words/sample * 4 bytes/word
608     {
609         8 * 1024,                                              // size
610         128,                                                   // alignment
611         IALG_SARAM,                                            // space
612         IALG_SCRATCH,                                          // attrs
613         NULL,                                                  // base
614     }
615 };
617 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
619     2,
620     inpMemTabPrimary
621 };
623 const PAF_ASP_LinkInit inpLinkInitPrimary[] =
625     PAF_ASP_LINKINITPARAMS (STD, IB, TIH, &inpSioAlgParamsPrimary),
626     PAF_ASP_LINKNONE
627 };
629 const PAF_ASP_LinkInit *const inpLinkInit[] =
631     inpLinkInitPrimary
632 };
634 // .............................................................................
635 // DOB memory requirements
637 // primary output
638 const IALG_MemRec outMemTabPrimary[] =
640     // SDRAM buffer
641     // 4 buffers * 256 samples * 32 ch * 4 bytes
642         {
643             4 * 256 * 32 * 4,                                      // size: note:
644             //6 * 256 * 32 * 4,                                      // size: note:
645             //16 * 256 * 32 * 4,                                      // size: note:
646             128,                                                   // alignment
647             IALG_EXTERNAL,                                         // space
648             IALG_PERSIST,                                          // attrs
649             NULL,                                                  // base
650         }
651 };
654 const PAF_SIO_IALG_Params outSioAlgParamsPrimary =
656     1,
657     outMemTabPrimary
658 };
660 const PAF_ASP_LinkInit outLinkInitPrimary[] =
662     PAF_ASP_LINKINITPARAMS (STD, OB, TIH, &outSioAlgParamsPrimary),
663     PAF_ASP_LINKNONE
664 };
666 const PAF_ASP_LinkInit * const outLinkInit[] =
668     outLinkInitPrimary,
669 };
672 // .............................................................................
673 // sourceProgram mapped to DOB num of buffers
674 const PAF_ASP_outNumBufMap outPrimaryNumBufMap =
676     4,                                                      // maxNumBuf
677 //    6,                                                      // maxNumBuf
678 //    16,                                                      // maxNumBuf
679     PAF_SOURCE_N,                                           // length
680     0,                                                      // PAF_SOURCE_UNKNOWN
681     0,                                                      // PAF_SOURCE_NONE
682     2,                                                      // PAF_SOURCE_PASS
683     2,                                                      // PAF_SOURCE_SNG
684     0,                                                      // PAF_SOURCE_AUTO
685     0,                                                      // PAF_SOURCE_BITSTREAM
686     0,                                                      // PAF_SOURCE_DTSALL
687     0,                                                      // PAF_SOURCE_PCMAUTO
688     2,                                                      // PAF_SOURCE_PCM
689     0,                                                      // PAF_SOURCE_PC8
690     2,                                                      // PAF_SOURCE_AC3
691     2,                                                      // PAF_SOURCE_DTS
692     2,                                                      // PAF_SOURCE_AAC
693     0,                                                      // PAF_SOURCE_MPEG
694     2,                                                      // PAF_SOURCE_DTS12
695     2,                                                      // PAF_SOURCE_DTS13
696     2,                                                      // PAF_SOURCE_DTS14
697     2,                                                      // PAF_SOURCE_DTS16
698     0,                                                      // PAF_SOURCE_WMA9PRO
699     0,                                                      // PAF_SOURCE_MP3
700     2,                                                      // PAF_SOURCE_DSD1,
701     2,                                                      // PAF_SOURCE_DSD2,
702     2,                                                      // PAF_SOURCE_DSD3,
703     4,                                                      // PAF_SOURCE_DDP
704     4,                                                      // PAF_SOURCE_DTSHD
705     4,                                                      // PAF_SOURCE_THD
706 //    6,                                                      // PAF_SOURCE_THD
707 //    16,                                                      // PAF_SOURCE_THD
708     4,                                                      // PAF_SOURCE_DXP
710 };
712 const PAF_ASP_outNumBufMap *const outNumBufMap[] =
714     &outPrimaryNumBufMap,
715 };
717 // .............................................................................
718 const PAF_MetadataBufStatus PAF_AST_params_MetadataBufStatus[] =
720     4 * 1024,               // bufSize
721     PAF_MAX_NUM_PRIVATE_MD, // NumBuf
722     128,                    // alignment
723     &gPafHeapIdExt //&SDRAM // &IRAM,        // pSpace
724 };
726 // .............................................................................
727 //
728 // This structure defines the memory allocation of audio frame buffers (channel buffers). Users can customize this structure based
729 // on their requirement. IALG_SARAM specifies the audio frame buffer is allocated in IRAM and IALG_EXTERNAL
730 // specifies the audio frame buffer is allocated in SDRAM. By allocating few channel buffers in SDRAM, users can save internal memory
731 // but trading performance
732 // This structure defined for PAF_MAXNUMCHAN number of channels. But channel buffers will be allocated  for "PAF_AST_params_numchan"
733 // number of channels only.
734 //
736 const PAF_AudioFrameBufStatus    PAF_AST_params_AudioFrameBufStatus[PAF_MAXNUMCHAN] =
738     IALG_SARAM, // 0
739     IALG_SARAM,
740     IALG_SARAM,
741     IALG_SARAM,
742     IALG_SARAM,
743     IALG_SARAM,
744     IALG_SARAM,
745     IALG_SARAM,
746     IALG_SARAM,
747     IALG_SARAM,
748     IALG_SARAM,
749     IALG_SARAM,
750     IALG_SARAM,
751     IALG_SARAM,
752     IALG_SARAM,
753     IALG_SARAM,
754     IALG_SARAM, // 16
755     IALG_SARAM,
756     IALG_SARAM,
757     IALG_SARAM,
758     IALG_SARAM,
759     IALG_SARAM,
760     IALG_SARAM,
761     IALG_SARAM,
762     IALG_SARAM,
763     IALG_SARAM,
764     IALG_SARAM,
765     IALG_SARAM,
766     IALG_SARAM,
767     IALG_SARAM,
768     IALG_SARAM,
769     IALG_SARAM, // 31
770     //IALG_EXTERNAL, // 16
771     //IALG_EXTERNAL,
772     //IALG_EXTERNAL,
773     //IALG_EXTERNAL,
774     //IALG_EXTERNAL,
775     //IALG_EXTERNAL,
776     //IALG_EXTERNAL,
777     //IALG_EXTERNAL,
778     //IALG_EXTERNAL,
779     //IALG_EXTERNAL,
780     //IALG_EXTERNAL,
781     //IALG_EXTERNAL,
782     //IALG_EXTERNAL,
783     //IALG_EXTERNAL,
784     //IALG_EXTERNAL,
785     //IALG_EXTERNAL // 31
786 };
788 //(***) FL: re-visit, clean this up (remove unused members)
789 // .............................................................................
790 //
791 // Audio Stream Parameter Definitions
792 //
793 //   Global definition in RAM provides standard & non-standard functionality.
794 //
796 const PAF_ASIT_Params asip_params_PAi =
798     &PAF_ASIT_params_fxns,                                     // fxns
799     {                                                          // zone
800         0,                                                     // master
801         1,                                                     // inputs
802         0,                                                     // input1
803         1,                                                     // inputN
804         1,                                                     // decodes
805         0,                                                     // decode1
806         1,                                                     // decodeN
807         1,                                                     // streams
808         0,                                                     // stream1 /* unused */
809         1,                                                     // streamN /* unused */
810         1,                                                     // encodes
811         0,                                                     // encode1
812         1,                                                     // encodeN
813         1,                                                     // outputs
814         0,                                                     // output1
815         1,                                                     // outputN
816     },
817     PAF_AST_inputsFromDecodes_std,
818     PAF_AST_outputsFromEncodes_std,
819     {                                                       // heap
820         &gPafHeapIdInt,    //&IRAM,                         // pIntern
821         &gPafHeapIdExt,    //&SDRAM,                        // pExtern
822         &gPafHeapIdInt,    //&IRAM,                         // pInpbuf
823         &gPafHeapIdInt,    //&IRAM,                         // pOutbuf
824         &gPafHeapIdInt,    //&IRAM,                         // pFrmbuf
825         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
826         1,                                                  // clear
827     },
828     {                                                       // common
829         params_memspace_PAi,                                // space
830     },
831     NULL,                                                   // z_rx_bufsiz
832     NULL,                                                   // z_tx_bufsiz
833     PAF_AST_params_numchan,                                 // z_numchan
834     256,                                                    // framelength
835     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
836     &PAF_ASP_chainFxns,                                     // pChainFxns
837     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
838     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
839     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
840     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
841     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
842     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
843     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
844     &PAF_ASP_params_decSioMap,                              // pDecSioMap
845     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
846     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
847     256,                                                    // maxFramelength
848     PAF_AST_streamOrder,                                    // streamOrder
849     inpLinkInit,                                            // i_inpLinkInit
850     outLinkInit,                                            // i_outLinkInit
851     outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
852     PAF_AST_params_MetadataBufStatus,                       //metadata buffer status
853     PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
854 };
856 extern const PAF_ASOT_Fxns PAF_ASOT_params_fxns;
858 //(***) FL: initially a copy of asip
859 //(***) FL: re-visit, clean this up (remove unused members)
860 const PAF_ASOT_Params asop_params_PAi =
862     &PAF_ASOT_params_fxns,                                     // fxns
863     {                                                          // zone
864         0,                                                     // master
865         1,                                                     // inputs
866         0,                                                     // input1
867         1,                                                     // inputN
868         1,                                                     // decodes
869         0,                                                     // decode1
870         1,                                                     // decodeN
871         1,                                                     // streams
872         0,                                                     // stream1 /* unused */
873         1,                                                     // streamN /* unused */
874         1,                                                     // encodes
875         0,                                                     // encode1
876         1,                                                     // encodeN
877         1,                                                     // outputs
878         0,                                                     // output1
879         1,                                                     // outputN
880     },
881     PAF_AST_inputsFromDecodes_std,
882     PAF_AST_outputsFromEncodes_std,
883     {                                                       // heap
884         &gPafHeapIdInt,    //&IRAM,                         // pIntern
885         &gPafHeapIdExt,    //&SDRAM,                        // pExtern
886         &gPafHeapIdInt,    //&IRAM,                         // pInpbuf
887         &gPafHeapIdInt,    //&IRAM,                         // pOutbuf
888         &gPafHeapIdInt,    //&IRAM,                         // pFrmbuf
889         &gPafHeapIdInt1,   //&L3RAM,                        // pIntern1
890         1,                                                  // clear
891     },
892     {                                                       // common
893         params_memspace_PAi,                                // space
894     },
895     NULL,                                                   // z_rx_bufsiz
896     NULL,                                                   // z_tx_bufsiz
897     PAF_AST_params_numchan,                                 // z_numchan
898     256,                                                    // framelength
899     &PAF_AST_params_audioFrameFunctions,                    // pAudioFrameFunctions
900     &PAF_ASP_chainFxns,                                     // pChainFxns
901     &PAF_AST_params_inpBufStatus,                           // pInpBufStatus
902     NULL, //PAF_AST_params_decodeStatus,                            // z_pDecodeStatus
903     &PAF_AST_params_outBufStatus,                           // pOutBufStatus
904     PAF_AST_params_encodeStatus,                            // z_pEncodeStatus
905     &PAF_AST_params_volumeStatus,                           // pVolumeStatus
906     &PAF_ASP_params_decAlgKey,                              // pDecAlgKey
907     &PAF_ASP_params_encAlgKey,                              // pEncAlgKey
908     &PAF_ASP_params_decSioMap,                              // pDecSioMap
909     PAF_AST_streamsFromDecodes_std,                         // streamsFromDecodes
910     PAF_AST_streamsFromEncodes_std,                         // streamsFromEncodes
911     256,                                                    // maxFramelength
912     PAF_AST_streamOrder,                                    // streamOrder
913     inpLinkInit,                                            // i_inpLinkInit
914     outLinkInit,                                            // i_outLinkInit
915     outNumBufMap,                                           // outNumBufMap // FL: poutNumBufMap
916     PAF_AST_params_MetadataBufStatus,                       //metadata buffer status
917     PAF_AST_params_AudioFrameBufStatus                      //Audio frame buffer status
918 };
921 // EOF