Senc1

Provides a simple interface to SPHENC1 (XDM 1.0) based algorithms. More...

Typedefs

typedef struct Senc1_Object * Senc1_Handle
 Handle through which to reference a Speech Encode algorithm.

Functions

Senc1_Handle Senc1_create (Engine_Handle hEngine, Char *codecName, SPHENC1_Params *params, SPHENC1_DynamicParams *dynParams)
 Creates a Speech Encode (XDM 1.0) algorithm instance.
Int Senc1_process (Senc1_Handle hSe1, Buffer_Handle hInBuf, Buffer_Handle hOutBuf)
 Encodes a Speech buffer.
Int Senc1_delete (Senc1_Handle hSe1)
 Deletes a Speech Encode algorithm instance.
SPHENC1_Handle Senc1_getVisaHandle (Senc1_Handle hSe1)
 Get the SPHENC1 handle from the Senc1 module instance.
Int32 Senc1_getInBufSize (Senc1_Handle hSe1)
 Get the input buffer size required by the codec.
Int32 Senc1_getOutBufSize (Senc1_Handle hSe1)
 Get the output buffer size required by the codec.

Variables

const SPHENC1_Params Senc1_Params_DEFAULT
 Default XDM parameters for a Speech Encode algorithm.
const SPHENC1_DynamicParams Senc1_DynamicParams_DEFAULT
 Default XDM dynamic parameters for a Speech Decode algorithm.

Detailed Description

Provides a simple interface to SPHENC1 (XDM 1.0) based algorithms.

Release Support: G711, G726, G729 and ILBC. Due to defects in G711 Encoder v 1.11.001 and ILBC Encoder v 1.10.002, this release will not work with these versions.

Typical usage:

     #include <xdc/std.h>
     #include <ti/sdo/ce/Engine.h>
     #include <ti/sdo/ce/CERuntime.h>
     #include <ti/sdo/dmai/Dmai.h>
     #include <ti/sdo/dmai/Buffer.h>
     #include <ti/sdo/dmai/ce/Senc1.h>

     Senc1_Handle hSe1;
     Buffer_Handle hOutBuf;
     Buffer_Handle hInBuf;
     Engine_Handle hEngine;
     SPHENC1_Params params = Senc1_Params_DEFAULT;
     SPHENC1_DynamicParams dynParams = Senc1_DynamicParams_DEFAULT;
     Buffer_Attrs bAttrs = Buffer_Attrs_DEFAULT;

     CERuntime_init();
     Dmai_init();
     hEngine = Engine_open("myengine", NULL, NULL);
     hSe1 = Senc1_create(hEngine, "mycodec", &params, &dynParams);
     hOutBuf = Buffer_create(Senc1_getOutBufSize(hSe), &bAttrs);
     hInBuf = Buffer_create(Senc1_getInBufSize(hSe), &bAttrs);

     // Fill hInBuf with raw samples
     Senc1_process(hSe1, hInBuf, hOutBuf);
     // encoded data now available in hOutBuf.

     Buffer_delete(hOutBuf);
     Buffer_delete(hInBuf);
     Senc1_delete(hSe);
     Engine_close(hEngine);

Typedef Documentation

typedef struct Senc1_Object* Senc1_Handle

Handle through which to reference a Speech Encode algorithm.


Function Documentation

Senc1_Handle Senc1_create ( Engine_Handle  hEngine,
Char *  codecName,
SPHENC1_Params *  params,
SPHENC1_DynamicParams *  dynParams 
)

Creates a Speech Encode (XDM 1.0) algorithm instance.

Parameters:
[in] hEngine An opened engine containing the algorithm to create.
[in] codecName The name of the algorithm to open. Corresponds to the string name given in the .cfg file.
[in] params XDM parameters to use while creating the codec.
[in] dynParams XDM dynamic parameters to use while creating the codec.
Return values:
Handle for use in subsequent operations (see Senc1_Handle).
NULL for failure.

Int Senc1_process ( Senc1_Handle  hSe1,
Buffer_Handle  hInBuf,
Buffer_Handle  hOutBuf 
)

Encodes a Speech buffer.

Parameters:
[in] hSe1 The Senc1_Handle to use for decoding.
[in] hInBuf The Buffer_Handle for the buffer containing the raw data.
[in] hOutBuf The Buffer_Handle for the buffer to fill with encoded data.
Return values:
DMAI_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Senc1_create must be called before this function.

Int Senc1_delete ( Senc1_Handle  hSe1  ) 

Deletes a Speech Encode algorithm instance.

Parameters:
[in] hSe1 The Senc1_Handle to delete.
Return values:
DMAI_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Senc1_create must be called before this function.

SPHENC1_Handle Senc1_getVisaHandle ( Senc1_Handle  hSe1  ) 

Get the SPHENC1 handle from the Senc1 module instance.

Parameters:
[in] hSe1 The Senc1_Handle for which to get the SPHENC1 handle.
Return values:
Handle to the speech1 encode algorithm, see the XDM documentation for SPHENC1.
Remarks:
Senc1_create must be called before this function.

Int32 Senc1_getInBufSize ( Senc1_Handle  hSe1  ) 

Get the input buffer size required by the codec.

Parameters:
[in] hSe1 The Senc1_Handle for which to get the buffer size.
Return values:
Size in bytes of the input buffer required.
Remarks:
Senc1_create must be called before this function.

Int32 Senc1_getOutBufSize ( Senc1_Handle  hSe1  ) 

Get the output buffer size required by the codec.

Parameters:
[in] hSe1 The Senc1_Handle for which to get the buffer size.
Return values:
Size in bytes of the output buffer required.
Remarks:
Senc1_create must be called before this function.


Variable Documentation

const SPHENC1_Params Senc1_Params_DEFAULT

Default XDM parameters for a Speech Encode algorithm.

     size                 = sizeof(SPHENC1_Params),
     frameSize            = 160,
     compandingLaw        = 1,
     packingType          = 0,
     vadSelection         = 0,
     codecSelection       = 0,
     bitRate              = 0,
     reserved             = 0,
     **tablesPtr          = NULL,

const SPHENC1_DynamicParams Senc1_DynamicParams_DEFAULT

Default XDM dynamic parameters for a Speech Decode algorithm.

     size                 = sizeof(SPHENC1_DynamicParams),
     frameSize            = 0,
     bitRate              = 0,
     mode                 = 0,
     vadFlag              = ISPEECH1_VADFLAG_DEFAULT,
     noiseSuppressionMode = 0,
     ttyTddMode           = 0,
     dtmfMode             = 0,
     dataTransmit         = 0,
     reserved             = 0,


Copyright 2011, Texas Instruments Incorporated