Fast median filters using separable sorting networks
Andrew Adams
Abstract
Median filters are a widely-used tool in graphics, imaging, machine learning, visual effects, and even audio processing. Currently, very-small-support median filters are performed using sorting networks, and large-support median filters are handled by O (1) histogram-based methods. However, the constant factor on these O (1) algorithms is large, and they scale poorly to data types above 8-bit integers. On the other hand, good sorting networks have not been described above the 7 X 7 case, leaving us with no fast way to compute integer median filters of modest size, and no fast way to compute floating point median filters for any size above 7 X 7. This paper describes new sorting networks that efficiently compute median filters of arbitrary size. The key idea is that these networks can be factored to exploit the separability of the sorting problem - they share common work across scanlines, and within small tiles of output. We also describe new ways to run sorting networks efficiently, using a sorting-specific instruction set, compiler, and interpreter. The speed-up over prior work is more than an order of magnitude for a wide range of data types and filter sizes. For 8-bit integers, we describe the fastest median filters for all sizes up to 25 X 25 on CPU, and up to 33 X 33 on GPU. For higher-precision types, we describe the fastest median filters at all sizes tested on both CPU and GPU.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 1ae3a7d5-055e-4dcf-90de-3ecb45299f88Cited by top-tier papers2
- Fast Isotropic Median FilteringBen WeissSIGGRAPH 2025 · 1 citation
- A Fast Parallel Median Filtering Algorithm Using Hierarchical TilingLouis SugySIGGRAPH 2025 · 1 citation
Related papers
- Origami: A High-Performance Mergesort FrameworkArif Arman, Dmitri LoguinovVLDB 2022 · 3 citations
- Minuet: Accelerating 3D Sparse Convolutions on GPUsJiacheng Yang, Christina Giannoula, Jun Wu, Mostafa Elhoushi et al.EuroSys 2024 · 2 citations
- PAGANI: a parallel adaptive GPU algorithm for numerical integrationIoannis Sakiotis, Kamesh Arumugam, Marc F. Paterno, Desh Ranjan et al.SC 2021 · 4 citations
- DWM: A Decomposable Winograd Method for Convolution AccelerationDi Huang, Xishan Zhang, Rui Zhang, Tian Zhi et al.AAAI 2020 · 31 citations
- A one-for-all and o(v log(v ))-cost solution for parallel merge style operations on sorted key-value arraysBangyan Wang, Lei Deng, Fei Sun, Guohao Dai et al.ASPLOS 2022 · 1 citation
