UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
532 Views
Registered: ‎01-20-2019

YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

Dear all

Great day !!

I have created a design with SDI input and output through PS DP for ZCU7E custom board.

I am scaling down the input resolution to 720p, & I would like to know how to do the YUV 4.2.2 to RGB convertion using the scalar I.P  

Below the Simple Block diagram of designsdiiiiiiiiii.png

regards

Gagandeep

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
483 Views
Registered: ‎11-09-2015

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

Hi @deepg799 ,

Yes it can.

In the example application, just modify the use case for the scaler only:

From

 

vpssVideo useCase[TOPOLOGY_COUNT][USECASE_COUNT] =
//scaler only
{{{1280, 720, XVIDC_CSF_YCRCB_420, XTPG_BKGND_COLOR_BARS, FALSE,
1920, 1080, XVIDC_CSF_YCRCB_444 },
{1280, 720, XVIDC_CSF_YCRCB_422, XTPG_BKGND_COLOR_BARS, FALSE,
720, 480, XVIDC_CSF_YCRCB_420 }},

to

 

 

vpssVideo useCase[TOPOLOGY_COUNT][USECASE_COUNT] =
//scaler only
{{{1280, 720, XVIDC_CSF_YCRCB_422, XTPG_BKGND_COLOR_BARS, FALSE,
1920, 1080, XVIDC_CSF_RGB},
{1280, 720, XVIDC_CSF_YCRCB_422, XTPG_BKGND_COLOR_BARS, FALSE,
720, 480, XVIDC_CSF_RGB}},
//full fledged

 

 

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
6 Replies
Moderator
Moderator
506 Views
Registered: ‎11-09-2015

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

Hi @deepg799 ,

If you are using the scaler only mode you need to make sure "Enable Color Space conversion" is enable in the IP configration.

Then if the option RGB | YUV4:4:4 | YUV4:2:2 | YUV4:2:0 you should be able to do any to any format conversion. Only configure the streams properly uisng the APIs.

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Adventurer
Adventurer
495 Views
Registered: ‎01-20-2019

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

@florentw It could be helpful for me if you share some sample code to configure color conversation APIs. I tried with below code but It is not working for me.

 

XVprocSs_Config* vprocss_config;
vprocss_config = XVprocSs_LookupConfig(XPAR_V_PROC_SS_0_DEVICE_ID); 

if(vprocss_config == NULL){
xil_printf("ERROR:: VProcess Lookup failed\r\n");
return(XST_FAILURE);
}

XVprocSs_LogReset(&vprocss); 
memset(&vprocss, 0, sizeof(XVprocSs)); // Init. all structure variable (vprocss) to ZERO.
status = XVprocSs_CfgInitialize(&vprocss, vprocss_config, vprocss_config->BaseAddress); // Init. vpross using vpross_config.

if(status != XST_SUCCESS){
xil_printf("ERROR:: VProcess Initialization failed\r\n");
return(XST_FAILURE);
}

if (rx_mode == 0) {
resolution = 4; //6 -1080p, 4-720p
}
else if (rx_mode == 2){
resolution = 6;
}

FRAME_HORIZONTAL_HSIZE = (u32) resolutions[resolution][5]; // rx_mode
FRAME_VERTICAL_LEN = (u32) resolutions[resolution][0];

xil_printf("Resolution: %dx%d\n\r",FRAME_HORIZONTAL_HSIZE,FRAME_VERTICAL_LEN); //1920x1080

thisCase.width_in = FRAME_HORIZONTAL_HSIZE;
thisCase.height_in = FRAME_VERTICAL_LEN;

thisCase.Cformat_in = XVIDC_CSF_YCRCB_422;
thisCase.IsInterlaced = FALSE;
thisCase.width_out = 1280;
thisCase.height_out =720;
thisCase.Cformat_out = XVIDC_CSF_RGB; 

//Stream In
XSys_SetStreamParam(&vprocss, XSYS_VPSS_STREAM_IN, thisCase.width_in, thisCase.height_in,
thisCase.Cformat_in, thisCase.IsInterlaced);

//Stream Out
XSys_SetStreamParam(&vprocss, XSYS_VPSS_STREAM_OUT, thisCase.width_out, thisCase.height_out,
thisCase.Cformat_out, thisCase.IsInterlaced);
//Query video processing subsystem configuration
status = XVprocSs_SetSubsystemConfig(&vprocss); 

XVprocSs_ReportSubsystemConfig(&vprocss);

0 Kudos
Moderator
Moderator
493 Views
Registered: ‎11-09-2015

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

Hi @deepg799 ,

Refer to the example application. It contains example.

The use cases for the scaler only is doing YUV420 > YUV444.

Regards,


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Adventurer
Adventurer
487 Views
Registered: ‎01-20-2019

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

@florentw I want to convert from YUV4.2.2 to RGB, could Scalar will do it?

0 Kudos
Moderator
Moderator
484 Views
Registered: ‎11-09-2015

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

Hi @deepg799 ,

Yes it can.

In the example application, just modify the use case for the scaler only:

From

 

vpssVideo useCase[TOPOLOGY_COUNT][USECASE_COUNT] =
//scaler only
{{{1280, 720, XVIDC_CSF_YCRCB_420, XTPG_BKGND_COLOR_BARS, FALSE,
1920, 1080, XVIDC_CSF_YCRCB_444 },
{1280, 720, XVIDC_CSF_YCRCB_422, XTPG_BKGND_COLOR_BARS, FALSE,
720, 480, XVIDC_CSF_YCRCB_420 }},

to

 

 

vpssVideo useCase[TOPOLOGY_COUNT][USECASE_COUNT] =
//scaler only
{{{1280, 720, XVIDC_CSF_YCRCB_422, XTPG_BKGND_COLOR_BARS, FALSE,
1920, 1080, XVIDC_CSF_RGB},
{1280, 720, XVIDC_CSF_YCRCB_422, XTPG_BKGND_COLOR_BARS, FALSE,
720, 480, XVIDC_CSF_RGB}},
//full fledged

 

 

 


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
Adventurer
Adventurer
477 Views
Registered: ‎01-20-2019

Re: YUV 4.2.2 to RBG using Scalar vpss

Jump to solution

@florentw Thanx for quick replay, 

Ok, I will try. & let you know for further clarification. 

0 Kudos