XilinxProcessorIPLib/drivers/vprocss/src/xvprocss.c
static int ValidateCscOnlyConfig(XVprocSs *XVprocSsPtr,
                                 u16 Allow422,
                                 u16 Allow420)
{
  XVidC_VideoStream *pStrmIn  = &XVprocSsPtr->VidIn;
  XVidC_VideoStream *pStrmOut = &XVprocSsPtr->VidOut;

  // Valid color formats for the csc only case:
  //   1) if Vin or Vout are 422, and 422 or 420 are enabled, the case is allowed
  //   2) if Vin or Vout are 420, and 420 is enabled, the case is allowed

  if (((pStrmIn->ColorFormatId == XVIDC_CSF_YCRCB_422) ||
       (pStrmOut->ColorFormatId == XVIDC_CSF_YCRCB_422)) &&
      (!Allow422)) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_NO422);
    return(XST_FAILURE);
  }

  if (((pStrmIn->ColorFormatId == XVIDC_CSF_YCRCB_420) ||
       (pStrmOut->ColorFormatId == XVIDC_CSF_YCRCB_420)) &&
      (!Allow420)) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_NO420);
    return(XST_FAILURE);
  }

  if(pStrmIn->VmId != pStrmOut->VmId) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_VMDIFF);
    return(XST_FAILURE);
  }

  if(pStrmIn->Timing.HActive != pStrmOut->Timing.HActive) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_HDIFF);
    return(XST_FAILURE);
  }

  if(pStrmIn->Timing.VActive != pStrmOut->Timing.VActive) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_VDIFF);
    return(XST_FAILURE);
  }

  XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_VALID);
  return(XST_SUCCESS);
}
/*****************************************************************************/
/**
* This function validates the input and output stream configuration for csc
* only configuration
*
* @param  pStrmIn is a pointer to the input stream
* @param  pStrmOut is a pointer to the output stream
*
* @return XST_SUCCESS if successful else XST_FAILURE
*
* @note This function is applicable only for Stream mode configuration of the
*       subsystem. In this mode very limited functionality is available
******************************************************************************/
This function validates the input and output stream configuration for csc
only configuration
This function validates the input and output stream configuration for csc only configuration
static int ValidateCscOnlyConfig(XVprocSs *XVprocSsPtr,
                                 u16 Allow422,
                                 u16 Allow420)
{
  XVidC_VideoStream *pStrmIn  = &XVprocSsPtr->VidIn;
  XVidC_VideoStream *pStrmOut = &XVprocSsPtr->VidOut;
  if (((pStrmIn->ColorFormatId == XVIDC_CSF_YCRCB_422) ||
       (pStrmOut->ColorFormatId == XVIDC_CSF_YCRCB_422)) &&
      (!Allow422)) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_NO422);
    return(XST_FAILURE);
  }
  if (((pStrmIn->ColorFormatId == XVIDC_CSF_YCRCB_420) ||
       (pStrmOut->ColorFormatId == XVIDC_CSF_YCRCB_420)) &&
      (!Allow420)) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_NO420);
    return(XST_FAILURE);
  }
  if(pStrmIn->VmId != pStrmOut->VmId) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_VMDIFF);
    return(XST_FAILURE);
  }
  if(pStrmIn->Timing.HActive != pStrmOut->Timing.HActive) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_HDIFF);
    return(XST_FAILURE);
  }
  if(pStrmIn->Timing.VActive != pStrmOut->Timing.VActive) {
    XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_VDIFF);
    return(XST_FAILURE);
  }
  XVprocSs_LogWrite(XVprocSsPtr, XVPROCSS_EVT_CFG_CSC, XVPROCSS_EDAT_VALID);
  return(XST_SUCCESS);
}
static int ValidateCscOnlyConfig ( XVprocSs * XVprocSsPtr , u16 Allow422 , u16 Allow420 ) { XVidC_VideoStream * pStrmIn = & XVprocSsPtr -> VidIn ; XVidC_VideoStream * pStrmOut = & XVprocSsPtr -> VidOut ; if ( ( ( pStrmIn -> ColorFormatId == XVIDC_CSF_YCRCB_422 ) || ( pStrmOut -> ColorFormatId == XVIDC_CSF_YCRCB_422 ) ) && ( ! Allow422 ) ) { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_NO422 ) ; return ( XST_FAILURE ) ; } if ( ( ( pStrmIn -> ColorFormatId == XVIDC_CSF_YCRCB_420 ) || ( pStrmOut -> ColorFormatId == XVIDC_CSF_YCRCB_420 ) ) && ( ! Allow420 ) ) { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_NO420 ) ; return ( XST_FAILURE ) ; } if ( pStrmIn -> VmId != pStrmOut -> VmId ) { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_VMDIFF ) ; return ( XST_FAILURE ) ; } if ( pStrmIn -> Timing . HActive != pStrmOut -> Timing . HActive ) { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_HDIFF ) ; return ( XST_FAILURE ) ; } if ( pStrmIn -> Timing . VActive != pStrmOut -> Timing . VActive ) { XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_VDIFF ) ; return ( XST_FAILURE ) ; } XVprocSs_LogWrite ( XVprocSsPtr , XVPROCSS_EVT_CFG_CSC , XVPROCSS_EDAT_VALID ) ; return ( XST_SUCCESS ) ; }
This function validates the input and output stream configuration for csc
only configuration
This function validates the input and output stream configuration for csc only configuration
// Valid color formats for the csc only case: //   1) if Vin or Vout are 422, and 422 or 420 are enabled, the case is allowed //   2) if Vin or Vout are 420, and 420 is enabled, the case is allowed