⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isphenc.h

📁 TI Algorithm Soft Kit 5.10 仅包括实例及其原代码
💻 H
字号:
/*  *  Copyright 2006 *  Texas Instruments Incorporated * *  All rights reserved.  Property of Texas Instruments Incorporated *  Restricted rights to use, duplicate or disclose this code are *  granted through contract. *  *//** *  @file       ti/xdais/dm/isphenc.h * *  @brief      This header defines all types, constants, and functions *              shared by all implementations of the speech/voice encoder *              algorithms. *//** *  @defgroup   ti_xdais_dm_ISPHENC    xDM 0.9 Speech/Voice Encoder Interface * *  This is the 0.9 xDM Speech/Voice Encoder Interface. */#ifndef ISPHENC_#define ISPHENC_#include <ti/xdais/ialg.h>#include <ti/xdais/xdas.h>#include "xdm.h"#include "ispeech.h"#ifdef __cplusplusextern "C" {#endif/** @ingroup    ti_xdais_dm_ISPHENC *//*@{*/#define ISPHENC_CID      "ti.xdais.dm.ISPHENC"  /**< ISPHENC Class ID */#define ISPHENC_ERUNTIME  XDM_ERUNTIME          /**< @copydoc XDM_ERUNTIME */#define ISPHENC_EOK       XDM_EOK               /**< @copydoc XDM_EOK */#define ISPHENC_EFAIL     XDM_EFAIL             /**< @copydoc XDM_EFAIL *//** *  @brief      This must be the first field of all ISPHENC *              instance objects. */typedef struct ISPHENC_Obj {    struct ISPHENC_Fxns *fxns;} ISPHENC_Obj;/** *  @brief      Opaque handle to an ISPHENC objects. */typedef struct ISPHENC_Obj  *ISPHENC_Handle;/** *  @brief      Defines the creation time parameters for *              all ISPHENC instance objects. * *  @remarks    The application should set the parameters to 0 to use *              the algorithm's default values. * *  @remarks    This structure may be extended by individual codec *              implementation allowing customization with vendor *              specific parameters.  The presence of vendor specific *              extensions will be detected by the value of *              the @c size parameter. * *  @remarks    The @c size field @b must be correctly set by the caller. */typedef struct ISPHENC_Params {    XDAS_Int32 size;            /**< Size of this structure in bytes.                                 *   Because this structure can be extended,                                 *   this field @b must be correctly set                                 *   by the caller.                                 */    XDAS_Int32 frameSize;       /**< Input frame size in bytes                                 *   for sample based codecs.                                 */    XDAS_Int32 compandingLaw;   /**< Companding Law.                                 *   See #ISPEECH_CompoundLaw.                                 */    XDAS_Int32 packingType;     /**< Packing Format Option (for codecs                                 *   that support multiple packing formats -                                 *   used for selection, 0, 1, 2...)                                 */    XDAS_Int32 vadSelection;    /**< VAD A/VAD B, VAD 1/ VAD 2 etc */} ISPHENC_Params;/** *  @brief      This structure defines the codec parameters that can be *              modified after creation via control() calls. * *  @remarks    It is not necessary that given implementation support all *              dynamic parameters to be configurable at run time.  If a *              particular algorithm does not support run-time updates to *              a parameter that the application is attempting to change *              at runtime, it may indicate this as an error. * *  @remarks    The @c size field @b must be correctly set by the caller. */typedef struct ISPHENC_DynamicParams {    XDAS_Int32 size;            /**< Size of this structure in bytes.                                 *   Because this structure can be extended,                                 *   this field @b must be correctly set                                 *   by the caller.                                 */    XDAS_Int32 frameSize;       /**< Input frame size in bytes for sample                                 *   based codecs.                                 */    XDAS_Int32 bitRate;         /**< Rate selection for multi_rate codecs  */    XDAS_Int32 mode;            /**< Mode selection for multi_mode codecs  */    XDAS_Int32 vadFlag;         /**< VAD_On =1, VAD_OFF = 0 */    XDAS_Int32 noiseSuppressionMode; /**< 0 - OFF, 1 = NS-A, 2 = NS-B  etc */    XDAS_Int32 ttyTddMode;      /**< 0 = TTY OFF, 1 = 45.45bauds 2 = 50 bauds */    XDAS_Int32 dtmfMode;        /**< 0 = DTMF_OFF, 1 = DTMF_ON */    XDAS_Int32 dataTransmit;    /**< 1 = ON, 0 = OFF */    XDAS_Int32 homingMode;      /**< 0 - DISABLED; 1 - ENABLED */} ISPHENC_DynamicParams;/** *  @brief      Defines the input arguments for all ISPHENC instance *              process function. * *  @remarks    This structure may be extended by individual codec *              implementation allowing customization with vendor *              specific parameters. * *  @remarks    The @c size field @b must be correctly set by the caller. */typedef struct ISPHENC_InArgs {    XDAS_Int32 size;            /**< Size of this structure in bytes.                                 *   Because this structure can be extended,                                 *   this field @b must be correctly set                                 *   by the caller.                                 */    XDAS_Int32 nullTrafficChannel; /**< 1 = ON, 0 = OFF */} ISPHENC_InArgs;/** *  @brief      Defines instance status parameters (read-only). * *  @remarks    This structure may be extended by individual codec *              implementation allowing customization with vendor *              specific parameters. * *  @remarks    The @c size field @b must be correctly set by the caller. */typedef struct ISPHENC_Status {    XDAS_Int32 size;            /**< Size of this structure in bytes.                                 *   Because this structure can be extended,                                 *   this field @b must be correctly set                                 *   by the caller.                                 */    XDAS_Int32 extendedError;   /**< @copydoc XDM_ErrorBit. */    XDAS_Int32 frameSize;       /**< Input frame size in bytes for sample based codecs */    XDAS_Int32 bitRate;         /**< Rate selection for multi_rate codecs  */    XDAS_Int32 mode;            /**< Mode selection for multi_mode codecs  */    XDAS_Int32 vadFlag;         /**< VAD_On =1, VAD_OFF = 0 */    XDAS_Int32 noiseSuppressionMode; /**< 0 - OFF, 1 = NS-A, 2 = NS-B  etc */    XDAS_Int32 ttyTddMode;      /**< 0 = TTY OFF, 1 = 45.45bauds 2 = 50 bauds */    XDAS_Int32 dtmfMode;        /**< 0 = DTMF_OFF, 1 = DTMF_ON */    XDAS_Int32 dataTransmit;    /**< 1 = ON, 0 = OFF */    XDAS_Int32 homingMode;      /**< 0 - DISABLED; 1 - ENABLED */    XDM_AlgBufInfo  bufInfo;    /**< Input and output buffer information.                                 *   See #XDM_AlgBufInfo.                                 */} ISPHENC_Status;/** *  @brief      Defines the run time output arguments for *              all ISPHENC instance objects. * *  @remarks    This structure may be extended by individual codec *              implementations allowing customization with vendor *              specific parameters. * *  @remarks    The @c size field @b must be correctly set by the caller. */typedef struct ISPHENC_OutArgs {    XDAS_Int32 size;            /**< Size of this structure in bytes.                                 *   Because this structure can be extended,                                 *   this field @b must be correctly set                                 *   by the caller.                                 */    XDAS_Int32   rate;          /**< Current frame bit rate. */    XDAS_Int32   frameType;     /**< Current frame type.  */    XDAS_Int32   outbufferSize; /**< Output buffer size in bytes. */} ISPHENC_OutArgs;/** *  @brief      Defines the control commands for the ISPHENC module. * *  @remarks    This ID can be extended in IMOD interface for *              additional controls. * *  @sa         XDM_CmdId */typedef  IALG_Cmd ISPHENC_Cmd;/** *  @brief      Defines all of the operations on ISPHENC objects. */typedef struct ISPHENC_Fxns{    IALG_Fxns   ialg;             /**< Traditional xDAIS algorithm interface. *//** *  @brief      Basic speech/voice encoding call. * *  @param[in]  handle          Handle to an algorithm instance. *  @param[in]  inBufs          Input buffer descriptors. *  @param[in,out] outBufs      Output buffer descriptors.  The algorithm *                              may modify the output buffer pointers. *  @param[in]  inArgs          Input arguments.  This is a required *                              parameter. *  @param[out] outArgs         Ouput results.  This is a required parameter. * *  @pre        @c inArgs must not be NULL, and must point to a valid *              ISPHENC_InArgs structure. * *  @pre        @c outArgs must not be NULL, and must point to a valid *              ISPHENC_OutArgs structure. * *  @pre        @c inBufs must not be NULL, and must point to a valid *              XDM_BufDesc structure. * *  @pre        @c inBufs.buf[0] must not be NULL, and must point to a valid *              buffer of data that is at least @c inBufs.bufSizes[0] bytes in *              length. * *  @pre        @c outBufs must not be NULL, and must point to a valid *              XDM_BufDesc structure. * *  @pre        @c outBufs.buf[0] must not be NULL, and must point to a valid *              buffer of data that is at least @c outBufs.bufSizes[0] bytes in *              length. * *  @post       The algorithm *must* not modify the contents of @c inBufs. *              That is, the data and buffers *              pointed to by these parameters must be treated as read-only. * *  @retval     IALG_EOK        Success. *  @retval     IALG_EFAIL      Failure.  See ISPHENC_OutArgs#extendedError *                              for more detailed further error conditions. */    XDAS_Int32  (*process)(ISPHENC_Handle handle,  XDM_BufDesc *inBufs,            XDM_BufDesc *outBufs, ISPHENC_InArgs *inArgs,            ISPHENC_OutArgs *outArgs);/** *  @brief      Control behaviour of an algorithm. * *  @param[in]  handle          Handle to an algorithm instance. *  @param[in]  id              Command id.  See #XDM_CmdId. *  @param[in]  params          Dynamic parameters.  This is a required *                              parameter. *  @param[out] status          Output results.  This is a required parameter. * *  @pre        @c params must not be NULL, and must point to a valid *              ISPHENC_DynamicParams structure. * *  @pre        @c status must not be NULL, and must point to a valid *              ISPHENC_Status structure. * *  @post       The algorithm *must* not modify the contents of @c params. *              That is, the data pointed to by this parameter must be *              treated as read-only. * *  @retval     IALG_EOK        Success. *  @retval     IALG_EFAIL      Failure.  See ISPHENC_Status#extendedError *                              for more detailed further error conditions. */    XDAS_Int32  (*control)(ISPHENC_Handle handle, ISPHENC_Cmd id,            ISPHENC_DynamicParams *params, ISPHENC_Status *status);} ISPHENC_Fxns;/*@}*/#ifdef __cplusplus}#endif#endif  /* ISPHENC_ *//* *  @(#) ti.xdais.dm; 1, 0, 1, 0,46; 10-18-2006 19:11:35; /db/wtree/library/trees/dais-g07x/src/ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -