mirror of
https://github.com/AndroidAudioMods/ViPERFX_RE.git
synced 2025-06-08 02:29:40 +08:00
Reformatted code
Indentated with 4 spaces
This commit is contained in:
parent
7912b7deec
commit
926aec54bb
@ -79,7 +79,8 @@ int32_t Effect::configure(effect_config_t *newConfig) {
|
|||||||
v4a_print(ANDROID_LOG_INFO, "Checking input and output configuration ...");
|
v4a_print(ANDROID_LOG_INFO, "Checking input and output configuration ...");
|
||||||
|
|
||||||
if (newConfig->inputCfg.samplingRate != newConfig->outputCfg.samplingRate) {
|
if (newConfig->inputCfg.samplingRate != newConfig->outputCfg.samplingRate) {
|
||||||
v4a_printf(ANDROID_LOG_ERROR, "ViPER4Android disabled, reason [in.SR = %d, out.SR = %d]", newConfig->inputCfg.samplingRate, newConfig->outputCfg.samplingRate);
|
v4a_printf(ANDROID_LOG_ERROR, "ViPER4Android disabled, reason [in.SR = %d, out.SR = %d]",
|
||||||
|
newConfig->inputCfg.samplingRate, newConfig->outputCfg.samplingRate);
|
||||||
DO_ERROR();
|
DO_ERROR();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +90,8 @@ int32_t Effect::configure(effect_config_t *newConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (newConfig->inputCfg.channels != newConfig->outputCfg.channels) {
|
if (newConfig->inputCfg.channels != newConfig->outputCfg.channels) {
|
||||||
v4a_printf(ANDROID_LOG_ERROR, "ViPER4Android disabled, reason [in.CH = %d, out.CH = %d]", newConfig->inputCfg.channels, newConfig->outputCfg.channels);
|
v4a_printf(ANDROID_LOG_ERROR, "ViPER4Android disabled, reason [in.CH = %d, out.CH = %d]",
|
||||||
|
newConfig->inputCfg.channels, newConfig->outputCfg.channels);
|
||||||
DO_ERROR();
|
DO_ERROR();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,10 +10,13 @@
|
|||||||
class Effect {
|
class Effect {
|
||||||
public:
|
public:
|
||||||
Effect();
|
Effect();
|
||||||
|
|
||||||
~Effect();
|
~Effect();
|
||||||
|
|
||||||
virtual int32_t command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData);
|
virtual int32_t command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData);
|
||||||
|
|
||||||
int32_t process(audio_buffer_s *in, audio_buffer_s *out);
|
int32_t process(audio_buffer_s *in, audio_buffer_s *out);
|
||||||
|
|
||||||
int32_t configure(effect_config_t *config);
|
int32_t configure(effect_config_t *config);
|
||||||
|
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
@ -15,7 +15,8 @@ ProcessUnit_FX::~ProcessUnit_FX() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ProcessUnit_FX::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) {
|
int32_t
|
||||||
|
ProcessUnit_FX::command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) {
|
||||||
// TODO
|
// TODO
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
class ProcessUnit_FX : public Effect {
|
class ProcessUnit_FX : public Effect {
|
||||||
public:
|
public:
|
||||||
ProcessUnit_FX();
|
ProcessUnit_FX();
|
||||||
|
|
||||||
~ProcessUnit_FX();
|
~ProcessUnit_FX();
|
||||||
|
|
||||||
int32_t command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) override;
|
int32_t command(uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) override;
|
||||||
@ -28,6 +29,7 @@ public:
|
|||||||
|
|
||||||
// TODO: Parameter types/names
|
// TODO: Parameter types/names
|
||||||
void DispatchCommand(int param_1, int param_2, int param_3, int param_4, int param_5, int param_6, int param_7);
|
void DispatchCommand(int param_1, int param_2, int param_3, int param_4, int param_5, int param_6, int param_7);
|
||||||
|
|
||||||
void ResetAllEffects();
|
void ResetAllEffects();
|
||||||
|
|
||||||
bool init_ok, enabled, force_enabled, fetcomp_enabled;
|
bool init_ok, enabled, force_enabled, fetcomp_enabled;
|
||||||
|
@ -7,7 +7,9 @@
|
|||||||
#ifdef ANDROID_TOOLCHAIN
|
#ifdef ANDROID_TOOLCHAIN
|
||||||
#include <android/errno.h>
|
#include <android/errno.h>
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "log.h" // TODO: Remove this dependency
|
#include "log.h" // TODO: Remove this dependency
|
||||||
|
@ -13,9 +13,11 @@ public:
|
|||||||
AnalogX();
|
AnalogX();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetProcessingModel(int model);
|
void SetProcessingModel(int model);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
MultiBiquad highpass[2];
|
MultiBiquad highpass[2];
|
||||||
|
@ -13,16 +13,25 @@ public:
|
|||||||
Cure();
|
Cure();
|
||||||
|
|
||||||
void Process(float *buffer, uint32_t size);
|
void Process(float *buffer, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetEnable(bool enabled);
|
void SetEnable(bool enabled);
|
||||||
|
|
||||||
uint16_t GetCutoff();
|
uint16_t GetCutoff();
|
||||||
|
|
||||||
float GetFeedback();
|
float GetFeedback();
|
||||||
|
|
||||||
float GetLevelDelay();
|
float GetLevelDelay();
|
||||||
|
|
||||||
preset_t GetPreset();
|
preset_t GetPreset();
|
||||||
|
|
||||||
void SetCutoff(uint16_t cutoff);
|
void SetCutoff(uint16_t cutoff);
|
||||||
|
|
||||||
void SetFeedback(float feedback);
|
void SetFeedback(float feedback);
|
||||||
|
|
||||||
void SetPreset(preset_t preset);
|
void SetPreset(preset_t preset);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
Crossfeed crossfeed;
|
Crossfeed crossfeed;
|
||||||
|
@ -11,13 +11,17 @@
|
|||||||
class DiffSurround {
|
class DiffSurround {
|
||||||
public:
|
public:
|
||||||
DiffSurround();
|
DiffSurround();
|
||||||
|
|
||||||
~DiffSurround();
|
~DiffSurround();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetDelayTime(float value);
|
void SetDelayTime(float value);
|
||||||
|
|
||||||
void SetEnable(bool enabled);
|
void SetEnable(bool enabled);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
uint32_t samplerate;
|
uint32_t samplerate;
|
||||||
|
@ -12,13 +12,19 @@ public:
|
|||||||
DynamicSystem();
|
DynamicSystem();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetBassGain(float gain);
|
void SetBassGain(float gain);
|
||||||
|
|
||||||
void SetEnable(bool enable);
|
void SetEnable(bool enable);
|
||||||
|
|
||||||
void SetSideGain(float gainX, float gainY);
|
void SetSideGain(float gainX, float gainY);
|
||||||
|
|
||||||
void SetXCoeffs(uint32_t low, uint32_t high);
|
void SetXCoeffs(uint32_t low, uint32_t high);
|
||||||
|
|
||||||
void SetYCoeffs(uint32_t low, uint32_t high);
|
void SetYCoeffs(uint32_t low, uint32_t high);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
DynamicBass bass;
|
DynamicBass bass;
|
||||||
|
@ -11,14 +11,21 @@ public:
|
|||||||
Reverberation();
|
Reverberation();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void Process(float *buffer, uint32_t size);
|
void Process(float *buffer, uint32_t size);
|
||||||
|
|
||||||
void SetEnable(bool enable);
|
void SetEnable(bool enable);
|
||||||
|
|
||||||
void SetRoomSize(float value);
|
void SetRoomSize(float value);
|
||||||
|
|
||||||
void SetDamp(float value);
|
void SetDamp(float value);
|
||||||
|
|
||||||
void SetWet(float value);
|
void SetWet(float value);
|
||||||
|
|
||||||
void SetDry(float value);
|
void SetDry(float value);
|
||||||
|
|
||||||
void SetWidth(float value);
|
void SetWidth(float value);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t value);
|
void SetSamplingRate(uint32_t value);
|
||||||
|
|
||||||
float roomsize;
|
float roomsize;
|
||||||
|
@ -12,9 +12,11 @@ public:
|
|||||||
SpeakerCorrection();
|
SpeakerCorrection();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetEnable(bool enabled);
|
void SetEnable(bool enabled);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
uint32_t samplerate;
|
uint32_t samplerate;
|
||||||
|
@ -42,11 +42,15 @@ void SpectrumExtend::Process(float *samples, uint32_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SpectrumExtend::Reset() {
|
void SpectrumExtend::Reset() {
|
||||||
this->highpass[0].RefreshFilter(FilterType::HIGHPASS, 0.0, (float)this->referenceFreq, (float)this->samplerate, 0.717, false);
|
this->highpass[0].RefreshFilter(FilterType::HIGHPASS, 0.0, (float) this->referenceFreq, (float) this->samplerate,
|
||||||
this->highpass[1].RefreshFilter(FilterType::HIGHPASS, 0.0, (float)this->referenceFreq, (float)this->samplerate, 0.717, false);
|
0.717, false);
|
||||||
|
this->highpass[1].RefreshFilter(FilterType::HIGHPASS, 0.0, (float) this->referenceFreq, (float) this->samplerate,
|
||||||
|
0.717, false);
|
||||||
|
|
||||||
this->lowpass[0].RefreshFilter(FilterType::LOWPASS, 0.0, (float)this->referenceFreq / 2.f - 2000.f, (float)this->referenceFreq, 0.717, false);
|
this->lowpass[0].RefreshFilter(FilterType::LOWPASS, 0.0, (float) this->referenceFreq / 2.f - 2000.f,
|
||||||
this->lowpass[1].RefreshFilter(FilterType::LOWPASS, 0.0, (float)this->referenceFreq / 2.f - 2000.f, (float)this->referenceFreq, 0.717, false);
|
(float) this->referenceFreq, 0.717, false);
|
||||||
|
this->lowpass[1].RefreshFilter(FilterType::LOWPASS, 0.0, (float) this->referenceFreq / 2.f - 2000.f,
|
||||||
|
(float) this->referenceFreq, 0.717, false);
|
||||||
|
|
||||||
this->harmonics[0].Reset();
|
this->harmonics[0].Reset();
|
||||||
this->harmonics[1].Reset();
|
this->harmonics[1].Reset();
|
||||||
|
@ -11,13 +11,19 @@
|
|||||||
class SpectrumExtend {
|
class SpectrumExtend {
|
||||||
public:
|
public:
|
||||||
SpectrumExtend();
|
SpectrumExtend();
|
||||||
|
|
||||||
~SpectrumExtend();
|
~SpectrumExtend();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetEnable(bool enable);
|
void SetEnable(bool enable);
|
||||||
|
|
||||||
void SetExciter(float value);
|
void SetExciter(float value);
|
||||||
|
|
||||||
void SetReferenceFrequency(uint32_t freq);
|
void SetReferenceFrequency(uint32_t freq);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
MultiBiquad highpass[2];
|
MultiBiquad highpass[2];
|
||||||
|
@ -11,6 +11,7 @@ public:
|
|||||||
TubeSimulator();
|
TubeSimulator();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void TubeProcess(float *buffer, uint32_t size);
|
void TubeProcess(float *buffer, uint32_t size);
|
||||||
|
|
||||||
float acc[2];
|
float acc[2];
|
||||||
|
@ -11,14 +11,19 @@
|
|||||||
class VHE {
|
class VHE {
|
||||||
public:
|
public:
|
||||||
VHE();
|
VHE();
|
||||||
|
|
||||||
~VHE();
|
~VHE();
|
||||||
|
|
||||||
void Process(float *source, float *dest, int frameSize);
|
void Process(float *source, float *dest, int frameSize);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
bool GetEnabled();
|
bool GetEnabled();
|
||||||
|
|
||||||
void SetEffectLevel(uint32_t level);
|
void SetEffectLevel(uint32_t level);
|
||||||
|
|
||||||
void SetEnable(bool enabled);
|
void SetEnable(bool enabled);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t srate);
|
void SetSamplingRate(uint32_t srate);
|
||||||
|
|
||||||
PConvSingle_F32 convLeft, convRight;
|
PConvSingle_F32 convLeft, convRight;
|
||||||
|
@ -20,12 +20,17 @@ public:
|
|||||||
ViPERClarity();
|
ViPERClarity();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetClarity(float gainPercent);
|
void SetClarity(float gainPercent);
|
||||||
|
|
||||||
void SetClarityToFilter();
|
void SetClarityToFilter();
|
||||||
|
|
||||||
void SetEnable(bool enabled);
|
void SetEnable(bool enabled);
|
||||||
|
|
||||||
void SetProcessMode(ClarityMode mode);
|
void SetProcessMode(ClarityMode mode);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
NoiseSharpening sharp;
|
NoiseSharpening sharp;
|
||||||
|
@ -11,10 +11,13 @@ public:
|
|||||||
CAllpassFilter();
|
CAllpassFilter();
|
||||||
|
|
||||||
void Mute();
|
void Mute();
|
||||||
|
|
||||||
float Process(float sample);
|
float Process(float sample);
|
||||||
|
|
||||||
float GetFeedback();
|
float GetFeedback();
|
||||||
|
|
||||||
void SetBuffer(float *buffer, uint32_t size);
|
void SetBuffer(float *buffer, uint32_t size);
|
||||||
|
|
||||||
void SetFeedback(float feedback);
|
void SetFeedback(float feedback);
|
||||||
|
|
||||||
float *buffer;
|
float *buffer;
|
||||||
|
@ -11,12 +11,17 @@ public:
|
|||||||
CCombFilter();
|
CCombFilter();
|
||||||
|
|
||||||
float Process(float sample);
|
float Process(float sample);
|
||||||
|
|
||||||
void Mute();
|
void Mute();
|
||||||
|
|
||||||
float GetDamp();
|
float GetDamp();
|
||||||
|
|
||||||
float GetFeedback();
|
float GetFeedback();
|
||||||
|
|
||||||
void SetDamp(float damp);
|
void SetDamp(float damp);
|
||||||
|
|
||||||
void SetFeedback(float feedback);
|
void SetFeedback(float feedback);
|
||||||
|
|
||||||
void SetBuffer(float *buffer, uint32_t size);
|
void SetBuffer(float *buffer, uint32_t size);
|
||||||
|
|
||||||
float feedback;
|
float feedback;
|
||||||
|
@ -10,24 +10,39 @@
|
|||||||
class CRevModel {
|
class CRevModel {
|
||||||
public:
|
public:
|
||||||
CRevModel();
|
CRevModel();
|
||||||
|
|
||||||
~CRevModel();
|
~CRevModel();
|
||||||
|
|
||||||
void Mute();
|
void Mute();
|
||||||
|
|
||||||
void ProcessReplace(float *bufL, float *bufR, uint32_t size);
|
void ProcessReplace(float *bufL, float *bufR, uint32_t size);
|
||||||
|
|
||||||
void UpdateCoeffs();
|
void UpdateCoeffs();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetRoomSize(float value);
|
void SetRoomSize(float value);
|
||||||
|
|
||||||
void SetDamp(float value);
|
void SetDamp(float value);
|
||||||
|
|
||||||
void SetWet(float value);
|
void SetWet(float value);
|
||||||
|
|
||||||
void SetDry(float value);
|
void SetDry(float value);
|
||||||
|
|
||||||
void SetWidth(float value);
|
void SetWidth(float value);
|
||||||
|
|
||||||
void SetMode(int value);
|
void SetMode(int value);
|
||||||
|
|
||||||
float GetRoomSize();
|
float GetRoomSize();
|
||||||
|
|
||||||
float GetDamp();
|
float GetDamp();
|
||||||
|
|
||||||
float GetWet();
|
float GetWet();
|
||||||
|
|
||||||
float GetDry();
|
float GetDry();
|
||||||
|
|
||||||
float GetWidth();
|
float GetWidth();
|
||||||
|
|
||||||
int GetMode();
|
int GetMode();
|
||||||
|
|
||||||
float gain;
|
float gain;
|
||||||
|
@ -56,6 +56,7 @@ void Crossfeed::ProcessFrames(float* buffer, uint32_t size) {
|
|||||||
|
|
||||||
#define lo_filter(in, out_1) (this->a0_lo * (in) + this->b1_lo * (out_1))
|
#define lo_filter(in, out_1) (this->a0_lo * (in) + this->b1_lo * (out_1))
|
||||||
#define hi_filter(in, in_1, out_1) (this->a0_hi * (in) + this->a1_hi * (in_1) + this->b1_hi * (out_1))
|
#define hi_filter(in, in_1, out_1) (this->a0_hi * (in) + this->a1_hi * (in_1) + this->b1_hi * (out_1))
|
||||||
|
|
||||||
void Crossfeed::FilterSample(float *sample) {
|
void Crossfeed::FilterSample(float *sample) {
|
||||||
this->lfs.lo[0] = lo_filter(sample[0], this->lfs.lo[0]);
|
this->lfs.lo[0] = lo_filter(sample[0], this->lfs.lo[0]);
|
||||||
this->lfs.lo[1] = lo_filter(sample[1], this->lfs.lo[1]);
|
this->lfs.lo[1] = lo_filter(sample[1], this->lfs.lo[1]);
|
||||||
|
@ -17,16 +17,25 @@ public:
|
|||||||
Crossfeed();
|
Crossfeed();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void ProcessFrames(float *buffer, uint32_t size);
|
void ProcessFrames(float *buffer, uint32_t size);
|
||||||
|
|
||||||
void FilterSample(float *sample);
|
void FilterSample(float *sample);
|
||||||
|
|
||||||
uint16_t GetCutoff();
|
uint16_t GetCutoff();
|
||||||
|
|
||||||
float GetFeedback();
|
float GetFeedback();
|
||||||
|
|
||||||
float GetLevelDelay();
|
float GetLevelDelay();
|
||||||
|
|
||||||
preset_t GetPreset();
|
preset_t GetPreset();
|
||||||
|
|
||||||
void SetCutoff(uint16_t cutoff);
|
void SetCutoff(uint16_t cutoff);
|
||||||
|
|
||||||
void SetFeedback(float feedback);
|
void SetFeedback(float feedback);
|
||||||
|
|
||||||
void SetPreset(preset_t preset);
|
void SetPreset(preset_t preset);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
uint32_t samplerate;
|
uint32_t samplerate;
|
||||||
|
@ -14,8 +14,11 @@ public:
|
|||||||
DepthSurround();
|
DepthSurround();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void RefreshStrength(short strength);
|
void RefreshStrength(short strength);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
void SetStrength(short strength);
|
void SetStrength(short strength);
|
||||||
|
|
||||||
short strength;
|
short strength;
|
||||||
|
@ -13,11 +13,17 @@ public:
|
|||||||
DynamicBass();
|
DynamicBass();
|
||||||
|
|
||||||
void FilterSamples(float *samples, uint32_t size);
|
void FilterSamples(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetBassGain(float gain);
|
void SetBassGain(float gain);
|
||||||
|
|
||||||
void SetFilterXPassFrequency(uint32_t low, uint32_t high);
|
void SetFilterXPassFrequency(uint32_t low, uint32_t high);
|
||||||
|
|
||||||
void SetFilterYPassFrequency(uint32_t low, uint32_t high);
|
void SetFilterYPassFrequency(uint32_t low, uint32_t high);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
void SetSideGain(float gainX, float gainY);
|
void SetSideGain(float gainX, float gainY);
|
||||||
|
|
||||||
uint32_t lowFreqX, highFreqX;
|
uint32_t lowFreqX, highFreqX;
|
||||||
|
@ -11,7 +11,8 @@ FixedBiquad::FixedBiquad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float FixedBiquad::ProcessSample(float sample) {
|
float FixedBiquad::ProcessSample(float sample) {
|
||||||
float out = sample * this->b0 + this->x_1 * this->b1 + this->x_2 * this->b2 + this->y_1 * this->a1 + this->y_2 * this->a2;
|
float out = sample * this->b0 + this->x_1 * this->b1 + this->x_2 * this->b2 + this->y_1 * this->a1 +
|
||||||
|
this->y_2 * this->a2;
|
||||||
this->y_2 = this->y_1;
|
this->y_2 = this->y_1;
|
||||||
this->y_1 = out;
|
this->y_1 = out;
|
||||||
this->x_2 = this->x_1;
|
this->x_2 = this->x_1;
|
||||||
@ -51,7 +52,8 @@ void FixedBiquad::SetBandPassParameter(float frequency, uint32_t samplerate, flo
|
|||||||
SetCoeffs(y + 1.f, -2.f * cosX, 1.f - y, sinX / 2.f, 0.f, -sinX / 2.f);
|
SetCoeffs(y + 1.f, -2.f * cosX, 1.f - y, sinX / 2.f, 0.f, -sinX / 2.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixedBiquad::SetHighPassParameter(float frequency, uint32_t samplerate, float param_4, float qFactor, float param_6) {
|
void
|
||||||
|
FixedBiquad::SetHighPassParameter(float frequency, uint32_t samplerate, float param_4, float qFactor, float param_6) {
|
||||||
// TODO: Cleanup and named params
|
// TODO: Cleanup and named params
|
||||||
float fVar12 = (frequency * 2.f * (float) M_PI) / (float) samplerate;
|
float fVar12 = (frequency * 2.f * (float) M_PI) / (float) samplerate;
|
||||||
float x = powf(10.f, param_4 / 40.f);
|
float x = powf(10.f, param_4 / 40.f);
|
||||||
|
@ -12,10 +12,15 @@ public:
|
|||||||
FixedBiquad();
|
FixedBiquad();
|
||||||
|
|
||||||
float ProcessSample(float sample);
|
float ProcessSample(float sample);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetCoeffs(float a0, float a1, float a2, float b0, float b1, float b2);
|
void SetCoeffs(float a0, float a1, float a2, float b0, float b1, float b2);
|
||||||
|
|
||||||
void SetBandPassParameter(float frequency, uint32_t samplerate, float qFactor);
|
void SetBandPassParameter(float frequency, uint32_t samplerate, float qFactor);
|
||||||
|
|
||||||
void SetHighPassParameter(float frequency, uint32_t samplerate, float param_4, float qFactor, float param_6);
|
void SetHighPassParameter(float frequency, uint32_t samplerate, float param_4, float qFactor, float param_6);
|
||||||
|
|
||||||
void SetLowPassParameter(float frequency, uint32_t samplerate, float qFactor);
|
void SetLowPassParameter(float frequency, uint32_t samplerate, float qFactor);
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,12 +10,15 @@
|
|||||||
class Harmonic {
|
class Harmonic {
|
||||||
public:
|
public:
|
||||||
Harmonic();
|
Harmonic();
|
||||||
|
|
||||||
~Harmonic();
|
~Harmonic();
|
||||||
|
|
||||||
float Process(float sample);
|
float Process(float sample);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetHarmonics(float *coeffs);
|
void SetHarmonics(float *coeffs);
|
||||||
|
|
||||||
void UpdateCoeffs(float *coeffs);
|
void UpdateCoeffs(float *coeffs);
|
||||||
|
|
||||||
float coeffs[11];
|
float coeffs[11];
|
||||||
|
@ -12,12 +12,15 @@
|
|||||||
class HiFi {
|
class HiFi {
|
||||||
public:
|
public:
|
||||||
HiFi();
|
HiFi();
|
||||||
|
|
||||||
~HiFi();
|
~HiFi();
|
||||||
|
|
||||||
void Process(float *samples, uint32_t size);
|
void Process(float *samples, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetClarity(float value);
|
void SetClarity(float value);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
WaveBuffer_I32 *buffers[2];
|
WaveBuffer_I32 *buffers[2];
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
#include "HighShelf.h"
|
#include "HighShelf.h"
|
||||||
|
|
||||||
float HighShelf::Process(float sample) {
|
float HighShelf::Process(float sample) {
|
||||||
float out = sample * this->b0 + this->x_1 * this->b1 + this->x_2 * this->b2 + this->y_1 * this->a1 + this->y_2 * this->a2;
|
float out = sample * this->b0 + this->x_1 * this->b1 + this->x_2 * this->b2 + this->y_1 * this->a1 +
|
||||||
|
this->y_2 * this->a2;
|
||||||
this->y_2 = this->y_1;
|
this->y_2 = this->y_1;
|
||||||
this->y_1 = out;
|
this->y_1 = out;
|
||||||
this->x_2 = this->x_1;
|
this->x_2 = this->x_1;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class HighShelf {
|
class HighShelf {
|
||||||
@ -10,8 +11,11 @@ public:
|
|||||||
float Process(float sample);
|
float Process(float sample);
|
||||||
|
|
||||||
void SetFrequency(uint32_t freq);
|
void SetFrequency(uint32_t freq);
|
||||||
|
|
||||||
void SetGain(float gain);
|
void SetGain(float gain);
|
||||||
|
|
||||||
void SetQuality(float q);
|
void SetQuality(float q);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
uint32_t frequency, samplerate;
|
uint32_t frequency, samplerate;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class IIR_1st {
|
class IIR_1st {
|
||||||
@ -10,21 +11,37 @@ public:
|
|||||||
IIR_1st();
|
IIR_1st();
|
||||||
|
|
||||||
void Mute();
|
void Mute();
|
||||||
|
|
||||||
void SetCoefficients(float b0, float b1, float a1);
|
void SetCoefficients(float b0, float b1, float a1);
|
||||||
|
|
||||||
void setHPF_A(float frequency, uint32_t samplerate);
|
void setHPF_A(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setHPF_BW(float frequency, uint32_t samplerate);
|
void setHPF_BW(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setHPF_C(float frequency, uint32_t samplerate);
|
void setHPF_C(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setHPFwLPS_A(float frequency, uint32_t samplerate);
|
void setHPFwLPS_A(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setHSF_A(float f1, float f2, uint32_t samplerate);
|
void setHSF_A(float f1, float f2, uint32_t samplerate);
|
||||||
|
|
||||||
void setLPF_A(float frequency, uint32_t samplerate);
|
void setLPF_A(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setLPF_BW(float frequency, uint32_t samplerate);
|
void setLPF_BW(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setLPF_C(float frequency, uint32_t samplerate);
|
void setLPF_C(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setLSF_A(float f1, float f2, uint32_t samplerate);
|
void setLSF_A(float f1, float f2, uint32_t samplerate);
|
||||||
|
|
||||||
void setPole(float a1);
|
void setPole(float a1);
|
||||||
|
|
||||||
void setPoleHPF(float frequency, uint32_t samplerate);
|
void setPoleHPF(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setPoleLPF(float frequency, uint32_t samplerate);
|
void setPoleLPF(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setZero(float b1);
|
void setZero(float b1);
|
||||||
|
|
||||||
void setZeroHPF(float frequency, uint32_t samplerate);
|
void setZeroHPF(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setZeroLPF(float frequency, uint32_t samplerate);
|
void setZeroLPF(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
float b0, b1, a1;
|
float b0, b1, a1;
|
||||||
|
@ -9,9 +9,11 @@
|
|||||||
class IIR_NOrder_BW_BP {
|
class IIR_NOrder_BW_BP {
|
||||||
public:
|
public:
|
||||||
explicit IIR_NOrder_BW_BP(uint32_t order);
|
explicit IIR_NOrder_BW_BP(uint32_t order);
|
||||||
|
|
||||||
~IIR_NOrder_BW_BP();
|
~IIR_NOrder_BW_BP();
|
||||||
|
|
||||||
void Mute();
|
void Mute();
|
||||||
|
|
||||||
void setBPF(float highCut, float lowCut, uint32_t samplerate);
|
void setBPF(float highCut, float lowCut, uint32_t samplerate);
|
||||||
|
|
||||||
IIR_1st *lowpass;
|
IIR_1st *lowpass;
|
||||||
|
@ -9,10 +9,13 @@
|
|||||||
class IIR_NOrder_BW_LH {
|
class IIR_NOrder_BW_LH {
|
||||||
public:
|
public:
|
||||||
explicit IIR_NOrder_BW_LH(uint32_t order);
|
explicit IIR_NOrder_BW_LH(uint32_t order);
|
||||||
|
|
||||||
~IIR_NOrder_BW_LH();
|
~IIR_NOrder_BW_LH();
|
||||||
|
|
||||||
void Mute();
|
void Mute();
|
||||||
|
|
||||||
void setLPF(float frequency, uint32_t samplerate);
|
void setLPF(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
void setHPF(float frequency, uint32_t samplerate);
|
void setHPF(float frequency, uint32_t samplerate);
|
||||||
|
|
||||||
IIR_1st *filters;
|
IIR_1st *filters;
|
||||||
|
@ -18,7 +18,8 @@ MultiBiquad::MultiBiquad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float MultiBiquad::ProcessSample(float sample) {
|
float MultiBiquad::ProcessSample(float sample) {
|
||||||
float out = sample * this->b0 + this->x_1 * this->b1 + this->x_2 * this->b2 + this->y_1 * this->a1 + this->y_2 * this->a2;
|
float out = sample * this->b0 + this->x_1 * this->b1 + this->x_2 * this->b2 + this->y_1 * this->a1 +
|
||||||
|
this->y_2 * this->a2;
|
||||||
this->y_2 = this->y_1;
|
this->y_2 = this->y_1;
|
||||||
this->y_1 = out;
|
this->y_1 = out;
|
||||||
this->x_2 = this->x_1;
|
this->x_2 = this->x_1;
|
||||||
@ -26,7 +27,8 @@ float MultiBiquad::ProcessSample(float sample) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiBiquad::RefreshFilter(FilterType type, float gainAmp, float freq, float samplerate, float qFactor, bool param_7) {
|
void
|
||||||
|
MultiBiquad::RefreshFilter(FilterType type, float gainAmp, float freq, float samplerate, float qFactor, bool param_7) {
|
||||||
bool uVar1;
|
bool uVar1;
|
||||||
int iVar2;
|
int iVar2;
|
||||||
int iVar3;
|
int iVar3;
|
||||||
|
@ -22,6 +22,7 @@ public:
|
|||||||
MultiBiquad();
|
MultiBiquad();
|
||||||
|
|
||||||
float ProcessSample(float sample);
|
float ProcessSample(float sample);
|
||||||
|
|
||||||
void RefreshFilter(FilterType type, float gainAmp, float freq, float samplerate, float qFactor, bool param_7);
|
void RefreshFilter(FilterType type, float gainAmp, float freq, float samplerate, float qFactor, bool param_7);
|
||||||
|
|
||||||
float y_2, y_1, x_2, x_1;
|
float y_2, y_1, x_2, x_1;
|
||||||
|
@ -12,8 +12,11 @@ public:
|
|||||||
NoiseSharpening();
|
NoiseSharpening();
|
||||||
|
|
||||||
void Process(float *buffer, uint32_t size);
|
void Process(float *buffer, uint32_t size);
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void SetGain(float gain);
|
void SetGain(float gain);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
IIR_1st filters[2];
|
IIR_1st filters[2];
|
||||||
|
@ -28,23 +28,35 @@ typedef struct {
|
|||||||
class PConvSingle_F32 {
|
class PConvSingle_F32 {
|
||||||
public:
|
public:
|
||||||
PConvSingle_F32();
|
PConvSingle_F32();
|
||||||
|
|
||||||
~PConvSingle_F32();
|
~PConvSingle_F32();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
int GetFFTSize();
|
int GetFFTSize();
|
||||||
|
|
||||||
int GetSegmentCount();
|
int GetSegmentCount();
|
||||||
|
|
||||||
int GetSegmentSize();
|
int GetSegmentSize();
|
||||||
|
|
||||||
bool InstanceUsable();
|
bool InstanceUsable();
|
||||||
|
|
||||||
void Convolve(float *buffer);
|
void Convolve(float *buffer);
|
||||||
|
|
||||||
void ConvolveInterleaved(float *buffer, int channel);
|
void ConvolveInterleaved(float *buffer, int channel);
|
||||||
|
|
||||||
void ConvSegment(float *buffer, bool interleaved, int channel);
|
void ConvSegment(float *buffer, bool interleaved, int channel);
|
||||||
|
|
||||||
int LoadKernel(float *buf, int param_2, int segmentSize);
|
int LoadKernel(float *buf, int param_2, int segmentSize);
|
||||||
|
|
||||||
int LoadKernel(float *buf, float *param_2, int segmentSize, int param_4, int param_5);
|
int LoadKernel(float *buf, float *param_2, int segmentSize, int param_4, int param_5);
|
||||||
|
|
||||||
int ProcessKernel(float *param_1, int param_2, int param_3);
|
int ProcessKernel(float *param_1, int param_2, int param_3);
|
||||||
|
|
||||||
int ProcessKernel(int param_2, float *param_3, int param_4, int param_5);
|
int ProcessKernel(int param_2, float *param_3, int param_4, int param_5);
|
||||||
|
|
||||||
void ReleaseResources();
|
void ReleaseResources();
|
||||||
|
|
||||||
void UnloadKernel();
|
void UnloadKernel();
|
||||||
|
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
@ -10,10 +10,13 @@
|
|||||||
class PassFilter {
|
class PassFilter {
|
||||||
public:
|
public:
|
||||||
PassFilter();
|
PassFilter();
|
||||||
|
|
||||||
~PassFilter();
|
~PassFilter();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void ProcessFrames(float *buffer, uint32_t size);
|
void ProcessFrames(float *buffer, uint32_t size);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
IIR_NOrder_BW_LH *filters[4];
|
IIR_NOrder_BW_LH *filters[4];
|
||||||
|
@ -21,11 +21,15 @@ public:
|
|||||||
PolesFilter();
|
PolesFilter();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
void UpdateCoeff();
|
void UpdateCoeff();
|
||||||
|
|
||||||
void DoFilterLeft(float sample, float *out1, float *out2, float *out3);
|
void DoFilterLeft(float sample, float *out1, float *out2, float *out3);
|
||||||
|
|
||||||
void DoFilterRight(float sample, float *out1, float *out2, float *out3);
|
void DoFilterRight(float sample, float *out1, float *out2, float *out3);
|
||||||
|
|
||||||
void SetPassFilter(uint32_t lower_freq, uint32_t upper_freq);
|
void SetPassFilter(uint32_t lower_freq, uint32_t upper_freq);
|
||||||
|
|
||||||
void SetSamplingRate(uint32_t samplerate);
|
void SetSamplingRate(uint32_t samplerate);
|
||||||
|
|
||||||
channel channels[2];
|
channel channels[2];
|
||||||
|
@ -8,9 +8,11 @@
|
|||||||
class TimeConstDelay {
|
class TimeConstDelay {
|
||||||
public:
|
public:
|
||||||
TimeConstDelay();
|
TimeConstDelay();
|
||||||
|
|
||||||
~TimeConstDelay();
|
~TimeConstDelay();
|
||||||
|
|
||||||
float ProcessSample(float sample);
|
float ProcessSample(float sample);
|
||||||
|
|
||||||
void SetParameters(uint32_t samplerate, float delay);
|
void SetParameters(uint32_t samplerate, float delay);
|
||||||
|
|
||||||
float *samples;
|
float *samples;
|
||||||
|
@ -10,18 +10,27 @@
|
|||||||
class WaveBuffer_I32 {
|
class WaveBuffer_I32 {
|
||||||
public:
|
public:
|
||||||
WaveBuffer_I32(int channels, uint32_t size);
|
WaveBuffer_I32(int channels, uint32_t size);
|
||||||
|
|
||||||
~WaveBuffer_I32();
|
~WaveBuffer_I32();
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
uint32_t GetBufferOffset();
|
uint32_t GetBufferOffset();
|
||||||
|
|
||||||
uint32_t GetBufferSize();
|
uint32_t GetBufferSize();
|
||||||
|
|
||||||
float *GetCurrentBufferI32Ptr();
|
float *GetCurrentBufferI32Ptr();
|
||||||
|
|
||||||
uint32_t PopSamples(uint32_t size, bool resetIndex);
|
uint32_t PopSamples(uint32_t size, bool resetIndex);
|
||||||
|
|
||||||
uint32_t PopSamples(float *dest, uint32_t size, bool resetIndex);
|
uint32_t PopSamples(float *dest, uint32_t size, bool resetIndex);
|
||||||
|
|
||||||
int PushSamples(float *source, uint32_t size);
|
int PushSamples(float *source, uint32_t size);
|
||||||
|
|
||||||
int PushZeros(uint32_t size);
|
int PushZeros(uint32_t size);
|
||||||
|
|
||||||
float *PushZerosGetBuffer(uint32_t size);
|
float *PushZerosGetBuffer(uint32_t size);
|
||||||
|
|
||||||
void SetBufferOffset(uint32_t offset);
|
void SetBufferOffset(uint32_t offset);
|
||||||
|
|
||||||
float *buffer;
|
float *buffer;
|
||||||
|
@ -43,7 +43,9 @@ extern "C" {
|
|||||||
return pContext->effect->process(in, out);
|
return pContext->effect->process(in, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t viper_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize, void *pReplyData) {
|
static int32_t
|
||||||
|
viper_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize, void *pCmdData, uint32_t *replySize,
|
||||||
|
void *pReplyData) {
|
||||||
auto pContext = (ViperContext *) self;
|
auto pContext = (ViperContext *) self;
|
||||||
|
|
||||||
if (pContext == nullptr) {
|
if (pContext == nullptr) {
|
||||||
@ -96,7 +98,9 @@ extern "C" {
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
v4a_printf(ANDROID_LOG_INFO, "viper_effect_create(), uuid = %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", uuid->timeLow, uuid->timeMid, uuid->timeHiAndVersion, uuid->clockSeq, uuid->node[0], uuid->node[1], uuid->node[2], uuid->node[3], uuid->node[4], uuid->node[5]);
|
v4a_printf(ANDROID_LOG_INFO, "viper_effect_create(), uuid = %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
|
||||||
|
uuid->timeLow, uuid->timeMid, uuid->timeHiAndVersion, uuid->clockSeq, uuid->node[0], uuid->node[1],
|
||||||
|
uuid->node[2], uuid->node[3], uuid->node[4], uuid->node[5]);
|
||||||
v4a_print(ANDROID_LOG_INFO, "viper_effect_create(), v4a standard effect (normal), Constructing ProcessUnit_FX");
|
v4a_print(ANDROID_LOG_INFO, "viper_effect_create(), v4a standard effect (normal), Constructing ProcessUnit_FX");
|
||||||
|
|
||||||
auto *pContext = new ViperContext;
|
auto *pContext = new ViperContext;
|
||||||
@ -149,7 +153,9 @@ extern "C" {
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
v4a_printf(ANDROID_LOG_INFO, "viper_effect_get_descriptor(), uuid = %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", uuid->timeLow, uuid->timeMid, uuid->timeHiAndVersion, uuid->clockSeq, uuid->node[0], uuid->node[1], uuid->node[2], uuid->node[3], uuid->node[4], uuid->node[5]);
|
v4a_printf(ANDROID_LOG_INFO, "viper_effect_get_descriptor(), uuid = %08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x",
|
||||||
|
uuid->timeLow, uuid->timeMid, uuid->timeHiAndVersion, uuid->clockSeq, uuid->node[0], uuid->node[1],
|
||||||
|
uuid->node[2], uuid->node[3], uuid->node[4], uuid->node[5]);
|
||||||
|
|
||||||
*pDescriptor = viper_descriptor;
|
*pDescriptor = viper_descriptor;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user