Add ffts as a submodule (because this is what ViPER used)

This commit is contained in:
Iscle 2023-03-02 02:37:55 +01:00
parent 942988d1b0
commit 8eed46db09
5 changed files with 27 additions and 24 deletions

6
.gitmodules vendored
View File

@ -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

View File

@ -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)

1
src/viper/ffts Submodule

@ -0,0 +1 @@
Subproject commit fe86885ecafd0d16eb122f3212403d1d5a86e24e

View File

@ -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();
}

View File

@ -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;
};