diff options
| -rw-r--r-- | src/qmmp/equ/iir_fpu.c | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/src/qmmp/equ/iir_fpu.c b/src/qmmp/equ/iir_fpu.c index 3efac6403..f1416be63 100644 --- a/src/qmmp/equ/iir_fpu.c +++ b/src/qmmp/equ/iir_fpu.c @@ -36,9 +36,6 @@ static sXYData data_history[EQ_CHANNELS][EQ_MAX_BANDS] __attribute__((aligned)); static sXYData data_history2[EQ_CHANNELS][EQ_MAX_BANDS] __attribute__((aligned)); float gain[EQ_CHANNELS][EQ_MAX_BANDS] __attribute__((aligned)); -/* random noise */ -//sample_t dither[256]; -//int di; void set_gain(int index, int chn, float val) { @@ -51,12 +48,6 @@ void clean_history() /* Zero the history arrays */ memset(data_history, 0, sizeof(sXYData) * EQ_MAX_BANDS * EQ_CHANNELS); memset(data_history2, 0, sizeof(sXYData) * EQ_MAX_BANDS * EQ_CHANNELS); - /* this is only needed if we use fpu code and there's no other place for - the moment to init the dither array*/ - //for (n = 0; n < 256; n++) { - // dither[n] = (rand() % 4) - 2; - //} - //di = 0; } __inline__ int iir(float *d, int samples, int nch) @@ -69,18 +60,8 @@ __inline__ int iir(float *d, int samples, int nch) static int i = 2, j = 1, k = 0; int index, band, channel; - //int tempgint; sample_t out[EQ_CHANNELS], pcm[EQ_CHANNELS]; - // Load the correct filter table according to the sampling rate if needed - /*if (srate != rate) - { - band_count = eqcfg.band_num; - rate = srate; - iir_cf = get_coeffs(&band_count, rate, eqcfg.use_xmms_original_freqs); - clean_history(); - }*/ - #ifdef BENCHMARK start_counter(); #endif //BENCHMARK @@ -171,34 +152,8 @@ __inline__ int iir(float *d, int samples, int nch) */ out[channel] += pcm[channel]*0.25; - /* remove random noise */ - //out[channel] -= dither[di]*0.25; - - /* Round and convert to integer */ -/*#ifdef ARCH_PPC - tempgint = round_ppc(out[channel]); -#else -#ifdef ARCH_X86 - tempgint = round_trick(out[channel]); -#else - tempgint = (int)out[channel]; -#endif -#endif*/ - - /* Limit the output */ - /*if (tempgint < -32768) - data[index+channel] = -32768; - else if (tempgint > 32767) - data[index+channel] = 32767; - else - data[index+channel] = tempgint;*/ - - data[index+channel] = out[channel]; - if(data[index+channel] > 1.0) - data[index+channel] = 1.0; - else if(data[index+channel] < -1.0) - data[index+channel] = -1.0; + data[index+channel] = out[channel] > 1.0 ? 1.0 : (out[channel] < -1.0 ? -1.0 : out[channel]); } /* For each channel */ @@ -206,8 +161,6 @@ __inline__ int iir(float *d, int samples, int nch) i = (i+1)%3; j = (j+1)%3; k = (k+1)%3; - /* random noise index */ - //di = (di + 1) % 256; }/* For each pair of samples */ |
