]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blobdiff - processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c
Add GateMP for Decoder Output Circular Buffer
[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / audioStreamInpProc.c
index 6fe77021fc1ad1480c67e75bc94a079f34004ba2..5209f7048bce82af4c6159d546eb3c8c0f6b2873 100644 (file)
@@ -1333,19 +1333,21 @@ PAF_ASIT_initPhaseDecOpCircBuf(
 )
 {
     PAF_AST_Config *pAstCfg;
-    Int as;                     /* Audio Stream Number (1, 2, etc.) */
+    PAF_AST_DecOpCircBufCtl *pCbCtl;    /* Decoder output circular buffer control */
+    PAF_AST_DecOpCircBuf *pCb;          /* Decoder output circular buffer */
+    Int as;                             /* Audio Stream Number (1, 2, etc.) */
     Int zMS;
-    Int z;                      /* decode counter */
-    PAF_AST_DecOpCircBuf *pCb;  /* Decoder output circular buffer */
-    Int errno;                  /* error number */
+    Int z;                              /* decode counter */
+    Int errno;                          /* error number */
     Error_Block    eb;
     Int i;
 
     // FL: (***)revisit
-
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     as = pAstCfg->as;
     zMS = pAstCfg->masterStr;
+
+    pCbCtl = &pC->pAspmCfg->decOpCircBufCtl; // get pointer to circular buffer control
     
     /* Decode output circular buffer memory */
     if (!(pAstCfg->xDecOpCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, 
@@ -1398,14 +1400,14 @@ PAF_ASIT_initPhaseDecOpCircBuf(
         
         // (***) FL: revisit, here PCM is hard-coded for 256 sample dec op frame length        
         // Initialize decoder output circular buffer for PCM
-        errno = cbInit(PAF_SOURCE_PCM, 256, FRAMELENGTH, pCb, 1);
+        errno = cbInit(pCbCtl, z, PAF_SOURCE_PCM, 256, FRAMELENGTH, 1);
         if (errno)
         {
             SW_BREAKPOINT; // FL: debug
             return errno;
         }
         // FL: debug
-        cbLog(pCb, 1, "PAF_ASIT_initPhaseDecOpCircBuf:cbInit");        
+        cbLog(pCbCtl, z, 1, "PAF_ASIT_initPhaseDecOpCircBuf:cbInit");        
     }
 
     return 0;
@@ -2238,17 +2240,17 @@ PAF_ASIT_decodeInit(
 )
 {
     PAF_AST_Config *pAstCfg;
-    Int as;                     /* Audio Stream Number (1, 2, etc.) */
-    Int z;                      /* decode/encode counter */
-    Int errno;                  /* error number */
+    PAF_AST_DecOpCircBufCtl *pCbCtl;    /* Decoder output circular buffer control */
+    Int as;                             /* Audio Stream Number (1, 2, etc.) */
+    Int z;                              /* decode/encode counter */
+    Int errno;                          /* error number */
     Int zI, zS;
     Int zMD;
     Int zMI;
-    ASP_Msg* pAspMsg;           /* Messaging */
+    ASP_Msg* pAspMsg;                   /* Messaging */
     Int argIdx;
     Int decErrno;
     Int status;
-    PAF_AST_DecOpCircBuf *pCb;  /* Decoder output circular buffer */
     
     pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
     as = pAstCfg->as;
@@ -2256,6 +2258,8 @@ PAF_ASIT_decodeInit(
     zMI = pP->zone.master;
     (void)as;  // clear compiler warning in case not used with tracing disabled
     
+    pCbCtl = &pC->pAspmCfg->decOpCircBufCtl; // get pointer to circular buffer control
+
     // reset frameCount
     for (z=DECODE1; z < DECODEN; z++)
     {
@@ -2439,15 +2443,14 @@ PAF_ASIT_decodeInit(
             //pC->xDec[z].decodeControl.rdSampleCount = 0;
 
             // Initialize decoder output circular buffer for selected source
-            pCb = &pAstCfg->xDecOpCb[z];
-            errno = cbInit(sourceSelect, frameLength, FRAMELENGTH, pCb, 0);
+            errno = cbInit(pCbCtl, z, sourceSelect, frameLength, FRAMELENGTH, 0);
             if (errno)
             {
                 SW_BREAKPOINT; // FL: debug
                 return errno;
             }
             // FL: debug
-            cbLog(pCb, 1, "PAF_ASIT_decodeInit:cbInit");
+            cbLog(pCbCtl, z, 1, "PAF_ASIT_decodeInit:cbInit");
             
             if (z != zMD) 
             {