Aenc1

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

Typedefs

typedef struct Aenc1_Object * Aenc1_Handle
 Handle through which to reference an Audio Encode algorithm.

Functions

Aenc1_Handle Aenc1_create (Engine_Handle hEngine, Char *codecName, AUDENC1_Params *params, AUDENC1_DynamicParams *dynParams)
 Creates an Audio Encode (XDM 0.9) algorithm instance.
Int Aenc1_process (Aenc1_Handle hAe, Buffer_Handle hInBuf, Buffer_Handle hOutBuf)
 Sends XDM_FLUSH command to codec to notify it is the last frame which must be padded with zeros. after this call Aenc1_process to encode last frame.
Int Aenc1_delete (Aenc1_Handle hAe)
 Deletes an Audio Encode algorithm instance.
AUDENC1_Handle Aenc1_getVisaHandle (Aenc1_Handle hAe)
 Get the AUDENC1 handle from the Aenc1 module instance.
Int32 Aenc1_getInBufSize (Aenc1_Handle hAe)
 Get the input buffer size required by the codec.
Int32 Aenc1_getOutBufSize (Aenc1_Handle hAe)
 Get the output buffer size required by the codec.

Variables

const AUDENC1_Params Aenc1_Params_DEFAULT
 Default XDM params for an Audio Encode algorithm.
const AUDENC1_DynamicParams Aenc1_DynamicParams_DEFAULT
 Default XDM dynamic params for an Audio Encode algorithm.

Detailed Description

Provides a simple interface to AUDENC1 (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/Aenc1.h>

     Aenc1_Handle hAe;
     Buffer_Handle hOutBuf;
     Engine_Handle hEngine;
     AUDENC1_Params params = Aenc1_Params_DEFAULT;
     AUDENC1_DynamicParams dynParams = Aenc1_DynamicParams_DEFAULT;
     Buffer_Attrs bAttrs = Buffer_Attrs_DEFAULT;

     CERuntime_init();
     Dmai_init();
     hEngine = Engine_open("myengine", NULL, NULL);
     hAe = Aenc1_create(hEngine, "aacenc", &params, &dynParams);
     hOutBuf = Buffer_create(Aenc1_getOutBufSize(hAe), &bAttrs);
     hInBuf = Buffer_create(Aenc1_getInBufSize(hAe), &bAttrs);

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

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

Typedef Documentation

typedef struct Aenc1_Object* Aenc1_Handle

Handle through which to reference an Audio Encode algorithm.


Function Documentation

Aenc1_Handle Aenc1_create ( Engine_Handle  hEngine,
Char *  codecName,
AUDENC1_Params *  params,
AUDENC1_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 Aenc1_Handle).
NULL for failure.

Int Aenc1_process ( Aenc1_Handle  hAe,
Buffer_Handle  hInBuf,
Buffer_Handle  hOutBuf 
)

Sends XDM_FLUSH command to codec to notify it is the last frame which must be padded with zeros. after this call Aenc1_process to encode last frame.

Parameters:
[in] hAe The Aenc1_Handle of the encoder to flush.
[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:
Aenc1_create must be called before this function.

Int Aenc1_delete ( Aenc1_Handle  hAe  ) 

Deletes an Audio Encode algorithm instance.

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

AUDENC1_Handle Aenc1_getVisaHandle ( Aenc1_Handle  hAe  ) 

Get the AUDENC1 handle from the Aenc1 module instance.

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

Int32 Aenc1_getInBufSize ( Aenc1_Handle  hAe  ) 

Get the input buffer size required by the codec.

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

Int32 Aenc1_getOutBufSize ( Aenc1_Handle  hAe  ) 

Get the output buffer size required by the codec.

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


Variable Documentation

const AUDENC1_Params Aenc1_Params_DEFAULT

Default XDM params for an Audio Encode algorithm.

     size                     = sizeof(AUDENC1_Params),
     sampleRate               = 48000,
     bitRate                  = 288000,
     channelMode              = IAUDIO_2_0,
     dataEndianness           = XDM_LE_16,
     encMode                  = IAUDIO_CBR,
     inputFormat              = IAUDIO_INTERLEAVED,
     inputBitsPerSample       = 16,
     maxBitRate               = 192000,
     dualMonoMode             = IAUDIO_DUALMONO_LR,
     crcFlag                  = XDAS_FALSE,
     ancFlag                  = XDAS_FALSE,
     lfeFlag                  = XDAS_FALSE

const AUDENC1_DynamicParams Aenc1_DynamicParams_DEFAULT

Default XDM dynamic params for an Audio Encode algorithm.

     size                     = sizeof(AUDENC1_DynamicParams),
     bitRate                  = 128000,
     sampleRate               = 48000,
     channelMode              = IAUDIO_2_0,
     lfeFlag                  = XDAS_FALSE,
     dualMonoMode             = IAUDIO_DUALMONO_LR,
     inputBitsPerSample       = 16


Copyright 2011, Texas Instruments Incorporated