summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 830bd21)
raw | patch | inline | side by side (parent: 830bd21)
author | Frank Livingston <frank-livingston@ti.com> | |
Tue, 6 Sep 2016 01:17:16 +0000 (20:17 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Tue, 6 Sep 2016 01:17:16 +0000 (20:17 -0500) |
Customize ASOT params, patchs, and configuration for ASOT
- Params with corresponding settings on ASDT/ASIT should have the same
value as the ASDT/ASIT values. This can be changed in future with
ARM/DSP common (shared) params data
- ASOT config has local configuration (currently ACP handle) and
pointer to commmon (shared) ARM/DSP configuration.
- Params with corresponding settings on ASDT/ASIT should have the same
value as the ASDT/ASIT values. This can be changed in future with
ARM/DSP common (shared) params data
- ASOT config has local configuration (currently ACP handle) and
pointer to commmon (shared) ARM/DSP configuration.
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 e8f3ab626047b0c1bb7a018423949d554cfb9b1a..c5f815219984f419c717929c5f012ecd2d26a198 100644 (file)
typedef struct PAF_AST_Config {
Int as;
- ACP_Handle acp;
+ //ACP_Handle acp;
//ACP_Handle acpSlave;
PAF_AST_InpBuf *xInp; /* INPUT1 -INPUTN */
PAF_AST_Decode *xDec; /* DECODE1-DECODEN */
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 eb2973f47737b670ad3a52547ef0e7ccb50e71ee..c12e272803db7b31bbf4ebb7fea14313b172aa9d 100644 (file)
SECTIONS
{
.globalSectionPafAsitConfig :> CORE0_DDR3
-
+ .globalSectionPafAsotConfig :> CORE0_DDR3
+
GROUP: {
.commonSectionPafAstConfig
.commonSectionAcpStdBetaTable
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 01b02a3d302b730d9bbeebefbf0f0778bbdeef88..84dcacfdc0e3741346ef8d9bacc5c935e16de183 100644 (file)
#define __TASK_NAME__ "TaskAsop"
+
/* FL: Check if at least one output selected */
static Int checkOutSel(
- const PAF_AST_Params *pP,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ PAF_ASOT_Config *pC,
Int *pOutSel
);
/* FL: Check if at least one output sio changed */
static Int checkOutSio(
- const PAF_AST_Params *pP,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ PAF_ASOT_Config *pC,
Int *pOutSioUpdate
);
-
LINNO_DEFN(TaskAsop); /* Line number macros */
ERRNO_DEFN(TaskAsop); /* Error number macros */
+// ASOT configuration
+#pragma DATA_SECTION(gPAF_ASOT_config, ".globalSectionPafAsotConfig")
+PAF_ASOT_Config gPAF_ASOT_config = {
+ NULL,
+ &gPAF_AST_config
+};
+
// Global debug counters */
UInt32 gTaskAsopCnt=0; // debug
UInt32 gAsopInitCnt =0;
*/
Void taskAsopFxn(
// Int betaPrimeValue, // FL: revisit
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ
)
{
- PAF_AST_Config *pC; /* Local configuration pointer */
+ PAF_ASOT_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;
+ pC = &gPAF_ASOT_config;
+ pAstCfg = pC->pAstCfg;
/* Obtain Audio Stream Number (1, 2, etc.) */
- as = pC->as;
+ as = pAstCfg->as;
TRACE_TERSE1("TaskAsop: Started with AS%d.", as);
//
//
// Determine stream index
//
- zMS = pC->masterStr;
+ zMS = pAstCfg->masterStr;
// Initialize as per parametrized phases:
//
{
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
- SIO_idle(pC->xOut[z].hTxSio);
+ SIO_idle(pAstCfg->xOut[z].hTxSio);
}
}
Int
PAF_ASOT_initPhaseMalloc (
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_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_ASOT_initPhaseMalloc: AS%d: initialization phase - memory allocation", as+zMS);
// Initialize error block
Error_init(&eb);
/* Stream memory */
- if (!(pC->xStr = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, STREAMN * sizeof (*pC->xStr), 4, &eb)))
+ if (!(pAstCfg->xStr = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, STREAMN * sizeof (*pAstCfg->xStr), 4, &eb)))
{
TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xStr) %d bytes from space %d at 0x%x.",
- STREAMN * sizeof (*pC->xStr),
- HEAP_ID_INTERNAL, (IArg)pC->xStr);
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pAstCfg->xStr) %d bytes from space %d at 0x%x.",
+ STREAMN * sizeof (*pAstCfg->xStr),
+ HEAP_ID_INTERNAL, (IArg)pAstCfg->xStr);
{
Int z; /* stream counter */
for (z=STREAM1; z < STREAMN; z++)
{
- pC->xStr[z].pAudioFrame = &fBuf[z-STREAM1];
- TRACE_TERSE2("pC->xStr[%d].pAudioFrame = 0x%x", z, (IArg)pC->xStr[z].pAudioFrame);
+ pAstCfg->xStr[z].pAudioFrame = &fBuf[z-STREAM1];
+ TRACE_TERSE2("pAstCfg->xStr[%d].pAudioFrame = 0x%x", z, (IArg)pAstCfg->xStr[z].pAudioFrame);
}
}
/* Encode memory */
- if (!(pC->xEnc = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, ENCODEN * sizeof (*pC->xEnc), 4, &eb)))
+ if (!(pAstCfg->xEnc = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, ENCODEN * sizeof (*pAstCfg->xEnc), 4, &eb)))
{
TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xEnc) %d bytes from space %d at 0x%x.",
- ENCODEN * sizeof (*pC->xEnc),
- HEAP_ID_INTERNAL, (IArg)pC->xEnc);
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pAstCfg->xEnc) %d bytes from space %d at 0x%x.",
+ ENCODEN * sizeof (*pAstCfg->xEnc),
+ HEAP_ID_INTERNAL, (IArg)pAstCfg->xEnc);
/* Output memory */
- if (!(pC->xOut = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, OUTPUTN * sizeof (*pC->xOut), 4, &eb)))
+ if (!(pAstCfg->xOut = Memory_calloc((IHeap_Handle)HEAP_INTERNAL, OUTPUTN * sizeof (*pAstCfg->xOut), 4, &eb)))
{
TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
return __LINE__;
}
- TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pC->xOut) %d bytes from space %d at 0x%x.",
- OUTPUTN * sizeof (*pC->xOut),
- HEAP_ID_INTERNAL, (IArg)pC->xOut);
+ TRACE_TERSE3("PAF_ASOT_initPhaseMalloc. (pAstCfg->xOut) %d bytes from space %d at 0x%x.",
+ OUTPUTN * sizeof (*pAstCfg->xOut),
+ HEAP_ID_INTERNAL, (IArg)pAstCfg->xOut);
TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: initialization phase - memory allocation complete.", as+zMS);
return 0;
//
Int
PAF_ASOT_initPhaseConfig(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* input/encode/stream/decode/output counter */
- Int zMS = pC->masterStr;
+ 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_ASOT_initPhaseConfig: AS%d: initialization phase - configuration", as+zMS);
{
Int zO = pP->outputsFromEncodes[z];
Int zS = pP->streamsFromEncodes[z];
- pC->xEnc[z].encodeControl.size = sizeof(pC->xEnc[z].encodeControl);
- pC->xEnc[z].encodeControl.pAudioFrame = pC->xStr[zS].pAudioFrame;
- pC->xEnc[z].encodeControl.pVolumeStatus = &pC->xEnc[z].volumeStatus;
- pC->xEnc[z].encodeControl.pOutBufConfig = &pC->xOut[zO].outBufConfig;
- pC->xEnc[z].encodeStatus = *pP->z_pEncodeStatus[z];
- pC->xEnc[z].encodeControl.encActive = pC->xEnc[z].encodeStatus.select;
- pC->xEnc[z].volumeStatus = *pP->pVolumeStatus;
- pC->xEnc[z].encodeInStruct.pAudioFrame = pC->xStr[zS].pAudioFrame;
+ pAstCfg->xEnc[z].encodeControl.size = sizeof(pAstCfg->xEnc[z].encodeControl);
+ pAstCfg->xEnc[z].encodeControl.pAudioFrame = pAstCfg->xStr[zS].pAudioFrame;
+ pAstCfg->xEnc[z].encodeControl.pVolumeStatus = &pAstCfg->xEnc[z].volumeStatus;
+ pAstCfg->xEnc[z].encodeControl.pOutBufConfig = &pAstCfg->xOut[zO].outBufConfig;
+ pAstCfg->xEnc[z].encodeStatus = *pP->z_pEncodeStatus[z];
+ pAstCfg->xEnc[z].encodeControl.encActive = pAstCfg->xEnc[z].encodeStatus.select;
+ pAstCfg->xEnc[z].volumeStatus = *pP->pVolumeStatus;
+ pAstCfg->xEnc[z].encodeInStruct.pAudioFrame = pAstCfg->xStr[zS].pAudioFrame;
}
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- pC->xOut[z].outBufStatus = *pP->pOutBufStatus;
+ pAstCfg->xOut[z].outBufStatus = *pP->pOutBufStatus;
}
TRACE_TERSE1("PAF_ASOT_initPhaseConfig: AS%d: initialization phase - configuration complete.", as+zMS);
//
Int
PAF_ASOT_initPhaseAcpAlg(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_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_ASOT_initPhaseAcpAlg: AS%d: initialization phase - ACP Algorithm", as+zMS);
ACP_MDS_init();
zS = pP->streamsFromEncodes[z];
acp->fxns->attach(acp, ACP_SERIES_STD,
STD_BETA_ENCODE + betaPrimeOffset * (as-1+zS),
- (IALG_Status *)&pC->xEnc[z].encodeStatus);
+ (IALG_Status *)&pAstCfg->xEnc[z].encodeStatus);
acp->fxns->attach(acp, ACP_SERIES_STD,
STD_BETA_VOLUME + betaPrimeOffset * (as-1+zS),
- (IALG_Status *)&pC->xEnc[z].volumeStatus);
+ (IALG_Status *)&pAstCfg->xEnc[z].volumeStatus);
/* Ignore errors, not reported. */
}
}
acp->fxns->attach(acp, ACP_SERIES_STD,
STD_BETA_OB + betaPrimeOffset * (as-1+zS),
- (IALG_Status *)&pC->xOut[z].outBufStatus);
+ (IALG_Status *)&pAstCfg->xOut[z].outBufStatus);
/* Ignore errors, not reported. */
}
//
Int
PAF_ASOT_initPhaseCommon(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_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 */
+ Int g; /* gear */
+ 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_ASOT_initPhaseCommon: initialization phase - Common Memory");
//
TRACE_TERSE1("PAF_ASOT_initPhaseCommon: calling PAF_ALG_ALLOC outLinkInit common[%d].", z);
if (PAF_ALG_ALLOC(outLinkInit[z-OUTPUT1], common[z]))
{
- TRACE_TERSE1("PAF_AST_initPhaseMalloc: AS%d: PAF_ALG_alloc failed", as+z);
+ TRACE_TERSE1("PAF_ASOT_initPhaseMalloc: AS%d: PAF_ALG_alloc failed", as+z);
TRACE_TERSE2("Failed to alloc %d bytes from space %d", common[z]->size, (IArg)common[z]->space);
SW_BREAKPOINT;
return __LINE__;
}
}
- pC->xStr[z].aspChain[0] = NULL;
+ pAstCfg->xStr[z].aspChain[0] = NULL;
for (g=0; g < GEARS; g++)
{
PAF_ASP_Chain *chain;
TRACE_TERSE0("PAF_ASOT_initPhaseCommon: calling PAF_ASP_chainInit for ASPs.");
- chain = PAF_ASP_chainInit(&pC->xStr[z].aspChainData[g], pP->pChainFxns,
+ chain = PAF_ASP_chainInit(&pAstCfg->xStr[z].aspChainData[g], pP->pChainFxns,
HEAP_INTERNAL, as+z, acp, &trace,
- aspLinkInit[z-STREAM1][g], pC->xStr[z].aspChain[0], common[z], &pafAlgConfig);
+ aspLinkInit[z-STREAM1][g], pAstCfg->xStr[z].aspChain[0], common[z], &pafAlgConfig);
if (!chain)
{
TRACE_TERSE2("AS%d: ASP chain %d initialization failed", as+z, g);
}
else
{
- pC->xStr[z].aspChain[g] = chain;
+ pAstCfg->xStr[z].aspChain[g] = chain;
}
}
{
PAF_ASP_Chain *chain;
TRACE_TERSE0("PAF_ASOT_initPhaseCommon: calling PAF_ASP_chainInit for encode.");
- chain = PAF_ASP_chainInit(&pC->xEnc[zE].encChainData, pP->pChainFxns,
+ chain = PAF_ASP_chainInit(&pAstCfg->xEnc[zE].encChainData, pP->pChainFxns,
HEAP_INTERNAL, as+z, acp, &trace,
encLinkInit[zE-ENCODE1], NULL, common[z], &pafAlgConfig);
if (!chain)
PAF_ASP_Chain *chain;
TRACE_TERSE2("PAF_ASOT_initPhaseMalloc: AS%d: non-common output chain init for %d",
as+z, z);
- chain = PAF_ASP_chainInit (&pC->xOut[z].outChainData, pP->pChainFxns,
+ chain = PAF_ASP_chainInit (&pAstCfg->xOut[z].outChainData, pP->pChainFxns,
HEAP_EXTERNAL, as+z, acp, &trace,
outLinkInit[z-OUTPUT1], NULL, common[z], &pafAlgConfig);
if (!chain)
// .............................................................................
Int
PAF_ASOT_initPhaseAlgKey(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode/encode counter */
- Int s; /* key number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/encode counter */
+ Int s; /* key number */
PAF_ASP_Link *that;
+ 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_ASOT_initPhaseAlgKey: AS%d: initialization phase - Algorithm Keys", as);
for (s=0; s < pP->pEncAlgKey->length; s++)
{
if ((pP->pEncAlgKey->code[s].full != 0) &&
- (that = PAF_ASP_chainFind(&pC->xEnc[z].encChainData, pP->pEncAlgKey->code[s])))
+ (that = PAF_ASP_chainFind(&pAstCfg->xEnc[z].encChainData, pP->pEncAlgKey->code[s])))
{
- pC->xEnc[z].encAlg[s] = (ALG_Handle )that->alg;
+ pAstCfg->xEnc[z].encAlg[s] = (ALG_Handle )that->alg;
}
/* Cast in interface, for now --Kurt */
else
{
- pC->xEnc[z].encAlg[s] = NULL;
+ pAstCfg->xEnc[z].encAlg[s] = NULL;
}
}
}
//
Int
PAF_ASOT_initPhaseDevice(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* input/output counter */
+ 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_ASOT_initPhaseDevice: AS%d: initialization phase - I/O Devices", as);
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- PAF_OutBufConfig *pConfig = &pC->xOut[z].outBufConfig;
+ PAF_OutBufConfig *pConfig = &pAstCfg->xOut[z].outBufConfig;
- pObj = (PAF_SIO_IALG_Obj *)pC->xOut[z].outChainData.head->alg;
+ pObj = (PAF_SIO_IALG_Obj *)pAstCfg->xOut[z].outChainData.head->alg;
pAlgConfig = &pObj->config;
- pC->xOut[z].hTxSio = NULL;
+ pAstCfg->xOut[z].hTxSio = NULL;
pConfig->base.pVoid = pAlgConfig->pMemRec[0].base;
pConfig->pntr.pVoid = pAlgConfig->pMemRec[0].base;
pConfig->head.pVoid = pAlgConfig->pMemRec[0].base;
Int
PAF_ASOT_initFrame0(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int z
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
Int ch;
//Int aLen;
Int aLen_int=0,aLen_ext=0;
char i;
Error_Block eb;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+
// Initialize error block
Error_init(&eb);
//
// Initialize audio frame elements directly
//
- pC->xStr[z].pAudioFrame->fxns = pP->pAudioFrameFunctions;
- pC->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN; ///
-/// pC->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN_AF;
- pC->xStr[z].pAudioFrame->data.nSamples = FRAMELENGTH;
- pC->xStr[z].pAudioFrame->data.sample = pC->xStr[z].audioFrameChannelPointers;
- pC->xStr[z].pAudioFrame->data.samsiz = pC->xStr[z].audioFrameChannelSizes;
- pC->xStr[z].pAudioFrame->pChannelConfigurationMaskTable = &PAF_ASP_stdCCMT;
+ pAstCfg->xStr[z].pAudioFrame->fxns = pP->pAudioFrameFunctions;
+ pAstCfg->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN; ///
+/// pAstCfg->xStr[z].pAudioFrame->data.nChannels = PAF_MAXNUMCHAN_AF;
+ pAstCfg->xStr[z].pAudioFrame->data.nSamples = FRAMELENGTH;
+ pAstCfg->xStr[z].pAudioFrame->data.sample = pAstCfg->xStr[z].audioFrameChannelPointers;
+ pAstCfg->xStr[z].pAudioFrame->data.samsiz = pAstCfg->xStr[z].audioFrameChannelSizes;
+ pAstCfg->xStr[z].pAudioFrame->pChannelConfigurationMaskTable = &PAF_ASP_stdCCMT;
//
// Allocate memory for and initialize pointers to audio data buffers
#pragma UNROLL(1)
for (i=0; i < PAF_MAXNUMCHAN_AF; i++)
{
- pC->xStr[z].audioFrameChannelPointers[i] = NULL;
+ pAstCfg->xStr[z].audioFrameChannelPointers[i] = NULL;
}
}
{
if(pP->pAudioFrameBufStatus->space[i] == IALG_SARAM)
{
- pC->xStr[z].audioFrameChannelPointers[chan] = aBuf_int + maxFrameLength*(j+1) - FRAMELENGTH;
+ pAstCfg->xStr[z].audioFrameChannelPointers[chan] = aBuf_int + maxFrameLength*(j+1) - FRAMELENGTH;
j++;
}
else
{
- pC->xStr[z].audioFrameChannelPointers[chan] = aBuf_ext + maxFrameLength*(k+1) - FRAMELENGTH;
+ pAstCfg->xStr[z].audioFrameChannelPointers[chan] = aBuf_ext + maxFrameLength*(k+1) - FRAMELENGTH;
k++;
}
TRACE_TERSE3("PAF_ASOT_initFrame0: chan = %d = AFChanPtrMap[%d][%d].", chan, numchan[z], i);
- TRACE_TERSE2("PAF_ASOT_initFrame0: audioFrameChannelPointers[%d]: 0x%x", chan, (IArg)pC->xStr[z].audioFrameChannelPointers[chan]);
+ TRACE_TERSE2("PAF_ASOT_initFrame0: audioFrameChannelPointers[%d]: 0x%x", chan, (IArg)pAstCfg->xStr[z].audioFrameChannelPointers[chan]);
}
}
}
for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++)
{
- if (pC->xStr[z].audioFrameChannelPointers[ch])
+ if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
{
- pC->xStr[z].origAudioFrameChannelPointers[ch] = pC->xStr[z].audioFrameChannelPointers[ch];
+ pAstCfg->xStr[z].origAudioFrameChannelPointers[ch] = pAstCfg->xStr[z].audioFrameChannelPointers[ch];
}
}
//
// Initialize meta data elements
//
- pC->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
- pC->xStr[z].pAudioFrame->numPrivateMetadata = 0;
- pC->xStr[z].pAudioFrame->bsMetadata_offset = 0;
- pC->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
- pC->xStr[z].pAudioFrame->privateMetadataBufSize = pP->pMetadataBufStatus->bufSize;
+ pAstCfg->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
+ pAstCfg->xStr[z].pAudioFrame->numPrivateMetadata = 0;
+ pAstCfg->xStr[z].pAudioFrame->bsMetadata_offset = 0;
+ pAstCfg->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+ pAstCfg->xStr[z].pAudioFrame->privateMetadataBufSize = pP->pMetadataBufStatus->bufSize;
for(i=0;i<pP->pMetadataBufStatus->NumBuf;i++)
{
- pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
- pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
- pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].pMdBuf = metadataBuf + pP->pMetadataBufStatus->bufSize*i;
+ pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
+ pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
+ pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].pMdBuf = metadataBuf + pP->pMetadataBufStatus->bufSize*i;
}
//
if (pP->streamsFromDecodes[zX] == z)
{
#ifdef NOAUDIOSHARE
- pC->xDec[zX].decodeInStruct.audioShare.nSamples = 0;
- pC->xDec[zX].decodeInStruct.audioShare.sample = NULL;
+ pAstCfg->xDec[zX].decodeInStruct.audioShare.nSamples = 0;
+ pAstCfg->xDec[zX].decodeInStruct.audioShare.sample = NULL;
#else /* NOAUDIOSHARE */
- pC->xDec[zX].decodeInStruct.audioShare.nSamples = aLen_int;
- pC->xDec[zX].decodeInStruct.audioShare.sample = aBuf_int;
+ pAstCfg->xDec[zX].decodeInStruct.audioShare.nSamples = aLen_int;
+ pAstCfg->xDec[zX].decodeInStruct.audioShare.sample = aBuf_int;
#endif /* NOAUDIOSHARE */
}
}
//
Int
PAF_ASOT_initFrame1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int z,
Int apply
)
{
+ PAF_AST_Config *pAstCfg;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
//
// Reinitialize audio frame elements:
//
if (apply < 0)
{
- pC->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_UNKNOWN;
- pC->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_UNKNOWN;
+ pAstCfg->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_UNKNOWN;
+ pAstCfg->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_UNKNOWN;
}
else
{
- pC->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_NONE;
- pC->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_NONE;
+ pAstCfg->xStr[z].pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_NONE;
+ pAstCfg->xStr[z].pAudioFrame->channelConfigurationStream.legacy = PAF_CC_NONE;
}
if (apply < 1)
{
- pC->xStr[z].pAudioFrame->sampleRate = PAF_SAMPLERATE_UNKNOWN;
- pC->xStr[z].pAudioFrame->sampleCount = 0;
+ pAstCfg->xStr[z].pAudioFrame->sampleRate = PAF_SAMPLERATE_UNKNOWN;
+ pAstCfg->xStr[z].pAudioFrame->sampleCount = 0;
}
return 0;
-} //PAF_AST_initFrame1
+} //PAF_ASOT_initFrame1
// -----------------------------------------------------------------------------
// ASOT Selection Function - Output Device Selection
//
Int
PAF_ASOT_selectDevices(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_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;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
// Select output devices
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if ((device = pC->xOut[z].outBufStatus.sioSelect) >= 0)
+ if ((device = pAstCfg->xOut[z].outBufStatus.sioSelect) >= 0)
{
TRACE_VERBOSE2("PAF_ASOT_selectDevices: AS%d: output device %d selecting ...", as+z, device);
device = 0; /* treat as device None */
}
- errme = pP->fxns->deviceSelect(&pC->xOut[z].hTxSio, SIO_OUTPUT,
+ errme = pP->fxns->deviceSelect(&pAstCfg->xOut[z].hTxSio, SIO_OUTPUT,
HEAP_ID_OUTBUF, (Ptr)pQ->devout->x[device]);
if (errme)
{
{
errno = ASPERR_DEVOUT + errme;
}
- pC->xOut[z].outBufStatus.sioSelect = 0x80;
+ pAstCfg->xOut[z].outBufStatus.sioSelect = 0x80;
}
else
{
Int zE;
- pC->xOut[z].outBufStatus.sioSelect = device | 0x80;
+ pAstCfg->xOut[z].outBufStatus.sioSelect = device | 0x80;
// register outBufStatus and encodeStatus pointers with output devices
// This enables proper IEC encapsulation.
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
// set max # of output buffers (use override if necessary)
- if (pC->xOut[z].outBufStatus.maxNumBufOverride == 0)
+ if (pAstCfg->xOut[z].outBufStatus.maxNumBufOverride == 0)
{
- SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
+ SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
(Arg)pP->poutNumBufMap[z]->maxNumBuf);
}
else
{
- SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
- (Arg)pC->xOut[z].outBufStatus.maxNumBufOverride);
+ SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_MAX_NUMBUF,
+ (Arg)pAstCfg->xOut[z].outBufStatus.maxNumBufOverride);
}
// register PAF_SIO_IALG object address
- SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_IALGADDR,
- (Arg)pC->xOut[z].outChainData.head->alg);
- SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_BUFSTATUSADDR,
- (Arg)&pC->xOut[z].outBufStatus);
+ SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_IALGADDR,
+ (Arg)pAstCfg->xOut[z].outChainData.head->alg);
+ SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_BUFSTATUSADDR,
+ (Arg)&pAstCfg->xOut[z].outBufStatus);
for (zE=ENCODE1; zE < ENCODEN; zE++)
{
if (pP->outputsFromEncodes[zE] == z)
{
- SIO_ctrl (pC->xOut[z].hTxSio,
+ SIO_ctrl(pAstCfg->xOut[z].hTxSio,
PAF_SIO_CONTROL_SET_ENCSTATUSADDR,
- (Arg)&pC->xEnc[zE].encodeStatus);
+ (Arg)&pAstCfg->xEnc[zE].encodeStatus);
break;
}
}
// if device selected and valid then enable stat tracking if
// required and start clocking
- if ((pC->xOut[z].outBufStatus.sioSelect < 0) && (pC->xOut[z].hTxSio))
+ if ((pAstCfg->xOut[z].outBufStatus.sioSelect < 0) && (pAstCfg->xOut[z].hTxSio))
{
TRACE_VERBOSE0("PAF_ASOT_selectDevices: start SIO clocks");
- errme = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_OUTPUT_START_CLOCKS, 0);
+ errme = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_OUTPUT_START_CLOCKS, 0);
if (errme)
{
TRACE_VERBOSE2("PAF_ASOT_selectDevices: errme 0x%x, errno 0x%x", errme, errno);
- SIO_idle (pC->xOut[z].hTxSio);
+ SIO_idle(pAstCfg->xOut[z].hTxSio);
if (!errno)
{
errno = ASPERR_DEVOUT + errme;
//
Int
PAF_ASOT_decodeProcessing(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int sourceSelect
)
{
+ PAF_AST_Config *pAstCfg;
Int z; /* decode counter */
Int errno; /* error number */
Int getVal;
Int block; // decoder output block count / input frame
Int outSioUpdate;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
for (;;)
{
// FL: Check if any change in output SIO, e.g. from Output shortcut.
Int ch;
for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++)
{
- if (pC->xStr[z].audioFrameChannelPointers[ch])
+ if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
{
- pC->xStr[z].audioFrameChannelPointers[ch] =
- pC->xStr[z].origAudioFrameChannelPointers[ch];
+ pAstCfg->xStr[z].audioFrameChannelPointers[ch] =
+ pAstCfg->xStr[z].origAudioFrameChannelPointers[ch];
}
}
}
for (z=STREAM1; z < STREAMN; z++)
{
- pC->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
- pC->xStr[z].pAudioFrame->numPrivateMetadata = 0;
- pC->xStr[z].pAudioFrame->bsMetadata_offset = 0;
- pC->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+ pAstCfg->xStr[z].pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
+ pAstCfg->xStr[z].pAudioFrame->numPrivateMetadata = 0;
+ pAstCfg->xStr[z].pAudioFrame->bsMetadata_offset = 0;
+ pAstCfg->xStr[z].pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
for (i=0; i<pP->pMetadataBufStatus->NumBuf; i++)
{
- pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
- pC->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
+ pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].offset = 0;
+ pAstCfg->xStr[z].pAudioFrame->pafPrivateMetadata[i].size = 0;
}
}
}
Int ch;
for (ch=PAF_LEFT; ch < PAF_MAXNUMCHAN_AF; ch++)
{
- if (pC->xStr[z].audioFrameChannelPointers[ch])
+ if (pAstCfg->xStr[z].audioFrameChannelPointers[ch])
{
- pC->xStr[z].audioFrameChannelPointers[ch] =
- pC->xStr[z].origAudioFrameChannelPointers[ch];
+ pAstCfg->xStr[z].audioFrameChannelPointers[ch] =
+ pAstCfg->xStr[z].origAudioFrameChannelPointers[ch];
}
}
}
{
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if ((pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND)
+ if ((pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND)
{
- TRACE_VERBOSE0("PAF_AST_outputProcessing: state: FINAL: SOUND -> QUIET");
- pC->xOut[z].outBufStatus.audio++; // SOUND -> QUIET
+ TRACE_VERBOSE0("PAF_ASOT_outputProcessing: state: FINAL: SOUND -> QUIET");
+ pAstCfg->xOut[z].outBufStatus.audio++; // SOUND -> QUIET
}
}
break;
//
Int
PAF_ASOT_encodeCommand(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* encode counter */
- Int errno = 0; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* encode counter */
+ Int errno = 0; /* error number */
Int zO, zS;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+
for (z=ENCODE1; z < ENCODEN; z++)
{
zO = pP->outputsFromEncodes[z];
zS = pP->streamsFromEncodes[z];
- if (! (pC->xEnc[z].encodeStatus.command2 & 0x80))
+ if (! (pAstCfg->xEnc[z].encodeStatus.command2 & 0x80))
{
- switch (pC->xEnc[z].encodeStatus.command2)
+ switch (pAstCfg->xEnc[z].encodeStatus.command2)
{
case 0: // command none - process
- pC->xEnc[z].encodeStatus.command2 |= 0x80;
+ pAstCfg->xEnc[z].encodeStatus.command2 |= 0x80;
break;
case 1: // mute command
TRACE_VERBOSE2("AS%d: PAF_ASOT_encodeCommand: encode command mute (0x%02x)", as+zS, 1);
- if ((pC->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
- && pC->xOut[zO].hTxSio
- && (errno = SIO_ctrl (pC->xOut[zO].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
+ if ((pAstCfg->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
+ && pAstCfg->xOut[zO].hTxSio
+ && (errno = SIO_ctrl (pAstCfg->xOut[zO].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
{
errno = (errno & 0xff) | ASPERR_MUTE;
/* convert to sensical errno */
}
else
{
- pC->xOut[zO].outBufStatus.audio |= PAF_OB_AUDIO_MUTED;
+ pAstCfg->xOut[zO].outBufStatus.audio |= PAF_OB_AUDIO_MUTED;
}
- pC->xEnc[z].encodeStatus.command2 |= 0x80;
+ pAstCfg->xEnc[z].encodeStatus.command2 |= 0x80;
break;
case 2: // unmute command
TRACE_VERBOSE2("AS%d: PAF_ASOT_encodeCommand: encode command unmute (0x%02x)", as+zS, 2);
- if ((pC->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
- && pC->xOut[zO].hTxSio
- && (errno = SIO_ctrl (pC->xOut[zO].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0)))
+ if ((pAstCfg->xOut[zO].outBufStatus.audio & 0x0f) != PAF_OB_AUDIO_QUIET
+ && pAstCfg->xOut[zO].hTxSio
+ && (errno = SIO_ctrl (pAstCfg->xOut[zO].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0)))
{
errno = (errno & 0xff) | ASPERR_MUTE;
/* convert to sensical errno */
}
else
{
- pC->xOut[zO].outBufStatus.audio &= ~PAF_OB_AUDIO_MUTED;
+ pAstCfg->xOut[zO].outBufStatus.audio &= ~PAF_OB_AUDIO_MUTED;
}
- pC->xEnc[z].encodeStatus.command2 |= 0x80;
+ pAstCfg->xEnc[z].encodeStatus.command2 |= 0x80;
break;
default: // command unknown - ignore
break;
// Purpose: Decoding Function for reinitializing the decoding process.
Int
PAF_ASOT_decodeInit(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_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 zO, zS;
- 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;
for (z=DECODE1; z < DECODEN; z++)
{
// Start decoder output circular buffer reads
- pCb = &pC->xDecOpCb[z];
+ pCb = &pAstCfg->xDecOpCb[z];
errno = cbReadStart(pCb);
if (errno)
{
{
zO = pP->outputsFromEncodes[z];
zS = pP->streamsFromEncodes[z];
- if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode)
+ if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode)
{
- Int select = pC->xEnc[z].encodeStatus.select;
- ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+ Int select = pAstCfg->xEnc[z].encodeStatus.select;
+ ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
ENC_Handle enc = (ENC_Handle )encAlg;
TRACE_VERBOSE1("AS%d: PAF_ASOT_decodeInit: initializing encode", as+zS);
if (encAlg->fxns->algActivate)
}
if (enc->fxns->reset
&& (errno = enc->fxns->reset(enc, NULL,
- &pC->xEnc[z].encodeControl, &pC->xEnc[z].encodeStatus)))
+ &pAstCfg->xEnc[z].encodeControl, &pAstCfg->xEnc[z].encodeStatus)))
{
return errno;
}
//
Int
PAF_ASOT_decodeInfo1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
)
{
+ PAF_AST_Config *pAstCfg;
Int z; /* decode/encode counter */
Int errno; /* error number */
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
// run the chain of ASP's on the stream.
TRACE_VERBOSE0("PAF_ASOT_decodeInfo1: calling streamChainFunction.");
if (errno = pP->fxns->streamChainFunction(pP, pQ, pC,
for (z=ENCODE1; z < ENCODEN; z++)
{
Int zO = pP->outputsFromEncodes[z];
- if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode)
+ if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode)
{
- Int select = pC->xEnc[z].encodeStatus.select;
- ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+ Int select = pAstCfg->xEnc[z].encodeStatus.select;
+ ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
ENC_Handle enc = (ENC_Handle )encAlg;
if (enc->fxns->info
&& (errno = enc->fxns->info(enc, NULL,
- &pC->xEnc[z].encodeControl, &pC->xEnc[z].encodeStatus)))
+ &pAstCfg->xEnc[z].encodeControl, &pAstCfg->xEnc[z].encodeStatus)))
{
TRACE_TERSE1("PAF_ASOT_decodeInfo1: info returns errno 0x%x ", errno);
return errno;
//
Int
PAF_ASOT_decodeInfo2(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
)
{
+ PAF_AST_Config *pAstCfg;
Int errno;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
errno = pP->fxns->setCheckRateX (pP, pQ, pC, 1);
TRACE_VERBOSE1("PAF_ASOT_decodeInfo2: return 0x%x", errno);
return errno;
//
Int
PAF_ASOT_decodeStream(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
)
{
+ PAF_AST_Config *pAstCfg;
Int z; /* decode/stream counter */
PAF_AST_DecOpCircBuf *pCb; /* decoder output circular buffer */
PAF_AudioFrame *pAfRd;
Int cbErrno;
Int errno;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
for (z=DECODE1; z < DECODEN; z++)
{
Int zS = pP->streamsFromDecodes[z];
//
// (***) FL: read circular buffer
//
- pCb = &pC->xDecOpCb[z];
- pAfRd = pC->xStr[zS].pAudioFrame;
+ pCb = &pAstCfg->xDecOpCb[z];
+ pAfRd = pAstCfg->xStr[zS].pAudioFrame;
cbErrno = cbReadAf(pCb, pAfRd);
if (cbErrno != 0)
{
//
Int
PAF_ASOT_decodeEncode(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* encode/output counter */
- Int errno; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* encode/output counter */
+ Int errno; /* error number */
Int zX, zE, zS;
UInt32 curTime;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
// Await output buffers (but not first time)
for (z=OUTPUT1; z < OUTPUTN; z++)
}
zS = pP->streamsFromEncodes[zE];
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
// update length (e.g. ARC may have changed)
- pC->xOut[z].outBufConfig.lengthofFrame =
- pC->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
+ pAstCfg->xOut[z].outBufConfig.lengthofFrame =
+ pAstCfg->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- idle", as+zS, block);
- errno = SIO_reclaim(pC->xOut[z].hTxSio,(Ptr *) &pC->xOut[z].pOutBuf, NULL);
+ errno = SIO_reclaim(pAstCfg->xOut[z].hTxSio,(Ptr *) &pAstCfg->xOut[z].pOutBuf, NULL);
if (errno < 0)
{
- SIO_idle(pC->xOut[z].hTxSio);
+ SIO_idle(pAstCfg->xOut[z].hTxSio);
TRACE_TERSE2("PAF_ASOT_decodeEncode: AS%d: SIO_reclaim returns error %d", as+zS, -errno);
return -errno; // SIO negates error codes
}
Int zO = pP->outputsFromEncodes[z];
Int zS = pP->streamsFromEncodes[z];
(void)zS; // clear compiler warning in case not used with tracing disabled
- if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode)
+ if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode)
{
- Int select = pC->xEnc[z].encodeStatus.select;
- ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+ Int select = pAstCfg->xEnc[z].encodeStatus.select;
+ ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
ENC_Handle enc = (ENC_Handle )encAlg;
- if (select != pC->xEnc[z].encodeControl.encActive)
+ if (select != pAstCfg->xEnc[z].encodeControl.encActive)
{
- pC->xEnc[z].encodeControl.encActive = select;
+ pAstCfg->xEnc[z].encodeControl.encActive = select;
TRACE_TERSE0("PAF_ASOT_decodeEncode: return error");
return (-1);
}
TRACE_GEN2("AS%d: PAF_ASOT_decodeEncode: processing block %d -- encode", as+zS, block);
// (MID 1933) temp. workaround for PCE2
- pC->xEnc[z].encodeInStruct.pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
+ pAstCfg->xEnc[z].encodeInStruct.pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
/*
#if (CURRENT_TRACE_MASK & TRACE_MASK_DATA)
if (enc->fxns->encode)
{
- pC->xEnc[z].encodeOutStruct.bypassFlag =
+ pAstCfg->xEnc[z].encodeOutStruct.bypassFlag =
pP->z_pEncodeStatus[z]->encBypass;
if (errno = enc->fxns->encode(enc, NULL,
- &pC->xEnc[z].encodeInStruct, &pC->xEnc[z].encodeOutStruct))
+ &pAstCfg->xEnc[z].encodeInStruct, &pAstCfg->xEnc[z].encodeOutStruct))
{
if (errno != PCEERR_OUTPUT_POINTERNULL)
{
}
zS = pP->streamsFromEncodes[zE];
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
TRACE_GEN2("PAF_ASOT_decodeEncode: AS%d: processing block %d -- output", as+zS, block);
- errno = SIO_issue(pC->xOut[z].hTxSio,
- &pC->xOut[z].outBufConfig, sizeof (pC->xOut[z].outBufConfig), 0);
+ errno = SIO_issue(pAstCfg->xOut[z].hTxSio,
+ &pAstCfg->xOut[z].outBufConfig, sizeof (pAstCfg->xOut[z].outBufConfig), 0);
if (errno)
{
- SIO_idle(pC->xOut[z].hTxSio);
+ SIO_idle(pAstCfg->xOut[z].hTxSio);
if (errno == 0x105) // 0x105 == RINGIO_EBUFFULL
{
// statStruct_LogFullRing(STATSTRUCT_AS1_F2);
//
Int
PAF_ASOT_decodeComplete(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
ALG_Handle decAlg[],
Int frame,
Int block
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* decode/encode counter */
- Int errno; /* error number */
- PAF_AST_DecOpCircBuf *pCb; /* decoder output circular buffer */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* decode/encode counter */
+ Int errno; /* error number */
+ PAF_AST_DecOpCircBuf *pCb; /* decoder output circular buffer */
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
for (z=DECODE1; z < DECODEN; z++)
{
// Stop decoder output circular buffer reads
- pCb = &pC->xDecOpCb[z];
+ pCb = &pAstCfg->xDecOpCb[z];
errno = cbReadStop(pCb);
if (errno)
{
for (z=ENCODE1; z < ENCODEN; z++)
{
Int zO = pP->outputsFromEncodes[z];
- if (pC->xOut[zO].hTxSio && pC->xEnc[z].encodeStatus.mode)
+ if (pAstCfg->xOut[zO].hTxSio && pAstCfg->xEnc[z].encodeStatus.mode)
{
- Int select = pC->xEnc[z].encodeStatus.select;
- ALG_Handle encAlg = pC->xEnc[z].encAlg[select];
+ Int select = pAstCfg->xEnc[z].encodeStatus.select;
+ ALG_Handle encAlg = pAstCfg->xEnc[z].encAlg[select];
#ifdef PAF_ASP_FINAL
ENC_Handle enc = (ENC_Handle)encAlg;
#endif /* PAF_ASP_FINAL */
TRACE_VERBOSE1("PAF_ASOT_decodeComplete: AS%d: finalizing encode", as+z);
#ifdef PAF_ASP_FINAL
if (enc->fxns->final)
- enc->fxns->final(enc, NULL, &pC->xEnc[z].encodeControl,
- &pC->xEnc[z].encodeStatus);
+ enc->fxns->final(enc, NULL, &pAstCfg->xEnc[z].encodeControl,
+ &pAstCfg->xEnc[z].encodeStatus);
#endif /* PAF_ASP_FINAL */
if (encAlg->fxns->algDeactivate)
{
Int
PAF_ASOT_startOutput(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* output counter */
- Int errno,nbufs; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* output counter */
+ Int errno,nbufs; /* error number */
Int zE, zS, zX;
- Int zMD = pC->masterDec;
+ Int zMD;
PAF_SIO_IALG_Obj *pObj;
PAF_SIO_IALG_Config *pAlgConfig;
+
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
+ zMD = pAstCfg->masterDec;
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
// determine associated encoder and stream
zE = z;
}
// Set sample count so that DOB knows how much data to send
- pC->xOut[z].outBufConfig.lengthofFrame =
- pC->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
+ pAstCfg->xOut[z].outBufConfig.lengthofFrame =
+ pAstCfg->xEnc[zE].encodeInStruct.pAudioFrame->sampleCount;
- if (pC->xOut[z].outBufStatus.markerMode == PAF_OB_MARKER_ENABLED)
+ if (pAstCfg->xOut[z].outBufStatus.markerMode == PAF_OB_MARKER_ENABLED)
{
- pObj = (PAF_SIO_IALG_Obj *) pC->xOut[z].outChainData.head->alg;
+ pObj = (PAF_SIO_IALG_Obj *) pAstCfg->xOut[z].outChainData.head->alg;
pAlgConfig = &pObj->config;
- memset(pC->xOut[z].outBufConfig.base.pVoid, 0xAA,
+ memset(pAstCfg->xOut[z].outBufConfig.base.pVoid, 0xAA,
pAlgConfig->pMemRec[0].size);
}
// The index to DEC_OUTNUMBUF_MAP will always come from the primary/master
// decoder. How should we handle the sourceProgram for multiple decoders?
// Override as needed
- nbufs = DEC_OUTNUMBUF_MAP(pC->xDec[zMD].decodeStatus.sourceProgram);
- if (pC->xOut[z].outBufStatus.numBufOverride[pC->xDec[zMD].decodeStatus.sourceProgram] > 0)
+ nbufs = DEC_OUTNUMBUF_MAP(pAstCfg->xDec[zMD].decodeStatus.sourceProgram);
+ if (pAstCfg->xOut[z].outBufStatus.numBufOverride[pAstCfg->xDec[zMD].decodeStatus.sourceProgram] > 0)
{
- nbufs = pC->xOut[z].outBufStatus.numBufOverride[pC->xDec[zMD].decodeStatus.sourceProgram];
+ nbufs = pAstCfg->xOut[z].outBufStatus.numBufOverride[pAstCfg->xDec[zMD].decodeStatus.sourceProgram];
}
- SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_NUMBUF, nbufs);
+ SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_NUMBUF, nbufs);
- if (errno = SIO_issue(pC->xOut[z].hTxSio,
- &pC->xOut[z].outBufConfig, sizeof(pC->xOut[z].outBufConfig), 0))
+ if (errno = SIO_issue(pAstCfg->xOut[z].hTxSio,
+ &pAstCfg->xOut[z].outBufConfig, sizeof(pAstCfg->xOut[z].outBufConfig), 0))
{
- SIO_idle(pC->xOut[z].hTxSio);
+ SIO_idle(pAstCfg->xOut[z].hTxSio);
TRACE_TERSE2("PAF_ASOT_startOutput: AS%d: SIO_issue failed (0x%x)", as+zS, errno);
return errno;
}
- if (!(pC->xOut[z].outBufStatus.audio & 0xf0) &&
- (errno = SIO_ctrl (pC->xOut[z].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0)))
+ if (!(pAstCfg->xOut[z].outBufStatus.audio & 0xf0) &&
+ (errno = SIO_ctrl (pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_UNMUTE, 0)))
{
errno = (errno & 0xff) | ASPERR_MUTE;
/* convert to sensical errno */
}
else
{
- pC->xOut[z].outBufStatus.audio
- = (pC->xOut[z].outBufStatus.audio & 0xf0) | PAF_OB_AUDIO_SOUND;
+ pAstCfg->xOut[z].outBufStatus.audio
+ = (pAstCfg->xOut[z].outBufStatus.audio & 0xf0) | PAF_OB_AUDIO_SOUND;
}
TRACE_VERBOSE1("PAF_ASOT_startOutput: AS%d: output started", as+zS);
//
Int
PAF_ASOT_stopOutput(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* output counter */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* output counter */
Int errno = 0, getVal;
Int zS, zX;
PAF_SIO_IALG_Obj *pObj;
PAF_SIO_IALG_Config *pAlgConfig;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
// determine associated encoder and stream
zS = z;
// where such termination is due to decode error or user command.
// Identification of this as the usual case is provided by the
// "decode processing" state machine.
- if (!(pC->xOut[z].outBufStatus.audio & 0xf0) &&
- ((pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND) &&
- (getVal = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
+ if (!(pAstCfg->xOut[z].outBufStatus.audio & 0xf0) &&
+ ((pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_SOUND) &&
+ (getVal = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
{
if (!errno)
{
#else
// This form should be used when driver support for truncating
// data is supported for both internal and external clocks.
- getVal = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_IDLE,
- pC->xOut[z].outBufStatus.flush ? 1 :
- (pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH
+ getVal = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_IDLE,
+ pAstCfg->xOut[z].outBufStatus.flush ? 1 :
+ (pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH
? 1 : 0);
/* TESTED */
#endif
// where such termination is due to processing of a final frame
// or user command. Identification of this as a special case is
// provided by the "decode processing" state machine.
- if (!(pC->xOut[z].outBufStatus.audio & 0xf0) &&
- ((pC->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH) &&
- (getVal = SIO_ctrl(pC->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
+ if (!(pAstCfg->xOut[z].outBufStatus.audio & 0xf0) &&
+ ((pAstCfg->xOut[z].outBufStatus.audio & 0x0f) == PAF_OB_AUDIO_FLUSH) &&
+ (getVal = SIO_ctrl(pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_MUTE, 0)))
{
if (!errno)
{
TRACE_VERBOSE1("as1-f2: PAF_ASOT_stopOutput: AS%d: SIO control failed (mute)", as+zS);
}
- pC->xOut[z].outBufStatus.audio &= ~0x0f;
+ pAstCfg->xOut[z].outBufStatus.audio &= ~0x0f;
// zero output buffers
- pObj = (PAF_SIO_IALG_Obj *) pC->xOut[z].outChainData.head->alg;
+ pObj = (PAF_SIO_IALG_Obj *) pAstCfg->xOut[z].outChainData.head->alg;
pAlgConfig = &pObj->config;
- memset (pC->xOut[z].outBufConfig.base.pVoid, 0, pAlgConfig->pMemRec[0].size);
- } //pC->xOut[z].hTxSio
+ memset (pAstCfg->xOut[z].outBufConfig.base.pVoid, 0, pAlgConfig->pMemRec[0].size);
+ } //pAstCfg->xOut[z].hTxSio
}//OUTPUT
return errno;
-} //PAF_AST_stopOutput
+} //PAF_ASOT_stopOutput
// -----------------------------------------------------------------------------
// ASOT Decoding Function Helper - SIO Driver Change
/* 0: set, 1: check, unused for now. --Kurt */
Int
PAF_ASOT_setCheckRateX(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int check
)
{
+ PAF_AST_Config *pAstCfg;
float rateX;
PAF_SampleRateHz rateO /* std */, rateI /* inv */;
Int z; /* output counter */
Int zx; /* output re-counter */
Int getVal;
int inputRate, inputCount, outputRate, outputCount;
- Int zMD = pC->masterDec;
- Int zMI = pP->zone.master;
- Int zMS = pC->masterStr;
+ Int zMD;
+ Int zMI;
+ Int zMS;
Int zE, zX;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ zMD = pAstCfg->masterDec;
+ zMS = pAstCfg->masterStr;
+ zMI = pP->zone.master;
- inputRate = pC->xInp[zMI].inpBufStatus.sampleRateStatus;
- inputCount = pC->xDec[zMD].decodeStatus.frameLength;
- rateI = pC->xStr[zMS].pAudioFrame->fxns->sampleRateHz
- (pC->xStr[zMS].pAudioFrame, inputRate, PAF_SAMPLERATEHZ_INV);
+ inputRate = pAstCfg->xInp[zMI].inpBufStatus.sampleRateStatus;
+ inputCount = pAstCfg->xDec[zMD].decodeStatus.frameLength;
+ rateI = pAstCfg->xStr[zMS].pAudioFrame->fxns->sampleRateHz
+ (pAstCfg->xStr[zMS].pAudioFrame, inputRate, PAF_SAMPLERATEHZ_INV);
for (z=OUTPUT1; z < OUTPUTN; z++) {
- if (pC->xOut[z].hTxSio && (pC->xOut[z].outBufStatus.clock & 0x01)) {
+ if (pAstCfg->xOut[z].hTxSio && (pAstCfg->xOut[z].outBufStatus.clock & 0x01)) {
// determine associated encoder
zE = z;
}
}
- outputRate = pC->xEnc[zE].encodeStatus.sampleRate;
- outputCount = pC->xEnc[zE].encodeStatus.frameLength;
- rateO = pC->xStr[zMS].pAudioFrame->fxns->sampleRateHz
- (pC->xStr[zMS].pAudioFrame, outputRate, PAF_SAMPLERATEHZ_STD);
+ outputRate = pAstCfg->xEnc[zE].encodeStatus.sampleRate;
+ outputCount = pAstCfg->xEnc[zE].encodeStatus.frameLength;
+ rateO = pAstCfg->xStr[zMS].pAudioFrame->fxns->sampleRateHz
+ (pAstCfg->xStr[zMS].pAudioFrame, outputRate, PAF_SAMPLERATEHZ_STD);
if (rateI > 0 && rateO > 0)
rateX = rateO /* std */ * rateI /* inv */;
else if (inputCount != 0)
else
return ( ASPERR_INFO_RATERATIO );
- getVal = SIO_ctrl (pC->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_RATEX, (Arg) &rateX);
+ getVal = SIO_ctrl (pAstCfg->xOut[z].hTxSio, PAF_SIO_CONTROL_SET_RATEX, (Arg) &rateX);
if (getVal == DOBERR_RATECHANGE) {
for (zx=OUTPUT1; zx < OUTPUTN; zx++)
- if (pC->xOut[zx].hTxSio)
- SIO_idle (pC->xOut[zx].hTxSio);
+ if (pAstCfg->xOut[zx].hTxSio)
+ SIO_idle (pAstCfg->xOut[zx].hTxSio);
// this forces an exit from the calling state machine which will
// eventually call startOutput which calls setCheckRateX for all outputs
//
Int
PAF_ASOT_streamChainFunction(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int iChainFrameFxns,
Int abortOnError,
Int logArg
)
{
- Int as = pC->as; /* Audio Stream Number (1, 2, etc.) */
- Int z; /* stream counter */
- Int errno; /* error number */
+ PAF_AST_Config *pAstCfg;
+ Int as; /* Audio Stream Number (1, 2, etc.) */
+ Int z; /* stream counter */
+ Int errno; /* error number */
Int dFlag, eFlag, gear;
Int zX;
Int zS;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ as = pAstCfg->as;
(void)as; // clear compiler warning in case not used with tracing disabled
for (zS = STREAM1; zS < STREAMN; zS++)
gear = 0;
for (zX = DECODE1; zX < DECODEN; zX++) {
if (pP->streamsFromDecodes[zX] == z) {
- dFlag = pC->xDec[zX].decodeStatus.mode;
- gear = pC->xDec[zX].decodeStatus.aspGearStatus;
+ dFlag = pAstCfg->xDec[zX].decodeStatus.mode;
+ gear = pAstCfg->xDec[zX].decodeStatus.aspGearStatus;
break;
}
}
eFlag = 1;
for (zX = ENCODE1; zX < ENCODEN; zX++) {
if (pP->streamsFromEncodes[zX] == z) {
- eFlag = pC->xEnc[zX].encodeStatus.mode;
+ eFlag = pAstCfg->xEnc[zX].encodeStatus.mode;
break;
}
}
if (dFlag && eFlag) {
- PAF_ASP_Chain *chain = pC->xStr[z].aspChain[gear];
- PAF_AudioFrame *frame = pC->xStr[z].pAudioFrame;
+ PAF_ASP_Chain *chain = pAstCfg->xStr[z].aspChain[gear];
+ PAF_AudioFrame *frame = pAstCfg->xStr[z].pAudioFrame;
Int (*func) (PAF_ASP_Chain *, PAF_AudioFrame *) =
chain->fxns->chainFrameFunction[iChainFrameFxns];
}
return 0;
-} //PAF_AST_streamChainFunction
+} //PAF_ASOT_streamChainFunction
/* FL: Check if at least one output selected */
static Int checkOutSel(
- const PAF_AST_Params *pP,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ PAF_ASOT_Config *pC,
Int *pOutSel
)
{
+ PAF_AST_Config *pAstCfg;
Int outSel;
Int z;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
outSel = 0;
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if (pC->xOut[z].hTxSio)
+ if (pAstCfg->xOut[z].hTxSio)
{
outSel = 1;
break;
/* FL: Check if at least one output sio changed */
static Int checkOutSio(
- const PAF_AST_Params *pP,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ PAF_ASOT_Config *pC,
Int *pOutSioUpdate
)
{
+ PAF_AST_Config *pAstCfg;
Int outSioUpdate;
Int z;
+ pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+
outSioUpdate = 0;
for (z=OUTPUT1; z < OUTPUTN; z++)
{
- if (pC->xOut[z].outBufStatus.sioSelect >= 0)
+ if (pAstCfg->xOut[z].outBufStatus.sioSelect >= 0)
{
outSioUpdate = 1;
break;
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.h
index 3ecc7322f2e4364ba0bfea9fb7cbd3b16b5fd6a6..90220aebd4f06ce07c3ad93f0a33c3e6aad53355 100644 (file)
// Global debug counter */
extern Uint32 gTaskAsopCnt; // debug counter for ASOP task
+struct PAF_ASOT_Params;
+struct PAF_ASOT_Patchs;
+struct PAF_ASOT_Config;
+
+// Audio Stream Output Task (ASOT) parameters, functions
+typedef struct PAF_ASOT_Fxns {
+ Int (*initPhase[8]) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+ Int (*initFrame0) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ Int (*initFrame1) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
+ //Int (*passProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
+ //Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
+ //Int (*autoProcessing) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, ALG_Handle);
+ Int (*decodeProcessing) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ //Int (*decodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
+ Int (*encodeCommand) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+ Int (*decodeInit) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ //Int (*decodeInfo) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
+ Int (*decodeInfo1) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
+ Int (*decodeInfo2) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_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_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
+ Int (*decodeStream) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
+ Int (*decodeEncode) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int, Int);
+ //Int (*decodeFinalTest) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
+ Int (*decodeComplete) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, ALG_Handle *, Int, Int);
+ Int (*selectDevices) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+ Int (*sourceDecode) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ Int (*startOutput) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+ Int (*stopOutput) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *);
+ Int (*setCheckRateX) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_Config *, Int);
+ Int (*streamChainFunction) (const struct PAF_ASOT_Params *, const struct PAF_ASOT_Patchs *, struct PAF_ASOT_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_ASOT_Fxns;
+
+// Audio Stream Output Task (ASOT) parameters
+typedef struct PAF_ASOT_Params {
+ const PAF_ASOT_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_ASOT_Params;
+
+// Audio Stream Output Task (ASOT) patchs
+typedef struct PAF_ASOT_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_ASOT_Patchs;
+
+// Audio Stream Input Task (ASOT) configuration
+typedef struct PAF_ASOT_Config {
+ ACP_Handle acp;
+ PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
+} PAF_ASOT_Config;
+
+
// Purpose: Audio Stream Outpu Task Function for initialization of data pointers
// by allocation of memory.
Int
PAF_ASOT_initPhaseMalloc(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for initialization of data values
// from parameters.
Int
PAF_ASOT_initPhaseConfig(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for initialization of ACP by
// instantiation of the algorithm.
Int
PAF_ASOT_initPhaseAcpAlg(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// (***) FL: ASIT/ASOT currently consider common memory independently.
// Purpose: Audio Stream Output Task Function for allocation of common memory.
Int
PAF_ASOT_initPhaseCommon(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for initialization of ASP algorithms.
Int
PAF_ASOT_initPhaseAspAlg(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for initialization of data values
// from parameters for Algorithm Keys.
Int
PAF_ASOT_initPhaseAlgKey(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for initialization of Input Devices.
Int
PAF_ASOT_initPhaseDevice(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for initialization of the Audio
// and values.
Int
PAF_ASOT_initFrame0(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int z
);
// time-varying nature.
Int
PAF_ASOT_initFrame1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int z,
Int apply
);
// for output.
Int
PAF_ASOT_selectDevices(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Audio Stream Output Task Function for processing audio data.
//
Int
PAF_ASOT_decodeProcessing(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int sourceSelect
);
// Purpose: Decoding Function for processing Encode Commands.
Int
PAF_ASOT_encodeCommand(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Decoding Function for reinitializing the decoding process.
Int
PAF_ASOT_decodeInit(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int sourceSelect
);
// is unique to initial frames of input data.
Int
PAF_ASOT_decodeInfo(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
);
// is unique to initial frames of input data.
Int
PAF_ASOT_decodeInfo1(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
);
// is unique to frames of input data other than the initial one.
Int
PAF_ASOT_decodeInfo2(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
);
// ASP Algorithms.
Int
PAF_ASOT_decodeStream(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
);
// Encode Algorithm.
Int
PAF_ASOT_decodeEncode(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int frame,
Int block
);
// Purpose: Decoding Function for terminating the decoding process.
Int
PAF_ASOT_decodeComplete(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
ALG_Handle decAlg[],
Int frame,
Int block
// Purpose: Decoding Function for initiating output.
Int
PAF_ASOT_startOutput(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Decoding Function for terminating output.
Int
PAF_ASOT_stopOutput(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC
);
// Purpose: Decoding Function for re-initiating output.
Int
PAF_ASOT_setCheckRateX(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int check
);
// Purpose: Common Function for processing algorithm chains.
Int
PAF_ASOT_streamChainFunction(
- const PAF_AST_Params *pP,
- const PAF_AST_Patchs *pQ,
- PAF_AST_Config *pC,
+ const PAF_ASOT_Params *pP,
+ const PAF_ASOT_Patchs *pQ,
+ PAF_ASOT_Config *pC,
Int iChainFrameFxns,
Int abortOnError,
Int logArg
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 cf51e7c462e7323c073c8828088486e9d38c77f7..628c82144ef45bf4297b48c1f5908386285022b4 100644 (file)
#include "asp1.h"
#include "audioStreamProc_params.h"
#include "audioStreamInpProc.h"
+#include "audioStreamOutProc.h"
//
// Framework Declarations
PAF_AST_params_AudioFrameBufStatus //Audio frame buffer status
};
-extern const PAF_AST_Fxns PAF_ASOT_params_fxns;
+extern const PAF_ASOT_Fxns PAF_ASOT_params_fxns;
//(***) FL: initially a copy of asip
//(***) FL: re-visit, clean this up (remove unused members)
-const PAF_AST_Params asop_params_PAi =
+const PAF_ASOT_Params asop_params_PAi =
{
&PAF_ASOT_params_fxns, // fxns
{ // zone
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 169f40b2498c2e4faf34f0e8d1c59c012c314086..3d6f3185b0f34fccdec98bd005dd5d3358ff637c 100644 (file)
#include <asp0.h>
#include <asp1.h>
#include "audioStreamInpProc.h"
+#include "audioStreamOutProc.h"
//
// Decoder Definitions
};
// (***) FL: initially a copy of asip
-const PAF_AST_Patchs asop_patchs_PAi =
+const PAF_ASOT_Patchs asop_patchs_PAi =
{
patchs_devinp,
patchs_devout,