From 982df3c009d4c7b86aab4c472fd6fb0e31272d22 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 10 Sep 2015 18:59:26 +0000 Subject: added equalizer optimization git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5553 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/equ/iir.h | 1 + src/qmmp/equ/iir_fpu.c | 9 +++++++++ 2 files changed, 10 insertions(+) (limited to 'src') 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) */ -- cgit v1.2.3-13-gbd6f