Software Drivers

xcresample.c File Reference


Detailed Description

This file contains the implementation of the interface functions for the Chroma Resampler core. Refer to the header file xcresample.h for more detailed information.
 MODIFICATION HISTORY:

 Ver   Who    Date     Changes
 ----- ------ -------- ----------------------------------------------------
 1.00a gaborz 08/04/11 Updated for CRESAMPLE V1.0
 2.00a vyc    04/24/12 Updated for CRESAMPLE V2.00.a
 2.00a vyc    07/25/12 Switched from Xuu3232 to u32
 2.00a vyc    10/16/12 Switch order of functions to remove compile warning
 4.0   adk    03/12/14 Changed the filename cresample.c to xcresample.c.
                       The Following functions are removed:
                       clear_coef_values, configure_444_to_422,
                       configure_422_to_444, configure_422_to_420,
                       configure_420_to_422, configure_444_to_420 and
                       configure_420_to_444.
                       Implemented the following functions :
                       StubCallBack, StubErrorCallBack,
                       XCresample_CfgInitialize,
                       XCresample_GetVersion, XCresample_EnableDbgByPass,
                       XCresample_IsDbgByPassEnabled,
                       XCresample_DisableDbgByPass,
                       XCresample_SetDbgTestPattern,
                       XCresample_IsDbgTestPatternEnabled,
                       XCresample_DisableDbgTestPattern
                       XCresample_GetDbgFrameCount,
                       XCresample_GetDbgLineCount,
                       XCresample_GetDbgPixelCount,
                       XCresample_SetActiveSize, XCresample_GetActiveSize,
                       XCresample_SetFieldParity, XCresample_GetFieldParity,
                       XCresample_SetChromaParity,
                       XCresample_GetChromaParity
                       XCresample_SetHCoefs, XCresample_GetHCoefs,
                       XCresample_SetVCoefs, XCresample_GetVCoefs,
                       XCresample_Clear_HCoef_Values, and
                       XCresample_Clear_VCoef_Values.

 

#include "xcresample.h"

Functions

int XCresample_CfgInitialize (XCresample *InstancePtr, XCresample_Config *CfgPtr, u32 EffectiveAddr)
void XCresample_EnableDbgByPass (XCresample *InstancePtr)
int XCresample_IsDbgByPassEnabled (XCresample *InstancePtr)
void XCresample_DisableDbgBypass (XCresample *InstancePtr)
void XCresample_EnableDbgTestPattern (XCresample *InstancePtr)
int XCresample_IsDbgTestPatternEnabled (XCresample *InstancePtr)
void XCresample_DisableDbgTestPattern (XCresample *InstancePtr)
u32 XCresample_GetVersion (XCresample *InstancePtr)
u32 XCresample_GetDbgFrameCount (XCresample *InstancePtr)
u32 XCresample_GetDbgLineCount (XCresample *InstancePtr)
u32 XCresample_GetDbgPixelCount (XCresample *InstancePtr)
void XCresample_SetActiveSize (XCresample *InstancePtr, u16 HSize, u16 VSize)
void XCresample_GetActiveSize (XCresample *InstancePtr, u16 *HSize, u16 *VSize)
void XCresample_SetFieldParity (XCresample *InstancePtr, u8 FieldParity)
u8 XCresample_GetFieldParity (XCresample *InstancePtr)
void XCresample_SetChromaParity (XCresample *InstancePtr, u8 ChromaParity)
u8 XCresample_GetChromaParity (XCresample *InstancePtr)
void XCresample_SetHCoefs (XCresample *InstancePtr, XHorizontal_Coeffs *Coeff, u32 Phases)
void XCresample_GetHCoefs (XCresample *InstancePtr, XHorizontal_Coeffs *Coeff)
void XCresample_SetVCoefs (XCresample *InstancePtr, XVertical_Coeffs *Coeff, u32 Phases)
void XCresample_GetVCoefs (XCresample *InstancePtr, XVertical_Coeffs *Coeff)
void XCresample_Clear_HCoef_Values (XCresample *InstancePtr)
void XCresample_Clear_VCoef_Values (XCresample *InstancePtr)


Function Documentation

int XCresample_CfgInitialize ( XCresample InstancePtr,
XCresample_Config CfgPtr,
u32  EffectiveAddr 
)

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

Parameters:
InstancePtr is a pointer to the XCresample instance.
CfgPtr is a reference to a structure containing information about a specific Chroma Resampler driver.
EffectiveAddr is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.
Returns:
- XST_SUCCESS if initialization was successful.
Note:
None.

void XCresample_Clear_HCoef_Values ( XCresample InstancePtr  ) 

This function clears all horizontal coefficients of the Chroma Resampler core which are previously set.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
None.
Note:
None.

void XCresample_Clear_VCoef_Values ( XCresample InstancePtr  ) 

This function clears all vertical coefficients of a the Chroma Resampler which are previously set.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
None.
Note:
None.

void XCresample_DisableDbgBypass ( XCresample InstancePtr  ) 

This function disables bypass mode of the Chroma Resampler core.

Parameters:
InstancePtr is a pointer to the XCresample instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCresample_DisableDbgTestPattern ( XCresample InstancePtr  ) 

This function disables debug test pattern mode in Control register of the Chroma Resampler core, if Debug feature is enabled.

Parameters:
InstancePtr is a pointer to the XCresample instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCresample_EnableDbgByPass ( XCresample InstancePtr  ) 

This function enables the bypass mode by setting bypass bit of the Control register to switch the core to bypass mode if debug feature is enabled in the core.

Parameters:
InstancePtr is a pointer to the XCresample instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCresample_EnableDbgTestPattern ( XCresample InstancePtr  ) 

This function enables the test-pattern mode if debug feature is enabled by setting test-pattern bit of the Control register of the Chroma Resampler core.

Parameters:
InstancePtr is a pointer to the XCresample instance to be worked on.
Returns:
None.
Note:
Debug functionality should be enabled.

void XCresample_GetActiveSize ( XCresample InstancePtr,
u16 *  HSize,
u16 *  VSize 
)

This function gets the number of Active Pixels per Scan line and number of Active Lines per Frame from the Active Size register.

Parameters:
InstancePtr is a pointer to the XCresample instance.
HSize is a pointer to 16-bit variable in which the number of Active Pixels per Scan Line is returned (Range is 32 to 7680).
VSize is a pointer to 16-bit variable in which the number of Active Lines per Frame is returned (Range is 32 to 7680).
Returns:
None.
Note:
None.

u8 XCresample_GetChromaParity ( XCresample InstancePtr  ) 

This function returns the value of chroma parity of the Chroma Resampler core from Encoding register.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
Chroma parity value is returned.
  • 0 - Chroma information on Odd or First line.
  • 1 - Chroma information on Even lines.
Note:
None.

u32 XCresample_GetDbgFrameCount ( XCresample InstancePtr  ) 

This function returns the number of frames processed since power-up or last time the core is reset.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
FrameCount is the number of frames processed since power-up.
Note:
Debug functionality should be enabled.

u32 XCresample_GetDbgLineCount ( XCresample InstancePtr  ) 

This function returns the number of lines processed since power-up or last time the core is reset.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
LineCount is the number of lines processed since power-up.
Note:
Debug functionality should be enabled.

u32 XCresample_GetDbgPixelCount ( XCresample InstancePtr  ) 

This function returns the number of pixels processed since power-up or last time the core is reset.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
PixelCount is the number of pixels processed since power-up.
Note:
Debug functionality should be enabled.

u8 XCresample_GetFieldParity ( XCresample InstancePtr  ) 

This function returns the field parity value of the Chroma Resampler core from Encoding register.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
Field parity value is returned. 0 - for even or bottom field. 1 - for odd or top field.
Note:
None.

void XCresample_GetHCoefs ( XCresample InstancePtr,
XHorizontal_Coeffs Coeff 
)

This function gets the coefficient values from all the Horizontal Coefficient registers of phase0 and phase1 of the Chroma Resampler core.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Coeff is a pointer to the structure XHorizontal_Coeffs which has horizontal coefficients of both phases.(Phase 0 and Phase 1) in which coefficients are updated. Range of coefficient values is [-2, 2).
Returns:
None.
Note:
For pre defined fixed coefficients filter values, ConvertType should be set with 1.

void XCresample_GetVCoefs ( XCresample InstancePtr,
XVertical_Coeffs Coeff 
)

This function gets the vertical coefficient values of the Chroma Resampler core from all Vertical Coefficient registers of phase0 and phase1.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Coeff is a pointer to the structure XVertical_Coeffs which has vertical coefficients of both phases.(Phase 0 and Phase 1) in which coefficients are updated. Range of coefficient values is [-2, 2).
Returns:
None.
Note:
For pre defined fixed coefficients filter values, ConvertType should be set with 1.

u32 XCresample_GetVersion ( XCresample InstancePtr  ) 

This function returns the version of the Chroma Resampler core.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Returns:
Content of Version register is returned..
Note:
None.

int XCresample_IsDbgByPassEnabled ( XCresample InstancePtr  ) 

This function returns the current bypass mode settings from Control register of the Chroma Resampler core.

Parameters:
InstancePtr is a pointer to the XCresample instance to be worked on.
Returns:
Core debug bypass mode.
  • TRUE = Bypass mode is enabled.
  • FALSE = Bypass mode is not enabled.
Note:
Debug functionality should be enabled.

int XCresample_IsDbgTestPatternEnabled ( XCresample InstancePtr  ) 

This function returns the test-pattern mode (enabled or not) from Control register of the Chroma Resampler core.

Parameters:
InstancePtr is a pointer to the XCresample instance to be worked on.
Returns:
Test-pattern generator mode.
  • TRUE = Test-pattern mode is enabled.
  • FALSE = Test-pattern mode is not enabled.
Note:
Debug functionality should be enabled.

void XCresample_SetActiveSize ( XCresample InstancePtr,
u16  HSize,
u16  VSize 
)

This function sets the active H/V sizes in the Active Size register.

Parameters:
InstancePtr is a pointer to the XCresample instance.
HSize specifies the number of Active Pixels per Scan Line that needs to be set (Range is 32 to 7680).
VSize specifies the number of Active Lines per Frame that needs to be set (Range is 32 to 7680).
Returns:
None.
Note:
None.

void XCresample_SetChromaParity ( XCresample InstancePtr,
u8  ChromaParity 
)

This functions sets the Chroma parity value of the Chroma Resampler core in the Encoding register.

Parameters:
InstancePtr is a pointer to the XCresample instance.
ChromaParity specifies the parity value which needs to be set.(0 or 1).
  • 0 - Chroma information on Odd or First line.
  • 1 - Chroma information on Even lines.
Returns:
None.
Note:
None.

void XCresample_SetFieldParity ( XCresample InstancePtr,
u8  FieldParity 
)

This functions sets the field parity value of the Chroma Resampler core in the Encoding register.

Parameters:
InstancePtr is a pointer to the XCresample instance.
FieldParity specifies the parity value which needs to be set.(0 or 1).
  • 0 - for even or bottom field.
  • 1 - for odd or top field.
Returns:
None.
Note:
To this feature need to use interlaced video.

void XCresample_SetHCoefs ( XCresample InstancePtr,
XHorizontal_Coeffs Coeff,
u32  Phases 
)

This function sets the horizontal coefficient values of the Chroma Resampler core for phase 0 or phase 1 or both phases.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Coeff is a pointer to the structure XHorizontal_Coeffs which has horizontal coefficients of both phases (Phase 0 and Phase 1) which needs to be set. Range of coefficient values is [-2, 2).
Phases specifies number of phases needs to be set.
  • 0 - Phase 0.
  • 1 - Phase 1.
  • 2 - Phase 0 and Phase 1.
Returns:
None.
Note:
For pre defined fixed coefficients filter values, ConvertType should be set with 1.

void XCresample_SetVCoefs ( XCresample InstancePtr,
XVertical_Coeffs Coeff,
u32  Phases 
)

This function sets the vertical coefficient values of the Chroma Resampler for phase 0 or for phase 1 or for both phases.

Parameters:
InstancePtr is a pointer to the XCresample instance.
Coeff is a pointer to the structure XHorizontal_Coeffs which has vertical coefficients of both phases (Phase 0 and Phase 1) which needs to be set.
Phases specifies number of phases needs to be set.
  • 0 - Phase 0.
  • 1 - Phase 1.
  • 2 - Phase 0 and Phase 1.
Returns:
None.
Note:
For pre defined fixed coefficients filter values, ConvertType should be set with 1.

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