In ResampleEffect, precompute the Lanczos function into a table.
[movit] / fft_input.cpp
index 76e77d6..b37d520 100644 (file)
@@ -23,6 +23,7 @@ FFTInput::FFTInput(unsigned width, unsigned height)
 {
        register_int("fft_width", &fft_width);
        register_int("fft_height", &fft_height);
+       register_uniform_sampler2d("tex", &uniform_tex);
 }
 
 FFTInput::~FFTInput()
@@ -98,13 +99,14 @@ void FFTInput::set_gl_state(GLuint glsl_program_num, const string& prefix, unsig
        }
 
        // Bind it to a sampler.
-       set_uniform_int(glsl_program_num, prefix, "tex", *sampler_num);
+       uniform_tex = *sampler_num;
        ++*sampler_num;
 }
 
 string FFTInput::output_fragment_shader()
 {
-       return read_file("flat_input.frag");
+       return string("#define FIXUP_SWAP_RB 0\n#define FIXUP_RED_TO_GRAYSCALE 0\n") +
+               read_file("flat_input.frag");
 }
 
 void FFTInput::invalidate_pixel_data()