aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qmmp/equ/iir.h1
-rw-r--r--src/qmmp/equ/iir_fpu.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/qmmp/equ/iir.h b/src/qmmp/equ/iir.h
index b8e96c52b..816773afe 100644
--- a/src/qmmp/equ/iir.h
+++ b/src/qmmp/equ/iir.h
@@ -24,6 +24,7 @@
modifications compared to original code:
added 48/96 kHz sampling rate support
added 24/32bit sample size support
+ added optimization
removed glib dependency
*/
diff --git a/src/qmmp/equ/iir_fpu.c b/src/qmmp/equ/iir_fpu.c
index 3c276dda4..9b19be241 100644
--- a/src/qmmp/equ/iir_fpu.c
+++ b/src/qmmp/equ/iir_fpu.c
@@ -24,6 +24,7 @@
modifications compared to original code:
added 48/96 kHz sampling rate support
added 24/32bit sample size support
+ added optimization
removed glib dependency
*/
@@ -114,6 +115,10 @@ __inline__ int iir(void * d, int length, int nch)
/* For each band */
for (band = 0; band < band_count; band++)
{
+ /* Optimization */
+ if(gain[band][channel] > -1.0e-10 && gain[band][channel] < 1.0e-10)
+ continue;
+
/* Store Xi(n) */
data_history[band][channel].x[i] = pcm[channel];
/* Calculate and store Yi(n) */
@@ -139,6 +144,10 @@ __inline__ int iir(void * d, int length, int nch)
/* Filter the sample again */
for (band = 0; band < band_count; band++)
{
+ /* Optimization */
+ if(gain[band][channel] > -1.0e-10 && gain[band][channel] < 1.0e-10)
+ continue;
+
/* Store Xi(n) */
data_history2[band][channel].x[i] = out[channel];
/* Calculate and store Yi(n) */