After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747232 - Port and optimize GstGL deinterlace filter
Port and optimize GstGL deinterlace filter
Status: RESOLVED DUPLICATE of bug 764873
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-02 10:06 UTC by Anton Obzhirov
Modified: 2016-09-27 06:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Anton Obzhirov 2015-04-02 10:06:10 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.
Comment 1 Julien Isorce 2015-04-02 10:32:11 UTC
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)
Comment 2 Daniel Stone 2015-04-02 14:34:52 UTC
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.
Comment 3 Julien Isorce 2016-05-09 12:08:20 UTC
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;
Comment 4 Haihua Hu 2016-05-09 12:17:04 UTC
(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.
Comment 5 Matthew Waters (ystreet00) 2016-09-27 06:11:24 UTC
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 ***