[SCM] calf/master: FFTW2 -> FFTW3
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:41:11 UTC 2013
The following commit has been merged in the master branch:
commit ebab697e311db3e26b5e600781a90d6707eb67d8
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Fri Sep 14 20:31:46 2012 +0100
FFTW2 -> FFTW3
diff --git a/configure.ac b/configure.ac
index 6b530fb..240fc15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.63)
-AC_INIT([calf],[0.0.19-rc1],[wdev at foltman.com])
+AC_INIT([calf],[0.0.19-rc2],[wdev at foltman.com])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
LT_INIT([dlopen])
@@ -50,8 +50,9 @@ AC_CHECK_HEADERS([memory.h stdint.h stdlib.h string.h time.h math.h])
AC_CHECK_HEADER(expat.h, true, AC_MSG_ERROR([Expat XML library not found]))
AC_CHECK_LIB(expat, XML_Parse, true, AC_MSG_ERROR([Expat XML library not found]))
-AC_CHECK_HEADER(srfftw.h, true, AC_MSG_ERROR([Single-precision FFTW2 header (srfftw.h) not found]))
-AC_CHECK_LIB(srfftw, true, AC_MSG_ERROR([Single-precision FFTW2 library (libsrfftw) not found]))
+AC_CHECK_HEADER(fftw3.h, true, AC_MSG_ERROR([FFTW3 header (fftw3.h) not found]))
+AC_CHECK_LIB(fftw3, true, AC_MSG_ERROR([FFTW3 library (libfftw3) not found]))
+AC_CHECK_LIB(fftw3f, true, AC_MSG_ERROR([Single-precision FFTW3 library (libfftw3f) not found]))
# JACK
AC_CHECK_HEADERS([jack/jack.h], have_jack_header=yes, have_jack_header=no)
diff --git a/src/Makefile.am b/src/Makefile.am
index eebdefa..b58c60f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,7 @@ AM_CXXFLAGS += $(JACK_DEPS_CFLAGS)
noinst_LTLIBRARIES += libcalfgui.la
bin_PROGRAMS += calfjackhost
calfjackhost_SOURCES = gtk_session_env.cpp host_session.cpp jack_client.cpp jackhost.cpp gtk_main_win.cpp session_mgr.cpp
-calfjackhost_LDADD = libcalfgui.la calf.la $(JACK_DEPS_LIBS) $(GUI_DEPS_LIBS) $(GLIB_DEPS_LIBS) $(FLUIDSYNTH_DEPS_LIBS) -lsrfftw -lsfftw
+calfjackhost_LDADD = libcalfgui.la calf.la $(JACK_DEPS_LIBS) $(GUI_DEPS_LIBS) $(GLIB_DEPS_LIBS) $(FLUIDSYNTH_DEPS_LIBS) -lfftw3f
if USE_LASH
AM_CXXFLAGS += $(LASH_DEPS_CFLAGS)
calfjackhost_LDADD += $(LASH_DEPS_LIBS)
@@ -32,17 +32,17 @@ endif
AM_CXXFLAGS += $(GLIB_DEPS_CFLAGS)
noinst_PROGRAMS += calfmakerdf
calfmakerdf_SOURCES = makerdf.cpp
-calfmakerdf_LDADD = calf.la
+calfmakerdf_LDADD = calf.la
calfbenchmark_SOURCES = benchmark.cpp
-calfbenchmark_LDADD = $(GLIB_DEPS_LIBS) -lsrfftw -lsfftw calf.la
+calfbenchmark_LDADD = calf.la $(GLIB_DEPS_LIBS)
calf_la_SOURCES = audio_fx.cpp metadata.cpp modules.cpp modules_comp.cpp modules_limit.cpp modules_dist.cpp modules_eq.cpp modules_mod.cpp fluidsynth.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp plugin.cpp preset.cpp synth.cpp utils.cpp wavetable.cpp modmatrix.cpp
-calf_la_LIBADD ?= $(FLUIDSYNTH_DEPS_LIBS)
+calf_la_LIBADD = $(FLUIDSYNTH_DEPS_LIBS) -lfftw3f
if USE_DEBUG
-calf_la_LDFLAGS = -rpath $(pkglibdir) -avoid-version -module -lexpat -disable-static $(FLUIDSYNTH_DEPS_LIBS) -lsrfftw -lsfftw
+calf_la_LDFLAGS = -rpath $(pkglibdir) -avoid-version -module -lexpat -disable-static
else
-calf_la_LDFLAGS = -rpath $(pkglibdir) -avoid-version -module -lexpat -disable-static -export-symbols-regex "lv2_descriptor" $(FLUIDSYNTH_DEPS_LIBS) -lsrfftw -lsfftw
+calf_la_LDFLAGS = -rpath $(pkglibdir) -avoid-version -module -lexpat -disable-static -export-symbols-regex "lv2_descriptor"
endif
if USE_LV2_GUI
diff --git a/src/calf/modules.h b/src/calf/modules.h
index d3977aa..583ab9d 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -21,8 +21,8 @@
#ifndef CALF_MODULES_H
#define CALF_MODULES_H
-#include "srfftw.h"
#include <assert.h>
+#include <fftw3.h>
#include <limits.h>
#include "biquad.h"
#include "inertia.h"
@@ -339,12 +339,12 @@ protected:
int plength;
int ppos;
int fpos;
- mutable rfftw_plan fft_plan;
+ mutable fftwf_plan fft_plan;
static const int max_fft_cache_size = 32768;
static const int max_fft_buffer_size = max_fft_cache_size * 2;
- fftw_real *fft_inL, *fft_outL;
- fftw_real *fft_inR, *fft_outR;
- fftw_real *fft_smoothL, *fft_smoothR;
+ float *fft_inL, *fft_outL;
+ float *fft_inR, *fft_outR;
+ float *fft_smoothL, *fft_smoothR;
float *fft_deltaL, *fft_deltaR;
float *fft_holdL, *fft_holdR;
float *fft_fallingL, *fft_fallingR;
diff --git a/src/modules.cpp b/src/modules.cpp
index 1f01692..91c3c7f 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -21,7 +21,7 @@
#include <limits.h>
#include <memory.h>
#include <math.h>
-#include <srfftw.h>
+#include <fftw3.h>
#include <calf/giface.h>
#include <calf/modules.h>
#include <calf/modules_dev.h>
@@ -880,15 +880,15 @@ analyzer_audio_module::analyzer_audio_module() {
fft_buffer = (float*) calloc(max_fft_buffer_size, sizeof(float));
memset(fft_buffer, 0, max_fft_buffer_size * sizeof(float));
- fft_inL = (fftw_real*) calloc(max_fft_cache_size, sizeof(fftw_real));
- fft_outL = (fftw_real*) calloc(max_fft_cache_size, sizeof(fftw_real));
- fft_inR = (fftw_real*) calloc(max_fft_cache_size, sizeof(fftw_real));
- fft_outR = (fftw_real*) calloc(max_fft_cache_size, sizeof(fftw_real));
+ fft_inL = (float*) calloc(max_fft_cache_size, sizeof(float));
+ fft_outL = (float*) calloc(max_fft_cache_size, sizeof(float));
+ fft_inR = (float*) calloc(max_fft_cache_size, sizeof(float));
+ fft_outR = (float*) calloc(max_fft_cache_size, sizeof(float));
- fft_smoothL = (fftw_real*) calloc(max_fft_cache_size, sizeof(fftw_real));
- fft_smoothR = (fftw_real*) calloc(max_fft_cache_size, sizeof(fftw_real));
- memset(fft_smoothL, 0, max_fft_cache_size * sizeof(fftw_real));
- memset(fft_smoothR, 0, max_fft_cache_size * sizeof(fftw_real));
+ fft_smoothL = (float*) calloc(max_fft_cache_size, sizeof(float));
+ fft_smoothR = (float*) calloc(max_fft_cache_size, sizeof(float));
+ memset(fft_smoothL, 0, max_fft_cache_size * sizeof(float));
+ memset(fft_smoothR, 0, max_fft_cache_size * sizeof(float));
fft_fallingL = (float*) calloc(max_fft_cache_size, sizeof(float));
fft_fallingR = (float*) calloc(max_fft_cache_size, sizeof(float));
@@ -927,11 +927,12 @@ void analyzer_audio_module::deactivate() {
void analyzer_audio_module::params_changed() {
bool ___sanitize = false;
if(*params[param_analyzer_accuracy] != _acc_old) {
- _accuracy = pow(2, 7 + *params[param_analyzer_accuracy]);
+ _accuracy = 1 << (7 + (int)*params[param_analyzer_accuracy]);
_acc_old = *params[param_analyzer_accuracy];
// recreate fftw plan
- if (fft_plan) rfftw_destroy_plan (fft_plan);
- fft_plan = rfftw_create_plan(_accuracy, FFTW_FORWARD, 0);
+ if (fft_plan) fftwf_destroy_plan (fft_plan);
+ //fft_plan = rfftw_create_plan(_accuracy, FFTW_FORWARD, 0);
+ fft_plan = fftwf_plan_r2r_1d(_accuracy, NULL, NULL, FFTW_R2HC, FFTW_ESTIMATE);
lintrans = -1;
___sanitize = true;
}
@@ -1204,8 +1205,8 @@ bool analyzer_audio_module::get_graph(int index, int subindex, float *data, int
// perhaps we need to compute two FFT's, so store left and right
// channel in case we need only one FFT, the left channel is
// used as 'standard'"
- fftw_real valL;
- fftw_real valR;
+ float valL;
+ float valR;
switch(_param_mode) {
case 0:
@@ -1260,11 +1261,11 @@ bool analyzer_audio_module::get_graph(int index, int subindex, float *data, int
// this takes our latest buffer and returns an array with
// non-normalized
if (fft_plan)
- rfftw_one(fft_plan, fft_inL, fft_outL);
+ fftwf_execute_r2r(fft_plan, fft_inL, fft_outL);
//run fft for for right channel too. it is needed for stereo image
//and stereo difference modes
if(_param_mode >= 3 and fft_plan) {
- rfftw_one(fft_plan, fft_inR, fft_outR);
+ fftwf_execute_r2r(fft_plan, fft_inR, fft_outR);
}
// ...and set some values for later use
____analyzer_phase_was_drawn_here = 0;
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list