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 ...");
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@ -89,7 +90,8 @@ int32_t Effect::configure(effect_config_t *newConfig) {
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -10,10 +10,13 @@
|
||||
class Effect {
|
||||
public:
|
||||
Effect();
|
||||
|
||||
~Effect();
|
||||
|
||||
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 configure(effect_config_t *config);
|
||||
|
||||
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
|
||||
return -1;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
class ProcessUnit_FX : public Effect {
|
||||
public:
|
||||
ProcessUnit_FX();
|
||||
|
||||
~ProcessUnit_FX();
|
||||
|
||||
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
|
||||
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();
|
||||
|
||||
bool init_ok, enabled, force_enabled, fetcomp_enabled;
|
||||
|
@ -7,7 +7,9 @@
|
||||
#ifdef ANDROID_TOOLCHAIN
|
||||
#include <android/errno.h>
|
||||
#else
|
||||
|
||||
#include <cerrno>
|
||||
|
||||
#endif
|
||||
|
||||
#include "log.h" // TODO: Remove this dependency
|
||||
|
@ -13,9 +13,11 @@ public:
|
||||
AnalogX();
|
||||
|
||||
void Process(float *samples, uint32_t size);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetProcessingModel(int model);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
MultiBiquad highpass[2];
|
||||
|
@ -13,16 +13,25 @@ public:
|
||||
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;
|
||||
|
@ -11,13 +11,17 @@
|
||||
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;
|
||||
|
@ -12,13 +12,19 @@ public:
|
||||
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;
|
||||
|
@ -11,14 +11,21 @@ public:
|
||||
Reverberation();
|
||||
|
||||
void Reset();
|
||||
|
||||
void Process(float *buffer, uint32_t size);
|
||||
|
||||
void SetEnable(bool enable);
|
||||
|
||||
void SetRoomSize(float value);
|
||||
|
||||
void SetDamp(float value);
|
||||
|
||||
void SetWet(float value);
|
||||
|
||||
void SetDry(float value);
|
||||
|
||||
void SetWidth(float value);
|
||||
|
||||
void SetSamplingRate(uint32_t value);
|
||||
|
||||
float roomsize;
|
||||
|
@ -12,9 +12,11 @@ public:
|
||||
SpeakerCorrection();
|
||||
|
||||
void Process(float *samples, uint32_t size);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetEnable(bool enabled);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
uint32_t samplerate;
|
||||
|
@ -42,11 +42,15 @@ void SpectrumExtend::Process(float *samples, uint32_t size) {
|
||||
}
|
||||
|
||||
void SpectrumExtend::Reset() {
|
||||
this->highpass[0].RefreshFilter(FilterType::HIGHPASS, 0.0, (float)this->referenceFreq, (float)this->samplerate, 0.717, false);
|
||||
this->highpass[1].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,
|
||||
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[1].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,
|
||||
(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[1].Reset();
|
||||
|
@ -11,13 +11,19 @@
|
||||
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];
|
||||
|
@ -11,6 +11,7 @@ public:
|
||||
TubeSimulator();
|
||||
|
||||
void Reset();
|
||||
|
||||
void TubeProcess(float *buffer, uint32_t size);
|
||||
|
||||
float acc[2];
|
||||
|
@ -11,14 +11,19 @@
|
||||
class VHE {
|
||||
public:
|
||||
VHE();
|
||||
|
||||
~VHE();
|
||||
|
||||
void Process(float *source, float *dest, int frameSize);
|
||||
|
||||
void Reset();
|
||||
|
||||
bool GetEnabled();
|
||||
|
||||
void SetEffectLevel(uint32_t level);
|
||||
|
||||
void SetEnable(bool enabled);
|
||||
|
||||
void SetSamplingRate(uint32_t srate);
|
||||
|
||||
PConvSingle_F32 convLeft, convRight;
|
||||
|
@ -20,12 +20,17 @@ public:
|
||||
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;
|
||||
|
@ -11,10 +11,13 @@ public:
|
||||
CAllpassFilter();
|
||||
|
||||
void Mute();
|
||||
|
||||
float Process(float sample);
|
||||
|
||||
float GetFeedback();
|
||||
|
||||
void SetBuffer(float *buffer, uint32_t size);
|
||||
|
||||
void SetFeedback(float feedback);
|
||||
|
||||
float *buffer;
|
||||
|
@ -11,12 +11,17 @@ public:
|
||||
CCombFilter();
|
||||
|
||||
float Process(float sample);
|
||||
|
||||
void Mute();
|
||||
|
||||
float GetDamp();
|
||||
|
||||
float GetFeedback();
|
||||
|
||||
void SetDamp(float damp);
|
||||
|
||||
void SetFeedback(float feedback);
|
||||
|
||||
void SetBuffer(float *buffer, uint32_t size);
|
||||
|
||||
float feedback;
|
||||
|
@ -10,24 +10,39 @@
|
||||
class CRevModel {
|
||||
public:
|
||||
CRevModel();
|
||||
|
||||
~CRevModel();
|
||||
|
||||
void Mute();
|
||||
|
||||
void ProcessReplace(float *bufL, float *bufR, uint32_t size);
|
||||
|
||||
void UpdateCoeffs();
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetRoomSize(float value);
|
||||
|
||||
void SetDamp(float value);
|
||||
|
||||
void SetWet(float value);
|
||||
|
||||
void SetDry(float value);
|
||||
|
||||
void SetWidth(float value);
|
||||
|
||||
void SetMode(int value);
|
||||
|
||||
float GetRoomSize();
|
||||
|
||||
float GetDamp();
|
||||
|
||||
float GetWet();
|
||||
|
||||
float GetDry();
|
||||
|
||||
float GetWidth();
|
||||
|
||||
int GetMode();
|
||||
|
||||
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 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) {
|
||||
this->lfs.lo[0] = lo_filter(sample[0], this->lfs.lo[0]);
|
||||
this->lfs.lo[1] = lo_filter(sample[1], this->lfs.lo[1]);
|
||||
|
@ -17,16 +17,25 @@ public:
|
||||
Crossfeed();
|
||||
|
||||
void Reset();
|
||||
|
||||
void ProcessFrames(float *buffer, uint32_t size);
|
||||
|
||||
void FilterSample(float *sample);
|
||||
|
||||
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);
|
||||
|
||||
uint32_t samplerate;
|
||||
|
@ -14,8 +14,11 @@ public:
|
||||
DepthSurround();
|
||||
|
||||
void Process(float *samples, uint32_t size);
|
||||
|
||||
void RefreshStrength(short strength);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
void SetStrength(short strength);
|
||||
|
||||
short strength;
|
||||
|
@ -13,11 +13,17 @@ public:
|
||||
DynamicBass();
|
||||
|
||||
void FilterSamples(float *samples, uint32_t size);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetBassGain(float gain);
|
||||
|
||||
void SetFilterXPassFrequency(uint32_t low, uint32_t high);
|
||||
|
||||
void SetFilterYPassFrequency(uint32_t low, uint32_t high);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
void SetSideGain(float gainX, float gainY);
|
||||
|
||||
uint32_t lowFreqX, highFreqX;
|
||||
|
@ -11,7 +11,8 @@ FixedBiquad::FixedBiquad() {
|
||||
}
|
||||
|
||||
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_1 = out;
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
float fVar12 = (frequency * 2.f * (float) M_PI) / (float) samplerate;
|
||||
float x = powf(10.f, param_4 / 40.f);
|
||||
|
@ -12,10 +12,15 @@ public:
|
||||
FixedBiquad();
|
||||
|
||||
float ProcessSample(float sample);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetCoeffs(float a0, float a1, float a2, float b0, float b1, float b2);
|
||||
|
||||
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 SetLowPassParameter(float frequency, uint32_t samplerate, float qFactor);
|
||||
|
||||
|
||||
|
@ -10,12 +10,15 @@
|
||||
class Harmonic {
|
||||
public:
|
||||
Harmonic();
|
||||
|
||||
~Harmonic();
|
||||
|
||||
float Process(float sample);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetHarmonics(float *coeffs);
|
||||
|
||||
void UpdateCoeffs(float *coeffs);
|
||||
|
||||
float coeffs[11];
|
||||
|
@ -12,12 +12,15 @@
|
||||
class HiFi {
|
||||
public:
|
||||
HiFi();
|
||||
|
||||
~HiFi();
|
||||
|
||||
void Process(float *samples, uint32_t size);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetClarity(float value);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
WaveBuffer_I32 *buffers[2];
|
||||
|
@ -6,7 +6,8 @@
|
||||
#include "HighShelf.h"
|
||||
|
||||
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_1 = out;
|
||||
this->x_2 = this->x_1;
|
||||
|
@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class HighShelf {
|
||||
@ -10,8 +11,11 @@ public:
|
||||
float Process(float sample);
|
||||
|
||||
void SetFrequency(uint32_t freq);
|
||||
|
||||
void SetGain(float gain);
|
||||
|
||||
void SetQuality(float q);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
uint32_t frequency, samplerate;
|
||||
|
@ -3,6 +3,7 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class IIR_1st {
|
||||
@ -10,21 +11,37 @@ public:
|
||||
IIR_1st();
|
||||
|
||||
void Mute();
|
||||
|
||||
void SetCoefficients(float b0, float b1, float a1);
|
||||
|
||||
void setHPF_A(float frequency, uint32_t samplerate);
|
||||
|
||||
void setHPF_BW(float frequency, uint32_t samplerate);
|
||||
|
||||
void setHPF_C(float frequency, uint32_t samplerate);
|
||||
|
||||
void setHPFwLPS_A(float frequency, uint32_t samplerate);
|
||||
|
||||
void setHSF_A(float f1, float f2, uint32_t samplerate);
|
||||
|
||||
void setLPF_A(float frequency, uint32_t samplerate);
|
||||
|
||||
void setLPF_BW(float frequency, uint32_t samplerate);
|
||||
|
||||
void setLPF_C(float frequency, uint32_t samplerate);
|
||||
|
||||
void setLSF_A(float f1, float f2, uint32_t samplerate);
|
||||
|
||||
void setPole(float a1);
|
||||
|
||||
void setPoleHPF(float frequency, uint32_t samplerate);
|
||||
|
||||
void setPoleLPF(float frequency, uint32_t samplerate);
|
||||
|
||||
void setZero(float b1);
|
||||
|
||||
void setZeroHPF(float frequency, uint32_t samplerate);
|
||||
|
||||
void setZeroLPF(float frequency, uint32_t samplerate);
|
||||
|
||||
float b0, b1, a1;
|
||||
|
@ -9,9 +9,11 @@
|
||||
class IIR_NOrder_BW_BP {
|
||||
public:
|
||||
explicit IIR_NOrder_BW_BP(uint32_t order);
|
||||
|
||||
~IIR_NOrder_BW_BP();
|
||||
|
||||
void Mute();
|
||||
|
||||
void setBPF(float highCut, float lowCut, uint32_t samplerate);
|
||||
|
||||
IIR_1st *lowpass;
|
||||
|
@ -9,10 +9,13 @@
|
||||
class IIR_NOrder_BW_LH {
|
||||
public:
|
||||
explicit IIR_NOrder_BW_LH(uint32_t order);
|
||||
|
||||
~IIR_NOrder_BW_LH();
|
||||
|
||||
void Mute();
|
||||
|
||||
void setLPF(float frequency, uint32_t samplerate);
|
||||
|
||||
void setHPF(float frequency, uint32_t samplerate);
|
||||
|
||||
IIR_1st *filters;
|
||||
|
@ -18,7 +18,8 @@ MultiBiquad::MultiBiquad() {
|
||||
}
|
||||
|
||||
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_1 = out;
|
||||
this->x_2 = this->x_1;
|
||||
@ -26,7 +27,8 @@ float MultiBiquad::ProcessSample(float sample) {
|
||||
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;
|
||||
int iVar2;
|
||||
int iVar3;
|
||||
|
@ -22,6 +22,7 @@ public:
|
||||
MultiBiquad();
|
||||
|
||||
float ProcessSample(float sample);
|
||||
|
||||
void RefreshFilter(FilterType type, float gainAmp, float freq, float samplerate, float qFactor, bool param_7);
|
||||
|
||||
float y_2, y_1, x_2, x_1;
|
||||
|
@ -12,8 +12,11 @@ public:
|
||||
NoiseSharpening();
|
||||
|
||||
void Process(float *buffer, uint32_t size);
|
||||
|
||||
void Reset();
|
||||
|
||||
void SetGain(float gain);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
IIR_1st filters[2];
|
||||
|
@ -28,23 +28,35 @@ typedef struct {
|
||||
class PConvSingle_F32 {
|
||||
public:
|
||||
PConvSingle_F32();
|
||||
|
||||
~PConvSingle_F32();
|
||||
|
||||
void Reset();
|
||||
|
||||
int GetFFTSize();
|
||||
|
||||
int GetSegmentCount();
|
||||
|
||||
int GetSegmentSize();
|
||||
|
||||
bool InstanceUsable();
|
||||
|
||||
void Convolve(float *buffer);
|
||||
|
||||
void ConvolveInterleaved(float *buffer, int channel);
|
||||
|
||||
void ConvSegment(float *buffer, bool interleaved, int channel);
|
||||
|
||||
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 ProcessKernel(float *param_1, int param_2, int param_3);
|
||||
|
||||
int ProcessKernel(int param_2, float *param_3, int param_4, int param_5);
|
||||
|
||||
void ReleaseResources();
|
||||
|
||||
void UnloadKernel();
|
||||
|
||||
bool enabled;
|
||||
|
@ -10,10 +10,13 @@
|
||||
class PassFilter {
|
||||
public:
|
||||
PassFilter();
|
||||
|
||||
~PassFilter();
|
||||
|
||||
void Reset();
|
||||
|
||||
void ProcessFrames(float *buffer, uint32_t size);
|
||||
|
||||
void SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
IIR_NOrder_BW_LH *filters[4];
|
||||
|
@ -21,11 +21,15 @@ public:
|
||||
PolesFilter();
|
||||
|
||||
void Reset();
|
||||
|
||||
void UpdateCoeff();
|
||||
|
||||
void DoFilterLeft(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 SetSamplingRate(uint32_t samplerate);
|
||||
|
||||
channel channels[2];
|
||||
|
@ -8,9 +8,11 @@
|
||||
class TimeConstDelay {
|
||||
public:
|
||||
TimeConstDelay();
|
||||
|
||||
~TimeConstDelay();
|
||||
|
||||
float ProcessSample(float sample);
|
||||
|
||||
void SetParameters(uint32_t samplerate, float delay);
|
||||
|
||||
float *samples;
|
||||
|
@ -10,18 +10,27 @@
|
||||
class WaveBuffer_I32 {
|
||||
public:
|
||||
WaveBuffer_I32(int channels, uint32_t size);
|
||||
|
||||
~WaveBuffer_I32();
|
||||
|
||||
void Reset();
|
||||
|
||||
uint32_t GetBufferOffset();
|
||||
|
||||
uint32_t GetBufferSize();
|
||||
|
||||
float *GetCurrentBufferI32Ptr();
|
||||
|
||||
uint32_t PopSamples(uint32_t size, bool resetIndex);
|
||||
|
||||
uint32_t PopSamples(float *dest, uint32_t size, bool resetIndex);
|
||||
|
||||
int PushSamples(float *source, uint32_t size);
|
||||
|
||||
int PushZeros(uint32_t size);
|
||||
|
||||
float *PushZerosGetBuffer(uint32_t size);
|
||||
|
||||
void SetBufferOffset(uint32_t offset);
|
||||
|
||||
float *buffer;
|
||||
|
@ -43,7 +43,9 @@ extern "C" {
|
||||
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;
|
||||
|
||||
if (pContext == nullptr) {
|
||||
@ -96,7 +98,9 @@ extern "C" {
|
||||
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");
|
||||
|
||||
auto *pContext = new ViperContext;
|
||||
@ -149,7 +153,9 @@ extern "C" {
|
||||
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user