diff --git a/CMakeLists.txt b/CMakeLists.txt index 50f8eaf..b5da529 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,6 @@ add_definitions(-DGABORATOR_USE_PFFFT) include_directories(lib/gaborator) include_directories(lib/pffft) -add_library(cgaborator SHARED cgaborator.cpp lib/pffft/pffft.c lib/pffft/fftpack.c) +add_library(cgaborator STATIC cgaborator.cpp lib/pffft/pffft.c lib/pffft/fftpack.c) target_link_options(cgaborator PRIVATE -static-libgcc -static-libstdc++) \ No newline at end of file diff --git a/build-deps.sh b/build-deps.sh deleted file mode 100755 index ee8a01b..0000000 --- a/build-deps.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -ex - -pushd "${0%/*}" - -pushd lib - -pushd pffft -if [[ -d "build" ]]; then - rm -r build -fi -if [[ -d "install" ]]; then - rm -r install -fi -mkdir build -mkdir install -pushd build -cmake .. -DUSE_TYPE_FLOAT=OFF -DUSE_TYPE_DOUBLE=ON -DCMAKE_INSTALL_PREFIX="$(pwd)/../install" -make -j$(nproc) -make install \ No newline at end of file diff --git a/cgaborator.cpp b/cgaborator.cpp index 07df9e0..ab1f886 100644 --- a/cgaborator.cpp +++ b/cgaborator.cpp @@ -2,9 +2,7 @@ #include "cgaborator.h" #include "gaborator/gaborator.h" -#include -#include -#include +#include const int C_ARRAY_SIZE = 300000 * 2; @@ -18,8 +16,6 @@ struct GaboratorState { int sample_rate; int64_t anal_support; - std::mutex stateMutex; - float cArray[C_ARRAY_SIZE]; }; @@ -27,8 +23,6 @@ void* gaborator_initialize(int blockSize, double sampleRate, int bandsPerOctave, auto state = new GaboratorState(); - std::unique_lock lck (state->stateMutex); - state->paramsRef = new gaborator::parameters(bandsPerOctave, minimumFrequency / sampleRate, referenceFrequency / sampleRate, 1.0, 1e-5); state->analyzerRef = new gaborator::analyzer(*(state->paramsRef)); state->coefsRef = new gaborator::coefs(*(state->analyzerRef)); @@ -123,8 +117,6 @@ void gaborator_bandcenters(void* ptr, float* band_centers) { void gaborator_release(void* ptr) { auto state = reinterpret_cast(ptr); - std::unique_lock lck (state->stateMutex); - //cleanup memory delete state->analyzerRef; delete state->coefsRef;