From 323fc04cb707d2a4b16e617279f2b82d86a9a2df Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Mon, 8 Oct 2007 10:32:16 +0000 Subject: Committed missing files needed for new out-of-place fftw plan creation --- src/fini.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ src/xtract_globals_private.h | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/fini.c create mode 100644 src/xtract_globals_private.h (limited to 'src') diff --git a/src/fini.c b/src/fini.c new file mode 100644 index 0000000..3ec9133 --- /dev/null +++ b/src/fini.c @@ -0,0 +1,48 @@ +/* libxtract feature extraction library + * + * Copyright (C) 2006 Jamie Bullock + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ + +/* fini.c: Contains library destructor routine */ + +#ifdef XTRACT_FFT +#include +#include "xtract_globals_private.h" +#endif + +#ifdef __GNUC__ +__attribute__((destructor)) void fini() +#else +void _fini() +#endif +{ +#ifdef XTRACT_FFT + if(spectrum_plan != NULL) + fftwf_destroy_plan(spectrum_plan); + if(autocorrelation_fft_plan_1 != NULL) + fftwf_destroy_plan(autocorrelation_fft_plan_1); + if(autocorrelation_fft_plan_2 != NULL) + fftwf_destroy_plan(autocorrelation_fft_plan_2); + if(dct_plan != NULL) + fftwf_destroy_plan(dct_plan); + fftwf_cleanup(); +#endif +} + + + diff --git a/src/xtract_globals_private.h b/src/xtract_globals_private.h new file mode 100644 index 0000000..ab96044 --- /dev/null +++ b/src/xtract_globals_private.h @@ -0,0 +1,36 @@ +/* libxtract feature extraction library + * + * Copyright (C) 2006 Jamie Bullock + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ + +/* xtract_globals_private.h: declares private global variables */ + +#ifndef XTRACT_GLOBALS_PRIVATE_H +#define XTRACT_GLOBALS_PRIVATE_H + +#ifdef XTRACT_FFT +#include + +fftwf_plan spectrum_plan, + autocorrelation_fft_plan_1, + autocorrelation_fft_plan_2, + dct_plan; +#endif + +#endif + -- cgit v1.2.3