gl_common: minor cleanup/refactor
[mplayer.git] / libvo / filter_kernels.h
blob46a392c40a2595b7ab06c9730d63c9c9f7071c6d
1 /*
2 * This file is part of mplayer2.
4 * mplayer2 is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * mplayer2 is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with mplayer2; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef MPLAYER_FILTER_KERNELS_H
20 #define MPLAYER_FILTER_KERNELS_H
22 #include <stdbool.h>
24 struct filter_kernel {
25 const char *name;
26 double radius;
27 double (*weight)(struct filter_kernel *kernel, double x);
29 // The filter params can be changed at runtime. Only used by some filters.
30 float params[2];
31 // The following values are set by mp_init_filter() at runtime.
32 // Number of coefficients; equals the rounded up radius multiplied with 2.
33 int size;
34 double inv_scale;
37 extern const struct filter_kernel mp_filter_kernels[];
39 const struct filter_kernel *mp_find_filter_kernel(const char *name);
40 bool mp_init_filter(struct filter_kernel *filter, const int *sizes,
41 double scale);
42 void mp_compute_weights(struct filter_kernel *filter, double f, float *out_w);
43 void mp_compute_lut(struct filter_kernel *filter, int count, float *out_array);
45 #endif /* MPLAYER_FILTER_KERNELS_H */