]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/commitdiff
PASDK-443:Update CB read for Nominal Delay
authorFrank Livingston <frank-livingston@ti.com>
Tue, 7 Nov 2017 23:10:40 +0000 (17:10 -0600)
committerFrank Livingston <frank-livingston@ti.com>
Tue, 7 Nov 2017 23:10:40 +0000 (17:10 -0600)
Update Nominal Delay delta samples hold off calculation to not subtract
size of first input frame. THD frame size is variable, and first frame can
be quite large (e.g. 96 AUs). This will cause delta samples to be very
small or negative, resulting in no read hold off (sample build up) for CB
nominal delay.

pasdk/test_arm/framework/aspDecOpCircBuf_slave.c

index 62cf64262af006bc19c9c50fa97d137b9eef1abb..413894df47d99bb7b562876ec9dc87f401573a67 100644 (file)
@@ -828,8 +828,14 @@ Int cbWriteAf(
                 // Calculate number of output frames to block reader.
                 // This is sample count reader waits before allowed to actually read samples from the CB.
                 //pCb->deltaSamps = (pCb->targetNDSamps - pAfWrt->sampleCount + (pCb->strFrameLen-1)) / pCb->strFrameLen * pCb->strFrameLen;
+                
                 // FL: CB read decrements by strFrameLen and tests for >0, so rounding to strFrameLen is unnecessary
-                pCb->deltaSamps = pCb->targetNDSamps - pAfWrt->sampleCount;
+                //pCb->deltaSamps = pCb->targetNDSamps - pAfWrt->sampleCount;
+                
+                // FL: THD has variable number of AUs per frame. 
+                //     Some frames can be quite large (e.g. 96 AUs), and delta samples calculation small or even negative.
+                //     In this case, there won't be any reader hold off, and no nominal delay in the CB.
+                pCb->deltaSamps = pCb->targetNDSamps;
                 
                 // debug
                 //gSampleCountBuf[gPrimedFlagCnt] = pAfWrt->sampleCount;