[Libva] Add coefficients yuv to rgb conversion
Emil Velikov
emil.l.velikov at gmail.com
Thu Nov 5 14:23:58 PST 2015
On 5 November 2015 at 21:00, Gilles Chanteperdrix
<gilles.chanteperdrix at xenomai.org> wrote:
> On Thu, Nov 05, 2015 at 02:13:29PM +0000, Emil Velikov wrote:
>> On 4 November 2015 at 00:54, Gilles Chanteperdrix
>> <gilles.chanteperdrix at xenomai.org> wrote:
>> > On Tue, Nov 03, 2015 at 04:56:14PM +0000, Lionel Landwerlin wrote:
>> >> Hi,
>> >>
>> >> Following your comments on the previous patch, here is an serie to add
>> >> support for coefficients passed down to the EUs for the vpp yuv to rgb
>> >> conversion path.
>> >
>> > Hi,
>> >
>> > sorry for intruding on the mailing list, but this is a topic on
>> > which I worked recently. First question is: I implemented yuv to rgb
>> > conversion using GLSL shaders (only for yuv420p, but this could be
>> > easily implemented for other pixel formats), and the code is
>> > relatively simple:
>> > https://git.click-hack.org/vplayer.git/tree/lib/yuv420p_frag.glsl
>> > What is the gain of using libva instead?
>> >
>> I'm no expert in the libva code so take this with a grain of salt.
>>
>> For doing things the GLSL way - you have an extra GL context
>> creation/management not to mention the overhead of
>> parsing/compiling/linking etc the GLSL shader. While the result (from
>> a hardware's perspective/instructions emitted) may be almost
>> identical, doing things within i965 libva driver should be less
>> CPU/memory intensive.
>
> Well, compiling/linking the GLSL shader happens only once at
> initialization. The advantage I see with a GLSL shader is that it
> looks more portable, OpenGL with GLSL is almost universally
> available, whereas libva runs on Linux only.
>
If you're looking for a cross-platform (*nix, Windows, OSX) solution
then obviously libva won't cut it. There are plenty of projects that
do colour transformations in GLSL. If you're on a platform that works
with libva (should be most *nix) then keeping this within the actual
backend (driver) is the way forward for the above mentioned reasons.
So you balance things out and pick the one that suits you :P
-Emil
P.S. Working on Mesa (and its GLSL compiler) I can tell you that the
overhead is not trivial ;-)
More information about the Libva
mailing list