summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40cc21c)
raw | patch | inline | side by side (parent: 40cc21c)
author | Frank Livingston <frank-livingston@ti.com> | |
Sat, 8 Jul 2017 22:51:59 +0000 (17:51 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Sat, 8 Jul 2017 22:51:59 +0000 (17:51 -0500) |
- No hard-coded values used (not cbInit() still called, but settings aren't applied during streaming
- Add APIs for ARM init of last AF, DSP update of last AF
- Add APIs for ARM init of last AF, DSP update of last AF
diff --git a/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c b/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
index 5427145162c5ed28f06a1bf04669714a1c34b41c..ef20c918734ce50d34dadac1fd8c9e94242de8b3 100644 (file)
#include "evmc66x_gpio_dbg.h" // Debug
+// Init last audio frame configuration info
+static Void cbInitLastAfInfo(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer control
+ PAF_AudioFrame *pAfInit // audio frame used for init
+);
+
+
#if 0 // FL: moved to common
// Initialize circular buffer control
Int cbCtlInit(
Int16 decOpFrameLen, // decoder output frame length (PCM samples)
Int16 strFrameLen, // stream frame length (PCM samples)
Int8 resetRwFlags, // whether to reset reader, writer, and drain flags
- PAF_AudioFrame *pDecInfo1Af // pointer to Dec Info1 audio frame
+ PAF_AudioFrame *pDecInitAf // pointer to Dec output audio frame used for CB initialization
)
{
IArg key;
//pCb->afInitialLag = ASP_DECOP_CB_INIT_LAG_THD;
// FL: (***) set nominal delay per sampling rate -- need to review these settings
- switch (pDecInfo1Af->sampleRate)
+ switch (pDecInitAf->sampleRate)
{
case PAF_SAMPLERATE_44100HZ:
case PAF_SAMPLERATE_48000HZ:
{
pAfCb = &pCb->afCb[n]; // get pointer to CB AF
- // Dec Info1 AF sample count not correct for CB AFs
+ // Dec init AF sample count not correct for CB AFs.
+ // Dec Op frame length is computed in framework based on selected source.
pAfCb->sampleCount = decOpFrameLen;
- // initialize CB AF using Dec Info1 AF
- pAfCb->sampleDecode = pDecInfo1Af->sampleDecode;
- PAF_PROCESS_COPY(pAfCb->sampleProcess, pDecInfo1Af->sampleProcess);
- pAfCb->sampleRate = pDecInfo1Af->sampleRate;
- pAfCb->channelConfigurationRequest.full = pDecInfo1Af->channelConfigurationRequest.full;
- pAfCb->channelConfigurationStream.full = pDecInfo1Af->channelConfigurationStream.full;
+ // initialize CB AF using Dec init AF
+ pAfCb->sampleDecode = pDecInitAf->sampleDecode;
+ PAF_PROCESS_COPY(pAfCb->sampleProcess, pDecInitAf->sampleProcess);
+ pAfCb->sampleRate = pDecInitAf->sampleRate;
+ pAfCb->channelConfigurationRequest.full = pDecInitAf->channelConfigurationRequest.full;
+ pAfCb->channelConfigurationStream.full = pDecInitAf->channelConfigurationStream.full;
// initialize metadata information updated by decoder
pAfCb->bsMetadata_type = PAF_bsMetadata_none; /* non zero if metadata is attached. */
}
}
+ // Initialize last audio frame configuration info
+ cbInitLastAfInfo(pCb, pDecInitAf);
+
// Reset read/write flags
if (resetRwFlags != 0)
{
return ASP_DECOP_CB_SOK;
}
#endif
+
+// Init last audio frame configuration info
+static Void cbInitLastAfInfo(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer control
+ PAF_AudioFrame *pAfInit // audio frame used for init
+)
+{
+ memset(&pCb->lastAf, 0, sizeof(PAF_AudioFrame));
+
+ pCb->lastAf.sampleDecode = pAfInit->sampleDecode;
+ pCb->lastAf.sampleRate = pAfInit->sampleRate;
+ pCb->lastAf.channelConfigurationRequest.full = pAfInit->channelConfigurationRequest.full;
+ pCb->lastAf.channelConfigurationStream.full = pAfInit->channelConfigurationStream.full;
+}
diff --git a/pasdk/test_arm/framework/aspDecOpCircBuf_slave.h b/pasdk/test_arm/framework/aspDecOpCircBuf_slave.h
index 406af4450a78bf6a9681c07f089ff60f5051660f..c632bb96a13444eca0f95040041ac3494d4723bf 100644 (file)
Int16 decOpFrameLen, // decoder output frame length (PCM samples)
Int16 strFrameLen, // stream frame length (PCM samples)
Int8 resetRwFlags, // whether to reset reader, writer, and drain flags
- PAF_AudioFrame *pDecInfo1Af // pointer to Dec Info1 audio frame
+ PAF_AudioFrame *pDecInitAf // pointer to Dec output audio frame used for CB initialization
);
// Start writes to circular buffer
diff --git a/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c b/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
index b4b6db1083a078aae78fe2b321bb8aead782518e..21264a6512e6b53c447214420dac690043773260 100644 (file)
PAF_AudioFrame *pAfRd // last audio frame stored in CB instance
);
+// Update last audio frame configuration info
+static Void cbUpdateLastAfInfo(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer control
+ PAF_AudioFrame *pAfUpd // audio frame used for update
+);
+
// Generate mute AF on circular buffer read using the last AF configuration info
static Void cbReadMuteWithLastAfInfo (
PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer control
//SW_BREAKPOINT; // FL: debug
// debug
- //{
- // static Uint8 toggleState = 0;
- // if (toggleState == 0)
- // GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
- // else
- // GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
- // toggleState = ~(toggleState);
- //}
+ {
+ static Uint8 toggleState = 0;
+ if (toggleState == 0)
+ GPIOSetOutput(GPIO_PORT_0, GPIO_PIN_107);
+ else
+ GPIOClearOutput(GPIO_PORT_0, GPIO_PIN_107);
+ toggleState = ~(toggleState);
+ }
#ifdef CB_RW_OP_CAP_PP // debug
if (pCb->cb_opCnt < CB_OP_COUNT_MAX)
}
#endif
- // update Last Cb info as per actual stream
- pCb->lastAf.sampleCount = pCb->strFrameLen;
- pCb->lastAf.sampleRate = pAfCb->sampleRate;
+ //// update Last Cb info as per actual stream
+ //pCb->lastAf.sampleCount = pCb->strFrameLen; // FL: last AF sample count isn't used (see cbReadMuteWithLastAfInfo())
+ //pCb->lastAf.sampleRate = pAfCb->sampleRate; // FL: moved inside cbUpdateLastAfInfo() along with other params from memcpy below
+ // Update last audio frame configuration info
+ cbUpdateLastAfInfo(pCb, pAfRd);
// read PCM samples
for (i = 0; i < pCb->maxAFChanNum; i++)
// update number of audio frames in circular buffer
pCb->numAfCb--;
}
- memcpy (&pCb->lastAf, pAfRd, sizeof(PAF_AudioFrame));
+
+ // FL: this update of Last AF is handled above
+ //memcpy (&pCb->lastAf, pAfRd, sizeof(PAF_AudioFrame));
{
static Uint8 toggleState = 0;
pAfRd->bsMetadata_offset = 0; /* offset into audio frame for change in bsMetadata_type field */
}
+// Update last audio frame configuration info
+static Void cbUpdateLastAfInfo(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer control
+ PAF_AudioFrame *pAfUpd // audio frame used for update
+)
+{
+ // FL: full copy shouldn't be necessary
+ // Note currently (data.nChannels, data.nSamples)=(32,256) is fixed in ASOT stream AF.
+ // There parameters aren't copied from CB on CB read.
+ //memcpy (&pCb->lastAf, pAfUpd, sizeof(PAF_AudioFrame));
+
+ // These are parameters used in cbReadMuteWithLastAfInfo()
+ pCb->lastAf.sampleDecode = pAfUpd->sampleDecode;
+ pCb->lastAf.sampleRate = pAfUpd->sampleRate;
+ pCb->lastAf.channelConfigurationRequest.full = pAfUpd->channelConfigurationRequest.full;
+ pCb->lastAf.channelConfigurationStream.full = pAfUpd->channelConfigurationStream.full;
+}
+
// Generate mute AF on circular buffer read using the last AF configuration info
static Void cbReadMuteWithLastAfInfo (
PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer control
pAfRd->sampleRate = pCb->lastAf.sampleRate;
pAfRd->sampleCount = pCb->strFrameLen;
pAfRd->channelConfigurationRequest.full = pCb->lastAf.channelConfigurationRequest.full;
- pAfRd->channelConfigurationRequest.part.sat = pCb->lastAf.channelConfigurationRequest.part.sat;
- pAfRd->channelConfigurationRequest.part.sub = pCb->lastAf.channelConfigurationRequest.part.sub;
+ //pAfRd->channelConfigurationRequest.part.sat = pCb->lastAf.channelConfigurationRequest.part.sat; // FL: not necessary since full in union already copied
+ //pAfRd->channelConfigurationRequest.part.sub = pCb->lastAf.channelConfigurationRequest.part.sub;
pAfRd->channelConfigurationStream.full = pCb->lastAf.channelConfigurationStream.full;
- pAfRd->channelConfigurationStream.part.sat = pCb->lastAf.channelConfigurationStream.part.sat;
- pAfRd->channelConfigurationStream.part.sub = pCb->lastAf.channelConfigurationStream.part.sub;
+ //pAfRd->channelConfigurationStream.part.sat = pCb->lastAf.channelConfigurationStream.part.sat;
+ //pAfRd->channelConfigurationStream.part.sub = pCb->lastAf.channelConfigurationStream.part.sub;
// compute stream mask
streamMask = pAfRd->fxns->channelMask(pAfRd, pAfRd->channelConfigurationStream);