Discussion:
Filling background pixels with YUV values
(too old to reply)
Recker, Jon
2016-12-23 00:30:13 UTC
Permalink
Hello.

When composing several sources into a single output surface, we can specify the color of the background pixels using VAProcPipelineParameterBuffer::output_background_color. According to the documentation, this background color must be a 32-bit ARGB value.

But when the output is a non-RGB format (for example, NV12) it would be helpful if we could set the background color to a constant YUV value instead. Does libva provide any method to do this?

I have tried converting the desired YUV background color to RGB, then setting output_background_color to this RGB value. When the final picture is processed, the background color is converted back to YUV automatically. But the final background color does not necessarily match the requested value, for example when one of the RGB channels is clipped to fit in the range [0,255].

A workaround would be to create a separate full-size NV12 surface and fill it with the desired background color, but for performance reasons it is preferable to avoid this. Any suggestions would be very much appreciated. Thanks.

Jon
Xiang, Haihao
2016-12-23 08:55:16 UTC
Permalink
Hi Jon,

VA-API doesn't support YUV background color. If you want to have this
feature, I suggest you file a bug with severity set to enhancement in
the bugzilla to track your requirement. We may consider to add this new
feature in a future version.

Thanks
Haihao

> Hello.
>  
> When composing several sources into a single output surface, we can
> specify the color of the background pixels using
> VAProcPipelineParameterBuffer::output_background_color. According to
> the documentation, this background color must be a 32-bit ARGB value.
>  
> But when the output is a non-RGB format (for example, NV12) it would
> be helpful if we could set the background color to a constant YUV
> value instead. Does libva provide any method to do this?
>  
> I have tried converting the desired YUV background color to RGB, then
> setting output_background_color to this RGB value. When the final
> picture is processed, the background color is converted back to YUV
> automatically. But the final background color does not necessarily
> match the requested value, for example when one of the RGB channels
> is clipped to fit in the range [0,255].
>  
> A workaround would be to create a separate full-size NV12 surface and
> fill it with the desired background color, but for performance
> reasons it is preferable to avoid this. Any suggestions would be very
> much appreciated. Thanks.
>  
> Jon
>  
> _______________________________________________
> Libva mailing list
> ***@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libva
Recker, Jon
2016-12-23 17:00:13 UTC
Permalink
Thank you for the information, Haihao. I have filed this feature request in bugzilla.



https://bugs.freedesktop.org/show_bug.cgi?id=99193



Jon



-----Original Message-----
From: Xiang, Haihao
Sent: Friday, December 23, 2016 12:55 AM
To: Recker, Jon <***@intel.com>; ***@lists.freedesktop.org
Subject: Re: [Libva] Filling background pixels with YUV values





Hi Jon,



VA-API doesn't support YUV background color. If you want to have this feature, I suggest you file a bug with severity set to enhancement in the bugzilla to track your requirement. We may consider to add this new feature in a future version.



Thanks

Haihao



> Hello.

>

> When composing several sources into a single output surface, we can

> specify the color of the background pixels using

> VAProcPipelineParameterBuffer::output_background_color. According to

> the documentation, this background color must be a 32-bit ARGB value.

>

> But when the output is a non-RGB format (for example, NV12) it would

> be helpful if we could set the background color to a constant YUV

> value instead. Does libva provide any method to do this?

>

> I have tried converting the desired YUV background color to RGB, then

> setting output_background_color to this RGB value. When the final

> picture is processed, the background color is converted back to YUV

> automatically. But the final background color does not necessarily

> match the requested value, for example when one of the RGB channels is

> clipped to fit in the range [0,255].

>

> A workaround would be to create a separate full-size NV12 surface and

> fill it with the desired background color, but for performance reasons

> it is preferable to avoid this. Any suggestions would be very much

> appreciated. Thanks.

>

> Jon

>

> _______________________________________________

> Libva mailing list

> ***@lists.freedesktop.org<mailto:***@lists.freedesktop.org>

> https://lists.freedesktop.org/mailman/listinfo/libva
Rogozhkin, Dmitry V
2016-12-23 17:43:38 UTC
Permalink
Haihao, could you, please, clarify API: does VAProcPipelineParameterBuffer::output_color_standard sets color format for the value in VAProcPipelineParameterBuffer::output_background_color or it sets something else?

As usual, we need to understand:
1) do we have required API in place (regardless whether driver supports such a trick or not)
2) do we have such support in the driver right now?

Dmitry.

On 23 Dec 2016, at 20:01, Recker, Jon <***@intel.com<mailto:***@intel.com>> wrote:


Thank you for the information, Haihao. I have filed this feature request in bugzilla.



https://bugs.freedesktop.org/show_bug.cgi?id=99193



Jon



-----Original Message-----
From: Xiang, Haihao
Sent: Friday, December 23, 2016 12:55 AM
To: Recker, Jon <***@intel.com<mailto:***@intel.com>>; ***@lists.freedesktop.org<mailto:***@lists.freedesktop.org>
Subject: Re: [Libva] Filling background pixels with YUV values





Hi Jon,



VA-API doesn't support YUV background color. If you want to have this feature, I suggest you file a bug with severity set to enhancement in the bugzilla to track your requirement. We may consider to add this new feature in a future version.



Thanks

Haihao



> Hello.

>

> When composing several sources into a single output surface, we can

> specify the color of the background pixels using

> VAProcPipelineParameterBuffer::output_background_color. According to

> the documentation, this background color must be a 32-bit ARGB value.

>

> But when the output is a non-RGB format (for example, NV12) it would

> be helpful if we could set the background color to a constant YUV

> value instead. Does libva provide any method to do this?

>

> I have tried converting the desired YUV background color to RGB, then

> setting output_background_color to this RGB value. When the final

> picture is processed, the background color is converted back to YUV

> automatically. But the final background color does not necessarily

> match the requested value, for example when one of the RGB channels is

> clipped to fit in the range [0,255].

>

> A workaround would be to create a separate full-size NV12 surface and

> fill it with the desired background color, but for performance reasons

> it is preferable to avoid this. Any suggestions would be very much

> appreciated. Thanks.

>

> Jon

>

> _______________________________________________

> Libva mailing list

> ***@lists.freedesktop.org<mailto:***@lists.freedesktop.org>

> https://lists.freedesktop.org/mailman/listinfo/libva

_______________________________________________
Libva mailing list
***@lists.freedesktop.org<mailto:***@lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/libva

--------------------------------------------------------------------
Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park,
17 Krylatskaya Str., Bldg 4, Moscow 121614,
Russian Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Xiang, Haihao
2016-12-26 00:41:37 UTC
Permalink
Hi Dmitry,

VAProcPipelineParameterBuffer::output_color_standard set the color
standard on the target surface which is specified by the 3rd parameter
of vaBeginPicture().

Thanks
Haihao


> Haihao, could you, please, clarify API:
> does VAProcPipelineParameterBuffer::output_color_standard sets color
> format for the value
> in VAProcPipelineParameterBuffer::output_background_color or it sets
> something else?
>
> As usual, we need to understand:
> 1) do we have required API in place (regardless whether driver
> supports such a trick or not)
> 2) do we have such support in the driver right now?
>
> Dmitry.
>
> On 23 Dec 2016, at 20:01, Recker, Jon <***@intel.com> wrote:
>
> > Thank you for the information, Haihao. I have filed this feature
> > request in bugzilla.
> >  
> > https://bugs.freedesktop.org/show_bug.cgi?id=99193
> >                                                                    
> >    
> > Jon
> >  
> > -----Original Message-----
> > From: Xiang, Haihao
> > Sent: Friday, December 23, 2016 12:55 AM
> > To: Recker, Jon <***@intel.com>; ***@lists.freedesktop.org
> > Subject: Re: [Libva] Filling background pixels with YUV values
> >  
> >  
> > Hi Jon,
> >  
> > VA-API doesn't support YUV background color. If you want to have
> > this feature, I suggest you file a bug with severity set to
> > enhancement in the bugzilla to track your requirement. We may
> > consider to add this new feature in a future version.
> >  
> > Thanks
> > Haihao
> >  
> > > Hello.
> > >  
> > > When composing several sources into a single output surface, we
> > can
> > > specify the color of the background pixels using
> > > VAProcPipelineParameterBuffer::output_background_color. According
> > to
> > > the documentation, this background color must be a 32-bit ARGB
> > value.
> > >  
> > > But when the output is a non-RGB format (for example, NV12) it
> > would
> > > be helpful if we could set the background color to a constant YUV
> > > value instead. Does libva provide any method to do this?
> > >  
> > > I have tried converting the desired YUV background color to RGB,
> > then
> > > setting output_background_color to this RGB value. When the final
> > > picture is processed, the background color is converted back to
> > YUV
> > > automatically. But the final background color does not
> > necessarily
> > > match the requested value, for example when one of the RGB
> > channels is
> > > clipped to fit in the range [0,255].
> > >  
> > > A workaround would be to create a separate full-size NV12 surface
> > and
> > > fill it with the desired background color, but for performance
> > reasons
> > > it is preferable to avoid this. Any suggestions would be very
> > much
> > > appreciated. Thanks.
> > >  
> > > Jon
> > >  
> > > _______________________________________________
> > > Libva mailing list
> > > ***@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/libva
> > _______________________________________________
> > Libva mailing list
> > ***@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/libva
Xiang, Haihao
2016-12-26 00:32:05 UTC
Permalink
Thanks, Jon.

> Thank you for the information, Haihao. I have filed this feature
> request in bugzilla.
>  
> https://bugs.freedesktop.org/show_bug.cgi?id=99193
>                                                                      
>  
> Jon
>  
> -----Original Message-----
> From: Xiang, Haihao
> Sent: Friday, December 23, 2016 12:55 AM
> To: Recker, Jon <***@intel.com>; ***@lists.freedesktop.org
> Subject: Re: [Libva] Filling background pixels with YUV values
>  
>  
> Hi Jon,
>  
> VA-API doesn't support YUV background color. If you want to have this
> feature, I suggest you file a bug with severity set to enhancement in
> the bugzilla to track your requirement. We may consider to add this
> new feature in a future version.
>  
> Thanks
> Haihao
>  
> > Hello.
> >  
> > When composing several sources into a single output surface, we can
> > specify the color of the background pixels using
> > VAProcPipelineParameterBuffer::output_background_color. According
> to
> > the documentation, this background color must be a 32-bit ARGB
> value.
> >  
> > But when the output is a non-RGB format (for example, NV12) it
> would
> > be helpful if we could set the background color to a constant YUV
> > value instead. Does libva provide any method to do this?
> >  
> > I have tried converting the desired YUV background color to RGB,
> then
> > setting output_background_color to this RGB value. When the final
> > picture is processed, the background color is converted back to YUV
> > automatically. But the final background color does not necessarily
> > match the requested value, for example when one of the RGB channels
> is
> > clipped to fit in the range [0,255].
> >  
> > A workaround would be to create a separate full-size NV12 surface
> and
> > fill it with the desired background color, but for performance
> reasons
> > it is preferable to avoid this. Any suggestions would be very much
> > appreciated. Thanks.
> >  
> > Jon
> >  
> > _______________________________________________
> > Libva mailing list
> > ***@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/libva
Loading...