Fastest Available Algorithm to Blur an Image (Low Pass Filter) Iam working with a camera that produces ugly artifacts:


by using ANY blur filter on the camera's output the visual quality improves drastically:


The above image was created using OpenCV's cv::medianBlur with a kernel size of 3.
I identified cv::medianBlur to be the fastest smooth/blur method in OpenCV. 
However for my needs it is still too slow since it uses up to 80% of the whole processing time including encoding (ffmpeg MPEG4). I already tryed to use cv::UMAT but uploading each Image to the GPU and downloading the result again is taking even more time. So using OpenCL / Cuda isn't an option either!?   

Therefore Iam looking for the fastest way to blur/smooth an image. However there are so many algorithms in so many librarys(OpenCV/IPP/swscale) to implement and test them all would take to much time. So do you have any suggestions which algorithms I can take a look at, or could offer a really good performance?

Here are some test results for 75.000 iterations of a 640x360 image:

+------------------------------+--------+----------+
|          Algorithm           | Kernel | Time(ms) |
+------------------------------+--------+----------+
| cv::medianBlur               | 3x3    | 18492    |
| cv::medianBlur ocl           | 3x3    | 54596    |
| ippiFilterMedianCross_8u_C3R | 3x3    | 15755    |
| cv::blur                     | 3x3    | &gt;100000  |
| cv::GaussianBlur             | 3x3    | &gt;100000  |
| cv::filter2d                 | 3x3    | &gt;100000  |
+------------------------------+--------+----------+
The fastest blur would be Box Blur.
You can implement it using Running Sum.
I think Intel FilterBoxBorder works in that manner.

If you'd like you can do a few passes of it to approximate the Gaussian Blur.

You can also use IIR Filter Coefficients to blur the image quite easily.

You may have a look at my project Fast Gaussian Blur.