gst/filter/: Don't forget new files.
[platform/upstream/gst-plugins-good.git] / gst / audiofx / audiowsinclimit.h
1 /* -*- c-basic-offset: 2 -*-
2  * 
3  * GStreamer
4  * Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
5  *               2006 Dreamlab Technologies Ltd. <mathis.hofer@dreamlab.net>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  * 
22  * 
23  * this windowed sinc filter is taken from the freely downloadable DSP book,
24  * "The Scientist and Engineer's Guide to Digital Signal Processing",
25  * chapter 16
26  * available at http://www.dspguide.com/
27  *
28  * FIXME:
29  * - this filter is totally unoptimized !
30  * - we do not destroy the allocated memory for filters and residue
31  * - this might be improved upon with bytestream
32  */
33
34 #ifndef __GST_LPWSINC_H__
35 #define __GST_LPWSINC_H__
36
37 #include "gstfilter.h"
38 #include <gst/gst.h>
39 #include <gst/base/gstbasetransform.h>
40
41 G_BEGIN_DECLS
42
43 #define GST_TYPE_LPWSINC \
44   (gst_lpwsinc_get_type())
45 #define GST_LPWSINC(obj) \
46   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LPWSINC,GstLPWSinc))
47 #define GST_LPWSINC_CLASS(klass) \
48   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_LPWSINC,GstLPWSincClass))
49 #define GST_IS_LPWSINC(obj) \
50   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LPWSINC))
51 #define GST_IS_LPWSINC_CLASS(klass) \
52   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_LPWSINC))
53
54 typedef struct _GstLPWSinc GstLPWSinc;
55 typedef struct _GstLPWSincClass GstLPWSincClass;
56
57 /**
58  * GstLPWSinc:
59  *
60  * Opaque data structure.
61  */
62 struct _GstLPWSinc {
63   GstBaseTransform element;
64
65   void (*process)(GstLPWSinc*, gpointer, gint);
66
67   double frequency;
68   int wing_size;                /* length of a "wing" of the filter; 
69                                    actual length is 2 * wing_size + 1 */
70
71   gfloat *residue;              /* buffer for left-over samples from previous buffer */
72   double *kernel;
73 };
74
75 struct _GstLPWSincClass {
76   GstBaseTransformClass parent_class;
77 };
78
79 G_END_DECLS
80
81 #endif /* __GST_LPWSINC_H__ */