From c3b05ebdc87be03e1cce5ccc5aa9398db3054f53 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 26 Dec 2015 10:26:11 +0000 Subject: changed visual api, disabled broken plugins git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5885 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Ui/skinned/fft.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/plugins/Ui/skinned/fft.c') diff --git a/src/plugins/Ui/skinned/fft.c b/src/plugins/Ui/skinned/fft.c index 0ea89eae6..2865e878e 100644 --- a/src/plugins/Ui/skinned/fft.c +++ b/src/plugins/Ui/skinned/fft.c @@ -25,6 +25,11 @@ * More optimisations. */ +/* + modifications compared to original code: + using float format for input data +*/ + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -56,7 +61,7 @@ struct _struct_fft_state { /* # Local function prototypes # */ /* ############################# */ -static void fft_prepare(const sound_sample * input, float *re, float *im); +static void fft_prepare(const float *input, float *re, float *im); static void fft_calculate(float *re, float *im); static void fft_output(const float *re, const float *im, float *output); static int reverseBits(unsigned int initial); @@ -126,7 +131,7 @@ fft_init(void) * state is a (non-NULL) pointer returned by fft_init. */ void -fft_perform(const sound_sample * input, float *output, fft_state * state) +fft_perform(const float *input, float *output, fft_state * state) { /* Convert data from sound format to be ready for FFT */ fft_prepare(input, state->real, state->imag); @@ -156,7 +161,7 @@ fft_close(fft_state * state) * Prepare data to perform an FFT on */ static void -fft_prepare(const sound_sample * input, float *re, float *im) +fft_prepare(const float *input, float *re, float *im) { unsigned int i; float *realptr = re; @@ -164,7 +169,7 @@ fft_prepare(const sound_sample * input, float *re, float *im) /* Get input, in reverse bit order */ for (i = 0; i < FFT_BUFFER_SIZE; i++) { - *realptr++ = input[bitReverse[i]]; + *realptr++ = input[bitReverse[i]] * 32767.0; *imagptr++ = 0; } } @@ -174,7 +179,7 @@ fft_prepare(const sound_sample * input, float *re, float *im) * Note: only produces half as many data points as the input had. * This is roughly a consequence of the Nyquist sampling theorm thingy. * (FIXME - make this comment better, and helpful.) - * + * * The two divisions by 4 are also a consequence of this: the contributions * returned for each frequency are split into two parts, one at i in the * table, and the other at FFT_BUFFER_SIZE - i, except for i = 0 and -- cgit v1.2.3-13-gbd6f