render: ensure correct yuv range handling

This commit is contained in:
itsmattkc
2022-07-20 23:16:08 -07:00
parent 5ea97f7a64
commit 187568324a
10 changed files with 96 additions and 176 deletions
+6
View File
@@ -3,6 +3,7 @@ uniform sampler2D u_channel;
uniform sampler2D v_channel;
uniform int bits_per_pixel;
uniform bool jpeg_range;
in vec2 ove_texcoord;
out vec4 frag_color;
@@ -31,5 +32,10 @@ void main() {
rgba.b = yuv.r + 2.017 * yuv.g;
rgba.a = 1.0;
if (jpeg_range) {
rgba.rgb *= 219.0 / 255.0;
rgba.rgb += 16.0 / 255.0;
}
frag_color = rgba;
}