Smooth

Reduces interlacing artifacts on a buffer. When capturing a frame from an interlaced medium, it actually consists of two fields 1/60s apart (D1 NTSC example). If an encoder that does not support interlaced frames, such as H.264 BP or MPEG4 SP is used on this buffer, suboptimal quality and performance will likely result. This Smooth module helps preprocess the buffer for use with such an encoder. Typical usage (no error checking):. More...

Data Structures

struct  Smooth_Attrs
 Attributes used to create a Smooth job. More...

Typedefs

typedef struct Smooth_Object * Smooth_Handle
 Handle through which to reference a Smooth job.

Functions

Smooth_Handle Smooth_create (Smooth_Attrs *attrs)
 Creates a Smooth job.
Int Smooth_config (Smooth_Handle hSmooth, Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
 Configure a Smooth job.
Int Smooth_execute (Smooth_Handle hSmooth, Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
 Execute a Smooth job.
Int Smooth_delete (Smooth_Handle hSmooth)
 Deletes a Smooth job.

Variables

const Smooth_Attrs Smooth_Attrs_DEFAULT
 Default attributes for a Smooth job.

Detailed Description

Reduces interlacing artifacts on a buffer. When capturing a frame from an interlaced medium, it actually consists of two fields 1/60s apart (D1 NTSC example). If an encoder that does not support interlaced frames, such as H.264 BP or MPEG4 SP is used on this buffer, suboptimal quality and performance will likely result. This Smooth module helps preprocess the buffer for use with such an encoder. Typical usage (no error checking):.

   #include <xdc/std.h>
   #include <ti/sdo/dmai/Dmai.h>
   #include <ti/sdo/dmai/Smooth.h>
   #include <ti/sdo/dmai/Buffer.h>
   #include <ti/sdo/dmai/Capture.h>

   Capture_Attrs cAttrs = Capture_Attrs_DM6446_DM355_DEFAULT;
   Smooth_Attrs smAttrs = Smooth_Attrs_DEFAULT;
   Buffer_Attrs bAttrs = Buffer_Attrs_DEFAULT;

   Dmai_init();
   Capture_Handle hCap = Capture_create(NULL, &cAttrs);
   hBuf = Buffer_clone(BufTab_getBuf(Capture_getBufTab(hCap), 0));
   Smooth_Handle hSmooth = Smooth_create(&smAttrs);
   Smooth_config(BufTab_getBuf(Capture_getBufTab(hCap), 0), hBuf);
   while (1) {
       Capture_get(hCap, &cBuf);
       Smooth_execute(cBuf, 0, hBuf, 0);
       // Further process the capture buffer, now smoothed in "hBuf"..
       Capture_put(hCap, cBuf);
   }
   Buffer_delete(hBuf);
   Smooth_delete(hSmooth);
   Capture_delete(hCap);

Typedef Documentation

typedef struct Smooth_Object* Smooth_Handle

Handle through which to reference a Smooth job.


Function Documentation

Smooth_Handle Smooth_create ( Smooth_Attrs attrs  ) 

Creates a Smooth job.

Parameters:
[in] attrs Smooth_Attrs to use for creating the Smooth job.
Return values:
Handle for use in subsequent operations (see Smooth_Handle).
NULL for failure.

Int Smooth_config ( Smooth_Handle  hSmooth,
Buffer_Handle  hSrcBuf,
Buffer_Handle  hDstBuf 
)

Configure a Smooth job.

Parameters:
[in] hSmooth The Smooth_Handle of the job to configure.
[in] hSrcBuf The source buffer to configure for. Note that only the buffer properties are accessed, the pointers are not used.
[in] hDstBuf The destination buffer to configure for. Note that only the buffer properties are accessed, the pointers are not used.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Int Smooth_execute ( Smooth_Handle  hSmooth,
Buffer_Handle  hSrcBuf,
Buffer_Handle  hDstBuf 
)

Execute a Smooth job.

Parameters:
[in] hSmooth The Smooth_Handle of the job to execute.
[in] hSrcBuf The Buffer_Handle of the source buffer to copy from.
[in] hDstBuf The Buffer_Handle of the destination buffer to copy to.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.

Int Smooth_delete ( Smooth_Handle  hSmooth  ) 

Deletes a Smooth job.

Parameters:
[in] hSmooth The Smooth_Handle of the job to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.


Variable Documentation

Default attributes for a Smooth job.

    rszRate   = 0xe


Copyright 2011, Texas Instruments Incorporated