// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)

#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying
#define COMPAT_ATTRIBUTE attribute
#define COMPAT_TEXTURE texture2D
#endif

#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_VARYING     vec2 _blur_dxdy;
COMPAT_VARYING     vec2 _tex_uv1;
COMPAT_VARYING     vec4 _position1;
COMPAT_VARYING     float _frame_rotation;
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
struct out_vertex {
    vec4 _position1;
    vec2 _tex_uv1;
    vec2 _blur_dxdy;
};
out_vertex _ret_0;
input_dummy _IN1;
vec4 _r0006;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
 
uniform mat4 MVPMatrix;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    out_vertex _OUT;
    vec2 _dxdy_scale;
    _r0006 = VertexCoord.x*MVPMatrix[0];
    _r0006 = _r0006 + VertexCoord.y*MVPMatrix[1];
    _r0006 = _r0006 + VertexCoord.z*MVPMatrix[2];
    _r0006 = _r0006 + VertexCoord.w*MVPMatrix[3];
    _dxdy_scale = InputSize/OutputSize;
    _OUT._blur_dxdy = _dxdy_scale/TextureSize;
    _ret_0._position1 = _r0006;
    _ret_0._tex_uv1 = TexCoord.xy;
    _ret_0._blur_dxdy = _OUT._blur_dxdy;
    gl_Position = _r0006;
    TEX0.xy = TexCoord.xy;
    TEX1.xy = _OUT._blur_dxdy;
    return;
    TEX0.xy = _ret_0._tex_uv1;
    TEX1.xy = _ret_0._blur_dxdy;
} 
#elif defined(FRAGMENT)

#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#endif

#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
COMPAT_VARYING     vec2 _blur_dxdy;
COMPAT_VARYING     vec2 _tex_uv1;
COMPAT_VARYING     float _frame_rotation;
struct input_dummy {
    vec2 _video_size;
    vec2 _texture_size;
    vec2 _output_dummy_size;
    float _frame_count;
    float _frame_direction;
    float _frame_rotation;
};
struct out_vertex {
    vec2 _tex_uv1;
    vec2 _blur_dxdy;
};
vec4 _ret_0;
vec3 _TMP1;
float _TMP29;
float _TMP28;
float _TMP27;
vec4 _TMP30;
vec3 _TMP32;
float _TMP10;
float _TMP9;
float _TMP8;
float _TMP7;
float _TMP6;
float _TMP5;
float _TMP4;
float _TMP3;
float _TMP2;
uniform sampler2D Texture;
vec3 _TMP39;
float _texel0to1ratio0042;
float _texel2to3ratio0042;
vec2 _sample1d_texel_offset0042;
vec2 _sample2d_texel_offset0042;
vec2 _sample3d_texel_offset0042;
vec2 _sample4d_texel_offset0042;
float _w10042;
float _w2_30042;
float _w40042;
float _weight_sum_inv0042;
vec2 _dxdy_mirror_x0042;
vec2 _dxdy_mirror_y0042;
vec2 _dxdy_mirror_xy0042;
vec3 _sum0042;
float _TMP43;
float _TMP47;
float _TMP51;
float _TMP57;
float _x0058;
float _TMP63;
float _x0064;
float _TMP69;
float _x0070;
float _TMP75;
float _x0076;
float _TMP81;
float _x0082;
float _TMP87;
float _x0088;
float _TMP93;
float _x0094;
float _TMP99;
float _x0100;
float _TMP105;
float _x0106;
vec4 _TMP109;
vec2 _tex_coords0110;
vec4 _TMP127;
vec2 _tex_coords0128;
vec4 _TMP145;
vec2 _tex_coords0146;
vec4 _TMP163;
vec2 _tex_coords0164;
vec4 _TMP181;
vec2 _tex_coords0182;
vec4 _TMP199;
vec2 _tex_coords0200;
vec4 _TMP217;
vec2 _tex_coords0218;
vec4 _TMP235;
vec2 _tex_coords0236;
vec4 _TMP253;
vec2 _tex_coords0254;
vec4 _TMP271;
vec2 _tex_coords0272;
vec4 _TMP289;
vec2 _tex_coords0290;
vec4 _TMP307;
vec2 _tex_coords0308;
vec4 _TMP325;
vec2 _tex_coords0326;
vec4 _TMP343;
vec2 _tex_coords0344;
vec4 _TMP361;
vec2 _tex_coords0362;
vec4 _TMP379;
vec2 _tex_coords0380;
vec4 _color0398;
COMPAT_VARYING vec4 TEX0;
COMPAT_VARYING vec4 TEX1;
 
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
    _TMP43 = pow(2.71828198E+00, -2.69917697E-01);
    _TMP47 = pow(2.71828198E+00, -1.07967079E+00);
    _TMP51 = pow(2.71828198E+00, -2.42925930E+00);
    _texel0to1ratio0042 = _TMP43/(5.00000000E-01 + _TMP43);
    _texel2to3ratio0042 = _TMP51/(_TMP47 + _TMP51);
    _sample1d_texel_offset0042 = vec2(_texel0to1ratio0042, _texel0to1ratio0042);
    _sample2d_texel_offset0042 = vec2( 2.00000000E+00, 0.00000000E+00) + vec2(_texel2to3ratio0042, _texel0to1ratio0042);
    _sample3d_texel_offset0042 = vec2( 0.00000000E+00, 2.00000000E+00) + vec2(_texel0to1ratio0042, _texel2to3ratio0042);
    _sample4d_texel_offset0042 = vec2( 2.00000000E+00, 2.00000000E+00) + vec2(_texel2to3ratio0042, _texel2to3ratio0042);
    _TMP2 = dot(vec2( 1.00000000E+00, 0.00000000E+00), vec2( 1.00000000E+00, 0.00000000E+00));
    _x0058 = -_TMP2*2.69917697E-01;
    _TMP57 = pow(2.71828198E+00, _x0058);
    _TMP3 = dot(vec2( 2.00000000E+00, 0.00000000E+00), vec2( 2.00000000E+00, 0.00000000E+00));
    _x0064 = -_TMP3*2.69917697E-01;
    _TMP63 = pow(2.71828198E+00, _x0064);
    _TMP4 = dot(vec2( 3.00000000E+00, 0.00000000E+00), vec2( 3.00000000E+00, 0.00000000E+00));
    _x0070 = -_TMP4*2.69917697E-01;
    _TMP69 = pow(2.71828198E+00, _x0070);
    _TMP5 = dot(vec2( 1.00000000E+00, 1.00000000E+00), vec2( 1.00000000E+00, 1.00000000E+00));
    _x0076 = -_TMP5*2.69917697E-01;
    _TMP75 = pow(2.71828198E+00, _x0076);
    _TMP6 = dot(vec2( 2.00000000E+00, 1.00000000E+00), vec2( 2.00000000E+00, 1.00000000E+00));
    _x0082 = -_TMP6*2.69917697E-01;
    _TMP81 = pow(2.71828198E+00, _x0082);
    _TMP7 = dot(vec2( 3.00000000E+00, 1.00000000E+00), vec2( 3.00000000E+00, 1.00000000E+00));
    _x0088 = -_TMP7*2.69917697E-01;
    _TMP87 = pow(2.71828198E+00, _x0088);
    _TMP8 = dot(vec2( 2.00000000E+00, 2.00000000E+00), vec2( 2.00000000E+00, 2.00000000E+00));
    _x0094 = -_TMP8*2.69917697E-01;
    _TMP93 = pow(2.71828198E+00, _x0094);
    _TMP9 = dot(vec2( 3.00000000E+00, 2.00000000E+00), vec2( 3.00000000E+00, 2.00000000E+00));
    _x0100 = -_TMP9*2.69917697E-01;
    _TMP99 = pow(2.71828198E+00, _x0100);
    _TMP10 = dot(vec2( 3.00000000E+00, 3.00000000E+00), vec2( 3.00000000E+00, 3.00000000E+00));
    _x0106 = -_TMP10*2.69917697E-01;
    _TMP105 = pow(2.71828198E+00, _x0106);
    _w10042 = 2.50000000E-01 + _TMP57 + _TMP75;
    _w2_30042 = (_TMP63 + _TMP69)*5.00000000E-01 + _TMP81 + _TMP87;
    _w40042 = _TMP93 + 2.00000000E+00*_TMP99 + _TMP105;
    _weight_sum_inv0042 = 1.00000000E+00/(4.00000000E+00*(_w10042 + 2.00000000E+00*_w2_30042 + _w40042));
    _dxdy_mirror_x0042 = TEX1.xy*vec2( -1.00000000E+00, 1.00000000E+00);
    _dxdy_mirror_y0042 = TEX1.xy*vec2( 1.00000000E+00, -1.00000000E+00);
    _dxdy_mirror_xy0042 = -TEX1.xy;
    _tex_coords0110 = TEX0.xy + _dxdy_mirror_xy0042*_sample1d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0110);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP109 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0128 = TEX0.xy + _dxdy_mirror_xy0042*_sample2d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0128);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP127 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0146 = TEX0.xy + _dxdy_mirror_xy0042*_sample3d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0146);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP145 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0164 = TEX0.xy + _dxdy_mirror_xy0042*_sample4d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0164);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP163 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0182 = TEX0.xy + _dxdy_mirror_y0042*_sample1d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0182);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP181 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0200 = TEX0.xy + _dxdy_mirror_y0042*_sample2d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0200);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP199 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0218 = TEX0.xy + _dxdy_mirror_y0042*_sample3d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0218);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP217 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0236 = TEX0.xy + _dxdy_mirror_y0042*_sample4d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0236);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP235 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0254 = TEX0.xy + _dxdy_mirror_x0042*_sample1d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0254);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP253 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0272 = TEX0.xy + _dxdy_mirror_x0042*_sample2d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0272);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP271 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0290 = TEX0.xy + _dxdy_mirror_x0042*_sample3d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0290);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP289 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0308 = TEX0.xy + _dxdy_mirror_x0042*_sample4d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0308);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP307 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0326 = TEX0.xy + TEX1.xy*_sample1d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0326);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP325 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0344 = TEX0.xy + TEX1.xy*_sample2d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0344);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP343 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0362 = TEX0.xy + TEX1.xy*_sample3d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0362);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP361 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _tex_coords0380 = TEX0.xy + TEX1.xy*_sample4d_texel_offset0042;
    _TMP30 = COMPAT_TEXTURE(Texture, _tex_coords0380);
    _TMP27 = pow(_TMP30.x, 2.20000005E+00);
    _TMP28 = pow(_TMP30.y, 2.20000005E+00);
    _TMP29 = pow(_TMP30.z, 2.20000005E+00);
    _TMP32 = vec3(_TMP27, _TMP28, _TMP29);
    _TMP379 = vec4(_TMP32.x, _TMP32.y, _TMP32.z, _TMP30.w);
    _sum0042 = _w10042*(_TMP109.xyz + _TMP181.xyz + _TMP253.xyz + _TMP325.xyz);
    _sum0042 = _sum0042 + _w2_30042*(_TMP127.xyz + _TMP199.xyz + _TMP271.xyz + _TMP343.xyz);
    _sum0042 = _sum0042 + _w2_30042*(_TMP145.xyz + _TMP217.xyz + _TMP289.xyz + _TMP361.xyz);
    _sum0042 = _sum0042 + _w40042*(_TMP163.xyz + _TMP235.xyz + _TMP307.xyz + _TMP379.xyz);
    _TMP39 = _sum0042*_weight_sum_inv0042;
    _color0398 = vec4(_TMP39.x, _TMP39.y, _TMP39.z, 1.00000000E+00);
    _TMP27 = pow(_color0398.x, 4.54545438E-01);
    _TMP28 = pow(_color0398.y, 4.54545438E-01);
    _TMP29 = pow(_color0398.z, 4.54545438E-01);
    _TMP1 = vec3(_TMP27, _TMP28, _TMP29);
    _ret_0 = vec4(_TMP1.x, _TMP1.y, _TMP1.z, _color0398.w);
    FragColor = _ret_0;
    return;
} 
#endif
