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