Venc1

Provides a simple interface to VIDENC1 (XDM 1.0) based algorithms. For typical usage see the video_encode_io1 app. More...

Typedefs

typedef struct Venc1_Object * Venc1_Handle
 Handle through which to reference a Video Encode algorithm.

Functions

Venc1_Handle Venc1_create (Engine_Handle hEngine, Char *codecName, VIDENC1_Params *params, VIDENC1_DynamicParams *dynParams)
 Creates a Video Encode (XDM 0.9) algorithm instance.
Int Venc1_process (Venc1_Handle hVe, Buffer_Handle hInBuf, Buffer_Handle hOutBuf)
 Encodes a video buffer.
Int Venc1_delete (Venc1_Handle hVe)
 Deletes a Video Encode algorithm instance.
Int32 Venc1_getInBufSize (Venc1_Handle hVe)
 After a Venc1_create call is made, this function can be called to figure out the total size of the required input buffer.
Int32 Venc1_getOutBufSize (Venc1_Handle hVe)
 After a Venc1_create call is made, this function can be called to figure out the min total size of the required output buffers.
VIDENC1_Handle Venc1_getVisaHandle (Venc1_Handle hVe)
 Get the VIDENC1 handle from the Venc module instance.
IVIDEO1_BufDesc * Venc1_getReconBufs (Venc1_Handle hVe)
 Get the reconstructed frame buffers created during the call to Venc1_process.
Buffer_Handle Venc1_getFreeBuf (Venc1_Handle hVe)
 After a Venc1_process call is made, this function should be called to obtain the freed raw buffers.
Void Venc1_setBufTab (Venc1_Handle hVe, BufTab_Handle hBufTab)
 After a Venc1_create call is made, this function should be called to hand a BufTab_Handle to the video encoder instance. Because of B-frames, the input buffer given may not be the same as the input buffer returned, so the Venc1 class needs a full array of input buffers to work with.
BufTab_Handle Venc1_getBufTab (Venc1_Handle hVe)
 Get the BufTab previously set using Venc1_setBufTab.
Int Venc1_flush (Venc1_Handle hVe)
 Flushes the codec. Call Venc1_process after this call.

Variables

const VIDENC1_Params Venc1_Params_DEFAULT
 Default XDM parameters for a Video Encode algorithm.
const VIDENC1_DynamicParams Venc1_DynamicParams_DEFAULT
 Default XDM dynamic parameters for a Video Encode algorithm.

Detailed Description

Provides a simple interface to VIDENC1 (XDM 1.0) based algorithms. For typical usage see the video_encode_io1 app.


Typedef Documentation

typedef struct Venc1_Object* Venc1_Handle

Handle through which to reference a Video Encode algorithm.


Function Documentation

Venc1_Handle Venc1_create ( Engine_Handle  hEngine,
Char *  codecName,
VIDENC1_Params *  params,
VIDENC1_DynamicParams *  dynParams 
)

Creates a Video 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 Venc1_Handle).
NULL for failure.

Int Venc1_process ( Venc1_Handle  hVe,
Buffer_Handle  hInBuf,
Buffer_Handle  hOutBuf 
)

Encodes a video buffer.

Parameters:
[in] hVe The Venc1_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 encoded data.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Venc1_create must be called before this function.

The lineLength setting in the input buffer will be passed as the framePitch in the IVIDEO1_BufDescIn parameter to VIDENC1_process. However, not the codecs may not recognize or use this framePitch setting. See IVIDENC1_DynamicParams::captureWidth for setting the frame pitch, and refer to your encoder user's guide for more information on area encode operations.

Int Venc1_delete ( Venc1_Handle  hVe  ) 

Deletes a Video Encode algorithm instance.

Parameters:
[in] hVe The Venc1_Handle to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Int32 Venc1_getInBufSize ( Venc1_Handle  hVe  ) 

After a Venc1_create call is made, this function can be called to figure out the total size of the required input buffer.

Parameters:
[in] hVe The Venc1_Handle to get the size for.
Return values:
Size in bytes of the input buffer.
Remarks:
Venc1_create must be called before this function.

Int32 Venc1_getOutBufSize ( Venc1_Handle  hVe  ) 

After a Venc1_create call is made, this function can be called to figure out the min total size of the required output buffers.

Parameters:
[in] hVe The Venc1_Handle to get the size for.
Return values:
Bytes in total for all output planes.
Remarks:
Venc1_create must be called before this function.

VIDENC1_Handle Venc1_getVisaHandle ( Venc1_Handle  hVe  ) 

Get the VIDENC1 handle from the Venc module instance.

Parameters:
[in] hVe The Venc1_Handle for which to get the VIDENC1 handle.
Return values:
Handle to the audio decode algorithm, see the XDM documentation for VIDENC1.
Remarks:
Venc1_create must be called before this function.

IVIDEO1_BufDesc* Venc1_getReconBufs ( Venc1_Handle  hVe  ) 

Get the reconstructed frame buffers created during the call to Venc1_process.

Parameters:
[in] hVe The Venc1_Handle for which to get the VIDENC1 handle.
Return values:
Pointer to the IVIDEO1_BufDesc object that contains information about reconstructed frames. This is equivalent to the outArgs.reconBufs member created during VIDENC1_process.
Remarks:
Venc1_process must be called before this function. The object pointed to by the return value becomes invalid after any subsequent call to Venc1_process.

Buffer_Handle Venc1_getFreeBuf ( Venc1_Handle  hVe  ) 

After a Venc1_process call is made, this function should be called to obtain the freed raw buffers.

Parameters:
[in] hVe The Venc1_Handle to obtain display buffers from.
Return values:
Handle to a free Buffer (see Buffer_Handle).
NULL if no more Buffers are available.
Remarks:
Venc1_create must be called before this function.

Venc1_process must be called before this function.

Void Venc1_setBufTab ( Venc1_Handle  hVe,
BufTab_Handle  hBufTab 
)

After a Venc1_create call is made, this function should be called to hand a BufTab_Handle to the video encoder instance. Because of B-frames, the input buffer given may not be the same as the input buffer returned, so the Venc1 class needs a full array of input buffers to work with.

Parameters:
[in] hVe The Venc1_Handle to set the BufTab for.
[in] hBufTab The BufTab_Handle to give to the video encoder.
Remarks:
Venc1_create must be called before this function.

BufTab_Handle Venc1_getBufTab ( Venc1_Handle  hVe  ) 

Get the BufTab previously set using Venc1_setBufTab.

Parameters:
[in] hVe The Venc1_Handle for which to get the BufTab.
Return values:
Handle to the BufTab managing the codec buffers (see BufTab_Handle).
Remarks:
Venc1_create must be called before this function.

Venc1_setBufTab must be called before this function.

Int Venc1_flush ( Venc1_Handle  hVe  ) 

Flushes the codec. Call Venc1_process after this call.

Parameters:
[in] hVe The Venc1_Handle to the encoder to flush.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Venc1_create must be called before this function.


Variable Documentation

const VIDENC1_Params Venc1_Params_DEFAULT

Default XDM parameters for a Video Encode algorithm.

     size                     = sizeof(VIDENC1_Params),
     encodingPreset           = XDM_DEFAULT,
     rateControlPreset        = IVIDEO_LOW_DELAY,
     maxHeight                = 720,
     maxWidth                 = 1280,
     maxFrameRate             = 30000,
     maxBitRate               = 6000000,
     dataEndianness           = XDM_BYTE,
     maxInterFrameInterval    = 0,
     inputChromaFormat        = XDM_YUV_420P,
     inputContentType         = IVIDEO_PROGRESSIVE,
     reconChromaFormat        = XDM_CHROMA_NA

const VIDENC1_DynamicParams Venc1_DynamicParams_DEFAULT

Default XDM dynamic parameters for a Video Encode algorithm.

     size                     = sizeof(IVIDENC1_DynamicParams),
     inputHeight              = 720,
     inputWidth               = 1280,
     refFrameRate             = 30000,
     targetFrameRate          = 30000,
     targetBitRate            = 6000000,
     intraFrameInterval       = 30,
     generateHeader           = XDM_DECODE_AU,
     captureWidth             = 0,
     forceFrame               = IVIDEO_NA_FRAME,
     interFrameInterval       = 1,
     mbDataFlag               = 0


Copyright 2011, Texas Instruments Incorporated