XilinxProcessorIPLib/drivers/v_hscaler/src/xv_hscaler_l2.c
int XV_HScalerValidateConfig(XV_Hscaler_l2 *InstancePtr,
                             u32 cformatIn,
                             u32 cformatOut)
{
  u32 lo, hi;

  if(cformatIn==XVIDC_CSF_YCRCB_422 && !XV_HscalerIs422Enabled(InstancePtr)) {
    return(FALSE);
  }

  if(cformatIn==XVIDC_CSF_RGB && !XV_HscalerIsCscEnabled(InstancePtr) && cformatOut!=XVIDC_CSF_RGB) {
    return(FALSE);
  }

  if(cformatIn != XVIDC_CSF_RGB) {
    lo = (XV_HscalerIsCscEnabled(InstancePtr)) ? XVIDC_CSF_RGB : XVIDC_CSF_YCRCB_444;
    hi = (XV_HscalerIs420Enabled(InstancePtr)) ? XVIDC_CSF_YCRCB_420 : ((XV_HscalerIs422Enabled(InstancePtr)) ? XVIDC_CSF_YCRCB_422 : XVIDC_CSF_YCRCB_444);
    if (cformatOut<lo || cformatOut>hi )
    {
      return(FALSE);
    }
  }
  return(TRUE);
}
/*****************************************************************************/
/**
* This function checks if the given input and output color formats
* are valid configuration parameters for this instance
*
* @param  InstancePtr is a pointer to the core instance to be worked on.
* @param  cformat is the input stream color format
* @param  cformatOut is the output stream color format
*
* @return TRUE if the requested setup parameters are valid
*         FALSE otherwise
*
******************************************************************************/
This function checks if the given input and output color formats
are valid configuration parameters for this instance
This function checks if the given input and output color formats are valid configuration parameters for this instance
int XV_HScalerValidateConfig(XV_Hscaler_l2 *InstancePtr,
                             u32 cformatIn,
                             u32 cformatOut)
{
  u32 lo, hi;
  if(cformatIn==XVIDC_CSF_YCRCB_422 && !XV_HscalerIs422Enabled(InstancePtr)) {
    return(FALSE);
  }
  if(cformatIn==XVIDC_CSF_RGB && !XV_HscalerIsCscEnabled(InstancePtr) && cformatOut!=XVIDC_CSF_RGB) {
    return(FALSE);
  }
  if(cformatIn != XVIDC_CSF_RGB) {
    lo = (XV_HscalerIsCscEnabled(InstancePtr)) ? XVIDC_CSF_RGB : XVIDC_CSF_YCRCB_444;
    hi = (XV_HscalerIs420Enabled(InstancePtr)) ? XVIDC_CSF_YCRCB_420 : ((XV_HscalerIs422Enabled(InstancePtr)) ? XVIDC_CSF_YCRCB_422 : XVIDC_CSF_YCRCB_444);
    if (cformatOut<lo || cformatOut>hi )
    {
      return(FALSE);
    }
  }
  return(TRUE);
}
int XV_HScalerValidateConfig ( XV_Hscaler_l2 * InstancePtr , u32 cformatIn , u32 cformatOut ) { u32 lo , hi ; if ( cformatIn == XVIDC_CSF_YCRCB_422 && ! XV_HscalerIs422Enabled ( InstancePtr ) ) { return ( FALSE ) ; } if ( cformatIn == XVIDC_CSF_RGB && ! XV_HscalerIsCscEnabled ( InstancePtr ) && cformatOut != XVIDC_CSF_RGB ) { return ( FALSE ) ; } if ( cformatIn != XVIDC_CSF_RGB ) { lo = ( XV_HscalerIsCscEnabled ( InstancePtr ) ) ? XVIDC_CSF_RGB : XVIDC_CSF_YCRCB_444 ; hi = ( XV_HscalerIs420Enabled ( InstancePtr ) ) ? XVIDC_CSF_YCRCB_420 : ( ( XV_HscalerIs422Enabled ( InstancePtr ) ) ? XVIDC_CSF_YCRCB_422 : XVIDC_CSF_YCRCB_444 ) ; if ( cformatOut < lo || cformatOut > hi ) { return ( FALSE ) ; } } return ( TRUE ) ; }
This function checks if the given input and output color formats
are valid configuration parameters for this instance
This function checks if the given input and output color formats are valid configuration parameters for this instance