2 /*
3 Copyright (c) 2018, 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 #include "dbgBenchmark.h" // PCM high-sampling rate + SRC + CAR benchmarking
60 //
61 // Framework Declarations
62 //
64 //#define PAF_AST_params_fxnsPA PAF_AST_params_fxnsPA17
66 //
67 // Audio Data Representation Definitions
68 //
69 // External declarations to patched IROM provide standard functionality.
70 //
72 /* audio frame "width" in channels */
74 const SmInt PAF_AST_params_numchan[1] =
75 {
76 32,
77 };
79 ///
80 // Audio Stream Processing Function Table Definition
81 //
83 const PAF_AudioFunctions PAF_AST_params_audioFrameFunctions =
84 {
85 &PAF_ASP_dB2ToLinear,
86 &PAF_ASP_channelMask,
87 &PAF_ASP_programFormat,
88 &PAF_ASP_sampleRateHz,
89 &PAF_ASP_delay,
90 };
92 //
93 // Source Select Array Declarations -- algorithm keys & sio map
94 //
95 // External declarations to patched IROM provide standard functionality.
96 //
98 const PAF_ASP_AlgKey PAF_ASP_params_decAlgKey =
99 {
100 PAF_SOURCE_N, // length
101 /* Relies on the fact that ACP_SERIES_* != 0 here */
102 0, // PAF_SOURCE_UNKNOWN
103 0, // PAF_SOURCE_NONE
104 0, // PAF_SOURCE_PASS
105 PAF_ASP_ALPHACODE (STD, SNG), // PAF_SOURCE_SNG
106 0, // PAF_SOURCE_AUTO
107 0, // PAF_SOURCE_BITSTREAM
108 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTSALL
109 PAF_ASP_ALPHACODE (STD, PCM), // PAF_SOURCE_PCMAUTO
110 PAF_ASP_ALPHACODE (STD, PCM), // PAF_SOURCE_PCM
111 PAF_ASP_ALPHACODE (STD, PCN), // PAF_SOURCE_PC8 /* unused */
112 PAF_ASP_ALPHACODE (STD, DDP), // PAF_SOURCE_AC3
113 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTS
114 PAF_ASP_ALPHACODE (STD, AAC), // PAF_SOURCE_AAC
115 PAF_ASP_ALPHACODE (STD, MPG), // PAF_SOURCE_MPEG /* unused */
116 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTS12
117 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTS13
118 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTS14
119 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTS16
120 0, // PAF_SOURCE_WMA9PRO
121 0, // PAF_SOURCE_MP3
122 PAF_ASP_ALPHACODE (STD, DSD), // PAF_SOURCE_DSD1
123 PAF_ASP_ALPHACODE (STD, DSD), // PAF_SOURCE_DSD2
124 PAF_ASP_ALPHACODE (STD, DSD), // PAF_SOURCE_DSD3
125 PAF_ASP_ALPHACODE (STD, DDP), // PAF_SOURCE_DDP
126 PAF_ASP_ALPHACODE (STD, DTSUHDA), // PAF_SOURCE_DTSHD
127 PAF_ASP_ALPHACODE (STD, THD), // PAF_SOURCE_THD
128 PAF_ASP_ALPHACODE (STD, DXP), // PAF_SOURCE_DXP
129 };
131 const PAF_ASP_AlgKey PAF_ASP_params_encAlgKey =
132 {
133 PAF_SOURCE_N, // length
134 /* Relies on the fact that ACP_SERIES_* != 0 here */
135 0, // PAF_SOURCE_UNKNOWN
136 0, // PAF_SOURCE_NONE
137 0, // PAF_SOURCE_PASS
138 0, // PAF_SOURCE_SNG
139 0, // PAF_SOURCE_AUTO
140 0, // PAF_SOURCE_BITSTREAM
141 0, // PAF_SOURCE_DTSALL
142 0, // PAF_SOURCE_PCMAUTO
143 PAF_ASP_ALPHACODE (STD, PCE), // PAF_SOURCE_PCM
144 0, // PAF_SOURCE_PC8
145 0, // PAF_SOURCE_AC3
146 0, // PAF_SOURCE_DTS
147 0, // PAF_SOURCE_AAC
148 0, // PAF_SOURCE_MPEG
149 0, // PAF_SOURCE_DTS12
150 0, // PAF_SOURCE_DTS13
151 0, // PAF_SOURCE_DTS14
152 0, // PAF_SOURCE_DTS16
153 0, // PAF_SOURCE_WMA9PRO
154 PAF_ASP_ALPHACODE (STD, MPE), // PAF_SOURCE_MP3
155 0, // PAF_SOURCE_DSD1
156 0, // PAF_SOURCE_DSD2
157 0 // PAF_SOURCE_DSD3
158 };
160 const PAF_ASP_SioMap PAF_ASP_params_decSioMap =
161 {
162 PAF_SOURCE_N, // length
163 PAF_SOURCE_UNKNOWN, // PAF_SOURCE_UNKNOWN -> ...
164 PAF_SOURCE_NONE, // PAF_SOURCE_NONE -> ...
165 PAF_SOURCE_PASS, // PAF_SOURCE_PASS -> ...
166 PAF_SOURCE_PCM, // PAF_SOURCE_SNG -> PCM
167 PAF_SOURCE_AUTO, // PAF_SOURCE_AUTO -> ...
168 PAF_SOURCE_BITSTREAM, // PAF_SOURCE_BITSTREAM -> ...
169 PAF_SOURCE_DTSALL, // PAF_SOURCE_UNUSED1 -> ...
170 PAF_SOURCE_PCMAUTO, // PAF_SOURCE_UNUSED2 -> ...
171 PAF_SOURCE_PCM, // PAF_SOURCE_PCM -> ...
172 PAF_SOURCE_PC8, // PAF_SOURCE_PC8 -> ...
173 PAF_SOURCE_AC3, // PAF_SOURCE_AC3 -> ...
174 PAF_SOURCE_DTS, // PAF_SOURCE_DTS -> ...
175 PAF_SOURCE_AAC, // PAF_SOURCE_AAC -> ...
176 PAF_SOURCE_MPEG, // PAF_SOURCE_MPEG -> ...
177 PAF_SOURCE_DTS12, // PAF_SOURCE_DTS12 -> ...
178 PAF_SOURCE_DTS13, // PAF_SOURCE_DTS13 -> ...
179 PAF_SOURCE_DTS14, // PAF_SOURCE_DTS14 -> ...
180 PAF_SOURCE_DTS16, // PAF_SOURCE_DTS16 -> ...
181 PAF_SOURCE_WMA9PRO, // PAF_SOURCE_WMA9PRO -> ...
182 PAF_SOURCE_MP3, // PAF_SOURCE_MP3 -> ...
183 PAF_SOURCE_DSD1, // PAF_SOURCE_DSD1 -> ...
184 PAF_SOURCE_DSD2, // PAF_SOURCE_DSD2 -> ...
185 PAF_SOURCE_DSD3, // PAF_SOURCE_DSD3 -> ...
186 PAF_SOURCE_DDP, // PAF_SOURCE_DDP -> ...
187 PAF_SOURCE_DTSHD, // PAF_SOURCE_DTSHD -> ...
188 PAF_SOURCE_THD, // PAF_SOURCE_THD -> ...
189 PAF_SOURCE_DXP, // PAF_SOURCE_DXP -> ...
190 };
192 //
193 // Mapping Declarations -- from *coders to *puts
194 //
195 // External declarations to patched IROM provide standard functionality.
196 //
197 const SmInt PAF_AST_streamsFromDecodes_std[DECODEN_MAX] =
198 {
199 0, 1, 2,
200 };
201 const SmInt PAF_AST_streamsFromEncodes_std[ENCODEN_MAX] =
202 {
203 0, 1, 2,
204 };
205 const SmInt PAF_AST_inputsFromDecodes_std[DECODEN_MAX] =
206 {
207 0, 1, 2,
208 };
209 extern const SmInt PAF_AST_outputsFromEncodes_std[ENCODEN_MAX];
210 #ifndef __TI_EABI__
211 asm ("_PAF_AST_outputsFromEncodes_std .set _PAF_AST_inputsFromDecodes_std");
212 #else
213 asm ("PAF_AST_outputsFromEncodes_std .set PAF_AST_inputsFromDecodes_std");
214 #endif
216 //
217 // Setting of audio stream order
218 //
220 const SmInt PAF_AST_streamOrder[1] =
221 {
222 0,
223 };
225 //
226 // Audio Framework Initialization Function Table Declarations
227 //
228 // External declarations to patched IROM provide standard functionality.
229 //
231 extern const PAF_ASIT_Fxns PAF_ASIT_params_fxns;
233 //
234 // Audio Framework Status Initialization Declarations
235 //
236 // External declarations to patched IROM provide standard functionality.
237 //
239 const PAF_InpBufStatus PAF_AST_params_inpBufStatus =
240 {
241 sizeof (PAF_InpBufStatus), // size
242 0, // mode
243 0, // sioSelect
244 0x80, // lockOverride = none
245 0, // unused
246 PAF_SAMPLERATE_UNKNOWN, // sampleRateOverride
247 PAF_SAMPLERATE_NONE, // sampleRateData
248 PAF_SAMPLERATE_NONE, // sampleRateMeasured
249 PAF_SAMPLERATE_UNKNOWN, // sampleRateStatus
250 PAF_IEC_AUDIOMODE_UNKNOWN, // nonaudio
251 PAF_IEC_PREEMPHASIS_UNKNOWN, // emphasisData
252 0, // emphasisOverride
253 PAF_IEC_PREEMPHASIS_NO, // emphasisStatus
254 0, // lock
255 0, // scanAtHighSampleRateMode
256 0, // zeroRun
257 0, // rateTrackMode
258 24, // precisionDefault
259 -1, // precisionDetect
260 0, // precisionOverride
261 0, // precisionInput
262 100, // zeroRunTrigger
263 100, // zeroRunRestart
264 2048, // unknownTimeout
265 0, // lastFrameMask
266 0, // lastFrameFlag
267 0, // reportDTS16AsDTSForLargeSampleRate
268 0, 0 // reserved
269 };
271 const PAF_OutBufStatus PAF_AST_params_outBufStatus =
272 {
273 sizeof (PAF_OutBufStatus), // size
274 1, // mode
275 0, // sioSelect
276 PAF_SAMPLERATE_UNKNOWN, // sampleRate
277 0, // audio
278 PAF_OB_CLOCK_INTERNAL, // clock
279 PAF_OB_FLUSH_DISABLE, // flush !!! FLUSH_ENABLE not supported, yet !!!
280 0, // rateTrackMode // unused
281 PAF_OB_MARKER_DISABLED, // markerMode
282 0, // maxNumBufOverride
283 // this is the start of numBufOverride[PAF_SOURCE_N]
284 0, // PAF_SOURCE_UNKNOWN
285 0, // PAF_SOURCE_NONE
286 0, // PAF_SOURCE_PASS
287 0, // PAF_SOURCE_SNG
288 0, // PAF_SOURCE_AUTO
289 0, // PAF_SOURCE_BITSTREAM
290 0, // PAF_SOURCE_DTSALL
291 0, // PAF_SOURCE_PCMAUTO
292 0, // PAF_SOURCE_PCM
293 0, // PAF_SOURCE_PC8
294 0, // PAF_SOURCE_AC3
295 0, // PAF_SOURCE_DTS
296 0, // PAF_SOURCE_AAC
297 0, // PAF_SOURCE_MPEG
298 0, // PAF_SOURCE_DTS12
299 0, // PAF_SOURCE_DTS13
300 0, // PAF_SOURCE_DTS14
301 0, // PAF_SOURCE_DTS16
302 0, // PAF_SOURCE_WMA9PRO
303 0, // PAF_SOURCE_MP3
304 0, // PAF_SOURCE_DSD1,
305 0, // PAF_SOURCE_DSD2,
306 0, // PAF_SOURCE_DSD3,
307 0, // PAF_SOURCE_DDP
308 0, // PAF_SOURCE_DTSHD
309 0, // PAF_SOURCE_THD
310 0, // PAF_SOURCE_DXP
311 };
313 const PAF_EncodeStatus PAF_AST_params_encodeStatus_primary =
314 {
315 sizeof (PAF_EncodeStatus), // size
316 1, // mode
317 0, // command2
318 PAF_SAMPLERATE_UNKNOWN, // sampleRate
319 0, // channelCount
320 0, 0, 0, 0, // Unused
321 0, 0, 0, 0, // Unused
322 0, 0, 0, 0, // Unused
323 0, 0, 0, 0, // Unused
324 0, 0, 0, 0, // Unused
325 0, // frameLength
326 0, // encBypass
327 PAF_SOURCE_PCM, // select
328 // channelConfigurationRequest.full
329 PAF_CC_SAT_SURROUND4, PAF_CC_SUB_ONE, PAF_CC_AUX_SURROUND4_UNKNOWN, 0,0,0,0,0,
330 // channelConfigurationStream.full
331 PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
332 // channelConfigurationEncode.full
333 PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0,0,0,0,0,
334 0, 0, 0, 0, 0, 0, 0, 0, // Unused
335 -3, // channelMap.from[0]
336 -3, // channelMap.from[1]
337 -3, // channelMap.from[2]
338 -3, // channelMap.from[3]
339 -3, // channelMap.from[4]
340 -3, // channelMap.from[5]
341 -3, // channelMap.from[6]
342 -3, // channelMap.from[7]
343 -3, // channelMap.from[8]
344 -3, // channelMap.from[9]
345 -3, // channelMap.from[10]
346 -3, // channelMap.from[11]
347 -3, // channelMap.from[12]
348 -3, // channelMap.from[13]
349 -3, // channelMap.from[14]
350 -3, // channelMap.from[15]
351 -3, // channelMap.from[16]
352 -3, // channelMap.from[17]
353 -3, // channelMap.from[18]
354 -3, // channelMap.from[19]
355 -3, // channelMap.from[20]
356 -3, // channelMap.from[21]
357 -3, // channelMap.from[22]
358 -3, // channelMap.from[23]
359 -3, // channelMap.from[24]
360 -3, // channelMap.from[25]
361 -3, // channelMap.from[26]
362 -3, // channelMap.from[27]
363 -3, // channelMap.from[27]
364 -3, // channelMap.from[28]
365 -3, // channelMap.from[30]
366 -3, // channelMap.from[31]
367 -3, // channelMap.to[0]
368 -3, // channelMap.to[1]
369 -3, // channelMap.to[2]
370 -3, // channelMap.to[3]
371 -3, // channelMap.to[4]
372 -3, // channelMap.to[5]
373 -3, // channelMap.to[6]
374 -3, // channelMap.to[7]
375 -3, // channelMap.to[8]
376 -3, // channelMap.to[9]
377 -3, // channelMap.to[10]
378 -3, // channelMap.to[11]
379 -3, // channelMap.to[12]
380 -3, // channelMap.to[13]
381 -3, // channelMap.to[14]
382 -3, // channelMap.to[15]
383 -3, // channelMap.to[16]
384 -3, // channelMap.to[17]
385 -3, // channelMap.to[18]
386 -3, // channelMap.to[19]
387 -3, // channelMap.to[20]
388 -3, // channelMap.to[21]
389 -3, // channelMap.to[22]
390 -3, // channelMap.to[23]
391 -3, // channelMap.to[24]
392 -3, // channelMap.to[25]
393 -3, // channelMap.to[26]
394 -3, // channelMap.to[27]
395 -3, // channelMap.to[28]
396 -3, // channelMap.to[29]
397 -3, // channelMap.to[30]
398 -3, // channelMap.to[31]
399 1, // programFormat.mask
400 0, // programFormat.form
401 0, // listeningFormat.mask
402 0, // listeningFormat.form
403 0, // sampleProcess[0]
404 0, 0, 0, 0, // Unused
405 PAF_CC_SAT_UNKNOWN, PAF_CC_SUB_ZERO, 0, 0, 0, 0, 0, 0, // channelConfigurationCompact
406 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, //channelCompact[PAF_MAXNUMCHAN_HD]
407 };
412 const PAF_EncodeStatus *const PAF_AST_params_encodeStatus[] =
413 {
414 &PAF_AST_params_encodeStatus_primary,
415 };
417 const PAF_VolumeStatus PAF_AST_params_volumeStatus =
418 {
419 sizeof (PAF_VolumeStatus), // size
420 1, // mode
421 PAF_MAXNUMCHAN, // channelCount
422 0x0f, // implementation
423 0, // unused1
424 50, // rampTime: 50 msec/dB (20 dB/sec)
425 0, // unused2
426 0, // unused3
427 -2 * 20, 0, 0, 0, // master
428 -2 * 0, 0, 0, 0, // trim
429 -2 * 0, 0, 0, 0, //
430 -2 * 0, 0, 0, 0, //
431 -2 * 0, 0, 0, 0, //
432 -2 * 0, 0, 0, 0, //
433 -2 * 0, 0, 0, 0, //
434 -2 * 0, 0, 0, 0, //
435 -2 * 0, 0, 0, 0, //
436 -2 * 0, 0, 0, 0, //
437 -2 * 0, 0, 0, 0, //
438 -2 * 0, 0, 0, 0, //
439 -2 * 0, 0, 0, 0, //
440 -2 * 0, 0, 0, 0, //
441 -2 * 0, 0, 0, 0, //
442 -2 * 0, 0, 0, 0, //
443 -2 * 0, 0, 0, 0, //
444 -2 * 0, 0, 0, 0, // trim - upper16
445 -2 * 0, 0, 0, 0, //
446 -2 * 0, 0, 0, 0, //
447 -2 * 0, 0, 0, 0, //
448 -2 * 0, 0, 0, 0, //
449 -2 * 0, 0, 0, 0, //
450 -2 * 0, 0, 0, 0, //
451 -2 * 0, 0, 0, 0, //
452 -2 * 0, 0, 0, 0, //
453 -2 * 0, 0, 0, 0, //
454 -2 * 0, 0, 0, 0, //
455 -2 * 0, 0, 0, 0, //
456 -2 * 0, 0, 0, 0, //
457 -2 * 0, 0, 0, 0, //
458 -2 * 0, 0, 0, 0, //
459 -2 * 0, 0, 0, 0, //
461 };
463 //
464 // Common Space Parameter Declarations and Definitions
465 //
466 // Local definitions in RAM provide non-standard functionality.
467 // The NULL pointer provides standard functionality.
468 //
470 /* baseline definition - NULL equivalent */
471 /* May be used for overrides of IALG_MemSpace */
473 static const IALG_MemSpace params_memspace_PAi[] = {
474 PAF_IALG_NONE, // Scratch
475 PAF_IALG_NONE, // Persistant
476 PAF_IALG_NONE, // Write once
477 PAF_IALG_NONE, // Common 1
478 PAF_IALG_NONE, // Common 2
479 PAF_IALG_NONE, // Common 3
480 PAF_IALG_NONE, // Common 4
481 PAF_IALG_NONE, // Common 5
482 PAF_IALG_NONE, // Common 6
483 PAF_IALG_NONE, // Common 7
484 IALG_EXTERNAL, // Common 8
485 PAF_IALG_NONE, // Common 9
486 PAF_IALG_NONE, // Common 10
487 PAF_IALG_NONE, // Common 11
488 PAF_IALG_NONE, // Common 12
489 PAF_IALG_NONE, // Common 13
490 PAF_IALG_NONE, // Common 14
491 PAF_IALG_NONE, // Common 15
492 };
494 //
495 // Heap Declarations
496 //
498 //#include <pafhjt.h>
500 //extern int IRAM;
501 //extern int SDRAM;
502 //extern int L3RAM;
504 // .............................................................................
505 // DIB memory requirements
507 // primary input
508 // IALG_SARAM_SHM: MSMC shared memory heap
509 // IALG_EXTERNAL_SHM: DDR shared memory heap
510 const IALG_MemRec inpMemTabPrimary[] =
511 {
512 // SDRAM circular buffer
513 // 2 buffers * 256 samples/buffer * 8 words/sample * 3 bytes/word
514 {
515 (6 * 60 * 1024) + 2, // size 360 kB + 1 16-bit word for EDMA padding
516 //(4 * 60 * 1024) + 2, // size 240 kB + 1 16-bit word for EDMA padding
517 //180 * 1024, // size
518 //6 * 60 * 1024, // size
519 128, // alignment
520 IALG_SARAM_SHM, //IALG_EXTERNAL_SHM, //IALG_SARAM2, //IALG_SARAM1, //IALG_EXTERNAL, // space
521 IALG_PERSIST, // attrs
522 NULL, // base
523 }
525 };
527 const PAF_SIO_IALG_Params inpSioAlgParamsPrimary =
528 {
529 1,
530 inpMemTabPrimary
531 };
533 const PAF_ASP_LinkInit inpLinkInitPrimary[] =
534 {
535 PAF_ASP_LINKINITPARAMS (STD, IB, TIH, &inpSioAlgParamsPrimary),
536 PAF_ASP_LINKNONE
537 };
539 const PAF_ASP_LinkInit *const inpLinkInit[] =
540 {
541 inpLinkInitPrimary
542 };
544 // .............................................................................
545 // DOB memory requirements
547 // primary output
548 const IALG_MemRec outMemTabPrimary[] =
549 {
550 // SDRAM buffer
551 // 4 buffers * PAF_ASOT_MAX_FRAMELENGTH samples * 16 ch (assumed MAX) * 4 bytes
552 {
553 4 * PAF_ASOT_MAX_FRAMELENGTH * 16 * 4, // size: note:
554 //6 * 256 * 32 * 4, // size: note:
555 //16 * 256 * 32 * 4, // size: note:
556 128, // alignment
557 IALG_SARAM, // space
558 IALG_PERSIST, // attrs
559 NULL, // base
560 }
561 };
564 const PAF_SIO_IALG_Params outSioAlgParamsPrimary =
565 {
566 1,
567 outMemTabPrimary
568 };
570 const PAF_ASP_LinkInit outLinkInitPrimary[] =
571 {
572 PAF_ASP_LINKINITPARAMS (STD, OB, TIH, &outSioAlgParamsPrimary),
573 PAF_ASP_LINKNONE
574 };
576 const PAF_ASP_LinkInit * const outLinkInit[] =
577 {
578 outLinkInitPrimary,
579 };
582 // .............................................................................
583 // sourceProgram mapped to DOB num of buffers
584 const PAF_ASP_outNumBufMap outPrimaryNumBufMap =
585 {
586 4, // maxNumBuf
587 PAF_SOURCE_N, // length
588 // this is the start of map[PAF_SOURCE_N]
589 0, // PAF_SOURCE_UNKNOWN
590 0, // PAF_SOURCE_NONE
591 2, // PAF_SOURCE_PASS
592 2, // PAF_SOURCE_SNG
593 0, // PAF_SOURCE_AUTO
594 0, // PAF_SOURCE_BITSTREAM
595 0, // PAF_SOURCE_DTSALL
596 0, // PAF_SOURCE_PCMAUTO
597 2, // PAF_SOURCE_PCM
598 0, // PAF_SOURCE_PC8
599 2, // PAF_SOURCE_AC3
600 2, // PAF_SOURCE_DTS
601 2, // PAF_SOURCE_AAC
602 0, // PAF_SOURCE_MPEG
603 2, // PAF_SOURCE_DTS12
604 2, // PAF_SOURCE_DTS13
605 2, // PAF_SOURCE_DTS14
606 2, // PAF_SOURCE_DTS16
607 0, // PAF_SOURCE_WMA9PRO
608 0, // PAF_SOURCE_MP3
609 2, // PAF_SOURCE_DSD1,
610 2, // PAF_SOURCE_DSD2,
611 2, // PAF_SOURCE_DSD3,
612 4, // PAF_SOURCE_DDP
613 4, // PAF_SOURCE_DTSHD
614 4, // PAF_SOURCE_THD
615 4, // PAF_SOURCE_DXP
616 };
618 const PAF_ASP_outNumBufMap *const outNumBufMap[] =
619 {
620 &outPrimaryNumBufMap,
621 };
623 // .............................................................................
624 const PAF_MetadataBufStatus PAF_AST_params_MetadataBufStatus[] =
625 {
626 PAF_MAX_PRIVATE_MD_SZ, // bufSize
627 PAF_MAX_NUM_PRIVATE_MD, // NumBuf
628 128, // alignment
629 &gPafHeapIdExt // pHeapIdMdbuf
630 };
632 // .............................................................................
633 //
634 // This structure defines the memory allocation of audio frame buffers (channel buffers). Users can customize this structure based
635 // on their requirement. IALG_SARAM specifies the audio frame buffer is allocated in IRAM and IALG_EXTERNAL
636 // specifies the audio frame buffer is allocated in SDRAM. By allocating few channel buffers in SDRAM, users can save internal memory
637 // but trading performance
638 // This structure defined for PAF_MAXNUMCHAN number of channels. But channel buffers will be allocated for "PAF_AST_params_numchan"
639 // number of channels only.
640 //
642 const PAF_AudioFrameBufStatus PAF_AST_params_AudioFrameBufStatus[PAF_MAXNUMCHAN] =
643 {
644 IALG_SARAM, // 0
645 IALG_SARAM,
646 IALG_SARAM,
647 IALG_SARAM,
648 IALG_SARAM,
649 IALG_SARAM,
650 IALG_SARAM,
651 IALG_SARAM,
652 IALG_SARAM,
653 IALG_SARAM,
654 IALG_SARAM,
655 IALG_SARAM,
656 IALG_SARAM,
657 IALG_SARAM,
658 IALG_SARAM,
659 IALG_SARAM,
660 IALG_SARAM, // 16
661 IALG_SARAM,
662 IALG_SARAM,
663 IALG_SARAM,
664 IALG_SARAM,
665 IALG_SARAM,
666 IALG_SARAM,
667 IALG_SARAM,
668 IALG_SARAM,
669 IALG_SARAM,
670 IALG_SARAM,
671 IALG_SARAM,
672 IALG_SARAM,
673 IALG_SARAM,
674 IALG_SARAM,
675 IALG_SARAM, // 31
676 //IALG_EXTERNAL, // 16
677 //IALG_EXTERNAL,
678 //IALG_EXTERNAL,
679 //IALG_EXTERNAL,
680 //IALG_EXTERNAL,
681 //IALG_EXTERNAL,
682 //IALG_EXTERNAL,
683 //IALG_EXTERNAL,
684 //IALG_EXTERNAL,
685 //IALG_EXTERNAL,
686 //IALG_EXTERNAL,
687 //IALG_EXTERNAL,
688 //IALG_EXTERNAL,
689 //IALG_EXTERNAL,
690 //IALG_EXTERNAL,
691 //IALG_EXTERNAL // 31
692 };
694 const PAF_AST_DecOpCircBufStatus PAF_AST_params_decOpCircBufStatus_primary =
695 {
696 sizeof(PAF_AST_DecOpCircBufStatus),
697 PAF_ASOT_FRAMELENGTH
698 };
700 const PAF_AST_DecOpCircBufStatus *const PAF_AST_params_decOpCircBufStatus[] =
701 {
702 &PAF_AST_params_decOpCircBufStatus_primary,
703 };
706 // Re-visit, remove unused members
707 // .............................................................................
708 //
709 // Audio Stream Parameter Definitions
710 //
711 // Global definition in RAM provides standard & non-standard functionality.
712 //
714 const PAF_ASIT_Params asip_params_PAi =
715 {
716 &PAF_ASIT_params_fxns, // fxns
717 { // zone
718 0, // zone.master
719 1, // zone.inputs
720 0, // zone.input1
721 1, // zone.inputN
722 1, // zone.decodes
723 0, // zone.decode1
724 1, // zone.decodeN
725 1, // zone.streams
726 0, // zone.stream1 /* unused */
727 1, // zone.streamN /* unused */
728 1, // zone.encodes
729 0, // zone.encode1
730 1, // zone.encodeN
731 1, // zone.outputs
732 0, // zone.output1
733 1, // zone.outputN
734 },
735 PAF_AST_inputsFromDecodes_std,
736 PAF_AST_outputsFromEncodes_std,
737 { // heap
738 &gPafHeapIdInt, // heap.pHeapIdIntern
739 &gPafHeapIdExt, // heap.pHeapIdExtern
740 &gPafHeapIdInt, // heap.pHeapIdInpbuf
741 &gPafHeapIdInt, // heap.pHeapIdOutbuf
742 &gPafHeapIdInt, // heap.pHeapIdFrmbuf
743 &gPafHeapIdInt1, // heap.pHeapIdIntern1
744 &gPafHeapIdInt1Shm, // heap.pHeapIdInt1Shm
745 &gPafHeapIdExtShm, // heap.pHeapIdExtShm
746 &gPafHeapIdExtNonCachedShm, // heap.pHeapIdExtNonCachedShm
747 1, // heap.clear
748 },
749 { // common
750 params_memspace_PAi, // common.space
751 },
752 NULL, // z_rx_bufsiz
753 NULL, // z_tx_bufsiz
754 PAF_AST_params_numchan, // z_numchan
755 PAF_SYS_FRAMELENGTH, // framelength
756 &PAF_AST_params_audioFrameFunctions, // pAudioFrameFunctions
757 &PAF_ASP_chainFxns, // pChainFxns
758 &PAF_AST_params_inpBufStatus, // pInpBufStatus
759 NULL, //PAF_AST_params_decodeStatus, // z_pDecodeStatus
760 &PAF_AST_params_outBufStatus, // pOutBufStatus
761 PAF_AST_params_encodeStatus, // z_pEncodeStatus
762 &PAF_AST_params_volumeStatus, // pVolumeStatus
763 &PAF_ASP_params_decAlgKey, // pDecAlgKey
764 &PAF_ASP_params_encAlgKey, // pEncAlgKey
765 &PAF_ASP_params_decSioMap, // pDecSioMap
766 PAF_AST_streamsFromDecodes_std, // streamsFromDecodes
767 PAF_AST_streamsFromEncodes_std, // streamsFromEncodes
768 PAF_MAX_SYS_FRAMELENGTH, // maxFramelength
769 PAF_AST_streamOrder, // streamOrder
770 inpLinkInit, // i_inpLinkInit
771 outLinkInit, // i_outLinkInit
772 outNumBufMap, // poutNumBufMap
773 PAF_AST_params_MetadataBufStatus, // metadata buffer status
774 PAF_AST_params_AudioFrameBufStatus, // Audio frame buffer status
775 PAF_AST_params_decOpCircBufStatus // z_pDecOpCircBufStatus
776 };
778 extern const PAF_ASOT_Fxns PAF_ASOT_params_fxns;
780 // Re-visit, remove unused members
781 const PAF_ASOT_Params asop_params_PAi =
782 {
783 &PAF_ASOT_params_fxns, // fxns
784 { // zone
785 0, // zone.master
786 1, // zone.inputs
787 0, // zone.input1
788 1, // zone.inputN
789 1, // zone.decodes
790 0, // zone.decode1
791 1, // zone.decodeN
792 1, // zone.streams
793 0, // zone.stream1 /* unused */
794 1, // zone.streamN /* unused */
795 1, // zone.encodes
796 0, // zone.encode1
797 1, // zone.encodeN
798 1, // zone.outputs
799 0, // zone.output1
800 1, // zone.outputN
801 },
802 PAF_AST_inputsFromDecodes_std,
803 PAF_AST_outputsFromEncodes_std,
804 { // heap
805 &gPafHeapIdInt, // heap.pHeapIdIntern
806 &gPafHeapIdExt, // heap.pHeapIdExtern
807 &gPafHeapIdInt, // heap.pHeapIdInpbuf
808 &gPafHeapIdInt, // heap.pHeapIdOutbuf
809 &gPafHeapIdInt, // heap.pHeapIdFrmbuf
810 &gPafHeapIdInt1, // heap.pHeapIdIntern1
811 &gPafHeapIdInt1Shm, // heap.pHeapIdInt1Shm
812 &gPafHeapIdExtShm, // heap.pHeapIdExtShm
813 &gPafHeapIdExtNonCachedShm, // heap.pHeapIdExtNonCachedShm
814 1, // heap.clear
815 },
816 { // common
817 params_memspace_PAi, // common.space
818 },
819 NULL, // z_rx_bufsiz
820 NULL, // z_tx_bufsiz
821 PAF_AST_params_numchan, // z_numchan
822 PAF_ASOT_FRAMELENGTH, // framelength
823 &PAF_AST_params_audioFrameFunctions, // pAudioFrameFunctions
824 &PAF_ASP_chainFxns, // pChainFxns
825 &PAF_AST_params_inpBufStatus, // pInpBufStatus
826 NULL, //PAF_AST_params_decodeStatus, // z_pDecodeStatus
827 &PAF_AST_params_outBufStatus, // pOutBufStatus
828 PAF_AST_params_encodeStatus, // z_pEncodeStatus
829 &PAF_AST_params_volumeStatus, // pVolumeStatus
830 &PAF_ASP_params_decAlgKey, // pDecAlgKey
831 &PAF_ASP_params_encAlgKey, // pEncAlgKey
832 &PAF_ASP_params_decSioMap, // pDecSioMap
833 PAF_AST_streamsFromDecodes_std, // streamsFromDecodes
834 PAF_AST_streamsFromEncodes_std, // streamsFromEncodes
835 PAF_ASOT_MAX_FRAMELENGTH, // maxFramelength
836 PAF_AST_streamOrder, // streamOrder
837 inpLinkInit, // i_inpLinkInit
838 outLinkInit, // i_outLinkInit
839 outNumBufMap, // poutNumBufMap
840 PAF_AST_params_MetadataBufStatus, // metadata buffer status
841 PAF_AST_params_AudioFrameBufStatus // Audio frame buffer status
842 };
845 // EOF