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

	/* Verify arguments. */
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(ACoef != NULL);
	Xil_AssertVoid(BCoef != NULL);
	Xil_AssertVoid(CCoef != NULL);
	Xil_AssertVoid(DCoef != NULL);

	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_ACOEF_OFFSET));
	*ACoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));

	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_BCOEF_OFFSET));
	*BCoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));

	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_CCOEF_OFFSET));
	*CCoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));

	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_DCOEF_OFFSET));
	*DCoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));
}
/*****************************************************************************/
/**
*
* This function returns A, B, C and D coefficients.
*
* @param	InstancePtr is a pointer to the XRgb2YCrCb instance.
* @param	ACoef is a pointer to double variable in which A coefficient is
*		returned within the range [0.0 to 1.0].
* @param	BCoef is a pointer to double variable in which B coefficient is
*		returned within the range [0.0 to 1.0].
* @param	CCoef is a pointer to double variable in which C coefficient is
*		returned within the range [0.0 to 1.0].
* @param	DCoef is a pointer to double variable in which D coefficient is
*		returned within the range [0.0 to 1.0].
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function returns A, B, C and D coefficients.
This function returns A B C and D coefficients .
void XRgb2YCrCb_GetCoefs(XRgb2YCrCb *InstancePtr, double *ACoef, double *BCoef,
				double *CCoef, double *DCoef)
{
	u32 CoefVal;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(ACoef != NULL);
	Xil_AssertVoid(BCoef != NULL);
	Xil_AssertVoid(CCoef != NULL);
	Xil_AssertVoid(DCoef != NULL);
	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_ACOEF_OFFSET));
	*ACoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));
	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_BCOEF_OFFSET));
	*BCoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));
	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_CCOEF_OFFSET));
	*CCoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));
	CoefVal = XRgb2YCrCb_ReadReg(InstancePtr->Config.BaseAddress,
					(XRGB_DCOEF_OFFSET));
	*DCoef = (double)CoefVal /
			(double)(1 << (XRGB_16_BIT_COEF_SHIFT));
}
void XRgb2YCrCb_GetCoefs ( XRgb2YCrCb * InstancePtr , double * ACoef , double * BCoef , double * CCoef , double * DCoef ) { u32 CoefVal ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( ACoef != NULL ) ; Xil_AssertVoid ( BCoef != NULL ) ; Xil_AssertVoid ( CCoef != NULL ) ; Xil_AssertVoid ( DCoef != NULL ) ; CoefVal = XRgb2YCrCb_ReadReg ( InstancePtr -> Config . BaseAddress , ( XRGB_ACOEF_OFFSET ) ) ; * ACoef = ( double ) CoefVal / ( double ) ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ; CoefVal = XRgb2YCrCb_ReadReg ( InstancePtr -> Config . BaseAddress , ( XRGB_BCOEF_OFFSET ) ) ; * BCoef = ( double ) CoefVal / ( double ) ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ; CoefVal = XRgb2YCrCb_ReadReg ( InstancePtr -> Config . BaseAddress , ( XRGB_CCOEF_OFFSET ) ) ; * CCoef = ( double ) CoefVal / ( double ) ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ; CoefVal = XRgb2YCrCb_ReadReg ( InstancePtr -> Config . BaseAddress , ( XRGB_DCOEF_OFFSET ) ) ; * DCoef = ( double ) CoefVal / ( double ) ( 1 << ( XRGB_16_BIT_COEF_SHIFT ) ) ; }
This function returns A, B, C and D coefficients.
This function returns A B C and D coefficients .
/* Verify arguments. */