
36 Designing Scientific Applications on GPUs
(a) Airplane image, corrupted by salt
and pepper noise of density 0.25
(b) Image denoised by a 3 × 3 median
filter
(c) Image denoised by a 5 × 5 median
filter
(d) Image denoised by 2 iterations of a
3 × 3 median filter
FIGURE 4.3. Example of median filtering, applied to salt and pepper noise
reduction.
decrease. One easy way to avoid this is to ensure that two consecu-
tive threads in one block always access 32-bit data at two consecutive
addresses.
As observed earlier, designing a median filter GPU implementation us-
ing only global memory is fairly straightforward, but its performance remains
quite low even if it is ...