Graphics Reference
In-Depth Information
While this change to the algorithm does indeed reduce the number of arithmetic op-
erations performed by each thread, it also increases the number of memory access opera-
tions as well. The group shared memory is supposed to be a very fast memory area, but
there is still some performance penalty for accessing it. In addition, the arithmetic opera-
tions we are attempting to minimize in this case are simple multiplications, which modern
GPUs can perform quite quickly. This may mean that any potential performance gains will
be relatively small. This type of calculation would be more beneficial if we were replacing
longer computational strings or more expensive instructions. In the end, the final results
will likely vary by the GPU being used and its individual performance characteristics for
arithmetic and memory access operations.
10.2.3 Conclusion
The Gaussian filter is a very widely used filter, which provides an adjustable amount of
blurring and can be used with a variety of different filter sizes. This allows the filter's
performance to be adjusted to the given situation. By using the separable nature of the
Gaussian filter, we greatly reduced the number of memory access and arithmetic opera-
tions, and then further reduced the number of memory accesses by using the group shared
memory as a customized memory cache. We even further reduced the number of arithmetic
operations by precalculating some filter elements that are shared by more than one pixel.
This type of optimization trades arithmetic operations for memory access operations, and
can be beneficial in some cases, when sufficiently heavy arithmetic operations are being re-
placed. However, it may not always produce a net performance improvement. This means
that the algorithm should be carefully designed to use the GSM only when it is beneficial
to do so.
10.3 Bilateral Filter
The second filter algorithm we will investigate is the bilateral filter. This filter was origi-
nally proposed in (Tomasi, 1998). It is similar in nature to the Gaussian filter and provides
another form of a blurring filter. However, the bilateral filter blurs an image while still
preserving the sharp edges and object boundaries in the image content. This is in contrast to
the Gaussian filter, which blurs the complete image regardless of the content. If a Gaussian
filter is used to blur the image several times in succession, the image can become washed
out, and it can become difficult to discern between objects. Figure 10.11 demonstrates the
difference between the two filter outputs after performing several passes of the filter.
Search WWH ::




Custom Search