comparison audacious/iir.h @ 430:67cd014f35a2 trunk

[svn] This commit rips out the old equalization engine with a dynamic engine that can be extended all the way up to 128 bands.
author nenolod
date Sat, 14 Jan 2006 16:49:00 -0800
parents cb178e5ad177
children 802c9f8461e0
comparison
equal deleted inserted replaced
429:e9569b4111b4 430:67cd014f35a2
1 /* 1 /*
2 * PCM time-domain equalizer 2 * PCM time-domain equalizer
3 * 3 *
4 * Copyright (C) 2002 Felipe Rivera <liebremx at users.sourceforge.net> 4 * Copyright (C) 2002-2005 Felipe Rivera <liebremx at users.sourceforge.net>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 * 19 *
20 * $Id: iir.h,v 1.5 2004/06/20 18:48:54 mderezynski Exp $ 20 * $Id: iir.h,v 1.12 2005/10/17 01:57:59 liebremx Exp $
21 */ 21 */
22 #ifndef IIR_H 22 #ifndef IIR_H
23 #define IIR_H 23 #define IIR_H
24 24
25 #define EQ_MAX_BANDS 10 25 #include <glib.h>
26 #define EQ_CHANNELS 2 26 #include "main.h"
27 #include "iir_cfs.h"
27 28
28 extern float gain[10]; 29 /*
29 extern float preamp; 30 * Flush-to-zero to avoid flooding the CPU with underflow exceptions
31 */
32 #ifdef SSE_MATH
33 #define FTZ 0x8000
34 #define FTZ_ON { \
35 unsigned int mxcsr; \
36 __asm__ __volatile__ ("stmxcsr %0" : "=m" (*&mxcsr)); \
37 mxcsr |= FTZ; \
38 __asm__ __volatile__ ("ldmxcsr %0" : : "m" (*&mxcsr)); \
39 }
40 #define FTZ_OFF { \
41 unsigned int mxcsr; \
42 __asm__ __volatile__ ("stmxcsr %0" : "=m" (*&mxcsr)); \
43 mxcsr &= ~FTZ; \
44 __asm__ __volatile__ ("ldmxcsr %0" : : "m" (*&mxcsr)); \
45 }
46 #else
47 #define FTZ_ON
48 #define FTZ_OFF
49 #endif
30 50
31 int iir(gpointer * d, gint length); 51 /*
52 * Function prototypes
53 */
32 void init_iir(); 54 void init_iir();
55 void clean_history();
56 void set_gain(gint index, gint chn, float val);
57 void set_preamp(gint chn, float val);
33 58
34 59
35 #endif /* #define IIR_H */ 60 __inline__ int iir(gpointer * d, gint length, gint nch);
61
62 #ifdef ARCH_X86
63 __inline__ int round_trick(float floatvalue_to_round);
64 #endif
65 #ifdef ARCH_PPC
66 __inline__ int round_ppc(float x);
67 #endif
68
69 #define EQ_CHANNELS 2
70 #define EQ_MAX_BANDS 10
71
72 extern float preamp[EQ_CHANNELS];
73 extern sIIRCoefficients *iir_cf;
74 extern gint rate;
75 extern gint band_count;
76
77 #ifdef BENCHMARK
78 extern double timex;
79 extern int count;
80 extern unsigned int blength;
81 #endif
82
83 #endif /* #define IIR_H */
84