source: roaraudio/include/libroardsp/filters.h @ 4953:bbb95f1eaaad

Last change on this file since 4953:bbb95f1eaaad was 4953:bbb95f1eaaad, checked in by phi, 13 years ago

Done some libroardsp header cleanup (Closes: #36)

File size: 6.1 KB
Line 
1//filters.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2011
5 *
6 *  This file is part of libroar a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  libroar is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 *  NOTE for everyone want's to change something and send patches:
25 *  read README and HACKING! There a addition information on
26 *  the license of this document you need to read before you send
27 *  any patches.
28 *
29 *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
30 *  or libpulse*:
31 *  The libs libroaresd, libroararts and libroarpulse link this lib
32 *  and are therefore GPL. Because of this it may be illigal to use
33 *  them with any software that uses libesd, libartsc or libpulse*.
34 */
35
36#ifndef _LIBROARDSP_FILTERS_H_
37#define _LIBROARDSP_FILTERS_H_
38
39#include "libroardsp.h"
40
41#ifdef ROAR_HAVE_LIBM
42struct roardsp_lowp {
43 uint32_t freq; // in mHz (0Hz..4MHz)
44 uint16_t a, b;
45 int32_t  old[ROAR_MAX_CHANNELS];
46};
47
48struct roardsp_highp {
49 uint32_t freq; // in mHz (0Hz..4MHz)
50 int32_t  a, b, c;
51 int32_t  oldout[ROAR_MAX_CHANNELS];
52 int32_t  oldin[ROAR_MAX_CHANNELS];
53};
54#endif
55
56struct roardsp_amp {
57 int32_t  mul;
58 int32_t  div;
59};
60
61struct roardsp_dcblock {
62 int cur;
63 int32_t dc[ROARDSP_DCBLOCK_NUMBLOCKS];
64};
65
66struct roardsp_swap {
67 int map[ROAR_MAX_CHANNELS];
68};
69
70struct roardsp_agc {
71 struct roardsp_filter * amp;
72 uint32_t target_amp;
73};
74
75struct roardsp_speex_prep {
76#ifdef _SPEEX_TYPES_H
77 SpeexPreprocessState *preprocess;
78 int frame_size;
79#else
80 char dummy[8];
81#endif
82};
83
84
85// filter:
86
87#ifdef ROAR_HAVE_LIBM
88int roardsp_lowp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
89int roardsp_lowp_uninit(struct roardsp_filter * filter);
90int roardsp_lowp_calc16(struct roardsp_filter * filter, void * data, size_t samples);
91int roardsp_lowp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
92int roardsp_lowp_reset (struct roardsp_filter * filter, int what);
93
94int roardsp_highp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
95int roardsp_highp_uninit(struct roardsp_filter * filter);
96int roardsp_highp_calc16(struct roardsp_filter * filter, void * data, size_t samples);
97int roardsp_highp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
98int roardsp_highp_reset (struct roardsp_filter * filter, int what);
99#endif
100
101int roardsp_amp_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
102int roardsp_amp_uninit(struct roardsp_filter * filter);
103int roardsp_amp_calc16(struct roardsp_filter * filter, void * data, size_t samples);
104int roardsp_amp_calc8 (struct roardsp_filter * filter, void * data, size_t samples);
105int roardsp_amp_ctl   (struct roardsp_filter * filter, int cmd, void * data);
106int roardsp_amp_reset (struct roardsp_filter * filter, int what);
107
108int roardsp_add_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
109int roardsp_add_calc16(struct roardsp_filter * filter, void * data, size_t samples);
110int roardsp_add_reset (struct roardsp_filter * filter, int what);
111
112int roardsp_quantify_init  (struct roardsp_filter * filter, struct roar_stream * stream, int id);
113int roardsp_quantify_uninit(struct roardsp_filter * filter);
114int roardsp_quantify_calc16(struct roardsp_filter * filter, void * data, size_t samples);
115int roardsp_quantify_ctl   (struct roardsp_filter * filter, int cmd, void * data);
116int roardsp_quantify_reset (struct roardsp_filter * filter, int what);
117
118int roardsp_clip_calc16(struct roardsp_filter * filter, void * data, size_t samples);
119int roardsp_clip_ctl   (struct roardsp_filter * filter, int cmd, void * data);
120int roardsp_clip_reset (struct roardsp_filter * filter, int what);
121
122int roardsp_downmix_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
123int roardsp_downmix_calc162(struct roardsp_filter * filter, void * data, size_t samples);
124int roardsp_downmix_ctl    (struct roardsp_filter * filter, int cmd, void * data);
125int roardsp_downmix_reset  (struct roardsp_filter * filter, int what);
126
127int roardsp_dcblock_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
128int roardsp_dcblock_uninit (struct roardsp_filter * filter);
129int roardsp_dcblock_calc16 (struct roardsp_filter * filter, void * data, size_t samples);
130int roardsp_dcblock_reset  (struct roardsp_filter * filter, int what);
131
132int roardsp_swap_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
133int roardsp_swap_uninit (struct roardsp_filter * filter);
134int roardsp_swap_calc162(struct roardsp_filter * filter, void * data, size_t samples);
135int roardsp_swap_ctl    (struct roardsp_filter * filter, int cmd, void * data);
136int roardsp_swap_reset  (struct roardsp_filter * filter, int what);
137
138int roardsp_agc_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
139int roardsp_agc_uninit (struct roardsp_filter * filter);
140int roardsp_agc_ctl    (struct roardsp_filter * filter, int cmd, void * data);
141int roardsp_agc_reset  (struct roardsp_filter * filter, int what);
142
143#ifdef _SPEEX_TYPES_H
144#define ROAR_HAVE_SPEEX_FILTER
145int roardsp_speex_prep_init   (struct roardsp_filter * filter, struct roar_stream * stream, int id);
146int roardsp_speex_prep_uninit (struct roardsp_filter * filter);
147int roardsp_speex_prep_calc161(struct roardsp_filter * filter, void * data, size_t samples);
148int roardsp_speex_prep_ctl    (struct roardsp_filter * filter, int cmd, void * data);
149int roardsp_speex_prep_reset  (struct roardsp_filter * filter, int what);
150#endif
151
152
153#endif
154
155//ll
Note: See TracBrowser for help on using the repository browser.