// Convert (and horizontal downsample) RGB to YUV2 using std 601 (this seems to be what Blackmagic card likes)
#version 330

#include "alpha.h"

uniform sampler2DRect inputTex;
uniform sampler2DRect inputTex1;


in vec2 fsTex0;

out vec4 outColor;

void main()
{
    vec4 texColor0;
    vec4 texColor1;

    float isOddLine=floor(fract(fsTex0.y * 0.5) * 2.0);

    texColor0 = texture(inputTex, fsTex0);
    texColor1 = texture(inputTex1, fsTex0);

    outColor=mix(texColor1,texColor0,isOddLine);

    processAlpha(outColor);
}
