Optimizing Gaussian blurs on a mobile GPU
sunsetlakesoftware.com
Optimizing Gaussian blurs on a mobile GPU
1–10 of 24 posts
Re: Optimizing Gaussian blurs on a mobile GPU
#2Re: Optimizing Gaussian blurs on a mobile GPU
#3You might need an Arbitrary Hack Constant (oh, sorry, "tuning parameter") to decide when to make that transition.
Re: Optimizing Gaussian blurs on a mobile GPU
#4Another opportunity for efficient blur would be to rescale the image if the blur radius is above a certain amount. This incurs overhead, so for smaller radii it might be more efficient to just blur the full-size image, but for larger radii you can first reduce the image, blur with a smaller radius, and then upscale the image. You might need an Arbitrary Hack Constant (oh, sorry, "tuning parameter") to decide when to…
> Instead of filtering the image in its native resolution, I used OpenGL's native support for linear interpolation to downsample the source image by 4X in width and height, blurred that downsampled image, then linearly upsampled via OpenGL afterward.
Re: Optimizing Gaussian blurs on a mobile GPU
#5Really great read!
[0]: http://whoisryannystrom.com/2013/09/17/Live-blur-in-iOS7/
Re: Optimizing Gaussian blurs on a mobile GPU
#6Re: Optimizing Gaussian blurs on a mobile GPU
#7Re: Optimizing Gaussian blurs on a mobile GPU
#8You can do Gaussian filter in 2 passes: first along X, then along Y. Then you only grow linearly in size, rather than quadratically. This change should also improve your cache hits.
Re: Optimizing Gaussian blurs on a mobile GPU
#9Re: Optimizing Gaussian blurs on a mobile GPU
#10Another opportunity for efficient blur would be to rescale the image if the blur radius is above a certain amount. This incurs overhead, so for smaller radii it might be more efficient to just blur the full-size image, but for larger radii you can first reduce the image, blur with a smaller radius, and then upscale the image. You might need an Arbitrary Hack Constant (oh, sorry, "tuning parameter") to decide when to…
That's already in the article: > Instead of filtering the image in its native resolution, I used OpenGL's native support for linear interpolation to downsample the source image by 4X in width and height, blurred that downsampled image, then linearly upsampled via OpenGL afterward.