I need a fast implementation of 2d grayscale image convolution procedure (based on Fourier Transform), programming language is C / C++. I know about opencv filter2d() function, but i cant use opencv or other 3rd-party libraries in my project. Now I use direct implementation, but it is very slow. Image is about 500x500 and kernel is ablout 25x25. Please help.