MODIFICATION HISTORY:
Ver Who Date Changes ----- ------ -------- ------------------------------------------------------- 5.00a tb 02/27/12 Updated for RGB2YCRCB v5.00.a. 7.0 adk 01/07/14 Changed the file name from "rgb2ycrcb.c" to "xrgb2ycrcb.c".
Implemented the following functions: XRgb2YCrCb_CfgInitialize, XRgb2YCrCb_EnableDbgByPass, XRgb2YCrCb_IsDbgByPassEnabled, XRgb2YCrCb_DisableDbgBypass, XRgb2YCrCb_EnableDbgTestPattern, XRgb2YCrCb_IsDbgTestPatternEnabled, XRgb2YCrCb_DisableDbgTestPattern, XRgb2YCrCb_GetVersion, XRgb2YCrCb_GetDbgFrameCount, XRgb2YCrCb_GetDbgLineCount, XRgb2YCrCb_GetDbgPixelCount, XRgb2YCrCb_Setup, XRgb2YCrCb_SetActiveSize, XRgb2YCrCb_GetActiveSize, XRgb2YCrCb_SetYMax, XRgb2YCrCb_GetYMax, XRgb2YCrCb_SetYMin, XRgb2YCrCb_GetYMin, XRgb2YCrCb_SetCbMax, XRgb2YCrCb_GetCbMax, XRgb2YCrCb_SetCbMin, XRgb2YCrCb_GetCbMin, XRgb2YCrCb_SetCrMax, XRgb2YCrCb_GetCrMax, XRgb2YCrCb_SetCrMin, XRgb2YCrCb_GetCrMin, XRgb2YCrCb_SetYOffset, XRgb2YCrCb_GetYOffset, XRgb2YCrCb_SetCbOffset, XRgb2YCrCb_GetCbOffset, XRgb2YCrCb_SetCrOffset, XRgb2YCrCb_GetCrOffset, XRgb2YCrCb_SetCoefs, XRgb2YCrCb_GetCoefs, XRgb2YCrCb_Select_Standard, XRgb2YCrCb_Coefficient_Translation, XRgb2YCrCb_Select_OutputRange.
#include "xrgb2ycrcb.h"
int XRgb2YCrCb_CfgInitialize | ( | XRgb2YCrCb * | InstancePtr, | |
XRgb2YCrCb_Config * | CfgPtr, | |||
u32 | EffectiveAddr | |||
) |
This function initializes the Rgb2YCrCb core. This function must be called prior to using the Rgb2YCrCb core. Initialization of the Rgb2YCrCb includes setting up the instance data and ensuring the hardware is in a quiescent state.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CfgPtr | is a reference to a structure containing information about a specific XRgb2YCrCb driver. | |
EffectiveAddr | is the core base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the core 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. |
u32 XRgb2YCrCb_Coefficient_Translation | ( | XRgb2YCrCb * | InstancePtr, | |
struct XRgb2YCrCb_Coef_Inputs * | CoefIn, | |||
struct XRgb2YCrCb_Coef_Outputs * | CoefOut, | |||
u32 | DataWidth | |||
) |
This function translates the XRgb2YCrCb_Coef_Inputs structure into the XRgb2YCrCb_Coef_Outputs structure that can be used to program the core's registers. The XRgb2YCrCb_Coef_Inputs structure uses the same values as the core's GUIs. The XRgb2YCrCb_Coef_Outputs structure uses the values that can be programmed into the core's registers.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CoefIn | specifies a pointer to a XRgb2YCrCb_Coef_Inputs structure to be translated. | |
CoefOut | specifies a pointer to a XRgb2YCrCb_Coef_Outputs structure with translated values. | |
DataWidth | specifies a valid range of [8,10,12,16] that needs to be set. |
void XRgb2YCrCb_DisableDbgBypass | ( | XRgb2YCrCb * | InstancePtr | ) |
This function disables Bypass mode.
InstancePtr | is a pointer to the XRgb2YCrCb core instance to be worked on. |
void XRgb2YCrCb_DisableDbgTestPattern | ( | XRgb2YCrCb * | InstancePtr | ) |
This function disables debug test pattern mode.
InstancePtr | is a pointer to the XRgb2YCrCb core instance to be worked on. |
void XRgb2YCrCb_EnableDbgByPass | ( | XRgb2YCrCb * | InstancePtr | ) |
This function sets the bypass bit of control register to switch the core to bypass mode if debug is enabled in the IP.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
void XRgb2YCrCb_EnableDbgTestPattern | ( | XRgb2YCrCb * | InstancePtr | ) |
This function switches the core to test-pattern generator mode if debug feature is enabled.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
void XRgb2YCrCb_GetActiveSize | ( | XRgb2YCrCb * | InstancePtr, | |
u16 * | HSize, | |||
u16 * | VSize | |||
) |
This function gets the active H/V sizes of the Rgb2YCrCb core from active size register.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
HSize | is a pointer to 16-bit variable in which the number of Active Pixels per scanline is returned within the range [32, 7680]. | |
VSize | is a pointer to 16-bit variable in which the number of Active Lines per frame is returned within the range [32, 7680]. |
u32 XRgb2YCrCb_GetCbMax | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the maximum value on the Cb Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetCbMin | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the minimum value on the Cb Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetCbOffset | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the offset compensation value for the Cb Chroma channel.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
void XRgb2YCrCb_GetCoefs | ( | XRgb2YCrCb * | InstancePtr, | |
double * | ACoef, | |||
double * | BCoef, | |||
double * | CCoef, | |||
double * | DCoef | |||
) |
This function returns A, B, C and D coefficients.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
ACoef | is a pointer to double variable in which A coefficient is returned within the range [0.0 to 1.0]. | |
BCoef | is a pointer to double variable in which B coefficient is returned within the range [0.0 to 1.0]. | |
CCoef | is a pointer to double variable in which C coefficient is returned within the range [0.0 to 1.0]. | |
DCoef | is a pointer to double variable in which D coefficient is returned within the range [0.0 to 1.0]. |
u32 XRgb2YCrCb_GetCrMax | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the maximum value on the Cr Chroma channel of the output
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetCrMin | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the minimum value on the Cr Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetCrOffset | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the offset compensation value of the Cr Chroma channel.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetDbgFrameCount | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the frame count, the number of frames processed since power-up. This is available only if the debugging feature is enabled.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetDbgLineCount | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns Line count, the number of lines processed since power-up. This is available only if the debugging feature is enabled.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetDbgPixelCount | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the pixel count, the number of pixels processed since power up. This is available only if the debugging feature is enabled.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetVersion | ( | XRgb2YCrCb * | InstancePtr | ) |
This function facilitates software identification of exact version of the RGB2YCrCb hardware (h/w).
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetYMax | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the maximum value of the Luma (Y) channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetYMin | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the minimum value of the Luma (Y) channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
u32 XRgb2YCrCb_GetYOffset | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the offset compensation value for the Luma (Y) channel.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
int XRgb2YCrCb_IsDbgByPassEnabled | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the current bypass mode of a core.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
int XRgb2YCrCb_IsDbgTestPatternEnabled | ( | XRgb2YCrCb * | InstancePtr | ) |
This function returns the test-pattern generator mode (enabled or not), if debug feature is enabled.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
void XRgb2YCrCb_Select_OutputRange | ( | XRgb2YCrCb * | InstancePtr, | |
enum XRgb_OutputRanges | Range | |||
) |
This function governs the range of outputs Y, Cr and Cb by affecting the conversion coefficients as well as the clipping and clamping values.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
Range | needs to be set from the enum XRgb_OutputRanges values as: 0 = XRGB_TV_16_TO_240, 1 = XRGB_STUDIO_16_TO_235, 2 = XRGB_GRAPHICS_0_TO_255. |
void XRgb2YCrCb_Select_Standard | ( | XRgb2YCrCb * | InstancePtr, | |
enum XRgb_Standards | StandardSel, | |||
enum XRgb_OutputRanges | InputRange, | |||
u32 | DataWidth, | |||
struct XRgb2YCrCb_Coef_Inputs * | CoefIn | |||
) |
This function populates an XRgb2YCrCb_Coef_Inputs structure with the values from the selected video standard.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
StandardSel | needs to be set from enum XRgb_Standards value as : 0 = XRGB_STANDARD_ITU_601_SD 1 = XRGB_STANDARD_ITU_709_NTSC 2 = XRGB_STANDARD_ITU_709_PAL 3 = XRGB_STANDARD_YUV. | |
InputRange | needs to be set from enum XRgb_OutputRanges value as: 0 = XRGB_TV_16_TO_240, 1 = XRGB_STUDIO_16_TO_235, 2 = XRGB_GRAPHICS_0_TO_255. | |
DataWidth | specifies the valid range of [8,10,12,16] that needs to be set. | |
CoefIn | specifies a pointer to a XRgb2YCrCb_Coef_Inputs structure which is populated with the values from selected video standard. |
void XRgb2YCrCb_SetActiveSize | ( | XRgb2YCrCb * | InstancePtr, | |
u16 | HSize, | |||
u16 | VSize | |||
) |
This function sets active H/V sizes in the active size register.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
HSize | specifies the number of Active Pixels per scanline that needs to be set within the range [32, 7680]. | |
VSize | specifies the number of Active Lines per frame that needs to be set within the range [32, 7680]. |
void XRgb2YCrCb_SetCbMax | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | CbMax | |||
) |
This function sets the maximum value allowed on the Cb Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CbMax | specifies the maximum value within range [0, 255] of Cb Chroma channel that needs to be set. |
void XRgb2YCrCb_SetCbMin | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | CbMin | |||
) |
This function sets the minimum value allowed on the Cb Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CbMin | specifies the maximum value within range [0, 255] of Cb Chroma channel needs to set. |
void XRgb2YCrCb_SetCbOffset | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | CbOffset | |||
) |
This function sets the offset compensation value for the Cb Chroma channel.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CbOffset | specifies the compensation value within range [0, 255] of Cb Chroma channel that needs to be set. |
void XRgb2YCrCb_SetCoefs | ( | XRgb2YCrCb * | InstancePtr, | |
double | ACoef, | |||
double | BCoef, | |||
double | CCoef, | |||
double | DCoef | |||
) |
This function sets A, B, C and D coefficients.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
ACoef | specifies the A coefficient value within the range [0.0 to 1.0] that needs to be set. | |
BCoef | specifies the B coefficient value within the range [0.0 to 1.0] that needs to be set. | |
CCoef | specifies the C coefficient value within the range [0.0 to 1.0] that needs to be set. | |
DCoef | specifies the D coefficient value within the range [0.0 to 1.0] that needs to be set. |
void XRgb2YCrCb_SetCrMax | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | CrMax | |||
) |
This function sets the maximum value allowed on the Cr Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CrMax | specifies the maximum value within range [0, 255] of Cr Chroma channel that needs to be set. |
void XRgb2YCrCb_SetCrMin | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | CrMin | |||
) |
This function sets the minimum value allowed on the Cr Chroma channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CrMin | specifies the minimum value within range [0, 255] of Cr Chroma channel that needs to be set. |
void XRgb2YCrCb_SetCrOffset | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | CrOffset | |||
) |
This function sets the offset compensation value for the Cr Chroma channel.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
CrOffset | specifies the compensation value within range [0, 255] of Cr Chroma channel that needs to be set. |
void XRgb2YCrCb_Setup | ( | XRgb2YCrCb * | InstancePtr | ) |
This function sets up double buffered ACTIVE_SIZE register and enables the register update.
InstancePtr | is a pointer to the XRgb2YCrCb instance. |
void XRgb2YCrCb_SetYMax | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | YMax | |||
) |
This function sets the maximum value allowed on the Luma (Y) channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
YMax | specifies the maximum value within range [0, 255] of Luma channel that needs to be set. |
void XRgb2YCrCb_SetYMin | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | YMin | |||
) |
This function sets the minimum value allowed on the Luma (Y) channel of the output.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
YMin | specifies the minimum value within range [0, 255] of Luma channel that needs to be set. |
void XRgb2YCrCb_SetYOffset | ( | XRgb2YCrCb * | InstancePtr, | |
u32 | YOffset | |||
) |
This function sets the offset compensation value for the Luma (Y) channel.
InstancePtr | is a pointer to the XRgb2YCrCb instance. | |
YOffset | specifies the compensation value within range [0, 255] of Luma channel that needs to be set. |
Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.