diff options
Diffstat (limited to 'libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd')
-rw-r--r-- | libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd index 8e55d14..367fb55 100644 --- a/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd +++ b/libraries/evas/src/modules/engines/gl_common/shader/yuv_frag.shd | |||
@@ -10,11 +10,15 @@ varying vec4 col; | |||
10 | varying vec2 tex_c, tex_c2, tex_c3; | 10 | varying vec2 tex_c, tex_c2, tex_c3; |
11 | void main() | 11 | void main() |
12 | { | 12 | { |
13 | const mat4 yuv2rgb = mat4( 1.16400, 1.16400, 1.16400, 0.00000, | 13 | float r, g, b, y, u, v; |
14 | 0.00000, -0.34410, 1.77200, 0.00000, | 14 | y = texture2D(tex, tex_c.xy).r; |
15 | 1.40200, -0.71410, 0.00000, 0.00000, | 15 | u = texture2D(texu, tex_c2.xy).r; |
16 | -0.77380, 0.45630, -0.95880, 1.00000); | 16 | v = texture2D(texv, tex_c3.xy).r; |
17 | gl_FragColor = (yuv2rgb * vec4(texture2D(tex, tex_c.xy).r, | 17 | y = (y - 0.0625) * 1.164; |
18 | texture2D(texu, tex_c2.xy).r, | 18 | u = u - 0.5; |
19 | texture2D(texv, tex_c3.xy).r, 1.0)) * col; | 19 | v = v - 0.5; |
20 | r = y + (1.402 * v); | ||
21 | g = y - (0.34414 * u) - (0.71414 * v); | ||
22 | b = y + (1.772 * u); | ||
23 | gl_FragColor = vec4(r, g, b, 1.0) * col; | ||
20 | } | 24 | } |