summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11ac901)
raw | patch | inline | side by side (parent: 11ac901)
author | Frank Livingston <frank-livingston@ti.com> | |
Mon, 5 Sep 2016 19:21:24 +0000 (14:21 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Mon, 5 Sep 2016 19:21:24 +0000 (14:21 -0500) |
Customize ASIT params, patchs, and configuration for ASIT
- Params with corresponding settings on ASDT/ASOT should have the same
value as the ASDT/ASOT values. This can be changed in future with
ARM/DSP common (shared) params data
- ASIT config has local configuration (currently ACP handle) and
pointer to commmon (shared) ARM/DSP configuration.
- Params with corresponding settings on ASDT/ASOT should have the same
value as the ASDT/ASOT values. This can be changed in future with
ARM/DSP common (shared) params data
- ASIT config has local configuration (currently ACP handle) and
pointer to commmon (shared) ARM/DSP configuration.
12 files changed:
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_config.h b/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_config.h
index 7c47a85226f5385c63465eb5f8ee2314669115a4..e8f3ab626047b0c1bb7a018423949d554cfb9b1a 100644 (file)
// Framework -- Configuration Declarations
//
-#ifndef _AS1_F2_CONFIG_H_
-#define _AS1_F2_CONFIG_H_
+#ifndef _ASP_CONFIG_H_
+#define _ASP_CONFIG_H_
#include <xdc/std.h>
//#include <ti/procsdk_audio/procsdk_audio_typ.h>
extern PAF_AST_Config *pC; /* Global configuration pointer */
-#endif /* _AS1_F2_CONFIG_H_ */
+#endif /* _ASP_CONFIG_H_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_params.h b/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_params.h
index c748716b3bdf6e8ca976aae9ed09f33e19d8e757..725395d7b2d5e73e12a27b357a15409a34b4729b 100644 (file)
// Framework Parameter Declarations
//
-#ifndef _AS1_F2_PARAMS_H_
-#define _AS1_F2_PARAMS_H_
+#ifndef _ASP_PARAMS_H_
+#define _ASP_PARAMS_H_
//#include <ti/procsdk_audio/procsdk_audio_typ.h>
#include <procsdk_audio_typ.h>
const PAF_AudioFrameBufStatus *pAudioFrameBufStatus;
} PAF_AST_Params;
-#endif /* _AS1_F2_PARAMS_H_ */
+#endif /* _ASP_PARAMS_H_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_patchs.h b/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_patchs.h
index 3a79920484646fbf44d1d3d11d383fff9ebe9c1e..e7f94ba221ab7c915ccfbabe6daf5931448ade54 100644 (file)
//
//
-#ifndef AS1_F2_PATCHS_
-#define AS1_F2_PATCHS_
+#ifndef _ASP_PATCHS_
+#define _ASP_PATCHS_
#include <xdc/std.h>
#include <pafsio.h>
const PAF_ASP_LinkInit * const (*i_encLinkInit);
} PAF_AST_Patchs;
-#endif /* AS1_F2_PATCHS_ */
+#endif /* _ASP_PATCHS_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c
index 73bf82f33e4470c44222811b9e98444408dbad09..5d3c2f18c7e910c9bc1c35c2ca02a8b601c5295d 100644 (file)
#define __TASK_NAME__ "TaskAsdp"
-LINNO_DEFN(TaskAsdp); /* Line number macros */
-ERRNO_DEFN(TaskAsdp); /* Error number macros */
-
extern struct {
Int size;
IALG_Status *pStatus[512];
extern const char AFChanPtrMap[PAF_MAXNUMCHAN+1][PAF_MAXNUMCHAN];
extern PAF_ChannelConfigurationMaskTable PAF_ASP_stdCCMT;
+LINNO_DEFN(TaskAsdp); /* Line number macros */
+ERRNO_DEFN(TaskAsdp); /* Error number macros */
+
// ASDT configuration
PAF_ASDT_Config gPAF_ASDT_config
__attribute__ ((section(".globalSectionPafAsdtConfig"))) = {
return;
}
+ //
+ // Audio Framework Configuration (*pC):
+ //
+ pC = &gPAF_ASDT_config;
+ pAstCfg = pC->pAstCfg;
+
// wait for initialization message from master
do {
status = MessageQ_get(hAspMsgSlave->slaveQue, (MessageQ_Msg *)&pAspMsg, MessageQ_FOREVER);
gSlaveStartCnt++;
TRACE_MSG3("Rx ASP message, procId=%d, cmd=%d, messageId=0x%04x", pAspMsg->procId, pAspMsg->cmd, pAspMsg->messageId);
- Cache_inv(&gPAF_AST_config, sizeof(PAF_AST_Config), Cache_Type_ALLD, 0);
+ Cache_inv(pAstCfg, sizeof(PAF_AST_Config), Cache_Type_ALLD, 0);
// FL: no need to share this pointer, can be local
//Cache_inv(&pC, sizeof(PAF_AST_Config *), Cache_Type_ALLD, 0);
Cache_wait();
// (***) FL: revisit
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// (***) FL: revisit
Cache_inv((Ptr)(&IACP_STD_BETA_TABLE.pStatus[0]), 512*sizeof(IALG_Status *), Cache_Type_ALLD, 0); // invalidate entire beta table
Cache_wait();
-
- //
- // Audio Framework Configuration (*pC):
- //
- pC = &gPAF_ASDT_config;
- pAstCfg = pC->pAstCfg;
- as = pAstCfg->as; // obtain audio stream number
+
+ /* Obtain Audio Stream Number (1, 2, etc.) */
+ as = pAstCfg->as;
TRACE_TERSE1("TaskAsdp: Started with AS%d.", as);
//
// (***) FL: revisit
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// Send initialization complete message to master
TRACE_MSG2("slaveCmd=%d, decIdx=%d", slaveCmd, z);
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
if (alg[z]->fxns->algActivate)
}
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// (***) FL: revisit
// (***) FL: revisit
// invalidate Inp configuration
- Cache_inv(&gPAF_AST_config.xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
// invalidate input data
- pIpBufConfig = &gPAF_AST_config.xInp[zI].inpBufConfig;
+ pIpBufConfig = &pAstCfg->xInp[zI].inpBufConfig;
size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
if (sourceSelect == PAF_SOURCE_PCM)
{
}
Cache_inv((Ptr)pIpBufConfig->pntr.pSmInt, size, Cache_Type_ALLD, 0);
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
// status for selected decoder should be invalidated
Cache_wait();
}
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// Re-initialize audio frame if decoder is disabled or
resetAfSamsiz(z);
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
//TRACE_TERSE0("Dec:cache wb done");
}
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// Re-initialize audio frame if decoder is disabled or
return 0;
} //PAF_AST_initPhaseAlgKey
+// Purpose: Audio Stream Decode Task Function for initialization of the Audio
+// Frame(s) by memory allocation and loading of data pointers
+// and values.
Int
PAF_ASDT_initFrame0(
const PAF_ASDT_Params *pP,
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.h b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.h
index 2f3ccb48dce19dbc7ce42f77945b56d4ebd872d6..da0aacef8a973d9dfe8ca009ef762fd39c9d7c5e 100644 (file)
PAF_ASDT_Config *pC
);
+// Purpose: Audio Stream Decode Task Function for initialization of the Audio
+// Frame(s) by memory allocation and loading of data pointers
+// and values.
Int
PAF_ASDT_initFrame0(
const PAF_ASDT_Params *pP,
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/app.cmd b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/application/app.cmd
index 127fcd6989a6f8cc0ceecf86356db99dbeaca128..eb2973f47737b670ad3a52547ef0e7ccb50e71ee 100644 (file)
SECTIONS
{
+ .globalSectionPafAsitConfig :> CORE0_DDR3
+
GROUP: {
.commonSectionPafAstConfig
.commonSectionAcpStdBetaTable
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c
index 61f28f204ee742aeb757121fb4e68517545a739c..af8c939b4ba77a46974d7eeae776e18eec261763 100644 (file)
#include "audioStreamProc_params.h"
#include "audioStreamProc_patchs.h"
#include "audioStreamProc_config.h"
+#include "audioStreamInpProc.h"
//
// Audio Stream Definitions
#define MINFRAMELENGTH 24
#define PA_MODULO 8 // also defined independently in ARC2 code, and may be hard coded other places.
-#if 0 // (***) FL: no longer used w/ removal of CONTINUOUS mode
-Int PAF_AST_decodeHandleErrorInput (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, ALG_Handle decAlg[], Int z, Int error);
-#endif
-
//
// Decoder Definitions
@@ -289,6 +286,13 @@ Int PAF_AST_decodeHandleErrorInput (const PAF_AST_Params *pP, const PAF_AST_Patc
LINNO_DEFN(TaskAsip); /* Line number macros */
ERRNO_DEFN(TaskAsip); /* Error number macros */
+// ASIT configuration
+#pragma DATA_SECTION(gPAF_ASIT_config, ".globalSectionPafAsitConfig")
+PAF_ASIT_Config gPAF_ASIT_config = {
+ NULL,
+ &gPAF_AST_config
+};
+
// Global debug counters */
UInt32 gTaskAsipCnt=0; // debug
UInt32 gAsipInitCnt =0;
*/
Void taskAsipFxn(
// Int betaPrimeValue, // FL: revisit
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ
)
{
- // Task data
- //PAF_AST_Config PAF_AST_config; /* Local configuration */
- PAF_AST_Config *pC; /* Local configuration pointer */
- // Local data
+ PAF_ASIT_Config *pC; /* Local configuration pointer */
+ PAF_AST_Config *pAstCfg; /* Common (shared) configuration pointer */
Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* input/encode/stream/decode/output counter */
Int i; /* phase */
//
// Audio Framework Configuration (*pC):
//
- pC = &gPAF_AST_config;
- as = gBetaPrimeValue + 1; /* Audio Stream Number (1, 2, etc.) */
- pC->as = as;
+ pC = &gPAF_ASIT_config;
+ pAstCfg = pC->pAstCfg;
+
+ /* Set Audio Stream Number (1, 2, etc.) */
+ as = gBetaPrimeValue + 1;
+ pAstCfg->as = as;
TRACE_TERSE1("TaskAsip: Started with AS%d.", as);
//
// Determine decoder and stream indices associated with the master input
//
zMI = pP->zone.master;
- pC->masterDec = zMI;
- pC->masterStr = zMI;
+ pAstCfg->masterDec = zMI;
+ pAstCfg->masterStr = zMI;
for (zX = DECODE1; zX < DECODEN; zX++)
{
if (pP->inputsFromDecodes[zX] == zMI)
{
- pC->masterDec = zX;
- pC->masterStr = pP->streamsFromDecodes[zX];
+ pAstCfg->masterDec = zX;
+ pAstCfg->masterStr = pP->streamsFromDecodes[zX];
break;
}
}
- zMD = pC->masterDec;
- zMS = pC->masterStr;
+ zMD = pAstCfg->masterDec;
+ zMS = pAstCfg->masterStr;
// Initialize as per parametrized phases:
//
// - Common: Common Memory Initialization
// - AlgKey: Dec/Enc chain to Array Initialization
// - Device: I/O Device Initialization
- // - Unused: (available)
+ // - DecOpCircBuf: Decoder Output Circular Buffer
// - Unused: (available)
//
LINNO_RPRT(TaskAsip, -2);
// (***) FL: revisit
// write back configuration
- Cache_wb(&gPAF_AST_config, sizeof(PAF_AST_Config), Cache_Type_ALLD, 0);
+ Cache_wb(pAstCfg, sizeof(PAF_AST_Config), Cache_Type_ALLD, 0);
// FL: no need to share this pointer, can be local
//Cache_wb(&pC, sizeof(PAF_AST_Config *), Cache_Type_ALLD, 0);
Cache_wait();
// (***) FL: revisit
// write Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// (***) FL: revisit
{
for (z=INPUT1; z < INPUTN; z++)
{
- if (pC->xInp[z].hRxSio)
+ if (pAstCfg->xInp[z].hRxSio)
{
- SIO_idle(pC->xInp[z].hRxSio);
+ SIO_idle(pAstCfg->xInp[z].hRxSio);
}
}
// if no master input selected then we don't know what may be at the input
// so set to unknown and skip any remaining processing
- if (!pC->xInp[zMI].hRxSio)
+ if (!pAstCfg->xInp[zMI].hRxSio)
{
- pC->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_UNKNOWN;
+ pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_UNKNOWN;
TRACE_VERBOSE1("TaskAsip: AS%d: No input selected...", as+zMS);
continue;
}
// if here then we have a valid input so query its status
- if (errno = pP->fxns->updateInputStatus(pC->xInp[zMI].hRxSio, &pC->xInp[zMI].inpBufStatus, &pC->xInp[zMI].inpBufConfig))
+ if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zMI].hRxSio, &pAstCfg->xInp[zMI].inpBufStatus, &pAstCfg->xInp[zMI].inpBufConfig))
{
TRACE_VERBOSE1("TaskAsip: continue as updateInputStatus returns 0x%x", errno);
continue;
}
// If master decoder is not enabled, or the input is unlocked, then do nothing
- if (!pC->xDec[zMD].decodeStatus.mode || !pC->xInp[zMI].inpBufStatus.lock)
+ if (!pAstCfg->xDec[zMD].decodeStatus.mode || !pAstCfg->xInp[zMI].inpBufStatus.lock)
{
TRACE_VERBOSE0("TaskAsip: Not locked, continue");
continue;
}
// If no source selected then do nothing
- if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
+ if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
{
- pC->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_NONE;
+ pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_NONE;
TRACE_VERBOSE1("TaskAsip: AS%d: no source selected, continue", as+zMS);
continue;
}
// If we want pass processing then proceed directly
- if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_PASS)
+ if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_PASS)
{
TRACE_VERBOSE1("TaskAsip: AS%d: Pass processing ...", as+zMS);
- pC->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_PASS;
+ pAstCfg->xDec[zMD].decodeStatus.sourceProgram = PAF_SOURCE_PASS;
pP->fxns->sourceDecode(pP, pQ, pC, PAF_SOURCE_PASS);
if (pP->fxns->passProcessing)
{
// If no decoder selected then do nothing. Need to reset the sourceProgram, since
// when no decoder is selected there are no calls to IB
//if (errno = pP->fxns->autoProcessing(pP, pQ, pC, pC->xDec[zMD].decodeStatus.sourceSelect, pC->xDec[zMD].decAlg[PAF_SOURCE_PCM]))
- if (errno = pP->fxns->autoProcessing(pP, pQ, pC, pC->xDec[zMD].decodeStatus.sourceSelect, NULL)) // (***) FL: hard-coded to use PCM framelength inside function
+ if (errno = pP->fxns->autoProcessing(pP, pQ, pC, pAstCfg->xDec[zMD].decodeStatus.sourceSelect, NULL)) // (***) FL: re-visit this, hard-coded to use PCM framelength inside function
{
TRACE_VERBOSE1("TaskAsip: autoProcessing returns 0x%x, continue", errno);
continue;
}
// query for input type
- if (errno = SIO_ctrl(pC->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM, (Arg )&sourceProgram))
+ if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM, (Arg )&sourceProgram))
{
TRACE_TERSE2("TaskAsip: SIO_ctrl returns 0x%x, then 0x%x, continue", errno, ASPERR_AUTO_PROGRAM);
errno = ASPERR_AUTO_PROGRAM;
continue;
}
- pC->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
+ pAstCfg->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
// if input is unclassifiable then do nothing
if (sourceProgram == PAF_SOURCE_UNKNOWN)
// input frame, we determine whether or not to call decodeProcessing and with
// what decAlg.
sourceSelect = PAF_SOURCE_NONE;
- switch (pC->xDec[zMD].decodeStatus.sourceSelect)
+ switch (pAstCfg->xDec[zMD].decodeStatus.sourceSelect)
{
// If autodetecting, decoding everything, and input is something
// (i.e. bitstream or PCM) then decode.
// If user made specific selection then program must match select.
// (NB: this compare relies on ordering of PAF_SOURCE)
default:
- sourceSelect = pC->xDec[zMD].decodeStatus.sourceSelect;
+ sourceSelect = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
if ((sourceSelect >= PAF_SOURCE_PCM) && (sourceSelect <= PAF_SOURCE_N))
{
if (sourceProgram != sourceSelect)
TRACE_VERBOSE1(procName[sourceProgram], as+zMS);
TRACE_VERBOSE0("TaskAsip: calling decodeProcessing.");
- //errno = pP->fxns->decodeProcessing(pP, pQ, pC, pC->xDec[zMD].decAlg[sourceSelect]);
- //errno = pP->fxns->decodeProcessing(pP, pQ, pC, NULL); // (***) FL: dec handle doesn't exist on Master (DSP)
- //errno = pP->fxns->decodeProcessing(pP, pQ, pC, NULL, sourceSelect);
errno = pP->fxns->decodeProcessing(pP, pQ, pC, sourceSelect);
if (errno)
{
//
Int
PAF_ASIT_initPhaseMalloc(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int zMS = pC->masterStr;
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int zMS;
Error_Block eb;
- Int i;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMS = pAstCfg->masterStr;
+
TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: initialization phase - memory allocation", as+zMS);
// Initialize error block
Error_init(&eb);
/* Input memory */
- if (!(pC->xInp = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
- INPUTN * sizeof (*pC->xInp), 4, &eb)))
+ if (!(pAstCfg->xInp = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
+ INPUTN * sizeof (*pAstCfg->xInp), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
TRACE_TERSE3("PAF_ASIT_initPhaseMalloc. (pC->xInp) %d bytes from space %d at 0x%x.",
- INPUTN * sizeof (*pC->xInp),
- HEAP_ID_INTERNAL1_SHM, (IArg)pC->xInp);
+ INPUTN * sizeof (*pAstCfg->xInp),
+ HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xInp);
/* Decode memory */
- if (!(pC->xDec = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
- DECODEN * sizeof (*pC->xDec), 4, &eb)))
+ if (!(pAstCfg->xDec = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
+ DECODEN * sizeof (*pAstCfg->xDec), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
TRACE_TERSE3("PAF_ASIT_initPhaseMalloc. (pC->xDec) %d bytes from space %d at 0x%x.",
- DECODEN * sizeof (*pC->xDec),
- HEAP_ID_INTERNAL1_SHM, (IArg)pC->xDec);
+ DECODEN * sizeof (*pAstCfg->xDec),
+ HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xDec);
TRACE_TERSE1("PAF_ASIT_initPhaseMalloc: AS%d: initialization phase - memory allocation complete.", as+zMS);
return 0;
//
Int
PAF_ASIT_initPhaseConfig(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* input/encode/stream/decode/output counter */
- Int zMS = pC->masterStr;
- Int errno; /* error number */
-
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* input/encode/stream/decode/output counter */
+ Int zMS;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMS = pAstCfg->masterStr;
+
TRACE_TERSE1("PAF_ASIT_initPhaseConfig: AS%d: initialization phase - configuration", as+zMS);
//
for (z=INPUT1; z < INPUTN; z++)
{
- pC->xInp[z].inpBufStatus = *pP->pInpBufStatus;
- pC->xInp[z].inpBufConfig.pBufStatus = &pC->xInp[z].inpBufStatus;
+ pAstCfg->xInp[z].inpBufStatus = *pP->pInpBufStatus;
+ pAstCfg->xInp[z].inpBufConfig.pBufStatus = &pAstCfg->xInp[z].inpBufStatus;
}
for (z=DECODE1; z < DECODEN; z++)
{
Int zI = pP->inputsFromDecodes[z];
- pC->xDec[z].decodeControl.size = sizeof(pC->xDec[z].decodeControl);
- pC->xDec[z].decodeControl.pInpBufConfig = (const PAF_InpBufConfig *)&pC->xInp[zI].inpBufConfig;
+ pAstCfg->xDec[z].decodeControl.size = sizeof(pAstCfg->xDec[z].decodeControl);
+ pAstCfg->xDec[z].decodeControl.pInpBufConfig = (const PAF_InpBufConfig *)&pAstCfg->xInp[zI].inpBufConfig;
//pC->xDec[z].decodeStatus = *pP->z_pDecodeStatus[z]; // FL: slave
}
//
Int
PAF_ASIT_initPhaseAcpAlg(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* input/encode/stream/decode/output counter */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* input/encode/stream/decode/output counter */
Int betaPrimeOffset;
ACP_Handle acp;
- Int zMS = pC->masterStr;
+ Int zMS;
Int zS, zX;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMS = pAstCfg->masterStr;
+
TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: initialization phase - ACP Algorithm", as+zMS);
ACP_MDS_init();
- if (!(acp = (ACP_Handle )ACP_MDS_create(NULL)))
+ if (!(acp = (ACP_Handle)ACP_MDS_create(NULL)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
return __LINE__;
}
acp->fxns->attach(acp, ACP_SERIES_STD,
STD_BETA_IB + betaPrimeOffset * (as-1+zS),
- (IALG_Status *)&pC->xInp[z].inpBufStatus);
- /* Ignore errors, not reported. */
- }
-
-#if 0 // FL: slave
- for (z=DECODE1; z < DECODEN; z++)
- {
- zS = pP->streamsFromDecodes[z];
- acp->fxns->attach(acp, ACP_SERIES_STD,
- STD_BETA_DECODE + betaPrimeOffset * (as-1+zS),
- (IALG_Status *)&pC->xDec[z].decodeStatus);
+ (IALG_Status *)&pAstCfg->xInp[z].inpBufStatus);
/* Ignore errors, not reported. */
}
-#endif
TRACE_TERSE1("PAF_ASIT_initPhaseAcpAlg: AS%d: initialization phase - ACP Algorithm complete.", as+zMS);
//
Int
PAF_ASIT_initPhaseCommon(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* stream counter */
- //Int g; /* gear */
- ACP_Handle acp = pC->acp;
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* stream counter */
+ ACP_Handle acp;
PAF_IALG_Config pafAlgConfig;
IALG_MemRec common[3][PAF_IALG_COMMON_MEMN+1];
+ acp = pC->acp;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+
TRACE_TERSE0("PAF_ASIT_initPhaseCommon: initialization phase - Common Memory");
//
for (z = STREAM1; z < STREAMN; z++)
{
- //Int zD, zE, zX;
-
TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: initialization phase - Common Memory", as+z);
//
//
PAF_ALG_init(common[z], lengthof(common[z]), COMMONSPACE);
-#if 0 // FL: slave
- zD = -1;
- for (zX = DECODE1; zX < DECODEN; zX++)
- {
- if (pP->streamsFromDecodes[zX] == z)
- {
- zD = zX;
- break;
- }
- }
-#endif
-
-#if 0 // FL: slave
- if (zD >= 0)
- {
- TRACE_TERSE3("%s.%d: calling PAF_ALG_ALLOC for decoder common[%d].", (IArg)__FUNCTION__, __LINE__, z);
- if (PAF_ALG_ALLOC(decLinkInit[zD-DECODE1], common[z]))
- {
- TRACE_TERSE3("AS%d: %s.%d: PAF_ALG_alloc failed", as+z, (IArg)__FUNCTION__, __LINE__);
- TRACE_TERSE2("Failed to alloc %d bytes from space %d", common[z]->size, common[z]->space);
-
- SW_BREAKPOINT;
- return __LINE__;
- }
- TRACE_TERSE3("alloced %d bytes from space %d at 0x%x", common[z]->size, common[z]->space, (IArg)common[z]->base);
- if (pP->fxns->allocPrint)
- {
- pP->fxns->allocPrint ((const PAF_ALG_AllocInit *)(decLinkInit[z-DECODE1]),sizeof (*(decLinkInit[z-DECODE1])), &pafAlgConfig);
- }
- }
-#endif
-
//
// Determine common memory needs of Logical Input driver
//
//
for (z = STREAM1; z < STREAMN; z++)
{
- //Int zD, zE, zX;
-
TRACE_TERSE0("PAF_ASIT_initPhaseCommon: calling PAF_ALG_mallocMemory for common space.");
if (PAF_ALG_mallocMemory(common[z], &pafAlgConfig))
{
pP->fxns->commonPrint(common[z], &pafAlgConfig);
}
-#if 0 // FL: slave
- zD = -1;
- for (zX = DECODE1; zX < DECODEN; zX++)
- {
- if (pP->streamsFromDecodes[zX] == z)
- {
- zD = zX;
- break;
- }
- }
-#endif
-
-#if 0 // FL: slave
- if (zD >= 0)
- {
- PAF_ASP_Chain *chain;
- TRACE_TERSE2("PAF_ASIT_initPhaseCommon: calling PAF_ASP_chainInit for decode.");
- chain = PAF_ASP_chainInit(&pC->xDec[zD].decChainData, pP->pChainFxns,
- HEAP_INTERNAL, as+z, acp, &trace,
- decLinkInit[zD-DECODE1], NULL, common[z], &pafAlgConfig);
- if (!chain)
- {
- TRACE_TERSE1("PAF_ASIT_initPhaseCommon: AS%d: Decode chain initialization failed", as+z);
- return __LINE__;
- }
- }
-#endif
-
//
// Allocate non-common memories for Logical IO drivers
// Since these structures are used at run-time we allocate from external memory
PAF_ASP_Chain *chain;
TRACE_TERSE2("PAF_ASIT_initPhaseCommon: AS%d: non-common input chain init for %d",
as+z, z);
- chain = PAF_ASP_chainInit(&pC->xInp[z].inpChainData, pP->pChainFxns,
+ chain = PAF_ASP_chainInit(&pAstCfg->xInp[z].inpChainData, pP->pChainFxns,
HEAP_EXTERNAL, as+z, acp, &trace,
inpLinkInit[z-INPUT1], NULL, common[z], &pafAlgConfig);
if (!chain)
return 0;
} //PAF_ASIT_initPhaseCommon
+// (***) FL: candidate for removal
// -----------------------------------------------------------------------------
// ASIT Initialization Function - Algorithm Keys
//
// .............................................................................
Int
PAF_ASIT_initPhaseAlgKey(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
-#if 0
- Int z; /* decode/encode counter */
- Int s; /* key number */
- PAF_ASP_Link *that;
-#endif
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
TRACE_VERBOSE1("PAF_ASIT_initPhaseAlgKey: AS%d: initialization phase - Algorithm Keys", as);
//
Int
PAF_ASIT_initPhaseDevice(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* input/output counter */
PAF_SIO_IALG_Obj *pObj;
PAF_SIO_IALG_Config *pAlgConfig;
PAF_IALG_Config pafAlgConfig;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
TRACE_TERSE1("PAF_ASIT_initPhaseDevice: AS%d: initialization phase - I/O Devices", as);
- if(pP->fxns->bufMemPrint)
+ if (pP->fxns->bufMemPrint)
{
PAF_ALG_setup (&pafAlgConfig,
HEAP_ID_INTERNAL, HEAP_INTERNAL,
for (z=INPUT1; z < INPUTN; z++)
{
- PAF_InpBufConfig *pConfig = &pC->xInp[z].inpBufConfig;
+ PAF_InpBufConfig *pConfig = &pAstCfg->xInp[z].inpBufConfig;
- pObj = (PAF_SIO_IALG_Obj *)pC->xInp[z].inpChainData.head->alg;
+ pObj = (PAF_SIO_IALG_Obj *)pAstCfg->xInp[z].inpChainData.head->alg;
pAlgConfig = &pObj->config;
- pC->xInp[z].hRxSio = NULL;
+ pAstCfg->xInp[z].hRxSio = NULL;
pConfig->base.pVoid = pAlgConfig->pMemRec[0].base;
pConfig->pntr.pVoid = pAlgConfig->pMemRec[0].base;
pConfig->sizeofElement = 2;
pConfig->precision = 16;
- if(pP->fxns->bufMemPrint)
+ if (pP->fxns->bufMemPrint)
{
- pP->fxns->bufMemPrint(z,pAlgConfig->pMemRec[0].size,PAF_ALG_memSpaceToHeapId(&pafAlgConfig,pAlgConfig->pMemRec[0].space),0);
+ pP->fxns->bufMemPrint(z, pAlgConfig->pMemRec[0].size, PAF_ALG_memSpaceToHeapId(&pafAlgConfig,pAlgConfig->pMemRec[0].space), 0);
}
}
+
TRACE_TERSE1("PAF_ASIT_initPhaseDevice: AS%d: initialization phase - I/O Devices complete.", as);
return 0;
//
Int
PAF_ASIT_initPhaseDecOpCircBuf(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int zMS = pC->masterStr;
- Int z; /* decode counter */
- PAF_AST_DecOpCircBuf *pCb; /* Decoder output circular buffer */
- Int errno; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int zMS;
+ Int z; /* decode counter */
+ PAF_AST_DecOpCircBuf *pCb; /* Decoder output circular buffer */
+ Int errno; /* error number */
Error_Block eb;
Int i;
// FL: (***)revisit
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMS = pAstCfg->masterStr;
/* Decode output circular buffer memory */
- if (!(pC->xDecOpCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
- DECODEN * sizeof (*pC->xDecOpCb), 4, &eb)))
+ if (!(pAstCfg->xDecOpCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM,
+ DECODEN * sizeof (*pAstCfg->xDecOpCb), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
TRACE_TERSE3("PAF_ASIT_initPhaseDecOpCircBuf. (pC->xDecOpCb) %d bytes from space %d at 0x%x.",
- DECODEN * sizeof (*pC->xDecOpCb),
- HEAP_ID_INTERNAL1_SHM, (IArg)pC->xDecOpCb);
+ DECODEN * sizeof (*pAstCfg->xDecOpCb),
+ HEAP_ID_INTERNAL1_SHM, (IArg)pAstCfg->xDecOpCb);
for (z=DECODE1; z < DECODEN; z++)
{
- pCb = &pC->xDecOpCb[z];
+ pCb = &pAstCfg->xDecOpCb[z];
// allocate audio frame circular buffer
if (!(pCb->afCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_AF * sizeof(PAF_AudioFrame), 4, &eb)))
/* and CODE_SECTION/clink constructs facilitate this omission. */
Int
-PAF_AST_passProcessing (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, Int hack)
+PAF_AST_passProcessing(const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, Int hack)
{
Int z; /* input/output counter */
Int errno = 0; /* error number */
@@ -1646,7 +1600,7 @@ PAF_AST_passProcessing (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_
return errno;
} //PAF_AST_passProcessing
-#endif
+#endif // #if 0
#if 0
// -----------------------------------------------------------------------------
@@ -1721,7 +1675,7 @@ PAF_AST_passProcessingCopy (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ,
return 0;
} //PAF_AST_passProcessingCopy
-#endif
+#endif // #if 0
// -----------------------------------------------------------------------------
// ASIT Processing Function - Auto Processing
@@ -1742,26 +1696,33 @@ PAF_AST_passProcessingCopy (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ,
Int
PAF_ASIT_autoProcessing(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int inputTypeSelect,
ALG_Handle pcmAlgMaster
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int errno = 0; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int errno = 0; /* error number */
Int nbytes;
Int frameLength;
- Int zMD = pC->masterDec;
- Int zMI = pP->zone.master;
- Int zMS = pC->masterStr;
-
+ Int zMD;
+ Int zMI;
+ Int zMS;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMD = pAstCfg->masterDec;
+ zMS = pAstCfg->masterStr;
+ zMI = pP->zone.master;
+
TRACE_VERBOSE1("PAF_ASIT_autoProcessing: AS%d: PAF_AST_autoProcessing", as+zMS);
- if (errno = SIO_ctrl (pC->xInp[zMI].hRxSio,
- PAF_SIO_CONTROL_SET_SOURCESELECT,
- DECSIOMAP (pC->xDec[zMD].decodeStatus.sourceSelect)))
+ if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio,
+ PAF_SIO_CONTROL_SET_SOURCESELECT,
+ DECSIOMAP(pAstCfg->xDec[zMD].decodeStatus.sourceSelect)))
{
TRACE_VERBOSE2("PAF_ASIT_autoProcessing: AS%d: source select returns 0x%x", as+zMS, errno);
return errno;
// pC->xDec[zMD].decodeStatus.bufferRatio);
frameLength = FRAMELENGTH; // FL: fix PCM frameLength for alpha release.
- if (errno = SIO_ctrl (pC->xInp[zMI].hRxSio,
- PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
+ if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio,
+ PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
{
TRACE_VERBOSE2("PAF_ASIT_autoProcessing: SET_PCMFRAMELENGTH returns 0x%x, returning ASPERR_AUTO_LENGTH, 0x%x",
errno, ASPERR_AUTO_LENGTH);
return ASPERR_AUTO_LENGTH;
}
- if (errno = SIO_issue (pC->xInp[zMI].hRxSio,
- &pC->xInp[zMI].inpBufConfig, sizeof (pC->xInp[zMI].inpBufConfig),
- PAF_SIO_REQUEST_SYNC))
+ if (errno = SIO_issue(pAstCfg->xInp[zMI].hRxSio,
+ &pAstCfg->xInp[zMI].inpBufConfig, sizeof(pAstCfg->xInp[zMI].inpBufConfig),
+ PAF_SIO_REQUEST_SYNC))
{
TRACE_VERBOSE2("PAF_ASIT_autoProcessing: REQUEST_SYNC returns 0x%x, returning ASPERR_ISSUE, 0x%x",
errno, ASPERR_ISSUE);
// all of the sync scan work is done in this call. If the error returned
// is DIBERR_SYNC then that just means we didn't find a sync, not a real I/O
// error so we mask it off.
- nbytes = SIO_reclaim (pC->xInp[zMI].hRxSio, (Ptr)&pC->xInp[zMI].pInpBuf, NULL);
+ nbytes = SIO_reclaim(pAstCfg->xInp[zMI].hRxSio, (Ptr)&pAstCfg->xInp[zMI].pInpBuf, NULL);
if (nbytes == -DIBERR_SYNC)
{
TRACE_TERSE2("PAF_ASIT_autoProcessing: AS%d: SIO_reclaim returned 0x%x, ignoring", as+zMS, nbytes);
return 0;
}
- if (nbytes != sizeof (PAF_InpBufConfig))
+ if (nbytes != sizeof(PAF_InpBufConfig))
{
- TRACE_TERSE3("PAF_AST_autoProcessing. SIO_reclaim returned %d, not %d, returning ASPERR_RECLAIM (0x%x)",
- nbytes, sizeof (PAF_InpBufConfig), ASPERR_RECLAIM);
+ TRACE_TERSE3("PAF_ASIT_autoProcessing. SIO_reclaim returned %d, not %d, returning ASPERR_RECLAIM (0x%x)",
+ nbytes, sizeof(PAF_InpBufConfig), ASPERR_RECLAIM);
return ASPERR_RECLAIM;
}
if (errno)
// -> *?* must catch ASPERR_ISSUE from (zMI) SIO_issue()
Int
PAF_ASIT_decodeProcessing(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int sourceSelect
)
{
+ PAF_AST_Config *pAstCfg;
//Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
Int z; /* decode counter */
Int errno; /* error number */
Int getVal;
enum { INIT, INFO1, INFO2, DECODE, FINAL, QUIT } state;
ALG_Handle alg[DECODEN_MAX];
- Int zMD = pC->masterDec;
- Int zMS = pC->masterStr;
+ Int zMD;
+ Int zMS;
Int size;
//PAF_InpBufConfig *pIpBufConfig;
Int frame; // decoder input frame count
Int block; // (***) FL: formerly -- decoder output block count / input frame
-
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ zMD = pAstCfg->masterDec;
+ zMS = pAstCfg->masterStr;
+
for (z=DECODE1; z < DECODEN; z++)
- alg[z] = pC->xDec[z].decAlg[PAF_SOURCE_PCM];
+ {
+ alg[z] = pAstCfg->xDec[z].decAlg[PAF_SOURCE_PCM];
+ }
alg[zMD] = NULL; // decAlgMaster; // FL: alg[] init is on slave
//
state = INIT;
errno = 0; /* error number */
- TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pC->xDec[zMD].decodeStatus.sourceSelect);
+ TRACE_TERSE1("PAF_ASIT_decodeProcessing: sourceSelect is %d", pAstCfg->xDec[zMD].decodeStatus.sourceSelect);
for (;;)
{
- if (pC->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
+ if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect == PAF_SOURCE_NONE)
{
TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: sourceSelect == PAF_SOURCE_NONE");
state = QUIT;
Cache_wait();
#endif
#if 0
- //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
- //Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
- size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
- Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
- size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
- Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
- Cache_wait();
+ ////size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]->size;
+ ////Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), size, Cache_Type_ALLD, 0);
+ //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]->size;
+ //Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_PCM]), size, Cache_Type_ALLD, 0);
+ //size = IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]->size;
+ //Cache_wbInv((Ptr)(IACP_STD_BETA_TABLE.pStatus[STD_BETA_DDP]), size, Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
- //if (errno = pP->fxns->decodeInit (pP, pQ, pC, alg))
- //if (errno = pP->fxns->decodeInit(pP, pQ, pC, alg, sourceSelect))
if (errno = pP->fxns->decodeInit(pP, pQ, pC, sourceSelect))
{
TRACE_VERBOSE1("PAF_ASIT_decodeProcessing: INIT, errno 0x%x. break after decodeInit", errno);
Log_info0("TaskAsip: state=INFO1");
#if 0
- // (***) FL: revisit
- // write back Inp configuration
- Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
- // write back input data
- pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
- size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
- Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
- // write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ //// (***) FL: revisit
+ //// write back Inp configuration
+ //Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+ //// write back input data
+ //pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
+ //size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
+ //Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
+ //// write back Dec configuration
+ //Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
// Establish primary timing
}
#if 0
- // (***) FL: revisit
- // invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ //// (***) FL: revisit
+ //// invalidate Dec configuration
+ //Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
// Don't start decode until major access unit is found.
- if (((pC->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_THD) ||
- (pC->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DXP) ||
- (pC->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DTSHD)) &&
- (pC->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN))
+ if (((pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_THD) ||
+ (pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DXP) ||
+ (pAstCfg->xDec[zMD].decodeStatus.sourceDecode == PAF_SOURCE_DTSHD)) &&
+ (pAstCfg->xStr[zMS].pAudioFrame->sampleRate == PAF_SAMPLERATE_UNKNOWN))
{
Int z;
for (z=DECODE1; z < DECODEN; z++)
{
Int zI = pP->inputsFromDecodes[z];
- if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
{
TRACE_VERBOSE0("TaskAsip: PAF_ASIT_decodeProcessing: INFO1, SIO_issue");
- if (SIO_issue (pC->xInp[zI].hRxSio, &pC->xInp[zI].inpBufConfig,
- sizeof (pC->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
+ if (SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
+ sizeof(pAstCfg->xInp[zI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME))
{
TRACE_TERSE0("PAF_ASIT_decodeProcessing. %d: INFO1, return (ASPERR_ISSUE)");
return (ASPERR_ISSUE);
Log_info0("TaskAsip: state=INFO2");
#if 0
- // (***) FL: revisit
- // write back Inp configuration
- Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
- // write back input data
- pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
- size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
- Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
- // write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ //// (***) FL: revisit
+ //// write back Inp configuration
+ //Cache_wb(&gPAF_AST_config.xInp[0], INPUTN*sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+ //// write back input data
+ //pIpBufConfig = &gPAF_AST_config.xInp[0].inpBufConfig;
+ //size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
+ //Cache_wb(pIpBufConfig->pntr.pLgInt, size, Cache_Type_ALLD, 0);
+ //// write back Dec configuration
+ //Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
// Establish primary timing
}
#if 0
- // (***) FL: revisit
- // invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ //// (***) FL: revisit
+ //// invalidate Dec configuration
+ //Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
if (errno = pP->fxns->decodeInfo2(pP, pQ, pC, frame, block))
Log_info0("TaskAsip: state=DECODE");
#if 0
- // (***) FL: revisit
- // write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ //// (***) FL: revisit
+ //// write back Dec configuration
+ //Cache_wb(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
if (errno = pP->fxns->decodeDecode(pP, pQ, pC, sourceSelect, frame, block))
}
#if 0
- // (***) FL: revisit
- // invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
- Cache_wait();
+ //// (***) FL: revisit
+ //// invalidate Dec configuration
+ //Cache_inv(&gPAF_AST_config.xDec[0], DECODEN*sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ //Cache_wait();
#endif
TRACE_VERBOSE0("PAF_ASIT_decodeProcessing: state: DECODE->FINAL");
Int
PAF_ASIT_decodeCommand(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode counter */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode counter */
Int zS;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
for (z=DECODE1; z < DECODEN; z++)
{
zS = pP->streamsFromDecodes[z];
- if (!(pC->xDec[z].decodeStatus.command2 & 0x80))
+ if (!(pAstCfg->xDec[z].decodeStatus.command2 & 0x80))
{
- switch (pC->xDec[z].decodeStatus.command2)
+ switch (pAstCfg->xDec[z].decodeStatus.command2)
{
case 0: // command none - process
- pC->xDec[z].decodeStatus.command2 |= 0x80;
+ pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
break;
case 1: // command abort - leave now
TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command abort (0x%02x)", as+zS, 1);
- pC->xDec[z].decodeStatus.command2 |= 0x80;
+ pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
return (ASPERR_ABORT);
case 2: // command restart - leave later
TRACE_TERSE2("AS%d: PAF_ASIT_decodeCommand: decode command quit (0x%02x)", as+zS, 2);
- pC->xDec[z].decodeStatus.command2 |= 0x80;
+ pAstCfg->xDec[z].decodeStatus.command2 |= 0x80;
return (ASPERR_QUIT);
default: // command unknown - ignore
break;
//
Int
PAF_ASIT_decodeInit(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int sourceSelect
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode/encode counter */
- Int errno; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/encode counter */
+ Int errno; /* error number */
Int zI, zS;
- Int zMD = pC->masterDec;
- Int zMI = pP->zone.master;
- ASP_Msg* pAspMsg; /* Messaging */
+ Int zMD;
+ Int zMI;
+ ASP_Msg* pAspMsg; /* Messaging */
Int argIdx;
Int decErrno;
Int status;
- PAF_AST_DecOpCircBuf *pCb; /* Decoder output circular buffer */
+ PAF_AST_DecOpCircBuf *pCb; /* Decoder output circular buffer */
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMD = pAstCfg->masterDec;
+ zMI = pP->zone.master;
(void)as; // clear compiler warning in case not used with tracing disabled
-
+
// reset frameCount
for (z=DECODE1; z < DECODEN; z++)
{
- if (pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xDec[z].decodeStatus.mode)
{
- pC->xDec[z].decodeStatus.frameCount = 0;
+ pAstCfg->xDec[z].decodeStatus.frameCount = 0;
}
}
zI = pP->inputsFromDecodes[z];
zS = pP->streamsFromDecodes[z];
(void)zS; // clear compiler warning in case not used with tracing disabled
- if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
{
Uns gear;
Int frameLength;
TRACE_VERBOSE1("AS%d: PAF_ASIT_decodeInit: initializing decode", as+zS);
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// FL: send dec activate message to slave
// (***) FL: revisit
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
#if 0 // FL: decoder reset call, slave
return errno;
#endif
- gear = pC->xDec[z].decodeStatus.aspGearControl;
- pC->xDec[z].decodeStatus.aspGearStatus = gear < GEARS ? gear : 0;
+ gear = pAstCfg->xDec[z].decodeStatus.aspGearControl;
+ pAstCfg->xDec[z].decodeStatus.aspGearStatus = gear < GEARS ? gear : 0;
#if 0 // FL: change handle to decIdx (zone index)
frameLength = pP->fxns->computeFrameLength(decAlg[z],
}
#endif
- pC->xDec[z].decodeControl.frameLength = frameLength;
- pC->xDec[z].decodeInStruct.sampleCount = frameLength;
- pC->xDec[z].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
+ pAstCfg->xDec[z].decodeControl.frameLength = frameLength;
+ pAstCfg->xDec[z].decodeInStruct.sampleCount = frameLength;
+ pAstCfg->xDec[z].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
// (***) FL: revisit. Count samples for DDP.
// Add framework frame length and running sample count to decoder control.
//pC->xDec[z].decodeControl.rdSampleCount = 0;
// Initialize decoder output circular buffer for selected source
- pCb = &pC->xDecOpCb[z];
+ pCb = &pAstCfg->xDecOpCb[z];
errno = cbInit(sourceSelect, frameLength, FRAMELENGTH, pCb, 0);
if (errno)
{
if (z != zMD)
{
- if (errno = SIO_idle(pC->xInp[zI].hRxSio))
+ if (errno = SIO_idle(pAstCfg->xInp[zI].hRxSio))
{
return errno;
}
}
- if (errno = SIO_ctrl(pC->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_SOURCESELECT,
- DECSIOMAP(pC->xDec[z].decodeStatus.sourceSelect)))
+ if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_SOURCESELECT,
+ DECSIOMAP(pAstCfg->xDec[z].decodeStatus.sourceSelect)))
{
return errno;
}
- if (errno = SIO_ctrl(pC->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_PCMFRAMELENGTH,
+ if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio, PAF_SIO_CONTROL_SET_PCMFRAMELENGTH,
frameLength))
{
return errno;
}
- if (errno = pP->fxns->updateInputStatus(pC->xInp[zI].hRxSio, &pC->xInp[zI].inpBufStatus,
- &pC->xInp[zI].inpBufConfig))
+ if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufStatus,
+ &pAstCfg->xInp[zI].inpBufConfig))
{
return errno;
}
}
}
- if (pC->xInp[zMI].hRxSio)
+ if (pAstCfg->xInp[zMI].hRxSio)
{
- errno = SIO_issue(pC->xInp[zMI].hRxSio, &pC->xInp[zMI].inpBufConfig,
- sizeof(pC->xInp[zMI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME);
+ errno = SIO_issue(pAstCfg->xInp[zMI].hRxSio, &pAstCfg->xInp[zMI].inpBufConfig,
+ sizeof(pAstCfg->xInp[zMI].inpBufConfig), PAF_SIO_REQUEST_NEWFRAME);
if (errno)
{
return errno;
//
Int
PAF_ASIT_decodeInfo(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* input/decode/stream counter */
- Int errno; /* error number */
- Int sioErr; /* error number, SIO */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* input/decode/stream counter */
+ Int errno; /* error number */
+ Int sioErr; /* error number, SIO */
Int zD, zI, zS, zX;
- Int zMD = pC->masterDec;
- Int zMI = pP->zone.master;
- Int zMS = pC->masterStr;
+ Int zMD;
+ Int zMI;
+ Int zMS;
UInt32 curTime;
- ASP_Msg *pAspMsg; /* Messaging */
+ ASP_Msg *pAspMsg; /* Messaging */
Int argIdx;
Int status;
// FL: revisit
//Int size;
//PAF_InpBufConfig *pIpBufConfig;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMD = pAstCfg->masterDec;
+ zMS = pAstCfg->masterStr;
+ zMI = pP->zone.master;
(void)zMS; (void)as; // clear compiler warning in case not used with tracing disabled
-
+
// Set decode control: sample rate, emphasis
for (z=INPUT1; z < INPUTN; z++)
{
}
}
- if (pC->xInp[z].hRxSio)
+ if (pAstCfg->xInp[z].hRxSio)
{
//determine associated decoder
- if (pC->xInp[z].inpBufStatus.sampleRateStatus !=
- pC->xDec[zD].decodeControl.sampleRate)
+ if (pAstCfg->xInp[z].inpBufStatus.sampleRateStatus !=
+ pAstCfg->xDec[zD].decodeControl.sampleRate)
{
- if (pC->xDec[zD].decodeControl.sampleRate == PAF_SAMPLERATE_UNKNOWN)
+ if (pAstCfg->xDec[zD].decodeControl.sampleRate == PAF_SAMPLERATE_UNKNOWN)
{
- pC->xDec[zD].decodeControl.sampleRate =
- pC->xInp[z].inpBufStatus.sampleRateStatus;
+ pAstCfg->xDec[zD].decodeControl.sampleRate =
+ pAstCfg->xInp[z].inpBufStatus.sampleRateStatus;
}
else
{
- TRACE_TERSE1("AS%d: return error ASPERR_INFO_RATECHANGE", as+pC->masterStr);
+ TRACE_TERSE1("AS%d: return error ASPERR_INFO_RATECHANGE", as+pAstCfg->masterStr);
TRACE_TERSE2("inpBufStatus.sampleRateStatus: 0x%x, decodeControl.sampleRate: 0x%x",
- pC->xInp[z].inpBufStatus.sampleRateStatus,
- pC->xDec[zD].decodeControl.sampleRate);
+ pAstCfg->xInp[z].inpBufStatus.sampleRateStatus,
+ pAstCfg->xDec[zD].decodeControl.sampleRate);
// return (ASPERR_INFO_RATECHANGE);
}
}
- pC->xDec[zD].decodeControl.emphasis =
- pC->xDec[zD].decodeStatus.sourceDecode != PAF_SOURCE_PCM
+ pAstCfg->xDec[zD].decodeControl.emphasis =
+ pAstCfg->xDec[zD].decodeStatus.sourceDecode != PAF_SOURCE_PCM
? PAF_IEC_PREEMPHASIS_NO // fix for Mantis ID #119
- : pC->xInp[z].inpBufStatus.emphasisStatus;
+ : pAstCfg->xInp[z].inpBufStatus.emphasisStatus;
}
else
{
- pC->xDec[zD].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
- pC->xDec[zD].decodeControl.emphasis = PAF_IEC_PREEMPHASIS_UNKNOWN;
+ pAstCfg->xDec[zD].decodeControl.sampleRate = PAF_SAMPLERATE_UNKNOWN;
+ pAstCfg->xDec[zD].decodeControl.emphasis = PAF_IEC_PREEMPHASIS_UNKNOWN;
}
}
// Wait for info input
TRACE_VERBOSE2("PAF_ASIT_decodeInfo: AS%d: awaiting frame %d -- sync+info+data", as+zMS, frame);
- if (pC->xInp[zMI].hRxSio)
+ if (pAstCfg->xInp[zMI].hRxSio)
{
TRACE_VERBOSE0("PAF_ASIT_decodeInfo: call SIO_reclaim to get input buffer.");
- sioErr = SIO_reclaim(pC->xInp[zMI].hRxSio, (Ptr)&pC->xInp[zMI].pInpBuf, NULL);
- if (sioErr != sizeof(pC->xInp[zMI].inpBufConfig))
+ sioErr = SIO_reclaim(pAstCfg->xInp[zMI].hRxSio, (Ptr)&pAstCfg->xInp[zMI].pInpBuf, NULL);
+ if (sioErr != sizeof(pAstCfg->xInp[zMI].inpBufConfig))
{
TRACE_TERSE1("SIO_reclaim on input returned error ASPERR_RECLAIM. sioErr: 0x%x", sioErr);
return ASPERR_RECLAIM;
}
// FL: debug, capture input buffer
- //capIb(pC->xInp[zMI].pInpBuf);
+ //capIb(pAstCfg->xInp[zMI].pInpBuf);
//
// Simulate Rx SIO_reclaim() pend
zI = pP->inputsFromDecodes[z];
zS = pP->streamsFromDecodes[z];
(void)zS; // clear compiler warning in case not used with tracing disabled
- if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
{
TRACE_GEN2("PAF_ASIT_decodeInfo: AS%d: processing frame %d -- info", as+zS, frame);
- if (errno = pP->fxns->updateInputStatus(pC->xInp[zI].hRxSio,
- &pC->xInp[zI].inpBufStatus, &pC->xInp[zI].inpBufConfig))
+ if (errno = pP->fxns->updateInputStatus(pAstCfg->xInp[zI].hRxSio,
+ &pAstCfg->xInp[zI].inpBufStatus, &pAstCfg->xInp[zI].inpBufConfig))
{
TRACE_TERSE1("return error errno 0x%x.", errno);
return errno;
#if 1
// (***) FL: revisit
// write back Inp configuration
- Cache_wb(&gPAF_AST_config.xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xInp[zI], sizeof(PAF_AST_InpBuf), Cache_Type_ALLD, 0);
// write back input data // (***) GJ: don't need this for 1xI2S HDMI/SPDIF. Maybe need this for 4xI2S HDMI.
//pIpBufConfig = &gPAF_AST_config.xInp[zI].inpBufConfig;
//size = pIpBufConfig->frameLength * pIpBufConfig->sizeofElement;
//Cache_wb((Ptr)pIpBufConfig->pntr.pSmInt, size, Cache_Type_ALLD, 0);
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
#endif
#if 1
// (***) FL: revisit
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
#endif
return errno;
}
// increment decoded frame count
- pC->xDec[z].decodeStatus.frameCount += 1;
+ pAstCfg->xDec[z].decodeStatus.frameCount += 1;
}
} // z=DECODE1 to DECODEN
// query IB for latest sourceProgram (needed if we started decoding due to a force mode)
- if (pC->xDec[zMD].decodeStatus.mode)
+ if (pAstCfg->xDec[zMD].decodeStatus.mode)
{
XDAS_Int8 sourceProgram;
- if (errno = SIO_ctrl(pC->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM,
+ if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio, PAF_SIO_CONTROL_GET_SOURCEPROGRAM,
(Arg)&sourceProgram))
{
TRACE_TERSE1("return error ASPERR_AUTO_PROGRAM. errno 0x%x.", errno);
return ASPERR_AUTO_PROGRAM;
}
- pC->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
-
-#if 0
- // (***) FL: revisit
- Cache_wb((Ptr)&pC->xDec[zMD].decodeStatus.sourceProgram,
- sizeof(pC->xDec[zMD].decodeStatus.sourceProgram), Cache_Type_ALLD, 0);
- Cache_wait();
-#endif
+ pAstCfg->xDec[zMD].decodeStatus.sourceProgram = sourceProgram;
}
// since now decoding update decode status for all enabled decoders
for (z=DECODE1; z < DECODEN; z++)
{
- if (pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xDec[z].decodeStatus.mode)
{
- pC->xDec[z].decodeStatus.sourceDecode = pC->xDec[z].decodeStatus.sourceProgram;
- if (pC->xDec[z].decodeStatus.sourceSelect == PAF_SOURCE_SNG)
+ pAstCfg->xDec[z].decodeStatus.sourceDecode = pAstCfg->xDec[z].decodeStatus.sourceProgram;
+ if (pAstCfg->xDec[z].decodeStatus.sourceSelect == PAF_SOURCE_SNG)
{
- pC->xDec[z].decodeStatus.sourceDecode = PAF_SOURCE_SNG;
+ pAstCfg->xDec[z].decodeStatus.sourceDecode = PAF_SOURCE_SNG;
}
-
-#if 0
- // (***) FL: revisit
- Cache_wb((Ptr)&pC->xDec[z].decodeStatus.sourceDecode,
- sizeof(pC->xDec[z].decodeStatus.sourceDecode), Cache_Type_ALLD, 0);
- Cache_wait();
-#endif
}
}
//
Int
PAF_ASIT_decodeInfo1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
)
//
Int
PAF_ASIT_decodeInfo2(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
)
//
Int
-PAF_AST_decodeCont (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_Config *pC, ALG_Handle decAlg[], Int frame, Int block)
+PAF_AST_decodeCont(
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
+ ALG_Handle decAlg[],
+ Int frame,
+ Int block
+)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode counter */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode counter */
Int zI, zS;
- Int zMD = pC->masterDec;
+ Int zMD;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMD = pAstCfg->masterDec;
(void)as; // clear compiler warning in case not used with tracing disabled
-
+
// Await slave inputs
for (z=DECODE1; z < DECODEN; z++) {
zI = pP->inputsFromDecodes[z];
zS = pP->streamsFromDecodes[z];
(void)zS;
if (z == zMD
- || ! pC->xInp[zI].hRxSio
- || ! pC->xDec[z].decodeStatus.mode)
+ || ! pAstCfg->xInp[zI].hRxSio
+ || ! pAstCfg->xDec[z].decodeStatus.mode)
continue;
TRACE_VERBOSE2("PAF_AST_decodeCont: AS%d: awaiting frame %d -- data", as+zS, frame);
- if (SIO_reclaim (pC->xInp[zI].hRxSio, (Ptr)&pC->xInp[zI].pInpBuf, NULL)
- != sizeof (pC->xInp[zI].inpBufConfig))
+ if (SIO_reclaim(pAstCfg->xInp[zI].hRxSio, (Ptr)&pAstCfg->xInp[zI].pInpBuf, NULL)
+ != sizeof (pAstCfg->xInp[zI].inpBufConfig))
return (ASPERR_RECLAIM);
}
@@ -2902,24 +2880,27 @@ PAF_AST_decodeCont (const PAF_AST_Params *pP, const PAF_AST_Patchs *pQ, PAF_AST_
//
Int
PAF_ASIT_decodeDecode(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int sourceSelect,
Int frame,
Int block
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode/stream counter */
- Int errno; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/stream counter */
+ Int errno; /* error number */
//Int ch;
- ASP_Msg *pAspMsg; /* Messaging */
+ ASP_Msg *pAspMsg; /* Messaging */
Int argIdx;
Int status;
Int cbErrno;
Int frameLength;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
#if 0 // FL: slave
Int zI = pP->inputsFromDecodes[z];
Int zS = pP->streamsFromDecodes[z];
(void)zS; // clear compiler warning in case not used with tracing disabled
- if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
{
TRACE_GEN2("PAF_ASIT_decodeDecode: AS%d: decodeDecode: processing block %d -- decode", as+zS, block);
TRACE_VERBOSE3("PAF_ASIT_decodeDecode: AS%d: decodeDecode: decoding from 0x%x (base) 0x%x (ptr)",
as+zS,
- (IArg)pC->xInp[z].pInpBuf->base.pVoid,
- (IArg)pC->xInp[z].pInpBuf->head.pVoid);
+ (IArg)pAstCfg->xInp[z].pInpBuf->base.pVoid,
+ (IArg)pAstCfg->xInp[z].pInpBuf->head.pVoid);
// FL: debug, capture input buffer
- //capIbPcm(pC->xInp[z].pInpBuf);
+ //capIbPcm(pAstCfg->xInp[z].pInpBuf);
// (***) FL: revisit
// write back Dec configuration
- Cache_wb(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_wb(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
// FL: send decode message to slave
// (***) FL: revisit
// invalidate Dec configuration
- Cache_inv(&gPAF_AST_config.xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
+ Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
#if 0 // FL: decoder decode call, slave
// ............................................................................
- pC->xDec[z].decodeControl.frameLength = frameLength;
- pC->xDec[z].decodeInStruct.sampleCount = frameLength;
- if (errno = SIO_ctrl(pC->xInp[zI].hRxSio,
+ pAstCfg->xDec[z].decodeControl.frameLength = frameLength;
+ pAstCfg->xDec[z].decodeInStruct.sampleCount = frameLength;
+ if (errno = SIO_ctrl(pAstCfg->xInp[zI].hRxSio,
PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
{
TRACE_VERBOSE1("PAF_ASIT_decodeDecode: SIO SET_PCMFRAMELENGTH returns 0x%x", errno);
}
TRACE_VERBOSE1("PAF_ASIT_decodeDecode: calling SIO_issue[%d]", zI);
- if (errno = SIO_issue(pC->xInp[zI].hRxSio, &pC->xInp[zI].inpBufConfig,
- sizeof(pC->xInp[zI].inpBufConfig),
+ if (errno = SIO_issue(pAstCfg->xInp[zI].hRxSio, &pAstCfg->xInp[zI].inpBufConfig,
+ sizeof(pAstCfg->xInp[zI].inpBufConfig),
PAF_SIO_REQUEST_NEWFRAME))
{
TRACE_VERBOSE2("PAF_ASIT_decodeDecode: SIO_issue returns 0x%x, we return ASPERR_ISSUE (0x%x)", errno, ASPERR_ISSUE);
Int
PAF_ASIT_decodeFinalTest(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
)
{
- Int zMD = pC->masterDec;
+ PAF_AST_Config *pAstCfg;
+ Int zMD;
Int sourceSelect;
Int sourceProgram;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ zMD = pAstCfg->masterDec;
- sourceSelect = pC->xDec[zMD].decodeStatus.sourceSelect;
- sourceProgram = pC->xDec[zMD].decodeStatus.sourceProgram;
+ sourceSelect = pAstCfg->xDec[zMD].decodeStatus.sourceSelect;
+ sourceProgram = pAstCfg->xDec[zMD].decodeStatus.sourceProgram;
if ((sourceSelect == PAF_SOURCE_NONE) || (sourceSelect == PAF_SOURCE_PASS))
{
}
else
{
- if (pC->xDec[zMD].decodeStatus.sourceSelect != pC->xDec[zMD].decodeStatus.sourceDecode)
+ if (pAstCfg->xDec[zMD].decodeStatus.sourceSelect != pAstCfg->xDec[zMD].decodeStatus.sourceDecode)
{
return 1;
}
//
Int
PAF_ASIT_decodeComplete(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
ALG_Handle decAlg[],
Int frame,
Int block
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode/encode counter */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/encode counter */
ASP_Msg* pAspMsg;
Int argIdx;
- Int errno; /* error number */
+ Int errno; /* error number */
Int status;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
#ifdef PAF_ASP_FINAL
DEC_Handle dec = (DEC_Handle )decAlg[z];
#endif /* PAF_ASP_FINAL */
Int zI = pP->inputsFromDecodes[z];
- if (pC->xInp[zI].hRxSio && pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xInp[zI].hRxSio && pAstCfg->xDec[z].decodeStatus.mode)
{
TRACE_VERBOSE1("PAF_ASIT_decodeComplete: AS%d: finalizing decode", as+z);
#ifdef PAF_ASP_FINAL
if (dec->fxns->final)
- dec->fxns->final(dec, NULL, &pC->xDec[z].decodeControl,
- &pC->xDec[z].decodeStatus);
+ dec->fxns->final(dec, NULL, &pAstCfg->xDec[z].decodeControl,
+ &pAstCfg->xDec[z].decodeStatus);
#endif /* PAF_ASP_FINAL */
// FL: send dec deactivate message to slave
pAspMsg = (ASP_Msg *)MessageQ_alloc(hAspMsgMaster->heapId, hAspMsgMaster->msgSize); /* allocate message */
//
Int
PAF_ASIT_selectDevices(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* input/output counter */
- Int errno = 0; /* error number */
- Int errme; /* error number, local */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* input/output counter */
+ Int errno = 0; /* error number */
+ Int errme; /* error number, local */
Int device;
- Int zMD = pC->masterDec;
+ Int zMD;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMD = pAstCfg->masterDec;
(void)as; // clear compiler warning in case not used with tracing disabled
-
+
// Select input devices
for (z=INPUT1; z < INPUTN; z++)
{
- if ((device = pC->xInp[z].inpBufStatus.sioSelect) >= 0)
+ if ((device = pAstCfg->xInp[z].inpBufStatus.sioSelect) >= 0)
{
TRACE_VERBOSE2("PAF_ASIT_selectDevices: AS%d: input device %d selecting ...", as+z, device);
device = 0; /* treat as device None */
}
- errme = pP->fxns->deviceSelect(&pC->xInp[z].hRxSio, SIO_INPUT,
+ errme = pP->fxns->deviceSelect(&pAstCfg->xInp[z].hRxSio, SIO_INPUT,
HEAP_ID_INPBUF, (Ptr)pQ->devinp->x[device]);
if (errme)
{
errno = ASPERR_DEVINP + errme;
}
- pC->xInp[z].inpBufStatus.sioSelect = 0x80;
+ pAstCfg->xInp[z].inpBufStatus.sioSelect = 0x80;
}
else
{
- pC->xInp[z].inpBufStatus.sioSelect = device | 0x80;
+ pAstCfg->xInp[z].inpBufStatus.sioSelect = device | 0x80;
// register decodeStatus pointer with input devices
// This allows, e.g., autoProcessing to exit when sourceSelect = none
// Use zMIs decodeStatus for all inputs
- if (pC->xInp[z].hRxSio)
+ if (pAstCfg->xInp[z].hRxSio)
{
// register PAF_SIO_IALG object address
- SIO_ctrl(pC->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_IALGADDR,
- (Arg)pC->xInp[z].inpChainData.head->alg);
- SIO_ctrl(pC->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_DECSTATUSADDR,
- (Arg)&pC->xDec[zMD].decodeStatus);
+ SIO_ctrl(pAstCfg->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_IALGADDR,
+ (Arg)pAstCfg->xInp[z].inpChainData.head->alg);
+ SIO_ctrl(pAstCfg->xInp[z].hRxSio, PAF_SIO_CONTROL_SET_DECSTATUSADDR,
+ (Arg)&pAstCfg->xDec[zMD].decodeStatus);
}
}
}
//
Int
PAF_ASIT_sourceDecode(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int x
)
{
+ PAF_AST_Config *pAstCfg;
Int z; /* decode counter */
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
for (z=DECODE1; z < DECODEN; z++)
{
- if (pC->xDec[z].decodeStatus.mode)
+ if (pAstCfg->xDec[z].decodeStatus.mode)
{
- pC->xDec[z].decodeStatus.sourceDecode = x;
+ pAstCfg->xDec[z].decodeStatus.sourceDecode = x;
}
}
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h
index cf9bfa36ac363f92874d0d36e26c2e7709c0b5d4..ebee5d1eae3a79429a082f041bd1906f75861f1e 100644 (file)
// Global debug counter */
extern Uint32 gTaskAsipCnt; // debug counter for ASP task
+struct PAF_ASIT_Params;
+struct PAF_ASIT_Patchs;
+struct PAF_ASIT_Config;
+
+// Audio Stream Input Task (ASIT) parameters, functions
+typedef struct PAF_ASIT_Fxns {
+ Int (*initPhase[8]) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
+ //Int (*initFrame0) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
+ //Int (*initFrame1) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
+ Int (*passProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
+ //Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
+ Int (*autoProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, ALG_Handle);
+ Int (*decodeProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
+ Int (*decodeCommand) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
+ //Int (*encodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
+ Int (*decodeInit) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
+ Int (*decodeInfo) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
+ Int (*decodeInfo1) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
+ Int (*decodeInfo2) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
+ //Int (*decodeCont) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
+ Int (*decodeDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int, Int);
+ //Int (*decodeStream) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
+ //Int (*decodeEncode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
+ Int (*decodeFinalTest) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
+ Int (*decodeComplete) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, ALG_Handle *, Int, Int);
+ Int (*selectDevices) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
+ Int (*sourceDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
+ //Int (*startOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
+ //Int (*stopOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
+ //Int (*setCheckRateX) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
+ //Int (*streamChainFunction) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
+ Int (*deviceAllocate) (SIO_Handle *, int, int, int, Ptr);
+ Int (*deviceSelect) (SIO_Handle *, int, int, Ptr);
+ Int (*computeFrameLength) (Int, Int, Int);
+ Int (*updateInputStatus) (SIO_Handle, PAF_InpBufStatus *, PAF_InpBufConfig *);
+ //Int (*copy) (Uns, PAF_InpBufConfig *, Uns, PAF_OutBufConfig *);
+
+ // For RAM_report
+ Void (*headerPrint)();
+ Int (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
+ Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
+ Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
+ Void (*memStatusPrint)(HeapMem_Handle hInternalHeap, HeapMem_Handle hInternal1Heap, HeapMem_Handle hExternalHeap, HeapMem_Handle hInternal1HeapShm);
+} PAF_ASIT_Fxns;
+
+// Audio Stream Input Task (ASIT) parameters
+typedef struct PAF_ASIT_Params {
+ const PAF_ASIT_Fxns *fxns;
+ struct {
+ SmInt master;
+ SmInt inputs;
+ SmInt input1;
+ SmInt inputN;
+ SmInt decodes;
+ SmInt decode1;
+ SmInt decodeN;
+ SmInt streams;
+ SmInt stream1; /* unused */
+ SmInt streamN; /* unused */
+ SmInt encodes;
+ SmInt encode1;
+ SmInt encodeN;
+ SmInt outputs;
+ SmInt output1;
+ SmInt outputN;
+ } zone;
+ const SmInt *inputsFromDecodes;
+ const SmInt *outputsFromEncodes;
+ struct {
+ int *pHeapIdIntern; //int *pIntern;
+ int *pHeapIdExtern; //int *pExtern;
+ int *pHeapIdInpbuf; //int *pInpbuf;
+ int *pHeapIdOutbuf; //int *pOutbuf;
+ int *pHeapIdFrmbuf; //int *pFrmbuf;
+ int *pHeapIdIntern1; //int *pIntern1;
+ int clear;
+ } heap;
+ struct {
+ const IALG_MemSpace *space;
+ } common;
+ const LgInt *z_rx_bufsiz;
+ const LgInt *z_tx_bufsiz;
+ const SmInt *z_numchan;
+ MdInt framelength;
+ const PAF_AudioFunctions *pAudioFrameFunctions;
+ const struct PAF_ASP_ChainFxns *pChainFxns;
+ const PAF_InpBufStatus *pInpBufStatus;
+ const PAF_DecodeStatus * const *z_pDecodeStatus;
+ const PAF_OutBufStatus *pOutBufStatus;
+ const PAF_EncodeStatus * const *z_pEncodeStatus;
+ const PAF_VolumeStatus *pVolumeStatus;
+ const PAF_ASP_AlgKey *pDecAlgKey;
+ const PAF_ASP_AlgKey *pEncAlgKey;
+ const PAF_ASP_SioMap *pDecSioMap;
+ const SmInt *streamsFromDecodes;
+ const SmInt *streamsFromEncodes;
+ const MdInt maxFramelength;
+ const SmInt *streamOrder;
+ const PAF_ASP_LinkInit * const (*i_inpLinkInit);
+ const PAF_ASP_LinkInit * const (*i_outLinkInit);
+ const PAF_ASP_outNumBufMap * const (*poutNumBufMap);
+ const PAF_MetadataBufStatus *pMetadataBufStatus;
+ const PAF_AudioFrameBufStatus *pAudioFrameBufStatus;
+} PAF_ASIT_Params;
+
+// Audio Stream Input Task (ASIT) patchs
+typedef struct PAF_ASIT_Patchs {
+ const PAF_SIO_ParamsN * devinp;
+ //const PAF_SIO_ParamsN * devout;
+ //const PAF_ASP_LinkInit * const (*i_decLinkInit);
+ //const PAF_ASP_LinkInit * const (*i_aspLinkInit)[GEARS];
+ //const PAF_ASP_LinkInit * const (*i_encLinkInit);
+} PAF_ASIT_Patchs;
+
+// Audio Stream Input Task (ASIT) configuration
+typedef struct PAF_ASIT_Config {
+ ACP_Handle acp;
+ PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
+} PAF_ASIT_Config;
+
+
// Purpose: Audio Stream Input Task Function for initialization of data pointers
// by allocation of memory.
Int
PAF_ASIT_initPhaseMalloc(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Audio Stream Input Task Function for initialization of data values
// from parameters.
Int
PAF_ASIT_initPhaseConfig(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Audio Stream Input Task Function for initialization of ACP by
// instantiation of the algorithm.
Int
PAF_ASIT_initPhaseAcpAlg(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
-// (***) FL: ASIT/ASOT currently consider common memory independently.
+// (***) FL: re-visit this, ASIT/ASOT currently consider common memory independently.
// Should simultaneously consider all algs in ASIT/ASOT.
// Purpose: Audio Stream Input Task Function for allocation of common memory.
Int
PAF_ASIT_initPhaseCommon(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Audio Stream Input Task Function for initialization of ASP algorithms.
Int
PAF_ASIT_initPhaseAspAlg(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
-
// Purpose: Audio Stream Input Task Function for initialization of data values
// from parameters for Algorithm Keys.
Int
PAF_ASIT_initPhaseAlgKey(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Audio Stream Input Task Function for initialization of Decoder Output Circular Buffer.
Int
PAF_ASIT_initPhaseDecOpCircBuf(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Audio Stream Input Task Function for initialization of Input Devices.
Int
PAF_ASIT_initPhaseDevice(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
+#if 0
// Purpose: Audio Stream Task Function for initialization or reinitiali-
// zation of the Audio Frame(s) by loading of data values of a
// time-varying nature.
Int
PAF_AST_initFrame1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
PAF_AST_Config *pC,
Int z,
Int apply
);
+#endif
// Purpose: Audio Stream Task Function for processing audio data to
// determine the input type without output.
Int
PAF_ASIT_autoProcessing(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int inputTypeSelect,
ALG_Handle pcmAlgMaster);
//
Int
PAF_ASIT_decodeProcessing(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int sourceSelect
);
// Purpose: Decoding Function for processing Decode Commands.
Int
PAF_ASIT_decodeCommand(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Decoding Function for reinitializing the decoding process.
Int
PAF_ASIT_decodeInit(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int sourceSelect
);
// is common for both initial and subsequent frames of input data.
Int
PAF_ASIT_decodeInfo(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
);
// is unique to initial frames of input data.
Int
PAF_ASIT_decodeInfo1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
);
// is unique to frames of input data other than the initial one.
Int
PAF_ASIT_decodeInfo2(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
);
// for frames of input data other than the initial one.
Int
PAF_AST_decodeCont(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
ALG_Handle decAlg[],
Int frame,
Int block
// Decode Algorithm.
Int
PAF_ASIT_decodeDecode(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int sourceSelect,
Int frame,
Int block
// current frame is complete.
Int
PAF_ASIT_decodeFinalTest(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int frame,
Int block
);
// Purpose: Decoding Function for terminating the decoding process.
Int
PAF_ASIT_decodeComplete(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
ALG_Handle decAlg[],
Int frame,
Int block
// for input.
Int
PAF_ASIT_selectDevices(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Audio Stream Input Task Function for selecting the sources used
// for decoding of input to output.
Int
PAF_ASIT_sourceDecode(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int x
);
// Purpose: Decoding Function for terminating output.
Int
PAF_AST_stopOutput(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC
);
// Purpose: Common Function for processing algorithm chains.
Int
PAF_AST_streamChainFunction(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASIT_Params *pP,
+ const PAF_ASIT_Patchs *pQ,
+ PAF_ASIT_Config *pC,
Int iChainFrameFxns,
Int abortOnError,
Int logArg
);
-
+
#endif /* _ASIP_H_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc_paramsFxns.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc_paramsFxns.c
index 8e64b48e5ba4fbb83934dadfd058b136ab1b5e3f..1a521e70228ddd63b5812d65592e32174fa32912 100644 (file)
// Return: N.A.
// Trace: None.
//
-const PAF_AST_Fxns PAF_ASIT_params_fxns =
+const PAF_ASIT_Fxns PAF_ASIT_params_fxns =
{
{ // initPhase[8]
PAF_ASIT_initPhaseMalloc,
PAF_ASIT_initPhaseDecOpCircBuf,
NULL
},
- NULL, //PAF_AST_initFrame0, // initFrame0
- NULL, //PAF_AST_initFrame1, // initFrame1
- NULL, //PAF_AST_passProcessing, // passProcessing
- NULL, //PAF_AST_passProcessingCopy, // passProcessingCopy
+ NULL, // passProcessing
PAF_ASIT_autoProcessing, // autoProcessing
PAF_ASIT_decodeProcessing, // decodeProcessing
PAF_ASIT_decodeCommand, // decodeCommand
- NULL, //PAF_AST_encodeCommand, // encodeCommand
PAF_ASIT_decodeInit, // decodeInit
PAF_ASIT_decodeInfo, // decodeInfo
PAF_ASIT_decodeInfo1, // decodeInfo1
PAF_ASIT_decodeInfo2, // decodeInfo2
- NULL, //PAF_AST_decodeCont, // decodeCont
PAF_ASIT_decodeDecode, // decodeDecode
- NULL, //PAF_AST_decodeStream, // decodeStream
- NULL, //PAF_AST_decodeEncode, // decodeEncode
PAF_ASIT_decodeFinalTest, // decodeFinalTest
PAF_ASIT_decodeComplete, // decodeComplete
PAF_ASIT_selectDevices, // selectDevices
PAF_ASIT_sourceDecode, // sourceDecode
- NULL, //PAF_AST_startOutput, // startOutput
- NULL, //PAF_AST_stopOutput, // stopOutput
- NULL, //PAF_AST_setCheckRateX, // setCheckRateX
- NULL, //PAF_AST_streamChainFunction, // streamChainFunction
PAF_DEC_deviceAllocate, // deviceAllocate
PAF_DEC_deviceSelect, // deviceSelect
PAF_DEC_computeFrameLength, // computeFrameLength
PAF_DEC_updateInputStatus, // updateInputStatus
- NULL, //PAF_BUF_copy, // copy
NULL, /*headerPrint*/ // headerPrint
NULL, /*allocPrint*/ // allocPrint
NULL, /*commonPrint*/ // commonPrint
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c
index c883b1caf663398d5bf6ab2d105919e68c2cd6d2..01b02a3d302b730d9bbeebefbf0f0778bbdeef88 100644 (file)
// Audio Framework Configuration (*pC):
//
pC = &gPAF_AST_config;
- as = pC->as; /* Audio Stream Number (1, 2, etc.) */
+
+ /* Obtain Audio Stream Number (1, 2, etc.) */
+ as = pC->as;
TRACE_TERSE1("TaskAsop: Started with AS%d.", as);
//
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/itopo/params.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/itopo/params.c
index 5ee78d99c0531118cad2f6d1ae1bde4628645a7f..cf51e7c462e7323c073c8828088486e9d38c77f7 100644 (file)
#include "asp1.h"
#include "audioStreamProc_params.h"
+#include "audioStreamInpProc.h"
//
// Framework Declarations
// External declarations to patched IROM provide standard functionality.
//
-extern const PAF_AST_Fxns PAF_ASIT_params_fxns;
+extern const PAF_ASIT_Fxns PAF_ASIT_params_fxns;
//
// Audio Framework Status Initialization Declarations
//IALG_EXTERNAL // 31
};
+//(***) FL: re-visit, clean this up (remove unused members)
// .............................................................................
//
// Audio Stream Parameter Definitions
// Global definition in RAM provides standard & non-standard functionality.
//
-const PAF_AST_Params asip_params_PAi =
+const PAF_ASIT_Params asip_params_PAi =
{
&PAF_ASIT_params_fxns, // fxns
{ // zone
extern const PAF_AST_Fxns PAF_ASOT_params_fxns;
-// (***) FL: initially a copy of asip
+//(***) FL: initially a copy of asip
+//(***) FL: re-visit, clean this up (remove unused members)
const PAF_AST_Params asop_params_PAi =
{
&PAF_ASOT_params_fxns, // fxns
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/itopo/patchs.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/itopo/patchs.c
index 9028aa454202056f3c0e427ebf5eed1ffd16dc13..169f40b2498c2e4faf34f0e8d1c59c012c314086 100644 (file)
#include <audioStreamProc_patchs.h>
#include <asp0.h>
#include <asp1.h>
+#include "audioStreamInpProc.h"
//
// Decoder Definitions
#include <pcm.h>
#include <pcm_mds.h>
-#include <dwr_inp.h>
-#if 0 // FL: slave
-const PAF_ASP_LinkInit decLinkInitI13[] =
-{
- //PAF_ASP_LINKINITPARAMS (STD, DWRPCM, TII, &IDWRPCM_PARAMS),
- PAF_ASP_LINKINIT(STD, PCM, MDS),
-
- PAF_ASP_LINKNONE,
-};
-
-const PAF_ASP_LinkInit *const patchs_decLinkInit[] =
-{
- decLinkInitI13,
-};
-#endif
//
// Audio Stream Processing Declarations & Definitions
extern const PAF_SIO_ParamsN patchs_devinp[];
extern const PAF_SIO_ParamsN patchs_devout[];
-const PAF_AST_Patchs asip_patchs_PAi =
+const PAF_ASIT_Patchs asip_patchs_PAi =
{
patchs_devinp,
- patchs_devout,
- NULL, //patchs_decLinkInit,
- patchs_aspLinkInit,
- patchs_encLinkInit,
+ //patchs_devout,
+ //NULL, //patchs_decLinkInit,
+ //patchs_aspLinkInit,
+ //patchs_encLinkInit,
};
// (***) FL: initially a copy of asip