summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11de6df)
raw | patch | inline | side by side (parent: 11de6df)
author | Frank Livingston <frank-livingston@ti.com> | |
Tue, 4 Jul 2017 17:41:11 +0000 (12:41 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Tue, 4 Jul 2017 17:41:11 +0000 (12:41 -0500) |
Add check for Dec sync before sending Dec Info1 sync message. This is
similar to logic in DSP:ASIT:decodeProcessing():INFO1 which checks for
THD/DTSHD/DXP majorAu.
Inspecting Dec Info function for various decoders:
- it appears this should work for MAT-THD/PCM, DDP & PCM.
- this may not work for DTSHD and DXP.
Whether it work correctly depends on Dec Info audio frame sampleDecode and
sampleRate output parameters.
Limited testing demonstrates this works for MAT-THD & DDP.
similar to logic in DSP:ASIT:decodeProcessing():INFO1 which checks for
THD/DTSHD/DXP majorAu.
Inspecting Dec Info function for various decoders:
- it appears this should work for MAT-THD/PCM, DDP & PCM.
- this may not work for DTSHD and DXP.
Whether it work correctly depends on Dec Info audio frame sampleDecode and
sampleRate output parameters.
Limited testing demonstrates this works for MAT-THD & DDP.
pasdk/test_arm/framework/audioStreamDecodeProc.c | patch | blob | history |
diff --git a/pasdk/test_arm/framework/audioStreamDecodeProc.c b/pasdk/test_arm/framework/audioStreamDecodeProc.c
index 636dacfaf4bd049efcfe39c259dece0300e6b0b1..d64d53f8e2fb257fd213c311fe180b5c4f5b94a6 100644 (file)
#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];
int tempCap_decSampleOut[CAP_FRAME_MAX] = {0};
#endif
+// debug
+//PAF_AudioFrame gAfCap[20];
+//gAfCapIdx=0;
+
/*
* ======== taskAsdpFxn ========
* Audio Stream Decode Processing task function
&pAstCfg->xDec[z].decodeStatus);
pfpEnd(PFP_ID_ASDT_1, PFP_FINISH_MEAS);
+ // debug
+ //if (gAfCapIdx < 20)
+ //{
+ // gAfCap[gAfCapIdx] = *pAstCfg->xDec[z].decodeControl.pAudioFrame;
+ // gAfCapIdx++;
+ //}
+
+ // debug
+ //if (outIsDecInfo1Flag < 10)
+ // outIsDecInfo1Flag++;
+ //if (outIsDecInfo1Flag == 10)
+
if (outIsDecInfo1Flag == 0)
{
// get pointer to Dec Info1 output audio frame
pDecCtrlAf = pAstCfg->xDec[z].decodeControl.pAudioFrame;
- // Perform Dec Info 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)
+ if (checkDecSync(pDecCtrlAf) == 1)
{
- SW_BREAKPOINT; // debug
- }
-
- //
- // FL: cbInitSourceSel() moved from DSP:ASIT:INIT:decodeInit()
- // frameLength: changed to decodeControl.frameLength.
- // Written by ASIT:decodeInit:getFrameLengthSourceSel().
- // FRAMELENGTH: pP->frameLength.
- // Formerly ASIT, now ASDT but same value (PAF_SYS_FRAMELENGTH).
- //
- // FL: hard-coded CB init, not using DEC Info1 output AF
-
- // Initialize decoder output circular buffer for selected source
- errno = cbInitSourceSel(pCbCtl, z, sourceSelect,
- pAstCfg->xDec[z].decodeControl.frameLength,
- FRAMELENGTH, 0, pDecCtrlAf);
- if (errno)
- {
- SW_BREAKPOINT; // debug
+ // Perform Dec Info 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
+ }
+
+ //
+ // FL: cbInitSourceSel() moved from DSP:ASIT:INIT:decodeInit()
+ // frameLength: changed to decodeControl.frameLength.
+ // Written by ASIT:decodeInit:getFrameLengthSourceSel().
+ // FRAMELENGTH: pP->frameLength.
+ // Formerly ASIT, now ASDT but same value (PAF_SYS_FRAMELENGTH).
+ //
+
+ // Initialize decoder output circular buffer for selected source
+ errno = cbInitSourceSel(pCbCtl, z, sourceSelect,
+ pAstCfg->xDec[z].decodeControl.frameLength,
+ FRAMELENGTH, 0, pDecCtrlAf);
+ if (errno)
+ {
+ SW_BREAKPOINT; // debug
+ }
+ // debug
+ cbLog(pCbCtl, z, 1, "cbInitSourceSel");
+
+ outIsDecInfo1Flag = 1; // set flag to indicate OutIS Dec Info has executed
}
- // debug
- cbLog(pCbCtl, z, 1, "cbInitSourceSel");
-
- outIsDecInfo1Flag = 1; // set flag to indicate OutIS Dec Info has executed
}
}
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;
+ }
+}