[processor-sdk/performance-audio-sr.git] / processor_audio_sdk_1_00_00_00 / pasdk / test_dsp / framework / audioStreamInpProc.h
diff --git a/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h b/processor_audio_sdk_1_00_00_00/pasdk/test_dsp/framework/audioStreamInpProc.h
+++ /dev/null
@@ -1,415 +0,0 @@
-
-/*
-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.
-*
-*/
-
-/*
- * ======== audioStreamInpProc.h ========
- */
-
-#ifndef _ASIP_H_
-#define _ASIP_H_
-
-#include <xdc/std.h>
-
-#include "audioStreamProc_params.h"
-#include "audioStreamProc_patchs.h"
-#include "audioStreamProc_config.h"
-#include "audioStreamProc_master.h"
-
-// Global debug counter */
-extern Uint32 gTaskAsipCnt; // debug counter for ASP task
-
-struct PAF_ASIT_Params;
-struct PAF_ASIT_Patchs;
-struct PAF_ASIT_Config;
-
-// Audio Stream Input Task (ASIT) parameters, functions
-typedef struct PAF_ASIT_Fxns {
- Int (*initPhase[8]) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
- //Int (*initFrame0) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
- //Int (*initFrame1) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
- Int (*passProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
- //Int (*passProcessingCopy) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
- Int (*autoProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, ALG_Handle);
- Int (*decodeProcessing) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
- Int (*decodeCommand) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
- //Int (*encodeCommand) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
- Int (*decodeInit) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
- Int (*decodeInfo) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
- Int (*decodeInfo1) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
- Int (*decodeInfo2) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
- //Int (*decodeCont) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, ALG_Handle *, Int, Int);
- Int (*decodeDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int, Int);
- //Int (*decodeStream) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
- //Int (*decodeEncode) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int);
- Int (*decodeFinalTest) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int, Int);
- Int (*decodeComplete) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, ALG_Handle *, Int, Int);
- Int (*selectDevices) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *);
- Int (*sourceDecode) (const struct PAF_ASIT_Params *, const struct PAF_ASIT_Patchs *, struct PAF_ASIT_Config *, Int);
- //Int (*startOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
- //Int (*stopOutput) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *);
- //Int (*setCheckRateX) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int);
- //Int (*streamChainFunction) (const struct PAF_AST_Params *, const struct PAF_AST_Patchs *, struct PAF_AST_Config *, Int, Int, Int);
- Int (*deviceAllocate) (SIO_Handle *, int, int, int, Ptr);
- Int (*deviceSelect) (SIO_Handle *, int, int, Ptr);
- Int (*computeFrameLength) (Int, Int, Int);
- Int (*updateInputStatus) (SIO_Handle, PAF_InpBufStatus *, PAF_InpBufConfig *);
- //Int (*copy) (Uns, PAF_InpBufConfig *, Uns, PAF_OutBufConfig *);
-
- // For RAM_report
- Void (*headerPrint)();
- Int (*allocPrint)(const PAF_ALG_AllocInit *pInit, Int sizeofInit, PAF_IALG_Config *p);
- Void (*commonPrint)(IALG_MemRec common[], PAF_IALG_Config *p);
- Void (*bufMemPrint)(Int z, Int size, Int heapId, Int bufType);
- Void (*memStatusPrint)(HeapMem_Handle hInternalHeap, HeapMem_Handle hInternal1Heap, HeapMem_Handle hExternalHeap, HeapMem_Handle hInternal1HeapShm);
-} PAF_ASIT_Fxns;
-
-// Audio Stream Input Task (ASIT) parameters
-typedef struct PAF_ASIT_Params {
- const PAF_ASIT_Fxns *fxns;
- struct {
- SmInt master;
- SmInt inputs;
- SmInt input1;
- SmInt inputN;
- SmInt decodes;
- SmInt decode1;
- SmInt decodeN;
- SmInt streams;
- SmInt stream1; /* unused */
- SmInt streamN; /* unused */
- SmInt encodes;
- SmInt encode1;
- SmInt encodeN;
- SmInt outputs;
- SmInt output1;
- SmInt outputN;
- } zone;
- const SmInt *inputsFromDecodes;
- const SmInt *outputsFromEncodes;
- struct {
- int *pHeapIdIntern; //int *pIntern;
- int *pHeapIdExtern; //int *pExtern;
- int *pHeapIdInpbuf; //int *pInpbuf;
- int *pHeapIdOutbuf; //int *pOutbuf;
- int *pHeapIdFrmbuf; //int *pFrmbuf;
- int *pHeapIdIntern1; //int *pIntern1;
- int clear;
- } heap;
- struct {
- const IALG_MemSpace *space;
- } common;
- const LgInt *z_rx_bufsiz;
- const LgInt *z_tx_bufsiz;
- const SmInt *z_numchan;
- MdInt framelength;
- const PAF_AudioFunctions *pAudioFrameFunctions;
- const struct PAF_ASP_ChainFxns *pChainFxns;
- const PAF_InpBufStatus *pInpBufStatus;
- const PAF_DecodeStatus * const *z_pDecodeStatus;
- const PAF_OutBufStatus *pOutBufStatus;
- const PAF_EncodeStatus * const *z_pEncodeStatus;
- const PAF_VolumeStatus *pVolumeStatus;
- const PAF_ASP_AlgKey *pDecAlgKey;
- const PAF_ASP_AlgKey *pEncAlgKey;
- const PAF_ASP_SioMap *pDecSioMap;
- const SmInt *streamsFromDecodes;
- const SmInt *streamsFromEncodes;
- const MdInt maxFramelength;
- const SmInt *streamOrder;
- const PAF_ASP_LinkInit * const (*i_inpLinkInit);
- const PAF_ASP_LinkInit * const (*i_outLinkInit);
- const PAF_ASP_outNumBufMap * const (*poutNumBufMap);
- const PAF_MetadataBufStatus *pMetadataBufStatus;
- const PAF_AudioFrameBufStatus *pAudioFrameBufStatus;
-} PAF_ASIT_Params;
-
-// Audio Stream Input Task (ASIT) patchs
-typedef struct PAF_ASIT_Patchs {
- const PAF_SIO_ParamsN * devinp;
- //const PAF_SIO_ParamsN * devout;
- //const PAF_ASP_LinkInit * const (*i_decLinkInit);
- //const PAF_ASP_LinkInit * const (*i_aspLinkInit)[GEARS];
- //const PAF_ASP_LinkInit * const (*i_encLinkInit);
-} PAF_ASIT_Patchs;
-
-// Audio Stream Input Task (ASIT) configuration
-typedef struct PAF_ASIT_Config {
- ACP_Handle acp;
- PAF_ASPM_Config *pAspmCfg; // ASIT/ASOT shared configuration
- PAF_AST_Config *pAstCfg; // ASIT/ASOT/ASDT shared configuration
-} PAF_ASIT_Config;
-
-
-// Purpose: Audio Stream Input Task Function for initialization of data pointers
-// by allocation of memory.
-Int
-PAF_ASIT_initPhaseMalloc(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for initialization of data values
-// from parameters.
-Int
-PAF_ASIT_initPhaseConfig(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for initialization of ACP by
-// instantiation of the algorithm.
-Int
-PAF_ASIT_initPhaseAcpAlg(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// (***) FL: re-visit this, ASIT/ASOT currently consider common memory independently.
-// Should simultaneously consider all algs in ASIT/ASOT.
-// Purpose: Audio Stream Input Task Function for allocation of common memory.
-Int
-PAF_ASIT_initPhaseCommon(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for initialization of ASP algorithms.
-Int
-PAF_ASIT_initPhaseAspAlg(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for initialization of data values
-// from parameters for Algorithm Keys.
-Int
-PAF_ASIT_initPhaseAlgKey(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for initialization of Decoder Output Circular Buffer.
-Int
-PAF_ASIT_initPhaseDecOpCircBuf(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for initialization of Input Devices.
-Int
-PAF_ASIT_initPhaseDevice(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-#if 0
-// Purpose: Audio Stream Task Function for initialization or reinitiali-
-// zation of the Audio Frame(s) by loading of data values of a
-// time-varying nature.
-Int
-PAF_AST_initFrame1(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_AST_Config *pC,
- Int z,
- Int apply
-);
-#endif
-
-// Purpose: Audio Stream Task Function for processing audio data to
-// determine the input type without output.
-Int
-PAF_ASIT_autoProcessing(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int inputTypeSelect,
- ALG_Handle pcmAlgMaster);
-
-// Purpose: Audio Stream Input Task Function for processing audio data.
-//
-Int
-PAF_ASIT_decodeProcessing(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int sourceSelect
-);
-
-// Purpose: Decoding Function for processing Decode Commands.
-Int
-PAF_ASIT_decodeCommand(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Decoding Function for reinitializing the decoding process.
-Int
-PAF_ASIT_decodeInit(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int sourceSelect
-);
-
-// Purpose: Decoding Function for processing information in a manner that
-// is common for both initial and subsequent frames of input data.
-Int
-PAF_ASIT_decodeInfo(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int frame,
- Int block
-);
-
-// Purpose: Decoding Function for processing information in a manner that
-// is unique to initial frames of input data.
-Int
-PAF_ASIT_decodeInfo1(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int frame,
- Int block
-);
-
-// Purpose: Decoding Function for processing information in a manner that
-// is unique to frames of input data other than the initial one.
-Int
-PAF_ASIT_decodeInfo2(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int frame,
- Int block
-);
-
-// Purpose: Decoding Function for processing that occurs subsequent to
-// information processing but antecedent to timing processing
-// for frames of input data other than the initial one.
-Int
-PAF_AST_decodeCont(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- ALG_Handle decAlg[],
- Int frame,
- Int block
-);
-
-// Purpose: Decoding Function for processing of input data by the
-// Decode Algorithm.
-Int
-PAF_ASIT_decodeDecode(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int sourceSelect,
- Int frame,
- Int block
-);
-
-// Purpose: Decoding Function for determining whether processing of the
-// current frame is complete.
-Int
-PAF_ASIT_decodeFinalTest(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int frame,
- Int block
-);
-
-// Purpose: Decoding Function for terminating the decoding process.
-Int
-PAF_ASIT_decodeComplete(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- ALG_Handle decAlg[],
- Int frame,
- Int block
-);
-
-// Purpose: Audio Stream Input Task Function for selecting the devices used
-// for input.
-Int
-PAF_ASIT_selectDevices(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Audio Stream Input Task Function for selecting the sources used
-// for decoding of input to output.
-Int
-PAF_ASIT_sourceDecode(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int x
-);
-
-// Purpose: Decoding Function for terminating output.
-Int
-PAF_AST_stopOutput(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC
-);
-
-// Purpose: Common Function for processing algorithm chains.
-Int
-PAF_AST_streamChainFunction(
- const PAF_ASIT_Params *pP,
- const PAF_ASIT_Patchs *pQ,
- PAF_ASIT_Config *pC,
- Int iChainFrameFxns,
- Int abortOnError,
- Int logArg
-);
-
-
-#endif /* _ASIP_H_ */