GL: fixed odd UYVY pixel width

fixed rendering `-t testcard:size=47x32:codec=UYVY`
This commit is contained in:
Martin Pulec
2022-11-15 11:19:12 +01:00
parent 0364f0253e
commit 742b677da7

View File

@@ -106,8 +106,10 @@ uniform sampler2D image;
uniform float imageWidth;
void main()
{
float imageWidthRaw;
imageWidthRaw = float((int(imageWidth) + 1) / 2 * 2);
vec4 yuv;
yuv.rgba = texture2D(image, gl_TexCoord[0].xy).grba;
yuv.rgba = texture2D(image, vec2(gl_TexCoord[0].x / imageWidthRaw * imageWidth, gl_TexCoord[0].y)).grba;
if(gl_TexCoord[0].x * imageWidth / 2.0 - floor(gl_TexCoord[0].x * imageWidth / 2.0) > 0.5)
yuv.r = yuv.a;
yuv.r = Y_SCALED_PLACEHOLDER * (yuv.r - 0.0625);