/usr/share/psychtoolbox-3/PsychOpenGL/PsychGLSLShaders/EXPDeinterlaceShaderAvg.frag.txt is in psychtoolbox-3-common 3.0.11.20140816.dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | /* Shader for video deinterlacing - Extracts either the even- or odd- field
* (even or odd rows) of an interlaced image texture:
*
* If even lines are wanted, then the even lines are taken as they are, the
* lines are replaced by the average of the even lines above and below them.
*
* Same logic applies when extracting the odd lines.
*
* This code is beta quality. It doesn't work yet with filtered texture
* drawing, and could be more optimized.
*
* Written 2007 by Mario Kleiner, part of the Psychtoolbox-3, licensed under
* MIT license.
*
*/
#extension GL_ARB_texture_rectangle : enable
/* UseOddField: To be set by usercode - 0 = Extract even lines, 1 = Extract odd lines. */
uniform float UseOddField;
/* Input image rectangle texture: */
uniform sampler2DRect Image1;
void main()
{
/* Get default texel read position (s,t): s is column, t is row of image. */
vec2 readpos = gl_TexCoord[0].st;
if (bool(mod(floor(readpos.t + UseOddField), 2.0))) {
/* This row is to be replaced by the average of its neighbour rows: */
gl_FragColor = 0.5*(texture2DRect(Image1, readpos - vec2(0.0, 1.0)) + texture2DRect(Image1, readpos + vec2(0.0, 1.0)));
}
else {
/* This row is to be used: */
gl_FragColor = texture2DRect(Image1, readpos);
}
}
|