Clutter-gst, now with 100% more shaders

Just committed shader support to clutter-gst. When your card supports it and gstreamer decides it’s the format to use (often it picks rgb over yuv, I’ve no idea why this is), YUV decoding will now be handled by a pixel shader instead of the CPU. This should give a reasonable boost when it gets used (in terms of CPU use).

Even more interesting in my eyes, is the YV12 shader I’ve also committed. Normally YV12 hardware-assisted decoding would be done with 8-bit textures and multi-texturing. This is also the sensible way to do it, mind, and I do realise that… But also committed, is a YV12 shader that will decode YV12 uploaded into a 24-bit rgb texture. I’ve not seen a shader that does this before, probably because it’s an insane thing to do, but if you build clutter-gst with USE_YV12_SHADER defined, YV12 decoding will be handled by the graphics card, using a single rgb texture. Note that this shader is completely untuned, however, and very experimental.

The win here is that not only are you offloading a lot of work from the CPU (most videos tend to be stored in YV12 format), but you’re also halving the texture upload (YV12 has quarter-resolution chroma). I imagine I’ll get back to this after guadec and implement it in the correct way. Patches welcome of course.


Leave a Reply

Your email address will not be published. Required fields are marked *