Aenc

Provides a simple interface to AUDENC (XDM 0.9) based algorithms. Typical example below (AAC, no error checking):. More...

Typedefs

typedef struct Aenc_Object * Aenc_Handle
 Handle through which to reference an Audio Encode algorithm.

Functions

Aenc_Handle Aenc_create (Engine_Handle hEngine, Char *codecName, AUDENC_Params *params, AUDENC_DynamicParams *dynParams)
 Creates an Audio Encode (XDM 0.9) algorithm instance.
Int Aenc_process (Aenc_Handle hAe, Buffer_Handle hInBuf, Buffer_Handle hOutBuf)
 Encodes an audio buffer.
Int Aenc_delete (Aenc_Handle hAe)
 Deletes an Audio Encode algorithm instance.
AUDENC_Handle Aenc_getVisaHandle (Aenc_Handle hAe)
 Get the AUDENC handle from the Aenc module instance.
Int32 Aenc_getInBufSize (Aenc_Handle hAe)
 Get the input buffer size required by the codec.
Int32 Aenc_getOutBufSize (Aenc_Handle hAe)
 Get the output buffer size required by the codec.

Variables

const AUDENC_Params Aenc_Params_DEFAULT
 Default XDM params for an Audio Encode algorithm.
const AUDENC_DynamicParams Aenc_DynamicParams_DEFAULT
 Default XDM dynamic params for an Audio Encode algorithm.

Detailed Description

Provides a simple interface to AUDENC (XDM 0.9) based algorithms. Typical example below (AAC, no error checking):.

     #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/Aenc.h>

     Aenc_Handle hAe;
     Buffer_Handle hOutBuf;
     Engine_Handle hEngine;
     AUDENC_Params params = Aenc_Params_DEFAULT;
     AUDENC_DynamicParams dynParams = Aenc_DynamicParams_DEFAULT;
     Buffer_Attrs bAttrs = Buffer_Attrs_DEFAULT;

     CERuntime_init();
     Dmai_init();
     hEngine = Engine_open("myengine", NULL, NULL);
     hAe = Aenc_create(hEngine, "aacenc", &params, &dynParams);
     hOutBuf = Buffer_create(Aenc_getOutBufSize(hAd), &bAttrs);
     hInBuf = Buffer_create(Aenc_getInBufSize(hAd), &bAttrs);

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

     Buffer_delete(hOutBuf);
     Buffer_delete(hInBuf);
     Aenc_delete(hAe);
     Engine_close(hEngine);

Typedef Documentation

typedef struct Aenc_Object* Aenc_Handle

Handle through which to reference an Audio Encode algorithm.


Function Documentation

Aenc_Handle Aenc_create ( Engine_Handle  hEngine,
Char *  codecName,
AUDENC_Params *  params,
AUDENC_DynamicParams *  dynParams 
)

Creates an Audio Encode (XDM 0.9) 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 Aenc_Handle).
NULL for failure.

Int Aenc_process ( Aenc_Handle  hAe,
Buffer_Handle  hInBuf,
Buffer_Handle  hOutBuf 
)

Encodes an audio buffer.

Parameters:
[in] hAe The Aenc_Handle to use for encoding.
[in] hInBuf The Buffer_Handle for the buffer containing the raw data.
[in] hOutBuf The Buffer_Handle for the buffer to fill with decoded data.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Aenc_create must be called before this function.

Int Aenc_delete ( Aenc_Handle  hAe  ) 

Deletes an Audio Encode algorithm instance.

Parameters:
[in] hAe The Aenc_Handle to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Aenc_create must be called before this function.

AUDENC_Handle Aenc_getVisaHandle ( Aenc_Handle  hAe  ) 

Get the AUDENC handle from the Aenc module instance.

Parameters:
[in] hAe The Aenc_Handle for which to get the AUDENC handle.
Return values:
Handle to the audio encode algorithm, see the XDM documentation for AUDENC.
Remarks:
Aenc_create must be called before this function.

Int32 Aenc_getInBufSize ( Aenc_Handle  hAe  ) 

Get the input buffer size required by the codec.

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

Int32 Aenc_getOutBufSize ( Aenc_Handle  hAe  ) 

Get the output buffer size required by the codec.

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


Variable Documentation

const AUDENC_Params Aenc_Params_DEFAULT

Default XDM params for an Audio Encode algorithm.

     size                     = sizeof(AUDENC_Params),
     encodingPreset           = XDM_DEFAULT,
     maxSampleRate            = 48000,
     maxBitrate               = 288000,
     maxNoOfCh                = IAUDIO_STEREO,
     dataEndianness           = XDM_LE_16

const AUDENC_DynamicParams Aenc_DynamicParams_DEFAULT

Default XDM dynamic params for an Audio Encode algorithm.

     size                     = sizeof(AUDENC_DynamicParams),
     inputFormat              = IAUDIO_INTERLEAVED,
     bitRate                  = 288000,
     sampleRate               = 48000,
     numChannels              = IAUDIO_STEREO,
     numLFEChannels           = 0,
     inputBitsPerSample       = 16


Copyright 2011, Texas Instruments Incorporated