XilinxProcessorIPLib/drivers/rgb2ycrcb/src/xrgb2ycrcb.c
void XRgb2YCrCb_SetCoefs(XRgb2YCrCb *InstancePtr, double ACoef, double BCoef,
				double CCoef, double DCoef)
{
	u32 CoefVal;

	/* Verify arguments. */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid((ACoef >= 0.000) && (ACoef <= 1.000));
	Xil_AssertVoid((BCoef >= 0.000) && (BCoef <= 1.000));
	Xil_AssertVoid((CCoef >= 0.000) && (CCoef <= 1.000));
	Xil_AssertVoid((DCoef >= 0.000) && (DCoef <= 1.000));

	CoefVal = (u32)((ACoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_ACOEF_OFFSET), CoefVal);

	CoefVal = (u32)((BCoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_BCOEF_OFFSET), CoefVal);

	CoefVal = (u32)((CCoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_CCOEF_OFFSET), CoefVal);

	CoefVal = (u32)((DCoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_DCOEF_OFFSET), CoefVal);
}
/*****************************************************************************/
/**
*
* This function sets A, B, C and D coefficients.
*
* @param	InstancePtr is a pointer to the XRgb2YCrCb instance.
* @param	ACoef specifies the A coefficient value within the range
*		[0.0 to 1.0] that needs to be set.
* @param	BCoef specifies the B coefficient value within the range
*		[0.0 to 1.0] that needs to be set.
* @param	CCoef specifies the C coefficient value within the range
*		[0.0 to 1.0] that needs to be set.
* @param	DCoef specifies the D coefficient value within the range
*		[0.0 to 1.0] that needs to be set.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function sets A, B, C and D coefficients.
This function sets A B C and D coefficients .
void XRgb2YCrCb_SetCoefs(XRgb2YCrCb *InstancePtr, double ACoef, double BCoef,
				double CCoef, double DCoef)
{
	u32 CoefVal;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid((ACoef >= 0.000) && (ACoef <= 1.000));
	Xil_AssertVoid((BCoef >= 0.000) && (BCoef <= 1.000));
	Xil_AssertVoid((CCoef >= 0.000) && (CCoef <= 1.000));
	Xil_AssertVoid((DCoef >= 0.000) && (DCoef <= 1.000));
	CoefVal = (u32)((ACoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_ACOEF_OFFSET), CoefVal);
	CoefVal = (u32)((BCoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_BCOEF_OFFSET), CoefVal);
	CoefVal = (u32)((CCoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_CCOEF_OFFSET), CoefVal);
	CoefVal = (u32)((DCoef) * (1 << (XRGB_16_BIT_COEF_SHIFT)));
	XRgb2YCrCb_WriteReg(InstancePtr->Config.BaseAddress,
					(XRGB_DCOEF_OFFSET), CoefVal);
}
void XRgb2YCrCb_SetCoefs ( XRgb2YCrCb * InstancePtr , double ACoef , double BCoef , double CCoef , double DCoef ) { u32 CoefVal ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( ( ACoef >= 0.000 ) && ( ACoef <= 1.000 ) ) ; Xil_AssertVoid ( ( BCoef >= 0.000 ) && ( BCoef <= 1.000 ) ) ; Xil_AssertVoid ( ( CCoef >= 0.000 ) && ( CCoef <= 1.000 ) ) ; Xil_AssertVoid ( ( DCoef >= 0.000 ) && ( DCoef <= 1.000 ) ) ; CoefVal = ( u32 ) ( ( ACoef ) * ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ) ; XRgb2YCrCb_WriteReg ( InstancePtr -> Config . BaseAddress , ( XRGB_ACOEF_OFFSET ) , CoefVal ) ; CoefVal = ( u32 ) ( ( BCoef ) * ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ) ; XRgb2YCrCb_WriteReg ( InstancePtr -> Config . BaseAddress , ( XRGB_BCOEF_OFFSET ) , CoefVal ) ; CoefVal = ( u32 ) ( ( CCoef ) * ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ) ; XRgb2YCrCb_WriteReg ( InstancePtr -> Config . BaseAddress , ( XRGB_CCOEF_OFFSET ) , CoefVal ) ; CoefVal = ( u32 ) ( ( DCoef ) * ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ) ; XRgb2YCrCb_WriteReg ( InstancePtr -> Config . BaseAddress , ( XRGB_DCOEF_OFFSET ) , CoefVal ) ; }
This function sets A, B, C and D coefficients.
This function sets A B C and D coefficients .
/* Verify arguments. */