diff --git a/.gitmodules b/.gitmodules index fc7d77a..8d234b0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "src/viper/kissfft"] - path = src/viper/kissfft - url = git@github.com:mborgerding/kissfft.git +[submodule "src/viper/ffts"] + path = src/viper/ffts + url = git@github.com:anthonix/ffts.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c55da3..807d7d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,12 +11,8 @@ project("ViPER4Android") add_compile_definitions(VERSION_CODE=20221231) add_compile_definitions(VERSION_NAME="0.1.0") -## KISS FFT -#set(KISSFFT_PKGCONFIG OFF) -#set(KISSFFT_STATIC ON) -#set(KISSFFT_TEST OFF) -#set(KISSFFT_TOOLS OFF) -#add_subdirectory(src/cpp/viper/kissfft) +# FFTS +add_subdirectory(src/viper/ffts) # ViPERFX include_directories(src/include) diff --git a/src/viper/ffts b/src/viper/ffts new file mode 160000 index 0000000..fe86885 --- /dev/null +++ b/src/viper/ffts @@ -0,0 +1 @@ +Subproject commit fe86885ecafd0d16eb122f3212403d1d5a86e24e diff --git a/src/viper/utils/PConvSingle.cpp b/src/viper/utils/PConvSingle.cpp index 455f544..9d18f84 100644 --- a/src/viper/utils/PConvSingle.cpp +++ b/src/viper/utils/PConvSingle.cpp @@ -3,8 +3,8 @@ #include "PConvSingle.h" PConvSingle::PConvSingle() { - this->enabled = false; - this->segments = 0; + this->instanceUsable = false; + this->segmentCount = 0; this->segmentSize = 0; // this->data = nullptr; } @@ -30,7 +30,7 @@ int PConvSingle::GetFFTSize() { } int PConvSingle::GetSegmentCount() { - return this->segments; + return this->segmentCount; } int PConvSingle::GetSegmentSize() { @@ -38,18 +38,18 @@ int PConvSingle::GetSegmentSize() { } bool PConvSingle::InstanceUsable() { - return this->enabled; + return this->instanceUsable; } int PConvSingle::LoadKernel(float *buf, int param_2, int segmentSize) { if (buf != nullptr && param_2 > 0 && segmentSize > 0 && segmentSize % 2 == 0) { - this->enabled = false; + this->instanceUsable = false; ReleaseResources(); -// this->data = new PConvData(); //(PConvData *) malloc(0x140); // TODO: Sizeof + this->data = new PConvData(); //(PConvData *) malloc(0x140); // TODO: Sizeof this->segmentSize = segmentSize; int n = ProcessKernel(buf, param_2, 1); if (n != 0) { - this->enabled = true; + this->instanceUsable = true; return n; } ReleaseResources(); @@ -84,18 +84,20 @@ int PConvSingle::ProcessKernel(int param_2, float *param_3, int param_4, int par } void PConvSingle::ReleaseResources() { - // TODO - this->enabled = false; - this->segments = 0; + if (this->data != nullptr) { + // TODO + } + this->instanceUsable = false; + this->segmentCount = 0; this->segmentSize = 0; } void PConvSingle::Reset() { - if (!this->enabled) return; + if (!this->instanceUsable) return; // TODO } void PConvSingle::UnloadKernel() { - this->enabled = false; + this->instanceUsable = false; ReleaseResources(); } diff --git a/src/viper/utils/PConvSingle.h b/src/viper/utils/PConvSingle.h index 43289cc..3e4610e 100644 --- a/src/viper/utils/PConvSingle.h +++ b/src/viper/utils/PConvSingle.h @@ -1,6 +1,9 @@ #pragma once class PConvSingle { + struct PConvData { + + }; public: PConvSingle(); @@ -34,7 +37,8 @@ public: void UnloadKernel(); - bool enabled; - int segments, segmentSize; -// PConvData *data; // TODO: Type + bool instanceUsable; + int segmentCount; + int segmentSize; + PConvData *data; };