summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 63dff33)
raw | patch | inline | side by side (parent: 63dff33)
author | Frank Livingston <frank-livingston@ti.com> | |
Sun, 2 Jul 2017 18:08:48 +0000 (13:08 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Sun, 2 Jul 2017 18:08:48 +0000 (13:08 -0500) |
Need to review decoder (and other) frame lengths used in system.
pasdk/test_dsp/framework/audioStreamInpProc.c | patch | blob | history |
diff --git a/pasdk/test_dsp/framework/audioStreamInpProc.c b/pasdk/test_dsp/framework/audioStreamInpProc.c
index fc677b05eb842126caea8d9b98ba01af22975782..ca53098ca095be30ee5dd00eeacfb4cb41c88d67 100644 (file)
#define __TASK_NAME__ "TaskAsip"
+
+//
+// Audio Stream Output Task definitions
+//
+
+#define ASIP_FRAMELEN_SS_DEFAULT ( 256 )
+// FL: pP->frameLength
+//#define ASIP_FRAMELEN_SS_PCM ( FRAMELENGTH )
+// FL: (***) hard-coded
+#define ASIP_FRAMELEN_SS_DDP_AC3 ( 1536 )
+// FL: (***) hard-coded
+#define ASIP_FRAMELEN_SS_THD ( 1536 ) //QIN FIX ME
+
+// Compute decoder frame length based on selected source
+static Int getFrameLengthSourceSel(
+ const PAF_ASIT_Params *pP,
+ Int8 sourceSelect
+);
+
LINNO_DEFN(TaskAsip); /* Line number macros */
ERRNO_DEFN(TaskAsip); /* Error number macros */
pfpBegin(PFP_ID_ASIT_1, pAsitCfg->taskHandle); // PFP begin
gNumPfpAsit1++;
+ // (***) FL: re-visit, hard-coded to use FRAMELENGTH (pP->frameLength) inside function
errno = pP->fxns->autoProcessing(pP, pQ, pAsitCfg, tempVar8, NULL);
pfpEnd(PFP_ID_ASIT_1, PFP_FINISH_MEAS); // PFP end
gNumPfpAsit1--;
- if (errno) // (***) FL: re-visit this, hard-coded to use PCM framelength inside function
+ if (errno)
{
TRACE_VERBOSE1("TaskAsip: autoProcessing returns 0x%x, continue", errno);
continue;
// At this point we have an enabled input and want to decode something.
// If no decoder selected then do nothing. Need to reset the sourceProgram, since
// when no decoder is selected there are no calls to IB
+
//if (errno = pP->fxns->autoProcessing(pP, pQ, PC, pC->xDec[zMD].decodeStatus.sourceSelect, pC->xDec[zMD].decAlg[PAF_SOURCE_PCM]))
- if (errno = pP->fxns->autoProcessing(pP, pQ, pAsitCfg, pAstCfg->xDec[zMD].decodeStatus.sourceSelect, NULL)) // (***) FL: re-visit this, hard-coded to use PCM framelength inside function
+ // (***) FL: re-visit this, hard-coded to use FRAMELENGTH (pP->frameLength) inside function
+ if (errno = pP->fxns->autoProcessing(pP, pQ, pAsitCfg, pAstCfg->xDec[zMD].decodeStatus.sourceSelect, NULL))
{
TRACE_VERBOSE1("TaskAsip: autoProcessing returns 0x%x, continue", errno);
continue;
}
//frameLength = pP->fxns->computeFrameLength (pcmAlgMaster, FRAMELENGTH,
// pC->xDec[zMD].decodeStatus.bufferRatio);
- frameLength = FRAMELENGTH; // FL: fix PCM frameLength for alpha release.
-
+ frameLength = FRAMELENGTH; // (***) FL: fix PCM frameLength
+
if (errno = SIO_ctrl(pAstCfg->xInp[zMI].hRxSio,
PAF_SIO_CONTROL_SET_PCMFRAMELENGTH, frameLength))
{
FRAMELENGTH,
pC->xDec[z].decodeStatus.bufferRatio);
#endif
-#if 0 // (***) FL: revisit. Bypass computeFrameLength().
+#if 0 // (***) FL: revisit. Bypass decoder computeFrameLength() function.
frameLength = pP->fxns->computeFrameLength(z,
FRAMELENGTH,
pC->xDec[z].decodeStatus.bufferRatio);
#else
- if (sourceSelect == PAF_SOURCE_PCM)
- {
- frameLength = PAF_SYS_FRAMELENGTH;
- }
- else if ((sourceSelect == PAF_SOURCE_DDP) || (sourceSelect == PAF_SOURCE_AC3))
- {
- frameLength = 1536;
- }
- else if (sourceSelect == PAF_SOURCE_THD)
- {
- frameLength = 1536; //QIN FIX ME
- }
- else
- {
- frameLength = 256;
- }
+ // Compute decoder frame length based on source selection
+ frameLength = getFrameLengthSourceSel(pP, sourceSelect);
#endif
pAstCfg->xDec[z].decodeControl.frameLength = frameLength;
FRAMELENGTH,
pC->xDec[z].decodeStatus.bufferRatio);
#endif
-#if 0 // (***) FL: revisit. Bypass computeFrameLength().
+#if 0 // (***) FL: revisit. Bypass decoder computeFrameLength() function.
frameLength = pP->fxns->computeFrameLength(z,
FRAMELENGTH,
pC->xDec[z].decodeStatus.bufferRatio);
#else
- if (sourceSelect == PAF_SOURCE_PCM)
- {
- frameLength = PAF_SYS_FRAMELENGTH;
- }
- else if ((sourceSelect == PAF_SOURCE_DDP) || (sourceSelect == PAF_SOURCE_AC3))
- {
- frameLength = 1536;
- }
- else if (sourceSelect == PAF_SOURCE_THD)
- {
- frameLength = 1536; //QIN FIX ME
- }
- else
- {
- frameLength = 256;
- }
+ // Compute decoder frame length based on source selection
+ frameLength = getFrameLengthSourceSel(pP, sourceSelect);
#endif
// // modify for different decoders
// if (sourceSelect == PAF_SOURCE_THD)
// {
-// start_profiling = 1;
+// start_profiling = 1;
// }
// else
// {
}
}
#endif
+
+// Compute decoder frame length based on selected source
+static Int getFrameLengthSourceSel(
+ const PAF_ASIT_Params *pP,
+ Int8 sourceSelect
+)
+{
+ Int frameLength;
+
+ switch(sourceSelect)
+ {
+ case PAF_SOURCE_PCM:
+ frameLength = FRAMELENGTH;
+ break;
+ case PAF_SOURCE_AC3:
+ case PAF_SOURCE_DDP:
+ frameLength = ASIP_FRAMELEN_SS_DDP_AC3;
+ break;
+ case PAF_SOURCE_THD:
+ frameLength = ASIP_FRAMELEN_SS_THD;
+ break;
+ default:
+ frameLength = ASIP_FRAMELEN_SS_DEFAULT;
+ break;
+ }
+
+ return frameLength;
+}