diff --git a/pasdk/test_arm/framework/audioStreamDecodeProc.c b/pasdk/test_arm/framework/audioStreamDecodeProc.c
index 2cb1b352339cd28346cf54ddf33e76f99471a7b7..65ab36c70e03c92af5a2d0eae686f43016121c8f 100644 (file)
#include "aspMsg_common.h"
#include "aspMsg_slave.h"
#include "aspDecOpCircBuf_slave.h"
+#include "aspOutInitSync_slave.h"
#include "audioStreamProc_common.h"
#include "audioStreamDecodeProc.h"
-
#include "statusOp_common.h"
+#include "pfp/pfp.h"
+#include "pfp_app.h" /* contains all PFP ID's */
// FL: debug
-//#include "fwkSim.h"
#include "dbgCapAf.h"
#include "dbgDib.h"
-
+#include "evmc66x_gpio_dbg.h"
//
// Decoder Definitions
#define __TASK_NAME__ "TaskAsdp"
+// Check decoder sync using information in INFO audio frame
+static Int8 checkDecSync(
+ PAF_AudioFrame *pAf
+);
+
extern struct {
Int size;
IALG_Status *pStatus[512];
// ASDT configuration
PAF_ASDT_Config gPAF_ASDT_config
__attribute__ ((section(".globalSectionPafAsdtConfig"))) = {
+ NULL, // taskHandle
NULL, // acp
- {NULL, NULL}, // decOpCircBufCtl
+ {NULL, 0, NULL}, // decOpCircBufCtl
+ {NULL, NULL}, // outIsCtl
&gPAF_AST_config // ASIT/ASOT/ASDT shared configuration
};
UInt32 gCbWrtAfErrCnt =0; // decoder output circular buffer write error count, not including overflows
UInt32 gDecOpCbWrtAfOvr =0; // decoder output circular buffer overflow count
UInt32 gMaxDecOpCbWrtAfOvr =0; // max (consecutive) decoder output circular buffer overflow count
+UInt32 gSlaveCbResetCnt =0; // slave circular buffer reset count
// Global debug counters */
UInt32 gSlaveStartErrCnt =0;
UInt32 gSlaveDecDeactivateCnt =0;
-// FL: (***) debug
-#include "evmc66x_gpio_dbg.h"
+//#define CAPTURE_DECODER_OUTSAMPLES_PP
+#ifdef CAPTURE_DECODER_OUTSAMPLES_PP
+
+#define CAP_FRAME_MAX 2000
+Uint32 tempCap_frameCnt = 0;
+int tempCap_decSampleOut[CAP_FRAME_MAX] = {0};
+#endif
/*
const PAF_ASDT_Patchs *pQ
)
{
- PAF_ASDT_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 */
+ PAF_ASDT_Config *pAsdtCfg; // ASDT 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
Int zMD, zMS;
Bool done;
Bool decDone;
ASP_Slave_Cmd slaveCmd;
Int sourceSelect;
DEC_Handle dec;
- IALG_Cmd decCtrlCmd; // decoder control command
- Int decCtrlRet; // decoder control return
- Int errno; /* error number */
+ IALG_Cmd decCtrlCmd; // decoder control command
+ Int decCtrlRet; // decoder control return
+ Int errno; // error number
Int size;
Int argIdx;
// Decoder output circular buffer
- PAF_AST_DecOpCircBufCtl *pCbCtl; /* Decoder output circular buffer control */
- //PAF_AST_DecOpCircBuf *pCb;
- PAF_AudioFrame *pAfWrt;
- Int cbErrno;
+ PAF_AST_DecOpCircBufCtl *pCbCtl; // Decoder output Circular Buffer control
+ PAF_AudioFrame *pAfWrt; // pointer to audio frame written to CB
+ Int cbErrno; // CB error number
+ // Output Init-Sync
+ PAF_AudioFrame *pDecCtrlAf; // pointer to Dec Control audio frame
+ PAF_AST_OutInitSyncCtl *pOutIsCtl; // OutIS control
+ Int8 outIsDecInfo1Flag; // indicates whether Dec Info Init-Sync has executed
+ Int8 outIsDecDecode1Flag; // indicates whether Dec Decode1 Init-Sync has executed
+ Int outIsErrno; // OutIS error number
// Messaging
- PAF_InpBufConfig *pIpBufConfig;
- ASP_Msg *pAspMsg;
- MessageQ_QueueId queId;
+ PAF_InpBufConfig *pIpBufConfig; // IB buffer configuration
+ ASP_Msg *pAspMsg; // Rx/Tx MessageQ message
+ MessageQ_QueueId queId; // MessageQ ID
Int status;
Int zI;
Int bufEnd, wrapSize, currentBufSize, chunkSize;
Int8 temp8;
-
Log_info0("Enter taskAsdpFxn()");
+
//
// Audio Framework Parameters & Patch (*pP, *pQ):
//
}
//
- // Audio Framework Configuration (*pC):
+ // Audio Stream Decode Task Configuration (*pAsdtCfg):
//
- pC = &gPAF_ASDT_config;
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
- pCbCtl = &pC->decOpCircBufCtl; // get pointer to circular buffer control
-
+ pAsdtCfg = &gPAF_ASDT_config; // initialize pointer to task configuration
+ pAsdtCfg->taskHandle = Task_self(); // set task handle
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
+ pCbCtl = &pAsdtCfg->decOpCircBufCtl; // get pointer to circular buffer control
+ pOutIsCtl = &pAsdtCfg->outIsCtl; // get pointer to output init-sync control
+
// wait for initialization message from master
do {
status = MessageQ_get(hAspMsgSlave->slaveQue, (MessageQ_Msg *)&pAspMsg, MessageQ_FOREVER);
// invalidate AST shared configuration
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
Int linno;
if (pP->fxns->initPhase[i])
{
- if ((linno = pP->fxns->initPhase[i](pP, pQ, pC)))
+ if ((linno = pP->fxns->initPhase[i](pP, pQ, pAsdtCfg)))
{
LINNO_RPRT(TaskAsdp, linno);
return;
TRACE_TERSE2("TaskAsdp: AS%d: initialization phase - %d completed", as+zMS, i);
LINNO_RPRT(TaskAsdp, -i-3);
}
-
- //
- // End of Initialization -- final memory usage report.
- //
- if (pP->fxns->memStatusPrint)
- {
- pP->fxns->memStatusPrint(HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL, HEAP_INTERNAL1_SHM);
- }
-
+
#ifdef NON_CACHE_STATUS
//
// init Status structure Gate
}
#endif
+ //
+ // End of Initialization -- final memory usage report.
+ //
+ if (pP->fxns->memStatusPrint)
+ {
+ pP->fxns->memStatusPrint("ASDT MEMSTAT REPORT",
+ HEAP_INTERNAL, HEAP_INTERNAL1, HEAP_EXTERNAL,
+ HEAP_INTERNAL1_SHM, HEAP_EXTERNAL_SHM, HEAP_EXTERNAL_NONCACHED_SHM);
+ }
+
// (***) FL: revisit
// write back Status structure addresses for Beta Units initialized on Slave
Cache_wb((Ptr)(&IACP_STD_BETA_TABLE.pStatus[STD_BETA_DECODE]), sizeof(IALG_Status *), Cache_Type_ALLD, 0);
}
alg[zMD] = pAstCfg->xDec[zMD].decAlg[sourceSelect];
- // FL: debug, reset IB capture buffer
+ // Reset IB capture buffer (debug)
//capIbReset();
//Log_info0("capIbReset()");
- // FL: debug, reset audio frame capture buffer
+ // Reset audio frame capture buffer (debug)
//capAfReset();
decDone = FALSE;
case ASP_SLAVE_DEC_CONTROL:
gSlaveDecControlCnt++;
- // simulate dec control load
- //simLoad(DEC_CONTROL_LOAD);
argIdx = 0; // get decIdx
z = *(Int32 *)&pAspMsg->buf[argIdx];
case ASP_SLAVE_DEC_ACTIVATE:
gSlaveDecActivateCnt++;
- // simulate dec activate load
- //simLoad(DEC_ACTIVATE_LOAD);
// (***) FL: revisit
// invalidate Status structures for shared Beta Units
}
// Start writes to circular buffer
- //pCb = &pAstCfg->xDecOpCb[z];
cbErrno = cbWriteStart(pCbCtl, z);
if (cbErrno < 0)
{
gCbWrtAfErrCnt=0; // reset write circular buffer error count
gDecOpCbWrtAfOvr=0; // reset decoder output circular buffer overflow count
gMaxDecOpCbWrtAfOvr=0; // reset max decoder output circular buffer overflow count
- // FL: debug, log circular buffer control variables
+ gSlaveCbResetCnt=0; // reset slave circular buffer reset count
+ // Log circular buffer control variables (debug)
cbLog(pCbCtl, z, 1, "cbWriteStart");
+
// Reset audio frame
resetAf(pP, z, sourceSelect);
+ // Initialize OutIS Dec flags
+ outIsDecInfo1Flag = 0; // OutIS Dec Info1 hasn't executed
+ outIsDecDecode1Flag = 0; // OutIS Dec Decode1 hasn't executed
+
// send dec activate complete message to master
queId = MessageQ_getReplyQueue(pAspMsg);
pAspMsg->procId = hAspMsgSlave->slaveProcId;
case ASP_SLAVE_DEC_RESET:
gSlaveDecResetCnt++;
- // simulate dec reset load
- //simLoad(DEC_RESET_LOAD);
argIdx = 0; // get decIdx
z = *(Int32 *)&pAspMsg->buf[argIdx];
errno = 0;
if (dec->fxns->reset)
{
+ //
+ // Execute decode reset
+ //
errno = dec->fxns->reset(dec, NULL, &pAstCfg->xDec[z].decodeControl, &pAstCfg->xDec[z].decodeStatus);
+
+ // Get pointer to Dec Reset output audio frame
+ pDecCtrlAf = pAstCfg->xDec[z].decodeControl.pAudioFrame;
+
+ // Perform Dec Reset Init-Sync
+ // - Write Dec Reset output audio frame
+ // - Set Dec Reset decoder stage flag
+ outIsErrno = outIsWriteDecStageFlagAndAf(pOutIsCtl, z,
+ ASP_OUTIS_DEC_STAGE_RESET_IDX, 1, pDecCtrlAf);
+ if (outIsErrno < 0)
+ {
+ SW_BREAKPOINT; // debug
+ }
}
// write back Dec configuration
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();*/
-
+
// send dec reset complete message to master
queId = MessageQ_getReplyQueue(pAspMsg);
pAspMsg->procId = hAspMsgSlave->slaveProcId;
case ASP_SLAVE_DEC_INFO:
gSlaveDecInfoCnt++;
- // simulate dec info load
- //simLoad(DEC_INFO_LOAD);
argIdx = 0; // get decIdx
z = *(Int32 *)&pAspMsg->buf[argIdx];
errno = 0;
if (dec->fxns->info)
{
- errno = dec->fxns->info(dec, NULL, &pAstCfg->xDec[z].decodeControl, &pAstCfg->xDec[z].decodeStatus);
+ //
+ // Execute decode info
+ //
+ pfpBegin(PFP_ID_ASDT_1, pAsdtCfg->taskHandle);
+ errno = dec->fxns->info(dec, NULL,
+ &pAstCfg->xDec[z].decodeControl,
+ &pAstCfg->xDec[z].decodeStatus);
+ pfpEnd(PFP_ID_ASDT_1, PFP_FINISH_MEAS);
+
+ //
+ // Execute Dec Info1 Init-Sync if required
+ //
+ if (outIsDecInfo1Flag == 0)
+ {
+ // Get pointer to Dec Info1 output audio frame
+ pDecCtrlAf = pAstCfg->xDec[z].decodeControl.pAudioFrame;
+
+ if (checkDecSync(pDecCtrlAf) == 1)
+ {
+ // Perform Dec Info1 Init-Sync
+ // - Write Dec Info1 output audio frame
+ // - Set Dec Info1 decoder stage flag
+ outIsErrno = outIsWriteDecStageFlagAndAf(pOutIsCtl, z,
+ ASP_OUTIS_DEC_STAGE_INFO1_IDX, 1, pDecCtrlAf);
+ if (outIsErrno < 0)
+ {
+ SW_BREAKPOINT; // debug
+ }
+
+ outIsDecInfo1Flag = 1; // OutIS Dec Info1 has executed
+ }
+ }
}
// write back Dec configuration
// doesn't have a valid input
if (!temp8 || !pAstCfg->xInp[zI].hRxSio)
{
- pP->fxns->initFrame1(pP, pQ, pC, z, 0);
+ pP->fxns->initFrame1(pP, pQ, pAsdtCfg, z, 0);
}
#else
// Re-initialize audio frame if decoder is disabled or
// doesn't have a valid input
if (!pAstCfg->xDec[z].decodeStatus.mode || !pAstCfg->xInp[zI].hRxSio)
{
- pP->fxns->initFrame1(pP, pQ, pC, z, 0);
+ pP->fxns->initFrame1(pP, pQ, pAsdtCfg, z, 0);
}
#endif
case ASP_SLAVE_DEC_DECODE:
gSlaveDecDecodeCnt++;
- // simulate dec info load
- //simLoad(DEC_DECODE_LOAD);
argIdx = 0; // get decIdx
z = *(Int32 *)&pAspMsg->buf[argIdx];
// Reset AF samsiz
resetAfSamsiz(z);
- // invalidate Dec configuration
+ // Invalidate Dec configuration
Cache_inv(&pAstCfg->xDec[z], sizeof(PAF_AST_Decode), Cache_Type_ALLD, 0);
Cache_wait();
//TRACE_TERSE0("Dec:cache wb done");
cbErrno = 0;
if (dec->fxns->decode)
{
- // FL: debug, capture input buffer
+ // Capture input buffer (debug)
//capIb(pAstCfg->xInp[z].pInpBuf);
-
+
+ //
+ // Execute decode
+ //
+ pfpBegin(PFP_ID_ASDT_2, pAsdtCfg->taskHandle);
errno = dec->fxns->decode(dec, NULL, &pAstCfg->xDec[z].decodeInStruct, &pAstCfg->xDec[z].decodeOutStruct);
+ pfpEnd(PFP_ID_ASDT_2, PFP_FINISH_MEAS);
if (errno < 0)
{
//SW_BREAKPOINT;
}
TRACE_TERSE0("Dec:decode done");
+
+ // Get pointer to Dec Decode output audio frame
+ pAfWrt = pAstCfg->xDec[z].decodeOutStruct.pAudioFrame;
+ TRACE_TERSE2("Dec:pAfWrt=0x%04x, nSamples=%d", (IArg)pAfWrt, pAfWrt->data.nSamples);
- // copy decoder output to decoder output circular buffers
- //pCb = &pAstCfg->xDecOpCb[z];
- //TRACE_TERSE1("Dec:pCb=0x%04x", (IArg)pCb);
-
- pAfWrt = pAstCfg->xDec[z].decodeOutStruct.pAudioFrame;
- TRACE_TERSE1("Dec:pAfWrt=0x%04x", (IArg)pAfWrt);
- //TRACE_TERSE1("nSamples=%d",pAfWrt->data.nSamples);
-
- // FL: debug, capture audio frame
- //if (capAfWrite(pAfWrt, PAF_CNTR) != CAP_AF_SOK)
+ // Capture audio frame (debug)
+ //if (capAfWrite(pAfWrt, PAF_LEFT) != CAP_AF_SOK)
//{
// Log_info0("capAfWrite() error");
- //}
+ //}
+
+ #ifdef CAPTURE_DECODER_OUTSAMPLES_PP
+ if (tempCap_frameCnt < CAP_FRAME_MAX)
+ {
+ tempCap_decSampleOut[tempCap_frameCnt] = pAfWrt->sampleCount;
+ tempCap_frameCnt++;
+ }
+ #endif
+
+ //
+ // Execute Dec Decode1 Init-Sync if required
+ //
+ if (outIsDecDecode1Flag == 0)
+ {
+ //
+ // FL: cbInitSourceSel() moved from DSP:ASIT:INIT:decodeInit()
+ // frameLength: changed to decodeControl.frameLength.
+ // Written by ASIT:decodeInit:getFrameLengthSourceSel().
+
+ // Initialize decoder output circular buffer
+ errno = cbInitDecWrite(pCbCtl, z, sourceSelect,
+ pAstCfg->xDec[z].decodeControl.frameLength,
+ 0, pAfWrt);
+ if (errno)
+ {
+ SW_BREAKPOINT; // debug
+ }
+ // debug
+ cbLog(pCbCtl, z, 1, "cbInitSourceSel");
+
+ // Perform Dec Decode1 Init-Sync
+ // - Set Dec Decode1 decoder stage flag
+ outIsErrno = outIsWriteDecStageFlag(pOutIsCtl, z,
+ ASP_OUTIS_DEC_STAGE_DECODE1_IDX, 1);
+ if (outIsErrno < 0)
+ {
+ SW_BREAKPOINT; // debug
+ }
- GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
+ outIsDecDecode1Flag = 1; // OutIS Dec Decode1 has executed
+ }
+
+ //
+ // Write decoder output audio frame to circular buffer
+ //
+
+ // debug
+ //pCb = &pAstCfg->xDecOpCb[z];
+ //TRACE_TERSE1("Dec:pCb=0x%04x", (IArg)pCb);
+
+ //GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_99); // debug
cbErrno = cbWriteAf(pCbCtl, z, pAfWrt);
- if ((cbErrno < 0) && (cbErrno != ASP_DECOP_CB_WRITE_OVERFLOW))
+ //GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_99); // debug
+ if ((cbErrno < 0) &&
+ (cbErrno != ASP_DECOP_CB_AF_WRITE_OVERFLOW) &&
+ (cbErrno != ASP_DECOP_CB_PCM_WRITE_OVERFLOW))
{
gCbWrtAfErrCnt++;
- //SW_BREAKPOINT; // FL: debug
+ //SW_BREAKPOINT; // debug
}
- // Handle overflows
- if (cbErrno == ASP_DECOP_CB_WRITE_OVERFLOW)
+ // Handle circular buffer overflows
+ if ((cbErrno == ASP_DECOP_CB_AF_WRITE_OVERFLOW) ||
+ (cbErrno == ASP_DECOP_CB_PCM_WRITE_OVERFLOW))
{
gDecOpCbWrtAfOvr++; // increment circular buffer overflow count
if (gDecOpCbWrtAfOvr >= DEC_OP_CB_WRTAF_OVR_THR)
// Reset circular buffer
cbReset(pCbCtl, z);
+ gSlaveCbResetCnt++; // increment slave circular buffer reset count
+ Log_info0("ASDT:cbReset");
}
}
else if ((cbErrno == ASP_DECOP_CB_SOK) && (gDecOpCbWrtAfOvr > 0))
cbErrno = 0; // don't return error condition
}
- GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
+ //GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107); // debug
TRACE_TERSE0("Dec:cbWriteAf() complete");
#if 0 // (***) FL: shows timing of CB write
}
#endif
- // FL: debug, log circular buffer control variables
+ // Log circular buffer control variables (debug)
cbLog(pCbCtl, z, 1, "cbWriteAf");
}
// doesn't have a valid input
if (!temp8 || !pAstCfg->xInp[zI].hRxSio)
{
- pP->fxns->initFrame1(pP, pQ, pC, z, 0);
+ pP->fxns->initFrame1(pP, pQ, pAsdtCfg, z, 0);
}
#else
// Re-initialize audio frame if decoder is disabled or
// doesn't have a valid input
if (!pAstCfg->xDec[z].decodeStatus.mode || !pAstCfg->xInp[zI].hRxSio)
{
- pP->fxns->initFrame1(pP, pQ, pC, z, 0);
+ pP->fxns->initFrame1(pP, pQ, pAsdtCfg, z, 0);
}
#endif
// send dec info complete message to master
case ASP_SLAVE_DEC_DEACTIVATE:
gSlaveDecDeactivateCnt++;
- // simulate dec info load
- //simLoad(DEC_DEACTIVATE_LOAD);
argIdx = 0; // get decIdx
z = *(Int32 *)&pAspMsg->buf[argIdx];
}
// Stop writes to circular buffer
- //pCb = &pAstCfg->xDecOpCb[z];
cbErrno = cbWriteStop(pCbCtl, z);
if (cbErrno < 0)
{
- SW_BREAKPOINT;
+ SW_BREAKPOINT; // debug
}
- // FL: debug, log circular buffer control variables
+ // Log circular buffer control variables (debug)
cbLog(pCbCtl, z, 1, "cbWriteStop");
+ // Reset Output Init-Sync decoder stage flags
+ outIsErrno = outIsResetDecStageFlags(pOutIsCtl, z);
+ if (outIsErrno < 0)
+ {
+ SW_BREAKPOINT; // debug
+ }
+
// send dec deactivate complete message to master
queId = MessageQ_getReplyQueue(pAspMsg);
pAspMsg->procId = hAspMsgSlave->slaveProcId;
PAF_ASDT_initPhaseMalloc(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC
+ PAF_ASDT_Config *pAsdtCfg
)
{
PAF_AST_Config *pAstCfg;
Int zMS;
Error_Block eb;
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
as = pAstCfg->as;
zMS = pAstCfg->masterStr;
// Initialize error block
Error_init(&eb);
-// if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_INTERNAL1,
- if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_EXTERNAL, //Qin - moved to external memory
+ if (!(gpDecAudioFrame = (PAF_AudioFrame *)Memory_calloc((IHeap_Handle)HEAP_EXTERNAL,
DECODEN * sizeof (PAF_AudioFrame), 4, &eb)))
{
TRACE_TERSE1("PAF_ASDT_initPhaseMalloc: AS%d: Memory_calloc failed", as+zMS);
PAF_ASDT_initPhaseConfig(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC
+ PAF_ASDT_Config *pAsdtCfg
)
{
PAF_AST_Config *pAstCfg;
Int zMS;
Int z;
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
as = pAstCfg->as;
zMS = pAstCfg->masterStr;
pAstCfg->xDec[z].decodeControl.pAudioFrame = &gpDecAudioFrame[z];
pAstCfg->xDec[z].decodeInStruct.pAudioFrame = &gpDecAudioFrame[z];
pAstCfg->xDec[z].decodeStatus = *pP->z_pDecodeStatus[z];
- pP->fxns->initFrame0(pP, pQ, pC, z);
+ pP->fxns->initFrame0(pP, pQ, pAsdtCfg, z);
}
return 0;
PAF_ASDT_initPhaseAcpAlg(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC
+ PAF_ASDT_Config *pAsdtCfg
)
{
PAF_AST_Config *pAstCfg;
Int zMS;
Int zS; //, zX;
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
as = pAstCfg->as;
zMS = pAstCfg->masterStr;
TRACE_TERSE1("PAF_ASDT_initPhaseAcpAlg: AS%d: ACP algorithm instance creation failed", as+zMS);
return __LINE__;
}
- pC->acp = acp;
+ pAsdtCfg->acp = acp;
((ALG_Handle)acp)->fxns->algControl((ALG_Handle)acp,
ACP_GETBETAPRIMEOFFSET, (IALG_Status *)&betaPrimeOffset);
PAF_ASDT_initPhaseCommon(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC
+ PAF_ASDT_Config *pAsdtCfg
)
{
PAF_AST_Config *pAstCfg;
PAF_IALG_Config pafAlgConfig;
IALG_MemRec common[3][PAF_IALG_COMMON_MEMN+1];
- acp = pC->acp; // get acp handle
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ acp = pAsdtCfg->acp; // get acp handle
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
as = pAstCfg->as;
TRACE_TERSE0("PAF_ASDT_initPhaseCommon: initialization phase - Common Memory");
PAF_ASDT_initPhaseAlgKey(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC
+ PAF_ASDT_Config *pAsdtCfg
)
{
PAF_AST_Config *pAstCfg;
(void)as; // clear warning.
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
as = pAstCfg->as;
TRACE_VERBOSE1("PAF_ASDT_initPhaseAlgKey: AS%d: initialization phase - Algorithm Keys", as);
PAF_ASDT_initFrame0(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC,
+ PAF_ASDT_Config *pAsdtCfg,
Int z
)
{
PAF_AudioFrame *pAudioFrame;
Int i;
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ pAstCfg = pAsdtCfg->pAstCfg; // get pointer to AST common (shared) configuration
as = pAstCfg->as;
pAudioFrame = &gpDecAudioFrame[z];
//maxFrameLength += PA_MODULO - maxFrameLength % PA_MODULO; // compute maximum framelength (needed for ARC support)
//aLen = numchan[z] * maxFrameLength;
aLen = numchan[z] * maxFrameLength + (maxFrameLength - FRAMELENGTH); /* Qin - need additional memory for starting offset
- See line 1301 */
+ See line 1301 */
//
// Initialize audio frame elements directly
PAF_ASDT_initFrame1(
const PAF_ASDT_Params *pP,
const PAF_ASDT_Patchs *pQ,
- PAF_ASDT_Config *pC,
+ PAF_ASDT_Config *pAsdtCfg,
Int z,
Int apply
)
}
// Reinitialize audio frame elements
- pAudioFrame->channelConfigurationRequest.legacy = PAF_CC_NONE;
- pAudioFrame->channelConfigurationStream.legacy = PAF_CC_NONE;
+ pAudioFrame->sampleDecode = PAF_SOURCE_UNKNOWN;
pAudioFrame->sampleRate = PAF_SAMPLERATE_UNKNOWN;
pAudioFrame->sampleCount = 0;
- pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
+ pAudioFrame->channelConfigurationRequest.full = PAF_CC_UNKNOWN;
+ pAudioFrame->channelConfigurationStream.full = PAF_CC_UNKNOWN;
+ pAudioFrame->data.nChannels = PAF_MAXNUMCHAN;
switch (sourceSelect)
{
case PAF_SOURCE_PCM:
pAudioFrame->pafBsMetadataUpdate = XDAS_FALSE;
pAudioFrame->numPrivateMetadata = 0;
pAudioFrame->bsMetadata_offset = 0;
- pAudioFrame->bsMetadata_type = PAF_bsMetadata_channelData;
+ pAudioFrame->bsMetadata_type = PAF_bsMetadata_none;
for (i=0; i<pP->pMetadataBufStatus->NumBuf; i++)
{
pAudioFrame->pafPrivateMetadata[i].offset = 0;
return 0;
}
+
+// (***) FL: Check correct behavior for other decs, esp DTSHD & DXP
+// Check decoder sync using information in INFO audio frame
+static Int8 checkDecSync(
+ PAF_AudioFrame *pAf
+)
+{
+ if ((pAf->sampleDecode == PAF_SOURCE_THD) &&
+ (pAf->sampleRate == PAF_SAMPLERATE_UNKNOWN))
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+}