From 953be21a22a8fb012a7e8c1ff540ce698f1bdb0b Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 2 Dec 2015 22:42:39 +1100 Subject: [PATCH] glcolorconvert: improve the YUY2/UYVY->RGBA conversion shader Don't offset the y-axis. We only need to offset on the x-axis. Removes a sawtooth pattern on horizontal and vertical edges. https://bugzilla.gnome.org/show_bug.cgi?id=755486 --- gst-libs/gst/gl/gstglcolorconvert.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index e01770019b..9fd640e5b5 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -324,8 +324,8 @@ static const struct shader_templ templ_YUY2_UYVY_to_RGB = " dx2 = -dx1;\n" " dx1 = 0.0;\n" "}\n" - "uv_texel.rg = texture2D(Ytex, texcoord * tex_scale0 + dx1).r%c;\n" - "uv_texel.ba = texture2D(Ytex, texcoord * tex_scale0 + dx2).r%c;\n" + "uv_texel.rg = texture2D(Ytex, texcoord * tex_scale0 + vec2(dx1, 0.0)).r%c;\n" + "uv_texel.ba = texture2D(Ytex, texcoord * tex_scale0 + vec2(dx2, 0.0)).r%c;\n" "yuv.yz = uv_texel.%c%c;\n" "rgba.rgb = yuv_to_rgb (yuv, offset, coeff1, coeff2, coeff3);\n" "rgba.a = 1.0;\n"