Add function prototypes for many functions (still incomplete, will not build)

This commit is contained in:
Iscle 2022-08-30 00:39:15 +02:00
parent 11fbdcb7fb
commit 8bf909a25d
33 changed files with 360 additions and 195 deletions

View File

@ -24,15 +24,23 @@ set(FILES
# Effects
src/cpp/viper/effects/AnalogX.cpp
src/cpp/viper/effects/ColorfulMusic.cpp
src/cpp/viper/effects/Convolver.cpp
src/cpp/viper/effects/Cure.cpp
src/cpp/viper/effects/DiffSurround.cpp
src/cpp/viper/effects/DynamicSystem.cpp
src/cpp/viper/effects/FETCompressor.cpp
src/cpp/viper/effects/IIRFilter.cpp
src/cpp/viper/effects/PlaybackGain.cpp
src/cpp/viper/effects/Reverberation.cpp
src/cpp/viper/effects/SoftwareLimiter.cpp
src/cpp/viper/effects/SpeakerCorrection.cpp
src/cpp/viper/effects/SpectrumExtend.cpp
src/cpp/viper/effects/TubeSimulator.cpp
src/cpp/viper/effects/VHE.cpp
src/cpp/viper/effects/ViPERBass.cpp
src/cpp/viper/effects/ViPERClarity.cpp
src/cpp/viper/effects/ViPERDDC.cpp
# Utils
src/cpp/viper/utils/AdaptiveBuffer_F32.cpp

View File

@ -155,13 +155,4 @@ enum ParamsConfigure {
PARAM_PROCESSUNIT_FX_END
};
enum FxMode {
ViPER_FX_TYPE_NONE = 0,
ViPER_FX_TYPE_HEADPHONE = 1,
ViPER_FX_TYPE_SPEAKER = 2,
ViPER_FX_TYPE_COUNT
};
}

View File

@ -61,9 +61,6 @@ int32_t Effect::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint
return 0;
}
#define DO_ERROR() this->configureOk = false;\
return -EINVAL
int32_t Effect::configure(effect_config_t *newConfig) {
VIPER_LOGI("Begin audio configure ...");
VIPER_LOGI("Checking input and output configuration ...");
@ -71,23 +68,23 @@ int32_t Effect::configure(effect_config_t *newConfig) {
if (newConfig->inputCfg.samplingRate != newConfig->outputCfg.samplingRate) {
VIPER_LOGE("ViPER4Android disabled, reason [in.SR = %d, out.SR = %d]",
newConfig->inputCfg.samplingRate, newConfig->outputCfg.samplingRate);
DO_ERROR();
goto exit_error;
}
if (newConfig->inputCfg.samplingRate > 48000) {
VIPER_LOGE("ViPER4Android disabled, reason [SR out of range]");
DO_ERROR();
goto exit_error;
}
if (newConfig->inputCfg.channels != newConfig->outputCfg.channels) {
VIPER_LOGE("ViPER4Android disabled, reason [in.CH = %d, out.CH = %d]",
newConfig->inputCfg.channels, newConfig->outputCfg.channels);
DO_ERROR();
goto exit_error;
}
if (newConfig->inputCfg.channels != AUDIO_CHANNEL_OUT_STEREO) {
VIPER_LOGE("ViPER4Android disabled, reason [CH != 2]");
DO_ERROR();
goto exit_error;
}
// TODO: Allow multiple formats by converting before/after processing
@ -95,13 +92,13 @@ int32_t Effect::configure(effect_config_t *newConfig) {
if (newConfig->inputCfg.format != AUDIO_FORMAT_PCM_FLOAT) {
VIPER_LOGE("ViPER4Android disabled, reason [in.FMT = %d]", newConfig->inputCfg.format);
VIPER_LOGE("We only accept f32 format");
DO_ERROR();
goto exit_error;
}
if (newConfig->outputCfg.format != AUDIO_FORMAT_PCM_FLOAT) {
VIPER_LOGE("ViPER4Android disabled, reason [out.FMT = %d]", newConfig->outputCfg.format);
VIPER_LOGE("We only accept f32 format");
DO_ERROR();
goto exit_error;
}
VIPER_LOGI("Input and output configuration checked.");
@ -112,5 +109,9 @@ int32_t Effect::configure(effect_config_t *newConfig) {
VIPER_LOGI("Audio configure finished");
return 0;
exit_error:
this->configureOk = false;
return -EINVAL;
}

View File

@ -1,9 +1,5 @@
//
// Created by mart on 7/25/21.
//
#include <ctime>
#include "ViPER.h"
#include <ctime>
#include "Effect.h"
#include "constants.h"
@ -15,9 +11,9 @@ ViPER::ViPER() {
this->waveBuffer = new WaveBuffer_I32(2, 4096);
this->convolver = new Convolver();
// this->convolver->SetEnable(false);
// this->convolver->SetSamplingRate(this->sampleRate);
// this->convolver->Reset();
this->convolver->SetEnable(false);
this->convolver->SetSamplingRate(this->sampleRate);
this->convolver->Reset();
this->vhe = new VHE();
this->vhe->SetEnable(false);
@ -25,9 +21,9 @@ ViPER::ViPER() {
this->vhe->Reset();
this->viperDdc = new ViPERDDC();
// this->viperDdc->SetEnable(false);
// this->viperDdc->SetSamplingRate(this->sampleRate);
// this->viperDdc->Reset();
this->viperDdc->SetEnable(false);
this->viperDdc->SetSamplingRate(this->sampleRate);
this->viperDdc->Reset();
this->spectrumExtend = new SpectrumExtend();
this->spectrumExtend->SetEnable(false);
@ -37,14 +33,14 @@ ViPER::ViPER() {
this->spectrumExtend->Reset();
this->iirFilter = new IIRFilter();
// this->iirFilter->SetEnable(false);
// this->iirFilter->SetSamplingRate(this->sampleRate);
// this->iirFilter->Reset();
this->iirFilter->SetEnable(false);
this->iirFilter->SetSamplingRate(this->sampleRate);
this->iirFilter->Reset();
this->colorfulMusic = new ColorfulMusic();
// this->colorfulMusic->SetEnable(false);
// this->colorfulMusic->SetSamplingRate(this->sampleRate);
// this->colorfulMusic->Reset();
this->colorfulMusic->SetEnable(false);
this->colorfulMusic->SetSamplingRate(this->sampleRate);
this->colorfulMusic->Reset();
this->reverberation = new Reverberation();
this->reverberation->SetEnable(false);
@ -52,14 +48,14 @@ ViPER::ViPER() {
this->reverberation->Reset();
this->playbackGain = new PlaybackGain();
// this->playbackGain->SetEnable(false);
// this->playbackGain->SetSamplingRate(this->sampleRate);
// this->playbackGain->Reset();
this->playbackGain->SetEnable(false);
this->playbackGain->SetSamplingRate(this->sampleRate);
this->playbackGain->Reset();
this->fetCompressor = new FETCompressor();
// this->fetCompressor->SetEnable(false);
// this->fetCompressor->SetSamplingRate(this->sampleRate);
// this->fetCompressor->Reset();
this->fetCompressor->SetParameter(0, 0.0);
this->fetCompressor->SetSamplingRate(this->sampleRate);
this->fetCompressor->Reset();
this->dynamicSystem = new DynamicSystem();
this->dynamicSystem->SetEnable(false);
@ -67,9 +63,9 @@ ViPER::ViPER() {
this->dynamicSystem->Reset();
this->viperBass = new ViPERBass();
// this->viperBass->SetEnable(false);
// this->viperBass->SetSamplingRate(this->sampleRate);
// this->viperBass->Reset();
this->viperBass->SetEnable(false);
this->viperBass->SetSamplingRate(this->sampleRate);
this->viperBass->Reset();
this->viperClarity = new ViPERClarity();
this->viperClarity->SetEnable(false);
@ -87,12 +83,11 @@ ViPER::ViPER() {
this->cure->Reset();
this->tubeSimulator = new TubeSimulator();
// this->tubeSimulator->SetEnable(false);
// this->tubeSimulator->SetSamplingRate(this->sampleRate);
this->tubeSimulator->enabled = false; //SetEnable(false);
this->tubeSimulator->Reset();
this->analogX = new AnalogX();
// this->analogX->SetEnable(false);
this->analogX->enabled = false; //SetEnable(false);
this->analogX->SetSamplingRate(this->sampleRate);
this->analogX->SetProcessingModel(0);
this->analogX->Reset();
@ -104,14 +99,18 @@ ViPER::ViPER() {
for (auto &softwareLimiter: this->softwareLimiters) {
softwareLimiter = new SoftwareLimiter();
// softwareLimiter->ResetLimiter();
softwareLimiter->ResetLimiter();
}
this->fetcomp_enabled = false;
this->init_ok = true;
this->scale_frames_if_not_1point0 = 1.0;
this->pan_frames_if_less_than_1point0 = 1.0;
this->process_time_ms = 0;
this->pan_frames_if_less_than_1point0_2 = 1.0;
this->enabled = false;
this->force_enabled = false;
this->mode = ViPER_FX_TYPE_NONE; // 0
this->update_status = false;
}
ViPER::~ViPER() {
@ -277,7 +276,7 @@ ViPER::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *rep
pReplyParam->status = 0;
//pReplyParam->psize = sizeof(int32_t); // TODO
pReplyParam->vsize = sizeof(int32_t);
*(int32_t *) pReplyParam->data = this->mode;
*(int32_t *) pReplyParam->data = 1; //this->mode; TODO: This driver is not using any effect type, it's completely controlled by the frontend
*replySize = 0x14; // As original, TODO: calculate correctly
return 0;
}
@ -301,7 +300,7 @@ ViPER::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *rep
pReplyParam->status = 0;
//pReplyParam->psize = sizeof(int32_t); // TODO
pReplyParam->vsize = sizeof(int32_t);
// *(int32_t *) pReplyParam->data = this->convolver->GetKernelID(); // TODO: Uncomment when function is implemented
*(uint32_t *) pReplyParam->data = this->convolver->GetKernelID();
*replySize = 0x14; // As original, TODO: calculate correctly
return 0;
}
@ -313,7 +312,71 @@ ViPER::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *rep
}
void ViPER::processBuffer(float *buffer, int frameSize) {
// TODO
if (!this->enabled) return;
if (frameSize < 1) return;
if (!this->init_ok) return;
if (this->update_status) {
struct timeval time{};
gettimeofday(&time, nullptr);
this->process_time_ms = time.tv_sec * 1000 + time.tv_usec / 1000;
}
int ret;
// if convolver is enabled
ret = this->waveBuffer->PushSamples(buffer, frameSize);
if (ret == 0) {
this->waveBuffer->Reset();
return;
}
auto pWaveBuffer = this->waveBuffer->GetCurrentBufferI32Ptr();
this->convolver->Process(pWaveBuffer, pWaveBuffer, frameSize);
this->vhe->Process(pWaveBuffer, pWaveBuffer, frameSize);
this->waveBuffer->SetBufferOffset(frameSize);
ret = this->adaptiveBuffer->PushZero(frameSize);
if (ret == 0) {
this->waveBuffer->Reset();
this->adaptiveBuffer->FlushBuffer();
return;
}
auto pAdaptiveBuffer = this->adaptiveBuffer->GetBufferPointer();
ret = this->waveBuffer->PopSamples((float *) pAdaptiveBuffer, frameSize, true);
this->adaptiveBuffer->SetBufferOffset(ret);
pAdaptiveBuffer = this->adaptiveBuffer->GetBufferPointer();
if (ret != 0) {
this->viperDdc->Process(pAdaptiveBuffer, frameSize);
this->spectrumExtend->Process(pAdaptiveBuffer, frameSize);
this->iirFilter->Process(pAdaptiveBuffer, ret);
this->colorfulMusic->Process(pAdaptiveBuffer, ret);
this->diffSurround->Process(pAdaptiveBuffer, ret);
this->reverberation->Process(pAdaptiveBuffer, ret);
this->speakerCorrection->Process(pAdaptiveBuffer, ret);
this->playbackGain->Process(pAdaptiveBuffer, ret);
this->fetCompressor->Process(pAdaptiveBuffer, ret);
this->dynamicSystem->Process(pAdaptiveBuffer, ret);
this->viperBass->Process(pAdaptiveBuffer, ret);
this->viperClarity->Process(pAdaptiveBuffer, ret);
this->cure->Process(pAdaptiveBuffer, ret);
this->tubeSimulator->TubeProcess(pAdaptiveBuffer, frameSize);
this->analogX->Process(pAdaptiveBuffer, ret);
}
if (this->scale_frames_if_not_1point0 != 1.0) {
this->adaptiveBuffer->ScaleFrames(this->scale_frames_if_not_1point0);
}
if (this->pan_frames_if_less_than_1point0 < 1.0 || this->pan_frames_if_less_than_1point0_2 < 1.0) {
this->adaptiveBuffer->PanFrames(this->pan_frames_if_less_than_1point0, this->pan_frames_if_less_than_1point0_2);
}
if (ret << 1 != 0) {
}
}
void ViPER::DispatchCommand(int param_1, int param_2, int param_3, int param_4, int param_5, int param_6,
@ -323,54 +386,54 @@ void ViPER::DispatchCommand(int param_1, int param_2, int param_3, int param_4,
void ViPER::ResetAllEffects() {
if (this->adaptiveBuffer != nullptr) {
// this->adaptiveBuffer->FlushBuffer();
this->adaptiveBuffer->FlushBuffer();
}
if (this->waveBuffer != nullptr) {
this->waveBuffer->Reset();
}
if (this->convolver != nullptr) {
// this->convolver->SetSamplingRate(this->sampleRate);
// this->convolver->Reset();
this->convolver->SetSamplingRate(this->sampleRate);
this->convolver->Reset();
}
if (this->vhe != nullptr) {
this->vhe->SetSamplingRate(this->sampleRate);
this->vhe->Reset();
}
if (this->viperDdc != nullptr) {
// this->viperDdc->SetSamplingRate(this->sampleRate);
// this->viperDdc->Reset();
this->viperDdc->SetSamplingRate(this->sampleRate);
this->viperDdc->Reset();
}
if (this->spectrumExtend != nullptr) {
this->spectrumExtend->SetSamplingRate(this->sampleRate);
this->spectrumExtend->Reset();
}
if (this->iirFilter != nullptr) {
// this->iirFilter->SetSamplingRate(this->sampleRate);
// this->iirFilter->Reset();
this->iirFilter->SetSamplingRate(this->sampleRate);
this->iirFilter->Reset();
}
if (this->colorfulMusic != nullptr) {
// this->colorfulMusic->SetSamplingRate(this->sampleRate);
// this->colorfulMusic->Reset();
this->colorfulMusic->SetSamplingRate(this->sampleRate);
this->colorfulMusic->Reset();
}
if (this->reverberation != nullptr) {
this->reverberation->SetSamplingRate(this->sampleRate);
this->reverberation->Reset();
}
if (this->playbackGain != nullptr) {
// this->playbackGain->SetSamplingRate(this->sampleRate);
// this->playbackGain->Reset();
this->playbackGain->SetSamplingRate(this->sampleRate);
this->playbackGain->Reset();
}
if (this->fetCompressor != nullptr) {
// this->fetCompressor->SetSamplingRate(this->sampleRate);
// this->fetCompressor->Reset();
this->fetCompressor->SetSamplingRate(this->sampleRate);
this->fetCompressor->Reset();
}
if (this->dynamicSystem != nullptr) {
this->dynamicSystem->SetSamplingRate(this->sampleRate);
this->dynamicSystem->Reset();
}
if (this->viperBass != nullptr) {
// this->viperBass->SetSamplingRate(this->sampleRate);
// this->viperBass->Reset();
this->viperBass->SetSamplingRate(this->sampleRate);
this->viperBass->Reset();
}
if (this->viperClarity != nullptr) {
this->viperClarity->SetSamplingRate(this->sampleRate);
@ -385,7 +448,7 @@ void ViPER::ResetAllEffects() {
this->cure->Reset();
}
if (this->tubeSimulator != nullptr) {
// this->tubeSimulator->Reset();
this->tubeSimulator->Reset();
}
if (this->analogX != nullptr) {
this->analogX->SetSamplingRate(this->sampleRate);
@ -397,7 +460,7 @@ void ViPER::ResetAllEffects() {
}
for (auto &softwareLimiter: softwareLimiters) {
if (softwareLimiter != nullptr) {
// softwareLimiter->Reset();
softwareLimiter->ResetLimiter();
}
}
}

View File

@ -41,12 +41,19 @@ public:
void ResetAllEffects();
bool init_ok, enabled, force_enabled, fetcomp_enabled;
FxMode mode;
bool update_status;
// Something or padding of 3 bytes
uint64_t process_time_ms;
bool init_ok;
bool enabled;
bool force_enabled;
// Something or padding of 1 byte
// FxMode mode;
// Effects
AdaptiveBuffer_F32 *adaptiveBuffer;
WaveBuffer_I32 *waveBuffer;
bool fetcomp_enabled;
Convolver *convolver;
VHE *vhe;
ViPERDDC *viperDdc;
@ -66,5 +73,7 @@ public:
SpeakerCorrection *speakerCorrection;
SoftwareLimiter *softwareLimiters[2];
int unk[3];
float scale_frames_if_not_1point0;
float pan_frames_if_less_than_1point0;
float pan_frames_if_less_than_1point0_2;
};

View File

@ -1,9 +1,5 @@
//
// Created by mart on 7/30/21.
//
#include <cstring>
#include "AnalogX.h"
#include <cstring>
#include "../constants.h"
static float ANALOGX_HARMONICS[10] = {
@ -26,6 +22,10 @@ AnalogX::AnalogX() {
Reset();
}
AnalogX::~AnalogX() {
}
void AnalogX::Process(float *samples, uint32_t size) {
for (int i = 0; i < 2 * size; i++) {
float sample = samples[i];

View File

@ -1,23 +1,17 @@
//
// Created by mart on 7/30/21.
//
#pragma once
#include <cstdint>
#include "../utils/Harmonic.h"
#include "../utils/MultiBiquad.h"
class AnalogX {
public:
AnalogX();
~AnalogX();
void Process(float *samples, uint32_t size);
void Reset();
void SetProcessingModel(int model);
void SetSamplingRate(uint32_t samplerate);
MultiBiquad highpass[2];

View File

@ -0,0 +1 @@
#include "ColorfulMusic.h"

View File

@ -1,7 +1,19 @@
#pragma once
#include <cstdint>
class ColorfulMusic {
// TODO
public:
ColorfulMusic();
~ColorfulMusic();
void Process(float *samples, uint32_t size);
void Reset();
void SetDepthValue();
void SetEnable(bool enable);
void SetMidImageValue();
void SetSamplingRate(uint32_t samplingRate);
void SetWidenValue();
};

View File

@ -0,0 +1,63 @@
#include "Convolver.h"
Convolver::Convolver() {
}
Convolver::~Convolver() {
}
void Convolver::CommitKernelBuffer(uint32_t param_1, uint32_t param_2, uint32_t kernelId) {
}
bool Convolver::GetEnabled() {
return false;
}
uint32_t Convolver::GetKernelID() {
return 0;
}
void Convolver::PrepareKernelBuffer(uint32_t param_1, uint32_t param_2, int32_t kernelId) {
}
void Convolver::Process(float *source, float *dest, int32_t frameSize) {
}
void Convolver::Reset() {
}
void Convolver::SetCrossChannel(float param_1) {
}
void Convolver::SetEnable(bool enabled) {
}
void Convolver::SetKernel(float *param_1, uint32_t param_2) {
}
void Convolver::SetKernel(const char *param_1) {
}
void Convolver::SetKernelBuffer(uint32_t param_1, float *param_2, uint32_t param_3) {
}
void Convolver::SetKernelStereo(float *param_1, float *param_2, uint32_t param_3) {
}
void Convolver::SetSamplingRate(uint32_t param_1) {
}

View File

@ -1,7 +1,25 @@
#pragma once
#include <cstdint>
class Convolver {
// TODO
public:
Convolver();
~Convolver();
void CommitKernelBuffer(uint32_t param_1, uint32_t param_2, uint32_t kernelId);
bool GetEnabled();
uint32_t GetKernelID();
void PrepareKernelBuffer(uint32_t param_1, uint32_t param_2, int32_t kernelId);
void Process(float *source, float *dest, int32_t frameSize);
void Reset();
void SetCrossChannel(float param_1);
void SetEnable(bool enabled);
void SetKernel(float *param_1, uint32_t param_2);
void SetKernel(const char *param_1);
void SetKernelBuffer(uint32_t param_1, float *param_2, uint32_t param_3);
void SetKernelStereo(float *param_1, float *param_2, uint32_t param_3);
void SetSamplingRate(uint32_t param_1);
};

View File

@ -1,37 +1,24 @@
//
// Created by mart on 7/26/21.
//
#pragma once
#include <cstdint>
#include "../utils/Crossfeed.h"
#include "../utils/PassFilter.h"
class Cure {
public:
Cure();
~Cure();
void Process(float *buffer, uint32_t size);
void Reset();
void SetEnable(bool enabled);
uint16_t GetCutoff();
float GetFeedback();
float GetLevelDelay();
preset_t GetPreset();
void SetCutoff(uint16_t cutoff);
void SetFeedback(float feedback);
void SetPreset(preset_t preset);
void SetSamplingRate(uint32_t samplerate);
Crossfeed crossfeed;

View File

@ -1,27 +1,17 @@
//
// Created by mart on 7/31/21.
//
#pragma once
#include <cstdint>
#include "../utils/WaveBuffer_I32.h"
class DiffSurround {
public:
DiffSurround();
~DiffSurround();
void Process(float *samples, uint32_t size);
void Reset();
void SetDelayTime(float value);
void SetEnable(bool enabled);
void SetSamplingRate(uint32_t samplerate);
uint32_t samplerate;

View File

@ -1,7 +1,3 @@
//
// Created by mart on 7/28/21.
//
#pragma once
#include <cstdint>
@ -10,21 +6,15 @@
class DynamicSystem {
public:
DynamicSystem();
~DynamicSystem();
void Process(float *samples, uint32_t size);
void Reset();
void SetBassGain(float gain);
void SetEnable(bool enable);
void SetSideGain(float gainX, float gainY);
void SetXCoeffs(uint32_t low, uint32_t high);
void SetYCoeffs(uint32_t low, uint32_t high);
void SetSamplingRate(uint32_t samplerate);
DynamicBass bass;

View File

@ -0,0 +1 @@
#include "FETCompressor.h.h"

View File

@ -1,7 +1,20 @@
#pragma once
#include <cstdint>
class FETCompressor {
// TODO
public:
FETCompressor();
~FETCompressor();
void GetMeter();
void GetParameter();
void GetParamterDefault();
void Process();
void ProcessSidechain();
void Reset();
void SetParameter(int32_t param_1, float param_2);
void SetSamplingRate(uint32_t samplingRate);
};

View File

@ -0,0 +1 @@
#include "IIRFilter.h"

View File

@ -1,7 +1,17 @@
#pragma once
#include <cstdint>
class IIRFilter {
// TODO
public:
IIRFilter();
~IIRFilter();
void Process(float *samples, uint32_t size);
void Reset();
void SetBandLevel();
void SetEnable(bool enable);
void SetSamplingRate(unsigned int i);
};

View File

@ -0,0 +1 @@
#include "PlaybackGain.h"

View File

@ -1,7 +1,20 @@
#pragma once
#include <cstdint>
class PlaybackGain {
// TODO
public:
PlaybackGain();
~PlaybackGain();
void AnalyseWave();
void Process();
void Reset();
void SetEnable(bool enable);
void SetMaxGainFactor();
void SetRatio();
void SetSamplingRate(uint32_t samplingRate);
void SetVolume();
};

View File

@ -1,32 +1,22 @@
//
// Created by mart on 7/28/21.
//
#pragma once
#include <cstdint>
#include "../utils/CRevModel.h"
class Reverberation {
public:
Reverberation();
void Reset();
~Reverberation();
void Process(float *buffer, uint32_t size);
void SetEnable(bool enable);
void SetRoomSize(float value);
void Reset();
void SetDamp(float value);
void SetWet(float value);
void SetDry(float value);
void SetWidth(float value);
void SetEnable(bool enable);
void SetRoomSize(float value);
void SetSamplingRate(uint32_t value);
void SetWet(float value);
void SetWidth(float value);
float roomsize;
float width;

View File

@ -0,0 +1 @@
#include "SoftwareLimiter.h"

View File

@ -1,7 +1,15 @@
#pragma once
#include <cstdint>
class SoftwareLimiter {
// TODO
public:
SoftwareLimiter();
~SoftwareLimiter();
void Process(float *samples, uint32_t size);
void ResetLimiter();
void SetGate();
};

View File

@ -1,22 +1,17 @@
//
// Created by mart on 7/30/21.
//
#pragma once
#include <cstdint>
#include "../utils/MultiBiquad.h"
#include "../utils/FixedBiquad.h"
class SpeakerCorrection {
public:
SpeakerCorrection();
~SpeakerCorrection();
void Process(float *samples, uint32_t size);
void Reset();
void SetEnable(bool enabled);
void SetSamplingRate(uint32_t samplerate);
uint32_t samplerate;

View File

@ -1,29 +1,19 @@
//
// Created by mart on 7/30/21.
//
#pragma once
#include <cstdint>
#include "../utils/Harmonic.h"
#include "../utils/MultiBiquad.h"
class SpectrumExtend {
public:
SpectrumExtend();
~SpectrumExtend();
void Process(float *samples, uint32_t size);
void Reset();
void SetEnable(bool enable);
void SetExciter(float value);
void SetReferenceFrequency(uint32_t freq);
void SetSamplingRate(uint32_t samplerate);
MultiBiquad highpass[2];

View File

@ -1,7 +1,3 @@
//
// Created by mart on 7/26/21.
//
#pragma once
#include <cstdint>
@ -9,9 +5,9 @@
class TubeSimulator {
public:
TubeSimulator();
~TubeSimulator();
void Reset();
void TubeProcess(float *buffer, uint32_t size);
float acc[2];

View File

@ -1,29 +1,19 @@
//
// Created by mart on 9/18/21.
//
#pragma once
#include <cstdint>
#include "../utils/PConvSingle_F32.h"
#include "../utils/WaveBuffer_I32.h"
class VHE {
public:
VHE();
~VHE();
void Process(float *source, float *dest, int frameSize);
void Reset();
bool GetEnabled();
void Process(float *source, float *dest, int frameSize);
void Reset();
void SetEffectLevel(uint32_t level);
void SetEnable(bool enabled);
void SetSamplingRate(uint32_t srate);
PConvSingle_F32 convLeft, convRight;

View File

@ -0,0 +1 @@
#include "ViPERBass.h"

View File

@ -1,7 +1,19 @@
#pragma once
#include <cstdint>
class ViPERBass {
// TODO
public:
ViPERBass();
~ViPERBass();
void Process(float *samples, uint32_t size);
void Reset();
void SetBassFactor();
void SetEnable(bool enable);
void SetProcessMode();
void SetSamplingRate(uint32_t samplingRate);
void SetSpeaker();
};

View File

@ -1,10 +1,6 @@
//
// Created by mart on 7/31/21.
//
#pragma once
#include <cstdint>
#include "../utils/NoiseSharpening.h"
#include "../utils/HiFi.h"
#include "../utils/HighShelf.h"
@ -18,19 +14,14 @@ enum ClarityMode {
class ViPERClarity {
public:
ViPERClarity();
~ViPERClarity();
void Process(float *samples, uint32_t size);
void Reset();
void SetClarity(float gainPercent);
void SetClarityToFilter();
void SetEnable(bool enabled);
void SetProcessMode(ClarityMode mode);
void SetSamplingRate(uint32_t samplerate);
NoiseSharpening sharp;

View File

@ -0,0 +1 @@
#include "ViPERDDC.h"

View File

@ -1,7 +1,18 @@
#pragma once
#include <cstdint>
class ViPERDDC {
// TODO
public:
ViPERDDC();
~ViPERDDC();
void Process(float *samples, uint32_t size);
void ReleaseResources();
void Reset();
void SetCoeffs();
void SetEnable(bool enable);
void SetSamplingRate(uint32_t samplingRate);
};

View File

@ -5,7 +5,20 @@
class AdaptiveBuffer_F32 {
public:
AdaptiveBuffer_F32(int channels, uint32_t size);
// TODO
~AdaptiveBuffer_F32();
void FlushBuffer();
uint32_t GetBufferLength();
int32_t GetBufferOffset();
int32_t *GetBufferPointer();
uint32_t GetChannels();
void PanFrames(int32_t param_1, int32_t param_2);
int32_t PopFrames(int16_t param_1, uint32_t param_2);
int32_t PushFrames(int16_t param_1, uint32_t param_2);
int32_t PushFrames(int32_t *param_1, uint32_t param_2);
int32_t PushZero(uint32_t param_1);
void ScaleFrames(int32_t param_1);
void SetBufferOffset(uint32_t param_1);
};