X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=fft_input.cpp;h=bbc4a5fd4ff44a32d291654c3ff615a4866d9801;hp=b37d52039b77c7b15aa4a13242af328d6a54d4f2;hb=eff011224abc5dc81f801f3ea44572287a55bcac;hpb=9c12e38b7cd88a77ef297d080b7c41e6bd6326fb diff --git a/fft_input.cpp b/fft_input.cpp index b37d520..bbc4a5f 100644 --- a/fft_input.cpp +++ b/fft_input.cpp @@ -19,7 +19,7 @@ FFTInput::FFTInput(unsigned width, unsigned height) fft_height(height), convolve_width(width), convolve_height(height), - pixel_data(NULL) + pixel_data(nullptr) { register_int("fft_width", &fft_width); register_int("fft_height", &fft_height); @@ -39,7 +39,7 @@ void FFTInput::set_gl_state(GLuint glsl_program_num, const string& prefix, unsig check_error(); if (texture_num == 0) { - assert(pixel_data != NULL); + assert(pixel_data != nullptr); // Do the FFT. Our FFTs should typically be small enough and // the data changed often enough that FFTW_ESTIMATE should be @@ -67,8 +67,8 @@ void FFTInput::set_gl_state(GLuint glsl_program_num, const string& prefix, unsig // Convert to fp16. fp16_int_t *kernel = new fp16_int_t[fft_width * fft_height * 2]; for (int i = 0; i < fft_width * fft_height; ++i) { - kernel[i * 2 + 0] = fp64_to_fp16(out[i][0]); - kernel[i * 2 + 1] = fp64_to_fp16(out[i][1]); + kernel[i * 2 + 0] = fp32_to_fp16(out[i][0]); + kernel[i * 2 + 1] = fp32_to_fp16(out[i][1]); } // (Re-)upload the texture.