GNOME Bugzilla – Bug 747232
Port and optimize GstGL deinterlace filter
Last modified: 2016-09-27 06:11:24 UTC
There is a deinterlace filter available in GstGL. It was written by Julien and supports OpenGL. ./master/gst-plugins-bad/ext/gl/gstgldeinterlace.c ./master/gst-plugins-bad/ext/gl/gstgldeinterlace.h. It should be ported to GLES2.0. Also Julien mentioned that it can be optimized. So I would like to start porting. There are few questions to start with: 1) Are there reference testing material available? I noticed another deinterlacer in gst-plugins-good so may be there are some generic tests. 2) if someone wants to share ideas about possible optmization it would be good to know them.
Daniel I remember you had some ideas to optimize the shader but I can't remember the details, the current code is here: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl/gstgldeinterlace.c, thx! (C version: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/deinterlace/tvtime/greedyh.c)
Hmm yeah, I do remember this, but also can't remember what they were. Probably mostly that using textureOffset() rather than texture2D(x±1.0) etc will be a lot cheaper, though this isn't available on GLES2 (only 3), so you'll need to maintain the fallback path. Texturing only in conditional branches is pretty harsh, so it'd probably be better to texture conditionally, and just change when you use the results. Also, the int conversions may be better done by using rounding in float space rather than forcing the conversion? Aside from that, it's incredibly complicated, but I can't see an obvious way to flatten it. It already seems fairly well thought in terms of parallelism and scheduling, at least.
Hi Haihua, thx for porting it to GLES2 (https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=0cfb0890ce9a20f096a0a9c9f23b656f436794c6). But it was still not efficient enough on embedded right ? That's why you wrote the other method ? typedef enum { GST_GL_DEINTERLACE_VFIR, -> this one GST_GL_DEINTERLACE_GREEDYH } GstGLDeinterlaceMethod;
(In reply to Julien Isorce from comment #3) > Hi Haihua, thx for porting it to GLES2 > (https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/ > ?id=0cfb0890ce9a20f096a0a9c9f23b656f436794c6). But it was still not > efficient enough on embedded right ? That's why you wrote the other method ? > > typedef enum > { > GST_GL_DEINTERLACE_VFIR, -> this one > GST_GL_DEINTERLACE_GREEDYH > } GstGLDeinterlaceMethod; Yes, the performance of the original shader is not good and can only reach half performance of the new shader on my imx6QP. The deinterlace effect is also not good and little sawtooth still exists on the video frame.
The port to GLES2 has already been completed. If anyone wants to optimize the shaders properly, please open a new bug. *** This bug has been marked as a duplicate of bug 764873 ***