1bb59434824269b99a2d3a70a68d39c3a7bb6d25
2 /*
3 Copyright (c) 2017, 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 * ======== audioStreamInpProc.h ========
38 */
40 #ifndef _ASIP_H_
41 #define _ASIP_H_
43 #include <xdc/std.h>
44 #include <ti/sysbios/knl/Task.h>
46 #include "audioStreamProc_params.h"
47 #include "audioStreamProc_patchs.h"
48 #include "audioStreamProc_config.h"
49 #include "audioStreamProc_master.h"
50 #include "statusOp_common.h"
51 #include "ioPhy.h"
52 #include "ioBuff.h"
53 #include "ioData.h"
55 // Global debug counter */
56 extern Uint32 gTaskAsipCnt; // debug counter for ASP task
58 struct PAF_ASIT_Params;
59 struct PAF_ASIT_Patchs;
60 struct PAF_ASIT_Config;
62 // Audio Stream Input Task (ASIT) parameters, functions
63 typedef struct PAF_ASIT_Fxns {
64 Int (*initPhase[8]) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
65 //Int (*initFrame0) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
66 //Int (*initFrame1) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
67 Int (*passProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
68 //Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
69 Int (*autoProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, ALG_Handle);
70 Int (*decodeProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
71 Int (*decodeCommand) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
72 //Int (*encodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
73 Int (*decodeInit) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
74 Int (*decodeInfo) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
75 Int (*decodeInfo1) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
76 Int (*decodeInfo2) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
77 //Int (*decodeCont) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
78 Int (*decodeDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int, Int);
79 //Int (*decodeStream) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
80 //Int (*decodeEncode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
81 Int (*decodeFinalTest) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
82 Int (*decodeComplete) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, ALG_Handle *, Int, Int);
83 Int (*selectDevices) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
84 Int (*sourceDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
85 //Int (*startOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
86 //Int (*stopOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
87 //Int (*setCheckRateX) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
88 //Int (*streamChainFunction) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
89 Int (*deviceAllocate) (SIO_Handle *, int, int, int, Ptr);
90 Int (*deviceSelect) (SIO_Handle *, int, int, Ptr);
91 Int (*computeFrameLength) (Int, Int, Int);
92 Int (*updateInputStatus) (SIO_Handle, PAF_InpBufStatus *, PAF_InpBufConfig *);
93 //Int (*copy) (Uns, PAF_InpBufConfig *, Uns, PAF_OutBufConfig *);
95 // For RAM_report
96 Void (*headerPrint)();
97 Int (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
98 Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
99 Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
100 Void (*memStatusPrint)(
101 CString header,
102 HeapMem_Handle hInternalHeap,
103 HeapMem_Handle hInternal1Heap,
104 HeapMem_Handle hExternalHeap,
105 HeapMem_Handle hInternal1HeapShm,
106 HeapMem_Handle hExternalHeapShm,
107 HeapMem_Handle hExternalNoncachedHeapShm);
108 } PAF_ASIT_Fxns;
110 // Audio Stream Input Task (ASIT) parameters
111 typedef struct PAF_ASIT_Params {
112 const PAF_ASIT_Fxns *fxns;
113 struct {
114 SmInt master;
115 SmInt inputs;
116 SmInt input1;
117 SmInt inputN;
118 SmInt decodes;
119 SmInt decode1;
120 SmInt decodeN;
121 SmInt streams;
122 SmInt stream1; /* unused */
123 SmInt streamN; /* unused */
124 SmInt encodes;
125 SmInt encode1;
126 SmInt encodeN;
127 SmInt outputs;
128 SmInt output1;
129 SmInt outputN;
130 } zone;
131 const SmInt *inputsFromDecodes;
132 const SmInt *outputsFromEncodes;
133 struct {
134 int *pHeapIdIntern; // INT memory heap ID
135 int *pHeapIdExtern; // EXT memory heap ID
136 int *pHeapIdInpbuf; // IB buffer heap ID
137 int *pHeapIdOutbuf; // OB buffer heap ID
138 int *pHeapIdFrmbuf; // Frame buffer heap ID
139 int *pHeapIdIntern1; // INT1 memory heap ID
140 int *pHeapIdInt1Shm; // INT1 SHared Memory heap ID
141 int *pHeapIdExtShm; // EXT SHared Memory heap ID
142 int *pHeapIdExtNonCachedShm; // EXT Non-Cached SHared Memory heap ID
143 int clear;
144 } heap;
145 struct {
146 const IALG_MemSpace *space;
147 } common;
148 const LgInt *z_rx_bufsiz;
149 const LgInt *z_tx_bufsiz;
150 const SmInt *z_numchan;
151 MdInt framelength;
152 const PAF_AudioFunctions *pAudioFrameFunctions;
153 const struct PAF_ASP_ChainFxns *pChainFxns;
154 const PAF_InpBufStatus *pInpBufStatus;
155 const PAF_DecodeStatus * const *z_pDecodeStatus;
156 const PAF_OutBufStatus *pOutBufStatus;
157 const PAF_EncodeStatus * const *z_pEncodeStatus;
158 const PAF_VolumeStatus *pVolumeStatus;
159 const PAF_ASP_AlgKey *pDecAlgKey;
160 const PAF_ASP_AlgKey *pEncAlgKey;
161 const PAF_ASP_SioMap *pDecSioMap;
162 const SmInt *streamsFromDecodes;
163 const SmInt *streamsFromEncodes;
164 const MdInt maxFramelength;
165 const SmInt *streamOrder;
166 const PAF_ASP_LinkInit * const (*i_inpLinkInit);
167 const PAF_ASP_LinkInit * const (*i_outLinkInit);
168 const PAF_ASP_outNumBufMap * const (*poutNumBufMap);
169 const PAF_MetadataBufStatus *pMetadataBufStatus;
170 const PAF_AudioFrameBufStatus *pAudioFrameBufStatus;
171 const PAF_AST_DecOpCircBufStatus * const *z_pDecOpCircBufStatus;
172 } PAF_ASIT_Params;
174 // Audio Stream Input Task (ASIT) patchs
175 typedef struct PAF_ASIT_Patchs {
176 const PAF_SIO_ParamsN * devinp;
177 //const PAF_SIO_ParamsN * devout;
178 //const PAF_ASP_LinkInit * const (*i_decLinkInit);
179 //const PAF_ASP_LinkInit * const (*i_aspLinkInit)[GEARS];
180 //const PAF_ASP_LinkInit * const (*i_encLinkInit);
181 } PAF_ASIT_Patchs;
183 enum {
184 ASIP_NO_ERR,
185 ASIP_ERR_AUTO_DETECION,
186 ASIP_ERR_NO_MATCHING_SOURCE,
187 ASIP_ERR_SWITCH_TO_PCM,
188 ASIP_ERR_D10_CFG,
189 ASIP_ERR_MCASP_CFG,
190 ASIP_ERR_INPUT_CFG,
191 ASIP_ERR_DECODE_INIT,
192 ASIP_ERR_DECODE_COMMAND,
193 ASIP_ERR_DECODE_INFO1,
194 ASIP_ERR_DECODE_INFO2,
195 ASIP_ERR_DECODE_DATA,
196 ASIP_ERR_DECODE_FINAL,
197 ASIP_ERR_DECODE_COMPLETE,
198 ASIP_ERR_DECODE_MSG,
199 ASIP_ERR_DECODE_QUIT,
200 ASIP_ERR_ABORT
201 };
203 enum {
204 ASIT_NO_ERR,
205 ASIT_ERR_IOBUFF_INIT,
206 ASIT_ERR_IODATA_INIT,
207 ASIT_ERR_IOPYH_INIT,
208 ASIT_ERR_INPDATA_PROC,
209 ASIT_ERR_INPBUF_UNDERFLOW,
210 ASIT_ERR_AUTO_DETECION,
211 ASIT_ERR_NO_MATCHING_SOURCE,
212 ASIT_ERR_SWITCH_TO_PCM,
213 ASIT_ERR_D10_CFG,
214 ASIT_ERR_MCASP_CFG,
215 ASIT_ERR_INPUT_CFG,
216 ASIT_ERR_DECODE_INIT,
217 ASIT_ERR_DECODE,
218 ASIT_ERR_DECODE_COMMAND,
219 ASIT_ERR_DECODE_INFO1,
220 ASIT_ERR_DECODE_INFO2,
221 ASIT_ERR_DECODE_DATA,
222 ASIT_ERR_DECODE_FINAL,
223 ASIT_ERR_DECODE_COMPLETE,
224 ASIT_ERR_DECODE_MSG,
225 ASIT_ERR_DECODE_QUIT,
226 ASIP_ERR_DECODE_ABORT,
227 ASIT_ERR_EVENTS,
228 ASIT_ERR_ABORT
229 };
231 enum {
232 DEC_NO_ERR,
233 DEC_ERR_SOURCE_NONE,
234 DEC_ERR_ASPERR_ABORT,
235 DEC_ERR_ASPERR_QUIT,
236 DEC_ERR_WRONG_MSG,
237 DEC_ERR_INFO_SNDMSG,
238 DEC_ERR_INFO_ACKMSG,
239 DEC_ERR_DECODE_SNDMSG,
240 DEC_ERR_DECODE_ACKMSG,
241 DEC_ERR_DECODE_FINAL,
242 DEC_ERR_COMPLETE_MSG
243 };
246 #define DEC_MSGMSK_INPDATA 0x1
247 #define DEC_MSGMSK_INFOACK 0x2
248 #define DEC_MSGMSK_DECACK 0x4
251 // Input I/O structure
252 typedef struct PAF_AST_InpIO {
253 ioPhyHandle_t hIoPhy; /* handle to I/O physical layer */
254 ioBuffHandle_t hIoBuff; /* handle to I/O buffer management */
255 ioDataHandle_t hIoData; /* handle to I/O data processing */
256 Ptr hMcaspChan;
257 const void *pRxParams; /* pointer to D10 Rx Params */
259 Int sourceSelect;
260 Int sourceProgram;
262 Int preSyncState;
263 Int numPrimeXfers;
264 Int mcaspXferErr;
265 /*
266 void *mcaspRxBuf1;
267 void *mcaspRxBuf2;
268 uint32_t mcaspRxSize1;
269 uint32_t mcaspRxSize2;
270 Int mcaspRxtwoXfers;
271 */
272 // debugging counters
273 //uint32_t numXferStart;
274 //uint32_t numXferFinish;
275 //uint32_t numXferInterm;
276 uint32_t numInputOverrun;
277 uint32_t numUnderflow;
278 uint32_t numAsitRestart;
279 uint32_t numAsitDecodeQuit;
280 uint32_t numFrameReceived;
281 uint32_t numPcmFrameReceived;
283 size_t phyXferSize;
284 int_fast32_t pcmSwitchHangOver;
285 uint_least16_t asipState;
286 //uint_least16_t asipProcState;
287 bool buffReadComplete;
288 bool swapData;
289 bool firstTimeInit;
290 } PAF_AST_IoInp;
292 // Decoder structure
293 typedef struct asipDecProc_s {
294 Int state;
295 Int frame;
296 Int block;
298 Int majorAuFound;
299 Int initDone;
300 Int decodeAckDelayed;
301 } asipDecProc_t;
303 // Audio Stream Input Task (ASIT) configuration
304 typedef struct PAF_ASIT_Config {
305 Task_Handle taskHandle; // ASIT handle
306 ACP_Handle acp; // ASIT local ACP handle
307 PAF_ASPM_Config *pAspmCfg; // ASIT/ASOT shared configuration
308 PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
309 PAF_AST_IoInp *pIoInp;
310 asipDecProc_t inpDec;
311 } PAF_ASIT_Config;
314 // Purpose: Audio Stream Input Task Function for initialization of data pointers
315 // by allocation of memory.
316 Int
317 PAF_ASIT_initPhaseMalloc(
318 const PAF_ASIT_Params *pP,
319 const PAF_ASIT_Patchs *pQ,
320 PAF_ASIT_Config *pAsitCfg
321 );
323 // Purpose: Audio Stream Input Task Function for initialization of data values
324 // from parameters.
325 Int
326 PAF_ASIT_initPhaseConfig(
327 const PAF_ASIT_Params *pP,
328 const PAF_ASIT_Patchs *pQ,
329 PAF_ASIT_Config *pAsitCfg
330 );
332 // Purpose: Audio Stream Input Task Function for initialization of ACP by
333 // instantiation of the algorithm.
334 Int
335 PAF_ASIT_initPhaseAcpAlg(
336 const PAF_ASIT_Params *pP,
337 const PAF_ASIT_Patchs *pQ,
338 PAF_ASIT_Config *pAsitCfg
339 );
341 // (***) FL: re-visit this, ASIT/ASOT currently consider common memory independently.
342 // Should simultaneously consider all algs in ASIT/ASOT.
343 // Purpose: Audio Stream Input Task Function for allocation of common memory.
344 Int
345 PAF_ASIT_initPhaseCommon(
346 const PAF_ASIT_Params *pP,
347 const PAF_ASIT_Patchs *pQ,
348 PAF_ASIT_Config *pAsitCfg
349 );
351 // Purpose: Audio Stream Input Task Function for initialization of ASP algorithms.
352 Int
353 PAF_ASIT_initPhaseAspAlg(
354 const PAF_ASIT_Params *pP,
355 const PAF_ASIT_Patchs *pQ,
356 PAF_ASIT_Config *pAsitCfg
357 );
359 // Purpose: Audio Stream Input Task Function for initialization of data values
360 // from parameters for Algorithm Keys.
361 Int
362 PAF_ASIT_initPhaseAlgKey(
363 const PAF_ASIT_Params *pP,
364 const PAF_ASIT_Patchs *pQ,
365 PAF_ASIT_Config *pAsitCfg
366 );
368 // Purpose: Audio Stream Input Task Function for initialization of Decoder Output Circular Buffer.
369 Int
370 PAF_ASIT_initPhaseDecOpCircBuf(
371 const PAF_ASIT_Params *pP,
372 const PAF_ASIT_Patchs *pQ,
373 PAF_ASIT_Config *pAsitCfg
374 );
376 // Purpose: Audio Stream Input Task Function for initialization of Input Devices.
377 Int
378 PAF_ASIT_initPhaseDevice(
379 const PAF_ASIT_Params *pP,
380 const PAF_ASIT_Patchs *pQ,
381 PAF_ASIT_Config *pAsitCfg
382 );
384 // Purpose: Audio Stream Input Task Function for initialization of Output Init-Sync.
385 Int
386 PAF_ASIT_initPhaseOutIS(
387 const PAF_ASIT_Params *pP,
388 const PAF_ASIT_Patchs *pQ,
389 PAF_ASIT_Config *pAsdtCfg
390 );
393 #if 0
394 // Purpose: Audio Stream Task Function for initialization or reinitiali-
395 // zation of the Audio Frame(s) by loading of data values of a
396 // time-varying nature.
397 Int
398 PAF_AST_initFrame1(
399 const PAF_ASIT_Params *pP,
400 const PAF_ASIT_Patchs *pQ,
401 PAF_AST_Config *pAsitCfg,
402 Int z,
403 Int apply
404 );
405 #endif
407 // Purpose: Audio Stream Task Function for processing audio data to
408 // determine the input type without output.
409 Int
410 PAF_ASIT_autoProcessing(
411 const PAF_ASIT_Params *pP,
412 const PAF_ASIT_Patchs *pQ,
413 PAF_ASIT_Config *pAsitCfg,
414 Int inputTypeSelect,
415 ALG_Handle pcmAlgMaster);
417 // Purpose: Audio Stream Input Task Function for processing audio data.
418 //
419 Int
420 PAF_ASIT_decodeProcessing(
421 const PAF_ASIT_Params *pP,
422 const PAF_ASIT_Patchs *pQ,
423 PAF_ASIT_Config *pAsitCfg,
424 Int sourceSelect
425 );
427 // Purpose: Decoding Function for processing Decode Commands.
428 Int
429 PAF_ASIT_decodeCommand(
430 const PAF_ASIT_Params *pP,
431 const PAF_ASIT_Patchs *pQ,
432 PAF_ASIT_Config *pAsitCfg
433 );
435 // Purpose: Decoding Function for reinitializing the decoding process.
436 Int
437 PAF_ASIT_decodeInit(
438 const PAF_ASIT_Params *pP,
439 const PAF_ASIT_Patchs *pQ,
440 PAF_ASIT_Config *pAsitCfg,
441 Int sourceSelect
442 );
444 // Purpose: Decoding Function for processing information in a manner that
445 // is common for both initial and subsequent frames of input data.
446 Int
447 PAF_ASIT_decodeInfo(
448 const PAF_ASIT_Params *pP,
449 const PAF_ASIT_Patchs *pQ,
450 PAF_ASIT_Config *pAsitCfg,
451 Int frame,
452 Int block
453 );
455 // Purpose: Decoding Function for processing information in a manner that
456 // is unique to initial frames of input data.
457 Int
458 PAF_ASIT_decodeInfo1(
459 const PAF_ASIT_Params *pP,
460 const PAF_ASIT_Patchs *pQ,
461 PAF_ASIT_Config *pAsitCfg,
462 Int frame,
463 Int block
464 );
466 // Purpose: Decoding Function for processing information in a manner that
467 // is unique to frames of input data other than the initial one.
468 Int
469 PAF_ASIT_decodeInfo2(
470 const PAF_ASIT_Params *pP,
471 const PAF_ASIT_Patchs *pQ,
472 PAF_ASIT_Config *pAsitCfg,
473 Int frame,
474 Int block
475 );
477 #if 0
478 // Purpose: Decoding Function for processing that occurs subsequent to
479 // information processing but antecedent to timing processing
480 // for frames of input data other than the initial one.
481 Int
482 PAF_AST_decodeCont(
483 const PAF_ASIT_Params *pP,
484 const PAF_ASIT_Patchs *pQ,
485 PAF_ASIT_Config *pAsitCfg,
486 ALG_Handle decAlg[],
487 Int frame,
488 Int block
489 );
490 #endif
492 // Purpose: Decoding Function for processing of input data by the
493 // Decode Algorithm.
494 Int
495 PAF_ASIT_decodeDecode(
496 const PAF_ASIT_Params *pP,
497 const PAF_ASIT_Patchs *pQ,
498 PAF_ASIT_Config *pAsitCfg,
499 Int sourceSelect,
500 Int frame,
501 Int block
502 );
504 // Purpose: Decoding Function for determining whether processing of the
505 // current frame is complete.
506 Int
507 PAF_ASIT_decodeFinalTest(
508 const PAF_ASIT_Params *pP,
509 const PAF_ASIT_Patchs *pQ,
510 PAF_ASIT_Config *pAsitCfg,
511 Int frame,
512 Int block
513 );
515 // Purpose: Decoding Function for terminating the decoding process.
516 Int
517 PAF_ASIT_decodeComplete(
518 const PAF_ASIT_Params *pP,
519 const PAF_ASIT_Patchs *pQ,
520 PAF_ASIT_Config *pAsitCfg,
521 ALG_Handle decAlg[],
522 Int frame,
523 Int block
524 );
526 // Purpose: Audio Stream Input Task Function for selecting the devices used
527 // for input.
528 Int
529 PAF_ASIT_selectDevices(
530 const PAF_ASIT_Params *pP,
531 const PAF_ASIT_Patchs *pQ,
532 PAF_ASIT_Config *pAsitCfg
533 );
535 // Purpose: Audio Stream Input Task Function for selecting the sources used
536 // for decoding of input to output.
537 Int
538 PAF_ASIT_sourceDecode(
539 const PAF_ASIT_Params *pP,
540 const PAF_ASIT_Patchs *pQ,
541 PAF_ASIT_Config *pAsitCfg,
542 Int x
543 );
545 // Purpose: Decoding Function for terminating output.
546 Int
547 PAF_AST_stopOutput(
548 const PAF_ASIT_Params *pP,
549 const PAF_ASIT_Patchs *pQ,
550 PAF_ASIT_Config *pAsitCfg
551 );
553 // Purpose: Common Function for processing algorithm chains.
554 Int
555 PAF_AST_streamChainFunction(
556 const PAF_ASIT_Params *pP,
557 const PAF_ASIT_Patchs *pQ,
558 PAF_ASIT_Config *pAsitCfg,
559 Int iChainFrameFxns,
560 Int abortOnError,
561 Int logArg
562 );
564 // Purpose: writing 8-bit integer to shared memeory
565 static inline
566 sharedMemWriteInt8(
567 volatile XDAS_Int8 *address, /* address to write to */
568 Int8 value, /* value to write to the adddress */
569 Int gateIdx) /* GateMP Index, defined in statusOp_common.h */
570 {
571 #ifdef NON_CACHE_STATUS
572 statusOp_write((void *)address, (void *)&value, sizeof(Int8), gateIdx);
573 #else
574 *address = value;
575 #endif
576 }
578 // Purpose: read 8-bit integer from shared memeory
579 static inline Int8 /* return the value read in the shared memory */
580 sharedMemReadInt8(
581 volatile XDAS_Int8 *address, /* address to read from */
582 Int gateIdx) /* GateMP Index, defined in statusOp_common.h */
583 {
584 #ifdef NON_CACHE_STATUS
585 Int8 tempVar;
586 statusOp_read((void *)&tempVar, (void *)address, sizeof(Int8), gateIdx);
588 return tempVar;
589 #else
590 return(*address);
591 #endif
592 }
594 // Purpose: writing 32-bit integer to shared memeory
595 static inline sharedMemWriteInt(volatile XDAS_Int32 *address, Int value, Int gateIdx)
596 {
597 #ifdef NON_CACHE_STATUS
598 statusOp_write((void *)address, (void *)&value, sizeof(Int), gateIdx);
599 #else
600 *address = value;
601 #endif
602 }
604 // Purpose: read 32-bit integer from shared memeory
605 static inline Int sharedMemReadInt(volatile XDAS_Int32 *address, Int gateIdx)
606 {
607 #ifdef NON_CACHE_STATUS
608 Int tempVar;
609 statusOp_read((void *)&tempVar, (void *)address, sizeof(Int), gateIdx);
611 return tempVar;
612 #else
613 return(*address);
614 #endif
615 }
617 Int asitUpdateInputStatus(const void *pRxParams, PAF_InpBufStatus *pStatus,
618 PAF_InpBufConfig *pInpBuf);
619 /*
620 Int asipDecodeInit(
621 const PAF_ASIT_Params *pP,
622 PAF_ASIT_Config *pAsitCfg,
623 Int sourceSelect);
624 */
625 /*Int asipDecodeProcessing(
626 const PAF_ASIT_Params *pP,
627 const PAF_ASIT_Patchs *pQ,
628 PAF_ASIT_Config *pAsitCfg,
629 Int sourceSelect);*/
630 Int asitDecodeProcessing(const PAF_ASIT_Params *pP,
631 const PAF_ASIT_Patchs *pQ,
632 PAF_ASIT_Config *pAsitCfg,
633 UInt asitEvents);
635 Int decDecodeInit(
636 const PAF_ASIT_Params *pP,
637 PAF_ASIT_Config *pAsitCfg,
638 Int sourceSelect);
640 Int decDecodeFsm(
641 const PAF_ASIT_Params *pP,
642 const PAF_ASIT_Patchs *pQ,
643 PAF_ASIT_Config *pAsitCfg,
644 Int sourceSelect,
645 UInt decMsg);
647 Int getFrameLengthSourceSel(
648 const PAF_ASIT_Params *pP,
649 Int8 sourceSelect);
651 Int rxDecodePcm(PAF_AST_IoInp *pInp);
653 Int rxDecodeBitStream(PAF_AST_IoInp *pInp);
655 Int rxDecodePlayZero(PAF_AST_IoInp *pInp);
657 #endif /* _ASIP_H_ */