Software Drivers

xdeint.c File Reference


Detailed Description

This is main code of Xilinx Vide Deinterlacer core. Please see xdeint.h for more details of the driver.

 MODIFICATION HISTORY:

 Ver   Who  Date     Changes
 ----- ---- -------- ------------------------------------------------------
 1.00a rjh  07/10/11 First release
 2.00a rjh  18/01/12 Updated for v_deinterlacer 2.00
 3.2   adk  02/13/14 Changed the prototype of XDeint_GetVersion
                     Implemented the following functions:
                     XDeint_GetFramestore
                     XDeint_GetVideo
                     XDeint_GetThresholds
                     XDeint_GetPulldown
                     XDeint_GetSize
 

#include "xdeint.h"
#include "xil_assert.h"

Functions

int XDeint_ConfigInitialize (XDeint *InstancePtr, XDeint_Config *CfgPtr, u32 EffectiveAddr)
void XDeint_SetFramestore (XDeint *InstancePtr, u32 FieldAddr1, u32 FieldAddr2, u32 FieldAddr3, u32 FrameSize)
void XDeint_SetVideo (XDeint *InstancePtr, u32 Packing, u32 Color, u32 Order, u32 PSF)
void XDeint_SetThresholds (XDeint *InstancePtr, u32 ThresholdT1, u32 ThresholdT2)
void XDeint_SetPulldown (XDeint *InstancePtr, u32 Enable_32, u32 Enable_22)
u32 XDeint_GetVersion (XDeint *InstancePtr)
void XDeint_SetSize (XDeint *InstancePtr, u32 Width, u32 Height)
void XDeint_GetVideo (XDeint *InstancePtr, u32 *Packing, u32 *Color, u32 *Order, u32 *PSF)
void XDeint_GetPulldown (XDeint *InstancePtr, u32 *Enable_32, u32 *Enable_22)
void XDeint_GetSize (XDeint *InstancePtr, u32 *Width, u32 *Height)
void XDeint_GetThresholds (XDeint *InstancePtr, u32 *ThresholdT1, u32 *ThresholdT2)
void XDeint_GetFramestore (XDeint *InstancePtr, u32 *FieldAddr1, u32 *FieldAddr2, u32 *FieldAddr3, u32 *FrameSize)


Function Documentation

int XDeint_ConfigInitialize ( XDeint InstancePtr,
XDeint_Config CfgPtr,
u32  EffectiveAddr 
)

This function initializes the Deinterlacer core. This function must be called prior to using a Deinterlacer core. Initialization of the Deinterlacer includes setting up the instance data, and ensuring the hardware is in a quiescent state.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
CfgPtr points to the configuration structure associated with the Deinterlacer core.
EffectiveAddr is the base address of the core. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
Returns:
  • XST_SUCCESS if initialization was successful.
Note:
None.

void XDeint_GetFramestore ( XDeint InstancePtr,
u32 *  FieldAddr1,
u32 *  FieldAddr2,
u32 *  FieldAddr3,
u32 *  FrameSize 
)

This function gets input field buffer addresses of an Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
FieldAddr1 is the pointer to the 1st input field buffer.
FieldAddr2 is the pointer to the 2nd input field buffer.
FieldAddr3 is the pointer to the 3rd input field buffer.
FrameSize is the pointer to size in 32bit words of a single field buffer.
Returns:
None.
Note:
None.

void XDeint_GetPulldown ( XDeint InstancePtr,
u32 *  Enable_32,
u32 *  Enable_22 
)

This function gets the pull down controller of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Enable_32 is a pointer which holds status of Enable_32 mode.
  • FALSE = Disabled.
  • TRUE = Enabled.
Enable_22 is a pointer which holds status of Enable_22 mode.
  • FALSE = Disabled.
  • TRUE = Enabled.
Returns:
None.
Note:
None.

void XDeint_GetSize ( XDeint InstancePtr,
u32 *  Width,
u32 *  Height 
)

This function gets the input frame size of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Width is pointer to the width of the frame.
Height is pointer to the height of the frame.
Returns:
None.
Note:
None.

void XDeint_GetThresholds ( XDeint InstancePtr,
u32 *  ThresholdT1,
u32 *  ThresholdT2 
)

This function gets the threshold used by the motion adaptive kernel.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
ThresholdT1 is the pointer to lower threshold of the motion kernel.
ThresholdT2 is the pointer to upper threshold of the motion kernel.
Returns:
None.

u32 XDeint_GetVersion ( XDeint InstancePtr  ) 

This function returns the contents of Version register.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Returns:
Returns the contents of the version register.
Note:
None.

void XDeint_GetVideo ( XDeint InstancePtr,
u32 *  Packing,
u32 *  Color,
u32 *  Order,
u32 *  PSF 
)

This function gets the video format of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Packing is a pointer to 32 bit variable which holds Packaging format.
  • 0 4:2:0 Packging is used.
  • XDEINT_MODE_PACKING_0 4:2:2 Packging is used.
  • XDEINT_MODE_PACKING_1 4:4:4 Packging is used.
Color is a pointer to 32 bit varaible which holds color value.
  • 0 YUV color space is used.
  • XDEINT_MODE_COL RGB color space is used.
Order is a pointer to 32 bit varaible which holds Field order.
  • 0 the field order maps to PAL/HD/3G.
  • XDEINT_MODE_FIELD_ORDER the field order maps to NTSC/480i
PSF is a pointer to 32 bit variable which says whether Psf enabled or disabled.
  • XDEINT_MODE_PSF_ENABLE for psf enable.
Returns:
None.
Note:
None.

void XDeint_SetFramestore ( XDeint InstancePtr,
u32  FieldAddr1,
u32  FieldAddr2,
u32  FieldAddr3,
u32  FrameSize 
)

This function sets the input field buffer addresses of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
FieldAddr1 is the address of the 1st input field buffer.
FieldAddr2 is the address of the 2nd input field buffer.
FieldAddr3 is the address of the 3rd input field buffer.
FrameSize is the size in 32bit words of a single field buffer.
Returns:
None.
Note:
None.

void XDeint_SetPulldown ( XDeint InstancePtr,
u32  Enable_32,
u32  Enable_22 
)

This function sets the pull down controller of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Enable_32 allows detectors to automatically control Deinterlacer core.
  • 1 Pull down enable 3:2
Enable_22 allows detectors to automatically control Deinterlacer core.
  • 1 Pull down enable 2:2
Returns:
None.
Note:
None.

void XDeint_SetSize ( XDeint InstancePtr,
u32  Width,
u32  Height 
)

This function sets the input frame size of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Width is the width of the frame.
Height is the height of the frame.
Returns:
None.
Note:
None.

void XDeint_SetThresholds ( XDeint InstancePtr,
u32  ThresholdT1,
u32  ThresholdT2 
)

This function sets the threshold used by the motion adaptive kernel of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
ThresholdT1 is the lower threshold of the motion kernel.
ThresholdT2 is the upper threshold of the motion kernel.
Returns:
None.
Note:
None.

void XDeint_SetVideo ( XDeint InstancePtr,
u32  Packing,
u32  Color,
u32  Order,
u32  PSF 
)

This function sets the video format of the Deinterlacer core.

Parameters:
InstancePtr is a pointer to XDeint instance to be worked on.
Packing selects the XSVI video packing mode.
  • 0 4:2:0 Packging is used.
  • XDEINT_MODE_PACKING_0 4:2:2 Packging is used.
  • XDEINT_MODE_PACKING_1 4:4:4 Packging is used.
Color selects what color space to use.
  • 0 YUV color space is used.
  • XDEINT_MODE_COL RGB color space is used.
Order selects which field ordering is being used.
  • 0 the field order maps to PAL/HD/3G.
  • XDEINT_MODE_FIELD_ORDER the field order maps to NTSC/480i
PSF enables psf (progressive segmented frame mode).
  • XDEINT_MODE_PSF_ENABLE for psf enable.
Returns:
None.
Note:
None.

Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.