A Survey of Gaussian Convolution Algorithms
|
Suite of different 1D Gaussian convolution methods. More...
Suite of different 1D Gaussian convolution methods.
Copyright (c) 2013, Pascal Getreuer All rights reserved.
This program is free software: you can redistribute it and/or modify it under, at your option, the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or the terms of the simplified BSD license.
You should have received a copy of these licenses along with this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.
Definition in file strategy_gaussian_conv.h.
#include "num.h"
Go to the source code of this file.
Typedefs | |
typedef struct gconv_ | gconv |
Plan to perform a 1D Gaussian convolution for any algorithm. More... | |
Functions | |
gconv * | gconv_plan (num *dest, const num *src, long N, long stride, const char *algo, double sigma, int K, num tol) |
Plan a 1D Gaussian convolution. More... | |
void | gconv_execute (gconv *g) |
Execute a 1D Gaussian convolution. More... | |
void | gconv_free (gconv *g) |
Free memory associated with a gconv. More... | |
Plan to perform a 1D Gaussian convolution for any algorithm.
The gconv* object represents a generic plan to perform a 1D Gaussian convolution using any of the implemented algorithms. It is an application of the strategy design pattern to allow the different Gaussian convolution algorithms to be easily interchangeable in the benchmarking code.
Use is similar to FFTW's fftw_plan. A gconv* object is first created by gconv_plan(), then the 1D Gaussian convolution is performed by gconv_execute(), and finally gconv_free() cleans up. The same Gaussian convolution may be executed multiple times by multiple calls to gconv_execute(). This interface allows to separate precomputation and actual execution in timing tests.
Most of the Gaussian convolution algorithm implementations follow this structure of plan, execute, free, but there are variations in the number of algorithm parameters and whether additional workspace memory is required. The implementation of gconv* is simply a set of wrapper functions to unify all algorithms to the same interface.
Definition at line 54 of file strategy_gaussian_conv.h.
void gconv_execute | ( | gconv * | g | ) |
Execute a 1D Gaussian convolution.
g | gconv* created by gconv_plan() |
Definition at line 125 of file strategy_gaussian_conv.c.
void gconv_free | ( | gconv * | g | ) |
Free memory associated with a gconv.
g | gconv* created by gconv_plan() |
Definition at line 134 of file strategy_gaussian_conv.c.
gconv* gconv_plan | ( | num * | dest, |
const num * | src, | ||
long | N, | ||
long | stride, | ||
const char * | algo, | ||
double | sigma, | ||
int | K, | ||
num | tol | ||
) |
Plan a 1D Gaussian convolution.
dest | destination array |
src | source array |
N | number of samples |
stride | stride between successive samples |
algo | Gaussian convolution algorithm |
sigma | Gaussian standard deviation |
K | algorithm steps or filter order parameter |
tol | algorithm accuracy parameter |
Definition at line 72 of file strategy_gaussian_conv.c.