summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 909f0df)
raw | patch | inline | side by side (parent: 909f0df)
author | Frank Livingston <frank-livingston@ti.com> | |
Tue, 6 Sep 2016 17:04:45 +0000 (12:04 -0500) | ||
committer | Frank Livingston <frank-livingston@ti.com> | |
Tue, 6 Sep 2016 17:04:45 +0000 (12:04 -0500) |
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.c b/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.c
--- /dev/null
@@ -0,0 +1,66 @@
+
+/*
+Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+All rights reserved.
+
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of
+* its contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+#include <xdc/std.h>
+#include <ti/sysbios/hal/Cache.h>
+#include <xdc/runtime/Log.h>
+
+#include "aspDecOpCircBuf_common.h"
+
+// Output log of circular buffer control variables (debug)
+Int cbLog(
+ PAF_AST_DecOpCircBuf *pCb,
+ Int8 fullLog,
+ char *locInfo
+)
+{
+ // Invalidate circular buffer configuration.
+ Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ Log_info1("CB: %s", (IArg)locInfo);
+ Log_info3("CB: readerActiveFlag=%d, writerActiveFlag=%d, emptyFlag=%d", pCb->readerActiveFlag, pCb->writerActiveFlag, pCb->emptyFlag);
+ Log_info4("CB: afRdIdx=%d, pcmRdIdx=%d, afWrtIdx=%d, numAfCb=%d", pCb->afRdIdx, pCb->pcmRdIdx,
+ pCb->afWrtIdx,
+ pCb->numAfCb);
+ if (fullLog)
+ {
+ Log_info1("CB: maxNumAfCb=%d", pCb->maxNumAfCb);
+ Log_info2("CB: decOpFrameLen=%d, strFrameLen=%d", pCb->decOpFrameLen, pCb->strFrameLen);
+ //Log_info1("cbWriteInit=%d", pCb->cbWriteAfInit);
+ }
+
+ return 0;
+}
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/paf_decOpCircBuf.h b/processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h
similarity index 57%
rename from processor_audio_sdk_1_00_00_00/pasdk/common/paf_decOpCircBuf.h
rename to processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h
index 96d4d4c6ab046497e474f92c668948801758d8dc..f3b90f4d545b91f203628047ed84d73e7b789a2f 100644 (file)
rename from processor_audio_sdk_1_00_00_00/pasdk/common/paf_decOpCircBuf.h
rename to processor_audio_sdk_1_00_00_00/pasdk/common/aspDecOpCircBuf_common.h
index 96d4d4c6ab046497e474f92c668948801758d8dc..f3b90f4d545b91f203628047ed84d73e7b789a2f 100644 (file)
*
*/
-#ifndef _DEC_OP_CIRC_BUF_H_
-#define _DEC_OP_CIRC_BUF_H_
+#ifndef _ASP_DECOP_CB_COMMON_H_
+#define _ASP_DECOP_CB_COMMON_H_
#include <xdc/std.h>
#include "paftyp.h"
-#define PAF_DECOP_CB_SOK ( 0 ) // ok
-#define PAF_DECOP_CB_INIT_INV_SOURCE_SEL ( -1 ) // error: invalid source selection on init
-#define PAF_DECOP_CB_WRITE_OVERFLOW ( -2 ) // error: write overflow
-#define PAF_DECOP_CB_READ_UNDERFLOW ( -3 ) // error: read underflow
-#define PAF_DECOP_CB_READ_INVSTATE ( -4 ) // error: circular buffer invalid state on read
+#define ASP_DECOP_CB_SOK ( 0 ) // ok
+
+#define ASP_DECOP_CB_MAX_NUM_AF ( 4 ) // decoder output circular buffer maximum number audio frames
+#define ASP_DECOP_CB_MAX_NUM_PCM_CH ( 16 ) // decoder output circular buffer maximum number audio PCM channels
+#define ASP_DECOP_CB_MAX_NUM_PCM_FRAMES ( 2 ) // decoder output circular buffer maximum number PCM frames //Qin - Increased to prevent cb overflow for ddp.
+#define ASP_DECOP_CB_MAX_PCM_FRAME_LEN ( 6*256 ) // decoder output circular buffer maximum PCM frame length
+#define ASP_DECOP_CB_PCM_BUF_SZ ( ASP_DECOP_CB_MAX_NUM_PCM_CH * ASP_DECOP_CB_MAX_NUM_PCM_FRAMES * ASP_DECOP_CB_MAX_PCM_FRAME_LEN )
-#define PAF_DECOP_CB_MAX_NUM_AF ( 4 ) // decoder output circular buffer maximum number audio frames
-#define PAF_DECOP_CB_MAX_NUM_PCM_CH ( 16 ) // decoder output circular buffer maximum number audio PCM channels
-#define PAF_DECOP_CB_MAX_NUM_PCM_FRAMES ( 2 ) // decoder output circular buffer maximum number PCM frames //Qin - Increased to prevent cb overflow for ddp.
-#define PAF_DECOP_CB_MAX_PCM_FRAME_LEN ( 6*256 ) // decoder output circular buffer maximum PCM frame length
-#define PAF_DECOP_CB_PCM_BUF_SZ ( PAF_DECOP_CB_MAX_NUM_PCM_CH * PAF_DECOP_CB_MAX_NUM_PCM_FRAMES * PAF_DECOP_CB_MAX_PCM_FRAME_LEN )
// Decoder output circular buffer
typedef struct PAF_AST_DecOpCircBuf
Int8 errOvrCnt; // overflow count
} PAF_AST_DecOpCircBuf;
-// Initialize circular buffer
-Int cbInit(
- Int8 sourceSelect, // source select (PCM, DDP, etc.)
- Int16 decOpFrameLen, // decoder output frame length (PCM samples)
- Int16 strFrameLen, // stream frame length (PCM samples)
- PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
- Int8 resetRwFlags // whether to reset reader, writer, and empty flags
-);
-
-// Start writes to circular buffer
-Int cbWriteStart(
- PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
-);
-
-// Stop writes to circular buffer
-Int cbWriteStop(
- PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
-);
-
-// Start reads from circular buffer
-Int cbReadStart(
- PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
-);
-
-// Stop reads from circular buffer
-Int cbReadStop(
- PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
-);
-
-// Read audio frame from circular buffer
-Int cbReadAf(
- PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
- PAF_AudioFrame *pAfRd // audio frame into which to read
-);
-
-// Write audio frame to circular buffer
-Int cbWriteAf(
- PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
- PAF_AudioFrame *pAfWrt // audio frame from which to write
-);
-
-// Get next audio frame to write in circular buffer
-Int cbGetNextWriteAf(
- PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
- PAF_AudioFrame **ppAfWrt // audio frame next to be written
-);
-
// Output log of circular buffer control variables (debug)
Int cbLog(
PAF_AST_DecOpCircBuf *pCb,
char *locInfo
);
-#endif /* _DEC_OP_CIRC_BUF_H_ */
+#endif /* _ASP_DECOP_CB_COMMON_H_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_config.h b/processor_audio_sdk_1_00_00_00/pasdk/common/audioStreamProc_config.h
index c5f815219984f419c717929c5f012ecd2d26a198..6dabdfb66de2f9ead5645974e14c5e998bd8a31b 100644 (file)
#include "as1-f2.h"
#include "asp0.h"
-#include "paf_decOpCircBuf.h"
+#include "aspDecOpCircBuf_common.h"
#ifdef HSE_MSGQ
#include <msgq.h>
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/aspDecOpCircBuf_slave.c
--- /dev/null
@@ -0,0 +1,249 @@
+
+/*
+Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+All rights reserved.
+
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of
+* its contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+#include <string.h> // for memset
+#include <xdc/std.h>
+#include <ti/sysbios/hal/Cache.h>
+#include <xdc/runtime/Log.h>
+
+#include "common.h"
+#include "paftyp.h"
+//#include "pafdec.h"
+//#include "pafsp.h"
+#include "aspDecOpCircBuf_slave.h"
+
+// Start writes to circular buffer
+Int cbWriteStart(
+ PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
+)
+{
+ PAF_AudioFrame *pAfCb;
+ Int8 n;
+ //Int8 i;
+
+ // (***) FL: revisit
+ // Invalidate circular buffer configuration.
+ // NOTE: Probably only a subset of this information needs to be updated.
+ Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ // Invalidate AF circular buffer
+ Cache_inv(pCb->afCb, pCb->maxNumAfCb*sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
+ for (n=0; n<pCb->maxNumAfCb; n++)
+ {
+ pAfCb = &pCb->afCb[n];
+ Cache_inv(pAfCb->data.sample, ASP_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
+ // FL: unnecessary since part of AF
+ //for (i=0; i<PAF_MAX_NUM_PRIVATE_MD; i++) //QIN
+ //{
+ // Cache_inv(&pAfCb->pafPrivateMetadata[i], sizeof(PAF_PrivateMetadata), Cache_Type_ALLD, 0);
+ //}
+ }
+ Cache_wait();
+
+ // update flags
+ pCb->writerActiveFlag = 1;
+ pCb->emptyFlag = 0;
+
+ // (***) FL: revisit
+ // Write back circular buffer configuration
+ Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ return ASP_DECOP_CB_SOK;
+};
+
+// Stop writes to circular buffer
+Int cbWriteStop(
+ PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
+)
+{
+ // Invalidate circular buffer configuration
+ Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ // update flags
+ pCb->writerActiveFlag = 0;
+ pCb->emptyFlag = 1;
+
+ // (***) FL: revisit
+ // Write back circular buffer configuration
+ Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ return ASP_DECOP_CB_SOK;
+}
+
+// Write audio frame to circular buffer
+Int cbWriteAf(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ PAF_AudioFrame *pAfWrt // audio frame from which to write
+)
+{
+ PAF_AudioFrame *pAfCb;
+ PAF_ChannelMask_HD streamMask;
+ Int8 i;
+ Int16 j;
+
+ // (***) FL: revisit
+ // Invalidate circular buffer configuration.
+ // NOTE: Probably only a subset of this information nexeds to be updated.
+ Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ Cache_wait();
+
+ if (pCb->readerActiveFlag == 1)
+ {
+ //
+ // Normal case, reader active.
+ // If reader not active, don't write to circular buffer or check OVRflow.
+
+#if 0
+ if (pCb->cbWriteAfInit == 0)
+ {
+ // Invalidate AF circular buffer
+ Cache_inv(pCb->afCb, pCb->maxNumAfCb*sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
+ for (n=0; n<pCb->maxNumAfCb; n++)
+ {
+ pAfCb = &pCb->afCb[n];
+ Cache_inv(pAfCb->data.sample, ASP_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
+ }
+ Cache_wait();
+
+ pCb->cbWriteAfInit = 1;
+ }
+#endif
+
+ // check overflow
+ if (pCb->numAfCb >= pCb->maxNumAfCb)
+ {
+ pCb->errOvrCnt++;
+ //SW_BREAKPOINT;
+ Log_info1("cbWriteAf: ERROR: overflow, numAfCb=%d", pCb->numAfCb);
+ return ASP_DECOP_CB_WRITE_OVERFLOW;
+ }
+
+ // get pointer to current audio frame in circular buffer
+ pAfCb = &pCb->afCb[pCb->afWrtIdx];
+
+ // write audio frame information updated by decoder
+ pAfCb->sampleDecode = pAfWrt->sampleDecode;
+ PAF_PROCESS_COPY(pAfCb->sampleProcess, pAfWrt->sampleProcess);
+ pAfCb->sampleRate = pAfWrt->sampleRate;
+ pAfCb->sampleCount = pAfWrt->sampleCount;
+ pAfCb->channelConfigurationRequest = pAfWrt->channelConfigurationRequest;
+ pAfCb->channelConfigurationStream = pAfWrt->channelConfigurationStream;
+ // write metadata information updated by decoder //QIN
+ pAfCb->bsMetadata_type = pAfWrt->bsMetadata_type; /* non zero if metadata is attached. */
+ pAfCb->pafBsMetadataUpdate = pAfWrt->pafBsMetadataUpdate; /* indicates whether bit-stream metadata update */
+ pAfCb->numPrivateMetadata = pAfWrt->numPrivateMetadata; /* number of valid private metadata (0 or 1 if metadata filtering enabled) */
+ pAfCb->bsMetadata_offset = pAfWrt->bsMetadata_offset; /* offset into audio frame for change in bsMetadata_type field */
+ // write PCM samples
+ streamMask = pAfWrt->fxns->channelMask(pAfWrt, pAfCb->channelConfigurationStream);
+ for (i = 0; i < ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ {
+ if ((streamMask >> i) & 0x1)
+ {
+ for (j = 0; j < pCb->decOpFrameLen; j++)
+ {
+ pAfCb->data.sample[i][j] = pAfWrt->data.sample[i][j];
+ }
+
+ pAfCb->data.samsiz[i] = pAfWrt->data.samsiz[i];
+ }
+ }
+
+ // Write metadata to circular buffer
+ for (i = 0; i < pAfCb->numPrivateMetadata; i++) // FL: only copy numPrivateMetadata
+ {
+ pAfCb->pafPrivateMetadata[i].offset = pAfWrt->pafPrivateMetadata[i].offset;
+ pAfCb->pafPrivateMetadata[i].size = pAfWrt->pafPrivateMetadata[i].size;
+ memcpy(pAfCb->pafPrivateMetadata[i].pMdBuf, pAfWrt->pafPrivateMetadata[i].pMdBuf, pAfWrt->pafPrivateMetadata[i].size);
+ }
+
+ // update audio frame write index
+ pCb->afWrtIdx++;
+ if (pCb->afWrtIdx >= pCb->maxNumAfCb)
+ {
+ pCb->afWrtIdx = 0;
+ }
+
+ // update number of audio frames in circular buffer
+ pCb->numAfCb++;
+
+ // (***) FL: revisit
+ // Write back circular buffer configuration
+ Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
+ // write back audio frame
+ Cache_wb(pAfCb, sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
+ Cache_wb(pAfCb->data.samsiz, ASP_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
+ // write back PCM data
+ for (i = 0; i < ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ {
+ if ((streamMask >> i) & 0x1)
+ {
+ Cache_wb(pAfCb->data.sample[i], pCb->decOpFrameLen*sizeof(PAF_AudioData), Cache_Type_ALLD, 0);
+ }
+ }
+
+ // write back private metadata // QIN
+ for (i=0; i<pAfCb->numPrivateMetadata; i++) // FL: only write back numPrivateMetadata
+ {
+ //Cache_wb(&pAfCb->pafPrivateMetadata[i], sizeof(PAF_PrivateMetadata), Cache_Type_ALLD, 0); // FL: unnecessary since part of AF
+ Cache_wb(pAfCb->pafPrivateMetadata[i].pMdBuf, pAfCb->pafPrivateMetadata[i].size, Cache_Type_ALLD, 0);
+ }
+ Cache_wait();
+ }
+
+ return ASP_DECOP_CB_SOK;
+}
+
+// Get next audio frame to write in circular buffer
+Int cbGetNextWriteAf(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ PAF_AudioFrame **ppAfWrt // audio frame next to be written
+)
+{
+ // get pointer to current audio frame in circular buffer
+ *ppAfWrt = &pCb->afCb[pCb->afWrtIdx];
+
+ // update audio frame write index
+ pCb->afWrtIdx++;
+ if (pCb->afWrtIdx > pCb->maxNumAfCb)
+ {
+ pCb->afWrtIdx = 0;
+ }
+
+ return ASP_DECOP_CB_SOK;
+}
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/aspDecOpCircBuf_slave.h b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/aspDecOpCircBuf_slave.h
--- /dev/null
@@ -0,0 +1,67 @@
+
+/*
+Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+All rights reserved.
+
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of
+* its contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+#ifndef _ASP_DECOP_CB_SLAVE_H_
+#define _ASP_DECOP_CB_SLAVE_H_
+
+#include <xdc/std.h>
+#include "paftyp.h"
+#include "aspDecOpCircBuf_common.h"
+
+#define ASP_DECOP_CB_WRITE_OVERFLOW ( ASP_DECOP_CB_SOK-1 ) // error: write overflow
+
+// Start writes to circular buffer
+Int cbWriteStart(
+ PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
+);
+
+// Stop writes to circular buffer
+Int cbWriteStop(
+ PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
+);
+
+// Write audio frame to circular buffer
+Int cbWriteAf(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ PAF_AudioFrame *pAfWrt // audio frame from which to write
+);
+
+// Get next audio frame to write in circular buffer
+Int cbGetNextWriteAf(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ PAF_AudioFrame **ppAfWrt // audio frame next to be written
+);
+
+#endif /* _ASP_DECOP_CB_SLAVE_H_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_arm/framework/audioStreamDecodeProc.c
index 5d3c2f18c7e910c9bc1c35c2ca02a8b601c5295d..cdd23ce0a961dcc74d11ad3f03c88835dd798971 100644 (file)
#include "common.h"
#include "aspMsg_common.h"
#include "aspMsg_slave.h"
-#include "paf_decOpCircBuf.h"
+#include "aspDecOpCircBuf_slave.h"
#include "audioStreamProc_common.h"
#include "audioStreamDecodeProc.h"
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/common/paf_decOpCircBuf.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
similarity index 63%
rename from processor_audio_sdk_1_00_00_00/pasdk/common/paf_decOpCircBuf.c
rename to processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
index 425496a70776b6992f3223e1fccc1564facd547a..948c1fb9b4716d0092a1f8f27a07b1421a1dff51 100644 (file)
rename from processor_audio_sdk_1_00_00_00/pasdk/common/paf_decOpCircBuf.c
rename to processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/aspDecOpCircBuf_master.c
index 425496a70776b6992f3223e1fccc1564facd547a..948c1fb9b4716d0092a1f8f27a07b1421a1dff51 100644 (file)
#include <xdc/runtime/Log.h>
#include "common.h"
+#include "paftyp.h"
#include "pafdec.h"
-#include "pafsp.h"
-#include "paf_decOpCircBuf.h"
-
-// Generate mute AF on circular buffer read
-static Void cbReadAfMute(
- PAF_AudioFrame *pAfRd, // audio frame into which to read
- Int16 strFrameLen // stream frame length (output transaction size)
-);
+#include "aspDecOpCircBuf_master.h"
#define MAX_NUM_AF_PCM ( 4 )
#define CB_INIT_RD_LAG_PCM ( 2 ) // 0...3
#define MAX_NUM_AF_DDP ( 2 )
#define CB_INIT_RD_LAG_DDP ( 4 ) // 0...5
+// Generate mute AF on circular buffer read
+static Void cbReadAfMute(
+ PAF_AudioFrame *pAfRd, // audio frame into which to read
+ Int16 strFrameLen // stream frame length (output transaction size)
+);
+
// Initialize circular buffer
Int cbInit(
Int8 sourceSelect, // source select (PCM, DDP, etc.)
}
else
{
- return PAF_DECOP_CB_INIT_INV_SOURCE_SEL;
+ return ASP_DECOP_CB_INIT_INV_SOURCE_SEL;
}
// initialize circular buffer current number of frames
for (n=0; n<pCb->maxNumAfCb; n++)
{
pAfCb = &pCb->afCb[n];
- pAfCb->data.nChannels = PAF_DECOP_CB_MAX_NUM_PCM_CH;
+ pAfCb->data.nChannels = ASP_DECOP_CB_MAX_NUM_PCM_CH;
pAfCb->data.nSamples = decOpFrameLen;
- for (i=0; i<PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ for (i=0; i<ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
{
pAfCb->data.sample[i] = pPcmBuf;
memset(pAfCb->data.sample[i], decOpFrameLen, 0);
for (n=0; n<pCb->maxNumAfCb; n++)
{
pAfCb = &pCb->afCb[n];
- Cache_wb(pAfCb->data.samsiz, PAF_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
- Cache_wb(pAfCb->data.sample, PAF_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
- for (i=0; i<PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ Cache_wb(pAfCb->data.samsiz, ASP_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
+ Cache_wb(pAfCb->data.sample, ASP_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
+ for (i=0; i<ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
{
Cache_wb(pAfCb->data.sample[i], decOpFrameLen*sizeof(PAF_AudioData), Cache_Type_ALLD, 0);
}
}
Cache_wait();
- return PAF_DECOP_CB_SOK;
-}
-
-// Start writes to circular buffer
-Int cbWriteStart(
- PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
-)
-{
- PAF_AudioFrame *pAfCb;
- Int8 n;
- //Int8 i;
-
- // (***) FL: revisit
- // Invalidate circular buffer configuration.
- // NOTE: Probably only a subset of this information needs to be updated.
- Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
- Cache_wait();
-
- // Invalidate AF circular buffer
- Cache_inv(pCb->afCb, pCb->maxNumAfCb*sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
- for (n=0; n<pCb->maxNumAfCb; n++)
- {
- pAfCb = &pCb->afCb[n];
- Cache_inv(pAfCb->data.sample, PAF_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
- // FL: unnecessary since part of AF
- //for (i=0; i<PAF_MAX_NUM_PRIVATE_MD; i++) //QIN
- //{
- // Cache_inv(&pAfCb->pafPrivateMetadata[i], sizeof(PAF_PrivateMetadata), Cache_Type_ALLD, 0);
- //}
- }
- Cache_wait();
-
- // update flags
- pCb->writerActiveFlag = 1;
- pCb->emptyFlag = 0;
-
- // (***) FL: revisit
- // Write back circular buffer configuration
- Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
- Cache_wait();
-
- return PAF_DECOP_CB_SOK;
-};
-
-// Stop writes to circular buffer
-Int cbWriteStop(
- PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
-)
-{
- // Invalidate circular buffer configuration
- Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
- Cache_wait();
-
- // update flags
- pCb->writerActiveFlag = 0;
- pCb->emptyFlag = 1;
-
- // (***) FL: revisit
- // Write back circular buffer configuration
- Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
- Cache_wait();
-
- return PAF_DECOP_CB_SOK;
+ return ASP_DECOP_CB_SOK;
}
// Start reads from circular buffer
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
Cache_wait();
- return PAF_DECOP_CB_SOK;
+ return ASP_DECOP_CB_SOK;
}
// Stop reads from circular buffer
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
Cache_wait();
- return PAF_DECOP_CB_SOK;
+ return ASP_DECOP_CB_SOK;
}
// Read audio frame from circular buffer
// writer is active AND draining circular buffer
Log_info2("cbReadAf: ERROR: writerActiveFlag=%d, emptyFlag=%d", pCb->writerActiveFlag, pCb->emptyFlag);
SW_BREAKPOINT; // FL: debug
- return PAF_DECOP_CB_READ_INVSTATE;
+ return ASP_DECOP_CB_READ_INVSTATE;
}
if ((pCb->writerActiveFlag == 0) && (pCb->emptyFlag == 0))
//
cbReadAfMute(pAfRd, pCb->strFrameLen);
- return PAF_DECOP_CB_SOK;
+ return ASP_DECOP_CB_SOK;
}
if ((pCb->writerActiveFlag == 1))
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
Cache_wait();
- return PAF_DECOP_CB_READ_UNDERFLOW;
+ return ASP_DECOP_CB_READ_UNDERFLOW;
}
}
// (***) FL: revisit
// Invalidate audio frame
Cache_inv(pAfCb, sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
- Cache_inv(pAfCb->data.samsiz, PAF_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
+ Cache_inv(pAfCb->data.samsiz, ASP_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
for (i=0; i<pAfCb->numPrivateMetadata; i++) //QIN // FL: only invalidate numPrivateMetadata
{
//Cache_inv(&pAfCb->pafPrivateMetadata[i], sizeof(PAF_PrivateMetadata), Cache_Type_ALLD, 0); // FL: unnecessary since part of AF
streamMask = pAfRd->fxns->channelMask(pAfRd, pAfCb->channelConfigurationStream);
// Invalidate PCM data
- for (i = 0; i < PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ for (i = 0; i < ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
{
if ((streamMask >> i) & 0x1)
{
pAfRd->bsMetadata_offset = pAfCb->bsMetadata_offset; /* offset into audio frame for change in bsMetadata_type field */
// read PCM samples
- for (i = 0; i < PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ for (i = 0; i < ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
{
if ((streamMask >> i) & 0x1)
{
Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
Cache_wait();
- return PAF_DECOP_CB_SOK;
-}
-
-// Write audio frame to circular buffer
-Int cbWriteAf(
- PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
- PAF_AudioFrame *pAfWrt // audio frame from which to write
-)
-{
- PAF_AudioFrame *pAfCb;
- PAF_ChannelMask_HD streamMask;
- Int8 i;
- Int16 j;
-
- // (***) FL: revisit
- // Invalidate circular buffer configuration.
- // NOTE: Probably only a subset of this information nexeds to be updated.
- Cache_inv(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
- Cache_wait();
-
- if (pCb->readerActiveFlag == 1)
- {
- //
- // Normal case, reader active.
- // If reader not active, don't write to circular buffer or check OVRflow.
-
-#if 0
- if (pCb->cbWriteAfInit == 0)
- {
- // Invalidate AF circular buffer
- Cache_inv(pCb->afCb, pCb->maxNumAfCb*sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
- for (n=0; n<pCb->maxNumAfCb; n++)
- {
- pAfCb = &pCb->afCb[n];
- Cache_inv(pAfCb->data.sample, PAF_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioData *), Cache_Type_ALLD, 0);
- }
- Cache_wait();
-
- pCb->cbWriteAfInit = 1;
- }
-#endif
-
- // check overflow
- if (pCb->numAfCb >= pCb->maxNumAfCb)
- {
- pCb->errOvrCnt++;
- //SW_BREAKPOINT;
- Log_info1("cbWriteAf: ERROR: overflow, numAfCb=%d", pCb->numAfCb);
- return PAF_DECOP_CB_WRITE_OVERFLOW;
- }
-
- // get pointer to current audio frame in circular buffer
- pAfCb = &pCb->afCb[pCb->afWrtIdx];
-
- // write audio frame information updated by decoder
- pAfCb->sampleDecode = pAfWrt->sampleDecode;
- PAF_PROCESS_COPY(pAfCb->sampleProcess, pAfWrt->sampleProcess);
- pAfCb->sampleRate = pAfWrt->sampleRate;
- pAfCb->sampleCount = pAfWrt->sampleCount;
- pAfCb->channelConfigurationRequest = pAfWrt->channelConfigurationRequest;
- pAfCb->channelConfigurationStream = pAfWrt->channelConfigurationStream;
- // write metadata information updated by decoder //QIN
- pAfCb->bsMetadata_type = pAfWrt->bsMetadata_type; /* non zero if metadata is attached. */
- pAfCb->pafBsMetadataUpdate = pAfWrt->pafBsMetadataUpdate; /* indicates whether bit-stream metadata update */
- pAfCb->numPrivateMetadata = pAfWrt->numPrivateMetadata; /* number of valid private metadata (0 or 1 if metadata filtering enabled) */
- pAfCb->bsMetadata_offset = pAfWrt->bsMetadata_offset; /* offset into audio frame for change in bsMetadata_type field */
- // write PCM samples
- streamMask = pAfWrt->fxns->channelMask(pAfWrt, pAfCb->channelConfigurationStream);
- for (i = 0; i < PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
- {
- if ((streamMask >> i) & 0x1)
- {
- for (j = 0; j < pCb->decOpFrameLen; j++)
- {
- pAfCb->data.sample[i][j] = pAfWrt->data.sample[i][j];
- }
-
- pAfCb->data.samsiz[i] = pAfWrt->data.samsiz[i];
- }
- }
-
- // Write metadata to circular buffer
- for (i = 0; i < pAfCb->numPrivateMetadata; i++) // FL: only copy numPrivateMetadata
- {
- pAfCb->pafPrivateMetadata[i].offset = pAfWrt->pafPrivateMetadata[i].offset;
- pAfCb->pafPrivateMetadata[i].size = pAfWrt->pafPrivateMetadata[i].size;
- memcpy(pAfCb->pafPrivateMetadata[i].pMdBuf, pAfWrt->pafPrivateMetadata[i].pMdBuf, pAfWrt->pafPrivateMetadata[i].size);
- }
-
- // update audio frame write index
- pCb->afWrtIdx++;
- if (pCb->afWrtIdx >= pCb->maxNumAfCb)
- {
- pCb->afWrtIdx = 0;
- }
-
- // update number of audio frames in circular buffer
- pCb->numAfCb++;
-
- // (***) FL: revisit
- // Write back circular buffer configuration
- Cache_wb(pCb, sizeof(PAF_AST_DecOpCircBuf), Cache_Type_ALLD, 0);
- // write back audio frame
- Cache_wb(pAfCb, sizeof(PAF_AudioFrame), Cache_Type_ALLD, 0);
- Cache_wb(pAfCb->data.samsiz, PAF_DECOP_CB_MAX_NUM_PCM_CH*sizeof(PAF_AudioSize), Cache_Type_ALLD, 0);
- // write back PCM data
- for (i = 0; i < PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
- {
- if ((streamMask >> i) & 0x1)
- {
- Cache_wb(pAfCb->data.sample[i], pCb->decOpFrameLen*sizeof(PAF_AudioData), Cache_Type_ALLD, 0);
- }
- }
-
- // write back private metadata // QIN
- for (i=0; i<pAfCb->numPrivateMetadata; i++) // FL: only write back numPrivateMetadata
- {
- //Cache_wb(&pAfCb->pafPrivateMetadata[i], sizeof(PAF_PrivateMetadata), Cache_Type_ALLD, 0); // FL: unnecessary since part of AF
- Cache_wb(pAfCb->pafPrivateMetadata[i].pMdBuf, pAfCb->pafPrivateMetadata[i].size, Cache_Type_ALLD, 0);
- }
- Cache_wait();
- }
-
- return PAF_DECOP_CB_SOK;
-}
-
-// Get next audio frame to write in circular buffer
-Int cbGetNextWriteAf(
- PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
- PAF_AudioFrame **ppAfWrt // audio frame next to be written
-)
-{
- // get pointer to current audio frame in circular buffer
- *ppAfWrt = &pCb->afCb[pCb->afWrtIdx];
-
- // update audio frame write index
- pCb->afWrtIdx++;
- if (pCb->afWrtIdx > pCb->maxNumAfCb)
- {
- pCb->afWrtIdx = 0;
- }
-
- return PAF_DECOP_CB_SOK;
-}
-
-// Output log of circular buffer control variables (debug)
-Int cbLog(
- PAF_AST_DecOpCircBuf *pCb,
- Int8 fullLog,
- char *locInfo
-)
-{
- Log_info1("CB: %s", (IArg)locInfo);
- Log_info3("CB: readerActiveFlag=%d, writerActiveFlag=%d, emptyFlag=%d", pCb->readerActiveFlag, pCb->writerActiveFlag, pCb->emptyFlag);
- Log_info4("CB: afRdIdx=%d, pcmRdIdx=%d, afWrtIdx=%d, numAfCb=%d", pCb->afRdIdx, pCb->pcmRdIdx,
- pCb->afWrtIdx,
- pCb->numAfCb);
- if (fullLog)
- {
- Log_info1("CB: maxNumAfCb=%d", pCb->maxNumAfCb);
- Log_info2("CB: decOpFrameLen=%d, strFrameLen=%d", pCb->decOpFrameLen, pCb->strFrameLen);
- //Log_info1("cbWriteInit=%d", pCb->cbWriteAfInit);
- }
-
- return 0;
+ return ASP_DECOP_CB_SOK;
}
// Generate mute AF on circular buffer read
// compute stream mask
streamMask = pAfRd->fxns->channelMask(pAfRd, pAfRd->channelConfigurationStream);
// Clear PCM data
- for (i = 0; i < PAF_DECOP_CB_MAX_NUM_PCM_CH; i++)
+ for (i = 0; i < ASP_DECOP_CB_MAX_NUM_PCM_CH; i++)
{
if ((streamMask >> i) & 0x1)
{
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/aspDecOpCircBuf_master.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/aspDecOpCircBuf_master.h
--- /dev/null
@@ -0,0 +1,79 @@
+
+/*
+Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
+All rights reserved.
+
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* Redistributions of source code must retain the above copyright
+* notice, this list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright
+* notice, this list of conditions and the following disclaimer in the
+* documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of Texas Instruments Incorporated nor the names of
+* its contributors may be used to endorse or promote products derived
+* from this software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*
+*/
+
+#ifndef _ASP_DECOP_CB_MASTER_H_
+#define _ASP_DECOP_CB_MASTER_H_
+
+#include <xdc/std.h>
+#include "paftyp.h"
+#include "aspDecOpCircBuf_common.h"
+
+#define ASP_DECOP_CB_INIT_INV_SOURCE_SEL ( ASP_DECOP_CB_SOK-1 ) // error: invalid source selection on init
+#define ASP_DECOP_CB_READ_UNDERFLOW ( ASP_DECOP_CB_SOK-2 ) // error: read underflow
+#define ASP_DECOP_CB_READ_INVSTATE ( ASP_DECOP_CB_SOK-3 ) // error: circular buffer invalid state on read
+
+
+// Initialize circular buffer
+Int cbInit(
+ Int8 sourceSelect, // source select (PCM, DDP, etc.)
+ Int16 decOpFrameLen, // decoder output frame length (PCM samples)
+ Int16 strFrameLen, // stream frame length (PCM samples)
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ Int8 resetRwFlags // whether to reset reader, writer, and empty flags
+);
+
+// Start reads from circular buffer
+Int cbReadStart(
+ PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
+);
+
+// Stop reads from circular buffer
+Int cbReadStop(
+ PAF_AST_DecOpCircBuf *pCb // decoder output circular buffer
+);
+
+// Read audio frame from circular buffer
+Int cbReadAf(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ PAF_AudioFrame *pAfRd // audio frame into which to read
+);
+
+// Write audio frame to circular buffer
+Int cbWriteAf(
+ PAF_AST_DecOpCircBuf *pCb, // decoder output circular buffer
+ PAF_AudioFrame *pAfWrt // audio frame from which to write
+);
+
+#endif /* _ASP_DECOP_CB_MASTER_H_ */
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.c
index af8c939b4ba77a46974d7eeae776e18eec261763..bdb6adecce905f33ea79a12dcb7cb5bd7ee1d296 100644 (file)
#include "paf_heapMgr.h"
#include "aspMsg_common.h"
#include "aspMsg_master.h"
-#include "paf_decOpCircBuf.h"
+#include "aspDecOpCircBuf_master.h"
#include "audioStreamProc_common.h"
#include "audioStreamInpProc.h"
pCb = &pAstCfg->xDecOpCb[z];
// allocate audio frame circular buffer
- if (!(pCb->afCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_AF * sizeof(PAF_AudioFrame), 4, &eb)))
+ if (!(pCb->afCb = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_AF * sizeof(PAF_AudioFrame), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
}
// allocate audio frame PCM sample pointer array
- for (i = 0; i<PAF_DECOP_CB_MAX_NUM_AF; i++)
+ for (i = 0; i<ASP_DECOP_CB_MAX_NUM_AF; i++)
{
- if (!(pCb->afCb[i].data.sample = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioData *), 4, &eb)))
+ if (!(pCb->afCb[i].data.sample = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioData *), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
}
- if (!(pCb->afCb[i].data.samsiz = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioSize), 4, &eb)))
+ if (!(pCb->afCb[i].data.samsiz = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_PCM_CH * sizeof(PAF_AudioSize), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
}
}
// allocate PCM sample buffer
- if (!(pCb->pcmBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_PCM_BUF_SZ * sizeof(PAF_AudioData), 4, &eb)))
+ if (!(pCb->pcmBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_PCM_BUF_SZ * sizeof(PAF_AudioData), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
}
// allocate Metadata buffers //QIN
- if (!(pCb->metaBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, PAF_DECOP_CB_MAX_NUM_AF * PAF_MAX_PRIVATE_MD_SZ * PAF_MAX_NUM_PRIVATE_MD * sizeof(Int8), 4, &eb)))
+ if (!(pCb->metaBuf = Memory_calloc((IHeap_Handle)HEAP_INTERNAL1_SHM, ASP_DECOP_CB_MAX_NUM_AF * PAF_MAX_PRIVATE_MD_SZ * PAF_MAX_NUM_PRIVATE_MD * sizeof(Int8), 4, &eb)))
{
TRACE_TERSE1("PAF_ASIT_initPhaseDecOpCircBuf: AS%d: Memory_calloc failed", as+zMS);
SW_BREAKPOINT;
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamOutProc.c
index 84dcacfdc0e3741346ef8d9bacc5c935e16de183..601d847717968239c3037db0b7b565b63dd21852 100644 (file)
#include "common.h"
#include "aspMsg_common.h"
#include "aspMsg_master.h"
-#include "paf_decOpCircBuf.h"
+#include "aspDecOpCircBuf_master.h"
#include "audioStreamProc_common.h"
#include "audioStreamOutProc.h"
Int block
)
{
- PAF_AST_Config *pAstCfg;
+ //PAF_AST_Config *pAstCfg;
Int errno;
- pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
+ //pAstCfg = pC->pAstCfg; // get pointer to common (shared) configuration
errno = pP->fxns->setCheckRateX (pP, pQ, pC, 1);
TRACE_VERBOSE1("PAF_ASOT_decodeInfo2: return 0x%x", errno);