PASDK-218:Add CB statistic for number of read AFs consumed for Nominal Delay
authorFrank Livingston <frank-livingston@ti.com>
Sat, 8 Jul 2017 23:25:37 +0000 (18:25 -0500)
committerFrank Livingston <frank-livingston@ti.com>
Sat, 8 Jul 2017 23:25:37 +0000 (18:25 -0500)
pasdk/common/aspDecOpCircBuf_common.c
pasdk/common/aspDecOpCircBuf_common.h
pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
pasdk/test_dsp/framework/aspDecOpCircBuf_master.c

index 15cf1342e3c3996cf7dd652595c2e28fefed17d5..607b8ae98505f7a07c2eecedf672d974b252d786 100644 (file)
@@ -167,6 +167,7 @@ Int cbReset(
     
     // reset stats
     pCb->readAfWriterInactiveCnt = 0;
+    pCb->readAfNdCnt = 0;
     pCb->wrtAfReaderInactiveCnt = 0;
     pCb->wrtAfZeroSampsCnt = 0;
     pCb->errUndCnt = 0;
@@ -219,6 +220,7 @@ Int cbGetStats(
 
     // Populate statistics
     pCbStats->readAfWriterInactiveCnt = pCb->readAfWriterInactiveCnt;
+    pCbStats->readAfNdCnt = pCb->readAfNdCnt;
     pCbStats->wrtAfReaderInactiveCnt = pCb->wrtAfReaderInactiveCnt;
     pCbStats->wrtAfZeroSampsCnt = pCb->wrtAfZeroSampsCnt;
     pCbStats->errUndCnt = pCb->errUndCnt;
index d8e67e7ab8037df7d8dcc775ebd72e159c1c2b25..4f9c455f308007bb851fef95823478feb776ce60 100644 (file)
@@ -130,6 +130,7 @@ typedef struct PAF_AST_DecOpCircBuf
     Int8 readerActiveFlag;          // flag indicates whether CB reader is active: FALSE - reader not active, TRUE - reader active
     Int8 drainFlag;                 // flag indicates whether reader should drain (empty) remaining frames in CB: FALSE - reader should not drain, TRUE - reader should drain
     Int32 readAfWriterInactiveCnt;  // count of read audio frames with inactive writer & not draining
+    Int32 readAfNdCnt;              // count of read audio frames for nominal delay 
     Int32 wrtAfReaderInactiveCnt;   // count of write audio frames with inactive reader
     Int32 wrtAfZeroSampsCnt;        // count of write audio frames with zero samples
     Int32 errUndCnt;                // read error underflow count
@@ -153,6 +154,7 @@ typedef struct PAF_AST_DecOpCircBuf
 typedef struct PAF_AST_DecOpCircBufStats
 {
     Int32 readAfWriterInactiveCnt;  // count of read audio frames with inactive writer & not draining
+    Int32 readAfNdCnt;              // count of read audio frames for nominal delay
     Int32 wrtAfReaderInactiveCnt;   // count of write audio frames with inactive reader
     Int32 wrtAfZeroSampsCnt;        // count of write audio frames with zero samples
     Int32 errUndCnt;                // read error underflow count
index ef20c918734ce50d34dadac1fd8c9e94242de8b3..d864671b1ddce913d41d917f9a0a8a8d8b38d9fb 100644 (file)
@@ -288,6 +288,7 @@ Int cbInitSourceSel(
     
     // Reset stats
     pCb->readAfWriterInactiveCnt = 0;
+    pCb->readAfNdCnt = 0;
     pCb->wrtAfReaderInactiveCnt = 0;
     pCb->wrtAfZeroSampsCnt = 0;
     pCb->errUndCnt = 0;
index 21264a6512e6b53c447214420dac690043773260..a8fa7ad9b118dbefe8630abd58d463ab66906110 100644 (file)
@@ -209,6 +209,7 @@ Int cbInit(
     
     // reset stats
     pCb->readAfWriterInactiveCnt = 0;
+    pCb->readAfNdCnt = 0;
     pCb->wrtAfReaderInactiveCnt = 0;
     pCb->wrtAfZeroSampsCnt = 0;
     pCb->errUndCnt = 0;
@@ -467,6 +468,7 @@ Int cbInitSourceSel(
     
     // reset stats
     pCb->readAfWriterInactiveCnt = 0;
+    pCb->readAfNdCnt = 0;
     pCb->wrtAfReaderInactiveCnt = 0;
     pCb->wrtAfZeroSampsCnt = 0;
     pCb->errUndCnt = 0;
@@ -648,6 +650,8 @@ Int cbReadAf(
     //if ((pCb->primedFlag == 0) || ((pCb->primedFlag==1) && (pCb->deltaSamps > 0))
     if ((pCb->primedFlag == 0) || (pCb->deltaSamps > 0))
     {
+        pCb->readAfNdCnt++;
+        
         if (pCb->primedFlag == 1)
         {
             pCb->deltaSamps = pCb->deltaSamps - pCb->strFrameLen;