gl: optimize glcolorbalance by precomputing shader math
authorDinesh Manajipet <saidinesh5@gmail.com>
Sat, 24 Oct 2020 18:15:19 +0000 (23:45 +0530)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 29 Oct 2020 01:16:49 +0000 (01:16 +0000)
commitad697e8f9784b84c05a6285101d9bb1271e8859e
treede93eafec43607966f2959700009dfccd4fdea28
parent15162754137141d439d2e4b1b2b86cbed79d1e29
gl: optimize glcolorbalance by precomputing shader math

Precompute the rgb -> yuv conversion and color balance adjustment math
so that the shader does minimal work per pixel.

Merging these 15+ steps into 3 steps let us jump from choppy
360p video to smooth 720p video on our underpowered embedded system.

If we can remove the clamp() step inside the shader, or apply it after
rgba
conversion, there are more performance benefits to reap. But I am not
sure
what the side effects will be in that case.

<https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/893>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/893>
ext/gl/gstglcolorbalance.c
ext/gl/gstglcolorbalance.h