commit 0f30a35b4948f02ceb86cde50d1e6f1b58f48caf Author: Martmists Date: Sat Feb 13 15:32:09 2021 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ec69de --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# IntelliJ project files +.idea/ +out/ +gen/ + +# cmake +cmake-build-debug/ +CMakeFiles/ +Makefile +cmake_install.cmake +CMakeCache.txt +*.cbp + +# build +build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..da93e28 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,43 @@ +# For more information about using CMake with Android Studio, read the +# documentation: https://d.android.com/studio/projects/add-native-code.html + +# Sets the minimum version of CMake required to build the native library. + +cmake_minimum_required(VERSION 3.10.2) + +# Declares and names the project. + +project("viper") + +file(GLOB EFFECTS src/effects/*.cpp) +file(GLOB UTIL src/util/*.cpp) + +# Creates and names a library, sets it as either STATIC +# or SHARED, and provides the relative paths to its source code. +# You can define multiple libraries, and CMake builds them for you. +# Gradle automatically packages shared libraries with your APK. + +add_library( # Sets the name of the library. + libv4a_fx + + # Sets the library as a shared library. + SHARED + + # Provides a relative path to your source file(s). + src/main.cpp + src/ProcessUnit_FX.cpp + ${EFFECTS} + ${UTIL} src/data.h) + +# Searches for a specified prebuilt library and stores the path as a +# variable. Because CMake includes system libraries in the search path by +# default, you only need to specify the name of the public NDK library +# you want to add. CMake verifies that the library exists before +# completing its build. + +# Specifies libraries CMake should link to your target library. You +# can link multiple libraries, such as libraries you define in this +# build script, prebuilt third-party libraries, or system libraries. + +target_link_libraries( # Specifies the target library. + libv4a_fx) diff --git a/README.md b/README.md new file mode 100644 index 0000000..582dcb1 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# ViPERFX RE + +This is a project aimed to reverse-engineer ViPERFX. The version of the shared library used is the armv7 version +taken from the ViPER4Android Magisk apk. It was then imported in Ghidra and analyzed. + +There's a lot of code that doesn't quite make sense, and it's important to look at the bytecode if something seems strange. +Liberties may be taken to write equivalent code in a mor readable way. + +# Contributing + +Feel free to PR in a more "clean" version of various methods, or general project cleanup. +You may rename fields, but ideally this is left until all methods are cleaned. diff --git a/src/ProcessUnit_FX.cpp b/src/ProcessUnit_FX.cpp new file mode 100644 index 0000000..0a2af61 --- /dev/null +++ b/src/ProcessUnit_FX.cpp @@ -0,0 +1,1942 @@ +// +// Created by mart on 2/13/21. +// + +#include "ProcessUnit_FX.h" +#include "util/AdaptiveBuffer_FPI32.h" + +// ProcessUnit_FX::ProcessUnit_FX() + +ProcessUnit_FX::ProcessUnit_FX() { + AdaptiveBuffer_FPI32 *this_00; + WaveBuffer_R32 *this_01; + Convolver *this_02; + VHE *this_03; + ViPERDDC *this_04; + SpectrumExtend *this_05; + IIRFilter *this_06; + ColorfulMusic *this_07; + Reverberation *this_08; + PlaybackGain *this_09; + FETCompressor *this_10; + DynamicSystem *this_11; + ViPERBass *this_12; + ViPERClarity *this_13; + DiffSurround *this_14; + Cure *this_15; + AnalogX *pAVar1; + TubeSimulator *pTVar2; + SpeakerCorrection *this_16; + SoftwareLimiter *pSVar3; + float fVar4; + float extraout_s0; + + Effect::Effect((Effect *)this); + this->field_0x0 = &PTR_command_000d0cf8; + __android_log_print(4,"ViPER4Android_v2","Welcome to ViPER4Android driver[SQ]"); + __android_log_print(4,"ViPER4Android_v2","Current version is %d.%d.%d.%d %s",2,5,0,4,"Beautiful"); + this->field_0x68 = (undefined *)this; + this->field_0x88 = 0; + this_00 = (AdaptiveBuffer_FPI32 *)operator_new(0x20); + this_00 = new AdaptiveBuffer_FPI32(2,0x1000); + this->floatIntBuffer = this_00; + this_01 = (WaveBuffer_R32 *)operator_new(0x20); + WaveBuffer_R32::WaveBuffer_R32(this_01,2,0x1000); + this->waveBuffer = this_01; + this_02 = (Convolver *)operator_new(0x174); + Convolver::Convolver(this_02); + this->convolver = this_02; + this_03 = (VHE *)operator_new(0x38); + VHE::VHE(this_03); + this->vhe = this_03; + this_04 = (ViPERDDC *)operator_new(0x34); + ViPERDDC::ViPERDDC(this_04); + this->vddc = this_04; + this_05 = (SpectrumExtend *)operator_new(0x118); + SpectrumExtend::SpectrumExtend(this_05); + this->spectrumExtend = this_05; + this_06 = (IIRFilter *)operator_new(0x860); + IIRFilter::IIRFilter(this_06,10); + this->iirFilter = this_06; + this_07 = (ColorfulMusic *)operator_new(0x6c); + ColorfulMusic::ColorfulMusic(this_07); + this->colorful = this_07; + this_08 = (Reverberation *)operator_new(0x2ec); + Reverberation::Reverberation(this_08); + this->reverb = this_08; + this_09 = (PlaybackGain *)operator_new(0x78); + PlaybackGain::PlaybackGain(this_09); + this->playbackGain = this_09; + this_10 = (FETCompressor *)operator_new(0xb0); + FETCompressor::FETCompressor(this_10); + this->fetCompressor = this_10; + this_11 = (DynamicSystem *)operator_new(0x138); + DynamicSystem::DynamicSystem(this_11); + this->dynamicSystem = this_11; + this_12 = (ViPERBass *)operator_new(0x2c); + ViPERBass::ViPERBass(this_12); + this->vbass = this_12; + this_13 = (ViPERClarity *)operator_new(0xe0); + ViPERClarity::ViPERClarity(this_13); + this->vclarity = this_13; + this_14 = (DiffSurround *)operator_new(0x14); + DiffSurround::DiffSurround(this_14); + this->diffSurround = this_14; + this_15 = (Cure *)operator_new(0x50); + Cure::Cure(this_15); + this->cure = this_15; + pAVar1 = (AnalogX *)operator_new(0x164); + AnalogX::AnalogX(pAVar1); + this->analogx = pAVar1; + pTVar2 = (TubeSimulator *)operator_new(0xc); + TubeSimulator::TubeSimulator(pTVar2); + this->tubeSim = pTVar2; + this_16 = (SpeakerCorrection *)operator_new(0xe0); + SpeakerCorrection::SpeakerCorrection(this_16); + this->speakerCorrection = this_16; + pSVar3 = (SoftwareLimiter *)operator_new(0xc28); + SoftwareLimiter::SoftwareLimiter(pSVar3); + this->softLimit1 = pSVar3; + pSVar3 = (SoftwareLimiter *)operator_new(0xc28); + fVar4 = (float)SoftwareLimiter::SoftwareLimiter(pSVar3); + this->softLimit2 = pSVar3; + if (this->convolver != nullptr) { + Convolver::SetEnable(this->convolver,false); + Convolver::SetSamplingRate(this->convolver,this->samplerate); + fVar4 = (float)Convolver::Reset(this->convolver); + } + if (this->vhe != nullptr) { + VHE::SetEnable(this->vhe,false); + VHE::SetSamplingRate(this->vhe,this->samplerate); + fVar4 = (float)VHE::Reset(this->vhe); + } + if (this->vddc != nullptr) { + ViPERDDC::SetEnable(this->vddc,false); + ViPERDDC::SetSamplingRate(this->vddc,this->samplerate); + fVar4 = (float)ViPERDDC::Reset(this->vddc); + } + if (this->spectrumExtend != nullptr) { + SpectrumExtend::SetEnable(this->spectrumExtend,false); + SpectrumExtend::SetSamplingRate(this->spectrumExtend,this->samplerate); + fVar4 = (float)SpectrumExtend::SetReferenceFrequency(this->spectrumExtend,0x1db0); + SpectrumExtend::SetExciter(this->spectrumExtend,fVar4); + fVar4 = (float)SpectrumExtend::Reset(); + } + if (this->iirFilter != nullptr) { + IIRFilter::SetEnable(this->iirFilter,false); + IIRFilter::SetSamplingRate(this->iirFilter,this->samplerate); + fVar4 = (float)IIRFilter::Reset(this->iirFilter); + } + if (this->colorful != nullptr) { + ColorfulMusic::SetEnable(this->colorful,false); + ColorfulMusic::SetSamplingRate(this->colorful,this->samplerate); + fVar4 = (float)ColorfulMusic::Reset(this->colorful); + } + if (this->reverb != nullptr) { + Reverberation::SetEnable(this->reverb,false); + Reverberation::SetSamplingRate(this->reverb,this->samplerate); + fVar4 = (float)Reverberation::Reset(this->reverb); + } + if (this->playbackGain != nullptr) { + PlaybackGain::SetEnable(this->playbackGain,false); + PlaybackGain::SetSamplingRate(this->playbackGain,this->samplerate); + PlaybackGain::Reset(this->playbackGain); + fVar4 = extraout_s0; + } + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,fVar4); + FETCompressor::SetSamplingRate(this->fetCompressor,this->samplerate); + FETCompressor::Reset(this->fetCompressor); + } + if (this->dynamicSystem != nullptr) { + DynamicSystem::SetEnable(this->dynamicSystem,false); + DynamicSystem::SetSamplingRate(this->dynamicSystem,this->samplerate); + DynamicSystem::Reset(this->dynamicSystem); + } + if (this->vbass != nullptr) { + ViPERBass::SetEnable(this->vbass,false); + ViPERBass::SetSamplingRate(this->vbass,this->samplerate); + ViPERBass::Reset(); + } + if (this->vclarity != nullptr) { + ViPERClarity::SetEnable(this->vclarity,false); + ViPERClarity::SetSamplingRate(this->vclarity,this->samplerate); + ViPERClarity::Reset(this->vclarity); + } + if (this->diffSurround != nullptr) { + DiffSurround::SetEnable(this->diffSurround,false); + DiffSurround::SetSamplingRate(this->diffSurround,this->samplerate); + DiffSurround::Reset(this->diffSurround); + } + if (this->cure != nullptr) { + Cure::SetEnable(this->cure,false); + Cure::SetSamplingRate(this->cure,this->samplerate); + Cure::Reset(this->cure); + } + pTVar2 = this->tubeSim; + if (pTVar2 != nullptr) { + pTVar2->field_0x8 = false; + TubeSimulator::Reset(pTVar2); + } + pAVar1 = this->analogx; + if (pAVar1 != nullptr) { + pAVar1->enabled = false; + AnalogX::SetSamplingRate(pAVar1,this->samplerate); + AnalogX::SetProcessingModel(this->analogx,0); + AnalogX::Reset(this->analogx); + } + if (this->speakerCorrection != nullptr) { + SpeakerCorrection::SetEnable(this->speakerCorrection,false); + SpeakerCorrection::SetSamplingRate(this->speakerCorrection,this->samplerate); + SpeakerCorrection::Reset(this->speakerCorrection); + } + if (this->softLimit1 != nullptr) { + SoftwareLimiter::ResetLimiter(this->softLimit1); + } + if (this->softLimit2 != nullptr) { + SoftwareLimiter::ResetLimiter(this->softLimit2); + } + if (((((((this->floatIntBuffer == nullptr) || (this->waveBuffer == nullptr)) || + (this->softLimit1 == nullptr)) || + (((this->softLimit2 == nullptr || (this->convolver == nullptr)) || + ((this->vhe == nullptr || ((this->vddc == nullptr || (this->spectrumExtend == nullptr)))))))) || + ((this->iirFilter == nullptr || + (((this->colorful == nullptr || (this->reverb == nullptr)) || (this->playbackGain == nullptr)))))) || + (((this->fetCompressor == nullptr || (this->vbass == nullptr)) || + (((this->vclarity == nullptr || ((this->diffSurround == nullptr || (this->dynamicSystem == nullptr)))) + || (this->cure == nullptr)))))) || + (((this->tubeSim == nullptr || (this->analogx == nullptr)) || (this->speakerCorrection == nullptr)))) { + *(undefined *)&this->field_0x78 = 0; + } + else { + *(undefined *)&this->field_0x78 = 1; + } + this->field_0xd8 = 0x2000000; + this->field_0xdc = 0x2000000; + this->field_0x70 = 0; + this->field_0xe0 = 0x2000000; + *(undefined *)&this->field_0x79 = 0; + *(undefined *)&this->field_0x7a = 0; + this->field_0x7c = 0; + *(undefined *)&this->field_0x6c = 0; + return this; +} + + + +// ProcessUnit_FX::~ProcessUnit_FX() + +ProcessUnit_FX::~ProcessUnit_FX() { + AdaptiveBuffer_FPI32 *this_00; + WaveBuffer_R32 *this_01; + Convolver *this_02; + VHE *this_03; + ViPERDDC *this_04; + SpectrumExtend *this_05; + IIRFilter *this_06; + ColorfulMusic *pCVar1; + Reverberation *pRVar2; + FETCompressor *this_07; + ViPERBass *this_08; + ViPERClarity *this_09; + DiffSurround *this_10; + Cure *this_11; + Harmonic *this_12; + AnalogX *pAVar3; + + this_00 = this->floatIntBuffer; + this->field_0x0 = &PTR_command_000d0cf8; + if (this_00 != nullptr) { + AdaptiveBuffer_FPI32::~AdaptiveBuffer_FPI32(this_00); + operator_delete(this_00); + } + this_01 = this->waveBuffer; + if (this_01 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(this_01); + operator_delete(this_01); + } + this_02 = this->convolver; + if (this_02 != nullptr) { + Convolver::~Convolver(this_02); + operator_delete(this_02); + } + this_03 = this->vhe; + if (this_03 != nullptr) { + VHE::~VHE(this_03); + operator_delete(this_03); + } + this_04 = this->vddc; + if (this_04 != nullptr) { + ViPERDDC::~ViPERDDC(this_04); + operator_delete(this_04); + } + this_05 = this->spectrumExtend; + if (this_05 != nullptr) { + SpectrumExtend::~SpectrumExtend(this_05); + operator_delete(this_05); + } + this_06 = this->iirFilter; + if (this_06 != nullptr) { + IIRFilter::~IIRFilter(this_06); + operator_delete(this_06); + } + pCVar1 = this->colorful; + if (pCVar1 != nullptr) { + TimeConstDelay::~TimeConstDelay((TimeConstDelay *)&pCVar1->field_0x34); + TimeConstDelay::~TimeConstDelay((TimeConstDelay *)&pCVar1->field_0x28); + operator_delete(pCVar1); + } + pRVar2 = this->reverb; + if (pRVar2 != nullptr) { + CRevModel::~CRevModel(&pRVar2->field_0x14); + operator_delete(pRVar2); + } + if (this->playbackGain != nullptr) { + operator_delete(this->playbackGain); + } + this_07 = this->fetCompressor; + if (this_07 != nullptr) { + FETCompressor::~FETCompressor(this_07); + operator_delete(this_07); + } + if (this->dynamicSystem != nullptr) { + operator_delete(this->dynamicSystem); + } + this_08 = this->vbass; + if (this_08 != nullptr) { + ViPERBass::~ViPERBass(this_08); + operator_delete(this_08); + } + this_09 = this->vclarity; + if (this_09 != nullptr) { + ViPERClarity::~ViPERClarity(this_09); + operator_delete(this_09); + } + this_10 = this->diffSurround; + if (this_10 != nullptr) { + DiffSurround::~DiffSurround(this_10); + operator_delete(this_10); + } + this_11 = this->cure; + if (this_11 != nullptr) { + Cure::~Cure(this_11); + operator_delete(this_11); + } + if (this->tubeSim != nullptr) { + operator_delete(this->tubeSim); + } + pAVar3 = this->analogx; + if (pAVar3 != nullptr) { + this_12 = (Harmonic *)&pAVar3->field_0xc0; + do { + this_12 = this_12 + -1; + Harmonic::~Harmonic(this_12); + } while (&pAVar3->field_0x48 != this_12); + operator_delete(pAVar3); + } + if (this->speakerCorrection != nullptr) { + operator_delete(this->speakerCorrection); + } + if (this->softLimit1 != nullptr) { + operator_delete(this->softLimit1); + } + if (this->softLimit2 != nullptr) { + operator_delete(this->softLimit2); + } + Effect::~Effect((Effect *)this); + return this; +} + + + +// ProcessUnit_FX::ResetAllEffects() + +void ProcessUnit_FX::ResetAllEffects() { + if (this->convolver != nullptr) { + Convolver::SetSamplingRate(this->convolver,this->samplerate); + } + if (this->vhe != nullptr) { + VHE::SetSamplingRate(this->vhe,this->samplerate); + } + if (this->vddc != nullptr) { + ViPERDDC::SetSamplingRate(this->vddc,this->samplerate); + } + if (this->spectrumExtend != nullptr) { + SpectrumExtend::SetSamplingRate(this->spectrumExtend,this->samplerate); + } + if (this->iirFilter != nullptr) { + IIRFilter::SetSamplingRate(this->iirFilter,this->samplerate); + } + if (this->colorful != nullptr) { + ColorfulMusic::SetSamplingRate(this->colorful,this->samplerate); + } + if (this->reverb != nullptr) { + Reverberation::SetSamplingRate(this->reverb,this->samplerate); + } + if (this->playbackGain != nullptr) { + PlaybackGain::SetSamplingRate(this->playbackGain,this->samplerate); + } + if (this->fetCompressor != nullptr) { + FETCompressor::SetSamplingRate(this->fetCompressor,this->samplerate); + } + if (this->dynamicSystem != nullptr) { + DynamicSystem::SetSamplingRate(this->dynamicSystem,this->samplerate); + } + if (this->vbass != nullptr) { + ViPERBass::SetSamplingRate(this->vbass,this->samplerate); + } + if (this->vclarity != nullptr) { + ViPERClarity::SetSamplingRate(this->vclarity,this->samplerate); + } + if (this->diffSurround != nullptr) { + DiffSurround::SetSamplingRate(this->diffSurround,this->samplerate); + } + if (this->cure != nullptr) { + Cure::SetSamplingRate(this->cure,this->samplerate); + } + if (this->analogx != nullptr) { + AnalogX::SetSamplingRate(this->analogx,this->samplerate); + } + if (this->speakerCorrection != nullptr) { + SpeakerCorrection::SetSamplingRate(this->speakerCorrection,this->samplerate); + } + if (this->floatIntBuffer != nullptr) { + AdaptiveBuffer_FPI32::FlushBuffer(this->floatIntBuffer); + } + if (this->waveBuffer != nullptr) { + WaveBuffer_R32::Reset(this->waveBuffer); + } + if (this->convolver != nullptr) { + Convolver::Reset(this->convolver); + } + if (this->vhe != nullptr) { + VHE::Reset(this->vhe); + } + if (this->vddc != nullptr) { + ViPERDDC::Reset(this->vddc); + } + if (this->spectrumExtend != nullptr) { + SpectrumExtend::Reset(); + } + if (this->iirFilter != nullptr) { + IIRFilter::Reset(this->iirFilter); + } + if (this->colorful != nullptr) { + ColorfulMusic::Reset(this->colorful); + } + if (this->reverb != nullptr) { + Reverberation::Reset(this->reverb); + } + if (this->playbackGain != nullptr) { + PlaybackGain::Reset(this->playbackGain); + } + if (this->fetCompressor != nullptr) { + FETCompressor::Reset(this->fetCompressor); + } + if (this->dynamicSystem != nullptr) { + DynamicSystem::Reset(this->dynamicSystem); + } + if (this->vbass != nullptr) { + ViPERBass::Reset(); + } + if (this->vclarity != nullptr) { + ViPERClarity::Reset(this->vclarity); + } + if (this->diffSurround != nullptr) { + DiffSurround::Reset(this->diffSurround); + } + if (this->cure != nullptr) { + Cure::Reset(this->cure); + } + if (this->tubeSim != nullptr) { + TubeSimulator::Reset(this->tubeSim); + } + if (this->analogx != nullptr) { + AnalogX::Reset(this->analogx); + } + if (this->speakerCorrection != nullptr) { + SpeakerCorrection::Reset(this->speakerCorrection); + } + if (this->softLimit1 != nullptr) { + SoftwareLimiter::ResetLimiter(this->softLimit1); + } + if (this->softLimit2 == nullptr) { + return; + } + SoftwareLimiter::ResetLimiter(this->softLimit2); + return; +} + + + +// ProcessUnit_FX::DispatchCommand(int, int, int, int, int, int, signed char*) + +void ProcessUnit_FX::DispatchCommand(int param_1,int param_2,int param_3,int param_4,int param_5, + int param_6,signed *param_7) { + bool bVar1; + signed *psVar2; + PlaybackGain *this_00; + DynamicSystem *this_01; + TubeSimulator *pTVar3; + SpeakerCorrection *this_02; + SoftwareLimiter *pSVar4; + uint uVar5; + float fVar6; + int iVar7; + AdaptiveBuffer_FPI32 *pAVar8; + WaveBuffer_R32 *pWVar9; + Convolver *pCVar10; + VHE *pVVar11; + ViPERDDC *pVVar12; + SpectrumExtend *pSVar13; + IIRFilter *pIVar14; + ColorfulMusic *pCVar15; + Reverberation *pRVar16; + FETCompressor *pFVar17; + ViPERBass *pVVar18; + ViPERClarity *pVVar19; + DiffSurround *pDVar20; + Cure *pCVar21; + Harmonic *pHVar22; + AnalogX *pAVar23; + float in_s0; + float fVar24; + undefined4 uVar25; + undefined4 uVar26; + undefined4 uVar27; + char acStack292 [256]; + int local_24; + + iVar7 = param_2; + if (param_2 != 0) { + iVar7 = 1; + } + local_24 = __stack_chk_guard; + if (param_1 == 0x10033) { + if (param_2 == 0) { + this->field_0xdc = 0x2000000; + this->field_0xe0 = 0x2000000; + } + else { + if (param_2 < 0) { + fVar24 = 9.403955e-38; + fVar6 = ROUND((1.0 - ABS((float)(longlong)param_2 / 100.0)) * 3.355443e+07 + 0.5); + } + else { + fVar6 = 9.403955e-38; + fVar24 = ROUND((1.0 - ABS((float)(longlong)param_2 / 100.0)) * 3.355443e+07 + 0.5); + } + this->field_0xdc = fVar24; + this->field_0xe0 = fVar6; + } + goto LAB_00071250; + } + bVar1 = SUB41(iVar7,0); + if (param_1 < 0x10034) { + if (param_1 == 0x10016) { + if (this->diffSurround != nullptr) { + DiffSurround::SetDelayTime(this->diffSurround,in_s0); + } + goto LAB_00071250; + } + if (0x10016 < param_1) { + if (param_1 == 0x10024) { + if (this->dynamicSystem != nullptr) { + DynamicBass::~ZN13DynamicSystem11SetSideGainEff + ((DynamicBass *)this->dynamicSystem,(int)((float)(longlong)param_2 / 100.0), + (int)((float)(longlong)param_3 / 100.0)); + } + goto LAB_00071250; + } + if (0x10024 < param_1) { + if (param_1 == 0x1002b) { + if (this->vclarity != nullptr) { + ViPERClarity::SetProcessMode(this->vclarity,param_2); + } + goto LAB_00071250; + } + if (param_1 < 0x1002c) { + if (param_1 == 0x10027) { + if (this->vbass != nullptr) { + ViPERBass::SetProcessMode(this->vbass,param_2); + } + } + else { + if (param_1 < 0x10028) { + if (param_1 == 0x10025) { + if (this->dynamicSystem != nullptr) { + DynamicBass::~ZN13DynamicSystem11SetBassGainEf + ((DynamicBass *)this->dynamicSystem, + (int)((float)(longlong)param_2 / 100.0)); + } + } + else { + if ((param_1 == 0x10026) && (this->vbass != nullptr)) { + ViPERBass::SetEnable(this->vbass,bVar1); + } + } + } + else { + if (param_1 == 0x10029) { + if (this->vbass != nullptr) { + ViPERBass::SetBassFactor(in_s0); + } + } + else { + if (param_1 < 0x1002a) { + if (this->vbass != nullptr) { + ViPERBass::SetSpeaker((int)this->vbass); + } + } + else { + if (this->vclarity != nullptr) { + ViPERClarity::SetEnable(this->vclarity,bVar1); + } + } + } + } + } + goto LAB_00071250; + } + if (param_1 == 0x1002f) { + pTVar3 = this->tubeSim; + if (pTVar3 != nullptr) { + if ((pTVar3->field_0x8 == false) && (iVar7 != 0)) { + TubeSimulator::Reset(pTVar3); + } + pTVar3->field_0x8 = bVar1; + } + goto LAB_00071250; + } + if (param_1 < 0x10030) { + if (param_1 == 0x1002d) { + if (this->cure != nullptr) { + Cure::SetEnable(this->cure,bVar1); + } + } + else { + if (param_1 < 0x1002e) { + if (this->vclarity != nullptr) { + ViPERClarity::SetClarity(this->vclarity,in_s0); + } + } + else { + pCVar21 = this->cure; + if (pCVar21 != nullptr) { + if (param_2 == 1) { + Crossfeed::~ZN4Cure9SetPresetEj((Crossfeed *)pCVar21,0x3c02bc); + } + else { + if (param_2 == 2) { + Crossfeed::~ZN4Cure9SetPresetEj((Crossfeed *)pCVar21,0x2d02bc); + } + else { + if (param_2 == 0) { + Crossfeed::~ZN4Cure9SetPresetEj((Crossfeed *)pCVar21,0x5f028a); + } + } + } + } + } + } + goto LAB_00071250; + } + if (param_1 == 0x10031) { + pAVar23 = this->analogx; + if (pAVar23 != nullptr) { + if (param_2 == 1) { + AnalogX::SetProcessingModel(pAVar23,1); + } + else { + if (param_2 == 2) { + AnalogX::SetProcessingModel(pAVar23,2); + } + else { + if (param_2 == 0) { + AnalogX::SetProcessingModel(pAVar23,0); + } + } + } + } + goto LAB_00071250; + } + if (param_1 < 0x10032) { + pAVar23 = this->analogx; + if (pAVar23 != nullptr) { + if ((pAVar23->enabled == false) && (iVar7 != 0)) { + AnalogX::Reset(pAVar23); + } + pAVar23->enabled = bVar1; + } + goto LAB_00071250; + } + LAB_00071ac4: + if (param_2 == 100) { + this->field_0xd8 = 0x2000000; + } + else { + this->field_0xd8 = ROUND(((float)(longlong)param_2 / 100.0) * 3.355443e+07 + 0.5); + } + goto LAB_00071250; + } + if (param_1 == 0x1001d) { + LAB_00071f48: + if (this->playbackGain != nullptr) { + PlaybackGain::SetEnable(this->playbackGain,bVar1); + } + goto LAB_00071250; + } + if (0x1001d < param_1) { + if (param_1 == 0x10020) { + LAB_00071644: + if (this->playbackGain != nullptr) { + PlaybackGain::SetMaxGainFactor(this->playbackGain,in_s0); + } + goto LAB_00071250; + } + if (0x10020 < param_1) { + if (param_1 == 0x10022) { + if (this->dynamicSystem != nullptr) { + DynamicBass::~ZN13DynamicSystem10SetXCoeffsEjj + ((DynamicBass *)this->dynamicSystem,param_2,param_3); + } + } + else { + if (param_1 < 0x10023) { + if (this->dynamicSystem != nullptr) { + DynamicSystem::SetEnable(this->dynamicSystem,bVar1); + } + } + else { + if (this->dynamicSystem != nullptr) { + DynamicBass::~ZN13DynamicSystem10SetYCoeffsEjj + ((DynamicBass *)this->dynamicSystem,param_2,param_3); + } + } + } + goto LAB_00071250; + } + if (param_1 == 0x1001e) { + LAB_00071b1c: + if (this->playbackGain != nullptr) { + PlaybackGain::SetRatio(this->playbackGain,in_s0); + } + goto LAB_00071250; + } + if (param_1 != 0x1001f) goto LAB_00071250; + LAB_00071564: + if (this->playbackGain != nullptr) { + PlaybackGain::SetVolume(this->playbackGain,in_s0); + } + goto LAB_00071250; + } + if (param_1 == 0x10019) { + LAB_00071918: + if (this->reverb != nullptr) { + Reverberation::SetWidth(this->reverb,(int)((float)(longlong)param_2 / 100.0)); + } + goto LAB_00071250; + } + if (param_1 < 0x1001a) { + if (param_1 != 0x10017) { + if (param_1 != 0x10018) goto LAB_00071250; + goto LAB_00071840; + } + goto LAB_00071900; + } + if (param_1 != 0x1001b) { + if (param_1 < 0x1001c) goto LAB_000707e4; + goto LAB_00071608; + } + goto LAB_00071b78; + } + if (param_1 == 0x10008) { + if (this->vhe != nullptr) { + VHE::SetEnable(this->vhe,bVar1); + } + goto LAB_00071250; + } + if (0x10008 < param_1) { + if (param_1 == 0x1000f) { + LAB_00071d64: + if (this->iirFilter != nullptr) { + IIRFilter::SetEnable(this->iirFilter,bVar1); + } + goto LAB_00071250; + } + if (param_1 < 0x10010) { + if (param_1 == 0x1000b) { + if (((this->vddc != nullptr) && (param_6 - 1U < 0x7f)) && (param_7 != nullptr)) { + ViPERDDC::SetCoeffs(this->vddc,param_6,(float *)param_7,(float *)(param_7 + param_6 * 4) + ); + } + } + else { + if (param_1 < 0x1000c) { + if (param_1 == 0x10009) { + if (this->vhe != nullptr) { + VHE::SetEffectLevel(this->vhe,param_2); + } + } + else { + if ((param_1 == 0x1000a) && (this->vddc != nullptr)) { + ViPERDDC::SetEnable(this->vddc,bVar1); + } + } + } + else { + if (param_1 == 0x1000d) { + if (this->spectrumExtend != nullptr) { + SpectrumExtend::SetReferenceFrequency(this->spectrumExtend,param_2); + } + } + else { + if (param_1 < 0x1000e) { + if (this->spectrumExtend != nullptr) { + SpectrumExtend::SetEnable(this->spectrumExtend,bVar1); + } + } + else { + if (this->spectrumExtend != nullptr) { + SpectrumExtend::SetExciter(this->spectrumExtend,in_s0); + } + } + } + } + } + goto LAB_00071250; + } + if (param_1 == 0x10012) { + if (this->colorful != nullptr) { + Stereo3DSurround::~ZN13ColorfulMusic13SetWidenValueEf + ((Stereo3DSurround *)this->colorful,in_s0); + } + goto LAB_00071250; + } + if (0x10012 < param_1) { + if (param_1 == 0x10014) { + if (this->colorful != nullptr) { + ColorfulMusic::SetDepthValue(this->colorful,(short)param_2); + } + } + else { + if (param_1 < 0x10015) { + if (this->colorful != nullptr) { + Stereo3DSurround::~ZN13ColorfulMusic16SetMidImageValueEf + ((Stereo3DSurround *)this->colorful,in_s0); + } + } + else { + if (this->diffSurround != nullptr) { + DiffSurround::SetEnable(this->diffSurround,bVar1); + } + } + } + goto LAB_00071250; + } + if (param_1 != 0x10010) { + if ((param_1 == 0x10011) && (this->colorful != nullptr)) { + ColorfulMusic::SetEnable(this->colorful,bVar1); + } + goto LAB_00071250; + } + LAB_000716d4: + if (this->iirFilter != nullptr) { + IIRFilter::SetBandLevel((int)this->iirFilter,in_s0); + } + goto LAB_00071250; + } + if (param_1 == 0x10001) { + if (((uint)param_2 < 3) && (this->field_0x7c != param_2)) { + this->field_0x7c = param_2; + ResetAllEffects(this); + } + goto LAB_00071250; + } + if (0x10001 < param_1) { + if (param_1 == 0x10004) { + LAB_00071de0: + if (this->convolver != nullptr) { + Convolver::PrepareKernelBuffer(this->convolver,param_2,param_3,param_4); + } + goto LAB_00071250; + } + if (param_1 < 0x10005) { + if (param_1 == 0x10002) goto LAB_000717e4; + if (param_1 != 0x10003) goto LAB_00071250; + goto LAB_00071720; + } + if (param_1 == 0x10006) { + LAB_00071384: + if (this->convolver != nullptr) { + Convolver::CommitKernelBuffer(this->convolver,param_2,param_3,param_4); + } + goto LAB_00071250; + } + if (param_1 < 0x10007) goto LAB_00071e00; + goto LAB_000715b8; + } + if (param_1 == 0x9003) { + __android_log_print(4,"ViPER4Android_v2","Reset required"); + ResetAllEffects(this); + goto LAB_00071250; + } + if (param_1 < 0x9004) { + if (param_1 == 0x9001) { + __android_log_print(4,"ViPER4Android_v2","Driver general communication"); + __android_log_print(4,"ViPER4Android_v2","Driver and server are alive"); + } + else { + if (param_1 == 0x9002) { + *(bool *)&this->field_0x6c = bVar1; + } + } + goto LAB_00071250; + } + if (param_1 == 0x9005) { + *(bool *)&this->field_0x7a = bVar1; + goto LAB_00071250; + } + if (param_1 < 0x9005) { + if ((*(char *)&this->field_0x79 == '\0') && (iVar7 != 0)) { + ResetAllEffects(this); + } + *(bool *)&this->field_0x79 = bVar1; + goto LAB_00071250; + } + if (param_1 != 0x9006) goto LAB_00071250; + __android_log_print(4,"ViPER4Android_v2","Begin self diagnose procedure ..."); + uVar25 = 5; + uVar26 = 0; + uVar27 = 4; + __android_log_print(4,"ViPER4Android_v2","[DN] Driver version %d.%d.%d.%d",2,5,0,4); + __android_log_print(4,"ViPER4Android_v2","[DN] Driver is fixed pointing mode"); + uVar5 = this->samplerate; + if (0xf3c < uVar5 - 0xac44) { + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Current sampling rate is %d ... Bad, unsupported sampling rate", + uVar5,uVar25,uVar26,uVar27); + __android_log_print(4,"ViPER4Android_v2","Self diagnose procedure finished"); + goto LAB_00071250; + } + __android_log_print(4,"ViPER4Android_v2","[DN] Current sampling rate is %d ... OK",uVar5,uVar25, + uVar26,uVar27); + if (*(char *)&this->field_0x5 == '\0') { + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Problem found, system has required an unsupported audio format",0, + uVar25,uVar26,uVar27); + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Please check system log for further information"); + __android_log_print(4,"ViPER4Android_v2","Self diagnose procedure finished"); + goto LAB_00071250; + } + if (*(char *)&this->field_0x4 == '\0') { + __android_log_print(4,"ViPER4Android_v2","[DN] Audio effect engine enabled = false",0,uVar25, + uVar26,uVar27); + } + else { + __android_log_print(4,"ViPER4Android_v2","[DN] Audio effect engine enabled = true", + *(char *)&this->field_0x4,uVar25,uVar26,uVar27); + } + if (*(char *)&this->field_0x7a == '\0') { + __android_log_print(4,"ViPER4Android_v2","[DN] Audio effect engine force enabled = false"); + } + else { + __android_log_print(4,"ViPER4Android_v2","[DN] Audio effect engine force enabled = true"); + } + if (*(char *)&this->field_0x79 == '\0') { + __android_log_print(4,"ViPER4Android_v2","[DN] Internal switch enabled = false"); + } + else { + __android_log_print(4,"ViPER4Android_v2","[DN] Internal switch enabled = true"); + } + if (1 < this->field_0x7c - 1) { + __android_log_print(4,"ViPER4Android_v2","[DN] *Wrong effect type found = %d"); + __android_log_print(4,"ViPER4Android_v2","[DN] *Fixing effect type ... OK"); + __android_log_print(4,"ViPER4Android_v2","[DN] *Resetting instance ... OK"); + this->field_0x7c = 1; + ResetAllEffects(this); + } + __android_log_print(4,"ViPER4Android_v2","[DN] Memory and sub effects checking ..."); + if (this == (ProcessUnit_FX *)this->field_0x68) { + __android_log_print(4,"ViPER4Android_v2","[DN] Instance pointer is %x ... OK",this); + } + else { + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Wrong instance pointer found, this may caused by a bug of system"); + __android_log_print(4,"ViPER4Android_v2","[DN] *Fixing instance pointer ... OK"); + __android_log_print(4,"ViPER4Android_v2","[DN] *Resetting instance ... OK"); + this->field_0x68 = (undefined *)this; + ResetAllEffects(this); + } + if (*(char *)&this->field_0x78 == '\0') { + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Memory pool corrupted, this may caused by lacking of memory"); + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Rebuilding memory pool and re-initialize all sub effects"); + pAVar8 = this->floatIntBuffer; + if (pAVar8 != nullptr) { + AdaptiveBuffer_FPI32::~AdaptiveBuffer_FPI32(pAVar8); + operator_delete(pAVar8); + } + pWVar9 = this->waveBuffer; + this->floatIntBuffer = nullptr; + if (pWVar9 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(pWVar9); + operator_delete(pWVar9); + } + pCVar10 = this->convolver; + this->waveBuffer = nullptr; + if (pCVar10 != nullptr) { + Convolver::~Convolver(pCVar10); + operator_delete(pCVar10); + } + pVVar11 = this->vhe; + this->convolver = nullptr; + if (pVVar11 != nullptr) { + VHE::~VHE(pVVar11); + operator_delete(pVVar11); + } + pVVar12 = this->vddc; + this->vhe = nullptr; + if (pVVar12 != nullptr) { + ViPERDDC::~ViPERDDC(pVVar12); + operator_delete(pVVar12); + } + pSVar13 = this->spectrumExtend; + this->vddc = nullptr; + if (pSVar13 != nullptr) { + SpectrumExtend::~SpectrumExtend(pSVar13); + operator_delete(pSVar13); + } + pIVar14 = this->iirFilter; + this->spectrumExtend = nullptr; + if (pIVar14 != nullptr) { + IIRFilter::~IIRFilter(pIVar14); + operator_delete(pIVar14); + } + pCVar15 = this->colorful; + this->iirFilter = nullptr; + if (pCVar15 != nullptr) { + TimeConstDelay::~TimeConstDelay((TimeConstDelay *)&pCVar15->field_0x34); + TimeConstDelay::~TimeConstDelay((TimeConstDelay *)&pCVar15->field_0x28); + operator_delete(pCVar15); + } + pRVar16 = this->reverb; + this->colorful = nullptr; + if (pRVar16 != nullptr) { + CRevModel::~CRevModel(&pRVar16->field_0x14); + operator_delete(pRVar16); + } + this->reverb = nullptr; + if (this->playbackGain != nullptr) { + operator_delete(this->playbackGain); + } + pFVar17 = this->fetCompressor; + this->playbackGain = nullptr; + if (pFVar17 != nullptr) { + FETCompressor::~FETCompressor(pFVar17); + operator_delete(pFVar17); + } + this->fetCompressor = nullptr; + if (this->dynamicSystem != nullptr) { + operator_delete(this->dynamicSystem); + } + pVVar18 = this->vbass; + this->dynamicSystem = nullptr; + if (pVVar18 != nullptr) { + ViPERBass::~ViPERBass(pVVar18); + operator_delete(pVVar18); + } + pVVar19 = this->vclarity; + this->vbass = nullptr; + if (pVVar19 != nullptr) { + ViPERClarity::~ViPERClarity(pVVar19); + operator_delete(pVVar19); + } + pDVar20 = this->diffSurround; + this->vclarity = nullptr; + if (pDVar20 != nullptr) { + DiffSurround::~DiffSurround(pDVar20); + operator_delete(pDVar20); + } + pCVar21 = this->cure; + this->diffSurround = nullptr; + if (pCVar21 != nullptr) { + Cure::~Cure(pCVar21); + operator_delete(pCVar21); + } + this->cure = nullptr; + if (this->tubeSim != nullptr) { + operator_delete(this->tubeSim); + } + pAVar23 = this->analogx; + this->tubeSim = nullptr; + if (pAVar23 != nullptr) { + pHVar22 = (Harmonic *)&pAVar23->field_0xc0; + do { + pHVar22 = pHVar22 + -1; + Harmonic::~Harmonic(pHVar22); + } while (&pAVar23->field_0x48 != pHVar22); + operator_delete(pAVar23); + } + this->analogx = nullptr; + if (this->speakerCorrection != nullptr) { + operator_delete(this->speakerCorrection); + } + this->speakerCorrection = nullptr; + if (this->softLimit1 != nullptr) { + operator_delete(this->softLimit1); + } + this->softLimit1 = nullptr; + if (this->softLimit2 != nullptr) { + operator_delete(this->softLimit2); + } + this->softLimit2 = nullptr; + pAVar8 = (AdaptiveBuffer_FPI32 *)operator_new(0x20); + AdaptiveBuffer_FPI32::AdaptiveBuffer_FPI32(pAVar8,2,0x1000); + this->floatIntBuffer = pAVar8; + pWVar9 = (WaveBuffer_R32 *)operator_new(0x20); + WaveBuffer_R32::WaveBuffer_R32(pWVar9,2,0x1000); + this->waveBuffer = pWVar9; + pCVar10 = (Convolver *)operator_new(0x174); + Convolver::Convolver(pCVar10); + this->convolver = pCVar10; + pVVar11 = (VHE *)operator_new(0x38); + VHE::VHE(pVVar11); + this->vhe = pVVar11; + pVVar12 = (ViPERDDC *)operator_new(0x34); + ViPERDDC::ViPERDDC(pVVar12); + this->vddc = pVVar12; + pSVar13 = (SpectrumExtend *)operator_new(0x118); + SpectrumExtend::SpectrumExtend(pSVar13); + this->spectrumExtend = pSVar13; + pIVar14 = (IIRFilter *)operator_new(0x860); + IIRFilter::IIRFilter(pIVar14,10); + this->iirFilter = pIVar14; + pCVar15 = (ColorfulMusic *)operator_new(0x6c); + ColorfulMusic::ColorfulMusic(pCVar15); + this->colorful = pCVar15; + pRVar16 = (Reverberation *)operator_new(0x2ec); + Reverberation::Reverberation(pRVar16); + this->reverb = pRVar16; + this_00 = (PlaybackGain *)operator_new(0x78); + PlaybackGain::PlaybackGain(this_00); + this->playbackGain = this_00; + pFVar17 = (FETCompressor *)operator_new(0xb0); + FETCompressor::FETCompressor(pFVar17); + this->fetCompressor = pFVar17; + this_01 = (DynamicSystem *)operator_new(0x138); + DynamicSystem::DynamicSystem(this_01); + this->dynamicSystem = this_01; + pVVar18 = (ViPERBass *)operator_new(0x2c); + ViPERBass::ViPERBass(pVVar18); + this->vbass = pVVar18; + pVVar19 = (ViPERClarity *)operator_new(0xe0); + ViPERClarity::ViPERClarity(pVVar19); + this->vclarity = pVVar19; + pDVar20 = (DiffSurround *)operator_new(0x14); + DiffSurround::DiffSurround(pDVar20); + this->diffSurround = pDVar20; + pCVar21 = (Cure *)operator_new(0x50); + Cure::Cure(pCVar21); + this->cure = pCVar21; + pTVar3 = (TubeSimulator *)operator_new(0xc); + TubeSimulator::TubeSimulator(pTVar3); + this->tubeSim = pTVar3; + pAVar23 = (AnalogX *)operator_new(0x164); + AnalogX::AnalogX(pAVar23); + this->analogx = pAVar23; + this_02 = (SpeakerCorrection *)operator_new(0xe0); + SpeakerCorrection::SpeakerCorrection(this_02); + this->speakerCorrection = this_02; + pSVar4 = (SoftwareLimiter *)operator_new(0xc28); + SoftwareLimiter::SoftwareLimiter(pSVar4); + this->softLimit1 = pSVar4; + pSVar4 = (SoftwareLimiter *)operator_new(0xc28); + SoftwareLimiter::SoftwareLimiter(pSVar4); + pAVar8 = this->floatIntBuffer; + this->softLimit2 = pSVar4; + if (pAVar8 != nullptr) { + if (((((((this->waveBuffer != nullptr) && (this->softLimit1 != nullptr)) && (pSVar4 != nullptr)) && + ((this->convolver != nullptr && (this->vhe != nullptr)))) && + (((this->vddc != nullptr && ((this->spectrumExtend != nullptr && (this->iirFilter != nullptr)))) + && (this->colorful != nullptr)))) && + ((((this->reverb != nullptr && (this->playbackGain != nullptr)) && + (this->fetCompressor != nullptr)) && + (((this->vbass != nullptr && (this->vclarity != nullptr)) && + ((this->diffSurround != nullptr && + ((this->dynamicSystem != nullptr && (this->cure != nullptr)))))))))) && + ((this->tubeSim != nullptr && ((this->analogx != nullptr && (this->speakerCorrection != nullptr))) + ))) { + *(undefined *)&this->field_0x78 = 1; + ResetAllEffects(this); + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Memory pool is OK and all sub effects re-initialized"); + goto LAB_000710f8; + } + AdaptiveBuffer_FPI32::~AdaptiveBuffer_FPI32(pAVar8); + operator_delete(pAVar8); + } + pWVar9 = this->waveBuffer; + this->floatIntBuffer = nullptr; + if (pWVar9 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(pWVar9); + operator_delete(pWVar9); + } + pCVar10 = this->convolver; + this->waveBuffer = nullptr; + if (pCVar10 != nullptr) { + Convolver::~Convolver(pCVar10); + operator_delete(pCVar10); + } + pVVar11 = this->vhe; + this->convolver = nullptr; + if (pVVar11 != nullptr) { + VHE::~VHE(pVVar11); + operator_delete(pVVar11); + } + pVVar12 = this->vddc; + this->vhe = nullptr; + if (pVVar12 != nullptr) { + ViPERDDC::~ViPERDDC(pVVar12); + operator_delete(pVVar12); + } + pSVar13 = this->spectrumExtend; + this->vddc = nullptr; + if (pSVar13 != nullptr) { + SpectrumExtend::~SpectrumExtend(pSVar13); + operator_delete(pSVar13); + } + pIVar14 = this->iirFilter; + this->spectrumExtend = nullptr; + if (pIVar14 != nullptr) { + IIRFilter::~IIRFilter(pIVar14); + operator_delete(pIVar14); + } + pCVar15 = this->colorful; + this->iirFilter = nullptr; + if (pCVar15 != nullptr) { + TimeConstDelay::~TimeConstDelay((TimeConstDelay *)&pCVar15->field_0x34); + TimeConstDelay::~TimeConstDelay((TimeConstDelay *)&pCVar15->field_0x28); + operator_delete(pCVar15); + } + pRVar16 = this->reverb; + this->colorful = nullptr; + if (pRVar16 != nullptr) { + CRevModel::~CRevModel(&pRVar16->field_0x14); + operator_delete(pRVar16); + } + this->reverb = nullptr; + if (this->playbackGain != nullptr) { + operator_delete(this->playbackGain); + } + pFVar17 = this->fetCompressor; + this->playbackGain = nullptr; + if (pFVar17 != nullptr) { + FETCompressor::~FETCompressor(pFVar17); + operator_delete(pFVar17); + } + this->fetCompressor = nullptr; + if (this->dynamicSystem != nullptr) { + operator_delete(this->dynamicSystem); + } + pVVar18 = this->vbass; + this->dynamicSystem = nullptr; + if (pVVar18 != nullptr) { + ViPERBass::~ViPERBass(pVVar18); + operator_delete(pVVar18); + } + pVVar19 = this->vclarity; + this->vbass = nullptr; + if (pVVar19 != nullptr) { + ViPERClarity::~ViPERClarity(pVVar19); + operator_delete(pVVar19); + } + pDVar20 = this->diffSurround; + this->vclarity = nullptr; + if (pDVar20 != nullptr) { + DiffSurround::~DiffSurround(pDVar20); + operator_delete(pDVar20); + } + pCVar21 = this->cure; + this->diffSurround = nullptr; + if (pCVar21 != nullptr) { + Cure::~Cure(pCVar21); + operator_delete(pCVar21); + } + this->cure = nullptr; + if (this->tubeSim != nullptr) { + operator_delete(this->tubeSim); + } + pAVar23 = this->analogx; + this->tubeSim = nullptr; + if (pAVar23 != nullptr) { + pHVar22 = (Harmonic *)&pAVar23->field_0xc0; + do { + pHVar22 = pHVar22 + -1; + Harmonic::~Harmonic(pHVar22); + } while (&pAVar23->field_0x48 != pHVar22); + operator_delete(pAVar23); + } + this->analogx = nullptr; + if (this->speakerCorrection != nullptr) { + operator_delete(this->speakerCorrection); + } + this->speakerCorrection = nullptr; + if (this->softLimit1 != nullptr) { + operator_delete(this->softLimit1); + } + this->softLimit1 = nullptr; + if (this->softLimit2 != nullptr) { + operator_delete(this->softLimit2); + } + this->softLimit2 = nullptr; + *(undefined *)&this->field_0x78 = 0; + __android_log_print(4,"ViPER4Android_v2", + "[DN] *Can not rebuild memory pool, audio system was broken"); + __android_log_print(4,"ViPER4Android_v2","Self diagnose procedure finished"); + } + else { + __android_log_print(4,"ViPER4Android_v2","[DN] Memory pool and all sub effects are OK"); + LAB_000710f8: + __android_log_print(4,"ViPER4Android_v2","[DN] Resetting instance ..."); + ResetAllEffects(this); + __android_log_print(4,"ViPER4Android_v2","Self diagnose procedure finished"); + } + goto LAB_00071250; + } + if (param_1 == 0x1004f) { + LAB_00071e2c: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 < 0x10050) { + if (param_1 != 0x10041) { + if (param_1 < 0x10042) { + if (param_1 == 0x1003a) { + LAB_000715b8: + if (this->convolver != nullptr) { + Convolver::SetCrossChannel(this->convolver,in_s0); + } + goto LAB_00071250; + } + if (0x1003a < param_1) { + if (param_1 == 0x1003d) { + LAB_00071900: + if (this->reverb != nullptr) { + Reverberation::SetEnable(this->reverb,bVar1); + } + goto LAB_00071250; + } + if (0x1003d < param_1) { + if (param_1 != 0x1003f) { + if (0x1003f < param_1) { + LAB_000707e4: + if (this->reverb != nullptr) { + Reverberation::SetDamp(this->reverb,(int)((float)(longlong)param_2 / 100.0)); + } + goto LAB_00071250; + } + LAB_00071840: + if (this->reverb != nullptr) { + Reverberation::SetRoomSize(this->reverb,(int)((float)(longlong)param_2 / 100.0)); + } + goto LAB_00071250; + } + goto LAB_00071918; + } + if (param_1 == 0x1003b) goto LAB_00071d64; + if (param_1 != 0x1003c) goto LAB_00071250; + goto LAB_000716d4; + } + if (param_1 == 0x10036) { + LAB_00071720: + if (0 < param_6) { + memset(acStack292,0,0x100); + memcpy(acStack292,param_7,param_6); + if (this->convolver != nullptr) { + Convolver::SetKernel(this->convolver,acStack292); + } + } + goto LAB_00071250; + } + if (0x10036 < param_1) { + if (param_1 == 0x10038) { + LAB_00071e00: + psVar2 = param_7; + if (param_7 != nullptr) { + psVar2 = (signed *)param_6; + } + if (((param_7 != nullptr && param_6 != 0) && -1 < (int)psVar2) && (this->convolver != nullptr) + ) { + Convolver::SetKernelBuffer(this->convolver,param_2,(float *)param_7,param_6); + } + goto LAB_00071250; + } + if (0x10038 < param_1) goto LAB_00071384; + goto LAB_00071de0; + } + if ((Elf32_Phdr *)param_1 != Elf32_Phdr_ARRAY_00010034) { + if (param_1 != 0x10035) goto LAB_00071250; + LAB_000717e4: + if (this->convolver != nullptr) { + Convolver::SetEnable(this->convolver,bVar1); + } + goto LAB_00071250; + } + } + else { + if (param_1 == 0x10048) goto LAB_00071ac4; + if (param_1 < 0x10049) { + if (param_1 != 0x10044) { + if (param_1 < 0x10045) { + if (param_1 != 0x10042) { + if ((param_1 == 0x10043) && (this->speakerCorrection != nullptr)) { + SpeakerCorrection::SetEnable(this->speakerCorrection,bVar1); + } + goto LAB_00071250; + } + LAB_00071608: + if (this->reverb != nullptr) { + Reverberation::SetDry(this->reverb,(int)((float)(longlong)param_2 / 100.0)); + } + goto LAB_00071250; + } + if (param_1 != 0x10046) { + if (param_1 < 0x10047) goto LAB_00071b1c; + goto LAB_00071644; + } + goto LAB_00071564; + } + goto LAB_00071f48; + } + if (param_1 == 0x1004b) { + LAB_0007085c: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (0x1004b < param_1) { + if (param_1 == 0x1004d) goto LAB_000719f8; + if (0x1004d < param_1) goto LAB_000713cc; + goto LAB_00071f78; + } + if (param_1 != 0x10049) { + if (param_1 != 0x1004a) goto LAB_00071250; + goto LAB_00071788; + } + } + if (this->softLimit1 != nullptr) { + in_s0 = (float)SoftwareLimiter::SetGate(this->softLimit1,in_s0); + } + if (this->softLimit2 != nullptr) { + SoftwareLimiter::SetGate(this->softLimit2,in_s0); + } + goto LAB_00071250; + } + LAB_00071b78: + if (this->reverb != nullptr) { + Reverberation::SetWet(this->reverb,(int)((float)(longlong)param_2 / 100.0)); + } + goto LAB_00071250; + } + if (param_1 == 0x1005d) { + LAB_00071f78: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 < 0x1005e) { + if (param_1 == 0x10056) { + LAB_000711c8: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (0x10056 < param_1) { + if (param_1 == 0x10059) { + LAB_00071940: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (0x10059 < param_1) { + if (param_1 == 0x1005b) { + LAB_00071788: + pFVar17 = this->fetCompressor; + if (pFVar17 != nullptr) { + if (iVar7 == 0) { + FETCompressor::SetParameter((int)pFVar17,in_s0); + this->field_0x88 = 0; + } + else { + if (this->field_0x88 == 0) { + FETCompressor::SetParameter((int)pFVar17,in_s0); + FETCompressor::Reset(this->fetCompressor); + this->field_0x88 = 1; + } + else { + FETCompressor::SetParameter((int)pFVar17,in_s0); + this->field_0x88 = 1; + } + } + } + goto LAB_00071250; + } + if (0x1005b < param_1) goto LAB_0007085c; + LAB_00071690: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 != 0x10057) { + if (param_1 != 0x10058) goto LAB_00071250; + LAB_000718d4: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + LAB_00071c98: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 == 0x10052) goto LAB_00071418; + if (param_1 < 0x10053) { + if (param_1 == 0x10050) { + LAB_00071aa0: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 != 0x10051) goto LAB_00071250; + LAB_00071888: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 == 0x10054) { + LAB_00071c74: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (0x10054 < param_1) goto LAB_00071330; + } + else { + if (param_1 != 0x10064) { + if (param_1 < 0x10065) { + if (param_1 == 0x10060) goto LAB_00071e2c; + if (param_1 < 0x10061) { + if (param_1 != 0x1005e) { + if (param_1 != 0x1005f) goto LAB_00071250; + LAB_000713cc: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + LAB_000719f8: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 == 0x10062) goto LAB_00071888; + if (param_1 < 0x10063) goto LAB_00071aa0; + LAB_00071418: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 == 0x10068) goto LAB_00071c98; + if (0x10068 < param_1) { + if (param_1 != 0x1006a) { + if (param_1 < 0x1006a) goto LAB_000718d4; + if (param_1 != 0x1006b) goto LAB_00071250; + goto LAB_00071690; + } + goto LAB_00071940; + } + if (param_1 == 0x10066) { + LAB_00071330: + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + goto LAB_00071250; + } + if (param_1 < 0x10067) goto LAB_00071c74; + goto LAB_000711c8; + } + } + if (this->fetCompressor != nullptr) { + FETCompressor::SetParameter((int)this->fetCompressor,in_s0); + } + LAB_00071250: + if (local_24 != __stack_chk_guard) { + // WARNING: Subroutine does not return + __stack_chk_fail(); + } + return; +} + + + +// ProcessUnit_FX::processBuffer(short*, int) + +int ProcessUnit_FX::processBuffer(short *param_1,int param_2) { + char cVar1; + AdaptiveBuffer_FPI32 *this_00; + int *piVar2; + float *pfVar3; + uint uVar4; + int iVar5; + int *piVar6; + WaveBuffer_R32 *this_01; + uint uVar7; + int iVar8; + timeval local_30; + + cVar1 = *(char *)&this->field_0x4; + if (*(char *)&this->field_0x7a == '\0') { + joined_r0x000725b0: + if (cVar1 == '\0') { + return -0x3d; + } + } + else { + if (cVar1 == '\0') { + cVar1 = *(char *)&this->field_0x79; + goto joined_r0x000725b0; + } + } + iVar5 = this->field_0x7c; + if (iVar5 == 0) { + return 0; + } + if (param_2 < 1) { + return 0; + } + if (*(char *)&this->field_0x78 == '\0') { + return 0; + } + if (*(char *)&this->field_0x6c != '\0') { + local_30.tv_sec = 0; + local_30.tv_usec = 0; + gettimeofday(&local_30,nullptr); + iVar5 = this->field_0x7c; + iVar8 = local_30.tv_sec * 1000 + local_30.tv_usec / 1000; + *(int *)&this->field_0x70 = iVar8; + *(int *)((int)&this->field_0x70 + 4) = iVar8 >> 0x1f; + } + if (iVar5 == 2) { + iVar5 = Convolver::GetEnabled(this->convolver); + if (iVar5 == 0) { + iVar5 = this->field_0x7c; + goto LAB_000724c0; + } + LAB_00072618: + iVar8 = this->field_0x7c + -2; + if (iVar8 != 0) { + iVar8 = 1; + } + LAB_00072624: + iVar5 = WaveBuffer_R32::PushSamples(this->waveBuffer,param_1,param_2); + if (iVar5 == 0) { + WaveBuffer_R32::Reset(this->waveBuffer); + return 0; + } + pfVar3 = (float *)WaveBuffer_R32::GetCurrentBufferR32Ptr(this->waveBuffer); + uVar4 = Convolver::Process(this->convolver,pfVar3,pfVar3,param_2); + if (iVar8 != 0) { + uVar4 = VHE::Process(this->vhe,pfVar3,pfVar3,uVar4); + } + WaveBuffer_R32::SetBufferOffset(this->waveBuffer,uVar4); + iVar5 = AdaptiveBuffer_FPI32::PushZero(this->floatIntBuffer,uVar4); + if (iVar5 == 0) { + WaveBuffer_R32::Reset(this->waveBuffer); + AdaptiveBuffer_FPI32::FlushBuffer(this->floatIntBuffer); + return 0; + } + this_01 = this->waveBuffer; + piVar2 = (int *)AdaptiveBuffer_FPI32::GetBufferPointer(this->floatIntBuffer); + uVar4 = WaveBuffer_R32::PopSamples(this_01,piVar2,uVar4,true); + AdaptiveBuffer_FPI32::SetBufferOffset(this->floatIntBuffer,uVar4); + piVar2 = (int *)AdaptiveBuffer_FPI32::GetBufferPointer(this->floatIntBuffer); + if (uVar4 == 0) goto LAB_000726cc; + } + else { + LAB_000724c0: + if (iVar5 == 1) { + iVar5 = Convolver::GetEnabled(this->convolver); + if (iVar5 != 0) goto LAB_00072618; + iVar5 = VHE::GetEnabled(this->vhe); + iVar8 = this->field_0x7c + -2; + if (iVar8 != 0) { + iVar8 = 1; + } + if (iVar5 == 0) goto LAB_000724c8; + goto LAB_00072624; + } + LAB_000724c8: + iVar5 = AdaptiveBuffer_FPI32::PushFrames(this->floatIntBuffer,param_1,param_2); + this_00 = this->floatIntBuffer; + if (iVar5 == 0) goto LAB_0007270c; + AdaptiveBuffer_FPI32::SetBufferOffset(this_00,param_2); + piVar2 = (int *)AdaptiveBuffer_FPI32::GetBufferPointer(this->floatIntBuffer); + uVar4 = param_2; + } + if (this->field_0x7c == 1) { + ViPERDDC::Process(this->vddc,piVar2,param_2); + SpectrumExtend::Process(this->spectrumExtend,piVar2,param_2); + IIRFilter::Process(this->iirFilter,piVar2,uVar4); + ColorfulMusic::Process(this->colorful,piVar2,uVar4); + DiffSurround::Process(this->diffSurround,piVar2,uVar4); + Reverberation::Process(this->reverb,piVar2,uVar4); + PlaybackGain::Process(this->playbackGain,piVar2,uVar4); + if (this->field_0x88 != 0) { + FETCompressor::Process(this->fetCompressor,piVar2,uVar4); + } + DynamicSystem::Process(this->dynamicSystem,piVar2,uVar4); + ViPERBass::Process(this->vbass,piVar2,uVar4); + ViPERClarity::Process(this->vclarity,piVar2,uVar4); + Cure::Process(this->cure,piVar2,uVar4); + TubeSimulator::TubeProcess(this->tubeSim,piVar2,param_2); + AnalogX::Process(this->analogx,piVar2,uVar4); + } + else { + if (this->field_0x7c == 2) { + IIRFilter::Process(this->iirFilter,piVar2,uVar4); + Reverberation::Process(this->reverb,piVar2,uVar4); + SpeakerCorrection::Process(this->speakerCorrection,piVar2,uVar4); + PlaybackGain::Process(this->playbackGain,piVar2,uVar4); + if (this->field_0x88 != 0) { + FETCompressor::Process(this->fetCompressor,piVar2,uVar4); + } + } + } + if (this->field_0xd8 != 0x2000000) { + AdaptiveBuffer_FPI32::ScaleFrames(this->floatIntBuffer,this->field_0xd8); + } + if ((((int)this->field_0xdc < 0x2000000) || ((int)this->field_0xe0 < 0x2000000)) && + (this->field_0x7c == 1)) { + AdaptiveBuffer_FPI32::PanFrames(this->floatIntBuffer,this->field_0xdc,this->field_0xe0); + } + if (uVar4 << 1 != 0) { + uVar7 = 0; + piVar6 = piVar2 + 1; + do { + uVar7 = uVar7 + 2; + iVar5 = SoftwareLimiter::Process((int)this->softLimit1); + piVar6[-1] = iVar5; + iVar5 = SoftwareLimiter::Process((int)this->softLimit2); + piVar2[1] = iVar5; + piVar2 = piVar2 + 2; + piVar6 = piVar6 + 2; + } while (uVar7 < uVar4 << 1); + } + iVar5 = AdaptiveBuffer_FPI32::PopFrames(this->floatIntBuffer,param_1,uVar4); + if (iVar5 == 0) { + this_00 = this->floatIntBuffer; + LAB_0007270c: + AdaptiveBuffer_FPI32::FlushBuffer(this_00); + return iVar5; + } + if ((uint)param_2 <= uVar4) { + return 0; + } + LAB_000726cc: + memmove(param_1 + (param_2 - uVar4) * 2,param_1,uVar4 << 2); + memset(param_1,0,(param_2 - uVar4) * 4); + return 0; +} + + + +// ProcessUnit_FX::command(unsigned int, unsigned int, void*, unsigned int*, void*) + +int ProcessUnit_FX::command(uint param_1,uint param_2,void *param_3,uint *param_4,void *param_5) { + byte bVar1; + int EVar2; + Convolver *this_00; + undefined4 uVar3; + int iVar4; + int iVar5; + int iVar6; + uint uVar7; + timeval local_28; + + if (param_1 == 3) { + if (*(char *)&this->field_0x4 != '\0') goto switchD_00072a04_caseD_a; + LAB_00072978: + ResetAllEffects(this); + switchD_00072a04_caseD_a: + EVar2 = Effect::command((Effect *)this,param_1,param_2,param_3,param_4,param_5); + return EVar2; + } + if ((param_1 & 0xfffffffd) == 0) goto LAB_00072978; + if (param_1 == 1) { + if ((((param_3 != nullptr) && (param_2 == 0x40)) && (param_5 != nullptr)) && (*param_4 == 4)) { + uVar7 = this->samplerate; + EVar2 = Effect::configure((Effect *)this,(effect_config_t *)param_3); + if (EVar2 == OK) { + if (this->samplerate != uVar7) { + ResetAllEffects(this); + } + *(undefined4 *)param_5 = 0; + return OK; + } + *(int *)param_5 = EVar2; + return OK; + } + return EINVAL; + } + if (param_1 == 5) { + if (*(int *)((int)param_3 + 4) != 4) { + LAB_00072a40: + *(undefined4 *)param_5 = 0xffffffea; + return OK; + } + iVar5 = *(int *)((int)param_3 + 8); + iVar4 = *(int *)((int)param_3 + 0xc); + if (iVar5 == 4) { + iVar5 = *(int *)((int)param_3 + 0x10); + iVar6 = 0; + } + else { + if (iVar5 != 8) { + if (iVar5 == 0xc) { + DispatchCommand(this,iVar4,*(int *)((int)param_3 + 0x10),*(int *)((int)param_3 + 0x14), + *(int *)((int)param_3 + 0x18),0,0,nullptr); + *(undefined4 *)param_5 = 0; + return OK; + } + if (iVar5 == 0x10) { + DispatchCommand(this,iVar4,*(int *)((int)param_3 + 0x10),*(int *)((int)param_3 + 0x14), + *(int *)((int)param_3 + 0x18),*(int *)((int)param_3 + 0x1c),0,nullptr); + *(undefined4 *)param_5 = 0; + return OK; + } + if ((iVar5 == 0x100) || (iVar5 == 0x400)) { + DispatchCommand(this,iVar4,0,0,0,0,*(int *)((int)param_3 + 0x10), + (signed *)((int)param_3 + 0x14)); + *(undefined4 *)param_5 = 0; + return OK; + } + if (iVar5 == 0x2000) { + DispatchCommand(this,iVar4,*(int *)((int)param_3 + 0x10),0,0,0, + *(int *)((int)param_3 + 0x14),(signed *)((int)param_3 + 0x18)); + *(undefined4 *)param_5 = 0; + return OK; + } + goto LAB_00072a40; + } + iVar5 = *(int *)((int)param_3 + 0x10); + iVar6 = *(int *)((int)param_3 + 0x14); + } + DispatchCommand(this,iVar4,iVar5,iVar6,0,0,0,nullptr); + *(undefined4 *)param_5 = 0; + return OK; + } + if ((param_1 != 8) || (*(int *)((int)param_3 + 4) != 4)) goto switchD_00072a04_caseD_a; + switch(*(undefined4 *)((int)param_3 + 0xc)) { + case 0x8001: + *(undefined4 *)((int)param_5 + 0x10) = 0x2050004; + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 8) = 4; + *param_4 = 0x14; + break; + case 0x8002: + goto LAB_00072a50; + case 0x8003: + bVar1 = *(byte *)&this->field_0x79; + goto LAB_00072b54; + case 0x8004: + uVar7 = (uint)*(byte *)&this->field_0x5; + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 8) = 4; + if (uVar7 != 0) { + uVar7 = 1; + } + *(uint *)((int)param_5 + 0x10) = uVar7; + *param_4 = 0x14; + break; + case 0x8005: + bVar1 = *(byte *)&this->field_0x78; + LAB_00072b54: + uVar7 = (uint)bVar1; + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 8) = 4; + if (uVar7 != 0) { + LAB_00072b34: + uVar7 = 1; + } + *(uint *)((int)param_5 + 0x10) = uVar7; + LAB_00072b3c: + *param_4 = 0x14; + break; + case 0x8006: + local_28.tv_sec = 0; + local_28.tv_usec = 0; + gettimeofday(&local_28,nullptr); + iVar4 = *(int *)&this->field_0x70; + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 8) = 4; + iVar4 = (local_28.tv_sec * 1000 + local_28.tv_usec / 1000) - iVar4; + if (iVar4 < 0) { + iVar4 = -iVar4; + } + if (4999 < iVar4) { + *(undefined4 *)((int)param_5 + 0x10) = 0; + goto LAB_00072b3c; + } + goto LAB_00072b34; + case 0x8007: + uVar3 = this->field_0x7c; + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 0x10) = uVar3; + *(undefined4 *)((int)param_5 + 8) = 4; + *param_4 = 0x14; + break; + case 0x8008: + uVar7 = this->samplerate; + *(undefined4 *)((int)param_5 + 8) = 4; + *(undefined4 *)param_5 = 0; + *(uint *)((int)param_5 + 0x10) = uVar7; + *param_4 = 0x14; + break; + case 0x8009: + LAB_00072a50: + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 8) = 4; + *(undefined4 *)((int)param_5 + 0x10) = 1; + *param_4 = 0x14; + break; + case 0x800a: + this_00 = this->convolver; + *(undefined4 *)param_5 = 0; + *(undefined4 *)((int)param_5 + 8) = 4; + if (this_00 != nullptr) { + this_00 = (Convolver *)Convolver::GetKernelID(this_00); + } + *(Convolver **)((int)param_5 + 0x10) = this_00; + goto LAB_00072b3c; + default: + goto switchD_00072a04_caseD_a; + } + return OK; +} diff --git a/src/ProcessUnit_FX.h b/src/ProcessUnit_FX.h new file mode 100644 index 0000000..312d67d --- /dev/null +++ b/src/ProcessUnit_FX.h @@ -0,0 +1,137 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_PROCESSUNIT_FX_H +#define VIPER_PROCESSUNIT_FX_H + + +#include "main.h" + +class ProcessUnit_FX { +public: + undefined * * field_0x0; + Effect* field_0x4; + uint samplerate; // Created by retype action + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined4 field_0x14; + undefined4 field_0x18; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined4 field_0x34; + undefined4 field_0x38; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined4 field_0x60; + undefined4 field_0x64; + undefined * field_0x68; + undefined field_0x6c; + undefined field_0x6d; + undefined field_0x6e; + undefined field_0x6f; + undefined8 field_0x70; + undefined field_0x78; + undefined field_0x79; + undefined field_0x7a; + undefined field_0x7b; + undefined4 field_0x7c; + AdaptiveBuffer_FPI32 * floatIntBuffer; + WaveBuffer_R32 * waveBuffer; + undefined4 field_0x88; + Convolver; + VHE; + ViPERDDC * vddc; + SpectrumExtend; + IIRFilter; + ColorfulMusic colorful; + Reverberation * reverb; + PlaybackGain; + FETCompressor; + DynamicSystem; + ViPERBass * vbass; + ViPERClarity * vclarity; + DiffSurround; + Cure; + TubeSimulator * tubeSim; + AnalogX; + SpeakerCorrection; + SoftwareLimiter * softLimit1; + SoftwareLimiter * softLimit2; + undefined4 field_0xd8; + undefined4 field_0xdc; + undefined4 field_0xe0; + +public: + ProcessUnit_FX(); + ~ProcessUnit_FX(); + void ResetAllEffects(); + void DispatchCommand(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6,signed *param_7); + int processBuffer(short *param_1,int param_2); + int command(uint param_1,uint param_2,void *param_3,uint *param_4,void *param_5); +}; + + +#endif //VIPER_PROCESSUNIT_FX_H diff --git a/src/data.h b/src/data.h new file mode 100644 index 0000000..525cadb --- /dev/null +++ b/src/data.h @@ -0,0 +1,23 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_DATA_H +#define VIPER_DATA_H + +#include "util/misc.h" + +// TODO: Unsure if these should be BE/LE +const effect_descriptor_t DAT_000d126c = { + effect_uuid_t { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + effect_uuid_t { 0x87C9D341, 0xCFE6, 0xE311, 0x8AA8, 0x11, 0xAB, 0xA5, 0xD5, 0xC5, 0x1B }, + 0x20000, + 0x10f00000, + 8, + 1, + "ViPER4Android [2.5.0.4]", + "ViPER.WYF" +}; + + +#endif //VIPER_DATA_H diff --git a/src/effects/AnalogX.cpp b/src/effects/AnalogX.cpp new file mode 100644 index 0000000..c6f1896 --- /dev/null +++ b/src/effects/AnalogX.cpp @@ -0,0 +1,195 @@ +// +// Created by mart on 2/12/21. +// + +#include "AnalogX.h" + +// AnalogX::Reset() + +void AnalogX::Reset() { + int iVar1; + Harmonic *this_00; + Harmonic *this_01; + float in_s0; + float in_s1; + undefined8 uVar2; + float in_s2; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + float extraout_s2_02; + float extraout_s2_03; + float extraout_s2_04; + float extraout_s2_05; + float extraout_s2_06; + float extraout_s2_07; + float in_s3; + float extraout_s3; + float extraout_s3_00; + float extraout_s3_01; + float extraout_s3_02; + float extraout_s3_03; + float extraout_s3_04; + float extraout_s3_05; + float extraout_s3_06; + float extraout_s3_07; + + this_01 = &this->field_0x48; + this_00 = &this->field_0x84; + uVar2 = MultiBiquad::RefreshFilter((MultiBiquad *)this,1,in_s0,in_s1,in_s2,in_s3,false); + uVar2 = MultiBiquad::RefreshFilter + (&this->field_0x24,1,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20),extraout_s2, + extraout_s3,false); + uVar2 = MultiBiquad::RefreshFilter + (&this->field_0x108,5,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + extraout_s2_00,extraout_s3_00,true); + MultiBiquad::RefreshFilter + (&this->field_0x12c,5,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20),extraout_s2_01, + extraout_s3_01,true); + Harmonic::Reset(this_01); + Harmonic::Reset(this_00); + iVar1 = this->processingModel; + if (iVar1 == 1) { + Harmonic::SetHarmonics(this_01,(float *)&DAT_000ce8dc); + uVar2 = Harmonic::SetHarmonics(this_00,(float *)&DAT_000ce8dc); + *(undefined4 *)&this->field_0x150 = 0x266594b; + uVar2 = MultiBiquad::RefreshFilter + (&this->field_0xc0,0,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + extraout_s2_06,extraout_s3_06,false); + MultiBiquad::RefreshFilter + (&this->field_0xe4,0,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20),extraout_s2_07, + extraout_s3_07,false); + this->field_0x154 = 0; + return; + } + if (iVar1 != 2) { + if (iVar1 != 0) { + this->field_0x154 = 0; + return; + } + Harmonic::SetHarmonics(this_01,(float *)&DAT_000ce8b4); + uVar2 = Harmonic::SetHarmonics(this_00,(float *)&DAT_000ce8b4); + *(undefined4 *)&this->field_0x150 = 0x1332618; + uVar2 = MultiBiquad::RefreshFilter + (&this->field_0xc0,0,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + extraout_s2_02,extraout_s3_02,false); + MultiBiquad::RefreshFilter + (&this->field_0xe4,0,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20),extraout_s2_03, + extraout_s3_03,false); + this->field_0x154 = 0; + return; + } + Harmonic::SetHarmonics(this_01,(float *)&DAT_000ce904); + uVar2 = Harmonic::SetHarmonics(this_00,(float *)&DAT_000ce904); + *(undefined4 *)&this->field_0x150 = 0x4ccbfb1; + uVar2 = MultiBiquad::RefreshFilter + (&this->field_0xc0,0,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + extraout_s2_04,extraout_s3_04,false); + MultiBiquad::RefreshFilter + (&this->field_0xe4,0,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20),extraout_s2_05, + extraout_s3_05,false); + this->field_0x154 = 0; + return; +} + + + +// AnalogX::AnalogX() + +AnalogX::AnalogX() { + MultiBiquad::MultiBiquad((MultiBiquad *)this); + MultiBiquad::MultiBiquad(&this->field_0x24); + Harmonic::Harmonic(&this->field_0x48); + Harmonic::Harmonic(&this->field_0x84); + MultiBiquad::MultiBiquad(&this->field_0xc0); + MultiBiquad::MultiBiquad(&this->field_0xe4); + MultiBiquad::MultiBiquad(&this->field_0x108); + MultiBiquad::MultiBiquad(&this->field_0x12c); + this->samplerate = 0xac44; + this->processingModel = 0; + this->enabled = false; + Reset(this); + return this; +} + + + +// AnalogX::SetSamplingRate(unsigned int) + +void AnalogX::SetSamplingRate(uint param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + Reset(this); + return; +} + + + +// AnalogX::SetProcessingModel(int) + +void AnalogX::SetProcessingModel(int param_1) { + if (this->processingModel == param_1) { + return; + } + this->processingModel = param_1; + Reset(this); + return; +} + + + +// AnalogX::Process(int*, int) + +void AnalogX::Process(int *param_1,int param_2) { + ulonglong uVar1; + longlong lVar2; + int iVar3; + int *piVar4; + int iVar5; + int iVar6; + undefined8 uVar7; + int local_58; + + if (this->enabled != false) { + if (0 < param_2 * 2) { + iVar5 = 0; + piVar4 = param_1; + do { + iVar6 = *piVar4; + iVar5 = iVar5 + 2; + iVar3 = MultiBiquad::ProcessSample((MultiBiquad *)this,iVar6); + iVar3 = Harmonic::Process(&this->field_0x48,iVar3); + uVar1 = (longlong)iVar3 * (longlong)*(int *)&this->field_0x150 + 0x1000000; + uVar7 = VectorShiftRight((uVar1 & 0xffffffff00000000) + (uVar1 & 0xffffffff),0x19); + local_58 = (int)uVar7; + iVar3 = MultiBiquad::ProcessSample(&this->field_0xc0,iVar6 + local_58); + lVar2 = (longlong)iVar3 * 0x1998c7e + 0x1000000; + iVar3 = MultiBiquad::ProcessSample + (&this->field_0x108, + (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + iVar6 = piVar4[1]; + *piVar4 = iVar3; + iVar3 = MultiBiquad::ProcessSample(&this->field_0x24,iVar6); + iVar3 = Harmonic::Process(&this->field_0x84,iVar3); + uVar1 = (longlong)iVar3 * (longlong)*(int *)&this->field_0x150 + 0x1000000; + uVar7 = VectorShiftRight((uVar1 & 0xffffffff00000000) + (uVar1 & 0xffffffff),0x19); + local_58 = (int)uVar7; + iVar3 = MultiBiquad::ProcessSample(&this->field_0xe4,iVar6 + local_58); + lVar2 = (longlong)iVar3 * 0x1998c7e + 0x1000000; + iVar3 = MultiBiquad::ProcessSample + (&this->field_0x12c, + (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar4[1] = iVar3; + piVar4 = piVar4 + 2; + } while (iVar5 + param_2 * -2 < 0 != SBORROW4(iVar5,param_2 * 2)); + } + if (this->field_0x154 < (int)((uint)this->samplerate >> 2)) { + this->field_0x154 = param_2 + this->field_0x154; + memset(param_1,0,param_2 << 3); + return; + } + } + return; +} diff --git a/src/effects/AnalogX.h b/src/effects/AnalogX.h new file mode 100644 index 0000000..7a190f8 --- /dev/null +++ b/src/effects/AnalogX.h @@ -0,0 +1,39 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_ANALOGX_H +#define VIPER_ANALOGX_H + + +class AnalogX { + struct MultiBiquad field_0x0; + struct MultiBiquad field_0x24; + struct Harmonic field_0x48; + struct Harmonic field_0x84; + struct MultiBiquad field_0xc0; + struct MultiBiquad field_0xe4; + struct MultiBiquad field_0x108; + struct MultiBiquad field_0x12c; + undefined field_0x150; + undefined field_0x151; + undefined field_0x152; + undefined field_0x153; + int field_0x154; + undefined4 processingModel; + int samplerate; // Created by retype action + bool enabled; // Created by retype action + undefined field_0x161; + undefined field_0x162; + undefined field_0x163; + +public: + void Reset(); + AnalogX(); + void SetSamplingRate(uint param_1); + void SetProcessingModel(int param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_ANALOGX_H diff --git a/src/effects/ColorfulMusic.cpp b/src/effects/ColorfulMusic.cpp new file mode 100644 index 0000000..1f60580 --- /dev/null +++ b/src/effects/ColorfulMusic.cpp @@ -0,0 +1,102 @@ +// +// Created by mart on 2/12/21. +// + +#include "ColorfulMusic.h" + + +// ColorfulMusic::ColorfulMusic() + +ColorfulMusic::ColorfulMusic() { + DepthSurround *this_00; + float fVar1; + + this_00 = (DepthSurround *)&this->field_0x18; + Stereo3DSurround::Stereo3DSurround((Stereo3DSurround *)this); + fVar1 = (float)DepthSurround::DepthSurround(this_00); + *(undefined4 *)&this->field_0x64 = 0xac44; + *(undefined *)&this->field_0x68 = 0; + Stereo3DSurround::SetStereoWiden((Stereo3DSurround *)this,fVar1); + DepthSurround::SetSamplingRate((uint)this_00); + DepthSurround::SetStrength(this_00,0); + return this; +} + + + +// ColorfulMusic::SetSamplingRate(unsigned int) + +void ColorfulMusic::SetSamplingRate(uint param_1) { + if (*(uint *)&this->field_0x64 == param_1) { + return; + } + *(uint *)&this->field_0x64 = param_1; + DepthSurround::SetSamplingRate(&this->field_0x18); + return; +} + + + +float ColorfulMusic::setStereoWidenValue(float param_1) { + // TODO: S3DS call +} + + + +float ColorfulMusic::setMidImageValue(float param_1) { + // TODO: S3DS call +} + + + +// ColorfulMusic::SetDepthValue(short) + +void ColorfulMusic::SetDepthValue(short param_1) { + DepthSurround::SetStrength((DepthSurround *)&this->field_0x18,param_1); + return; +} + + + +// ColorfulMusic::Reset() + +void ColorfulMusic::Reset() { + DepthSurround::SetSamplingRate(&this->field_0x18); + return; +} + + + +// ColorfulMusic::SetEnable(bool) + +undefined4 ColorfulMusic::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0x68; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = *(char *)&this->field_0x68; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0x68 = param_1; + return 1; +} + + + +// ColorfulMusic::Process(int*, int) + +void ColorfulMusic::Process(int *param_1,int param_2) { + if (*(char *)&this->field_0x68 == '\0') { + return; + } + DepthSurround::Process((DepthSurround *)&this->field_0x18,param_1,param_2); + Stereo3DSurround::Process((Stereo3DSurround *)this,param_1,param_2); + return; +} + diff --git a/src/effects/ColorfulMusic.h b/src/effects/ColorfulMusic.h new file mode 100644 index 0000000..1f9e27e --- /dev/null +++ b/src/effects/ColorfulMusic.h @@ -0,0 +1,133 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_COLORFULMUSIC_H +#define VIPER_COLORFULMUSIC_H + + +#include "Stereo3DSurround.h" + +class ColorfulMusic { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined field_0x60; + undefined field_0x61; + undefined field_0x62; + undefined field_0x63; + undefined field_0x64; + undefined field_0x65; + undefined field_0x66; + undefined field_0x67; + undefined field_0x68; + undefined field_0x69; + undefined field_0x6a; + undefined field_0x6b; + +public: + ColorfulMusic(); + void SetSamplingRate(uint param_1); + void SetDepthValue(short param_1); + void Reset(); + float setMidImageValue(float param_1); + float setStereoWidenValue(float param_1); + undefined4 SetEnable(bool param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_COLORFULMUSIC_H diff --git a/src/effects/Convolver.cpp b/src/effects/Convolver.cpp new file mode 100644 index 0000000..e504874 --- /dev/null +++ b/src/effects/Convolver.cpp @@ -0,0 +1,1035 @@ +// +// Created by mart on 2/12/21. +// + +#include "Convolver.h" + + +// Convolver::Convolver() + +Convolver::Convolver() { + WaveBuffer_R32 *pWVar1; + PConvSingle_F32 *this_00; + PConvSingle_F32 *__s; + + this_00 = (PConvSingle_F32 *)&this->field_0x8; + do { + __s = this_00 + 0x10; + PConvSingle_F32::PConvSingle_F32(this_00); + this_00 = __s; + } while (__s != (PConvSingle_F32 *)&this->field_0x48); + *(undefined4 *)&this->field_0x16c = 0xac44; + *(undefined *)&this->field_0x170 = 0; + pWVar1 = (WaveBuffer_R32 *)operator_new(0x20); + WaveBuffer_R32::WaveBuffer_R32(pWVar1,2,0x1000); + *(WaveBuffer_R32 **)this = pWVar1; + pWVar1 = (WaveBuffer_R32 *)operator_new(0x20); + WaveBuffer_R32::WaveBuffer_R32(pWVar1,2,0x1000); + *(WaveBuffer_R32 **)&this->field_0x4 = pWVar1; + memset(__s,0,0x100); + *(undefined4 *)&this->field_0x148 = 0; + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + *(undefined4 *)&this->field_0x15c = 0; + *(undefined4 *)&this->field_0x160 = 0; + *(undefined4 *)&this->field_0x164 = 0; + return this; +} + + + +// Convolver::~Convolver() + +Convolver::~Convolver() { + WaveBuffer_R32 *pWVar1; + PConvSingle_F32 *this_00; + + pWVar1 = *(WaveBuffer_R32 **)this; + if (pWVar1 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(pWVar1); + operator_delete(pWVar1); + } + pWVar1 = *(WaveBuffer_R32 **)&this->field_0x4; + *(undefined4 *)this = 0; + if (pWVar1 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(pWVar1); + operator_delete(pWVar1); + } + *(undefined4 *)&this->field_0x4 = 0; + *(undefined4 *)&this->field_0x148 = 0; + if (*(void **)&this->field_0x14c != nullptr) { + operator_delete__(*(void **)&this->field_0x14c); + } + this_00 = (PConvSingle_F32 *)&this->field_0x48; + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + *(undefined4 *)&this->field_0x15c = 0; + do { + this_00 = this_00 + -0x10; + PConvSingle_F32::~PConvSingle_F32(this_00); + } while ((PConvSingle_F32 *)&this->field_0x8 != this_00); + return this; +} + + + +// Convolver::GetEnabled() + +undefined Convolver::GetEnabled() { + return *(undefined *)&this->field_0x170; +} + + + +// Convolver::SetSamplingRate(unsigned int) + +void Convolver::SetSamplingRate(uint param_1) { + if (*(uint *)&this->field_0x16c != param_1) { + *(uint *)&this->field_0x16c = param_1; + } + return; +} + + + +// Convolver::PrepareKernelBuffer(unsigned int, unsigned int, int) + +void Convolver::PrepareKernelBuffer(uint param_1,uint param_2,int param_3) { + bool bVar1; + + if (param_3 == 0) { + bVar1 = 3 < param_2; + if (param_2 != 4) { + bVar1 = param_2 != 1; + } + if (!bVar1 || (param_2 == 4 || param_2 == 2)) { + if (*(void **)&this->field_0x14c != nullptr) { + operator_delete__(*(void **)&this->field_0x14c); + } + *(uint *)&this->field_0x150 = param_1; + *(uint *)&this->field_0x158 = param_2; + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x154 = 0; + return; + } + } + else { + *(undefined4 *)&this->field_0x160 = 0; + if (*(void **)&this->field_0x14c != nullptr) { + operator_delete__(*(void **)&this->field_0x14c); + } + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + *(undefined4 *)&this->field_0x15c = 0; + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x8); + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x18); + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x28); + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x38); + PConvSingle_F32::UnloadKernel((PConvSingle_F32 *)&this->field_0x8); + PConvSingle_F32::UnloadKernel((PConvSingle_F32 *)&this->field_0x18); + PConvSingle_F32::UnloadKernel((PConvSingle_F32 *)&this->field_0x28); + PConvSingle_F32::UnloadKernel((PConvSingle_F32 *)&this->field_0x38); + memset((void *)&this->field_0x48,0,0x100); + *(undefined4 *)&this->field_0x148 = 0; + } + return; +} + + + +// Convolver::SetKernelBuffer(unsigned int, float*, unsigned int) + +void Convolver::SetKernelBuffer(uint param_1,float *param_2,uint param_3) { + int iVar1; + uint uVar2; + void *pvVar3; + + if (param_3 == 0 || param_2 == nullptr) { + return; + } + if (*(uint *)&this->field_0x150 != param_1) { + return; + } + if (*(int *)&this->field_0x14c != 0) { + iVar1 = param_3 + *(int *)&this->field_0x154; + if ((uint)(iVar1 * 4) < 0x1fc00001) { + uVar2 = iVar1 * 0x10; + } + else { + uVar2 = 0xffffffff; + } + pvVar3 = operator_new__(uVar2); + if (pvVar3 != nullptr) { + memcpy(pvVar3,*(void **)&this->field_0x14c,*(int *)&this->field_0x154 << 2); + if (*(void **)&this->field_0x14c != nullptr) { + operator_delete__(*(void **)&this->field_0x14c); + } + *(void **)&this->field_0x14c = pvVar3; + memcpy((void *)((int)pvVar3 + *(int *)&this->field_0x154 * 4),param_2,param_3 << 2); + *(uint *)&this->field_0x154 = *(int *)&this->field_0x154 + param_3; + return; + } + return; + } + if (param_3 * 4 < 0x1fc00001) { + uVar2 = param_3 << 4; + } + else { + uVar2 = 0xffffffff; + } + pvVar3 = operator_new__(uVar2); + *(void **)&this->field_0x14c = pvVar3; + if (pvVar3 != nullptr) { + memcpy(pvVar3,param_2,param_3 * 4); + *(uint *)&this->field_0x154 = *(int *)&this->field_0x154 + param_3; + return; + } + return; +} + + + +// Convolver::GetKernelID() + +undefined4 Convolver::GetKernelID() { + return *(undefined4 *)&this->field_0x148; +} + + + +// Convolver::SetCrossChannel(float) + +void Convolver::SetCrossChannel(float param_1) { + undefined4 in_r1; + bool in_NG; + bool in_ZR; + char in_OV; + + if (in_NG) { + *(undefined4 *)&this->field_0x164 = 0; + } + else { + if (!in_ZR && in_NG == (bool)in_OV) { + *(undefined4 *)&this->field_0x164 = 0x3f800000; + } + if ((!in_ZR && in_NG == (bool)in_OV) || + (*(undefined4 *)&this->field_0x164 = in_r1, !in_ZR && in_NG == (bool)in_OV)) { + *(undefined *)&this->field_0x168 = 1; + return; + } + } + *(undefined *)&this->field_0x168 = 0; + return; +} + + + +// Convolver::Reset() + +void Convolver::Reset() { + if (*(WaveBuffer_R32 **)this != nullptr) { + WaveBuffer_R32::Reset(*(WaveBuffer_R32 **)this); + } + if (*(WaveBuffer_R32 **)&this->field_0x4 != nullptr) { + WaveBuffer_R32::Reset(*(WaveBuffer_R32 **)&this->field_0x4); + } + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x8); + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x18); + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x28); + PConvSingle_F32::Reset((PConvSingle_F32 *)&this->field_0x38); + return; +} + + + +// Convolver::SetEnable(bool) + +undefined4 Convolver::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0x170; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = *(char *)&this->field_0x170; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0x170 = param_1; + return 1; +} + + + +// Convolver::SetKernel(float*, unsigned int) + +void Convolver::SetKernel(float *param_1,uint param_2) { + byte bVar1; + byte bVar2; + PConvSingle_F32 *this_00; + PConvSingle_F32 *this_01; + PConvSingle_F32 *this_02; + PConvSingle_F32 *this_03; + + if (param_2 < 0x10) { + return; + } + this_01 = (PConvSingle_F32 *)&this->field_0x8; + *(undefined4 *)&this->field_0x160 = 0; + this_00 = (PConvSingle_F32 *)&this->field_0x18; + this_03 = (PConvSingle_F32 *)&this->field_0x28; + PConvSingle_F32::Reset(this_01); + this_02 = (PConvSingle_F32 *)&this->field_0x38; + PConvSingle_F32::Reset(this_00); + PConvSingle_F32::Reset(this_03); + PConvSingle_F32::Reset(this_02); + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_03); + PConvSingle_F32::UnloadKernel(this_02); + bVar1 = PConvSingle_F32::LoadKernel(this_01,param_1,param_2,0x1000); + bVar2 = PConvSingle_F32::LoadKernel(this_00,param_1,param_2,0x1000); + if ((bVar2 & bVar1) == 0) { + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_03); + PConvSingle_F32::UnloadKernel(this_02); + } + *(undefined4 *)&this->field_0x148 = 0; + *(undefined4 *)&this->field_0x15c = 0; + Reset(this); + return; +} + + + +// Convolver::SetKernelStereo(float*, float*, unsigned int) + +void Convolver::SetKernelStereo(float *param_1,float *param_2,uint param_3) { + byte bVar1; + byte bVar2; + PConvSingle_F32 *this_00; + PConvSingle_F32 *this_01; + PConvSingle_F32 *this_02; + PConvSingle_F32 *this_03; + + if (param_3 < 0x10) { + return; + } + this_01 = (PConvSingle_F32 *)&this->field_0x8; + *(undefined4 *)&this->field_0x160 = 0; + this_00 = (PConvSingle_F32 *)&this->field_0x18; + this_03 = (PConvSingle_F32 *)&this->field_0x28; + PConvSingle_F32::Reset(this_01); + this_02 = (PConvSingle_F32 *)&this->field_0x38; + PConvSingle_F32::Reset(this_00); + PConvSingle_F32::Reset(this_03); + PConvSingle_F32::Reset(this_02); + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_03); + PConvSingle_F32::UnloadKernel(this_02); + bVar1 = PConvSingle_F32::LoadKernel(this_01,param_1,param_3,0x1000); + bVar2 = PConvSingle_F32::LoadKernel(this_00,param_2,param_3,0x1000); + if ((bVar2 & bVar1) == 0) { + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_03); + PConvSingle_F32::UnloadKernel(this_02); + } + *(undefined4 *)&this->field_0x148 = 0; + *(undefined4 *)&this->field_0x15c = 0; + Reset(this); + return; +} + + + +// Convolver::SetKernel(char const*) + +void Convolver::SetKernel(char *param_1) { + byte bVar1; + byte bVar2; + byte bVar3; + byte bVar4; + int iVar5; + uint uVar6; + float *pfVar7; + float *pfVar8; + float *pfVar9; + uint uVar10; + float *pfVar11; + float *pfVar12; + char *__s2; + PConvSingle_F32 *this_00; + PConvSingle_F32 *this_01; + PConvSingle_F32 *this_02; + PConvSingle_F32 *this_03; + float *pfVar13; + float *pfVar14; + bool bVar15; + undefined8 uVar16; + float *local_60; + float *local_5c; + float *local_54; + uint local_48; + int local_44; + undefined4 local_40; + uint local_3c; + undefined4 local_38; + undefined4 local_34; + undefined4 local_30; + undefined4 local_2c; + + if (param_1 == nullptr) { + return; + } + __s2 = (char *)&this->field_0x48; + iVar5 = strcmp(param_1,__s2); + if (iVar5 == 0) { + return; + } + this_00 = (PConvSingle_F32 *)&this->field_0x8; + this_01 = (PConvSingle_F32 *)&this->field_0x18; + *(undefined4 *)&this->field_0x160 = 0; + this_02 = (PConvSingle_F32 *)&this->field_0x28; + PConvSingle_F32::Reset(this_00); + this_03 = (PConvSingle_F32 *)&this->field_0x38; + PConvSingle_F32::Reset(this_01); + PConvSingle_F32::Reset(this_02); + PConvSingle_F32::Reset(this_03); + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_02); + PConvSingle_F32::UnloadKernel(this_03); + *(undefined4 *)&this->field_0x15c = 0; + *(undefined4 *)&this->field_0x148 = 0; + if (*param_1 == '\0') { + memset(__s2,0,0x100); + return; + } + local_48 = 0; + local_44 = 0; + local_40 = 0; + local_3c = 0; + local_38 = 0; + local_34 = 0; + local_30 = 0; + local_2c = 0; + iVar5 = sf_open(param_1,0x10,&local_48); + if (iVar5 == 0) { + return; + } + bVar15 = 3 < local_3c; + if (local_3c != 4) { + bVar15 = local_3c != 1; + } + if ((bVar15 && (local_3c != 4 && local_3c != 2)) || + ((int)(local_44 - (uint)(0xf >= local_48)) < 0 != + (local_44 < 0 && (int)(local_44 + -1 + (uint)(0xf < local_48)) < 0 != local_44 < 0))) { + LAB_00064430: + sf_close(iVar5); + return; + } + if (local_48 * local_3c < 0x1fc00001) { + uVar6 = local_48 * local_3c * 4; + } + else { + uVar6 = 0xffffffff; + } + pfVar7 = (float *)operator_new__(uVar6); + if (pfVar7 == nullptr) goto LAB_00064430; + uVar16 = sf_readf_float(iVar5,pfVar7,local_48,local_44); + uVar6 = local_48; + if (local_44 != (int)((ulonglong)uVar16 >> 0x20) || local_48 != (uint)uVar16) { + operator_delete__(pfVar7); + goto LAB_00064430; + } + sf_close(iVar5); + if (local_3c == 1) { + bVar1 = PConvSingle_F32::LoadKernel(this_00,pfVar7,uVar6,0x1000); + bVar4 = PConvSingle_F32::LoadKernel(this_01,pfVar7,uVar6,0x1000); + bVar4 = bVar4 & bVar1; + LAB_000645d0: + if (bVar4 != 0) { + memset(__s2,0,0x100); + strcpy(__s2,param_1); + goto LAB_000645f4; + } + } + else { + if (local_3c == 2) { + if (uVar6 < 0x1fc00001) { + uVar10 = uVar6 << 2; + pfVar8 = (float *)operator_new__(uVar10); + } + else { + pfVar8 = (float *)operator_new__(0xffffffff); + uVar10 = 0xffffffff; + } + local_60 = (float *)operator_new__(uVar10); + if (pfVar8 != nullptr && local_60 != nullptr) { + iVar5 = 0; + if (0 < (int)uVar6) { + pfVar9 = pfVar8; + pfVar11 = local_60; + pfVar12 = pfVar7 + 1; + do { + iVar5 = iVar5 + 4; + *pfVar9 = pfVar12[-1]; + *pfVar11 = *pfVar12; + pfVar9 = pfVar9 + 1; + pfVar11 = pfVar11 + 1; + pfVar12 = pfVar12 + 2; + } while (iVar5 != uVar6 * 4); + } + operator_delete__(pfVar7); + bVar1 = PConvSingle_F32::LoadKernel(this_00,pfVar8,uVar6,0x1000); + bVar4 = PConvSingle_F32::LoadKernel(this_01,local_60,uVar6,0x1000); + bVar4 = bVar4 & bVar1; + operator_delete__(pfVar8); + operator_delete__(local_60); + goto LAB_000645d0; + } + if (pfVar8 != nullptr) { + operator_delete__(pfVar8); + } + LAB_00064654: + if (local_60 != nullptr) { + operator_delete__(local_60); + } + } + else { + if (uVar6 < 0x1fc00001) { + uVar10 = uVar6 << 2; + local_5c = (float *)operator_new__(uVar10); + local_60 = (float *)operator_new__(uVar10); + local_54 = (float *)operator_new__(uVar10); + } + else { + local_5c = (float *)operator_new__(0xffffffff); + local_60 = (float *)operator_new__(0xffffffff); + local_54 = (float *)operator_new__(0xffffffff); + uVar10 = 0xffffffff; + } + pfVar8 = (float *)operator_new__(uVar10); + if (local_5c == nullptr || local_60 == nullptr) { + if (local_5c != nullptr) goto LAB_0006460c; + } + else { + if (local_54 != nullptr && pfVar8 != nullptr) { + iVar5 = 0; + if (0 < (int)uVar6) { + pfVar9 = local_54; + pfVar11 = pfVar8; + pfVar12 = pfVar7 + 3; + pfVar13 = local_5c; + pfVar14 = local_60; + do { + iVar5 = iVar5 + 4; + *pfVar13 = pfVar12[-3]; + *pfVar14 = pfVar12[-2]; + *pfVar9 = pfVar12[-1]; + *pfVar11 = *pfVar12; + pfVar9 = pfVar9 + 1; + pfVar11 = pfVar11 + 1; + pfVar12 = pfVar12 + 4; + pfVar13 = pfVar13 + 1; + pfVar14 = pfVar14 + 1; + } while (iVar5 != uVar6 << 2); + } + operator_delete__(pfVar7); + bVar1 = PConvSingle_F32::LoadKernel(this_00,local_5c,uVar6,0x1000); + bVar2 = PConvSingle_F32::LoadKernel(this_01,local_60,uVar6,0x1000); + bVar3 = PConvSingle_F32::LoadKernel(this_02,local_54,uVar6,0x1000); + bVar4 = PConvSingle_F32::LoadKernel(this_03,pfVar8,uVar6,0x1000); + bVar4 = bVar2 & bVar1 & bVar3 & bVar4; + operator_delete__(local_5c); + operator_delete__(local_60); + operator_delete__(local_54); + operator_delete__(pfVar8); + *(undefined4 *)&this->field_0x160 = 1; + goto LAB_000645d0; + } + LAB_0006460c: + operator_delete__(local_5c); + } + if (local_60 != nullptr) { + operator_delete__(local_60); + } + if ((local_54 != nullptr) && (local_5c != nullptr)) { + operator_delete__(local_5c); + } + if (pfVar8 != nullptr) goto LAB_00064654; + } + operator_delete__(pfVar7); + } + *(undefined4 *)&this->field_0x160 = 0; + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_02); + PConvSingle_F32::UnloadKernel(this_03); + LAB_000645f4: + Reset(this); + return; +} + + + +// Convolver::CommitKernelBuffer(unsigned int, unsigned int, unsigned int) + +void Convolver::CommitKernelBuffer(uint param_1,uint param_2,uint param_3) { + bool bVar1; + byte bVar2; + byte bVar3; + byte bVar4; + byte bVar5; + float *pfVar6; + float *pfVar7; + float *pfVar8; + uint uVar9; + float *pfVar10; + float *pfVar11; + float *pfVar12; + uint uVar13; + float *pfVar14; + void *pvVar15; + PConvSingle_F32 *this_00; + PConvSingle_F32 *this_01; + undefined4 unaff_r8; + PConvSingle_F32 *this_02; + PConvSingle_F32 *this_03; + int iVar16; + float *pfVar17; + bool bVar18; + bool bVar19; + float *local_34; + float *local_2c; + + pvVar15 = *(void **)&this->field_0x14c; + if (pvVar15 == nullptr) { + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + return; + } + if (*(uint *)&this->field_0x150 != param_1) { + LAB_00064830: + operator_delete__(pvVar15); + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + return; + } + if (*(int *)&this->field_0x154 == 0) { + operator_delete__(pvVar15); + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + return; + } + uVar13 = *(uint *)&this->field_0x158; + bVar19 = 3 < uVar13; + bVar18 = uVar13 == 4; + if (!bVar18) { + bVar19 = uVar13 != 1; + } + bVar1 = uVar13 != 2; + if (!bVar19 || (bVar18 || !bVar1)) { + unaff_r8 = 0; + } + if (bVar19 && (!bVar18 && bVar1)) { + unaff_r8 = 1; + } + if (bVar19 && (!bVar18 && bVar1)) goto LAB_00064830; + uVar13 = FUN_00063c3c(pvVar15,*(int *)&this->field_0x154 << 2); + if ((uVar13 != param_2) || (*(uint *)&this->field_0x15c == uVar13)) { + operator_delete__(pvVar15); + *(undefined4 *)&this->field_0x14c = unaff_r8; + *(undefined4 *)&this->field_0x150 = unaff_r8; + *(undefined4 *)&this->field_0x154 = unaff_r8; + *(undefined4 *)&this->field_0x158 = unaff_r8; + return; + } + this_00 = (PConvSingle_F32 *)&this->field_0x8; + *(uint *)&this->field_0x15c = uVar13; + *(undefined4 *)&this->field_0x160 = unaff_r8; + this_01 = (PConvSingle_F32 *)&this->field_0x18; + this_02 = (PConvSingle_F32 *)&this->field_0x28; + PConvSingle_F32::Reset(this_00); + this_03 = (PConvSingle_F32 *)&this->field_0x38; + PConvSingle_F32::Reset(this_01); + PConvSingle_F32::Reset(this_02); + PConvSingle_F32::Reset(this_03); + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_02); + PConvSingle_F32::UnloadKernel(this_03); + iVar16 = *(int *)&this->field_0x158; + uVar13 = __divsi3(*(undefined4 *)&this->field_0x154,iVar16); + if (iVar16 == 1) { + bVar2 = PConvSingle_F32::LoadKernel(this_00,*(float **)&this->field_0x14c,uVar13,0x1000); + bVar5 = PConvSingle_F32::LoadKernel(this_01,*(float **)&this->field_0x14c,uVar13,0x1000); + bVar5 = bVar5 & bVar2; + LAB_00064a9c: + if (bVar5 != 0) { + memset((void *)&this->field_0x48,0,0x100); + *(uint *)&this->field_0x148 = param_3; + goto LAB_00064ab8; + } + } + else { + if (iVar16 == 2) { + if (uVar13 < 0x1fc00001) { + uVar9 = uVar13 << 2; + pfVar7 = (float *)operator_new__(uVar9); + } + else { + pfVar7 = (float *)operator_new__(0xffffffff); + uVar9 = 0xffffffff; + } + pfVar6 = (float *)operator_new__(uVar9); + if (pfVar7 != nullptr && pfVar6 != nullptr) { + if (0 < (int)uVar13) { + pfVar8 = pfVar6; + pfVar10 = pfVar7; + pfVar11 = (float *)(*(int *)&this->field_0x14c + 4); + do { + pfVar14 = pfVar10 + 1; + *pfVar10 = pfVar11[-1]; + *pfVar8 = *pfVar11; + pfVar8 = pfVar8 + 1; + pfVar10 = pfVar14; + pfVar11 = pfVar11 + 2; + } while (pfVar14 != pfVar7 + uVar13); + } + bVar2 = PConvSingle_F32::LoadKernel(this_00,pfVar7,uVar13,0x1000); + bVar5 = PConvSingle_F32::LoadKernel(this_01,pfVar6,uVar13,0x1000); + bVar5 = bVar5 & bVar2; + operator_delete__(pfVar7); + operator_delete__(pfVar6); + goto LAB_00064a9c; + } + if (pfVar7 != nullptr) { + operator_delete__(pfVar7); + } + } + else { + if (uVar13 < 0x1fc00001) { + uVar9 = uVar13 << 2; + local_34 = (float *)operator_new__(uVar9); + pfVar6 = (float *)operator_new__(uVar9); + local_2c = (float *)operator_new__(uVar9); + } + else { + local_34 = (float *)operator_new__(0xffffffff); + pfVar6 = (float *)operator_new__(0xffffffff); + local_2c = (float *)operator_new__(0xffffffff); + uVar9 = 0xffffffff; + } + pfVar7 = (float *)operator_new__(uVar9); + if (local_34 == nullptr || pfVar6 == nullptr) { + if (local_34 != nullptr) goto LAB_00064af8; + } + else { + if (local_2c != nullptr && pfVar7 != nullptr) { + if (0 < (int)uVar13) { + pfVar8 = local_2c; + pfVar10 = pfVar7; + pfVar11 = local_34; + pfVar14 = (float *)(*(int *)&this->field_0x14c + 0xc); + pfVar17 = pfVar6; + do { + pfVar12 = pfVar11 + 1; + *pfVar11 = pfVar14[-3]; + *pfVar17 = pfVar14[-2]; + *pfVar8 = pfVar14[-1]; + *pfVar10 = *pfVar14; + pfVar8 = pfVar8 + 1; + pfVar10 = pfVar10 + 1; + pfVar11 = pfVar12; + pfVar14 = pfVar14 + 4; + pfVar17 = pfVar17 + 1; + } while (pfVar12 != local_34 + uVar13); + } + bVar2 = PConvSingle_F32::LoadKernel(this_00,local_34,uVar13,0x1000); + bVar3 = PConvSingle_F32::LoadKernel(this_01,pfVar6,uVar13,0x1000); + bVar4 = PConvSingle_F32::LoadKernel(this_02,local_2c,uVar13,0x1000); + bVar5 = PConvSingle_F32::LoadKernel(this_03,pfVar7,uVar13,0x1000); + bVar5 = bVar3 & bVar2 & bVar4 & bVar5; + operator_delete__(local_34); + operator_delete__(pfVar6); + operator_delete__(local_2c); + operator_delete__(pfVar7); + *(undefined4 *)&this->field_0x160 = 1; + goto LAB_00064a9c; + } + LAB_00064af8: + operator_delete__(local_34); + } + if (pfVar6 != nullptr) { + operator_delete__(pfVar6); + } + if ((local_2c != nullptr) && (local_34 != nullptr)) { + operator_delete__(local_34); + } + if (pfVar7 == nullptr) goto LAB_00064b4c; + } + if (pfVar6 != nullptr) { + operator_delete__(pfVar6); + } + } + LAB_00064b4c: + *(undefined4 *)&this->field_0x160 = 0; + PConvSingle_F32::UnloadKernel(this_00); + PConvSingle_F32::UnloadKernel(this_01); + PConvSingle_F32::UnloadKernel(this_02); + PConvSingle_F32::UnloadKernel(this_03); + *(undefined4 *)&this->field_0x15c = 0; + *(undefined4 *)&this->field_0x148 = 0; + LAB_00064ab8: + if (*(void **)&this->field_0x14c != nullptr) { + operator_delete__(*(void **)&this->field_0x14c); + } + *(undefined4 *)&this->field_0x14c = 0; + *(undefined4 *)&this->field_0x150 = 0; + *(undefined4 *)&this->field_0x154 = 0; + *(undefined4 *)&this->field_0x158 = 0; + Reset(this); + return; +} + + + +// WARNING: Type propagation algorithm not settling +// Convolver::Process(float*, float*, int) + +int Convolver::Process(float *param_1,float *param_2,int param_3) { + undefined auVar1 [16]; + undefined4 uVar2; + int iVar3; + uint uVar4; + float fVar5; + float *pfVar6; + undefined8 *puVar7; + undefined8 *puVar8; + float *pfVar9; + undefined8 *puVar10; + float *pfVar11; + float *pfVar12; + undefined8 *puVar13; + undefined8 *puVar14; + undefined8 *puVar15; + float *pfVar16; + float *pfVar17; + PConvSingle_F32 *this_00; + float fVar18; + undefined8 *puVar19; + undefined8 *puVar20; + undefined auVar21 [16]; + undefined auVar22 [16]; + undefined auVar23 [16]; + undefined auVar24 [16]; + undefined auVar25 [16]; + undefined auVar26 [16]; + undefined auVar27 [16]; + undefined auVar28 [16]; + undefined auVar29 [16]; + undefined auVar30 [16]; + undefined auVar31 [16]; + undefined auVar32 [16]; + undefined auVar33 [16]; + undefined auVar34 [16]; + undefined auVar35 [16]; + undefined auVar36 [16]; + float afStack98496 [8192]; + float afStack65728 [16423]; + + if (*(char *)&this->field_0x170 == '\0') { + return param_3; + } + if (*(int *)this == 0) { + return param_3; + } + if (*(int *)&this->field_0x4 == 0) { + return param_3; + } + this_00 = (PConvSingle_F32 *)&this->field_0x8; + if (*(int *)&this->field_0x160 == 0) { + iVar3 = PConvSingle_F32::InstanceUsable(this_00); + if (iVar3 == 0) { + return param_3; + } + iVar3 = PConvSingle_F32::InstanceUsable((PConvSingle_F32 *)&this->field_0x18); + } + else { + iVar3 = PConvSingle_F32::InstanceUsable(this_00); + if (iVar3 == 0) { + return param_3; + } + iVar3 = PConvSingle_F32::InstanceUsable((PConvSingle_F32 *)&this->field_0x18); + if (iVar3 == 0) { + return param_3; + } + iVar3 = PConvSingle_F32::InstanceUsable((PConvSingle_F32 *)&this->field_0x28); + if (iVar3 == 0) { + return param_3; + } + iVar3 = PConvSingle_F32::InstanceUsable((PConvSingle_F32 *)&this->field_0x38); + } + if ((iVar3 != 0) && + (iVar3 = WaveBuffer_R32::PushSamples(*(WaveBuffer_R32 **)this,param_1,param_3), iVar3 != 0)) { + if (*(int *)&this->field_0x160 == 0) { + while (uVar4 = WaveBuffer_R32::GetBufferOffset(), 0xfff < uVar4) { + pfVar6 = (float *)WaveBuffer_R32::GetCurrentBufferR32Ptr(*(WaveBuffer_R32 **)this); + PConvSingle_F32::ConvolveInterleaved(this_00,pfVar6,0); + PConvSingle_F32::ConvolveInterleaved((PConvSingle_F32 *)&this->field_0x18,pfVar6,1); + if (*(char *)&this->field_0x168 != '\0') { + iVar3 = 0; + auVar1 = ZEXT816(CONCAT44(*(undefined4 *)&this->field_0x164, + *(undefined4 *)&this->field_0x164)); + auVar1 = auVar1 & auVar1 << 0x40; + do { + puVar14 = (undefined8 *)((int)pfVar6 + iVar3 + 0x10); + puVar15 = (undefined8 *)(iVar3 + (int)pfVar6); + auVar35 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar14 + 4), + *(undefined4 *)((int)puVar14 + 4)), + CONCAT44(*(undefined4 *)puVar14,*(undefined4 *)puVar14)); + puVar20 = (undefined8 *)((int)pfVar6 + iVar3 + 0x20); + puVar19 = (undefined8 *)((int)(pfVar6 + 0xc) + iVar3); + puVar7 = (undefined8 *)((int)(pfVar6 + 0x10) + iVar3); + auVar22 = FloatVectorMult(auVar35,auVar1,2,0x20); + puVar10 = (undefined8 *)((int)(pfVar6 + 0x18) + iVar3); + auVar36 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar15 + 4), + *(undefined4 *)((int)puVar15 + 4)), + CONCAT44(*(undefined4 *)puVar15,*(undefined4 *)puVar15)); + puVar8 = (undefined8 *)((int)(pfVar6 + 0x14) + iVar3); + auVar27 = FloatVectorMult(auVar36,auVar1,2,0x20); + puVar13 = (undefined8 *)((int)(pfVar6 + 0x1c) + iVar3); + auVar34 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar20 + 4), + *(undefined4 *)((int)puVar20 + 4)), + CONCAT44(*(undefined4 *)puVar20,*(undefined4 *)puVar20)); + iVar3 = iVar3 + 0x80; + auVar33 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar19 + 4), + *(undefined4 *)((int)puVar19 + 4)), + CONCAT44(*(undefined4 *)puVar19,*(undefined4 *)puVar19)); + auVar25 = FloatVectorMult(auVar34,auVar1,2,0x20); + auVar32 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar7 + 4), + *(undefined4 *)((int)puVar7 + 4)), + CONCAT44(*(undefined4 *)puVar7,*(undefined4 *)puVar7)); + auVar31 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar8 + 4), + *(undefined4 *)((int)puVar8 + 4)), + CONCAT44(*(undefined4 *)puVar8,*(undefined4 *)puVar8)); + auVar24 = FloatVectorMult(auVar33,auVar1,2,0x20); + auVar30 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar10 + 4), + *(undefined4 *)((int)puVar10 + 4)), + CONCAT44(*(undefined4 *)puVar10,*(undefined4 *)puVar10)); + auVar29 = CONCAT88(CONCAT44(*(undefined4 *)((int)puVar13 + 4), + *(undefined4 *)((int)puVar13 + 4)), + CONCAT44(*(undefined4 *)puVar13,*(undefined4 *)puVar13)); + auVar23 = FloatVectorMult(auVar32,auVar1,2,0x20); + auVar21 = vrev(auVar22,4); + auVar28 = vrev(auVar27,4); + auVar22 = FloatVectorMult(auVar31,auVar1,2,0x20); + auVar27 = FloatVectorMult(auVar30,auVar1,2,0x20); + auVar26 = vrev(auVar25,4); + auVar25 = vrev(auVar24,4); + auVar24 = FloatVectorMult(auVar29,auVar1,2,0x20); + auVar23 = vrev(auVar23,4); + auVar22 = vrev(auVar22,4); + auVar27 = vrev(auVar27,4); + auVar36 = FloatVectorAdd(auVar36,auVar28,2,0x20); + auVar28 = FloatVectorAdd(auVar34,auVar26,2,0x20); + auVar24 = vrev(auVar24,4); + auVar21 = FloatVectorAdd(auVar35,auVar21,2,0x20); + auVar26 = FloatVectorAdd(auVar33,auVar25,2,0x20); + *puVar15 = CONCAT44(SUB164(auVar36,0),SUB164(auVar36,0)); + uVar2 = SUB164(auVar36 >> 0x40,0); + *(ulonglong *)((int)puVar15 + 4) = CONCAT44(uVar2,uVar2); + auVar25 = FloatVectorAdd(auVar32,auVar23,2,0x20); + auVar23 = FloatVectorAdd(auVar31,auVar22,2,0x20); + *puVar14 = CONCAT44(SUB164(auVar21,0),SUB164(auVar21,0)); + uVar2 = SUB164(auVar21 >> 0x40,0); + *(ulonglong *)((int)puVar14 + 4) = CONCAT44(uVar2,uVar2); + auVar21 = FloatVectorAdd(auVar30,auVar27,2,0x20); + auVar22 = FloatVectorAdd(auVar29,auVar24,2,0x20); + *puVar20 = CONCAT44(SUB164(auVar28,0),SUB164(auVar28,0)); + uVar2 = SUB164(auVar28 >> 0x40,0); + *(ulonglong *)((int)puVar20 + 4) = CONCAT44(uVar2,uVar2); + *puVar19 = CONCAT44(SUB164(auVar26,0),SUB164(auVar26,0)); + uVar2 = SUB164(auVar26 >> 0x40,0); + *(ulonglong *)((int)puVar19 + 4) = CONCAT44(uVar2,uVar2); + *puVar7 = CONCAT44(SUB164(auVar25,0),SUB164(auVar25,0)); + uVar2 = SUB164(auVar25 >> 0x40,0); + *(ulonglong *)((int)puVar7 + 4) = CONCAT44(uVar2,uVar2); + *puVar8 = CONCAT44(SUB164(auVar23,0),SUB164(auVar23,0)); + uVar2 = SUB164(auVar23 >> 0x40,0); + *(ulonglong *)((int)puVar8 + 4) = CONCAT44(uVar2,uVar2); + *puVar10 = CONCAT44(SUB164(auVar21,0),SUB164(auVar21,0)); + uVar2 = SUB164(auVar21 >> 0x40,0); + *(ulonglong *)((int)puVar10 + 4) = CONCAT44(uVar2,uVar2); + *puVar13 = CONCAT44(SUB164(auVar22,0),SUB164(auVar22,0)); + uVar2 = SUB164(auVar22 >> 0x40,0); + *(ulonglong *)((int)puVar13 + 4) = CONCAT44(uVar2,uVar2); + } while (iVar3 != 0x8000); + } + WaveBuffer_R32::PushSamples(*(WaveBuffer_R32 **)&this->field_0x4,pfVar6,0x1000); + WaveBuffer_R32::PopSamples(*(WaveBuffer_R32 **)this,0x1000,true); + } + } + else { + while (uVar4 = WaveBuffer_R32::GetBufferOffset(), 0xfff < uVar4) { + WaveBuffer_R32::PopSamples(*(WaveBuffer_R32 **)this,afStack65728 + 0x2000,0x1000,false); + pfVar16 = afStack65728 + 1; + pfVar17 = afStack98496 + 1; + pfVar6 = pfVar17; + pfVar9 = afStack65728 + 0x2001; + pfVar11 = pfVar16; + do { + fVar18 = pfVar9[-1]; + fVar5 = *pfVar9; + pfVar11[-1] = fVar18; + pfVar12 = pfVar11 + 2; + *pfVar11 = fVar18; + pfVar6[-1] = fVar5; + *pfVar6 = fVar5; + pfVar6 = pfVar6 + 2; + pfVar9 = pfVar9 + 2; + pfVar11 = pfVar12; + } while (pfVar12 != afStack65728 + 0x2001); + PConvSingle_F32::ConvolveInterleaved(this_00,afStack65728,0); + PConvSingle_F32::ConvolveInterleaved((PConvSingle_F32 *)&this->field_0x18,afStack65728,1); + PConvSingle_F32::ConvolveInterleaved((PConvSingle_F32 *)&this->field_0x28,afStack98496,0); + PConvSingle_F32::ConvolveInterleaved((PConvSingle_F32 *)&this->field_0x38,afStack98496,1); + pfVar6 = afStack65728 + 0x2001; + do { + pfVar9 = pfVar16 + -1; + fVar5 = *pfVar16; + fVar18 = *pfVar17; + pfVar16 = pfVar16 + 2; + pfVar11 = pfVar17 + -1; + pfVar17 = pfVar17 + 2; + pfVar6[-1] = *pfVar9 + *pfVar11; + *pfVar6 = fVar5 + fVar18; + pfVar6 = pfVar6 + 2; + } while (pfVar16 != afStack65728 + 0x2001); + WaveBuffer_R32::PushSamples + (*(WaveBuffer_R32 **)&this->field_0x4,afStack65728 + 0x2000,0x1000); + } + } + param_3 = WaveBuffer_R32::PopSamples(*(WaveBuffer_R32 **)&this->field_0x4,param_2,param_3,false) + ; + } + return param_3; +} diff --git a/src/effects/Convolver.h b/src/effects/Convolver.h new file mode 100644 index 0000000..60e02cc --- /dev/null +++ b/src/effects/Convolver.h @@ -0,0 +1,401 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_CONVOLVER_H +#define VIPER_CONVOLVER_H + + +class Convolver { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined field_0x60; + undefined field_0x61; + undefined field_0x62; + undefined field_0x63; + undefined field_0x64; + undefined field_0x65; + undefined field_0x66; + undefined field_0x67; + undefined field_0x68; + undefined field_0x69; + undefined field_0x6a; + undefined field_0x6b; + undefined field_0x6c; + undefined field_0x6d; + undefined field_0x6e; + undefined field_0x6f; + undefined field_0x70; + undefined field_0x71; + undefined field_0x72; + undefined field_0x73; + undefined field_0x74; + undefined field_0x75; + undefined field_0x76; + undefined field_0x77; + undefined field_0x78; + undefined field_0x79; + undefined field_0x7a; + undefined field_0x7b; + undefined field_0x7c; + undefined field_0x7d; + undefined field_0x7e; + undefined field_0x7f; + undefined field_0x80; + undefined field_0x81; + undefined field_0x82; + undefined field_0x83; + undefined field_0x84; + undefined field_0x85; + undefined field_0x86; + undefined field_0x87; + undefined field_0x88; + undefined field_0x89; + undefined field_0x8a; + undefined field_0x8b; + undefined field_0x8c; + undefined field_0x8d; + undefined field_0x8e; + undefined field_0x8f; + undefined field_0x90; + undefined field_0x91; + undefined field_0x92; + undefined field_0x93; + undefined field_0x94; + undefined field_0x95; + undefined field_0x96; + undefined field_0x97; + undefined field_0x98; + undefined field_0x99; + undefined field_0x9a; + undefined field_0x9b; + undefined field_0x9c; + undefined field_0x9d; + undefined field_0x9e; + undefined field_0x9f; + undefined field_0xa0; + undefined field_0xa1; + undefined field_0xa2; + undefined field_0xa3; + undefined field_0xa4; + undefined field_0xa5; + undefined field_0xa6; + undefined field_0xa7; + undefined field_0xa8; + undefined field_0xa9; + undefined field_0xaa; + undefined field_0xab; + undefined field_0xac; + undefined field_0xad; + undefined field_0xae; + undefined field_0xaf; + undefined field_0xb0; + undefined field_0xb1; + undefined field_0xb2; + undefined field_0xb3; + undefined field_0xb4; + undefined field_0xb5; + undefined field_0xb6; + undefined field_0xb7; + undefined field_0xb8; + undefined field_0xb9; + undefined field_0xba; + undefined field_0xbb; + undefined field_0xbc; + undefined field_0xbd; + undefined field_0xbe; + undefined field_0xbf; + undefined field_0xc0; + undefined field_0xc1; + undefined field_0xc2; + undefined field_0xc3; + undefined field_0xc4; + undefined field_0xc5; + undefined field_0xc6; + undefined field_0xc7; + undefined field_0xc8; + undefined field_0xc9; + undefined field_0xca; + undefined field_0xcb; + undefined field_0xcc; + undefined field_0xcd; + undefined field_0xce; + undefined field_0xcf; + undefined field_0xd0; + undefined field_0xd1; + undefined field_0xd2; + undefined field_0xd3; + undefined field_0xd4; + undefined field_0xd5; + undefined field_0xd6; + undefined field_0xd7; + undefined field_0xd8; + undefined field_0xd9; + undefined field_0xda; + undefined field_0xdb; + undefined field_0xdc; + undefined field_0xdd; + undefined field_0xde; + undefined field_0xdf; + undefined field_0xe0; + undefined field_0xe1; + undefined field_0xe2; + undefined field_0xe3; + undefined field_0xe4; + undefined field_0xe5; + undefined field_0xe6; + undefined field_0xe7; + undefined field_0xe8; + undefined field_0xe9; + undefined field_0xea; + undefined field_0xeb; + undefined field_0xec; + undefined field_0xed; + undefined field_0xee; + undefined field_0xef; + undefined field_0xf0; + undefined field_0xf1; + undefined field_0xf2; + undefined field_0xf3; + undefined field_0xf4; + undefined field_0xf5; + undefined field_0xf6; + undefined field_0xf7; + undefined field_0xf8; + undefined field_0xf9; + undefined field_0xfa; + undefined field_0xfb; + undefined field_0xfc; + undefined field_0xfd; + undefined field_0xfe; + undefined field_0xff; + undefined field_0x100; + undefined field_0x101; + undefined field_0x102; + undefined field_0x103; + undefined field_0x104; + undefined field_0x105; + undefined field_0x106; + undefined field_0x107; + undefined field_0x108; + undefined field_0x109; + undefined field_0x10a; + undefined field_0x10b; + undefined field_0x10c; + undefined field_0x10d; + undefined field_0x10e; + undefined field_0x10f; + undefined field_0x110; + undefined field_0x111; + undefined field_0x112; + undefined field_0x113; + undefined field_0x114; + undefined field_0x115; + undefined field_0x116; + undefined field_0x117; + undefined field_0x118; + undefined field_0x119; + undefined field_0x11a; + undefined field_0x11b; + undefined field_0x11c; + undefined field_0x11d; + undefined field_0x11e; + undefined field_0x11f; + undefined field_0x120; + undefined field_0x121; + undefined field_0x122; + undefined field_0x123; + undefined field_0x124; + undefined field_0x125; + undefined field_0x126; + undefined field_0x127; + undefined field_0x128; + undefined field_0x129; + undefined field_0x12a; + undefined field_0x12b; + undefined field_0x12c; + undefined field_0x12d; + undefined field_0x12e; + undefined field_0x12f; + undefined field_0x130; + undefined field_0x131; + undefined field_0x132; + undefined field_0x133; + undefined field_0x134; + undefined field_0x135; + undefined field_0x136; + undefined field_0x137; + undefined field_0x138; + undefined field_0x139; + undefined field_0x13a; + undefined field_0x13b; + undefined field_0x13c; + undefined field_0x13d; + undefined field_0x13e; + undefined field_0x13f; + undefined field_0x140; + undefined field_0x141; + undefined field_0x142; + undefined field_0x143; + undefined field_0x144; + undefined field_0x145; + undefined field_0x146; + undefined field_0x147; + undefined field_0x148; + undefined field_0x149; + undefined field_0x14a; + undefined field_0x14b; + undefined field_0x14c; + undefined field_0x14d; + undefined field_0x14e; + undefined field_0x14f; + undefined field_0x150; + undefined field_0x151; + undefined field_0x152; + undefined field_0x153; + undefined field_0x154; + undefined field_0x155; + undefined field_0x156; + undefined field_0x157; + undefined field_0x158; + undefined field_0x159; + undefined field_0x15a; + undefined field_0x15b; + undefined field_0x15c; + undefined field_0x15d; + undefined field_0x15e; + undefined field_0x15f; + undefined field_0x160; + undefined field_0x161; + undefined field_0x162; + undefined field_0x163; + undefined field_0x164; + undefined field_0x165; + undefined field_0x166; + undefined field_0x167; + undefined field_0x168; + undefined field_0x169; + undefined field_0x16a; + undefined field_0x16b; + undefined field_0x16c; + undefined field_0x16d; + undefined field_0x16e; + undefined field_0x16f; + undefined field_0x170; + undefined field_0x171; + undefined field_0x172; + undefined field_0x173; +public: + Convolver(); + ~Convolver(); + undefined GetEnabled(); + void SetSamplingRate(uint param_1); + void PrepareKernelBuffer(uint param_1,uint param_2,int param_3); + void SetKernelBuffer(uint param_1,float *param_2,uint param_3); + undefined4 GetKernelID(); + void SetCrossChannel(float param_1); + void Reset(); + undefined4 SetEnable(bool param_1); + void SetKernel(float *param_1,uint param_2); + void SetKernelStereo(float *param_1,float *param_2,uint param_3); + void SetKernel(char *param_1); + void CommitKernelBuffer(uint param_1,uint param_2,uint param_3); + int Process(float *param_1,float *param_2,int param_3); +}; + + +#endif //VIPER_CONVOLVER_H diff --git a/src/effects/Cure.cpp b/src/effects/Cure.cpp new file mode 100644 index 0000000..8e082fc --- /dev/null +++ b/src/effects/Cure.cpp @@ -0,0 +1,131 @@ +// +// Created by mart on 2/13/21. +// + +#include "Cure.h" + +// Cure::~Cure() + +Cure::~Cure() { + PassFilter::~PassFilter(&this->field_0x38); + Crossfeed::~Crossfeed((Crossfeed *)this); + return this; +} + + + +// Cure::Reset() + +void Cure::Reset() { + Crossfeed::Reset((Crossfeed *)this); + PassFilter::Reset(); + return; +} + + + +// Cure::Cure() + +Cure::Cure() { + Crossfeed::Crossfeed((Crossfeed *)this); + PassFilter::PassFilter(&this->field_0x38); + this->enabled = false; + Reset(this); + return this; +} + + + +// Cure::SetEnable(bool) + +undefined4 Cure::SetEnable(bool param_1) { + if (this->enabled != param_1) { + Reset(this); + this->enabled = param_1; + return 1; + } + return 0; +} + + + +// Cure::SetSamplingRate(int) + +void Cure::SetSamplingRate(int param_1) { + Crossfeed::SetSamplingRate((Crossfeed *)this,param_1); + PassFilter::SetSamplingRate(&this->field_0x38,param_1); + return; +} + + +void Cure::~ZN4Cure9SetCutoffEi(int param_1) { + SetPreset(this,param_1 | (uint)(ushort)this->feedback << 0x10); + return; +} + + + +void Cure::~ZN4Cure11SetFeedbackEf(float param_1) { + undefined4 in_cr7; + + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + SetPreset(this,(uint)(ushort)this->cutoff); + return; +} + + + +void Cure::~ZN4Cure9SetPresetEj(uint param_1) { + *(uint *)&this->cutoff = param_1; + Reset(this); + return; +} + + + +short Cure::~ZN4Cure9GetCutoffEv() { + return this->cutoff; +} + + + +float Cure::~ZN4Cure11GetFeedbackEv() { + return (float)(longlong)(int)(uint)(ushort)this->feedback / 10.0; +} + + + +float Cure::~ZN4Cure13GetLevelDelayEv() { + int iVar1; + undefined4 in_cr7; + float fVar2; + + iVar1 = GetCutoff(this); + if (iVar1 - 300U < 0x6a5) { + fVar2 = 18700.0 / (float)(longlong)iVar1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + } + else { + fVar2 = 0.0; + } + return fVar2; +} + + + +undefined4 Cure::~ZN4Cure9GetPresetEv() { + return *(undefined4 *)&this->cutoff; +} + + + +// Cure::Process(int*, int) + +void Cure::Process(int *param_1,int param_2) { + if (this->enabled == false) { + return; + } + Crossfeed::ProcessFrames((Crossfeed *)this,param_1,param_2); + PassFilter::ProcessFrames(&this->field_0x38,param_1,param_2); + return; +} diff --git a/src/effects/Cure.h b/src/effects/Cure.h new file mode 100644 index 0000000..8002567 --- /dev/null +++ b/src/effects/Cure.h @@ -0,0 +1,34 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_CURE_H +#define VIPER_CURE_H + + +class Cure { + struct Crossfeed field_0x0; + struct PassFilter field_0x38; + bool enabled; // Created by retype action + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + +public: + ~Cure(); + void Reset(); + Cure(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(int param_1); + void ~ZN4Cure9SetCutoffEi(int param_1); + void ~ZN4Cure11SetFeedbackEf(float param_1); + void ~ZN4Cure9SetPresetEj(uint param_1); + short ~ZN4Cure9GetCutoffEv(); + float ~ZN4Cure11GetFeedbackEv(); + float ~ZN4Cure13GetLevelDelayEv(); + undefined4 ~ZN4Cure9GetPresetEv(); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_CURE_H diff --git a/src/effects/DepthSurround.cpp b/src/effects/DepthSurround.cpp new file mode 100644 index 0000000..faccdbe --- /dev/null +++ b/src/effects/DepthSurround.cpp @@ -0,0 +1,178 @@ +// +// Created by mart on 2/12/21. +// + +#include "DepthSurround.h" + +// DepthSurround::RefreshStrength(short) + +void DepthSurround::RefreshStrength(short param_1) { + undefined4 uVar1; + uint uVar2; + undefined4 extraout_r1; + uint uVar3; + short sVar4; + undefined4 unaff_r4; + undefined4 unaff_r5; + undefined4 unaff_r6; + undefined4 in_lr; + undefined4 in_cr0; + undefined4 in_cr1; + double dVar5; + longlong lVar6; + + sVar4 = param_1; + if (param_1 != 0) { + sVar4 = 1; + } + this[3] = (DepthSurround)(499 < param_1); + this[2] = SUB21(sVar4,0); + if (sVar4 != 0) { + uVar1 = 0; + dVar5 = pow((double)CONCAT44(unaff_r5,unaff_r4),(double)CONCAT44(in_lr,unaff_r6)); + coprocessor_function(0xb,6,5,in_cr1,in_cr1,in_cr0); + lVar6 = __fixdfdi(SUB84(dVar5,0),uVar1,extraout_r1); + uVar3 = (uint)((ulonglong)lVar6 >> 0x20); + uVar2 = (uint)lVar6; + if (0 < (int)(uVar3 + (uVar2 >= 0x80000000)) != + (lVar6 < 0 && (int)(~uVar3 + (uint)(uVar2 < 0x80000000)) < 0)) { + uVar2 = 0x7fffffff; + } + *(uint *)(this + 4) = uVar2; + return; + } + *(undefined4 *)(this + 4) = 0; + return; +} + + + +// DepthSurround::SetSamplingRate(unsigned int) + +void DepthSurround::SetSamplingRate(uint param_1) { + uint in_r1; + float in_s0; + float fVar1; + undefined8 uVar2; + float extraout_s2; + float extraout_s3; + float extraout_s4; + + fVar1 = (float)TimeConstDelay::SetParameters + ((TimeConstDelay *)(param_1 + 0x10),(uint)ROUND((float)(ulonglong)in_r1), + in_s0); + uVar2 = TimeConstDelay::SetParameters + ((TimeConstDelay *)(param_1 + 0x1c),(uint)ROUND((float)(ulonglong)in_r1),fVar1); + FixedBiquad::SetHighPassParameter + ((FixedBiquad *)(param_1 + 0x28),(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + extraout_s2,extraout_s3,extraout_s4); + *(undefined4 *)(param_1 + 8) = 0; + *(undefined4 *)(param_1 + 0xc) = 0; + return; +} + + + +// DepthSurround::DepthSurround() + +DepthSurround::DepthSurround() { + TimeConstDelay::TimeConstDelay((TimeConstDelay *)(this + 0x10)); + TimeConstDelay::TimeConstDelay((TimeConstDelay *)(this + 0x1c)); + FixedBiquad::FixedBiquad((FixedBiquad *)(this + 0x28)); + *(undefined2 *)this = 0; + this[2] = (DepthSurround)0x0; + this[3] = (DepthSurround)0x0; + *(undefined4 *)(this + 4) = 0; + *(undefined4 *)(this + 8) = 0; + *(undefined4 *)(this + 0xc) = 0; + SetSamplingRate((uint)this); + RefreshStrength(this,*(short *)this); + return this; +} + + + +// DepthSurround::SetStrength(short) + +void DepthSurround::SetStrength(short param_1) { + *(short *)this = param_1; + RefreshStrength(this,param_1); + return; +} + + + +// DepthSurround::Process(int*, int) + +void DepthSurround::Process(int *param_1,int param_2) { + int iVar1; + int iVar2; + int iVar3; + int iVar4; + int iVar5; + int *piVar6; + uint uVar7; + undefined8 uVar8; + int local_48; + int local_40; + + if (this[2] != (DepthSurround)0x0) { + uVar7 = (uint)(byte)this[3]; + if (uVar7 == 0) { + if (0 < param_2) { + piVar6 = param_1 + 1; + do { + iVar3 = piVar6[-1]; + uVar7 = uVar7 + 1; + iVar4 = param_1[1]; + iVar1 = TimeConstDelay::ProcessSample((int)(this + 0x10)); + iVar2 = TimeConstDelay::ProcessSample((int)(this + 0x1c)); + uVar8 = VectorShiftRight((longlong)*(int *)(this + 4) * (longlong)iVar2 + 0x1000000,0x19); + local_48 = (int)uVar8; + uVar8 = VectorShiftRight((longlong)iVar1 * (longlong)*(int *)(this + 4) + 0x1000000,0x19); + *(int *)(this + 0xc) = local_48; + local_40 = (int)uVar8; + *(int *)(this + 8) = local_40; + iVar1 = (iVar3 + local_40) - (iVar4 + local_48) >> 1; + iVar2 = iVar3 + local_40 + iVar4 + local_48 >> 1; + iVar3 = FixedBiquad::ProcessSample((FixedBiquad *)(this + 0x28),iVar1); + iVar1 = iVar1 - iVar3; + piVar6[-1] = iVar2 + iVar1; + param_1[1] = iVar2 - iVar1; + param_1 = param_1 + 2; + piVar6 = piVar6 + 2; + } while (uVar7 != param_2); + } + } + else { + if (0 < param_2) { + iVar1 = 0; + piVar6 = param_1 + 1; + do { + iVar4 = piVar6[-1]; + iVar1 = iVar1 + 1; + iVar5 = param_1[1]; + iVar2 = TimeConstDelay::ProcessSample((int)(this + 0x10)); + iVar3 = TimeConstDelay::ProcessSample((int)(this + 0x1c)); + uVar8 = VectorShiftRight((longlong)*(int *)(this + 4) * (longlong)-iVar3 + 0x1000000,0x19) + ; + local_48 = (int)uVar8; + uVar8 = VectorShiftRight((longlong)iVar2 * (longlong)*(int *)(this + 4) + 0x1000000,0x19); + *(int *)(this + 0xc) = local_48; + local_40 = (int)uVar8; + *(int *)(this + 8) = local_40; + iVar2 = (iVar4 + local_40) - (iVar5 + local_48) >> 1; + iVar3 = iVar4 + local_40 + iVar5 + local_48 >> 1; + iVar4 = FixedBiquad::ProcessSample((FixedBiquad *)(this + 0x28),iVar2); + iVar2 = iVar2 - iVar4; + piVar6[-1] = iVar3 + iVar2; + param_1[1] = iVar3 - iVar2; + param_1 = param_1 + 2; + piVar6 = piVar6 + 2; + } while (iVar1 != param_2); + return; + } + } + } + return; +} diff --git a/src/effects/DepthSurround.h b/src/effects/DepthSurround.h new file mode 100644 index 0000000..46955e2 --- /dev/null +++ b/src/effects/DepthSurround.h @@ -0,0 +1,31 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_DEPTHSURROUND_H +#define VIPER_DEPTHSURROUND_H + + +#include "Stereo3DSurround.h" + +class DepthSurround { + short field_0x0; + bool enabled; + undefined field_0x3; + int field_0x4; + int field_0x8; + int field_0xc; + struct TimeConstDelay field_0x10; + struct TimeConstDelay field_0x1c; + struct FixedBiquad field_0x28; + +public: + void RefreshStrength(short param_1); + void SetSamplingRate(uint param_1); + DepthSurround(); + void SetStrength(short param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_DEPTHSURROUND_H diff --git a/src/effects/DiffSurround.cpp b/src/effects/DiffSurround.cpp new file mode 100644 index 0000000..13cbf00 --- /dev/null +++ b/src/effects/DiffSurround.cpp @@ -0,0 +1,179 @@ +// +// Created by mart on 2/12/21. +// + +#include "DiffSurround.h" + + +// DiffSurround::~DiffSurround() + +DiffSurround::~DiffSurround() { + WaveBuffer_I32 *pWVar1; + + pWVar1 = *(WaveBuffer_I32 **)&this->field_0xc; + *(undefined4 *)&this->field_0x8 = 0; + if (pWVar1 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(pWVar1); + operator_delete(pWVar1); + } + pWVar1 = *(WaveBuffer_I32 **)&this->field_0x10; + *(undefined4 *)&this->field_0xc = 0; + if (pWVar1 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(pWVar1); + operator_delete(pWVar1); + } + *(undefined4 *)&this->field_0x10 = 0; + return this; +} + + + +// DiffSurround::Reset() + +void DiffSurround::Reset() { + undefined4 in_cr0; + undefined4 in_cr1; + + if (*(WaveBuffer_I32 **)&this->field_0xc == nullptr) { + return; + } + if (*(int *)&this->field_0x10 == 0) { + return; + } + WaveBuffer_I32::Reset(*(WaveBuffer_I32 **)&this->field_0xc); + WaveBuffer_I32::Reset(*(WaveBuffer_I32 **)&this->field_0x10); + coprocessor_function(0xb,6,5,in_cr0,in_cr1,in_cr0); + WaveBuffer_I32::PushZeros + (*(WaveBuffer_I32 **)&this->field_0x10,SUB84(ROUND((double)(ulonglong)*(uint *)this),0)) + ; + return; +} + + + +// DiffSurround::DiffSurround() + +DiffSurround::DiffSurround() { + WaveBuffer_I32 *pWVar1; + + *(undefined4 *)this = 0xac44; + *(undefined4 *)&this->field_0x8 = 0; + *(undefined *)&this->field_0x4 = 0; + pWVar1 = (WaveBuffer_I32 *)operator_new(0x20); + WaveBuffer_I32::WaveBuffer_I32(pWVar1,1,0x1000); + *(WaveBuffer_I32 **)&this->field_0xc = pWVar1; + pWVar1 = (WaveBuffer_I32 *)operator_new(0x20); + WaveBuffer_I32::WaveBuffer_I32(pWVar1,1,0x1000); + *(WaveBuffer_I32 **)&this->field_0x10 = pWVar1; + Reset(this); + return this; +} + + + +// DiffSurround::SetEnable(bool) + +undefined4 DiffSurround::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0x4; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = *(char *)&this->field_0x4; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0x4 = param_1; + return 1; +} + + + +// DiffSurround::SetSamplingRate(unsigned int) + +void DiffSurround::SetSamplingRate(uint param_1) { + if (*(uint *)this == param_1) { + return; + } + *(uint *)this = param_1; + Reset(this); + return; +} + + + +// DiffSurround::SetDelayTime(float) + +void DiffSurround::SetDelayTime(float param_1) { + undefined4 in_r1; + bool in_ZR; + + if (in_ZR) { + return; + } + *(undefined4 *)&this->field_0x8 = in_r1; + Reset(this); + return; +} + + + +// DiffSurround::Process(int*, int) + +void DiffSurround::Process(int *param_1,int param_2) { + int iVar1; + int iVar2; + int iVar3; + int iVar4; + int *piVar5; + int *piVar6; + + if (*(char *)&this->field_0x4 == '\0') { + return; + } + if (*(WaveBuffer_I32 **)&this->field_0xc == nullptr) { + return; + } + if (*(int *)&this->field_0x10 == 0) { + return; + } + iVar2 = WaveBuffer_I32::PushZerosGetBuffer(*(WaveBuffer_I32 **)&this->field_0xc,param_2); + iVar3 = WaveBuffer_I32::PushZerosGetBuffer(*(WaveBuffer_I32 **)&this->field_0x10,param_2); + if (iVar2 == 0 || iVar3 == 0) { + Reset(this); + return; + } + iVar4 = 0; + iVar1 = param_2 * 2; + if (iVar1 < 1) { + WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)&this->field_0xc); + WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)&this->field_0x10); + } + else { + piVar5 = param_1; + do { + piVar6 = piVar5 + 2; + *(int *)(iVar2 + iVar4) = *piVar5; + *(int *)(iVar3 + iVar4) = piVar5[1]; + iVar4 = iVar4 + 4; + piVar5 = piVar6; + } while (piVar6 != param_1 + iVar1); + iVar2 = WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)&this->field_0xc); + iVar3 = WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)&this->field_0x10); + iVar4 = 0; + do { + *param_1 = *(int *)(iVar2 + iVar4); + piVar5 = (int *)(iVar3 + iVar4); + iVar4 = iVar4 + 4; + param_1[1] = *piVar5; + param_1 = param_1 + 2; + } while (iVar4 != ((iVar1 - 1U >> 1) + 1) * 4); + } + WaveBuffer_I32::PopSamples(*(WaveBuffer_I32 **)&this->field_0xc,param_2,false); + WaveBuffer_I32::PopSamples(*(WaveBuffer_I32 **)&this->field_0x10,param_2,false); + return; +} diff --git a/src/effects/DiffSurround.h b/src/effects/DiffSurround.h new file mode 100644 index 0000000..355f2e8 --- /dev/null +++ b/src/effects/DiffSurround.h @@ -0,0 +1,44 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_DIFFSURROUND_H +#define VIPER_DIFFSURROUND_H + + +#include "../libv4a_fx.so.h" + +class DiffSurround { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + +public: + ~DiffSurround(); + void Reset(); + DiffSurround(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(uint param_1); + void SetDelayTime(float param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_DIFFSURROUND_H diff --git a/src/effects/DynamicBass.cpp b/src/effects/DynamicBass.cpp new file mode 100644 index 0000000..c9140a2 --- /dev/null +++ b/src/effects/DynamicBass.cpp @@ -0,0 +1,214 @@ +// +// Created by mart on 2/12/21. +// + +#include "DynamicBass.h" + + +// DynamicBass::SetSamplingRate(unsigned int) + +void DynamicBass::SetSamplingRate(uint param_1) { + undefined8 uVar1; + float extraout_s2; + + this->field_0x10 = param_1; + PolesFilter::SetSamplingRate(&this->field_0x24,param_1); + uVar1 = PolesFilter::SetSamplingRate(&this->field_0x98,param_1); + FixedBiquad::SetLowPassParameter + (&this->field_0x10c,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2); + return; +} + + + +// DynamicBass::SetFilterXPassFrequency(int, int) + +void DynamicBass::SetFilterXPassFrequency(int param_1,int param_2) { + undefined8 uVar1; + float extraout_s2; + + this->field_0x0 = param_1; + this->field_0x4 = param_2; + PolesFilter::SetPassFilter(&this->field_0x24,param_1,param_2); + uVar1 = PolesFilter::SetSamplingRate(&this->field_0x24,this->field_0x10); + FixedBiquad::SetLowPassParameter + (&this->field_0x10c,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2); + return; +} + + + +// DynamicBass::SetFilterYPassFrequency(int, int) + +void DynamicBass::SetFilterYPassFrequency(int param_1,int param_2) { + this->field_0x8 = param_1; + this->field_0xc = param_2; + PolesFilter::SetPassFilter(&this->field_0x98,param_1,param_2); + PolesFilter::SetSamplingRate(&this->field_0x98,this->field_0x10); + return; +} + + + +// DynamicBass::SetSideGain(float, float) + +void DynamicBass::SetSideGain(int param_1,int param_2) { + this->field_0x20 = ROUND((float)param_1 * 3.355443e+07 + 0.5); + this->field_0x1c = ROUND((float)param_2 * 3.355443e+07 + 0.5); + return; +} + + + +// DynamicBass::SetBassGain(float) + +void DynamicBass::SetBassGain(int param_1) { + int iVar1; + undefined4 in_cr6; + undefined4 in_cr7; + float in_s0; + float in_s1; + float in_s2; + float fVar2; + + fVar2 = ROUND((float)param_1 * 3.355443e+07 + 0.5); + coprocessor_function(10,6,1,in_cr7,in_cr6,in_cr6); + this->field_0x18 = fVar2; + iVar1 = (int)SUB42(ROUND(fVar2),0); + if (iVar1 < 0x641) { + this->field_0x14 = iVar1; + } + else { + this->field_0x14 = 0x640; + } + FixedBiquad::SetLowPassParameter(&this->field_0x10c,in_s0,in_s1,in_s2); + return; +} + + + +// DynamicBass::Reset() + +void DynamicBass::Reset() { + undefined8 uVar1; + float extraout_s2; + + PolesFilter::~ZN11PolesFilter5ResetEv(&this->field_0x24); + uVar1 = PolesFilter::~ZN11PolesFilter5ResetEv(&this->field_0x98); + FixedBiquad::SetLowPassParameter + (&this->field_0x10c,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2); + return; +} + + + +// DynamicBass::DynamicBass() + +DynamicBass::DynamicBass() { + uint uVar1; + undefined8 uVar2; + float extraout_s2; + + PolesFilter::PolesFilter(&this->field_0x24); + PolesFilter::PolesFilter(&this->field_0x98); + FixedBiquad::FixedBiquad(&this->field_0x10c); + this->field_0x14 = 0; + SetSamplingRate(this,0xac44); + uVar1 = this->field_0x10; + this->field_0xc = 0x50; + if ((int)uVar1 < 0) { + uVar1 = uVar1 + 3; + } + this->field_0x18 = 0x2000000; + this->field_0x1c = 0x2000000; + this->field_0x20 = 0x2000000; + this->field_0x0 = 0x78; + this->field_0x4 = (int)uVar1 >> 2; + this->field_0x8 = 0x28; + PolesFilter::SetPassFilter(&this->field_0x24,0x78,(int)uVar1 >> 2); + uVar2 = PolesFilter::SetPassFilter(&this->field_0x98,this->field_0x8,this->field_0xc); + FixedBiquad::SetLowPassParameter + (&this->field_0x10c,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20),extraout_s2); + Reset(this); + return this; +} + + + +// DynamicBass::FilterSamples(int*, int) + +void DynamicBass::FilterSamples(int *param_1,int param_2) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + longlong lVar4; + int iVar5; + int *piVar6; + int iVar7; + int iVar8; + int iVar9; + int local_98; + uint local_58; + uint local_54; + int local_50; + int local_4c; + int local_48; + int local_44; + int local_40; + int local_3c; + int local_38; + int local_34; + int local_30; + int local_2c [2]; + + if ((int)this->field_0x0 < 0x79) { + if (0 < param_2 * 2) { + iVar7 = 0; + piVar6 = param_1 + 1; + do { + iVar9 = piVar6[-1]; + iVar7 = iVar7 + 2; + iVar8 = param_1[1]; + iVar5 = FixedBiquad::ProcessSample(&this->field_0x10c,iVar9 + iVar8); + piVar6[-1] = iVar9 + iVar5; + param_1[1] = iVar8 + iVar5; + piVar6 = piVar6 + 2; + param_1 = param_1 + 2; + } while (iVar7 + param_2 * -2 < 0 != SBORROW4(iVar7,param_2 * 2)); + return; + } + } + else { + if (0 < param_2 * 2) { + local_98 = 0; + piVar6 = param_1 + 1; + do { + local_98 = local_98 + 2; + PolesFilter::DoFilterLeft(&this->field_0x24,piVar6[-1],(int *)&local_58,&local_50,&local_48) + ; + PolesFilter::DoFilterRight + (&this->field_0x24,param_1[1],(int *)&local_54,&local_4c,&local_44); + lVar1 = (longlong)(int)local_58 * (longlong)(int)this->field_0x18 + 0x1000000; + lVar2 = (longlong)(int)this->field_0x18 * (longlong)(int)local_54 + 0x1000000; + local_58 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + local_54 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + PolesFilter::DoFilterLeft(&this->field_0x98,local_58,&local_40,&local_38,&local_30); + PolesFilter::DoFilterRight(&this->field_0x98,local_54,&local_3c,&local_34,local_2c); + lVar1 = (longlong)local_38 * (longlong)(int)this->field_0x20 + 0x1000000; + lVar2 = (longlong)(int)this->field_0x20 * (longlong)local_34 + 0x1000000; + lVar3 = (longlong)local_40 * (longlong)(int)this->field_0x1c + 0x1000000; + lVar4 = (longlong)(int)this->field_0x1c * (longlong)local_3c + 0x1000000; + piVar6[-1] = local_50 + + local_30 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7) + local_48; + param_1[1] = local_4c + + local_2c[0] + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7) + local_44; + param_1 = param_1 + 2; + piVar6 = piVar6 + 2; + } while (local_98 < param_2 * 2); + } + } + return; +} + diff --git a/src/effects/DynamicBass.h b/src/effects/DynamicBass.h new file mode 100644 index 0000000..2e834e8 --- /dev/null +++ b/src/effects/DynamicBass.h @@ -0,0 +1,35 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_DYNAMICBASS_H +#define VIPER_DYNAMICBASS_H + + +class DynamicBass { + undefined4 field_0x0; + int field_0x4; + int field_0x8; + int field_0xc; + uint field_0x10; + undefined4 field_0x14; + undefined4 field_0x18; + undefined4 field_0x1c; + undefined4 field_0x20; + struct PolesFilter field_0x24; + struct PolesFilter field_0x98; + struct FixedBiquad field_0x10c; + +public: + void SetSamplingRate(uint param_1); + void SetFilterXPassFrequency(int param_1,int param_2); + void SetFilterYPassFrequency(int param_1,int param_2); + void SetSideGain(int param_1,int param_2); + void SetBassGain(int param_1); + void Reset(); + DynamicBass(); + void FilterSamples(int *param_1,int param_2); +}; + + +#endif //VIPER_DYNAMICBASS_H diff --git a/src/effects/DynamicSystem.cpp b/src/effects/DynamicSystem.cpp new file mode 100644 index 0000000..df80dfe --- /dev/null +++ b/src/effects/DynamicSystem.cpp @@ -0,0 +1,131 @@ +// +// Created by mart on 2/12/21. +// + +#include "DynamicSystem.h" + +// DynamicSystem::DynamicSystem() + +DynamicSystem::DynamicSystem() { + DynamicBass::DynamicBass((DynamicBass *)this); + this->enabled = false; + this->samplerate = 0xac44; + DynamicBass::SetSamplingRate((DynamicBass *)this,0xac44); + DynamicBass::Reset((DynamicBass *)this); + return this; +} + + + +// DynamicSystem::SetSamplingRate(unsigned int) + +void DynamicSystem::SetSamplingRate(uint param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + DynamicBass::SetSamplingRate((DynamicBass *)this,param_1); + return; +} + + + +void DynamicSystem::~ZN13DynamicSystem10SetXCoeffsEjj(int param_1,int param_2) { + undefined8 uVar1; + float extraout_s2; + + this->field_0x0 = param_1; + this->field_0x4 = param_2; + PolesFilter::SetPassFilter(&this->field_0x24,param_1,param_2); + uVar1 = PolesFilter::SetSamplingRate(&this->field_0x24,this->field_0x10); + FixedBiquad::SetLowPassParameter + (&this->field_0x10c,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2); + return; +} + + + +void DynamicSystem::~ZN13DynamicSystem10SetYCoeffsEjj(int param_1,int param_2) { + this->field_0x8 = param_1; + this->field_0xc = param_2; + PolesFilter::SetPassFilter(&this->field_0x98,param_1,param_2); + PolesFilter::SetSamplingRate(&this->field_0x98,this->field_0x10); + return; +} + + + +void DynamicSystem::~ZN13DynamicSystem11SetSideGainEff(int param_1,int param_2) { + this->field_0x20 = ROUND((float)param_1 * 3.355443e+07 + 0.5); + this->field_0x1c = ROUND((float)param_2 * 3.355443e+07 + 0.5); + return; +} + + + +void DynamicSystem::~ZN13DynamicSystem11SetBassGainEf(int param_1) { + int iVar1; + undefined4 in_cr6; + undefined4 in_cr7; + float in_s0; + float in_s1; + float in_s2; + float fVar2; + + fVar2 = ROUND((float)param_1 * 3.355443e+07 + 0.5); + coprocessor_function(10,6,1,in_cr7,in_cr6,in_cr6); + this->field_0x18 = fVar2; + iVar1 = (int)SUB42(ROUND(fVar2),0); + if (iVar1 < 0x641) { + this->field_0x14 = iVar1; + } + else { + this->field_0x14 = 0x640; + } + FixedBiquad::SetLowPassParameter(&this->field_0x10c,in_s0,in_s1,in_s2); + return; +} + + + +// DynamicSystem::Reset() + +void DynamicSystem::Reset() { + DynamicBass::SetSamplingRate((DynamicBass *)this,this->samplerate); + DynamicBass::Reset((DynamicBass *)this); + return; +} + + + +// DynamicSystem::SetEnable(bool) + +undefined4 DynamicSystem::SetEnable(bool param_1) { + char cVar1; + + cVar1 = this->enabled; + if ((bool)cVar1 == false) { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = this->enabled; + } + if (param_1 == (bool)cVar1) { + return 0; + } + this->enabled = param_1; + return 1; +} + + + +// DynamicSystem::Process(int*, int) + +void DynamicSystem::Process(int *param_1,int param_2) { + if (this->enabled == false) { + return; + } + DynamicBass::FilterSamples((DynamicBass *)this,param_1,param_2); + return; +} diff --git a/src/effects/DynamicSystem.h b/src/effects/DynamicSystem.h new file mode 100644 index 0000000..66c2cf3 --- /dev/null +++ b/src/effects/DynamicSystem.h @@ -0,0 +1,41 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_DYNAMICSYSTEM_H +#define VIPER_DYNAMICSYSTEM_H + + +class DynamicSystem { + undefined4 field_0x0; + int field_0x4; + int field_0x8; + int field_0xc; + uint field_0x10; + undefined4 field_0x14; + undefined4 field_0x18; + undefined4 field_0x1c; + undefined4 field_0x20; + struct PolesFilter field_0x24; + struct PolesFilter field_0x98; + struct FixedBiquad field_0x10c; + int samplerate; // Created by retype action + bool enabled; // Created by retype action + undefined field_0x135; + undefined field_0x136; + undefined field_0x137; + +public: + DynamicSystem(); + void SetSamplingRate(uint param_1); + void ~ZN13DynamicSystem10SetXCoeffsEjj(int param_1,int param_2); + void ~ZN13DynamicSystem10SetYCoeffsEjj(int param_1,int param_2); + void ~ZN13DynamicSystem11SetSideGainEff(int param_1,int param_2); + void ~ZN13DynamicSystem11SetBassGainEf(int param_1); + void Reset(); + undefined4 SetEnable(bool param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_DYNAMICSYSTEM_H diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp new file mode 100644 index 0000000..ac02625 --- /dev/null +++ b/src/effects/Effect.cpp @@ -0,0 +1,527 @@ +// +// Created by mart on 2/12/21. +// + +#include +#include +#include "../libv4a_fx.so.h" +#include "Effect.h" + + +// Effect::Effect() + +Effect::Effect() { + *(undefined *)&this->field_0x4 = 0; + *(undefined *)&this->field_0x5 = 1; + this->samplerate = 0xac44; + memset(&this->field_0xc,0,0x40); + *(undefined *)&this->field_0x29 = 1; + this->field_0x28 = '\x01'; + this->field_0x14 = 0xac44; + *(undefined *)&this->field_0x49 = 0; + this->field_0x48 = '\x01'; + this->samplerate = 0xac44; + this->field_0x60 = nullptr; + this->field_0x64 = nullptr; + this->field_0x68 = nullptr; + this->field_0x18 = (int *)0x3; + this->field_0x38 = 3; + this->field_0x2a = 0x3f; + this->field_0x4a = 0x3f; +} + + + +// Effect::~Effect() + +Effect::~Effect() { + if (this->field_0x60 != nullptr) { + free(this->field_0x60); + } + this->field_0x60 = nullptr; + this->field_0x64 = nullptr; + this->field_0x68 = nullptr; +} + + + +// Effect::configure(void*) + +int Effect::configure(effect_config_t *param_1) { + int *piVar1; + int *piVar2; + int *piVar3; + int *piVar4; + int *piVar5; + int *piVar6; + int *piVar7; + int *piVar8; + int *piVar9; + void *pvVar10; + int *piVar11; + void *pvVar12; + int *piVar13; + uint uVar14; + int *piVar15; + uint uVar16; + undefined local_4b; + undefined local_2b; + + piVar1 = (int *)(param_1->inputCfg).buffer.frameCount; + piVar5 = (int *)(param_1->inputCfg).buffer.buffer; + piVar9 = (int *)(param_1->inputCfg).samplingRate; + piVar13 = (int *)(param_1->inputCfg).channels; + piVar2 = (int *)(param_1->inputCfg).bufferProvider.getBuffer; + piVar6 = (int *)(param_1->inputCfg).bufferProvider.releaseBuffer; + pvVar10 = (param_1->inputCfg).bufferProvider.cookie; + uVar14 = *(uint *)&(param_1->inputCfg).format; + piVar3 = (int *)(param_1->outputCfg).buffer.frameCount; + piVar7 = (int *)(param_1->outputCfg).buffer.buffer; + piVar11 = (int *)(param_1->outputCfg).samplingRate; + piVar15 = (int *)(param_1->outputCfg).channels; + piVar4 = (int *)(param_1->outputCfg).bufferProvider.getBuffer; + piVar8 = (int *)(param_1->outputCfg).bufferProvider.releaseBuffer; + pvVar12 = (param_1->outputCfg).bufferProvider.cookie; + uVar16 = *(uint *)&(param_1->outputCfg).format; + __android_log_print(4,"ViPER4Android_v2","Begin audio configure ..."); + __android_log_print(4,"ViPER4Android_v2","Checking input and output configuration ..."); + if (((uVar14 & 0x20000) != 0) && ((uVar16 & 0x20000) != 0)) { + if (piVar11 != piVar9) { + __android_log_print(4,"ViPER4Android_v2", + "ViPER4Android disabled, reason [in.SR = %d, out.SR = %d]",piVar9,piVar11) + ; + *(undefined *)&this->field_0x5 = 0; + return EINVAL; + } + if ((int *)0xf3c < piVar11 + -0x2b11) { + __android_log_print(4,"ViPER4Android_v2","ViPER4Android disabled, reason [SR out of range]"); + *(undefined *)&this->field_0x5 = 0; + return EINVAL; + } + this->samplerate = piVar11; + } + if (((uVar14 & 0x40000) != 0) && ((uVar16 & 0x40000) != 0)) { + if (piVar13 != piVar15) { + __android_log_print(4,"ViPER4Android_v2", + "ViPER4Android disabled, reason [in.CH = %d, out.CH = %d]",piVar13,piVar15 + ); + *(undefined *)&this->field_0x5 = 0; + return EINVAL; + } + if (piVar13 != (int *)0x3) { + __android_log_print(4,"ViPER4Android_v2","ViPER4Android disabled, reason [CH != 2]"); + *(undefined *)&this->field_0x5 = 0; + return EINVAL; + } + } + if (((uVar14 & 0x80000) != 0) && ((uVar16 & 0x80000) != 0)) { + if ((uVar14 & 0xfd) != 1) { + __android_log_print(4,"ViPER4Android_v2","ViPER4Android disabled, reason [in.FMT = %d]"); + __android_log_print(4,"ViPER4Android_v2","We only accept s16 and fixed.31 format"); + *(undefined *)&this->field_0x5 = 0; + return EINVAL; + } + if ((uVar16 & 0xfd) != 1) { + __android_log_print(4,"ViPER4Android_v2","ViPER4Android disabled, reason [out.FMT = %d]"); + __android_log_print(4,"ViPER4Android_v2","We only accept s16 and fixed.31 format"); + *(undefined *)&this->field_0x5 = 0; + return EINVAL; + } + } + __android_log_print(4,"ViPER4Android_v2","Input and output configuration checked."); + if ((uVar14 & 0x10000) != 0) { + this->field_0xc = piVar1; + this->field_0x10 = piVar5; + } + if ((uVar14 & 0x200000) != 0) { + this->field_0x1c = piVar2; + this->field_0x20 = piVar6; + this->field_0x24 = pvVar10; + } + if ((uVar14 & 0x20000) != 0) { + this->field_0x14 = piVar9; + } + if ((uVar14 & 0x40000) != 0) { + this->field_0x18 = piVar13; + } + if ((uVar14 & 0x80000) != 0) { + this->field_0x28 = (char)uVar14; + } + if ((uVar14 & 0x100000) != 0) { + local_4b = (undefined)(uVar14 >> 8); + *(undefined *)&this->field_0x29 = local_4b; + } + if ((uVar16 & 0x10000) != 0) { + this->field_0x2c = piVar3; + this->field_0x30 = piVar7; + } + if ((uVar16 & 0x200000) != 0) { + this->field_0x3c = piVar4; + this->field_0x40 = piVar8; + this->field_0x44 = pvVar12; + } + if ((uVar16 & 0x20000) != 0) { + this->samplerate = piVar11; + } + if ((uVar16 & 0x40000) != 0) { + this->field_0x38 = piVar15; + } + if ((uVar16 & 0x80000) != 0) { + this->field_0x48 = (char)uVar16; + } + if ((uVar16 & 0x100000) != 0) { + local_2b = (undefined)(uVar16 >> 8); + *(undefined *)&this->field_0x49 = local_2b; + } + __android_log_print(4,"ViPER4Android_v2","Audio configure finished"); + *(undefined *)&this->field_0x5 = 1; + return OK; +} + + + +// Effect::command(unsigned int, unsigned int, void*, unsigned int*, void*) + +int Effect::command(uint param_1,uint param_2,void *param_3,uint *param_4,void *param_5) { + int *piVar1; + int **ppiVar2; + int **ppiVar3; + char *pcVar4; + int *piVar5; + int *piVar6; + + switch(param_1) { + case 0: + *(undefined4 *)param_5 = 0; + return OK; + case 1: + goto LAB_0006f49c; + case 2: + break; + case 3: + *(undefined *)&this->field_0x4 = 1; + *(undefined4 *)param_5 = 0; + return OK; + case 4: + *(undefined *)&this->field_0x4 = 0; + *(undefined4 *)param_5 = 0; + return OK; + case 5: + LAB_0006f49c: + *(undefined4 *)param_5 = 0; + return OK; + case 6: + break; + case 7: + *(undefined4 *)param_5 = 0; + return OK; + case 8: + *(undefined4 *)param_5 = 0xffffffea; + *(undefined4 *)((int)param_5 + 8) = 0; + *param_4 = 0xc; + return OK; + case 9: + break; + case 10: + break; + case 0xb: + break; + case 0xc: + *(undefined4 *)param_5 = 0xffffffea; + return EINVAL; + case 0xd: + break; + case 0xe: + if (param_5 == nullptr) { + return EINVAL; + } + if (*param_4 != 0x40) { + return EINVAL; + } + ppiVar2 = &this->field_0xc; + do { + ppiVar3 = ppiVar2 + 4; + piVar5 = ppiVar2[1]; + piVar6 = ppiVar2[2]; + piVar1 = ppiVar2[3]; + *(int **)param_5 = *ppiVar2; + *(int **)((int)param_5 + 4) = piVar5; + *(int **)((int)param_5 + 8) = piVar6; + *(int **)((int)param_5 + 0xc) = piVar1; + param_5 = (int **)((int)param_5 + 0x10); + ppiVar2 = ppiVar3; + } while (ppiVar3 != (int **)&this->field_0x4c); + break; + case 0xf: + return EINVAL; + case 0x10: + return EINVAL; + case 0x11: + return EINVAL; + case 0x12: + return EINVAL; + case 0x13: + break; + case 0x14: + if ((param_3 == nullptr) && (param_2 == 8)) { + if (cRam00000000 == '\0') { + pcVar4 = "false"; + } + else { + pcVar4 = "true"; + } + __android_log_print(4,"ViPER4Android_v2","Effect offload status = %s",pcVar4,0); + return EINVAL; + } + default: + return EINVAL; + } + return OK; +} + + + +// Effect::process(audio_buffer_s*, audio_buffer_s*) + +int Effect::process(audio_buffer_s *param_1,audio_buffer_s *param_2) { + char cVar1; + char cVar2; + int *piVar3; + void *pvVar4; + int EVar5; + short *psVar6; + int *piVar7; + short *psVar8; + short *psVar9; + int *piVar10; + int *piVar11; + int *piVar12; + int *piVar13; + int *piVar14; + int *piVar15; + undefined4 uVar16; + undefined4 uVar17; + ProcessUnit_FX *pPVar18; + int *piVar19; + uint uVar20; + int *local_38; + int *local_34; + int *local_30; + int *local_2c; + + if (*(char *)&this->field_0x5 == '\0') { + return EINVAL; + } + uVar16 = this->field_0x24; + piVar12 = this->field_0x20; + uVar17 = this->field_0x44; + local_38 = nullptr; + local_34 = nullptr; + piVar15 = this->field_0x2c; + piVar14 = this->field_0x30; + piVar10 = this->field_0x1c; + piVar19 = this->field_0x3c; + piVar13 = this->field_0x40; + cVar1 = this->field_0x28; + cVar2 = this->field_0x48; + if (param_1 == nullptr) { + piVar11 = (int *)param_1; + piVar7 = this->field_0xc; + piVar3 = this->field_0x10; + if ((((this->field_0x10 == nullptr) && + (piVar11 = piVar10, piVar7 = local_38, piVar3 = local_34, piVar10 != nullptr)) && + (piVar11 = piVar12, piVar12 != nullptr)) && + ((*(code *)piVar10)(uVar16,&local_38), piVar11 = local_34, piVar7 = local_38, + piVar3 = local_34, local_34 != nullptr)) { + piVar11 = (int *)0x1; + } + } + else { + piVar11 = nullptr; + piVar7 = *(int **)param_1; + piVar3 = *(int **)(param_1 + 4); + } + local_34 = piVar3; + local_38 = piVar7; + local_30 = nullptr; + local_2c = nullptr; + if (param_2 == nullptr) { + piVar10 = (int *)param_2; + piVar7 = piVar15; + if (((piVar14 == nullptr) && + (piVar10 = piVar19, piVar15 = piVar19, piVar7 = local_30, piVar14 = local_2c, + piVar19 != nullptr)) && + ((piVar10 = piVar13, piVar15 = piVar13, piVar13 != nullptr && + ((*(code *)piVar19)(uVar17,&local_30), piVar10 = local_2c, piVar15 = local_30, + piVar7 = local_30, piVar14 = local_2c, local_2c != nullptr)))) { + piVar10 = (int *)0x1; + } + } + else { + piVar10 = nullptr; + piVar15 = *(int **)param_2; + piVar7 = *(int **)param_2; + piVar14 = *(int **)(param_2 + 4); + } + local_2c = piVar14; + local_30 = piVar7; + piVar14 = local_38; + if (local_38 != piVar15) { + LAB_0006f694: + if (piVar11 != nullptr) { + (*(code *)piVar12)(uVar16,&local_38); + } + LAB_0006f69c: + if (piVar10 != nullptr) { + (*(code *)piVar13)(uVar17,&local_30); + } + return EINVAL; + } + if (piVar15 == nullptr) { + joined_r0x0006f6bc: + if (piVar11 != nullptr) { + (*(code *)piVar12)(uVar16,&local_38); + } + LAB_0006f6c0: + if (piVar10 != nullptr) { + (*(code *)piVar13)(uVar17,&local_30); + } + return OK; + } + if ((local_34 == nullptr) || (local_2c == nullptr)) goto LAB_0006f694; + if (cVar2 == '\x01' && cVar1 == '\x01') { + if (local_34 != local_2c) { + memcpy(local_2c,local_34,(int)piVar15 << 2); + } + if (this->field_0x68 != nullptr) { + EVar5 = ProcessUnit_FX::processBuffer(this->field_0x68,(short *)local_2c,(int)piVar15); + goto LAB_0006f868; + } + } + else { + uVar20 = (uint)(cVar2 == '\x03' && cVar1 == '\x03'); + if (uVar20 == 0) { + if (cVar2 != '\x03' || cVar1 != '\x01') { + if (cVar1 != '\x03' || cVar2 != '\x01') { + if (piVar11 != nullptr) { + (*(code *)piVar12)(uVar16,&local_38); + } + goto LAB_0006f69c; + } + if ((local_34 != local_2c) && (0 < (int)piVar15 * 2)) { + piVar19 = local_34 + -1; + piVar14 = local_2c; + do { + piVar19 = piVar19 + 1; + piVar7 = (int *)((int)piVar14 + 2); + *(short *)piVar14 = (short)((uint)*piVar19 >> 0x10); + piVar14 = piVar7; + } while (piVar7 != local_2c + (int)piVar15); + } + if (this->field_0x68 != nullptr) { + EVar5 = ProcessUnit_FX::processBuffer(this->field_0x68,(short *)local_2c,(int)piVar15); + goto LAB_0006f868; + } + goto LAB_0006f9a8; + } + if ((local_34 != local_2c) && (0 < (int)piVar15 * 2)) { + do { + *(int *)((int)local_2c + uVar20 * 2) = (int)*(short *)((int)local_34 + uVar20) << 0x10; + uVar20 = uVar20 + 2; + } while (uVar20 != (int)piVar15 * 4); + } + if ((int)this->field_0x64 < (int)piVar15) { + if (this->field_0x60 != nullptr) { + free(this->field_0x60); + } + this->field_0x60 = nullptr; + LAB_0006f93c: + pvVar4 = valloc((int)piVar14 << 2); + this->field_0x60 = pvVar4; + this->field_0x64 = piVar15; + if (pvVar4 == nullptr) { + this->field_0x64 = nullptr; + if (piVar11 != nullptr) { + (*(code *)piVar12)(uVar16,&local_38); + } + goto LAB_0006f6c0; + } + } + else { + if (this->field_0x60 == nullptr) goto LAB_0006f93c; + } + pPVar18 = this->field_0x68; + if (pPVar18 != nullptr) { + memcpy(this->field_0x60,local_34,(int)piVar14 << 2); + EVar5 = ProcessUnit_FX::processBuffer(pPVar18,(short *)this->field_0x60,(int)piVar15); + psVar6 = (short *)this->field_0x60; + piVar14 = local_2c; + psVar9 = psVar6; + do { + psVar8 = psVar9 + 1; + *piVar14 = (int)*psVar9 << 0x10; + piVar14 = piVar14 + 1; + psVar9 = psVar8; + } while (psVar8 != psVar6 + (int)piVar15 * 2); + goto LAB_0006f868; + } + } + else { + if (local_34 != local_2c) { + memcpy(local_2c,local_34,(int)piVar15 << 3); + } + if ((int)this->field_0x64 < (int)piVar15) { + if (this->field_0x60 != nullptr) { + free(this->field_0x60); + } + this->field_0x60 = nullptr; + LAB_0006f788: + pvVar4 = valloc((int)piVar14 << 2); + this->field_0x60 = pvVar4; + this->field_0x64 = piVar15; + if (pvVar4 == nullptr) { + this->field_0x64 = nullptr; + goto joined_r0x0006f6bc; + } + } + else { + if (this->field_0x60 == nullptr) goto LAB_0006f788; + } + pPVar18 = this->field_0x68; + if (pPVar18 != nullptr) { + psVar6 = (short *)this->field_0x60; + piVar14 = local_2c; + psVar9 = psVar6; + do { + psVar8 = psVar9 + 1; + *psVar9 = (short)((uint)*piVar14 >> 0x10); + piVar14 = piVar14 + 1; + psVar9 = psVar8; + } while (psVar8 != psVar6 + (int)piVar15 * 2); + EVar5 = ProcessUnit_FX::processBuffer(pPVar18,psVar6,(int)piVar15); + psVar6 = (short *)this->field_0x60; + piVar14 = local_2c; + psVar9 = psVar6; + do { + psVar8 = psVar9 + 1; + *piVar14 = (int)*psVar9 << 0x10; + piVar14 = piVar14 + 1; + psVar9 = psVar8; + } while (psVar8 != psVar6 + (int)piVar15 * 2); + goto LAB_0006f868; + } + } + } + LAB_0006f9a8: + EVar5 = OK; + LAB_0006f868: + if (piVar11 != nullptr) { + (*(code *)piVar12)(uVar16,&local_38); + } + if (piVar10 != nullptr) { + (*(code *)piVar13)(uVar17,&local_30); + return EVar5; + } + return EVar5; +} + diff --git a/src/effects/Effect.h b/src/effects/Effect.h new file mode 100644 index 0000000..f97143c --- /dev/null +++ b/src/effects/Effect.h @@ -0,0 +1,69 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_EFFECT +#define VIPER_EFFECT + + +class Effect{ + undefined4 field_0x0; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined4 field_0x8; + int * field_0xc; + int * field_0x10; + int field_0x14; + int * field_0x18; + int * field_0x1c; + int * field_0x20; + undefined4 field_0x24; + char field_0x28; + undefined field_0x29; + undefined2 field_0x2a; + int * field_0x2c; + int * field_0x30; + undefined4 samplerate; + undefined4 field_0x38; + int * field_0x3c; + int * field_0x40; + undefined4 field_0x44; + char field_0x48; + undefined field_0x49; + undefined2 field_0x4a; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + void * field_0x60; + int * field_0x64; + struct ProcessUnit_FX * field_0x68; + +public: + Effect(); + ~Effect(); + int configure(effect_config_t *param_1); + int command(uint param_1,uint param_2,void *param_3,uint *param_4,void *param_5); + virtual int process(audio_buffer_s *param_1,audio_buffer_s *param_2); +}; + + +#endif //VIPER_EFFECT diff --git a/src/effects/FETCompressor.cpp b/src/effects/FETCompressor.cpp new file mode 100644 index 0000000..fcfce49 --- /dev/null +++ b/src/effects/FETCompressor.cpp @@ -0,0 +1,463 @@ +// +// Created by mart on 2/12/21. +// + +#include "FETCompressor.h" + +// FETCompressor::~FETCompressor() + +FETCompressor::~FETCompressor() { + return; +} + + + +// FETCompressor::SetParameter(int, float) + +void FETCompressor::SetParameter(int param_1,float param_2) { + undefined4 uVar1; + int in_r1; + float in_r2; + undefined uVar2; + int iVar3; + char cVar4; + bool bVar5; + char cVar6; + undefined4 in_cr6; + undefined4 in_cr7; + float in_s1; + float fVar7; + + iVar3 = param_1 + in_r1 * 4; + *(float *)(iVar3 + 4) = in_r2; + cVar6 = SBORROW4(in_r1,0x10); + cVar4 = in_r1 + -0x10 < 0; + bVar5 = in_r1 == 0x10; + switch(in_r1) { + case 0: + if (in_r1 < 0x10) { + iVar3 = 0; + } + uVar2 = (undefined)iVar3; + if (0xf < in_r1) { + uVar2 = 1; + } + *(undefined *)(param_1 + 0x4c) = uVar2; + return; + case 1: + uVar1 = 0x41200000; + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr6); + fVar7 = powf(param_2,in_s1); + logf(fVar7); + *(undefined4 *)(param_1 + 100) = uVar1; + return; + case 2: + *(float *)(param_1 + 0x74) = 0.0 - in_r2; + return; + case 3: + uVar1 = 0x41200000; + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr6); + fVar7 = powf(param_2,in_s1); + logf(fVar7); + *(undefined4 *)(param_1 + 0x68) = uVar1; + return; + case 4: + if (in_r1 < 0x10) { + iVar3 = 0; + } + uVar2 = (undefined)iVar3; + if (0xf < in_r1) { + uVar2 = 1; + } + *(undefined *)(param_1 + 0x4d) = uVar2; + return; + case 5: + uVar1 = 0x41200000; + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr6); + fVar7 = powf(param_2,in_s1); + logf(fVar7); + *(undefined4 *)(param_1 + 0x70) = uVar1; + return; + case 6: + if (in_r1 < 0x10) { + iVar3 = 0; + } + uVar2 = (undefined)iVar3; + if (0xf < in_r1) { + uVar2 = 1; + } + *(undefined *)(param_1 + 0x4e) = uVar2; + return; + case 7: + fVar7 = in_r2 * 7.600903 - 9.21034; + expf(param_2); + iVar3 = *(int *)param_1; + *(float *)(param_1 + 0x80) = fVar7; + if (bVar5 || cVar4 != cVar6) { + iVar3 = 0x3f800000; + } + if (!bVar5 && cVar4 == cVar6) { + iVar3 = FUN_00067ef8((float)(longlong)iVar3); + } + *(int *)(param_1 + 0x84) = iVar3; + return; + case 8: + if (in_r1 < 0x10) { + iVar3 = 0; + } + uVar2 = (undefined)iVar3; + if (0xf < in_r1) { + uVar2 = 1; + } + *(undefined *)(param_1 + 0x4f) = uVar2; + return; + case 9: + fVar7 = in_r2 * 5.991465 - 5.298317; + expf(param_2); + iVar3 = *(int *)param_1; + *(float *)(param_1 + 0x88) = fVar7; + if (bVar5 || cVar4 != cVar6) { + iVar3 = 0x3f800000; + } + if (!bVar5 && cVar4 == cVar6) { + iVar3 = FUN_00067ef8((float)(longlong)iVar3); + } + *(int *)(param_1 + 0x8c) = iVar3; + return; + case 10: + if (in_r1 < 0x10) { + iVar3 = 0; + } + uVar2 = (undefined)iVar3; + if (0xf < in_r1) { + uVar2 = 1; + } + *(undefined *)(param_1 + 0x50) = uVar2; + return; + case 0xb: + *(float *)(param_1 + 0x90) = in_r2 * 4.0 + 0.0; + return; + case 0xc: + fVar7 = in_r2 * 7.600903 - 9.21034; + expf(param_2); + *(float *)(param_1 + 0x94) = fVar7; + return; + case 0xd: + fVar7 = in_r2 * 5.991465 - 5.298317; + expf(param_2); + *(float *)(param_1 + 0x98) = fVar7; + return; + case 0xe: + fVar7 = in_r2 * 5.991465 - 5.298317; + expf(param_2); + iVar3 = *(int *)param_1; + *(float *)(param_1 + 0x9c) = fVar7; + if (bVar5 || cVar4 != cVar6) { + iVar3 = 0x3f800000; + } + if (!bVar5 && cVar4 == cVar6) { + iVar3 = FUN_00067ef8((float)(longlong)iVar3); + } + *(int *)(param_1 + 0xa0) = iVar3; + return; + case 0xf: + fVar7 = in_r2 * 1.386294 + 0.0; + expf(param_2); + iVar3 = *(int *)param_1; + *(float *)(param_1 + 0xa4) = fVar7; + if (bVar5 || cVar4 != cVar6) { + iVar3 = 0x3f800000; + } + if (!bVar5 && cVar4 == cVar6) { + iVar3 = FUN_00067ef8((float)(longlong)iVar3); + } + *(int *)(param_1 + 0xa8) = iVar3; + return; + case 0x10: + if (in_r1 < 0x10) { + iVar3 = 0; + } + uVar2 = (undefined)iVar3; + if (0xf < in_r1) { + uVar2 = 1; + } + *(undefined *)(param_1 + 0xac) = uVar2; + } + return; +} + + + +// FETCompressor::GetParameter(int) + +float FETCompressor::GetParameter(int param_1) { + return this->parameters[param_1]; +} + + + +// FETCompressor::GetParameterDefault(int) + +float FETCompressor::GetParameterDefault(int param_1) { + if ((uint)param_1 < 0x11) { + return FLOAT_ARRAY_000ce870[param_1]; + } + return 0.0; +} + + + +// WARNING: Removing unreachable block (ram,0x000682cc) +// FETCompressor::GetMeter(int) + +float FETCompressor::GetMeter(int param_1) { + bool bVar1; + + if (param_1 != 0) { + return 0.0; + } + bVar1 = this->field_0x4c == '\0'; + if ((!bVar1) && (bVar1)) { + return ((0.0 - (float)this->field_0x58) - DAT_000d5894) / (0.0 - DAT_000d5894); + } + return 1.0; +} + + + +// FETCompressor::Reset() + +void FETCompressor::Reset() { + undefined4 uVar1; + + uVar1 = FUN_00067ef8((float)(longlong)this->samplerate,0x3d4ccccd); + this->field_0x48 = uVar1; + this->field_0x60 = this->field_0x64; + this->field_0x6c = this->field_0x70; + this->field_0x78 = 0x358637bd; + this->field_0x7c = 0x358637bd; + this->field_0x54 = 0; + this->field_0x58 = 0; + this->field_0x5c = 0; + return; +} + + + +// FETCompressor::FETCompressor() + +FETCompressor::FETCompressor() { + int iVar1; + float fVar2; + + iVar1 = 0; + this->samplerate = 0xac44; + do { + fVar2 = (float)GetParameterDefault(this,iVar1); + iVar1 = iVar1 + 1; + SetParameter((int)this,fVar2); + } while (iVar1 != 0x11); + Reset(this); + return this; +} + + + +// FETCompressor::SetSamplingRate(int) + +void FETCompressor::SetSamplingRate(int param_1) { + int iVar1; + float fVar2; + + iVar1 = 0; + this->samplerate = param_1; + do { + fVar2 = (float)GetParameter(this,iVar1); + iVar1 = iVar1 + 1; + SetParameter((int)this,fVar2); + } while (iVar1 != 0x11); + Reset(this); + return; +} + + + +// WARNING: Removing unreachable block (ram,0x0006850c) +// WARNING: Removing unreachable block (ram,0x00068520) +// WARNING: Removing unreachable block (ram,0x00068624) +// WARNING: Removing unreachable block (ram,0x0006852c) +// FETCompressor::ProcessSidechain(float) + +void FETCompressor::ProcessSidechain(float param_1) { + void *pFVar1; + FETCompressor *in_r1; + bool in_NG; + bool in_ZR; + char in_OV; + char cVar1; + char cVar2; + bool bVar3; + undefined uVar4; + undefined4 in_cr4; + undefined4 in_cr5; + undefined4 in_cr6; + undefined4 in_cr7; + undefined4 in_cr8; + float extraout_s0; + float extraout_s0_00; + float fVar5; + float fVar6; + float in_s15; + float fVar7; + float fVar8; + float fVar9; + float fVar10; + + coprocessor_function(10,6,0,in_cr7,in_cr8,in_cr8); + if (in_ZR || in_NG != (bool)in_OV) { + in_s15 = 1e-06; + } + fVar8 = (float)this->field_0x84; + fVar5 = (float)this->field_0x7c + (in_s15 - (float)this->field_0x7c) * (float)this->field_0xa0; + fVar9 = this->field_0x80; + if (in_NG) { + in_s15 = (float)this->field_0x78 + (float)this->field_0xa0 * (in_s15 - (float)this->field_0x78); + } + bVar3 = *(char *)&this->field_0x4f != '\0'; + this->field_0x7c = fVar5; + this->field_0x78 = in_s15; + fVar5 = in_s15 / fVar5; + pFVar1 = this; + if (bVar3) { + param_1 = (float)this->samplerate; + fVar9 = (this->field_0x94 + this->field_0x94) / fVar5; + if (bVar3) { + pFVar1 = (void *)FUN_00067ef8((float)(longlong)(int)param_1,fVar9); + param_1 = extraout_s0; + fVar8 = extraout_s0; + } + else { + fVar8 = 1.0; + } + } + fVar10 = (float)this->field_0x8c; + cVar2 = '\0'; + uVar4 = *(char *)&this->field_0x50 == '\0'; + cVar1 = '\0'; + if (!(bool)uVar4) { + param_1 = (float)this->samplerate; + if ((bool)uVar4) { + fVar10 = 1.0; + } + else { + pFVar1 = (void *)FUN_00067ef8((float)(longlong)(int)param_1, + (this->field_0x98 + this->field_0x98) / fVar5 - fVar9); + param_1 = extraout_s0_00; + fVar10 = extraout_s0_00; + } + } + if ((bool)uVar4 || cVar2 != cVar1) { + pFVar1 = (FETCompressor *)0x358637bd; + } + if (!(bool)uVar4 && cVar2 == cVar1) { + pFVar1 = in_r1; + } + fVar5 = logf(param_1); + fVar9 = (float)this->field_0x60; + bVar3 = *(char *)&this->field_0x4d == '\0'; + if (bVar3) { + coprocessor_function(10,6,4,in_cr6,in_cr6,in_cr5); + fVar6 = (float)this->field_0x5c; + coprocessor_function(10,6,0,in_cr5,in_cr6,in_cr4); + coprocessor_function(10,6,4,in_cr6,in_cr6,in_cr4); + } + else { + fVar6 = (float)this->field_0x5c; + coprocessor_function(10,6,5,in_cr6,in_cr6,in_cr5); + if (!bVar3) { + coprocessor_function(10,6,1,in_cr5,in_cr6,in_cr5); + } + } + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr5); + fVar7 = (float)pFVar1 - fVar9; + if (bVar3) { + fVar7 = (float)this->field_0x54 + (((float)pFVar1 - fVar9) - (float)this->field_0x54) * fVar10; + } + this->field_0x54 = fVar7; + fVar8 = (float)this->field_0x58 + (fVar7 - (float)this->field_0x58) * fVar8; + this->field_0x58 = fVar8; + this->field_0x5c = fVar6 + (((0.0 - fVar8) - fVar9) - fVar6) * (float)this->field_0xa8; + if (*(char *)&this->field_0x4e != '\0') { + bVar3 = *(char *)&this->field_0xac != '\0'; + if (bVar3) { + fVar8 = (float)pFVar1 - fVar8; + if (bVar3) { + fVar8 = (fVar8 - fVar9) + 0.00115127; + } + if (bVar3) { + this->field_0x5c = fVar8; + } + } + expf(fVar5); + return; + } + expf(fVar5); + return; +} + + + +// FETCompressor::Process(int*, int) + +void FETCompressor::Process(int *param_1,int param_2) { + longlong lVar1; + FETCompressor *pFVar2; + int *piVar3; + int iVar4; + undefined4 in_cr7; + undefined4 in_cr8; + float in_s0; + float extraout_s0; + float fVar5; + float fVar6; + + if (param_2 * 2 < 1) { + fVar5 = (float)this->field_0x60; + fVar6 = (float)this->field_0x6c; + } + else { + piVar3 = param_1 + 1; + iVar4 = 0; + do { + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr8); + coprocessor_function(10,2,0,in_cr7,in_cr7,in_cr8); + pFVar2 = this; + ProcessSidechain(this,in_s0); + if (this->field_0x4c != '\0') { + fVar5 = ROUND((float)pFVar2 * 3.355443e+07 + 0.5); + lVar1 = (longlong)piVar3[-1] * (longlong)(int)fVar5 + 0x1000000; + piVar3[-1] = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + lVar1 = (longlong)(int)fVar5 * (longlong)param_1[1] + 0x1000000; + param_1[1] = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + } + iVar4 = iVar4 + 2; + param_1 = param_1 + 2; + piVar3 = piVar3 + 2; + fVar5 = (float)this->field_0x60 + + ((float)this->field_0x64 - (float)this->field_0x60) * (float)this->field_0x48; + fVar6 = (float)this->field_0x6c + + (float)this->field_0x48 * ((float)this->field_0x70 - (float)this->field_0x6c); + this->field_0x60 = fVar5; + this->field_0x6c = fVar6; + in_s0 = extraout_s0; + } while (iVar4 + param_2 * -2 < 0 != SBORROW4(iVar4,param_2 * 2)); + } + this->field_0x58 = ((float)this->field_0x58 + 9.999999e-19) - 9.999999e-19; + this->field_0x54 = ((float)this->field_0x54 + 9.999999e-19) - 9.999999e-19; + this->field_0x5c = ((float)this->field_0x5c + 9.999999e-19) - 9.999999e-19; + this->field_0x7c = ((float)this->field_0x7c + 9.999999e-19) - 9.999999e-19; + this->field_0x78 = ((float)this->field_0x78 + 9.999999e-19) - 9.999999e-19; + this->field_0x60 = (fVar5 + 9.999999e-19) - 9.999999e-19; + this->field_0x6c = (fVar6 + 9.999999e-19) - 9.999999e-19; + return; +} diff --git a/src/effects/FETCompressor.h b/src/effects/FETCompressor.h new file mode 100644 index 0000000..e46d6ef --- /dev/null +++ b/src/effects/FETCompressor.h @@ -0,0 +1,62 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_FETCOMPRESSOR_H +#define VIPER_FETCOMPRESSOR_H + + +class FETCompressor { + int samplerate; + float parameters[17]; // Created by retype action + undefined4 field_0x48; + char field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined4 field_0x54; + undefined4 field_0x58; + undefined4 field_0x5c; + undefined4 field_0x60; + undefined4 field_0x64; + undefined4 field_0x68; + undefined4 field_0x6c; + undefined4 field_0x70; + float field_0x74; + undefined4 field_0x78; + undefined4 field_0x7c; + float field_0x80; + int field_0x84; + float field_0x88; + int field_0x8c; + float field_0x90; + float field_0x94; + float field_0x98; + float field_0x9c; + int field_0xa0; + float field_0xa4; + int field_0xa8; + undefined field_0xac; + undefined field_0xad; + undefined field_0xae; + undefined field_0xaf; + +public: + ~FETCompressor(); + void SetParameter(int param_1,float param_2); + float GetParameter(int param_1); + float GetParameterDefault(int param_1); + float GetMeter(int param_1); + void Reset(); + FETCompressor(); + void SetSamplingRate(int param_1); + void ProcessSidechain(float param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_FETCOMPRESSOR_H diff --git a/src/effects/FIREqualizer.cpp b/src/effects/FIREqualizer.cpp new file mode 100644 index 0000000..e233ad0 --- /dev/null +++ b/src/effects/FIREqualizer.cpp @@ -0,0 +1,250 @@ +// +// Created by mart on 2/12/21. +// + +#include "FIREqualizer.h" + +// FIREqualizer::~FIREqualizer() + +FIREqualizer::~FIREqualizer() { + if ((void *)this->field_0x0 != nullptr) { + operator_delete((void *)this->field_0x0); + } + this->field_0x0 = 0; + return this; +} + + + +// FIREqualizer::SetBandLevel(unsigned int, float) + +void FIREqualizer::SetBandLevel(uint param_1,float param_2) { + float in_r2; + float fVar1; + + if (this->field_0x0 == 0) { + return; + } + if (9 < param_1) { + return; + } + if (9 < (int)param_1) { + in_r2 = in_r2 + in_r2; + } + fVar1 = ROUND((in_r2 + 1.0) * 3.355443e+07 + 0.5); + *(uint *)(this->field_0x0 + (9 - param_1) * 4) = (uint)fVar1 & ~((int)fVar1 >> 0x1f); + return; +} + + + +// FIREqualizer::Reset() + +void FIREqualizer::Reset() { + if (this->field_0x0 == 0) { + return; + } + memset((void *)(this->field_0x0 + 0x28),0,0x400); + memset((void *)(this->field_0x0 + 0x428),0,0x400); + memset((void *)(this->field_0x0 + 0x828),0,0x400); + memset((void *)(this->field_0x0 + 0xc28),0,0x400); + memset((void *)(this->field_0x0 + 0x1028),0,0x48); + memset((void *)(this->field_0x0 + 0x1070),0,0x48); + *(undefined4 *)(this->field_0x0 + 0x10b8) = 0; + return; +} + + + +// FIREqualizer::SetEnable(bool) + +undefined4 FIREqualizer::SetEnable(bool param_1) { + bool cVar1; + + cVar1 = this->enabled; + if (cVar1 == false) { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = this->enabled; + } + if (param_1 == cVar1) { + return 0; + } + this->enabled = param_1; + return 1; +} + + + +// FIREqualizer::SetSamplingRate(unsigned int) + +void FIREqualizer::SetSamplingRate(uint param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + Reset(this); + return; +} + + + +// FIREqualizer::FIREqualizer() + +FIREqualizer::FIREqualizer() { + void *__s; + uint uVar1; + uint uVar2; + float extraout_s0; + float fVar3; + + __s = operator_new(0x10c0); + memset(__s,0,0x10c0); + this->field_0x0 = (int)__s; + uVar1 = 0; + fVar3 = extraout_s0; + do { + uVar2 = uVar1 + 1; + fVar3 = (float)SetBandLevel(this,uVar1,fVar3); + uVar1 = uVar2; + } while (uVar2 != 10); + Reset(this); + this->samplerate = 0; + SetSamplingRate(this,0xac44); + this->enabled = false; + return this; +} + + + +// FIREqualizer::Process(int*, int) + +void FIREqualizer::Process(int *param_1,int param_2) { + int *piVar1; + uint *puVar2; + int *piVar3; + longlong lVar4; + longlong lVar5; + int *piVar6; + uint uVar7; + int iVar8; + uint uVar9; + uint uVar10; + uint uVar11; + int iVar12; + uint uVar13; + int iVar14; + uint *puVar15; + int *piVar16; + uint uVar17; + int *local_90; + int *local_8c; + uint local_84; + uint local_68 [8]; + int local_48; + uint local_44 [9]; + + piVar16 = (int *)this->field_0x0; + if (((piVar16 != nullptr) && (this->enabled != false)) && (param_2 << 1 != 0)) { + uVar9 = piVar16[0x42e]; + local_84 = 0; + local_90 = param_1; + local_8c = param_1 + 1; + do { + piVar6 = piVar16 + uVar9; + iVar8 = 0; + iVar12 = piVar6[0x20a]; + iVar14 = piVar6[0x30a]; + piVar6[0x20a] = local_8c[-1]; + piVar6[0x30a] = local_90[1]; + piVar6 = piVar16; + do { + piVar1 = (int *)((int)&DAT_000ce550 + iVar8); + uVar10 = piVar6[0x40a]; + iVar8 = iVar8 + 4; + uVar13 = (piVar16 + (uVar9 + *piVar1 & 0xff))[0x20a]; + uVar11 = (piVar16 + (uVar9 + *piVar1 & 0xff))[0x30a]; + piVar6[0x40a] = uVar10 + uVar13; + piVar6[0x40b] = piVar6[0x40b] + ((int)uVar13 >> 0x1f) + (uint)CARRY4(uVar10,uVar13); + uVar10 = piVar6[0x41c]; + piVar6[0x41c] = uVar10 + uVar11; + piVar6[0x41d] = piVar6[0x41d] + ((int)uVar11 >> 0x1f) + (uint)CARRY4(uVar10,uVar11); + piVar6 = piVar6 + 2; + } while (iVar8 != 0x24); + iVar8 = 0; + piVar6 = piVar16; + uVar10 = 0; + do { + puVar15 = (uint *)(piVar6 + 0x40a); + piVar1 = piVar6 + 0x40b; + uVar17 = uVar10 + 1; + puVar2 = (uint *)(piVar6 + 0x41c); + piVar3 = piVar6 + 0x41d; + piVar6 = piVar6 + 2; + uVar11 = *puVar15 >> (uVar17 & 0xff) | *piVar1 << (0x20 - uVar17 & 0xff); + uVar13 = *puVar2 >> (uVar17 & 0xff) | *piVar3 << (0x20 - uVar17 & 0xff); + if (-1 < (int)(uVar10 - 0x1f)) { + uVar11 = uVar11 | *piVar1 >> (uVar10 - 0x1f & 0xff); + } + if (-1 < (int)(uVar10 - 0x1f)) { + uVar13 = uVar13 | *piVar3 >> (uVar10 - 0x1f & 0xff); + } + *(uint *)((int)local_68 + iVar8) = uVar11; + *(uint *)((int)local_44 + iVar8) = uVar13; + iVar8 = iVar8 + 4; + uVar10 = uVar17; + } while (uVar17 != 9); + puVar15 = local_68; + iVar8 = 0; + lVar4 = (longlong)(int)(iVar12 - local_68[0]) * (longlong)*piVar16 + 0x1000000; + uVar13 = (uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7; + lVar4 = (longlong)*piVar16 * (longlong)(int)(iVar14 - local_44[0]) + 0x1000000; + uVar17 = (uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7; + uVar10 = local_44[0]; + uVar11 = local_68[0]; + piVar6 = piVar16; + do { + iVar8 = iVar8 + 4; + puVar15 = puVar15 + 1; + uVar7 = *(uint *)((int)local_44 + iVar8); + piVar6 = piVar6 + 1; + lVar4 = (longlong)*piVar6 * (longlong)(int)(uVar10 - uVar7) + 0x1000000; + lVar5 = (longlong)(int)(uVar11 - *puVar15) * (longlong)*piVar6 + 0x1000000; + uVar17 = uVar17 + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7); + uVar13 = uVar13 + ((uint)lVar5 >> 0x19 | (int)((ulonglong)lVar5 >> 0x20) << 7); + uVar10 = uVar7; + uVar11 = *puVar15; + } while (iVar8 != 0x20); + iVar8 = 0; + lVar4 = (longlong)local_48 * (longlong)piVar16[9] + 0x1000000; + lVar5 = (longlong)piVar16[9] * (longlong)(int)local_44[8] + 0x1000000; + piVar6 = piVar16; + do { + piVar1 = (int *)((int)&DAT_000ce574 + iVar8); + iVar8 = iVar8 + 4; + uVar7 = (piVar16 + (uVar9 + *piVar1 & 0xff))[10]; + uVar10 = (piVar16 + (uVar9 + *piVar1 & 0xff))[0x10a]; + uVar11 = piVar6[0x40a]; + piVar6[0x40a] = uVar11 - uVar7; + piVar6[0x40b] = piVar6[0x40b] - (((int)uVar7 >> 0x1f) + (uint)(uVar11 < uVar7)); + uVar11 = piVar6[0x41c]; + piVar6[0x41c] = uVar11 - uVar10; + piVar6[0x41d] = piVar6[0x41d] - (((int)uVar10 >> 0x1f) + (uint)(uVar11 < uVar10)); + piVar6 = piVar6 + 2; + } while (iVar8 != 0x24); + local_8c[-1] = uVar13 + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7); + local_90[1] = uVar17 + ((uint)lVar5 >> 0x19 | (int)((ulonglong)lVar5 >> 0x20) << 7); + local_84 = local_84 + 2; + iVar8 = piVar16[0x42e]; + uVar9 = iVar8 + 1U & 0xff; + (piVar16 + iVar8)[10] = iVar12; + (piVar16 + iVar8)[0x10a] = iVar14; + piVar16[0x42e] = uVar9; + local_90 = local_90 + 2; + local_8c = local_8c + 2; + } while (local_84 < (uint)(param_2 << 1)); + } + return; +} diff --git a/src/effects/FIREqualizer.h b/src/effects/FIREqualizer.h new file mode 100644 index 0000000..29c7eb5 --- /dev/null +++ b/src/effects/FIREqualizer.h @@ -0,0 +1,25 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_FIREQUALIZER_H +#define VIPER_FIREQUALIZER_H + + +class FIREqualizer { + int* field_0x0; + uint samplerate; + bool enabled; + +public: + ~FIREqualizer(); + void SetBandLevel(uint param_1,float param_2); + void Reset(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(uint param_1); + FIREqualizer(); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_FIREQUALIZER_H diff --git a/src/effects/PlaybackGain.cpp b/src/effects/PlaybackGain.cpp new file mode 100644 index 0000000..77d89c7 --- /dev/null +++ b/src/effects/PlaybackGain.cpp @@ -0,0 +1,250 @@ +// +// Created by mart on 2/12/21. +// + +#include "PlaybackGain.h" + +// PlaybackGain::PlaybackGain() + +PlaybackGain::PlaybackGain() { + FixedBiquad::FixedBiquad(&this->field_0x28); + FixedBiquad::FixedBiquad(&this->field_0x4c); + this->field_0x8 = 0; + this->field_0xc = 0x3cd00000; + this->field_0x4 = 0x3ede5bd8; + *(undefined *)&this->field_0x74 = 0; + this->field_0x14 = 0; + this->field_0x18 = 0x2000000; + this->field_0x1c = 0x2000000; + this->field_0x20 = 0x2000000; + this->field_0x24 = 0x2000000; + this->samplerate = 0xac44; + this->field_0x10 = 0x40000000; + this->field_0x0 = 0x3f000000; + FixedBiquad::SetBandPassParameter(&this->field_0x28,0x45098000,0x472c4400,0x3ea8f5c3); + FixedBiquad::SetBandPassParameter + (&this->field_0x4c,0x45098000,(int)(float)(ulonglong)this->samplerate,0x3ea8f5c3); + return this; +} + + + +// PlaybackGain::AnalyseWave(int*, int) + +void PlaybackGain::AnalyseWave(int *param_1,int param_2) { + int *piVar1; + longlong lVar2; + int iVar3; + uint uVar4; + uint uVar5; + uint uVar6; + uint uVar7; + int iVar8; + bool bVar9; + + if (param_2 * 2 < 1) { + uVar6 = 0; + uVar7 = 0; + } + else { + uVar4 = 0; + uVar5 = 0; + iVar8 = 0; + uVar6 = 0; + uVar7 = 0; + do { + iVar3 = FixedBiquad::ProcessSample(&this->field_0x28,*param_1); + iVar8 = iVar8 + 2; + piVar1 = param_1 + 1; + lVar2 = (longlong)iVar3 * (longlong)iVar3 + CONCAT44(uVar7,uVar6); + uVar6 = (uint)lVar2; + uVar7 = (uint)((ulonglong)lVar2 >> 0x20); + param_1 = param_1 + 2; + iVar3 = FixedBiquad::ProcessSample(&this->field_0x4c,*piVar1); + lVar2 = (longlong)iVar3 * (longlong)iVar3 + CONCAT44(uVar5,uVar4); + uVar4 = (uint)lVar2; + uVar5 = (uint)((ulonglong)lVar2 >> 0x20); + } while (iVar8 + param_2 * -2 < 0 != SBORROW4(iVar8,param_2 * 2)); + bVar9 = uVar5 <= uVar7; + if (uVar7 == uVar5) { + bVar9 = uVar4 <= uVar6; + } + if (!bVar9) { + uVar6 = uVar4; + uVar7 = uVar5; + } + } + __aeabi_uldivmod(uVar6,uVar7,param_2,param_2 >> 0x1f); + return; +} + + + +// PlaybackGain::SetRatio(float) + +void PlaybackGain::SetRatio(float param_1) { + float in_r1; + + this->field_0x10 = in_r1 + 1.0; + this->field_0x0 = 1.0 / (in_r1 + 1.0); + return; +} + + + +// PlaybackGain::SetVolume(float) + +void PlaybackGain::SetVolume(float param_1) { + float in_r1; + + this->field_0x18 = ROUND(in_r1 * 3.355443e+07 + 0.5); + return; +} + + + +// PlaybackGain::SetMaxGainFactor(float) + +void PlaybackGain::SetMaxGainFactor(float param_1) { + float in_r1; + + this->field_0x1c = ROUND(in_r1 * 3.355443e+07 + 0.5); + return; +} + + + +// PlaybackGain::Reset() + +void PlaybackGain::Reset() { + FixedBiquad::SetBandPassParameter + (&this->field_0x28,0x45098000,(int)(float)(ulonglong)this->samplerate,0x3ea8f5c3); + FixedBiquad::SetBandPassParameter + (&this->field_0x4c,0x45098000,(int)(float)(ulonglong)this->samplerate,0x3ea8f5c3); + this->field_0x14 = 0; + this->field_0x20 = 0x2000000; + this->field_0x24 = 0x2000000; + return; +} + + + +// PlaybackGain::SetEnable(bool) + +undefined4 PlaybackGain::SetEnable(bool param_1) { + undefined4 uVar1; + + if ((bool)*(char *)&this->field_0x74 == param_1) { + uVar1 = 0; + } + else { + if ((*(char *)&this->field_0x74 == '\0') && (param_1 != false)) { + Reset(this); + } + uVar1 = 1; + *(bool *)&this->field_0x74 = param_1; + } + return uVar1; +} + + + +// PlaybackGain::SetSamplingRate(unsigned int) + +void PlaybackGain::SetSamplingRate(uint param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + Reset(this); + return; +} + + + +// PlaybackGain::Process(int*, int) + +void PlaybackGain::Process(int *param_1,int param_2) { + longlong lVar1; + uint uVar2; + int iVar3; + int iVar4; + int iVar5; + int iVar6; + uint uVar7; + PlaybackGain *pPVar8; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr5; + undefined4 in_cr6; + undefined4 in_cr7; + float fVar9; + float __y; + undefined8 uVar10; + undefined4 in_d18; + undefined4 in_register_00000394; + longlong lVar11; + + if (*(char *)&this->field_0x74 == '\0') { + return; + } + AnalyseWave(this,param_1,param_2); + fVar9 = (float)__floatundidf(); + coprocessor_function(0xb,6,5,in_cr0,in_cr1,in_cr0); + fVar9 = logf(fVar9); + coprocessor_function(10,2,0,in_cr6,in_cr7,in_cr6); + if ((int)this->field_0x14 < 100) { + this->field_0x14 = this->field_0x14 + 1; + } + coprocessor_function(10,6,5,in_cr7,in_cr5,in_cr7); + coprocessor_function(10,2,0,in_cr7,in_cr7,in_cr7); + powf(fVar9,__y); + coprocessor_function(0xb,6,5,in_cr2,in_cr1,in_cr0); + lVar11 = __fixdfdi(in_d18,in_register_00000394); + uVar2 = this->samplerate / 0x28; + if ((int)uVar2 < param_2) { + uVar2 = param_2; + } + uVar10 = VectorShiftRight(CONCAT44(uVar2,uVar2),0x20); + pPVar8 = this; + do { + uVar7 = pPVar8->field_0x20; + lVar1 = lVar11 * (int)this->field_0x18 + 0x1000000; + iVar3 = (int)((ulonglong)lVar1 >> 0x20); + uVar2 = (uint)lVar1 >> 0x19 | iVar3 * 0x80; + iVar3 = __aeabi_ldivmod(uVar2 - uVar7, + (iVar3 >> 0x19) - (((int)uVar7 >> 0x1f) + (uint)(uVar2 < uVar7)), + (int)uVar10,(int)((ulonglong)uVar10 >> 0x20)); + if (0 < iVar3) { + iVar3 = iVar3 >> 4; + } + if (param_2 != 0) { + iVar4 = 0; + while( true ) { + lVar1 = (longlong)*(int *)((int)param_1 + iVar4) * (longlong)(int)uVar7 + 0x1000000; + *(uint *)((int)param_1 + iVar4) = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7 + ; + iVar6 = this->field_0x1c; + iVar5 = iVar3 + pPVar8->field_0x20; + if (iVar6 < iVar5) { + pPVar8->field_0x20 = iVar6; + } + else { + if (-iVar6 < iVar5) { + pPVar8->field_0x20 = iVar5; + } + else { + pPVar8->field_0x20 = -iVar6; + } + } + iVar4 = iVar4 + 8; + if (iVar4 == param_2 * 8) break; + uVar7 = pPVar8->field_0x20; + } + } + pPVar8 = (PlaybackGain *)&pPVar8->field_0x4; + param_1 = param_1 + 1; + } while (pPVar8 != (PlaybackGain *)&this->field_0x8); + return; +} diff --git a/src/effects/PlaybackGain.h b/src/effects/PlaybackGain.h new file mode 100644 index 0000000..ba713c7 --- /dev/null +++ b/src/effects/PlaybackGain.h @@ -0,0 +1,41 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_PLAYBACKGAIN_H +#define VIPER_PLAYBACKGAIN_H + + +class PlaybackGain { + undefined4 field_0x0; + undefined4 field_0x4; + undefined4 field_0x8; + undefined4 field_0xc; + undefined4 field_0x10; + undefined4 field_0x14; + undefined4 field_0x18; + undefined4 field_0x1c; + undefined4 field_0x20; + undefined4 field_0x24; + struct FixedBiquad field_0x28; + struct FixedBiquad field_0x4c; + uint samplerate; + undefined field_0x74; + undefined field_0x75; + undefined field_0x76; + undefined field_0x77; + +public: + PlaybackGain(); + void AnalyseWave(int *param_1,int param_2); + void SetRatio(float param_1); + void SetVolume(float param_1); + void SetMaxGainFactor(float param_1); + void Reset(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(uint param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_PLAYBACKGAIN_H diff --git a/src/effects/Reverberation.cpp b/src/effects/Reverberation.cpp new file mode 100644 index 0000000..475e1f6 --- /dev/null +++ b/src/effects/Reverberation.cpp @@ -0,0 +1,134 @@ +// +// Created by mart on 2/12/21. +// + +#include "Reverberation.h" + +// Reverberation::Reverberation() + +Reverberation::Reverberation() { + CRevModel *this_00; + + this_00 = &this->field_0x14; + CRevModel::CRevModel(this_00); + this->roomSize = 0; + this->width = 0.0; + this->damp = 0.0; + this->wet = 0.0; + this->dry = 0.5; + CRevModel::SetRoomSize(this_00,0); + CRevModel::SetWidth(this_00,(int)ROUND(this->width * 3.355443e+07 + 0.5)); + CRevModel::SetDamp(this_00,(int)ROUND(this->damp * 3.355443e+07 + 0.5)); + CRevModel::SetWet(this_00,(int)ROUND(this->wet * 3.355443e+07 + 0.5)); + CRevModel::SetDry(this_00,(int)ROUND(this->dry * 3.355443e+07 + 0.5)); + CRevModel::~ZN9CRevModel5ResetEv(this_00); + this->samplerate = 0xac44; + this->enabled = false; + return this; +} + + + +// Reverberation::SetSamplingRate(unsigned int) + +void Reverberation::SetSamplingRate(uint param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + CRevModel::~ZN9CRevModel5ResetEv(&this->field_0x14); + return; +} + + + +// Reverberation::SetRoomSize(float) + +void Reverberation::SetRoomSize(int param_1) { + this->roomSize = param_1; + CRevModel::SetRoomSize(&this->field_0x14,(int)ROUND((float)param_1 * 3.355443e+07 + 0.5)); + return; +} + + + +// Reverberation::SetWidth(float) + +void Reverberation::SetWidth(int param_1) { + this->width = (float)param_1; + CRevModel::SetWidth(&this->field_0x14,(int)ROUND((float)param_1 * 3.355443e+07 + 0.5)); + return; +} + + + +// Reverberation::SetDamp(float) + +void Reverberation::SetDamp(int param_1) { + this->damp = (float)param_1; + CRevModel::SetDamp(&this->field_0x14,(int)ROUND((float)param_1 * 3.355443e+07 + 0.5)); + return; +} + + + +// Reverberation::SetWet(float) + +void Reverberation::SetWet(int param_1) { + this->wet = (float)param_1; + CRevModel::SetWet(&this->field_0x14,(int)ROUND((float)param_1 * 3.355443e+07 + 0.5)); + return; +} + + + +// Reverberation::SetDry(float) + +void Reverberation::SetDry(int param_1) { + this->dry = (float)param_1; + CRevModel::SetDry(&this->field_0x14,(int)ROUND((float)param_1 * 3.355443e+07 + 0.5)); + return; +} + + + +// Reverberation::Reset() + +void Reverberation::Reset() { + CRevModel::~ZN9CRevModel5ResetEv(&this->field_0x14); + return; +} + + + +// Reverberation::SetEnable(bool) + +undefined4 Reverberation::SetEnable(bool param_1) { + bool cVar1; + + cVar1 = this->enabled; + if (cVar1 == false) { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = this->enabled; + } + if (param_1 == cVar1) { + return 0; + } + this->enabled = param_1; + return 1; +} + + + +// Reverberation::Process(int*, int) + +void Reverberation::Process(int *param_1,int param_2) { + if (this->enabled == false) { + return; + } + CRevModel::ProcessReplace(&this->field_0x14,param_1,param_1 + 1,param_2); + return; +} diff --git a/src/effects/Reverberation.h b/src/effects/Reverberation.h new file mode 100644 index 0000000..f105900 --- /dev/null +++ b/src/effects/Reverberation.h @@ -0,0 +1,36 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_REVERBERATION_H +#define VIPER_REVERBERATION_H + + +class Reverberation { + undefined4 roomSize; + float width; + float damp; + float wet; + float dry; + struct CRevModel field_0x14; + undefined4 samplerate; + bool enabled; + undefined field_0x2e9; + undefined field_0x2ea; + undefined field_0x2eb; + +public: + Reverberation(); + void SetSamplingRate(uint param_1); + void SetRoomSize(int param_1); + void SetWidth(int param_1); + void SetDamp(int param_1); + void SetWet(int param_1); + void SetDry(int param_1); + void Reset(); + undefined4 SetEnable(bool param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_REVERBERATION_H diff --git a/src/effects/SpeakerCorrection.cpp b/src/effects/SpeakerCorrection.cpp new file mode 100644 index 0000000..fb22b16 --- /dev/null +++ b/src/effects/SpeakerCorrection.cpp @@ -0,0 +1,123 @@ +// +// Created by mart on 2/12/21. +// + +#include "SpeakerCorrection.h" + +// SpeakerCorrection::Reset() + +void SpeakerCorrection::Reset() { + undefined8 uVar1; + undefined8 extraout_d0; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + float extraout_s2_02; + float extraout_s3; + float extraout_s3_00; + + FixedBiquad::Reset(&this->field_0x50); + FixedBiquad::Reset(&this->field_0x74); + FixedBiquad::Reset(&this->field_0x98); + uVar1 = FixedBiquad::Reset(&this->field_0xbc); + uVar1 = MultiBiquad::RefreshFilter + (&this->field_0x8,1,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2, + extraout_s3,false); + uVar1 = MultiBiquad::RefreshFilter + (&this->field_0x2c,1,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_00,extraout_s3_00,false); + FixedBiquad::SetLowPassParameter + (&this->field_0x50,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2_01); + FixedBiquad::SetLowPassParameter + (&this->field_0x74,(float)extraout_d0,(float)((ulonglong)extraout_d0 >> 0x20), + extraout_s2_02); + FixedBiquad::SetBandPassParameter + (&this->field_0x98,0x43d20000,(int)(float)(ulonglong)this->samplerate,0x407851ec); + FixedBiquad::SetBandPassParameter + (&this->field_0xbc,0x43d20000,(int)(float)(ulonglong)this->samplerate,0x407851ec); + return; +} + + + +// SpeakerCorrection::SpeakerCorrection() + +SpeakerCorrection::SpeakerCorrection() { + MultiBiquad::MultiBiquad(&this->field_0x8); + MultiBiquad::MultiBiquad(&this->field_0x2c); + FixedBiquad::FixedBiquad(&this->field_0x50); + FixedBiquad::FixedBiquad(&this->field_0x74); + FixedBiquad::FixedBiquad(&this->field_0x98); + FixedBiquad::FixedBiquad(&this->field_0xbc); + this->samplerate = 0xac44; + this->enabled = false; + Reset(this); + return this; +} + + + +// SpeakerCorrection::SetEnable(bool) + +undefined4 SpeakerCorrection::SetEnable(bool param_1) { + bool cVar1; + + cVar1 = this->enabled; + if (cVar1 == false) { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = this->enabled; + } + if (param_1 == cVar1) { + return 0; + } + this->enabled = param_1; + return 1; +} + + + +// SpeakerCorrection::SetSamplingRate(unsigned int) + +void SpeakerCorrection::SetSamplingRate(uint param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + Reset(this); + return; +} + + + +// SpeakerCorrection::Process(int*, int) + +void SpeakerCorrection::Process(int *param_1,int param_2) { + longlong lVar1; + int iVar2; + uint uVar3; + int iVar4; + + if ((this->enabled != false) && (0 < param_2 * 2)) { + iVar4 = 0; + do { + iVar2 = FixedBiquad::ProcessSample(&this->field_0x50,*param_1); + iVar2 = MultiBiquad::ProcessSample(&this->field_0x8,iVar2); + lVar1 = (longlong)iVar2 * 0x1000000 + 0x1000000; + iVar4 = iVar4 + 2; + uVar3 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + iVar2 = FixedBiquad::ProcessSample(&this->field_0x98,uVar3); + *param_1 = iVar2 + uVar3; + iVar2 = FixedBiquad::ProcessSample(&this->field_0x74,param_1[1]); + iVar2 = MultiBiquad::ProcessSample(&this->field_0x2c,iVar2); + lVar1 = (longlong)iVar2 * 0x1000000 + 0x1000000; + uVar3 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + iVar2 = FixedBiquad::ProcessSample(&this->field_0xbc,uVar3); + param_1[1] = iVar2 + uVar3; + param_1 = param_1 + 2; + } while (iVar4 + param_2 * -2 < 0 != SBORROW4(iVar4,param_2 * 2)); + } + return; +} diff --git a/src/effects/SpeakerCorrection.h b/src/effects/SpeakerCorrection.h new file mode 100644 index 0000000..84919b3 --- /dev/null +++ b/src/effects/SpeakerCorrection.h @@ -0,0 +1,31 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_SPEAKERCORRECTION_H +#define VIPER_SPEAKERCORRECTION_H + + +class SpeakerCorrection { + uint samplerate; + bool enabled; // Created by retype action + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + struct MultiBiquad field_0x8; + struct MultiBiquad field_0x2c; + struct FixedBiquad field_0x50; + struct FixedBiquad field_0x74; + struct FixedBiquad field_0x98; + struct FixedBiquad field_0xbc; + +public: + void Reset(); + SpeakerCorrection(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(uint param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_SPEAKERCORRECTION_H diff --git a/src/effects/SpectrumExtend.cpp b/src/effects/SpectrumExtend.cpp new file mode 100644 index 0000000..bfb8110 --- /dev/null +++ b/src/effects/SpectrumExtend.cpp @@ -0,0 +1,174 @@ +// +// Created by mart on 2/12/21. +// + +#include "SpectrumExtend.h" + +// SpectrumExtend::~SpectrumExtend() + +SpectrumExtend::~SpectrumExtend() { + Harmonic *this_00; + + if (this != (SpectrumExtend *)0xffffff70) { + this_00 = (Harmonic *)&this->field_0x108; + do { + this_00 = this_00 + -1; + Harmonic::~Harmonic(this_00); + } while ((Harmonic *)&this->field_0x90 != this_00); + } + return this; +} + + + +// SpectrumExtend::Reset() + +void SpectrumExtend::Reset(void) { + MultiBiquad *in_r0; + float in_s0; + float in_s1; + undefined8 uVar1; + float in_s2; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + float in_s3; + float extraout_s3; + float extraout_s3_00; + float extraout_s3_01; + + uVar1 = MultiBiquad::RefreshFilter(in_r0,1,in_s0,in_s1,in_s2,in_s3,false); + uVar1 = MultiBiquad::RefreshFilter + (in_r0 + 1,1,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2, + extraout_s3,false); + uVar1 = MultiBiquad::RefreshFilter + (in_r0 + 2,0,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2_00, + extraout_s3_00,false); + MultiBiquad::RefreshFilter + (in_r0 + 3,0,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20),extraout_s2_01, + extraout_s3_01,false); + Harmonic::Reset((Harmonic *)(in_r0 + 4)); + Harmonic::Reset((Harmonic *)&in_r0[5].field_0x18); + Harmonic::SetHarmonics((Harmonic *)(in_r0 + 4),(float *)&DAT_000ce848); + Harmonic::SetHarmonics((Harmonic *)&in_r0[5].field_0x18,(float *)&DAT_000ce848); + return; +} + + + +// SpectrumExtend::SpectrumExtend() + +SpectrumExtend::SpectrumExtend() { + MultiBiquad::MultiBiquad((MultiBiquad *)this); + MultiBiquad::MultiBiquad((MultiBiquad *)&this->field_0x24); + MultiBiquad::MultiBiquad((MultiBiquad *)&this->field_0x48); + MultiBiquad::MultiBiquad((MultiBiquad *)&this->field_0x6c); + Harmonic::Harmonic((Harmonic *)&this->field_0x90); + Harmonic::Harmonic((Harmonic *)&this->field_0xcc); + *(undefined4 *)&this->field_0x10c = 0xac44; + *(undefined4 *)&this->field_0x110 = 0x1db0; + *(undefined *)&this->field_0x108 = 0; + *(undefined4 *)&this->field_0x114 = 0; + Reset(); + return this; +} + + + +// SpectrumExtend::SetEnable(bool) + +undefined4 SpectrumExtend::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0x108; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(); + cVar1 = *(char *)&this->field_0x108; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0x108 = param_1; + return 1; +} + + + +// SpectrumExtend::SetSamplingRate(int) + +void SpectrumExtend::SetSamplingRate(int param_1) { + if (*(int *)&this->field_0x10c != param_1) { + *(int *)&this->field_0x10c = param_1; + if (param_1 / 2 + -99 <= *(int *)&this->field_0x110) { + *(int *)&this->field_0x110 = param_1 / 2 + -100; + } + Reset(); + return; + } + return; +} + + + +// SpectrumExtend::SetReferenceFrequency(int) + +void SpectrumExtend::SetReferenceFrequency(int param_1) { + int iVar1; + + iVar1 = *(int *)&this->field_0x10c / 2; + if (iVar1 + -99 <= param_1) { + param_1 = iVar1 + -100; + } + *(int *)&this->field_0x110 = param_1; + Reset(); + return; +} + + + +// SpectrumExtend::SetExciter(float) + +void SpectrumExtend::SetExciter(float param_1) { + float in_r1; + + *(float *)&this->field_0x114 = ROUND(in_r1 * 3.355443e+07 + 0.5); + return; +} + + + +// SpectrumExtend::Process(int*, int) + +void SpectrumExtend::Process(int *param_1,int param_2) { + ulonglong uVar1; + int iVar2; + int iVar3; + undefined8 uVar4; + int local_40; + + if ((*(char *)&this->field_0x108 != '\0') && (0 < param_2 * 2)) { + iVar3 = 0; + do { + iVar2 = MultiBiquad::ProcessSample((MultiBiquad *)this,*param_1); + iVar2 = Harmonic::Process((Harmonic *)&this->field_0x90,iVar2); + iVar3 = iVar3 + 2; + uVar1 = (longlong)iVar2 * (longlong)*(int *)&this->field_0x114 + 0x1000000; + uVar4 = VectorShiftRight((uVar1 & 0xffffffff00000000) + (uVar1 & 0xffffffff),0x19); + local_40 = (int)uVar4; + iVar2 = MultiBiquad::ProcessSample((MultiBiquad *)&this->field_0x48,local_40); + *param_1 = *param_1 + iVar2; + iVar2 = MultiBiquad::ProcessSample((MultiBiquad *)&this->field_0x24,param_1[1]); + iVar2 = Harmonic::Process((Harmonic *)&this->field_0xcc,iVar2); + uVar1 = (longlong)iVar2 * (longlong)*(int *)&this->field_0x114 + 0x1000000; + uVar4 = VectorShiftRight((uVar1 & 0xffffffff00000000) + (uVar1 & 0xffffffff),0x19); + local_40 = (int)uVar4; + iVar2 = MultiBiquad::ProcessSample((MultiBiquad *)&this->field_0x6c,local_40); + param_1[1] = param_1[1] + iVar2; + param_1 = param_1 + 2; + } while (iVar3 + param_2 * -2 < 0 != SBORROW4(iVar3,param_2 * 2)); + } + return; +} diff --git a/src/effects/SpectrumExtend.h b/src/effects/SpectrumExtend.h new file mode 100644 index 0000000..a5049b5 --- /dev/null +++ b/src/effects/SpectrumExtend.h @@ -0,0 +1,303 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_SPECTRUMEXTEND_H +#define VIPER_SPECTRUMEXTEND_H + + +class SpectrumExtend { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined field_0x60; + undefined field_0x61; + undefined field_0x62; + undefined field_0x63; + undefined field_0x64; + undefined field_0x65; + undefined field_0x66; + undefined field_0x67; + undefined field_0x68; + undefined field_0x69; + undefined field_0x6a; + undefined field_0x6b; + undefined field_0x6c; + undefined field_0x6d; + undefined field_0x6e; + undefined field_0x6f; + undefined field_0x70; + undefined field_0x71; + undefined field_0x72; + undefined field_0x73; + undefined field_0x74; + undefined field_0x75; + undefined field_0x76; + undefined field_0x77; + undefined field_0x78; + undefined field_0x79; + undefined field_0x7a; + undefined field_0x7b; + undefined field_0x7c; + undefined field_0x7d; + undefined field_0x7e; + undefined field_0x7f; + undefined field_0x80; + undefined field_0x81; + undefined field_0x82; + undefined field_0x83; + undefined field_0x84; + undefined field_0x85; + undefined field_0x86; + undefined field_0x87; + undefined field_0x88; + undefined field_0x89; + undefined field_0x8a; + undefined field_0x8b; + undefined field_0x8c; + undefined field_0x8d; + undefined field_0x8e; + undefined field_0x8f; + undefined field_0x90; + undefined field_0x91; + undefined field_0x92; + undefined field_0x93; + undefined field_0x94; + undefined field_0x95; + undefined field_0x96; + undefined field_0x97; + undefined field_0x98; + undefined field_0x99; + undefined field_0x9a; + undefined field_0x9b; + undefined field_0x9c; + undefined field_0x9d; + undefined field_0x9e; + undefined field_0x9f; + undefined field_0xa0; + undefined field_0xa1; + undefined field_0xa2; + undefined field_0xa3; + undefined field_0xa4; + undefined field_0xa5; + undefined field_0xa6; + undefined field_0xa7; + undefined field_0xa8; + undefined field_0xa9; + undefined field_0xaa; + undefined field_0xab; + undefined field_0xac; + undefined field_0xad; + undefined field_0xae; + undefined field_0xaf; + undefined field_0xb0; + undefined field_0xb1; + undefined field_0xb2; + undefined field_0xb3; + undefined field_0xb4; + undefined field_0xb5; + undefined field_0xb6; + undefined field_0xb7; + undefined field_0xb8; + undefined field_0xb9; + undefined field_0xba; + undefined field_0xbb; + undefined field_0xbc; + undefined field_0xbd; + undefined field_0xbe; + undefined field_0xbf; + undefined field_0xc0; + undefined field_0xc1; + undefined field_0xc2; + undefined field_0xc3; + undefined field_0xc4; + undefined field_0xc5; + undefined field_0xc6; + undefined field_0xc7; + undefined field_0xc8; + undefined field_0xc9; + undefined field_0xca; + undefined field_0xcb; + undefined field_0xcc; + undefined field_0xcd; + undefined field_0xce; + undefined field_0xcf; + undefined field_0xd0; + undefined field_0xd1; + undefined field_0xd2; + undefined field_0xd3; + undefined field_0xd4; + undefined field_0xd5; + undefined field_0xd6; + undefined field_0xd7; + undefined field_0xd8; + undefined field_0xd9; + undefined field_0xda; + undefined field_0xdb; + undefined field_0xdc; + undefined field_0xdd; + undefined field_0xde; + undefined field_0xdf; + undefined field_0xe0; + undefined field_0xe1; + undefined field_0xe2; + undefined field_0xe3; + undefined field_0xe4; + undefined field_0xe5; + undefined field_0xe6; + undefined field_0xe7; + undefined field_0xe8; + undefined field_0xe9; + undefined field_0xea; + undefined field_0xeb; + undefined field_0xec; + undefined field_0xed; + undefined field_0xee; + undefined field_0xef; + undefined field_0xf0; + undefined field_0xf1; + undefined field_0xf2; + undefined field_0xf3; + undefined field_0xf4; + undefined field_0xf5; + undefined field_0xf6; + undefined field_0xf7; + undefined field_0xf8; + undefined field_0xf9; + undefined field_0xfa; + undefined field_0xfb; + undefined field_0xfc; + undefined field_0xfd; + undefined field_0xfe; + undefined field_0xff; + undefined field_0x100; + undefined field_0x101; + undefined field_0x102; + undefined field_0x103; + undefined field_0x104; + undefined field_0x105; + undefined field_0x106; + undefined field_0x107; + undefined field_0x108; + undefined field_0x109; + undefined field_0x10a; + undefined field_0x10b; + undefined field_0x10c; + undefined field_0x10d; + undefined field_0x10e; + undefined field_0x10f; + undefined field_0x110; + undefined field_0x111; + undefined field_0x112; + undefined field_0x113; + undefined field_0x114; + undefined field_0x115; + undefined field_0x116; + undefined field_0x117; + +public: + ~SpectrumExtend(); + void Reset(); + SpectrumExtend(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(int param_1); + void SetReferenceFrequency(int param_1); + void SetExciter(float param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_SPECTRUMEXTEND_H diff --git a/src/effects/Stereo3DSurround.cpp b/src/effects/Stereo3DSurround.cpp new file mode 100644 index 0000000..f3cfbb9 --- /dev/null +++ b/src/effects/Stereo3DSurround.cpp @@ -0,0 +1,166 @@ +// +// Created by mart on 2/12/21. +// + +#include "Stereo3DSurround.h" + + +// Stereo3DSurround::Stereo3DSurround() + +Stereo3DSurround::Stereo3DSurround() { + this->field_0x4 = 0x2000000; + this->field_0x0 = 0.0; + this->field_0x8 = 0x2000000; + this->field_0xc = 0x1000000; + this->field_0x10 = 0x1000000; + this->field_0x14 = 0x1000000; + return; +} + + + +// Stereo3DSurround::SetStereoWiden(float) + +float Stereo3DSurround::SetStereoWiden(float param_1) { + uint uVar1; + float in_r1; + int iVar2; + uint uVar3; + uint uVar4; + uint uVar5; + uint uVar6; + float extraout_s0; + float fVar7; + + this->field_0x0 = in_r1; + fVar7 = ROUND(in_r1 * 3.355443e+07 + 0.5); + uVar3 = (int)fVar7 + 0x2000000; + this->field_0x8 = uVar3; + if ((int)uVar3 < 0x2000000) { + uVar1 = 0x1000000; + iVar2 = 0; + } + else { + iVar2 = (int)fVar7 + 0x4000000; + uVar1 = __aeabi_ldivmod(0,0x40000,iVar2,iVar2 >> 0x1f); + iVar2 = (int)uVar1 >> 0x1f; + param_1 = extraout_s0; + } + uVar5 = this->field_0x4; + uVar4 = (uint)((ulonglong)uVar1 * (ulonglong)uVar3); + this->field_0xc = uVar1; + uVar6 = (uint)((ulonglong)uVar1 * (ulonglong)uVar5); + this->field_0x10 = + uVar6 + 0x1000000 >> 0x19 | + (uVar1 * ((int)uVar5 >> 0x1f) + uVar5 * iVar2 + + (int)((ulonglong)uVar1 * (ulonglong)uVar5 >> 0x20) + (uint)(0xfeffffff < uVar6)) * 0x80; + this->field_0x14 = + uVar4 + 0x1000000 >> 0x19 | + (uVar1 * ((int)uVar3 >> 0x1f) + uVar3 * iVar2 + + (int)((ulonglong)uVar1 * (ulonglong)uVar3 >> 0x20) + (uint)(0xfeffffff < uVar4)) * 0x80; + return param_1; +} + + + +// Stereo3DSurround::SetMiddleImage(float) + +float Stereo3DSurround::SetMiddleImage(float param_1) { + uint uVar1; + float in_r1; + int iVar2; + uint uVar3; + uint uVar4; + uint uVar5; + float extraout_s0; + float fVar6; + float fVar7; + undefined8 uVar8; + int iStack36; + + fVar7 = ROUND(this->field_0x0 * 3.355443e+07 + 0.5); + fVar6 = ROUND(in_r1 * 3.355443e+07 + 0.5); + uVar3 = (int)fVar7 + 0x2000000; + this->field_0x4 = (uint)fVar6; + this->field_0x8 = uVar3; + if ((int)uVar3 < 0x2000000) { + uVar1 = 0x1000000; + iVar2 = 0; + } + else { + iVar2 = (int)fVar7 + 0x4000000; + uVar1 = __aeabi_ldivmod(0,0x40000,iVar2,iVar2 >> 0x1f); + iVar2 = (int)uVar1 >> 0x1f; + param_1 = extraout_s0; + } + this->field_0xc = uVar1; + uVar8 = VectorShiftRight(CONCAT44(uVar3,uVar3),0x20); + iStack36 = (int)((ulonglong)uVar8 >> 0x20); + uVar5 = (uint)((ulonglong)uVar1 * (ulonglong)(uint)fVar6); + uVar4 = (uint)((ulonglong)uVar1 * (ulonglong)uVar3); + this->field_0x10 = + uVar5 + 0x1000000 >> 0x19 | + (uVar1 * ((int)fVar6 >> 0x1f) + (int)fVar6 * iVar2 + + (int)((ulonglong)uVar1 * (ulonglong)(uint)fVar6 >> 0x20) + (uint)(0xfeffffff < uVar5)) * + 0x80; + this->field_0x14 = + uVar4 + 0x1000000 >> 0x19 | + (uVar1 * iStack36 + uVar3 * iVar2 + (int)((ulonglong)uVar1 * (ulonglong)uVar3 >> 0x20) + + (uint)(0xfeffffff < uVar4)) * 0x80; + return param_1; +} + + + +// Stereo3DSurround::Process(int*, int) + +void Stereo3DSurround::Process(int *param_1,int param_2) { + uint uVar1; + longlong lVar2; + longlong lVar3; + uint uVar4; + uint uVar5; + uint uVar6; + int *piVar7; + uint uVar8; + int *piVar9; + + uVar1 = param_2 << 1; + uVar4 = uVar1 & 0xfffffffc; + if (uVar4 != 0) { + uVar8 = 0; + piVar7 = param_1 + 1; + piVar9 = param_1; + do { + uVar8 = uVar8 + 4; + lVar2 = (longlong)(int)this->field_0x10 * (longlong)(piVar7[-1] + piVar9[1]) + 0x1000000; + uVar6 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + lVar2 = (longlong)(int)this->field_0x14 * (longlong)(piVar9[1] - piVar7[-1]) + 0x1000000; + lVar3 = (longlong)(int)this->field_0x10 * (longlong)(piVar9[2] + piVar9[3]) + 0x1000000; + uVar5 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + lVar2 = (longlong)(int)this->field_0x14 * (longlong)(piVar9[3] - piVar9[2]) + 0x1000000; + piVar7[-1] = uVar6 - uVar5; + piVar9[1] = uVar5 + uVar6; + uVar5 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + uVar6 = (uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7; + piVar9[2] = uVar6 - uVar5; + piVar9[3] = uVar5 + uVar6; + piVar7 = piVar7 + 4; + piVar9 = piVar9 + 4; + } while (uVar8 < uVar4); + } + if ((uVar1 & 2) != 0) { + while (uVar4 < uVar1) { + lVar2 = (longlong)(int)this->field_0x10 * (longlong)(param_1[uVar4] + param_1[uVar4 + 1]) + + 0x1000000; + lVar3 = (longlong)(int)this->field_0x14 * (longlong)(param_1[uVar4 + 1] - param_1[uVar4]) + + 0x1000000; + uVar5 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + uVar8 = (uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7; + param_1[uVar4] = uVar5 - uVar8; + param_1[uVar4 + 1] = uVar8 + uVar5; + uVar4 = uVar4 + 2; + } + } + return; +} diff --git a/src/effects/Stereo3DSurround.h b/src/effects/Stereo3DSurround.h new file mode 100644 index 0000000..1dec4c0 --- /dev/null +++ b/src/effects/Stereo3DSurround.h @@ -0,0 +1,27 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_STEREOSURROUND_H +#define VIPER_STEREOSURROUND_H + + +#include "../libv4a_fx.so.h" + +class Stereo3DSurround { + float field_0x0; + uint field_0x4; + uint field_0x8; + uint field_0xc; + uint field_0x10; + uint field_0x14; + +public: + Stereo3DSurround(); + float SetStereoWiden(float param_1); + float SetMiddleImage(float param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_STEREOSURROUND_H diff --git a/src/effects/Subwoofer.cpp b/src/effects/Subwoofer.cpp new file mode 100644 index 0000000..356bef4 --- /dev/null +++ b/src/effects/Subwoofer.cpp @@ -0,0 +1,158 @@ +// +// Created by mart on 2/12/21. +// + +#include "Subwoofer.h" + +// Subwoofer::Subwoofer() + +Subwoofer::Subwoofer() { + undefined8 uVar1; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + float extraout_s2_02; + float extraout_s2_03; + float extraout_s2_04; + float extraout_s3; + float extraout_s3_00; + float extraout_s3_01; + float extraout_s3_02; + float extraout_s3_03; + float extraout_s3_04; + + MultiBiquad::MultiBiquad((MultiBiquad *)this); + MultiBiquad::MultiBiquad((MultiBiquad *)(this + 0x24)); + MultiBiquad::MultiBiquad((MultiBiquad *)(this + 0x48)); + MultiBiquad::MultiBiquad((MultiBiquad *)(this + 0x6c)); + MultiBiquad::MultiBiquad((MultiBiquad *)(this + 0x90)); + uVar1 = MultiBiquad::MultiBiquad((MultiBiquad *)(this + 0xb4)); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)this,5,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2,extraout_s3,false); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(this + 0x24),5,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_00,extraout_s3_00,false); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(this + 0x48),5,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_01,extraout_s3_01,false); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(this + 0x6c),5,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_02,extraout_s3_02,false); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(this + 0x90),0,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_03,extraout_s3_03,false); + MultiBiquad::RefreshFilter + ((MultiBiquad *)(this + 0xb4),0,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_04,extraout_s3_04,false); + return this; +} + + + +// WARNING: Unknown calling convention yet parameter storage is locked +// Subwoofer::SetBassGain(int, float) + +void Subwoofer::SetBassGain(int param_1,float param_2) { + float in_r2; + char in_NG; + bool in_ZR; + char in_OV; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + undefined4 in_s1; + undefined8 uVar1; + double dVar2; + float in_s2; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + float extraout_s2_02; + float extraout_s2_03; + float extraout_s2_04; + float in_s3; + float extraout_s3; + float extraout_s3_00; + float extraout_s3_01; + float extraout_s3_02; + float extraout_s3_03; + float extraout_s3_04; + undefined uVar3; + double dVar4; + undefined4 in_stack_ffffffc8; + undefined4 in_stack_ffffffcc; + + dVar2 = (double)CONCAT44(in_s1,param_2); + dVar4 = (double)in_r2; + if (in_ZR || in_NG != in_OV) { + uVar3 = false; + } + else { + log10((double)CONCAT44(in_stack_ffffffcc,in_stack_ffffffc8)); + coprocessor_function(0xb,6,4,in_cr0,in_cr1,in_cr8); + coprocessor_function(10,6,1,in_cr7,in_cr9,in_cr7); + uVar3 = SUB41((float)dVar4,0); + dVar2 = log10((double)CONCAT44(in_stack_ffffffcc,in_stack_ffffffc8)); + coprocessor_function(0xb,2,4,in_cr8,in_cr1,in_cr8); + in_s2 = extraout_s2_04; + in_s3 = extraout_s3_04; + } + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)param_1,5,SUB84(dVar2,0),(float)((ulonglong)dVar2 >> 0x20),in_s2(in_s3,(bool)uVar3); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(param_1 + 0x24),5,(float)uVar1, + (float)((ulonglong)uVar1 >> 0x20),extraout_s2,extraout_s3,(bool)uVar3); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(param_1 + 0x48),5,(float)uVar1, + (float)((ulonglong)uVar1 >> 0x20),extraout_s2_00,extraout_s3_00,false); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(param_1 + 0x6c),5,(float)uVar1, + (float)((ulonglong)uVar1 >> 0x20),extraout_s2_01,extraout_s3_01,false); + uVar1 = MultiBiquad::RefreshFilter + ((MultiBiquad *)(param_1 + 0x90),0,(float)uVar1, + (float)((ulonglong)uVar1 >> 0x20),extraout_s2_02,extraout_s3_02,false); + MultiBiquad::RefreshFilter + ((MultiBiquad *)(param_1 + 0xb4),0,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20), + extraout_s2_03,extraout_s3_03,false); + return; +} + + + +// Subwoofer::Process(int*, int) + +void Subwoofer::Process(int *param_1,int param_2) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + longlong lVar4; + int iVar5; + int iVar6; + int iVar7; + + if (0 < param_2) { + iVar7 = param_2 + -1; + do { + iVar7 = iVar7 + -1; + iVar5 = MultiBiquad::ProcessSample((MultiBiquad *)this,*param_1); + iVar5 = MultiBiquad::ProcessSample((MultiBiquad *)(this + 0x48),iVar5); + iVar5 = MultiBiquad::ProcessSample((MultiBiquad *)(this + 0x90),iVar5 - *param_1); + iVar6 = MultiBiquad::ProcessSample((MultiBiquad *)(this + 0x24),param_1[1]); + iVar6 = MultiBiquad::ProcessSample((MultiBiquad *)(this + 0x6c),iVar6); + iVar6 = MultiBiquad::ProcessSample((MultiBiquad *)(this + 0xb4),iVar6 - param_1[1]); + lVar1 = (longlong)iVar6 * 0x1333334 + 0x1000000; + lVar2 = (longlong)iVar5 * 0x1333334 + 0x1000000; + lVar3 = (longlong)param_1[1] * 0x1000000 + 0x1000000; + lVar4 = (longlong)*param_1 * 0x1000000 + 0x1000000; + param_1[1] = ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7) + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *param_1 = ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + param_1 = param_1 + 2; + } while (iVar7 != -1); + } + return; +} diff --git a/src/effects/Subwoofer.h b/src/effects/Subwoofer.h new file mode 100644 index 0000000..809aafa --- /dev/null +++ b/src/effects/Subwoofer.h @@ -0,0 +1,32 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_SUBWOOFER_H +#define VIPER_SUBWOOFER_H + + +class Subwoofer { + int field_0x0; + int field_0x4; + int field_0x8; + int field_0xc; + int field_0x10; + undefined4 field_0x14; + undefined4 field_0x18; + undefined4 field_0x1c; + undefined4 field_0x20; + struct MultiBiquad field_0x24; + struct MultiBiquad field_0x48; + struct MultiBiquad field_0x6c; + struct MultiBiquad field_0x90; + struct MultiBiquad field_0xb4; + +public: + Subwoofer(); + void SetBassGain(int param_1,float param_2); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_SUBWOOFER_H diff --git a/src/effects/TubeSimulator.cpp b/src/effects/TubeSimulator.cpp new file mode 100644 index 0000000..b16b5d7 --- /dev/null +++ b/src/effects/TubeSimulator.cpp @@ -0,0 +1,56 @@ +// +// Created by mart on 2/12/21. +// + +#include "TubeSimulator.h" + +// TubeSimulator::TubeSimulator() + +TubeSimulator::TubeSimulator() { + *(undefined4 *)this = 0; + *(undefined4 *)&this->field_0x4 = 0; + this->field_0x8 = false; + return; +} + + + +// TubeSimulator::TubeProcess(int*, int) + +void TubeSimulator::TubeProcess(int *param_1,int param_2) { + int iVar1; + int iVar2; + int *piVar3; + int iVar4; + int *piVar5; + + if ((this->field_0x8 != false) && (0 < param_2)) { + iVar2 = param_2 + -1; + piVar3 = param_1 + 2; + piVar5 = param_1 + 2; + do { + iVar4 = param_1[1]; + iVar2 = iVar2 + -1; + iVar1 = *(int *)this + piVar3[-2] >> 1; + *(int *)this = iVar1; + *(int *)&this->field_0x4 = iVar4 + *(int *)&this->field_0x4 >> 1; + piVar3[-2] = iVar1; + param_1[1] = *(int *)&this->field_0x4; + param_1 = piVar5; + piVar3 = piVar3 + 2; + piVar5 = piVar5 + 2; + } while (iVar2 != -1); + } + return; +} + + + +// TubeSimulator::Reset() + +void TubeSimulator::Reset() { + *(undefined4 *)this = 0; + *(undefined4 *)&this->field_0x4 = 0; + this->field_0x8 = false; + return; +} diff --git a/src/effects/TubeSimulator.h b/src/effects/TubeSimulator.h new file mode 100644 index 0000000..c9d6da9 --- /dev/null +++ b/src/effects/TubeSimulator.h @@ -0,0 +1,30 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_TUBESIMULATOR_H +#define VIPER_TUBESIMULATOR_H + + +class TubeSimulator { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + bool field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + +public: + TubeSimulator(); + void TubeProcess(int *param_1,int param_2); + void Reset(); +}; + + +#endif //VIPER_TUBESIMULATOR_H diff --git a/src/effects/VHE.cpp b/src/effects/VHE.cpp new file mode 100644 index 0000000..26f429d --- /dev/null +++ b/src/effects/VHE.cpp @@ -0,0 +1,308 @@ +// +// Created by mart on 2/12/21. +// + +#include "VHE.h" + +// VHE::~VHE() + +VHE::~VHE() { + WaveBuffer_R32 *pWVar1; + VHE *this_00; + + pWVar1 = *(WaveBuffer_R32 **)&this->field_0x20; + if (pWVar1 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(pWVar1); + operator_delete(pWVar1); + } + pWVar1 = *(WaveBuffer_R32 **)&this->field_0x24; + if (pWVar1 != nullptr) { + WaveBuffer_R32::~WaveBuffer_R32(pWVar1); + operator_delete(pWVar1); + } + this_00 = (VHE *)&this->field_0x20; + do { + this_00 = (VHE *)&this_00[-1].field_0x28; + PConvSingle_F32::~PConvSingle_F32((PConvSingle_F32 *)this_00); + } while (this != this_00); + return this; +} + + + +// VHE::GetEnabled() + +undefined VHE::GetEnabled() { + return *(undefined *)&this->field_0x2c; +} + + + +// VHE::Reset() + +void VHE::Reset() { + float *pfVar1; + int iVar2; + PConvSingle_F32 *this_00; + int iVar3; + int iVar4; + float *pfVar5; + int iVar6; + float fVar7; + + if (*(WaveBuffer_R32 **)&this->field_0x20 != nullptr) { + WaveBuffer_R32::Reset(*(WaveBuffer_R32 **)&this->field_0x20); + } + if (*(WaveBuffer_R32 **)&this->field_0x24 != nullptr) { + WaveBuffer_R32::Reset(*(WaveBuffer_R32 **)&this->field_0x24); + } + this_00 = (PConvSingle_F32 *)&this->field_0x10; + PConvSingle_F32::Reset((PConvSingle_F32 *)this); + PConvSingle_F32::UnloadKernel((PConvSingle_F32 *)this); + PConvSingle_F32::Reset(this_00); + fVar7 = (float)PConvSingle_F32::UnloadKernel(this_00); + iVar6 = *(int *)&this->field_0x30; + iVar2 = *(int *)&this->field_0x28; + switch(iVar6) { + case 0: + if (iVar2 == 0xac44) { + pfVar1 = (float *)&UNK_000ca550; + } + else { + if (iVar2 != 48000) { + return; + } + pfVar1 = (float *)&UNK_000c6550; + } + iVar4 = 0x1000; + iVar3 = 0x403c8a72; + if (iVar2 != 0xac44) { + pfVar5 = (float *)&UNK_00092560; + goto joined_r0x00065304; + } + pfVar5 = (float *)&UNK_0008a560; + goto LAB_000651f4; + case 1: + if (iVar2 == 0xac44) { + iVar4 = 0x7ff; + iVar3 = 0x3f71adfb; + pfVar1 = (float *)&UNK_000c0554; + } + else { + if (iVar2 != 48000) { + return; + } + iVar4 = 0x7ff; + iVar3 = 0x3f71adfb; + pfVar1 = (float *)&UNK_000ba558; + } + break; + case 2: + if (iVar2 == 0xac44) { + iVar4 = 0x1000; + iVar3 = 0x3fc5b4dd; + pfVar1 = (float *)&UNK_000b2558; + } + else { + if (iVar2 != 48000) { + return; + } + iVar4 = 0x1000; + iVar3 = 0x3fc408b7; + pfVar1 = (float *)&UNK_000aa558; + } + break; + case 3: + if (iVar2 == 0xac44) { + iVar4 = 0x1000; + iVar3 = 0x3fcac8ef; + pfVar1 = (float *)&UNK_000b6558; + } + else { + if (iVar2 != 48000) { + return; + } + iVar4 = 0x1000; + iVar3 = 0x3fc8ad4f; + pfVar1 = (float *)&UNK_000c2550; + } + break; + case 4: + if (iVar2 == 0xac44) { + iVar4 = 0x1000; + iVar3 = 0x3fbbbc34; + pfVar1 = (float *)&DAT_000ae558; + } + else { + if (iVar2 != 48000) { + return; + } + iVar4 = 0x1000; + iVar3 = 0x3fbe5d74; + pfVar1 = (float *)&UNK_000bc554; + } + break; + default: + goto switchD_00065170_caseD_5; + } + if (iVar6 == 1) { + if (iVar2 == 0xac44) { + pfVar5 = (float *)&UNK_0009a560; + } + else { + pfVar5 = (float *)&UNK_000a055c; + joined_r0x00065304: + if (iVar2 != 48000) { + return; + } + } + } + else { + if (iVar6 == 2) { + if (iVar2 != 0xac44) { + pfVar5 = (float *)&UNK_00096560; + goto joined_r0x00065304; + } + pfVar5 = (float *)&UNK_000a6558; + } + else { + if (iVar6 == 3) { + if (iVar2 != 0xac44) { + pfVar5 = (float *)&UNK_00086560; + goto joined_r0x00065304; + } + pfVar5 = (float *)&UNK_000a2558; + } + else { + if (iVar6 != 4) { + return; + } + if (iVar2 == 0xac44) { + pfVar5 = (float *)&UNK_0009c55c; + } + else { + if (iVar2 != 48000) { + return; + } + pfVar5 = (float *)&DAT_0008e560; + } + } + } + } + LAB_000651f4: + if (pfVar1 != nullptr) { + fVar7 = (float)PConvSingle_F32::LoadKernel((PConvSingle_F32 *)this,pfVar1,fVar7,iVar3,iVar4); + PConvSingle_F32::LoadKernel(this_00,pfVar5,fVar7,iVar3,iVar4); + *(undefined4 *)&this->field_0x34 = 0x1000; + } + switchD_00065170_caseD_5: + return; +} + + + +// VHE::VHE() + +VHE::VHE() { + WaveBuffer_R32 *pWVar1; + + PConvSingle_F32::PConvSingle_F32((PConvSingle_F32 *)this); + PConvSingle_F32::PConvSingle_F32((PConvSingle_F32 *)&this->field_0x10); + *(undefined *)&this->field_0x2c = 0; + *(undefined4 *)&this->field_0x30 = 0; + *(undefined4 *)&this->field_0x34 = 0; + *(undefined4 *)&this->field_0x28 = 0xac44; + pWVar1 = (WaveBuffer_R32 *)operator_new(0x20); + WaveBuffer_R32::WaveBuffer_R32(pWVar1,2,0x1000); + *(WaveBuffer_R32 **)&this->field_0x20 = pWVar1; + pWVar1 = (WaveBuffer_R32 *)operator_new(0x20); + WaveBuffer_R32::WaveBuffer_R32(pWVar1,2,0x1000); + *(WaveBuffer_R32 **)&this->field_0x24 = pWVar1; + Reset(this); + return this; +} + + + +// VHE::SetEnable(bool) + +undefined4 VHE::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0x2c; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = *(char *)&this->field_0x2c; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0x2c = param_1; + return 1; +} + + + +// VHE::SetSamplingRate(unsigned int) + +void VHE::SetSamplingRate(uint param_1) { + if (*(uint *)&this->field_0x28 == param_1) { + return; + } + *(uint *)&this->field_0x28 = param_1; + Reset(this); + return; +} + + + +// VHE::SetEffectLevel(int) + +void VHE::SetEffectLevel(int param_1) { + if (*(int *)&this->field_0x30 == param_1) { + return; + } + if (4 < (uint)param_1) { + return; + } + *(int *)&this->field_0x30 = param_1; + Reset(this); + return; +} + + + +// VHE::Process(float*, float*, int) + +int VHE::Process(float *param_1,float *param_2,int param_3) { + int iVar1; + float *pfVar2; + uint uVar3; + + if ((((*(char *)&this->field_0x2c != '\0') && (*(int *)&this->field_0x20 != 0)) && + (*(int *)&this->field_0x24 != 0)) && + (iVar1 = PConvSingle_F32::InstanceUsable((PConvSingle_F32 *)this), iVar1 != 0)) { + iVar1 = PConvSingle_F32::InstanceUsable((PConvSingle_F32 *)&this->field_0x10); + if ((iVar1 != 0) && + (iVar1 = WaveBuffer_R32::PushSamples(*(WaveBuffer_R32 **)&this->field_0x20,param_1,param_3), + iVar1 != 0)) { + while (uVar3 = WaveBuffer_R32::GetBufferOffset(), *(uint *)&this->field_0x34 <= uVar3) { + pfVar2 = (float *)WaveBuffer_R32::GetCurrentBufferR32Ptr + (*(WaveBuffer_R32 **)&this->field_0x20); + PConvSingle_F32::ConvolveInterleaved((PConvSingle_F32 *)this,pfVar2,0); + PConvSingle_F32::ConvolveInterleaved((PConvSingle_F32 *)&this->field_0x10,pfVar2,1); + WaveBuffer_R32::PushSamples + (*(WaveBuffer_R32 **)&this->field_0x24,pfVar2,*(uint *)&this->field_0x34); + WaveBuffer_R32::PopSamples + (*(WaveBuffer_R32 **)&this->field_0x20,*(uint *)&this->field_0x34,true); + } + iVar1 = WaveBuffer_R32::PopSamples + (*(WaveBuffer_R32 **)&this->field_0x24,param_2,param_3,false); + return iVar1; + } + } + return param_3; +} diff --git a/src/effects/VHE.h b/src/effects/VHE.h new file mode 100644 index 0000000..e047994 --- /dev/null +++ b/src/effects/VHE.h @@ -0,0 +1,78 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_VHE_H +#define VIPER_VHE_H + + +class VHE { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; +public: + ~VHE(); + undefined GetEnabled(); + void Reset(); + VHE(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(uint param_1); + void SetEffectLevel(int param_1); + int Process(float *param_1,float *param_2,int param_3); +}; + + +#endif //VIPER_VHE_H diff --git a/src/effects/ViPERBass.cpp b/src/effects/ViPERBass.cpp new file mode 100644 index 0000000..3ca7840 --- /dev/null +++ b/src/effects/ViPERBass.cpp @@ -0,0 +1,370 @@ +// +// Created by mart on 2/12/21. +// + +#include "ViPERBass.h" + +// ViPERBass::~ViPERBass() + +ViPERBass::~ViPERBass() { + Polyphase *this_00; + WaveBuffer_I32 *this_01; + + this_00 = *(Polyphase **)this; + if (this_00 != nullptr) { + Polyphase::~Polyphase(this_00); + operator_delete(this_00); + } + if (*(void **)&this->field_0x4 != nullptr) { + operator_delete(*(void **)&this->field_0x4); + } + if (*(void **)&this->field_0x8 != nullptr) { + operator_delete(*(void **)&this->field_0x8); + } + this_01 = *(WaveBuffer_I32 **)&this->field_0xc; + if (this_01 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(this_01); + operator_delete(this_01); + } + return this; +} + + + +// ViPERBass::Reset() + +void ViPERBass::Reset(void) { + Polyphase **in_r0; + uint uVar1; + Polyphase *pPVar2; + WaveBuffer_I32 *this; + undefined4 in_cr7; + undefined4 in_s0; + undefined4 in_s1; + undefined8 uVar3; + float in_s2; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + + uVar3 = CONCAT44(in_s1,in_s0); + if (*in_r0 != nullptr) { + Polyphase::SetSamplingRate(*in_r0,(int)in_r0[6]); + uVar3 = Polyphase::Reset(*in_r0); + in_s2 = extraout_s2; + } + if ((WaveBuffer_I32 *)in_r0[3] != nullptr) { + WaveBuffer_I32::Reset((WaveBuffer_I32 *)in_r0[3]); + this = (WaveBuffer_I32 *)in_r0[3]; + uVar1 = Polyphase::GetLatency(); + uVar3 = WaveBuffer_I32::PushZeros(this,uVar1); + in_s2 = extraout_s2_00; + } + if (in_r0[2] != nullptr) { + FixedToFP(in_r0[10],0x20,0x20,0x19,0,0); + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + uVar3 = Subwoofer::SetBassGain((int)in_r0[2],(float)uVar3); + in_s2 = extraout_s2_01; + } + if ((FixedBiquad *)in_r0[1] != nullptr) { + FixedBiquad::SetLowPassParameter + ((FixedBiquad *)in_r0[1],(float)uVar3,(float)((ulonglong)uVar3 >> 0x20),in_s2); + } + pPVar2 = (Polyphase *)__divsi3(0x2000000,in_r0[6]); + in_r0[7] = pPVar2; + in_r0[8] = nullptr; + return; +} + + + +// ViPERBass::ViPERBass() + +ViPERBass::ViPERBass() { + Polyphase *this_00; + FixedBiquad *this_01; + Subwoofer *this_02; + WaveBuffer_I32 *this_03; + float fVar1; + float extraout_s0; + undefined8 uVar2; + float extraout_s2; + + *(undefined4 *)&this->field_0x24 = 0x3c; + *(undefined *)&this->field_0x10 = 0; + *(undefined *)&this->field_0x11 = 0; + *(undefined4 *)&this->field_0x14 = 0; + *(undefined4 *)&this->field_0x20 = 0; + *(undefined4 *)&this->field_0x28 = 0; + *(undefined4 *)&this->field_0x18 = 0xac44; + *(undefined4 *)&this->field_0x1c = 0x2f8; + this_00 = (Polyphase *)operator_new(0x1c); + Polyphase::Polyphase(this_00,2); + *(Polyphase **)this = this_00; + this_01 = (FixedBiquad *)operator_new(0x24); + FixedBiquad::FixedBiquad(this_01); + *(FixedBiquad **)&this->field_0x4 = this_01; + this_02 = (Subwoofer *)operator_new(0xd8); + Subwoofer::Subwoofer(this_02); + *(Subwoofer **)&this->field_0x8 = this_02; + this_03 = (WaveBuffer_I32 *)operator_new(0x20); + fVar1 = (float)WaveBuffer_I32::WaveBuffer_I32(this_03,1,0x1000); + *(WaveBuffer_I32 **)&this->field_0xc = this_03; + if (*(FixedBiquad **)&this->field_0x4 != nullptr) { + uVar2 = FixedBiquad::Reset(*(FixedBiquad **)&this->field_0x4); + FixedBiquad::SetLowPassParameter + (*(FixedBiquad **)&this->field_0x4,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + extraout_s2); + fVar1 = extraout_s0; + } + if (*(int *)&this->field_0x8 != 0) { + Subwoofer::SetBassGain(*(int *)&this->field_0x8,fVar1); + } + if ((((*(int *)this != 0) && (*(int *)&this->field_0x4 != 0)) && (*(int *)&this->field_0x8 != 0)) + && (*(int *)&this->field_0xc != 0)) { + *(undefined *)&this->field_0x11 = 1; + } + Reset(); + return this; +} + + + +// ViPERBass::SetEnable(bool) + +undefined4 ViPERBass::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0x10; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(); + cVar1 = *(char *)&this->field_0x10; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0x10 = param_1; + return 1; +} + + + +// ViPERBass::SetSamplingRate(int) + +void ViPERBass::SetSamplingRate(int param_1) { + undefined4 uVar1; + undefined4 in_cr7; + undefined8 extraout_d0; + undefined8 uVar2; + undefined8 extraout_d0_00; + float extraout_s2; + float extraout_s2_00; + float fVar3; + + if (*(int *)&this->field_0x18 == param_1) { + return; + } + *(int *)&this->field_0x18 = param_1; + uVar1 = __divsi3(0x2000000); + *(undefined4 *)&this->field_0x1c = uVar1; + fVar3 = extraout_s2; + uVar2 = extraout_d0; + if (*(Polyphase **)this != nullptr) { + uVar2 = Polyphase::SetSamplingRate(*(Polyphase **)this,param_1); + fVar3 = extraout_s2_00; + } + if (*(FixedBiquad **)&this->field_0x4 != nullptr) { + FixedBiquad::SetLowPassParameter + (*(FixedBiquad **)&this->field_0x4,(float)uVar2,(float)((ulonglong)uVar2 >> 0x20), + fVar3); + uVar2 = extraout_d0_00; + } + if (*(int *)&this->field_0x8 == 0) { + return; + } + FixedToFP(*(undefined4 *)&this->field_0x28,0x20,0x20,0x19,0,0); + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + Subwoofer::SetBassGain(*(int *)&this->field_0x8,(float)uVar2); + return; +} + + + +// ViPERBass::SetProcessMode(int) + +void ViPERBass::SetProcessMode(int param_1) { + if (2 < (uint)param_1) { + return; + } + if (*(int *)&this->field_0x14 == param_1) { + return; + } + *(int *)&this->field_0x14 = param_1; + Reset(); + return; +} + + + +// ViPERBass::SetSpeaker(int) + +void ViPERBass::SetSpeaker(int param_1) { + int in_r1; + float in_s0; + float in_s1; + float in_s2; + + if (*(int *)(param_1 + 0x24) == in_r1) { + return; + } + *(int *)(param_1 + 0x24) = in_r1; + if (*(FixedBiquad **)(param_1 + 4) == nullptr) { + return; + } + FixedBiquad::SetLowPassParameter(*(FixedBiquad **)(param_1 + 4),in_s0,in_s1,in_s2); + return; +} + + + +// ViPERBass::SetBassFactor(float) + +void ViPERBass::SetBassFactor(float param_1) { + int in_r0; + float in_r1; + char in_NG; + bool in_ZR; + char in_OV; + undefined4 in_cr6; + undefined4 in_cr7; + + if (in_ZR || in_NG != in_OV) { + return; + } + *(float *)(in_r0 + 0x28) = ROUND(in_r1 * 3.355443e+07 + 0.5); + if (*(int *)(in_r0 + 8) == 0) { + return; + } + coprocessor_function(10,2,4,in_cr7,in_cr6,in_cr7); + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + Subwoofer::SetBassGain(*(int *)(in_r0 + 8),param_1); + return; +} + + + +// ViPERBass::Process(int*, int) + +int ViPERBass::Process(int *param_1,int param_2) { + longlong lVar1; + ulonglong uVar2; + int iVar3; + int iVar4; + undefined4 uVar5; + int *piVar6; + int *piVar7; + int iVar8; + uint uVar9; + int iVar10; + undefined4 *puVar11; + int *piVar12; + int *piVar13; + undefined8 uVar14; + int local_30; + + if ((*(char *)&this->field_0x10 != '\0') && (*(char *)&this->field_0x11 != '\0')) { + iVar8 = *(int *)&this->field_0x20; + if ((iVar8 != 0x2000000) && (0 < param_2 * 2)) { + piVar6 = param_1 + 1; + piVar7 = param_1; + do { + piVar12 = piVar7 + 2; + lVar1 = (longlong)piVar6[-1] * (longlong)iVar8 + 0x1000000; + piVar6[-1] = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + lVar1 = (longlong)piVar7[1] * (longlong)*(int *)&this->field_0x20 + 0x1000000; + piVar7[1] = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + iVar8 = *(int *)&this->field_0x20 + *(int *)&this->field_0x1c; + if (0x2000000 < iVar8) { + iVar8 = 0x2000000; + } + *(int *)&this->field_0x20 = iVar8; + piVar6 = piVar6 + 2; + piVar7 = piVar12; + } while (piVar12 != param_1 + param_2 * 2); + } + iVar8 = *(int *)&this->field_0x14; + if (iVar8 == 0) { + if (0 < param_2 * 2) { + piVar6 = param_1 + 1; + do { + iVar8 = iVar8 + 2; + uVar2 = (longlong)(piVar6[-1] + param_1[1]) * 0x1000000 + 0x1000000; + uVar14 = VectorShiftRight((uVar2 & 0xffffffff00000000) + (uVar2 & 0xffffffff),0x19); + local_30 = (int)uVar14; + iVar3 = FixedBiquad::ProcessSample(*(FixedBiquad **)&this->field_0x4,local_30); + lVar1 = (longlong)iVar3 * (longlong)*(int *)&this->field_0x28 + 0x1000000; + uVar9 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + piVar6[-1] = piVar6[-1] + uVar9; + param_1[1] = param_1[1] + uVar9; + piVar6 = piVar6 + 2; + param_1 = param_1 + 2; + } while (iVar8 + param_2 * -2 < 0 != SBORROW4(iVar8,param_2 * 2)); + } + } + else { + if (iVar8 != 1) { + Subwoofer::Process(*(Subwoofer **)&this->field_0x8,param_1,param_2); + return param_2; + } + iVar8 = WaveBuffer_I32::PushSamples(*(WaveBuffer_I32 **)&this->field_0xc,param_1,param_2); + if (iVar8 != 0) { + iVar8 = param_2 * 2; + iVar3 = WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)&this->field_0xc); + iVar4 = WaveBuffer_I32::GetBufferOffset(); + if (0 < iVar8) { + iVar10 = 0; + puVar11 = (undefined4 *)(iVar3 + (iVar4 - param_2) * 4 + -4); + piVar6 = param_1; + do { + iVar3 = *piVar6; + piVar7 = piVar6 + 1; + iVar10 = iVar10 + 2; + piVar6 = piVar6 + 2; + lVar1 = (longlong)(iVar3 + *piVar7) * 0x1000000 + 0x1000000; + uVar5 = FixedBiquad::ProcessSample + (*(FixedBiquad **)&this->field_0x4, + (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + puVar11 = puVar11 + 1; + *puVar11 = uVar5; + } while (iVar10 + param_2 * -2 < 0 != SBORROW4(iVar10,iVar8)); + } + iVar3 = Polyphase::Process(*(Polyphase **)this,param_1,param_2); + if (iVar3 == param_2) { + piVar6 = (int *)WaveBuffer_I32::GetCurrentBufferI32Ptr + (*(WaveBuffer_I32 **)&this->field_0xc); + if (0 < iVar8) { + piVar7 = param_1 + 1; + piVar12 = param_1; + do { + piVar13 = piVar12 + 2; + lVar1 = (longlong)*piVar6 * (longlong)*(int *)&this->field_0x28 + 0x1000000; + piVar7[-1] = piVar7[-1] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + ; + lVar1 = (longlong)*piVar6 * (longlong)*(int *)&this->field_0x28 + 0x1000000; + piVar12[1] = piVar12[1] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + ; + piVar6 = piVar6 + 1; + piVar7 = piVar7 + 2; + piVar12 = piVar13; + } while (piVar13 != param_1 + param_2 * 2); + } + WaveBuffer_I32::PopSamples(*(WaveBuffer_I32 **)&this->field_0xc,param_2,true); + } + } + } + } + return param_2; +} diff --git a/src/effects/ViPERBass.h b/src/effects/ViPERBass.h new file mode 100644 index 0000000..0f3f8e1 --- /dev/null +++ b/src/effects/ViPERBass.h @@ -0,0 +1,68 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_VIPERBASS_H +#define VIPER_VIPERBASS_H + + +class ViPERBass { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + +public: + ~ViPERBass(); + void Reset(); + ViPERBass(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(int param_1); + void SetProcessMode(int param_1); + void SetSpeaker(int param_1); + void SetBassFactor(float param_1); + int Process(int *param_1,int param_2); +}; + + +#endif //VIPER_VIPERBASS_H diff --git a/src/effects/ViPERClarity.cpp b/src/effects/ViPERClarity.cpp new file mode 100644 index 0000000..cd29581 --- /dev/null +++ b/src/effects/ViPERClarity.cpp @@ -0,0 +1,183 @@ +// +// Created by mart on 2/13/21. +// + +#include "ViPERClarity.h" + +// ViPERClarity::~ViPERClarity() + +ViPERClarity::~ViPERClarity() { + HiFi::~HiFi((HiFi *)&this->field_0xa8); + return this; +} + + + +// ViPERClarity::SetClarityToFilter() + +void ViPERClarity::SetClarityToFilter(void) { + NoiseSharpening *in_r0; + float in_s0; + float fVar1; + + fVar1 = (float)NoiseSharpening::SetGain(in_r0,in_s0); + fVar1 = (float)HighShelf::SetGain(fVar1); + fVar1 = (float)HighShelf::SetGain(fVar1); + HiFi::SetClarity((HiFi *)(in_r0 + 0xa8),fVar1); + return; +} + + + +// ViPERClarity::Reset() + +void ViPERClarity::Reset() { + HighShelf *this_00; + HighShelf *this_01; + float fVar1; + + this_01 = (HighShelf *)&this->field_0x30; + NoiseSharpening::SetSamplingRate((NoiseSharpening *)this,*(int *)&this->field_0xd8); + NoiseSharpening::Reset(); + this_00 = (HighShelf *)&this->field_0x6c; + fVar1 = (float)SetClarityToFilter(); + fVar1 = (float)HighShelf::SetFrequency(this_01,fVar1); + HighShelf::SetQuality(this_01,fVar1); + fVar1 = (float)HighShelf::SetSamplingRate(this_01,*(int *)&this->field_0xd8); + fVar1 = (float)HighShelf::SetFrequency(this_00,fVar1); + HighShelf::SetQuality(this_00,fVar1); + HighShelf::SetSamplingRate(this_00,*(int *)&this->field_0xd8); + HiFi::SetSamplingRate((HiFi *)&this->field_0xa8,*(int *)&this->field_0xd8); + HiFi::Reset(); + return; +} + + + +// ViPERClarity::ViPERClarity() + +ViPERClarity::ViPERClarity() { + HighShelf *this_00; + HiFi *this_01; + float fVar1; + + fVar1 = (float)NoiseSharpening::NoiseSharpening((NoiseSharpening *)this); + this_00 = (HighShelf *)&this->field_0x30; + do { + fVar1 = (float)HighShelf::SetFrequency(this_00,fVar1); + fVar1 = (float)HighShelf::SetQuality(this_00,fVar1); + HighShelf::SetGain(fVar1); + this_01 = (HiFi *)(this_00 + 0x3c); + fVar1 = (float)HighShelf::SetSamplingRate(this_00,0xac44); + this_00 = (HighShelf *)this_01; + } while (this_01 != (HiFi *)&this->field_0xa8); + HiFi::HiFi(this_01); + *(undefined *)&this->field_0xd0 = 0; + *(undefined4 *)&this->field_0xd4 = 0; + *(undefined4 *)&this->field_0xdc = 0; + *(undefined4 *)&this->field_0xd8 = 0xac44; + Reset(this); + return this; +} + + + +// ViPERClarity::SetEnable(bool) + +undefined4 ViPERClarity::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)&this->field_0xd0; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = *(char *)&this->field_0xd0; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)&this->field_0xd0 = param_1; + return 1; +} + + + +// ViPERClarity::SetSamplingRate(int) + +void ViPERClarity::SetSamplingRate(int param_1) { + if (*(int *)&this->field_0xd8 == param_1) { + return; + } + *(int *)&this->field_0xd8 = param_1; + Reset(this); + return; +} + + + +// ViPERClarity::SetProcessMode(int) + +void ViPERClarity::SetProcessMode(int param_1) { + if (2 < (uint)param_1) { + return; + } + if (*(int *)&this->field_0xd4 == param_1) { + return; + } + *(int *)&this->field_0xd4 = param_1; + Reset(this); + return; +} + + + +// ViPERClarity::SetClarity(float) + +void ViPERClarity::SetClarity(float param_1) { + undefined4 in_r1; + + *(undefined4 *)&this->field_0xdc = in_r1; + if (*(int *)&this->field_0xd4 != 1) { + SetClarityToFilter(); + return; + } + Reset(this); + return; +} + + + +// ViPERClarity::Process(int*, int) + +int ViPERClarity::Process(int *param_1,int param_2) { + int iVar1; + int *piVar2; + int iVar3; + + if (*(char *)&this->field_0xd0 != '\0') { + if (*(int *)&this->field_0xd4 == 0) { + NoiseSharpening::Process((NoiseSharpening *)this,param_1,param_2); + return param_2; + } + if (*(int *)&this->field_0xd4 != 1) { + iVar3 = HiFi::Process((HiFi *)&this->field_0xa8,param_1,param_2); + return iVar3; + } + if (0 < param_2 * 2) { + piVar2 = param_1 + 1; + iVar3 = 0; + do { + iVar1 = HighShelf::Process((HighShelf *)&this->field_0x30,piVar2[-1]); + iVar3 = iVar3 + 2; + piVar2[-1] = iVar1; + iVar1 = HighShelf::Process((HighShelf *)&this->field_0x6c,param_1[1]); + param_1[1] = iVar1; + piVar2 = piVar2 + 2; + param_1 = param_1 + 2; + } while (iVar3 < param_2 * 2); + } + } + return param_2; +} diff --git a/src/effects/ViPERClarity.h b/src/effects/ViPERClarity.h new file mode 100644 index 0000000..c5597c8 --- /dev/null +++ b/src/effects/ViPERClarity.h @@ -0,0 +1,248 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_VIPERCLARITY_H +#define VIPER_VIPERCLARITY_H + + +class ViPERClarity { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined field_0x60; + undefined field_0x61; + undefined field_0x62; + undefined field_0x63; + undefined field_0x64; + undefined field_0x65; + undefined field_0x66; + undefined field_0x67; + undefined field_0x68; + undefined field_0x69; + undefined field_0x6a; + undefined field_0x6b; + undefined field_0x6c; + undefined field_0x6d; + undefined field_0x6e; + undefined field_0x6f; + undefined field_0x70; + undefined field_0x71; + undefined field_0x72; + undefined field_0x73; + undefined field_0x74; + undefined field_0x75; + undefined field_0x76; + undefined field_0x77; + undefined field_0x78; + undefined field_0x79; + undefined field_0x7a; + undefined field_0x7b; + undefined field_0x7c; + undefined field_0x7d; + undefined field_0x7e; + undefined field_0x7f; + undefined field_0x80; + undefined field_0x81; + undefined field_0x82; + undefined field_0x83; + undefined field_0x84; + undefined field_0x85; + undefined field_0x86; + undefined field_0x87; + undefined field_0x88; + undefined field_0x89; + undefined field_0x8a; + undefined field_0x8b; + undefined field_0x8c; + undefined field_0x8d; + undefined field_0x8e; + undefined field_0x8f; + undefined field_0x90; + undefined field_0x91; + undefined field_0x92; + undefined field_0x93; + undefined field_0x94; + undefined field_0x95; + undefined field_0x96; + undefined field_0x97; + undefined field_0x98; + undefined field_0x99; + undefined field_0x9a; + undefined field_0x9b; + undefined field_0x9c; + undefined field_0x9d; + undefined field_0x9e; + undefined field_0x9f; + undefined field_0xa0; + undefined field_0xa1; + undefined field_0xa2; + undefined field_0xa3; + undefined field_0xa4; + undefined field_0xa5; + undefined field_0xa6; + undefined field_0xa7; + undefined field_0xa8; + undefined field_0xa9; + undefined field_0xaa; + undefined field_0xab; + undefined field_0xac; + undefined field_0xad; + undefined field_0xae; + undefined field_0xaf; + undefined field_0xb0; + undefined field_0xb1; + undefined field_0xb2; + undefined field_0xb3; + undefined field_0xb4; + undefined field_0xb5; + undefined field_0xb6; + undefined field_0xb7; + undefined field_0xb8; + undefined field_0xb9; + undefined field_0xba; + undefined field_0xbb; + undefined field_0xbc; + undefined field_0xbd; + undefined field_0xbe; + undefined field_0xbf; + undefined field_0xc0; + undefined field_0xc1; + undefined field_0xc2; + undefined field_0xc3; + undefined field_0xc4; + undefined field_0xc5; + undefined field_0xc6; + undefined field_0xc7; + undefined field_0xc8; + undefined field_0xc9; + undefined field_0xca; + undefined field_0xcb; + undefined field_0xcc; + undefined field_0xcd; + undefined field_0xce; + undefined field_0xcf; + undefined field_0xd0; + undefined field_0xd1; + undefined field_0xd2; + undefined field_0xd3; + undefined field_0xd4; + undefined field_0xd5; + undefined field_0xd6; + undefined field_0xd7; + undefined field_0xd8; + undefined field_0xd9; + undefined field_0xda; + undefined field_0xdb; + undefined field_0xdc; + undefined field_0xdd; + undefined field_0xde; + undefined field_0xdf; + +public: + ~ViPERClarity(); + void SetClarityToFilter(); + void Reset(); + ViPERClarity(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(int param_1); + void SetProcessMode(int param_1); + void SetClarity(float param_1); + int Process(int *param_1,int param_2); +}; + + +#endif //VIPER_VIPERCLARITY_H diff --git a/src/effects/ViPERDDC.cpp b/src/effects/ViPERDDC.cpp new file mode 100644 index 0000000..ee4e48c --- /dev/null +++ b/src/effects/ViPERDDC.cpp @@ -0,0 +1,562 @@ +// +// Created by mart on 2/13/21. +// + +#include "ViPERDDC.h" + +// ViPERDDC::ViPERDDC() + +ViPERDDC::ViPERDDC() { + *(undefined4 *)&this->field_0x4 = 0xac44; + *(undefined *)this = 0; + *(undefined *)&this->field_0x1 = 0; + *(undefined4 *)&this->field_0x8 = 0; + *(undefined4 *)&this->field_0xc = 0; + *(undefined4 *)&this->field_0x10 = 0; + *(undefined4 *)&this->field_0x20 = 0; + *(undefined4 *)&this->field_0x1c = 0; + *(undefined4 *)&this->field_0x18 = 0; + *(undefined4 *)&this->field_0x14 = 0; + *(undefined4 *)&this->field_0x30 = 0; + *(undefined4 *)&this->field_0x2c = 0; + *(undefined4 *)&this->field_0x28 = 0; + *(undefined4 *)&this->field_0x24 = 0; + return; +} + + + +// ViPERDDC::ReleaseResources() + +void ViPERDDC::ReleaseResources() { + void *pvVar1; + void *pvVar2; + int iVar3; + int iVar4; + + pvVar1 = *(void **)&this->field_0xc; + if (pvVar1 != nullptr) { + iVar3 = *(int *)&this->field_0x8; + if (iVar3 < 1) { + LAB_0006da6c: + operator_delete__(pvVar1); + } + else { + iVar4 = 0; + do { + pvVar2 = *(void **)((int)pvVar1 + iVar4 * 4); + iVar4 = iVar4 + 1; + if (pvVar2 != nullptr) { + operator_delete__(pvVar2); + pvVar1 = *(void **)&this->field_0xc; + iVar3 = *(int *)&this->field_0x8; + } + } while (iVar4 < iVar3); + if (pvVar1 != nullptr) goto LAB_0006da6c; + } + *(undefined4 *)&this->field_0xc = 0; + } + pvVar1 = *(void **)&this->field_0x10; + if (pvVar1 == nullptr) goto LAB_0006dad4; + iVar3 = *(int *)&this->field_0x8; + if (iVar3 < 1) { + LAB_0006dac4: + operator_delete__(pvVar1); + } + else { + iVar4 = 0; + do { + pvVar2 = *(void **)((int)pvVar1 + iVar4 * 4); + iVar4 = iVar4 + 1; + if (pvVar2 != nullptr) { + operator_delete__(pvVar2); + pvVar1 = *(void **)&this->field_0x10; + iVar3 = *(int *)&this->field_0x8; + } + } while (iVar4 < iVar3); + if (pvVar1 != nullptr) goto LAB_0006dac4; + } + *(undefined4 *)&this->field_0x10 = 0; + LAB_0006dad4: + if (*(void **)&this->field_0x14 != nullptr) { + operator_delete__(*(void **)&this->field_0x14); + } + *(undefined4 *)&this->field_0x14 = 0; + if (*(void **)&this->field_0x18 != nullptr) { + operator_delete__(*(void **)&this->field_0x18); + } + *(undefined4 *)&this->field_0x18 = 0; + if (*(void **)&this->field_0x1c != nullptr) { + operator_delete__(*(void **)&this->field_0x1c); + } + *(undefined4 *)&this->field_0x1c = 0; + if (*(void **)&this->field_0x20 != nullptr) { + operator_delete__(*(void **)&this->field_0x20); + } + *(undefined4 *)&this->field_0x20 = 0; + if (*(void **)&this->field_0x24 != nullptr) { + operator_delete__(*(void **)&this->field_0x24); + } + *(undefined4 *)&this->field_0x24 = 0; + if (*(void **)&this->field_0x28 != nullptr) { + operator_delete__(*(void **)&this->field_0x28); + } + *(undefined4 *)&this->field_0x28 = 0; + if (*(void **)&this->field_0x2c != nullptr) { + operator_delete__(*(void **)&this->field_0x2c); + } + *(undefined4 *)&this->field_0x2c = 0; + if (*(void **)&this->field_0x30 != nullptr) { + operator_delete__(*(void **)&this->field_0x30); + } + *(undefined4 *)&this->field_0x30 = 0; + *(undefined *)&this->field_0x1 = 0; + return; +} + + + +// ViPERDDC::~ViPERDDC() + +ViPERDDC::~ViPERDDC() { + ReleaseResources(this); + return this; +} + + + +// ViPERDDC::Reset() + +void ViPERDDC::Reset() { + int iVar1; + int iVar2; + int iVar3; + int iVar4; + + if ((*(char *)&this->field_0x1 != '\0') && (0 < *(int *)&this->field_0x8)) { + iVar4 = *(int *)&this->field_0x14; + iVar2 = 0; + iVar3 = *(int *)&this->field_0x18; + iVar1 = 0; + do { + *(undefined4 *)(iVar4 + iVar2) = 0; + iVar1 = iVar1 + 1; + *(undefined4 *)(iVar3 + iVar2) = 0; + iVar2 = iVar2 + 4; + } while (iVar1 < *(int *)&this->field_0x8); + } + return; +} + + + +// ViPERDDC::SetEnable(bool) + +undefined4 ViPERDDC::SetEnable(bool param_1) { + char cVar1; + + cVar1 = *(char *)this; + if (cVar1 == '\0') { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = *(char *)this; + } + if (param_1 == (bool)cVar1) { + return 0; + } + *(bool *)this = param_1; + return 1; +} + + + +// ViPERDDC::SetSamplingRate(int) + +void ViPERDDC::SetSamplingRate(int param_1) { + if (*(int *)&this->field_0x4 == param_1) { + return; + } + *(int *)&this->field_0x4 = param_1; + Reset(this); + return; +} + + + +// ViPERDDC::SetCoeffs(int, float*, float*) + +void ViPERDDC::SetCoeffs(int param_1,float *param_2,float *param_3) { + uint uVar1; + void *pvVar2; + int iVar3; + int iVar4; + int iVar5; + int iVar6; + int iVar7; + float *pfVar8; + float *pfVar9; + float fVar10; + float fVar11; + + ReleaseResources(this); + uVar1 = param_1 / 5; + *(uint *)&this->field_0x8 = uVar1; + if (uVar1 < 0x1fc00001) { + uVar1 = uVar1 * 4; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0xc = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x10 = pvVar2; + if ((*(void **)&this->field_0xc != nullptr) && (pvVar2 != nullptr)) { + memset(*(void **)&this->field_0xc,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x10,0,*(int *)&this->field_0x8 << 2); + uVar1 = *(uint *)&this->field_0x8; + if (0 < (int)uVar1) { + iVar7 = *(int *)&this->field_0xc; + iVar4 = 0; + do { + pvVar2 = operator_new__(0x14); + *(void **)(iVar7 + iVar4 * 4) = pvVar2; + iVar7 = *(int *)&this->field_0x10; + pvVar2 = operator_new__(0x14); + *(void **)(iVar7 + iVar4 * 4) = pvVar2; + iVar7 = *(int *)&this->field_0xc; + iVar5 = *(int *)(iVar7 + iVar4 * 4); + if (iVar5 == 0) { + return; + } + iVar6 = *(int *)(*(int *)&this->field_0x10 + iVar4 * 4); + if (iVar6 == 0) { + return; + } + iVar3 = 0; + pfVar8 = param_2; + pfVar9 = param_3; + do { + fVar10 = *pfVar8; + pfVar8 = pfVar8 + 1; + fVar11 = *pfVar9; + pfVar9 = pfVar9 + 1; + *(float *)(iVar5 + iVar3) = ROUND(fVar10 * 3.355443e+07 + 0.5); + *(float *)(iVar6 + iVar3) = ROUND(fVar11 * 3.355443e+07 + 0.5); + iVar3 = iVar3 + 4; + } while (iVar3 != 0x14); + uVar1 = *(uint *)&this->field_0x8; + iVar4 = iVar4 + 1; + param_2 = param_2 + 5; + param_3 = param_3 + 5; + } while (iVar4 < (int)uVar1); + } + if (uVar1 < 0x1fc00001) { + uVar1 = uVar1 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x14 = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x18 = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x1c = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x20 = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x24 = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x28 = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x2c = pvVar2; + if (*(uint *)&this->field_0x8 < 0x1fc00001) { + uVar1 = *(uint *)&this->field_0x8 << 2; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)&this->field_0x30 = pvVar2; + if (((((*(void **)&this->field_0x14 != nullptr) && (*(int *)&this->field_0x18 != 0)) && + (*(int *)&this->field_0x1c != 0)) && + ((*(int *)&this->field_0x20 != 0 && (*(int *)&this->field_0x24 != 0)))) && + ((*(int *)&this->field_0x28 != 0 && ((*(int *)&this->field_0x2c != 0 && (pvVar2 != nullptr)))))) + { + memset(*(void **)&this->field_0x14,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x18,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x1c,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x20,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x24,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x28,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x2c,0,*(int *)&this->field_0x8 << 2); + memset(*(void **)&this->field_0x30,0,*(int *)&this->field_0x8 << 2); + *(undefined *)&this->field_0x1 = 1; + } + } + return; +} + + + +// ViPERDDC::Process(int*, int) + +void ViPERDDC::Process(int *param_1,int param_2) { + longlong lVar1; + int iVar2; + int iVar3; + uint uVar4; + int iVar5; + uint uVar6; + int iVar7; + int *piVar8; + int iVar9; + int iVar10; + uint uVar11; + int iVar12; + int iVar13; + int iVar14; + int iVar15; + int iVar16; + int iVar17; + int iVar18; + int iVar19; + int iVar20; + int iVar21; + int *local_34; + int *local_30; + uint local_2c; + + if ((*(char *)&this->field_0x1 != '\0') && (*(char *)this != '\0')) { + if (*(int *)&this->field_0x4 == 0xac44) { + if (0 < param_2 * 2) { + local_34 = param_1; + local_30 = param_1 + 1; + do { + uVar11 = local_34[1]; + if (*(int *)&this->field_0x8 < 1) { + local_2c = 0; + uVar6 = 0; + } + else { + iVar12 = *(int *)&this->field_0x1c; + iVar2 = 0; + iVar17 = *(int *)&this->field_0x24; + iVar21 = 0; + iVar16 = *(int *)&this->field_0xc; + iVar7 = *(int *)&this->field_0x14; + iVar15 = *(int *)&this->field_0x2c; + uVar6 = local_30[-1]; + do { + piVar8 = *(int **)(iVar16 + iVar2); + iVar21 = iVar21 + 1; + iVar5 = *(int *)(iVar7 + iVar2); + iVar13 = *(int *)(iVar12 + iVar2); + iVar3 = piVar8[1]; + iVar19 = piVar8[2]; + iVar14 = *piVar8; + iVar20 = piVar8[3]; + iVar9 = piVar8[4]; + iVar18 = *(int *)(iVar15 + iVar2); + iVar10 = *(int *)(iVar17 + iVar2); + *(int *)(iVar15 + iVar2) = iVar10; + lVar1 = (longlong)iVar9 * (longlong)iVar18 + + (longlong)iVar20 * (longlong)iVar10 + + (longlong)iVar19 * (longlong)iVar13 + + (longlong)iVar14 * (longlong)(int)uVar6 + (longlong)iVar3 * (longlong)iVar5; + uVar4 = (uint)lVar1; + local_2c = uVar4 + 0x1000000 >> 0x19 | + ((int)((ulonglong)lVar1 >> 0x20) + (uint)(0xfeffffff < uVar4)) * 0x80; + *(uint *)(iVar17 + iVar2) = local_2c; + *(undefined4 *)(iVar12 + iVar2) = *(undefined4 *)(iVar7 + iVar2); + *(uint *)(iVar7 + iVar2) = uVar6; + iVar2 = iVar2 + 4; + uVar6 = local_2c; + } while (iVar21 < *(int *)&this->field_0x8); + if (*(int *)&this->field_0x8 < 1) { + uVar6 = 0; + } + else { + iVar17 = *(int *)&this->field_0x30; + iVar7 = 0; + iVar15 = *(int *)&this->field_0x20; + iVar2 = 0; + iVar12 = *(int *)&this->field_0x28; + iVar21 = *(int *)&this->field_0x18; + do { + iVar2 = iVar2 + 1; + iVar13 = *(int *)(iVar21 + iVar7); + iVar18 = *(int *)(iVar15 + iVar7); + piVar8 = *(int **)(iVar16 + iVar7); + iVar3 = piVar8[1]; + iVar5 = piVar8[2]; + iVar19 = *piVar8; + iVar14 = piVar8[3]; + iVar9 = piVar8[4]; + iVar20 = *(int *)(iVar17 + iVar7); + iVar10 = *(int *)(iVar12 + iVar7); + *(int *)(iVar17 + iVar7) = iVar10; + lVar1 = (longlong)iVar9 * (longlong)iVar20 + + (longlong)iVar14 * (longlong)iVar10 + + (longlong)iVar5 * (longlong)iVar18 + + (longlong)iVar19 * (longlong)(int)uVar11 + + (longlong)iVar3 * (longlong)iVar13; + uVar6 = (uint)lVar1; + uVar6 = uVar6 + 0x1000000 >> 0x19 | + ((int)((ulonglong)lVar1 >> 0x20) + (uint)(0xfeffffff < uVar6)) * 0x80; + *(uint *)(iVar12 + iVar7) = uVar6; + *(undefined4 *)(iVar15 + iVar7) = *(undefined4 *)(iVar21 + iVar7); + *(uint *)(iVar21 + iVar7) = uVar11; + iVar7 = iVar7 + 4; + uVar11 = uVar6; + } while (iVar2 < *(int *)&this->field_0x8); + } + } + piVar8 = local_34 + 2; + local_30[-1] = local_2c; + local_34[1] = uVar6; + local_34 = piVar8; + local_30 = local_30 + 2; + } while (piVar8 != param_1 + param_2 * 2); + } + } + else { + if ((*(int *)&this->field_0x4 == 48000) && (0 < param_2 * 2)) { + local_34 = param_1; + local_30 = param_1 + 1; + do { + uVar11 = local_34[1]; + if (*(int *)&this->field_0x8 < 1) { + local_2c = 0; + uVar6 = 0; + } + else { + iVar12 = *(int *)&this->field_0x1c; + iVar2 = 0; + iVar17 = *(int *)&this->field_0x24; + iVar21 = 0; + iVar16 = *(int *)&this->field_0x10; + iVar7 = *(int *)&this->field_0x14; + iVar15 = *(int *)&this->field_0x2c; + uVar6 = local_30[-1]; + do { + piVar8 = *(int **)(iVar16 + iVar2); + iVar21 = iVar21 + 1; + iVar5 = *(int *)(iVar7 + iVar2); + iVar18 = *(int *)(iVar12 + iVar2); + iVar3 = piVar8[1]; + iVar13 = *piVar8; + iVar19 = piVar8[2]; + iVar20 = piVar8[3]; + iVar9 = piVar8[4]; + iVar14 = *(int *)(iVar15 + iVar2); + iVar10 = *(int *)(iVar17 + iVar2); + *(int *)(iVar15 + iVar2) = iVar10; + lVar1 = (longlong)iVar9 * (longlong)iVar14 + + (longlong)iVar20 * (longlong)iVar10 + + (longlong)iVar19 * (longlong)iVar18 + + (longlong)iVar13 * (longlong)(int)uVar6 + (longlong)iVar3 * (longlong)iVar5; + uVar4 = (uint)lVar1; + local_2c = uVar4 + 0x1000000 >> 0x19 | + ((int)((ulonglong)lVar1 >> 0x20) + (uint)(0xfeffffff < uVar4)) * 0x80; + *(uint *)(iVar17 + iVar2) = local_2c; + *(undefined4 *)(iVar12 + iVar2) = *(undefined4 *)(iVar7 + iVar2); + *(uint *)(iVar7 + iVar2) = uVar6; + iVar2 = iVar2 + 4; + uVar6 = local_2c; + } while (iVar21 < *(int *)&this->field_0x8); + if (*(int *)&this->field_0x8 < 1) { + uVar6 = 0; + } + else { + iVar17 = *(int *)&this->field_0x30; + iVar7 = 0; + iVar15 = *(int *)&this->field_0x20; + iVar2 = 0; + iVar12 = *(int *)&this->field_0x28; + iVar21 = *(int *)&this->field_0x18; + do { + iVar2 = iVar2 + 1; + iVar13 = *(int *)(iVar21 + iVar7); + iVar18 = *(int *)(iVar15 + iVar7); + piVar8 = *(int **)(iVar16 + iVar7); + iVar3 = piVar8[1]; + iVar5 = piVar8[2]; + iVar19 = *piVar8; + iVar14 = piVar8[3]; + iVar9 = piVar8[4]; + iVar20 = *(int *)(iVar17 + iVar7); + iVar10 = *(int *)(iVar12 + iVar7); + *(int *)(iVar17 + iVar7) = iVar10; + lVar1 = (longlong)iVar9 * (longlong)iVar20 + + (longlong)iVar14 * (longlong)iVar10 + + (longlong)iVar5 * (longlong)iVar18 + + (longlong)iVar19 * (longlong)(int)uVar11 + + (longlong)iVar3 * (longlong)iVar13; + uVar6 = (uint)lVar1; + uVar6 = uVar6 + 0x1000000 >> 0x19 | + ((int)((ulonglong)lVar1 >> 0x20) + (uint)(0xfeffffff < uVar6)) * 0x80; + *(uint *)(iVar12 + iVar7) = uVar6; + *(undefined4 *)(iVar15 + iVar7) = *(undefined4 *)(iVar21 + iVar7); + *(uint *)(iVar21 + iVar7) = uVar11; + iVar7 = iVar7 + 4; + uVar11 = uVar6; + } while (iVar2 < *(int *)&this->field_0x8); + } + } + piVar8 = local_34 + 2; + local_30[-1] = local_2c; + local_34[1] = uVar6; + local_34 = piVar8; + local_30 = local_30 + 2; + } while (piVar8 != param_1 + param_2 * 2); + } + } + } + return; +} diff --git a/src/effects/ViPERDDC.h b/src/effects/ViPERDDC.h new file mode 100644 index 0000000..ca798d7 --- /dev/null +++ b/src/effects/ViPERDDC.h @@ -0,0 +1,75 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_VIPERDDC_H +#define VIPER_VIPERDDC_H + + +class ViPERDDC { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + +public: + ViPERDDC(); + void ReleaseResources(); + ~ViPERDDC(); + void Reset(); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(int param_1); + void SetCoeffs(int param_1,float *param_2,float *param_3); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_VIPERDDC_H diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..e364e9b --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,175 @@ +// +// Created by mart on 2/12/21. +// + +#include +#include +#include +#include "main.h" +#include "effects/Effect.h" +#include "util/misc.h" +#include "ProcessUnit_FX.h" +#include "data.h" + +int EffectRelease(handle *param_1) { + Effect *this_; + + if (param_1 != nullptr) { + __android_log_print(4,"ViPER4Android_v2","EffectRelease(), Deconstructing ProcessUnit"); + this_ = param_1->field_0x4; + delete this_; + + free(param_1); + return OK; + } + return EINVAL; +} + + + +// uuidToString(effect_uuid_s const*, char*) + +int uuidToString(effect_uuid_s *param_1,char *param_2) { + sprintf(param_2,"%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", + param_1->field_0x0, + (uint)param_1->field_0x4, + (uint)param_1->field_0x6, + (uint)param_1->field_0x8, + (uint)param_1->field_0xa, + (uint)param_1->field_0xb, + (uint)param_1->field_0xc, + (uint)param_1->field_0xd, + (uint)param_1->field_0xe, + (uint)param_1->field_0xf); + return OK; +} + +int EffectCreate(effect_uuid_s *uuid, int sessionId, int ioId, handle *pHandle) { + int iVar1; + handle* ptr; + ProcessUnit_FX *this_; + char acStack164 [128]; + int local_24; + + local_24 = __stack_chk_guard; + __android_log_print(4,"ViPER4Android_v2","Enter EffectCreate()"); + if (uuid == nullptr) { + __android_log_print(4,"ViPER4Android_v2","EffectCreate(), Error [uuid = nullptr]"); + iVar1 = -0x16; + } + else { + if (pHandle == nullptr) { + __android_log_print(4,"ViPER4Android_v2","EffectCreate(), Error [pEffect = nullptr]"); + iVar1 = -0x16; + } + else { + uuidToString(uuid, acStack164); + __android_log_print(4,"ViPER4Android_v2","EffectCreate(), uuid = %s",acStack164); + iVar1 = memcmp(uuid, &DAT_000d127c, 0x10); + if (iVar1 == 0) { + ptr = (handle*)calloc(1,0xc); + if (ptr == nullptr) { + __android_log_print(4,"ViPER4Android_v2", + "EffectCreate(), v4a standard effect, Error [calloc() return nullptr]"); + iVar1 = -0x16; + } + else { + __android_log_print(4,"ViPER4Android_v2", + + "EffectCreate(), v4a standard effect (normal), Constructing ProcessUnit_FX" + ); + ptr->interface = (intf *)&PTR_LAB_000d0cb0; + this_ = new ProcessUnit_FX(); + ptr->core = this_; + if (this_ == nullptr) { + __android_log_print(4,"ViPER4Android_v2", + + "EffectCreate(), v4a standard effect, Error [new ProcessUnit_FX() return nullptr]" + ); + __android_log_print(4,"ViPER4Android_v2", + + "EffectCreate(), v4a standard effect, Error [ProcessUnit_FX construct failed]" + ); + free(ptr); + iVar1 = -0x16; + } + else { + ptr->descriptor = &DAT_000d126c; + __android_log_print(4,"ViPER4Android_v2","Creating %s", + s_ViPER4Android__2_5_0_4__000d1298); + *&pHandle = ptr; + } + } + } + else { + __android_log_print(4,"ViPER4Android_v2","EffectCreate(), Error [effect not found]"); + iVar1 = -2; + } + } + } + if (local_24 == __stack_chk_guard) { + return iVar1; + } + // WARNING: Subroutine does not return + __stack_chk_fail(); +} + + + +int EffectGetDescriptor(effect_uuid_s *uuid, effect_descriptor_t *pDescriptor) { + int iVar1; + char uuidAsString [128]; + int local_24; + + __android_log_print(4, "ViPER4Android_v2", "Enter EffectGetDescriptor()"); + + if (uuid == nullptr) { + __android_log_print(4, "ViPER4Android_v2", "EffectGetDescriptor(), uuid = nullptr"); + return -EINVAL; + } + + if (pDescriptor == nullptr) { + __android_log_print(4, "ViPER4Android_v2", "EffectGetDescriptor(), pDescriptor = nullptr"); + return -EINVAL; + } + + uuidToString(uuid, uuidAsString); + __android_log_print(4, "ViPER4Android_v2", "EffectGetDescriptor(), uuid = %s", uuidAsString); + iVar1 = memcmp(uuid, &DAT_000d126c.uuid, 0x10); + if (iVar1 == 0) { + memcpy(pDescriptor, &DAT_000d126c, 0xac); + return OK; + } + + __android_log_print(4,"ViPER4Android_v2","EffectGetDescriptor(), Error [uuid not found]"); + return -ENOENT; +} + + +int GetLibraryVersionMain() { + return 2; +} + + + +int GetLibraryVersionSub() { + return 5; +} + + + +int GetLibraryVersionExt() { + return 0; +} + + + +int GetLibraryVersionBuild() { + return 4; +} + + + +char * GetLibraryVersionCodename() { + return (char*)"Beautiful"; +} diff --git a/src/main.h b/src/main.h new file mode 100644 index 0000000..09bce0d --- /dev/null +++ b/src/main.h @@ -0,0 +1,43 @@ + +#ifndef VIPER_MAIN +#define VIPER_MAIN + +#include "util/misc.h" +#include "ProcessUnit_FX.h" + +typedef struct intf { + int32_t (*process)(effect_handle_t self, + audio_buffer_t *inBuffer, + audio_buffer_t *outBuffer); + int32_t (*command)(effect_handle_t self, + uint32_t cmdCode, + uint32_t cmdSize, + void *pCmdData, + uint32_t *replySize, + void *pReplyData); + int32_t (*get_descriptor)(effect_handle_t self, + effect_descriptor_t *pDescriptor); + int32_t (*process_reverse)(effect_handle_t self, + audio_buffer_t *inBuffer, + audio_buffer_t *outBuffer); +} intf; + +typedef struct handle { + intf* interface; + ProcessUnit_FX* core; + void* descriptor; +} handle; + +extern "C" { + int EffectRelease(handle *param_1); + int uuidToString(effect_uuid_s *param_1,char *param_2); + int EffectCreate(effect_uuid_s *uuid, int sessionId, int ioId, handle *pHandle); + int EffectGetDescriptor(effect_uuid_s *uuid, effect_descriptor_t *pDescriptor); + int GetLibraryVersionMain(); + int GetLibraryVersionSub(); + int GetLibraryVersionExt(); + int GetLibraryVersionBuild(); + char * GetLibraryVersionCodename(); +}; + +#endif diff --git a/src/util/AdaptiveBuffer_FPI32.cpp b/src/util/AdaptiveBuffer_FPI32.cpp new file mode 100644 index 0000000..300495f --- /dev/null +++ b/src/util/AdaptiveBuffer_FPI32.cpp @@ -0,0 +1,541 @@ +// +// Created by mart on 2/12/21. +// + +#include "AdaptiveBuffer_FPI32.h" + + +// AdaptiveBuffer_FPI32::AdaptiveBuffer_FPI32(unsigned int, unsigned int) + +AdaptiveBuffer_FPI32::AdaptiveBuffer_FPI32(uint param_1,uint param_2) { + void *pvVar1; + + this->channels = param_1; + this->bufferPointer = nullptr; + this->bufferLength = 0; + this->bufferOffset = 0; + if (param_1 != 0) { + pvVar1 = valloc(param_1 * param_2 * 4); + this->bufferPointer = pvVar1; + if (pvVar1 != nullptr) { + this->bufferLength = param_2; + } + } + return this; +} + + + +// AdaptiveBuffer_FPI32::~AdaptiveBuffer_FPI32() + +AdaptiveBuffer_FPI32::~AdaptiveBuffer_FPI32() { +if (this->bufferPointer != nullptr) { +free(this->bufferPointer); +} +this->bufferPointer = nullptr; +return this; +} + + + +// AdaptiveBuffer_FPI32::FlushBuffer() + +void AdaptiveBuffer_FPI32::FlushBuffer() { +this->bufferOffset = 0; +return; +} + + + +// AdaptiveBuffer_FPI32::PushZero(unsigned int) + +undefined4 AdaptiveBuffer_FPI32::PushZero(uint param_1) { + int iVar1; + int iVar2; + void *__dest; + + __dest = this->bufferPointer; + if (__dest == nullptr) { + return 0; + } + iVar2 = this->bufferOffset; + if (this->bufferLength < param_1 + iVar2) { + __dest = valloc((param_1 + iVar2) * this->channels * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,this->bufferPointer,this->channels * this->bufferOffset * 4); + free(this->bufferPointer); + iVar2 = this->bufferOffset; + this->bufferPointer = __dest; + this->bufferLength = param_1 + iVar2; + } + iVar1 = this->channels * 4; + memset((void *)(iVar2 * iVar1 + (int)__dest),0,iVar1 * param_1); + this->bufferOffset = this->bufferOffset + param_1; + return 1; +} + + + +// AdaptiveBuffer_FPI32::PushFrames(short*, unsigned int) + +undefined4 AdaptiveBuffer_FPI32::PushFrames(short *param_1,uint param_2) { + undefined4 uVar1; + undefined4 uVar2; + int iVar3; + undefined8 *puVar4; + int *piVar5; + short *psVar6; + int iVar7; + short *psVar8; + void *__dest; + undefined8 *puVar9; + short *psVar10; + uint uVar11; + uint uVar12; + short *psVar13; + undefined auVar14 [16]; + undefined auVar15 [16]; + undefined auVar16 [16]; + undefined auVar17 [16]; + + __dest = this->bufferPointer; + if (__dest == nullptr) { + return 0; + } + if (param_2 == 0) { + return 1; + } + iVar7 = this->bufferOffset; + if (this->bufferLength < param_2 + iVar7) { + __dest = valloc((param_2 + iVar7) * this->channels * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,this->bufferPointer,this->channels * this->bufferOffset * 4); + free(this->bufferPointer); + iVar7 = this->bufferOffset; + this->bufferPointer = __dest; + this->bufferLength = param_2 + iVar7; + } + uVar12 = this->channels * param_2; + puVar4 = (undefined8 *)(iVar7 * this->channels * 4 + (int)__dest); + if ((int)uVar12 < 0x10) { + if (0 < (int)uVar12) { + piVar5 = (int *)((int)puVar4 + -4); + iVar7 = 0; + do { + psVar13 = (short *)((int)param_1 + iVar7); + iVar7 = iVar7 + 2; + piVar5 = piVar5 + 1; + *piVar5 = (int)*psVar13 << 10; + } while (iVar7 != uVar12 * 2); + iVar7 = this->bufferOffset; + } + this->bufferOffset = iVar7 + param_2; + return 1; + } + uVar11 = uVar12 & 0xfffffff0; + if (uVar11 != 0) { + iVar7 = 0; + puVar9 = puVar4; + psVar13 = param_1; + do { + psVar8 = psVar13 + 8; + psVar6 = psVar13 + 0xc; + iVar7 = iVar7 + 0x10; + uVar1 = CONCAT22(*psVar13,*psVar13); + psVar10 = psVar13 + 4; + psVar13 = psVar13 + 0x10; + uVar2 = CONCAT22(*psVar10,*psVar10); + auVar17 = VectorShiftLongLeft(CONCAT44(uVar1,uVar1),10); + uVar1 = CONCAT22(*psVar8,*psVar8); + auVar16 = VectorShiftLongLeft(CONCAT44(uVar2,uVar2),10); + uVar2 = CONCAT22(*psVar6,*psVar6); + auVar15 = VectorShiftLongLeft(CONCAT44(uVar1,uVar1),10); + auVar14 = VectorShiftLongLeft(CONCAT44(uVar2,uVar2),10); + *puVar9 = CONCAT44(SUB164(auVar17,0),SUB164(auVar17,0)); + uVar1 = SUB164(auVar17 >> 0x40,0); + *(ulonglong *)((int)puVar9 + 4) = CONCAT44(uVar1,uVar1); + puVar9[2] = CONCAT44(SUB164(auVar16,0),SUB164(auVar16,0)); + uVar1 = SUB164(auVar16 >> 0x40,0); + *(ulonglong *)((int)puVar9 + 0x14) = CONCAT44(uVar1,uVar1); + puVar9[4] = CONCAT44(SUB164(auVar15,0),SUB164(auVar15,0)); + uVar1 = SUB164(auVar15 >> 0x40,0); + *(ulonglong *)((int)puVar9 + 0x24) = CONCAT44(uVar1,uVar1); + puVar9[6] = CONCAT44(SUB164(auVar14,0),SUB164(auVar14,0)); + uVar1 = SUB164(auVar14 >> 0x40,0); + *(ulonglong *)((int)puVar9 + 0x34) = CONCAT44(uVar1,uVar1); + puVar9 = puVar9 + 8; + } while (iVar7 < (int)uVar11); + } + if (uVar12 - uVar11 != 0 && (int)uVar11 <= (int)uVar12) { + puVar4 = (undefined8 *)((int)puVar4 + (uVar11 + 0x3fffffff) * 4); + iVar7 = 0; + do { + iVar3 = iVar7 + uVar11 * 2; + iVar7 = iVar7 + 2; + puVar4 = (undefined8 *)((int)puVar4 + 4); + *(int *)puVar4 = (int)*(short *)((int)param_1 + iVar3) << 10; + } while (iVar7 != (uVar12 - uVar11) * 2); + } + this->bufferOffset = this->bufferOffset + param_2; + return 1; +} + + + +// AdaptiveBuffer_FPI32::PushFrames(int*, unsigned int) + +undefined4 AdaptiveBuffer_FPI32::PushFrames(int *param_1,uint param_2) { + int iVar1; + int iVar2; + void *__dest; + + __dest = this->bufferPointer; + if (__dest == nullptr) { + return 0; + } + if (param_2 != 0) { + iVar2 = this->bufferOffset; + if (this->bufferLength < param_2 + iVar2) { + __dest = valloc((param_2 + iVar2) * this->channels * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,this->bufferPointer,this->channels * this->bufferOffset * 4); + free(this->bufferPointer); + iVar2 = this->bufferOffset; + this->bufferPointer = __dest; + this->bufferLength = param_2 + iVar2; + } + iVar1 = this->channels * 4; + memcpy((void *)(iVar2 * iVar1 + (int)__dest),param_1,iVar1 * param_2); + this->bufferOffset = this->bufferOffset + param_2; + return 1; + } + return 1; +} + + + +// AdaptiveBuffer_FPI32::PopFrames(short*, unsigned int) + +undefined4 AdaptiveBuffer_FPI32::PopFrames(short *param_1,uint param_2) { + undefined auVar1 [16]; + int *piVar2; + ulonglong *puVar3; + uint uVar4; + int iVar5; + uint uVar6; + uint uVar7; + void *__dest; + undefined4 *puVar8; + int iVar9; + ulonglong uVar10; + undefined auVar11 [16]; + ulonglong uVar12; + undefined auVar13 [16]; + ulonglong uVar14; + undefined auVar15 [16]; + undefined8 uVar16; + undefined auVar18 [16]; + ulonglong uVar17; + + __dest = this->bufferPointer; + if ((__dest == nullptr) || (uVar4 = this->bufferOffset, uVar4 < param_2)) { + return 0; + } + if (param_2 != 0) { + uVar7 = this->channels; + uVar6 = uVar7 * param_2; + if ((int)uVar6 < 0x10) { + if (0 < (int)uVar6) { + piVar2 = (int *)((int)__dest + -4); + iVar5 = 0; + do { + piVar2 = piVar2 + 1; + iVar9 = *piVar2 + 0x200; + if (iVar9 < -0x2000000) { + iVar9 = -0x2000000; + } + if (0x1fffffe < iVar9) { + iVar9 = 0x1ffffff; + } + *(short *)((int)param_1 + iVar5) = (short)(iVar9 >> 10); + iVar5 = iVar5 + 2; + } while (iVar5 != uVar6 * 2); + } + iVar5 = uVar4 - param_2; + this->bufferOffset = iVar5; + if (iVar5 != 0) { + memmove(__dest,(void *)((int)__dest + uVar6 * 4),iVar5 * uVar7 * 4); + } + } + else { + uVar7 = uVar6 & 0xfffffff0; + if (uVar7 != 0) { + auVar1 = SIMDExpandImmediate(0,2,2); + iVar5 = 0; + puVar3 = (ulonglong *)(param_1 + 4); + while( true ) { + puVar8 = (undefined4 *)((int)__dest + iVar5); + auVar18 = VectorAdd(CONCAT88(CONCAT44(puVar8[1],puVar8[1]),CONCAT44(*puVar8,*puVar8)), + auVar1,4); + iVar5 = iVar5 + 0x40; + auVar15 = VectorAdd(CONCAT88(CONCAT44(puVar8[5],puVar8[5]),CONCAT44(puVar8[4],puVar8[4])), + auVar1,4); + auVar13 = VectorAdd(CONCAT88(CONCAT44(puVar8[9],puVar8[9]),CONCAT44(puVar8[8],puVar8[8])), + auVar1,4); + auVar11 = VectorAdd(CONCAT88(CONCAT44(puVar8[0xd],puVar8[0xd]), + CONCAT44(puVar8[0xc],puVar8[0xc])),auVar1,4); + uVar16 = VectorShiftRightNarrow(auVar18,10,2,0); + uVar17 = SatQ(uVar16,2,0); + uVar16 = VectorShiftRightNarrow(auVar15,10,2,0); + uVar14 = SatQ(uVar16,2,0); + uVar16 = VectorShiftRightNarrow(auVar13,10,2,0); + uVar12 = SatQ(uVar16,2,0); + uVar16 = VectorShiftRightNarrow(auVar11,10,2,0); + uVar10 = SatQ(uVar16,2,0); + uVar17 = uVar17 & 0xffff | (uVar17 & 0xffff) << 0x10; + puVar3[-1] = uVar17 | uVar17 << 0x20; + uVar17 = uVar14 & 0xffff | (uVar14 & 0xffff) << 0x10; + *puVar3 = uVar17 | uVar17 << 0x20; + uVar17 = uVar12 & 0xffff | (uVar12 & 0xffff) << 0x10; + puVar3[1] = uVar17 | uVar17 << 0x20; + uVar17 = uVar10 & 0xffff | (uVar10 & 0xffff) << 0x10; + puVar3[2] = uVar17 | uVar17 << 0x20; + if (puVar3 == (ulonglong *)((int)(param_1 + 4) + uVar7 * 2 + -0x20)) break; + __dest = this->bufferPointer; + puVar3 = puVar3 + 4; + } + uVar4 = this->bufferOffset; + } + if (uVar6 - uVar7 != 0 && (int)uVar7 <= (int)uVar6) { + iVar5 = 0; + piVar2 = (int *)((int)this->bufferPointer + (uVar7 + 0x3fffffff) * 4); + do { + piVar2 = piVar2 + 1; + iVar9 = *piVar2 + 0x200; + if (iVar9 < -0x2000000) { + iVar9 = -0x2000000; + } + if (0x1fffffe < iVar9) { + iVar9 = 0x1ffffff; + } + *(short *)((int)param_1 + iVar5 + uVar7 * 2) = (short)(iVar9 >> 10); + iVar5 = iVar5 + 2; + } while (iVar5 != (uVar6 - uVar7) * 2); + } + iVar5 = uVar4 - param_2; + this->bufferOffset = iVar5; + if (iVar5 != 0) { + iVar9 = this->channels * 4; + memmove(this->bufferPointer,(void *)(iVar9 * param_2 + (int)this->bufferPointer), + iVar9 * iVar5); + return 1; + } + } + } + return 1; +} + + + +// AdaptiveBuffer_FPI32::ScaleFrames(int) + +void AdaptiveBuffer_FPI32::ScaleFrames(int param_1) { + undefined4 uVar1; + longlong lVar2; + ulonglong *puVar3; + int iVar4; + int iVar5; + uint *puVar6; + uint *puVar7; + uint *puVar8; + uint uVar9; + uint uVar10; + ulonglong uVar11; + undefined auVar12 [16]; + undefined8 uVar13; + undefined auVar15 [16]; + ulonglong uVar14; + + puVar6 = (uint *)this->bufferPointer; + if (puVar6 != nullptr) { + uVar9 = this->bufferOffset * this->channels; + if ((int)uVar9 < 4) { + if (0 < (int)uVar9) { + puVar7 = puVar6; + do { + lVar2 = (longlong)(int)*puVar7 * (longlong)param_1 + 0x1000000; + puVar8 = puVar7 + 1; + *puVar7 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + puVar7 = puVar8; + } while (puVar8 != puVar6 + uVar9); + } + } + else { + uVar10 = uVar9 & 0xfffffffc; + if (uVar10 != 0) { + iVar4 = 8; + iVar5 = 0; + while( true ) { + puVar3 = (ulonglong *)(puVar6 + iVar5); + iVar5 = iVar5 + 4; + uVar1 = *(undefined4 *)puVar3; + auVar15 = VectorMultiply(CONCAT44(*(undefined4 *)((int)puVar6 + iVar4), + *(undefined4 *)((int)puVar6 + iVar4)), + CONCAT44(param_1,param_1),4,0); + auVar12 = VectorMultiply(CONCAT44(uVar1,uVar1),CONCAT44(param_1,param_1),4,0); + auVar15 = VectorAdd(auVar15,CONCAT88(0x1000000,0x1000000),8); + auVar12 = VectorAdd(auVar12,CONCAT88(0x1000000,0x1000000),8); + uVar13 = VectorShiftRightNarrow(auVar15,0x19,4,0); + uVar14 = SatQ(uVar13,4,0); + uVar13 = VectorShiftRightNarrow(auVar12,0x19,4,0); + uVar11 = SatQ(uVar13,4,0); + *puVar3 = uVar11 & 0xffffffff | (uVar11 & 0xffffffff) << 0x20; + puVar3 = (ulonglong *)((int)this->bufferPointer + iVar4); + iVar4 = iVar4 + 0x10; + *puVar3 = uVar14 & 0xffffffff | (uVar14 & 0xffffffff) << 0x20; + if ((int)uVar10 <= iVar5) break; + puVar6 = (uint *)this->bufferPointer; + } + } + if (uVar9 - uVar10 != 0 && (int)uVar10 <= (int)uVar9) { + puVar6 = (uint *)((int)this->bufferPointer + uVar10 * 4); + do { + uVar10 = uVar10 + 1; + lVar2 = (longlong)(int)*puVar6 * (longlong)param_1 + 0x1000000; + *puVar6 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + puVar6 = puVar6 + 1; + } while (uVar9 - uVar10 != 0); + return; + } + } + } + return; +} + + + +// AdaptiveBuffer_FPI32::PanFrames(int, int) + +void AdaptiveBuffer_FPI32::PanFrames(int param_1,int param_2) { + uint uVar1; + undefined4 uVar2; + longlong lVar3; + ulonglong *puVar4; + int iVar5; + int iVar6; + uint uVar7; + uint uVar8; + uint *puVar9; + ulonglong uVar10; + undefined auVar11 [16]; + undefined8 uVar12; + undefined auVar14 [16]; + int local_20 [2]; + ulonglong uVar13; + + puVar9 = (uint *)this->bufferPointer; + if ((puVar9 != nullptr) && (this->channels == 2)) { + local_20[0] = param_1; + local_20[1] = param_2; + uVar1 = this->bufferOffset * 2; + if ((int)uVar1 < 4) { + if (0 < (int)uVar1) { + uVar8 = 0; + while( true ) { + uVar8 = uVar8 + 1; + lVar3 = (longlong)(int)*puVar9 * (longlong)param_1 + 0x1000000; + *puVar9 = (uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7; + if (uVar1 == uVar8) break; + param_1 = local_20[uVar8 & 1]; + puVar9 = puVar9 + 1; + } + return; + } + } + else { + uVar8 = uVar1 & 0xfffffffc; + if (uVar8 != 0) { + iVar5 = 8; + iVar6 = 0; + while( true ) { + puVar4 = (ulonglong *)(puVar9 + iVar6); + iVar6 = iVar6 + 4; + uVar2 = *(undefined4 *)puVar4; + auVar14 = VectorMultiply(CONCAT44(*(undefined4 *)((int)puVar9 + iVar5), + *(undefined4 *)((int)puVar9 + iVar5)), + CONCAT44(param_1,param_1),4,0); + auVar11 = VectorMultiply(CONCAT44(uVar2,uVar2),CONCAT44(param_1,param_1),4,0); + auVar14 = VectorAdd(auVar14,CONCAT88(0x1000000,0x1000000),8); + auVar11 = VectorAdd(auVar11,CONCAT88(0x1000000,0x1000000),8); + uVar12 = VectorShiftRightNarrow(auVar14,0x19,4,0); + uVar13 = SatQ(uVar12,4,0); + uVar12 = VectorShiftRightNarrow(auVar11,0x19,4,0); + uVar10 = SatQ(uVar12,4,0); + *puVar4 = uVar10 & 0xffffffff | (uVar10 & 0xffffffff) << 0x20; + puVar4 = (ulonglong *)((int)this->bufferPointer + iVar5); + iVar5 = iVar5 + 0x10; + *puVar4 = uVar13 & 0xffffffff | (uVar13 & 0xffffffff) << 0x20; + if ((int)uVar8 <= iVar6) break; + puVar9 = (uint *)this->bufferPointer; + } + } + if ((int)uVar8 < (int)uVar1) { + puVar9 = (uint *)((int)this->bufferPointer + uVar8 * 4); + do { + uVar7 = uVar8 & 1; + uVar8 = uVar8 + 1; + lVar3 = (longlong)(int)*puVar9 * (longlong)local_20[uVar7] + 0x1000000; + *puVar9 = (uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7; + puVar9 = puVar9 + 1; + } while (uVar1 != uVar8); + } + } + } + return; +} + + + +// AdaptiveBuffer_FPI32::SetBufferOffset(unsigned int) + +void AdaptiveBuffer_FPI32::SetBufferOffset(uint param_1) { + this->bufferOffset = param_1; + return; +} + + + +// AdaptiveBuffer_FPI32::GetBufferPointer() + +void * AdaptiveBuffer_FPI32::GetBufferPointer() { +return this->bufferPointer; +} + + + +// AdaptiveBuffer_FPI32::GetBufferLength() + +uint AdaptiveBuffer_FPI32::GetBufferLength() { +return this->bufferLength; +} + + + +// AdaptiveBuffer_FPI32::GetBufferOffset() + +undefined4 AdaptiveBuffer_FPI32::GetBufferOffset() { +return this->bufferOffset; +} + + +// AdaptiveBuffer_FPI32::GetChannels() + +uint AdaptiveBuffer_FPI32::GetChannels() { +return this->channels; +} diff --git a/src/util/AdaptiveBuffer_FPI32.h b/src/util/AdaptiveBuffer_FPI32.h new file mode 100644 index 0000000..ae07e69 --- /dev/null +++ b/src/util/AdaptiveBuffer_FPI32.h @@ -0,0 +1,50 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_ADAPTIVEBUFFER_FPI32_H +#define VIPER_ADAPTIVEBUFFER_FPI32_H + +#include "../libv4a_fx.so.h" + +class AdaptiveBuffer_FPI32 { + void * bufferPointer; + uint bufferLength; + undefined4 bufferOffset; + uint channels; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + +public: + AdaptiveBuffer_FPI32(uint param_1,uint param_2); + ~AdaptiveBuffer_FPI32(); + void FlushBuffer(); + undefined4 PushZero(uint param_1); + undefined4 PushFrames(short *param_1,uint param_2); + undefined4 PushFrames(int *param_1,uint param_2); + undefined4 PopFrames(short *param_1,uint param_2); + void ScaleFrames(int param_1); + void PanFrames(int param_1,int param_2); + void SetBufferOffset(uint param_1); + void * GetBufferPointer(); + uint GetBufferLength(); + undefined4 GetBufferOffset(); + uint GetChannels(); +}; + + +#endif //VIPER_ADAPTIVEBUFFER_FPI32_H diff --git a/src/util/AdaptiveBuffer_R32.cpp b/src/util/AdaptiveBuffer_R32.cpp new file mode 100644 index 0000000..e30523d --- /dev/null +++ b/src/util/AdaptiveBuffer_R32.cpp @@ -0,0 +1,541 @@ +// +// Created by mart on 2/12/21. +// + +#include "AdaptiveBuffer_R32.h" + + +// AdaptiveBuffer_R32::AdaptiveBuffer_R32(unsigned int, unsigned int) + +AdaptiveBuffer_R32::AdaptiveBuffer_R32(uint param_1,uint param_2) { + void *pvVar1; + + this->channels = param_1; + this->bufferPointer = nullptr; + this->bufferLength = 0; + this->bufferOffset = 0; + if (param_1 != 0) { + pvVar1 = valloc(param_1 * param_2 * 4); + this->bufferPointer = pvVar1; + if (pvVar1 != nullptr) { + this->bufferLength = param_2; + } + } + return this; +} + + + +// AdaptiveBuffer_R32::~AdaptiveBuffer_R32() + +AdaptiveBuffer_R32::~AdaptiveBuffer_R32() { + if (this->bufferPointer != nullptr) { + free(this->bufferPointer); + } + this->bufferPointer = nullptr; + return this; +} + + + +// AdaptiveBuffer_R32::Short2Float(short*, float*, unsigned int) + +void AdaptiveBuffer_R32::Short2Float(short *param_1,float *param_2,uint param_3) { + bool bVar1; + undefined4 uVar2; + int iVar3; + undefined8 *puVar4; + short *psVar5; + float *pfVar6; + uint uVar7; + uint uVar8; + uint uVar9; + undefined4 in_cr7; + undefined auVar10 [16]; + + uVar7 = this->channels * param_3; + if (uVar7 < 4) { + iVar3 = uVar7 - 1; + if (uVar7 != 0) { + psVar5 = param_1 + uVar7; + pfVar6 = param_2 + uVar7; + do { + psVar5 = psVar5 + -1; + iVar3 = iVar3 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + pfVar6 = pfVar6 + -1; + *pfVar6 = (float)(longlong)(int)*psVar5; + } while (iVar3 != -1); + } + } + else { + uVar9 = uVar7 & 3; + if (uVar7 >> 2 != 0) { + puVar4 = (undefined8 *)param_2; + uVar7 = uVar7 >> 2; + psVar5 = param_1; + do { + uVar2 = CONCAT22(*psVar5,*psVar5); + psVar5 = psVar5 + 4; + auVar10 = VectorCopyLong(CONCAT44(uVar2,uVar2),2,0); + auVar10 = FixedToFP(auVar10,0x20,0x20,0,0,0); + auVar10 = FloatVectorMult(auVar10,ZEXT816(0x3800010038000100) & + ZEXT816(0x3800010038000100) << 0x40,2,0x20); + uVar8 = uVar7 - 1; + *puVar4 = CONCAT44(SUB164(auVar10,0),SUB164(auVar10,0)); + uVar2 = SUB164(auVar10 >> 0x40,0); + *(ulonglong *)((int)puVar4 + 4) = CONCAT44(uVar2,uVar2); + puVar4 = puVar4 + 2; + bVar1 = 0 < (int)uVar7; + uVar7 = uVar8; + } while (uVar8 != 0 && bVar1); + } + if (uVar9 != 0) { + psVar5 = param_1 + uVar9; + pfVar6 = param_2 + uVar9; + iVar3 = uVar9 - 1; + do { + psVar5 = psVar5 + -1; + iVar3 = iVar3 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + pfVar6 = pfVar6 + -1; + *pfVar6 = (float)(longlong)(int)*psVar5; + } while (iVar3 != -1); + return; + } + } + return; +} + + + +// AdaptiveBuffer_R32::Float2Short(float*, short*, unsigned int) + +void AdaptiveBuffer_R32::Float2Short(float *param_1,short *param_2,uint param_3) { + bool bVar1; + undefined auVar2 [16]; + float fVar3; + int iVar4; + ulonglong *puVar5; + float *pfVar6; + short *psVar7; + uint uVar8; + uint uVar9; + uint uVar10; + float *pfVar11; + undefined4 in_cr7; + ulonglong uVar12; + undefined auVar13 [16]; + undefined auVar14 [16]; + + uVar8 = this->channels * param_3; + if (uVar8 < 4) { + iVar4 = uVar8 - 1; + if (uVar8 != 0) { + pfVar6 = param_1 + uVar8; + psVar7 = param_2 + uVar8; + do { + pfVar6 = pfVar6 + -1; + iVar4 = iVar4 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + psVar7 = psVar7 + -1; + *psVar7 = SUB42(ROUND(*pfVar6),0); + } while (iVar4 != -1); + } + } + else { + uVar10 = uVar8 & 3; + if (uVar8 >> 2 != 0) { + auVar2 = ZEXT816(0x3f8000003f800000) & ZEXT816(0x3f8000003f800000) << 0x40; + auVar14 = FloatVectorNeg(auVar2,2,0x20); + puVar5 = (ulonglong *)param_2; + uVar8 = uVar8 >> 2; + pfVar6 = param_1; + do { + fVar3 = *pfVar6; + pfVar11 = pfVar6 + 1; + pfVar6 = pfVar6 + 4; + auVar13 = FloatVectorMin(CONCAT88(CONCAT44(*pfVar11,*pfVar11),CONCAT44(fVar3,fVar3)),auVar2, + 2,0x20); + auVar13 = FloatVectorMax(auVar13,auVar14,2,0x20); + auVar13 = FloatVectorMult(auVar13,ZEXT816(0x46fffe0046fffe00) & + ZEXT816(0x46fffe0046fffe00) << 0x40,2,0x20); + auVar13 = FPToFixed(auVar13,0x20,0x20,0x10,0,3); + uVar12 = VectorRoundShiftRightNarrow(auVar13,0x10); + uVar9 = uVar8 - 1; + uVar12 = uVar12 & 0xffff | (uVar12 & 0xffff) << 0x10; + *puVar5 = uVar12 | uVar12 << 0x20; + puVar5 = puVar5 + 1; + bVar1 = 0 < (int)uVar8; + uVar8 = uVar9; + } while (uVar9 != 0 && bVar1); + } + if (uVar10 != 0) { + pfVar6 = param_1 + uVar10; + psVar7 = param_2 + uVar10; + iVar4 = uVar10 - 1; + do { + pfVar6 = pfVar6 + -1; + iVar4 = iVar4 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + psVar7 = psVar7 + -1; + *psVar7 = SUB42(ROUND(*pfVar6),0); + } while (iVar4 != -1); + return; + } + } + return; +} + + + +// AdaptiveBuffer_R32::FlushBuffer() + +void AdaptiveBuffer_R32::FlushBuffer() { + this->bufferOffset = 0; + return; +} + + + +// AdaptiveBuffer_R32::PushZero(unsigned int) + +undefined4 AdaptiveBuffer_R32::PushZero(uint param_1) { + int iVar1; + int iVar2; + void *__dest; + + __dest = this->bufferPointer; + if (__dest == nullptr) { + return 0; + } + iVar2 = this->bufferOffset; + if (this->bufferLength < param_1 + iVar2) { + __dest = valloc((param_1 + iVar2) * this->channels * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,this->bufferPointer,this->channels * this->bufferOffset * 4); + free(this->bufferPointer); + iVar2 = this->bufferOffset; + this->bufferPointer = __dest; + this->bufferLength = param_1 + iVar2; + } + iVar1 = this->channels * 4; + memset((void *)(iVar2 * iVar1 + (int)__dest),0,iVar1 * param_1); + this->bufferOffset = this->bufferOffset + param_1; + return 1; +} + + + +// AdaptiveBuffer_R32::PushFrames(short*, unsigned int) + +undefined4 AdaptiveBuffer_R32::PushFrames(short *param_1,uint param_2) { + int iVar1; + void *__dest; + + __dest = this->bufferPointer; + if (__dest == nullptr) { + return 0; + } + if (param_2 != 0) { + iVar1 = this->bufferOffset; + if (this->bufferLength < param_2 + iVar1) { + __dest = valloc((param_2 + iVar1) * this->channels * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,this->bufferPointer,this->channels * this->bufferOffset * 4); + free(this->bufferPointer); + iVar1 = this->bufferOffset; + this->bufferPointer = __dest; + this->bufferLength = param_2 + iVar1; + } + Short2Float(this,param_1,(float *)(iVar1 * this->channels * 4 + (int)__dest),param_2); + this->bufferOffset = this->bufferOffset + param_2; + return 1; + } + return 1; +} + + + +// AdaptiveBuffer_R32::PopFrames(short*, unsigned int) + +undefined4 AdaptiveBuffer_R32::PopFrames(short *param_1,uint param_2) { + int iVar1; + int iVar2; + + if (((float *)this->bufferPointer != nullptr) && (param_2 <= (uint)this->bufferOffset)) { + if (param_2 != 0) { + Float2Short(this,(float *)this->bufferPointer,param_1,param_2); + iVar2 = this->bufferOffset - param_2; + this->bufferOffset = iVar2; + if (iVar2 != 0) { + iVar1 = this->channels * 4; + memmove(this->bufferPointer,(void *)(iVar1 * param_2 + (int)this->bufferPointer), + iVar1 * iVar2); + } + } + return 1; + } + return 0; +} + + + +// WARNING: Restarted to delay deadcode elimination for space: register +// AdaptiveBuffer_R32::ScaleFrames(float) + +void AdaptiveBuffer_R32::ScaleFrames(float param_1) { + undefined auVar1 [16]; + undefined4 uVar2; + undefined4 uVar4; + undefined4 in_r1; + uint uVar6; + undefined4 *puVar7; + undefined8 *puVar8; + int iVar9; + uint uVar10; + int iVar11; + int iVar12; + undefined4 *puVar13; + int iVar14; + undefined4 in_cr7; + undefined auVar15 [16]; + undefined auVar16 [16]; + undefined auVar17 [16]; + undefined4 uVar3; + undefined4 uVar5; + + puVar7 = (undefined4 *)this->bufferPointer; + if ((puVar7 != nullptr) && (-1 < (int)puVar7)) { + uVar6 = this->bufferOffset * this->channels; + if ((int)uVar6 < 0x10) { + if (0 < (int)uVar6) { + iVar9 = 0; + do { + iVar9 = iVar9 + 1; + coprocessor_function(10,2,1,in_cr7,in_cr7,in_cr7); + *puVar7 = *puVar7; + puVar7 = puVar7 + 1; + } while (uVar6 - iVar9 != 0); + } + } + else { + uVar10 = uVar6 & 0xfffffff0; + auVar1 = ZEXT816(CONCAT44(in_r1,in_r1)) & ZEXT816(CONCAT44(in_r1,in_r1)) << 0x40; + if (uVar10 != 0) { + iVar9 = 0x10; + iVar14 = 0; + while( true ) { + puVar8 = (undefined8 *)(puVar7 + iVar14); + iVar12 = iVar9 + 0x10; + iVar11 = iVar9 + 0x20; + uVar2 = *(undefined4 *)((int)puVar7 + iVar9); + uVar3 = ((undefined4 *)((int)puVar7 + iVar9))[1]; + puVar13 = (undefined4 *)((int)puVar7 + iVar12); + puVar7 = (undefined4 *)((int)puVar7 + iVar11); + iVar14 = iVar14 + 0x10; + auVar17 = FloatVectorMult(CONCAT88(CONCAT44(*(undefined4 *)((int)puVar8 + 4), + *(undefined4 *)((int)puVar8 + 4)), + CONCAT44(*(undefined4 *)puVar8,*(undefined4 *)puVar8)), + auVar1,2,0x20); + auVar16 = FloatVectorMult(CONCAT88(CONCAT44(uVar3,uVar3),CONCAT44(uVar2,uVar2)),auVar1,2, + 0x20); + uVar2 = *puVar7; + uVar3 = puVar7[1]; + uVar4 = *puVar13; + uVar5 = puVar13[1]; + auVar15 = FloatVectorMult(CONCAT88(CONCAT44(uVar5,uVar5),CONCAT44(uVar4,uVar4)),auVar1,2, + 0x20); + *puVar8 = CONCAT44(SUB164(auVar17,0),SUB164(auVar17,0)); + uVar4 = SUB164(auVar17 >> 0x40,0); + *(ulonglong *)((int)puVar8 + 4) = CONCAT44(uVar4,uVar4); + auVar17 = FloatVectorMult(CONCAT88(CONCAT44(uVar3,uVar3),CONCAT44(uVar2,uVar2)),auVar1,2, + 0x20); + puVar8 = (undefined8 *)((int)this->bufferPointer + iVar9); + iVar9 = iVar9 + 0x40; + *puVar8 = CONCAT44(SUB164(auVar16,0),SUB164(auVar16,0)); + uVar2 = SUB164(auVar16 >> 0x40,0); + *(ulonglong *)((int)puVar8 + 4) = CONCAT44(uVar2,uVar2); + puVar8 = (undefined8 *)((int)this->bufferPointer + iVar12); + *puVar8 = CONCAT44(SUB164(auVar15,0),SUB164(auVar15,0)); + uVar2 = SUB164(auVar15 >> 0x40,0); + *(ulonglong *)((int)puVar8 + 4) = CONCAT44(uVar2,uVar2); + puVar8 = (undefined8 *)((int)this->bufferPointer + iVar11); + *puVar8 = CONCAT44(SUB164(auVar17,0),SUB164(auVar17,0)); + uVar2 = SUB164(auVar17 >> 0x40,0); + *(ulonglong *)((int)puVar8 + 4) = CONCAT44(uVar2,uVar2); + if ((int)uVar10 <= iVar14) break; + puVar7 = (undefined4 *)this->bufferPointer; + } + } + if (uVar6 - uVar10 != 0 && (int)uVar10 <= (int)uVar6) { + puVar7 = (undefined4 *)((int)this->bufferPointer + uVar10 * 4); + do { + uVar10 = uVar10 + 1; + coprocessor_function(10,2,1,in_cr7,in_cr7,in_cr7); + *puVar7 = *puVar7; + puVar7 = puVar7 + 1; + } while (uVar6 - uVar10 != 0); + } + } + } + return; +} + + + +// AdaptiveBuffer_R32::PanFrames(float, float) + +void AdaptiveBuffer_R32::PanFrames(float param_1,float param_2) { + uint uVar1; + undefined4 uVar2; + undefined4 uVar4; + undefined4 in_r1; + int iVar6; + undefined4 in_r2; + int iVar7; + uint uVar8; + undefined4 *puVar9; + uint uVar10; + undefined8 *puVar11; + int iVar12; + int iVar13; + undefined4 *puVar14; + bool bVar15; + undefined4 in_cr7; + undefined8 uVar16; + undefined8 uVar17; + undefined auVar18 [16]; + undefined auVar19 [16]; + undefined auVar20 [16]; + undefined4 local_28 [4]; + undefined4 uVar3; + undefined4 uVar5; + + puVar9 = (undefined4 *)this->bufferPointer; + if (((puVar9 != nullptr) && (bVar15 = -1 < (int)(this->channels - 2), this->channels == 2)) && + ((bVar15 || (bVar15)))) { + uVar1 = this->bufferOffset * 2; + if ((int)uVar1 < 0x10) { + if (0 < (int)uVar1) { + uVar10 = 0; + while( true ) { + uVar10 = uVar10 + 1; + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + *puVar9 = in_r1; + puVar9 = puVar9 + 1; + if (uVar1 == uVar10) break; + in_r1 = local_28[uVar10 & 3]; + } + return; + } + } + else { + uVar10 = uVar1 & 0xfffffff0; + uVar16 = CONCAT44(in_r1,in_r1); + uVar17 = CONCAT44(in_r2,in_r2); + if (uVar10 != 0) { + iVar7 = 0x10; + iVar6 = 0; + while( true ) { + puVar11 = (undefined8 *)(puVar9 + iVar6); + iVar13 = iVar7 + 0x10; + iVar12 = iVar7 + 0x20; + uVar2 = *(undefined4 *)((int)puVar9 + iVar7); + uVar3 = ((undefined4 *)((int)puVar9 + iVar7))[1]; + puVar14 = (undefined4 *)((int)puVar9 + iVar13); + puVar9 = (undefined4 *)((int)puVar9 + iVar12); + iVar6 = iVar6 + 0x10; + auVar20 = FloatVectorMult(CONCAT88(CONCAT44(*(undefined4 *)((int)puVar11 + 4), + *(undefined4 *)((int)puVar11 + 4)), + CONCAT44(*(undefined4 *)puVar11,*(undefined4 *)puVar11) + ),CONCAT88(uVar17,uVar16),2,0x20); + auVar19 = FloatVectorMult(CONCAT88(CONCAT44(uVar3,uVar3),CONCAT44(uVar2,uVar2)), + CONCAT88(uVar17,uVar16),2,0x20); + uVar2 = *puVar9; + uVar3 = puVar9[1]; + uVar4 = *puVar14; + uVar5 = puVar14[1]; + auVar18 = FloatVectorMult(CONCAT88(CONCAT44(uVar5,uVar5),CONCAT44(uVar4,uVar4)), + CONCAT88(uVar17,uVar16),2,0x20); + *puVar11 = CONCAT44(SUB164(auVar20,0),SUB164(auVar20,0)); + uVar4 = SUB164(auVar20 >> 0x40,0); + *(ulonglong *)((int)puVar11 + 4) = CONCAT44(uVar4,uVar4); + auVar20 = FloatVectorMult(CONCAT88(CONCAT44(uVar3,uVar3),CONCAT44(uVar2,uVar2)), + CONCAT88(uVar17,uVar16),2,0x20); + puVar11 = (undefined8 *)((int)this->bufferPointer + iVar7); + iVar7 = iVar7 + 0x40; + *puVar11 = CONCAT44(SUB164(auVar19,0),SUB164(auVar19,0)); + uVar2 = SUB164(auVar19 >> 0x40,0); + *(ulonglong *)((int)puVar11 + 4) = CONCAT44(uVar2,uVar2); + puVar11 = (undefined8 *)((int)this->bufferPointer + iVar13); + *puVar11 = CONCAT44(SUB164(auVar18,0),SUB164(auVar18,0)); + uVar2 = SUB164(auVar18 >> 0x40,0); + *(ulonglong *)((int)puVar11 + 4) = CONCAT44(uVar2,uVar2); + puVar11 = (undefined8 *)((int)this->bufferPointer + iVar12); + *puVar11 = CONCAT44(SUB164(auVar20,0),SUB164(auVar20,0)); + uVar2 = SUB164(auVar20 >> 0x40,0); + *(ulonglong *)((int)puVar11 + 4) = CONCAT44(uVar2,uVar2); + if ((int)uVar10 <= iVar6) break; + puVar9 = (undefined4 *)this->bufferPointer; + } + } + if ((int)uVar10 < (int)uVar1) { + puVar9 = (undefined4 *)((int)this->bufferPointer + uVar10 * 4); + do { + uVar8 = uVar10 & 3; + uVar10 = uVar10 + 1; + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + *puVar9 = local_28[uVar8]; + puVar9 = puVar9 + 1; + } while (uVar1 != uVar10); + } + } + } + return; +} + + + +// AdaptiveBuffer_R32::SetBufferOffset(unsigned int) + +void AdaptiveBuffer_R32::SetBufferOffset(uint param_1) { + this->bufferOffset = param_1; + return; +} + + + +// AdaptiveBuffer_R32::GetBufferPointer() + +void * AdaptiveBuffer_R32::GetBufferPointer() { + return this->bufferPointer; +} + + + +// AdaptiveBuffer_R32::GetBufferLength() + +uint AdaptiveBuffer_R32::GetBufferLength() { + return this->bufferLength; +} + + + +// AdaptiveBuffer_R32::GetBufferOffset() + +undefined4 AdaptiveBuffer_R32::GetBufferOffset() { + return this->bufferOffset; +} + + + +// AdaptiveBuffer_R32::GetChannels() + +uint AdaptiveBuffer_R32::GetChannels() { + return this->channels; +} diff --git a/src/util/AdaptiveBuffer_R32.h b/src/util/AdaptiveBuffer_R32.h new file mode 100644 index 0000000..3f5aaa8 --- /dev/null +++ b/src/util/AdaptiveBuffer_R32.h @@ -0,0 +1,36 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_ADAPTIVEBUFFER_R32_H +#define VIPER_ADAPTIVEBUFFER_R32_H + + +#include "AdaptiveBuffer_FPI32.h" + +class AdaptiveBuffer_R32 { + void * bufferPointer; + uint bufferLength; + undefined4 bufferOffset; + uint channels; + +public: + AdaptiveBuffer_R32(uint param_1,uint param_2); + ~AdaptiveBuffer_R32(); + void Short2Float(short *param_1,float *param_2,uint param_3); + void Float2Short(float *param_1,short *param_2,uint param_3); + void FlushBuffer(); + undefined4 PushZero(uint param_1); + undefined4 PushFrames(short *param_1,uint param_2); + undefined4 PopFrames(short *param_1,uint param_2); + void ScaleFrames(float param_1); + void PanFrames(float param_1,float param_2); + void SetBufferOffset(uint param_1); + void * GetBufferPointer(); + uint GetBufferLength(); + undefined4 GetBufferOffset(); + uint GetChannels(); +}; + + +#endif //VIPER_ADAPTIVEBUFFER_R32_H diff --git a/src/util/CAllpassFilter.cpp b/src/util/CAllpassFilter.cpp new file mode 100644 index 0000000..faca183 --- /dev/null +++ b/src/util/CAllpassFilter.cpp @@ -0,0 +1,85 @@ +// +// Created by mart on 2/12/21. +// + +#include "CAllpassFilter.h" + + +// CAllpassFilter::CAllpassFilter() + +CAllpassFilter::CAllpassFilter() { + this->field_0x4 = 0; + this->field_0x8 = 0; + this->field_0xc = 0; + this->feedback = 0; + return; +} + + + +// CAllpassFilter::SetBuffer(int*, int) + +void CAllpassFilter::SetBuffer(int *param_1,int param_2) { + this->field_0x4 = param_1; + this->field_0x8 = param_2; + return; +} + + + +// CAllpassFilter::Process(int) + +int CAllpassFilter::Process(int param_1) { + longlong lVar1; + int iVar2; + int iVar3; + + iVar3 = *(int *)(this->field_0x4 + this->field_0xc * 4); + lVar1 = (longlong)iVar3 * (longlong)(int)this->feedback + 0x1000000; + *(uint *)(this->field_0x4 + this->field_0xc * 4) = + param_1 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + iVar2 = this->field_0xc + 1; + this->field_0xc = iVar2; + if ((int)this->field_0x8 <= iVar2) { + this->field_0xc = 0; + } + return iVar3 - param_1; +} + + + +// CAllpassFilter::Mute() + +void CAllpassFilter::Mute() { + undefined4 *puVar1; + int iVar2; + + if ((int)this->field_0x8 < 1) { + return; + } + iVar2 = 0; + puVar1 = (undefined4 *)(this->field_0x4 + -4); + do { + puVar1 = puVar1 + 1; + *puVar1 = 0; + iVar2 = iVar2 + 1; + } while (iVar2 < (int)this->field_0x8); + return; +} + + + +// CAllpassFilter::SetFeedback(int) + +void CAllpassFilter::SetFeedback(int param_1) { + this->feedback = param_1; + return; +} + + + +// CAllpassFilter::GetFeedback() + +undefined4 CAllpassFilter::GetFeedback() { + return this->feedback; +} diff --git a/src/util/CAllpassFilter.h b/src/util/CAllpassFilter.h new file mode 100644 index 0000000..733ab1a --- /dev/null +++ b/src/util/CAllpassFilter.h @@ -0,0 +1,27 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_CALLPASSFILTER_H +#define VIPER_CALLPASSFILTER_H + + +#include "AdaptiveBuffer_FPI32.h" + +class CAllpassFilter { + undefined4 feedback; + undefined4 field_0x4; + undefined4 field_0x8; + undefined4 field_0xc; + +public: + CAllpassFilter(); + void SetBuffer(int *param_1,int param_2); + int Process(int param_1); + void Mute(); + void SetFeedback(int param_1); + undefined4 GetFeedback(); +}; + + +#endif //VIPER_CALLPASSFILTER_H diff --git a/src/util/CCombFilter.cpp b/src/util/CCombFilter.cpp new file mode 100644 index 0000000..49bd30e --- /dev/null +++ b/src/util/CCombFilter.cpp @@ -0,0 +1,113 @@ +// +// Created by mart on 2/12/21. +// + +#include "CCombFilter.h" + + +// CCombFilter::CCombFilter() + +CCombFilter::CCombFilter() { + this->field_0x10 = 0; + this->field_0x14 = 0; + this->field_0x18 = 0; + this->feedback = 0; + this->field_0x4 = 0; + this->damp = 0; + this->field_0xc = 0; + return; +} + + + +// CCombFilter::SetBuffer(int*, int) + +void CCombFilter::SetBuffer(int *param_1,int param_2) { + this->field_0x10 = (int)param_1; + this->field_0x14 = param_2; + return; +} + + + +// CCombFilter::Process(int) + +int CCombFilter::Process(int param_1) { + longlong lVar1; + longlong lVar2; + int iVar3; + int iVar4; + + iVar4 = *(int *)(this->field_0x10 + this->field_0x18 * 4); + lVar1 = (longlong)iVar4 * (longlong)(int)this->field_0xc + 0x1000000; + lVar2 = (longlong)(int)this->field_0x4 * (longlong)(int)this->damp + 0x1000000; + iVar3 = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + this->field_0x4 = iVar3; + lVar1 = (longlong)iVar3 * (longlong)(int)this->feedback + 0x1000000; + *(uint *)(this->field_0x10 + this->field_0x18 * 4) = + param_1 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + iVar3 = this->field_0x18 + 1; + this->field_0x18 = iVar3; + if (this->field_0x14 <= iVar3) { + this->field_0x18 = 0; + } + return iVar4; +} + + + +// CCombFilter::Mute() + +void CCombFilter::Mute() { + undefined4 *puVar1; + int iVar2; + + if (this->field_0x14 < 1) { + return; + } + iVar2 = 0; + puVar1 = (undefined4 *)(this->field_0x10 + -4); + do { + puVar1 = puVar1 + 1; + *puVar1 = 0; + iVar2 = iVar2 + 1; + } while (iVar2 < this->field_0x14); + return; +} + + + +// CCombFilter::SetDamp(int) + +void CCombFilter::SetDamp(int param_1) { + this->damp = param_1; + this->field_0xc = 0x2000000 - param_1; + return; +} + + + +// CCombFilter::GetDamp() + +undefined4 CCombFilter::GetDamp() { + return this->damp; +} + + + +// CCombFilter::SetFeedback(int) + +void CCombFilter::SetFeedback(int param_1) { + this->feedback = param_1; + return; +} + + + +// CCombFilter::GetFeedback() + +undefined4 CCombFilter::GetFeedback() { + return this->feedback; +} + diff --git a/src/util/CCombFilter.h b/src/util/CCombFilter.h new file mode 100644 index 0000000..9d227a9 --- /dev/null +++ b/src/util/CCombFilter.h @@ -0,0 +1,30 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_CCOMBFILTER_H +#define VIPER_CCOMBFILTER_H + + +class CCombFilter { + undefined4 feedback; + undefined4 field_0x4; + undefined4 damp; + undefined4 field_0xc; + int field_0x10; + int field_0x14; + undefined4 field_0x18; + +public: + CCombFilter(); + void SetBuffer(int *param_1,int param_2); + int Process(int param_1); + void Mute(); + void SetDamp(int param_1); + undefined4 GetDamp(); + void SetFeedback(int param_1); + undefined4 GetFeedback(); +}; + + +#endif //VIPER_CCOMBFILTER_H diff --git a/src/util/CRevModel.cpp b/src/util/CRevModel.cpp new file mode 100644 index 0000000..034b0b1 --- /dev/null +++ b/src/util/CRevModel.cpp @@ -0,0 +1,617 @@ +// +// Created by mart on 2/12/21. +// + +#include "CRevModel.h" + +// CRevModel::~CRevModel() + +CRevModel::~CRevModel() { + if (this->field_0x270 != nullptr) { + operator_delete__(this->field_0x270); + } + if (this->field_0x274 != nullptr) { + operator_delete__(this->field_0x274); + } + if (this->field_0x278 != nullptr) { + operator_delete__(this->field_0x278); + } + if (this->field_0x27c != nullptr) { + operator_delete__(this->field_0x27c); + } + if (this->field_0x280 != nullptr) { + operator_delete__(this->field_0x280); + } + if (this->field_0x284 != nullptr) { + operator_delete__(this->field_0x284); + } + if (this->field_0x288 != nullptr) { + operator_delete__(this->field_0x288); + } + if (this->field_0x28c != nullptr) { + operator_delete__(this->field_0x28c); + } + if (this->field_0x290 != nullptr) { + operator_delete__(this->field_0x290); + } + if (this->field_0x294 != nullptr) { + operator_delete__(this->field_0x294); + } + if (this->field_0x298 != nullptr) { + operator_delete__(this->field_0x298); + } + if (this->field_0x29c != nullptr) { + operator_delete__(this->field_0x29c); + } + if (this->field_0x2a0 != nullptr) { + operator_delete__(this->field_0x2a0); + } + if (this->field_0x2a4 != nullptr) { + operator_delete__(this->field_0x2a4); + } + if (this->field_0x2a8 != nullptr) { + operator_delete__(this->field_0x2a8); + } + if (this->field_0x2ac != nullptr) { + operator_delete__(this->field_0x2ac); + } + if (this->field_0x2b0 != nullptr) { + operator_delete__(this->field_0x2b0); + } + if (this->field_0x2b4 != nullptr) { + operator_delete__(this->field_0x2b4); + } + if (this->field_0x2b8 != nullptr) { + operator_delete__(this->field_0x2b8); + } + if (this->field_0x2bc != nullptr) { + operator_delete__(this->field_0x2bc); + } + if (this->field_0x2c0 != nullptr) { + operator_delete__(this->field_0x2c0); + } + if (this->field_0x2c4 != nullptr) { + operator_delete__(this->field_0x2c4); + } + if (this->field_0x2c8 != nullptr) { + operator_delete__(this->field_0x2c8); + } + if (this->field_0x2cc != nullptr) { + operator_delete__(this->field_0x2cc); + } + return this; +} + + + +// CRevModel::ProcessReplace(int*, int*, int) + +void CRevModel::ProcessReplace(int *param_1,int *param_2,int param_3) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + longlong lVar4; + longlong lVar5; + longlong lVar6; + int iVar7; + CCombFilter *this_00; + CAllpassFilter *this_01; + uint uVar8; + int iVar9; + int iVar10; + CAllpassFilter *this_02; + int iVar11; + int iVar12; + int iVar13; + int *piVar14; + int *local_40; + int local_3c; + + if ((this->field_0x0 != 0) && (local_3c = param_3 + -1, 0 < param_3)) { + piVar14 = param_2 + 2; + local_40 = param_1 + 2; + do { + iVar10 = piVar14[-2]; + iVar11 = 0; + iVar9 = local_40[-2]; + iVar13 = 0; + iVar12 = 0; + lVar1 = (longlong)(iVar9 + iVar10) * (longlong)*(int *)&this->field_0x4 + 0x1000000; + uVar8 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + do { + iVar7 = CCombFilter::Process + ((CCombFilter *)((int)&this->field_0x30[0].feedback + iVar11),uVar8); + iVar12 = iVar12 + iVar7; + this_00 = (CCombFilter *)((int)&this->field_0x110[0].feedback + iVar11); + iVar11 = iVar11 + 0x1c; + iVar7 = CCombFilter::Process(this_00,uVar8); + iVar13 = iVar13 + iVar7; + } while (iVar11 != 0xe0); + iVar11 = 4; + this_02 = this->field_0x1f0; + do { + iVar12 = CAllpassFilter::Process(this_02,iVar12); + this_01 = this_02 + 4; + this_02 = this_02 + 1; + iVar13 = CAllpassFilter::Process(this_01,iVar13); + iVar11 = iVar11 + -1; + } while (iVar11 != 0); + local_3c = local_3c + -1; + lVar1 = (longlong)iVar13 * (longlong)*(int *)&this->field_0x20 + 0x1000000; + lVar2 = (longlong)*(int *)&this->field_0x1c * (longlong)iVar13 + 0x1000000; + lVar3 = (longlong)iVar12 * (longlong)*(int *)&this->field_0x1c + 0x1000000; + lVar4 = (longlong)iVar12 * (longlong)*(int *)&this->field_0x20 + 0x1000000; + lVar5 = (longlong)iVar9 * (longlong)this->field_0x24 + 0x1000000; + lVar6 = (longlong)this->field_0x24 * (longlong)iVar10 + 0x1000000; + local_40[-2] = ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7) + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar5 >> 0x19 | (int)((ulonglong)lVar5 >> 0x20) << 7); + piVar14[-2] = ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7) + + ((uint)lVar6 >> 0x19 | (int)((ulonglong)lVar6 >> 0x20) << 7); + piVar14 = piVar14 + 2; + local_40 = local_40 + 2; + } while (local_3c != -1); + } + return; +} + + + +// CRevModel::UpdateCoeffs() + +void CRevModel::UpdateCoeffs() { + int iVar1; + longlong lVar2; + longlong lVar3; + uint uVar4; + CCombFilter *this_00; + uint uVar5; + int iVar6; + CCombFilter *this_01; + CCombFilter *pCVar7; + undefined8 uVar8; + undefined8 uVar9; + ulonglong uVar10; + ulonglong uVar11; + + if (this->field_0x0 == 0) { + return; + } + iVar6 = this->field_0x28; + uVar4 = this->field_0x18; + uVar8 = VectorShiftRight(CONCAT44(iVar6,iVar6),0x20); + uVar8 = VectorShiftLeft(uVar8,0x19,0x40,0); + uVar9 = VectorShiftRight(CONCAT44(0x2000000 - iVar6,0x2000000 - iVar6),0x20); + uVar9 = VectorShiftLeft(uVar9,0x19,0x40,0); + iVar6 = (int)((longlong)uVar8 >> 0x3f); + iVar1 = (int)((longlong)uVar9 >> 0x3f); + uVar10 = VectorShiftRight(CONCAT44(iVar6,iVar6),0x20); + uVar11 = VectorShiftRight(CONCAT44(iVar1,iVar1),0x20); + uVar8 = VectorAdd(uVar10 & 0x3ffffff,uVar8,8); + uVar9 = VectorAdd(uVar11 & 0x3ffffff,uVar9,8); + uVar8 = VectorShiftRight(uVar8,0x1a); + uVar10 = VectorShiftRight(uVar9,0x1a); + lVar2 = (longlong)(int)uVar4 * (longlong)((int)uVar8 + 0x1000000) + 0x1000000; + lVar3 = (uVar10 & 0xffffffff) * (ulonglong)uVar4; + uVar5 = (uint)lVar3; + *(uint *)&this->field_0x1c = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + *(uint *)&this->field_0x20 = + uVar5 + 0x1000000 >> 0x19 | + ((int)uVar10 * ((int)uVar4 >> 0x1f) + uVar4 * (int)(uVar10 >> 0x20) + + (int)((ulonglong)lVar3 >> 0x20) + (uint)(0xfeffffff < uVar5)) * 0x80; + if (this->field_0x2c < 0x1000000) { + uVar4 = this->field_0x8; + *(undefined **)&this->field_0x4 = &DAT_0007ae14; + *(uint *)&this->field_0xc = uVar4; + *(uint *)&this->field_0x14 = this->field_0x10; + } + else { + uVar4 = 0x2000000; + *(undefined4 *)&this->field_0xc = 0x2000000; + *(undefined4 *)&this->field_0x14 = 0; + *(undefined4 *)&this->field_0x4 = 0; + } + this_01 = this->field_0x30; + pCVar7 = this_01; + while( true ) { + CCombFilter::SetFeedback(pCVar7,uVar4); + this_00 = pCVar7 + 8; + pCVar7 = pCVar7 + 1; + CCombFilter::SetFeedback(this_00,*(int *)&this->field_0xc); + if (pCVar7 == this->field_0x110) break; + uVar4 = *(uint *)&this->field_0xc; + } + do { + CCombFilter::SetDamp(this_01,*(int *)&this->field_0x14); + pCVar7 = this_01 + 8; + this_01 = this_01 + 1; + CCombFilter::SetDamp(pCVar7,*(int *)&this->field_0x14); + } while (this_01 != this->field_0x110); + return; +} + + + +// CRevModel::SetRoomSize(int) + +void CRevModel::SetRoomSize(int param_1) { + longlong lVar1; + + if (this->field_0x0 == 0) { + return; + } + lVar1 = (longlong)param_1 * 0x8f5c2a + 0x1000000; + this->field_0x8 = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + 0x1666666; + UpdateCoeffs(this); + return; +} + + + +// CRevModel::GetRoomSize() + +void CRevModel::GetRoomSize(void) { + int in_r0; + uint uVar1; + + uVar1 = *(int *)(in_r0 + 8) + 0xfe99999a; + __aeabi_ldivmod(uVar1 * 0x2000000,((int)uVar1 >> 0x1f) << 0x19 | uVar1 >> 7,0x8f5c2a,0); + return; +} + + + +// CRevModel::SetDamp(int) + +void CRevModel::SetDamp(int param_1) { + longlong lVar1; + + if (this->field_0x0 == 0) { + return; + } + lVar1 = (longlong)param_1 * 0xccccce + 0x1000000; + this->field_0x10 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + UpdateCoeffs(this); + return; +} + + + +// CRevModel::GetDamp() + +void CRevModel::GetDamp(void) { + int in_r0; + uint uVar1; + + uVar1 = *(uint *)(in_r0 + 0x10); + __aeabi_ldivmod(uVar1 << 0x19,((int)uVar1 >> 0x1f) << 0x19 | uVar1 >> 7,0xccccce,0); + return; +} + + + +// CRevModel::SetWet(int) + +void CRevModel::SetWet(int param_1) { + longlong lVar1; + + if (this->field_0x0 == 0) { + return; + } + lVar1 = (longlong)param_1 * 0x6000000 + 0x1000000; + this->field_0x18 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + UpdateCoeffs(this); + return; +} + + + +// CRevModel::GetWet() + +void CRevModel::GetWet(void) { + int in_r0; + uint uVar1; + + uVar1 = *(uint *)(in_r0 + 0x18); + __aeabi_ldivmod(uVar1 << 0x19,((int)uVar1 >> 0x1f) << 0x19 | uVar1 >> 7,0x6000000,0); + return; +} + + + +// CRevModel::SetDry(int) + +void CRevModel::SetDry(int param_1) { + if (this->field_0x0 == 0) { + return; + } + this->field_0x24 = param_1 << 1; + return; +} + + + +// CRevModel::GetDry() + +undefined8 CRevModel::GetDry() { + int iVar1; + undefined8 uVar2; + ulonglong uVar3; + + uVar2 = VectorShiftRight(CONCAT44(this->field_0x24,this->field_0x24),0x20); + uVar2 = VectorShiftLeft(uVar2,0x19,0x40,0); + iVar1 = (int)((longlong)uVar2 >> 0x3f); + uVar3 = VectorShiftRight(CONCAT44(iVar1,iVar1),0x20); + uVar2 = VectorAdd(uVar3 & 0x3ffffff,uVar2,8); + uVar2 = VectorShiftRight(uVar2,0x1a); + return uVar2; +} + + + +// CRevModel::SetWidth(int) + +void CRevModel::SetWidth(int param_1) { + if (this->field_0x0 == 0) { + return; + } + this->field_0x28 = param_1; + UpdateCoeffs(this); + return; +} + + + +// CRevModel::GetWidth() + +int CRevModel::GetWidth() { + return this->field_0x28; +} + + + +// CRevModel::SetMode(int) + +void CRevModel::SetMode(int param_1) { + if (this->field_0x0 == 0) { + return; + } + this->field_0x2c = param_1; + UpdateCoeffs(this); + return; +} + + + +// CRevModel::GetMode() + +undefined4 CRevModel::GetMode() { + undefined4 uVar1; + + if (this->field_0x2c < 0x1000000) { + uVar1 = 0; + } + else { + uVar1 = 0x2000000; + } + return uVar1; +} + + + +// CRevModel::Mute() + +void CRevModel::Mute() { + int iVar1; + CCombFilter *this_00; + CAllpassFilter *this_01; + CAllpassFilter *this_02; + + if (this->field_0x0 == 0) { + return; + } + iVar1 = GetMode(this); + if (0xffffff < iVar1) { + return; + } + iVar1 = 0; + do { + CCombFilter::Mute((CCombFilter *)((int)&this->field_0x30[0].feedback + iVar1)); + this_00 = (CCombFilter *)((int)&this->field_0x110[0].feedback + iVar1); + iVar1 = iVar1 + 0x1c; + CCombFilter::Mute(this_00); + } while (iVar1 != 0xe0); + this_02 = this->field_0x1f0; + iVar1 = 4; + do { + CAllpassFilter::Mute(this_02); + this_01 = this_02 + 4; + this_02 = this_02 + 1; + CAllpassFilter::Mute(this_01); + iVar1 = iVar1 + -1; + } while (iVar1 != 0); + return; +} + + + +void CRevModel::~ZN9CRevModel5ResetEv() { + int iVar1; + CCombFilter *this_00; + CAllpassFilter *this_01; + CAllpassFilter *this_02; + + if (this->field_0x0 == 0) { + return; + } + iVar1 = GetMode(this); + if (0xffffff < iVar1) { + return; + } + iVar1 = 0; + do { + CCombFilter::Mute((CCombFilter *)((int)&this->field_0x30[0].feedback + iVar1)); + this_00 = (CCombFilter *)((int)&this->field_0x110[0].feedback + iVar1); + iVar1 = iVar1 + 0x1c; + CCombFilter::Mute(this_00); + } while (iVar1 != 0xe0); + this_02 = this->field_0x1f0; + iVar1 = 4; + do { + CAllpassFilter::Mute(this_02); + this_01 = this_02 + 4; + this_02 = this_02 + 1; + CAllpassFilter::Mute(this_01); + iVar1 = iVar1 + -1; + } while (iVar1 != 0); + return; +} + + + +// CRevModel::CRevModel() + +CRevModel::CRevModel() { + void *pvVar1; + CCombFilter *pCVar2; + CCombFilter *pCVar3; + CAllpassFilter *pCVar4; + CAllpassFilter *pCVar5; + CAllpassFilter *pCVar6; + CCombFilter *this_00; + CAllpassFilter *this_01; + + this_00 = this->field_0x110; + pCVar3 = this->field_0x30; + do { + pCVar2 = pCVar3 + 1; + CCombFilter::CCombFilter(pCVar3); + pCVar3 = pCVar2; + } while (pCVar2 != this_00); + pCVar6 = this->field_0x1f0; + pCVar3 = this_00; + do { + pCVar2 = pCVar3 + 1; + CCombFilter::CCombFilter(pCVar3); + pCVar3 = pCVar2; + } while (pCVar2 != (CCombFilter *)pCVar6); + this_01 = this->field_0x1f0 + 4; + pCVar5 = pCVar6; + do { + pCVar4 = pCVar5 + 1; + CAllpassFilter::CAllpassFilter(pCVar5); + pCVar5 = pCVar4; + } while (pCVar4 != this_01); + pCVar5 = this_01; + do { + pCVar4 = pCVar5 + 1; + CAllpassFilter::CAllpassFilter(pCVar5); + pCVar5 = pCVar4; + } while (pCVar4 != (CAllpassFilter *)&this->field_0x270); + this->field_0x0 = 0; + pvVar1 = operator_new__(0x1170); + this->field_0x270 = pvVar1; + pvVar1 = operator_new__(0x11cc); + this->field_0x274 = pvVar1; + pvVar1 = operator_new__(0x1290); + this->field_0x278 = pvVar1; + pvVar1 = operator_new__(0x12ec); + this->field_0x27c = pvVar1; + pvVar1 = operator_new__(0x13f4); + this->field_0x280 = pvVar1; + pvVar1 = operator_new__(0x1450); + this->field_0x284 = pvVar1; + pvVar1 = operator_new__(0x1530); + this->field_0x288 = pvVar1; + pvVar1 = operator_new__(0x158c); + this->field_0x28c = pvVar1; + pvVar1 = operator_new__(0x1638); + this->field_0x290 = pvVar1; + pvVar1 = operator_new__(0x1694); + this->field_0x294 = pvVar1; + pvVar1 = operator_new__(0x174c); + this->field_0x298 = pvVar1; + pvVar1 = operator_new__(0x17a8); + this->field_0x29c = pvVar1; + pvVar1 = operator_new__(0x1854); + this->field_0x2a0 = pvVar1; + pvVar1 = operator_new__(0x18b0); + this->field_0x2a4 = pvVar1; + pvVar1 = operator_new__(0x1944); + this->field_0x2a8 = pvVar1; + pvVar1 = operator_new__(0x19a0); + this->field_0x2ac = pvVar1; + pvVar1 = operator_new__(0x8b0); + this->field_0x2b0 = pvVar1; + pvVar1 = operator_new__(0x90c); + this->field_0x2b4 = pvVar1; + pvVar1 = operator_new__(0x6e4); + this->field_0x2b8 = pvVar1; + pvVar1 = operator_new__(0x740); + this->field_0x2bc = pvVar1; + pvVar1 = operator_new__(0x554); + this->field_0x2c0 = pvVar1; + pvVar1 = operator_new__(0x5b0); + this->field_0x2c4 = pvVar1; + pvVar1 = operator_new__(900); + this->field_0x2c8 = pvVar1; + pvVar1 = operator_new__(0x3e0); + this->field_0x2cc = pvVar1; + if (((((((int *)this->field_0x270 != nullptr) && (this->field_0x274 != nullptr)) && + (this->field_0x278 != nullptr)) && + (((this->field_0x27c != nullptr && (this->field_0x280 != nullptr)) && + ((this->field_0x284 != nullptr && ((this->field_0x288 != nullptr && (this->field_0x28c != nullptr)))) + )))) && (((this->field_0x290 != nullptr && + ((((((this->field_0x294 != nullptr && (this->field_0x298 != nullptr)) && + (this->field_0x29c != nullptr)) && + ((this->field_0x2a0 != nullptr && (this->field_0x2a4 != nullptr)))) && + ((this->field_0x2a8 != nullptr && + ((this->field_0x2ac != nullptr && (this->field_0x2b0 != nullptr)))))) && + (this->field_0x2b4 != nullptr)))) && + (((this->field_0x2b8 != nullptr && (this->field_0x2bc != nullptr)) && + (this->field_0x2c0 != nullptr)))))) && + (((this->field_0x2c4 != nullptr && (this->field_0x2c8 != nullptr)) && (pvVar1 != nullptr)))) { + this->field_0x0 = 1; + CCombFilter::SetBuffer(this->field_0x30,(int *)this->field_0x270,0x45c); + CCombFilter::SetBuffer(this_00,(int *)this->field_0x274,0x473); + CCombFilter::SetBuffer(this->field_0x30 + 1,(int *)this->field_0x278,0x4a4); + CCombFilter::SetBuffer(this->field_0x110 + 1,(int *)this->field_0x27c,0x4bb); + CCombFilter::SetBuffer(this->field_0x30 + 2,(int *)this->field_0x280,0x4fd); + CCombFilter::SetBuffer(this->field_0x110 + 2,(int *)this->field_0x284,0x514); + CCombFilter::SetBuffer(this->field_0x30 + 3,(int *)this->field_0x288,0x54c); + CCombFilter::SetBuffer(this->field_0x110 + 3,(int *)this->field_0x28c,0x563); + CCombFilter::SetBuffer(this->field_0x30 + 4,(int *)this->field_0x290,0x58e); + CCombFilter::SetBuffer(this->field_0x110 + 4,(int *)this->field_0x294,0x5a5); + CCombFilter::SetBuffer(this->field_0x30 + 5,(int *)this->field_0x298,0x5d3); + CCombFilter::SetBuffer(this->field_0x110 + 5,(int *)this->field_0x29c,0x5ea); + CCombFilter::SetBuffer(this->field_0x30 + 6,(int *)this->field_0x2a0,0x615); + CCombFilter::SetBuffer(this->field_0x110 + 6,(int *)this->field_0x2a4,0x62c); + CCombFilter::SetBuffer(this->field_0x30 + 7,(int *)this->field_0x2a8,0x651); + CCombFilter::SetBuffer(this->field_0x110 + 7,(int *)this->field_0x2ac,0x668); + CAllpassFilter::SetBuffer(pCVar6,(int *)this->field_0x2b0,0x22c); + CAllpassFilter::SetBuffer(this_01,(int *)this->field_0x2b4,0x243); + CAllpassFilter::SetBuffer(this->field_0x1f0 + 1,(int *)this->field_0x2b8,0x1b9); + CAllpassFilter::SetBuffer(this->field_0x1f0 + 5,(int *)this->field_0x2bc,0x1d0); + CAllpassFilter::SetBuffer(this->field_0x1f0 + 2,(int *)this->field_0x2c0,0x155); + CAllpassFilter::SetBuffer(this->field_0x1f0 + 6,(int *)this->field_0x2c4,0x16c); + CAllpassFilter::SetBuffer(this->field_0x1f0 + 3,(int *)this->field_0x2c8,0xe1); + CAllpassFilter::SetBuffer(this->field_0x1f0 + 7,(int *)this->field_0x2cc,0xf8); + CAllpassFilter::SetFeedback(pCVar6,0x1000000); + CAllpassFilter::SetFeedback(this_01,0x1000000); + CAllpassFilter::SetFeedback(this->field_0x1f0 + 1,0x1000000); + CAllpassFilter::SetFeedback(this->field_0x1f0 + 5,0x1000000); + CAllpassFilter::SetFeedback(this->field_0x1f0 + 2,0x1000000); + CAllpassFilter::SetFeedback(this->field_0x1f0 + 6,0x1000000); + CAllpassFilter::SetFeedback(this->field_0x1f0 + 3,0x1000000); + CAllpassFilter::SetFeedback(this->field_0x1f0 + 7,0x1000000); + SetWet(this,0x558106); + SetRoomSize(this,0x1000000); + SetDry(this,0x800000); + SetDamp(this,0x1000000); + SetWidth(this,0x2000000); + SetMode(this,0); + _ZN9CRevModel5ResetEv(this); + } + return this; +} diff --git a/src/util/CRevModel.h b/src/util/CRevModel.h new file mode 100644 index 0000000..506b2e1 --- /dev/null +++ b/src/util/CRevModel.h @@ -0,0 +1,87 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_CREVMODEL_H +#define VIPER_CREVMODEL_H + + +class CRevModel { + int field_0x0; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + uint field_0x8; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + uint field_0x10; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + uint field_0x18; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + int field_0x24; + int field_0x28; + int field_0x2c; + struct CCombFilter field_0x30[8]; + struct CCombFilter field_0x110[8]; + struct CAllpassFilter field_0x1f0[8]; + void * field_0x270; + void * field_0x274; + void * field_0x278; + void * field_0x27c; + void * field_0x280; + void * field_0x284; + void * field_0x288; + void * field_0x28c; + void * field_0x290; + void * field_0x294; + void * field_0x298; + void * field_0x29c; + void * field_0x2a0; + void * field_0x2a4; + void * field_0x2a8; + void * field_0x2ac; + void * field_0x2b0; + void * field_0x2b4; + void * field_0x2b8; + void * field_0x2bc; + void * field_0x2c0; + void * field_0x2c4; + void * field_0x2c8; + void * field_0x2cc; + +public: + ~CRevModel(); + void ProcessReplace(int *param_1,int *param_2,int param_3); + void UpdateCoeffs(); + void SetRoomSize(int param_1); + void GetRoomSize(); + void SetDamp(int param_1); + void GetDamp(); + void SetWet(int param_1); + void GetWet(); + void SetDry(int param_1); + undefined8 GetDry(); + void SetWidth(int param_1); + int GetWidth(); + void SetMode(int param_1); + undefined4 GetMode(); + void Mute(); + void ~ZN9CRevModel5ResetEv(); + CRevModel(); +}; + + +#endif //VIPER_CREVMODEL_H diff --git a/src/util/Crossfeed.cpp b/src/util/Crossfeed.cpp new file mode 100644 index 0000000..985e9aa --- /dev/null +++ b/src/util/Crossfeed.cpp @@ -0,0 +1,239 @@ +// +// Created by mart on 2/13/21. +// + +#include "Crossfeed.h" + +// Crossfeed::~Crossfeed() + +Crossfeed::~Crossfeed() { + return; +} + + + +// Crossfeed::FilterSample(int*) + +void Crossfeed::FilterSample(int *param_1) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + longlong lVar4; + longlong lVar5; + int iVar6; + int iVar7; + + lVar1 = (longlong)this->field_0x4 * (longlong)this->field_0x20 + 0x1000000; + lVar2 = (longlong)this->field_0x0 * (longlong)*param_1 + 0x1000000; + lVar3 = (longlong)this->field_0x4 * (longlong)*(int *)&this->field_0x24 + 0x1000000; + this->field_0x20 = + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)this->field_0xc * (longlong)this->field_0x18 + 0x1000000; + lVar2 = (longlong)this->field_0x0 * (longlong)param_1[1] + 0x1000000; + lVar4 = (longlong)this->field_0xc * (longlong)*(int *)&this->field_0x1c + 0x1000000; + iVar6 = ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7); + *(int *)&this->field_0x24 = iVar6; + lVar2 = (longlong)this->field_0x10 * (longlong)this->field_0x28 + 0x1000000; + lVar3 = (longlong)this->field_0x8 * (longlong)*param_1 + 0x1000000; + lVar5 = (longlong)this->field_0x10 * (longlong)(int)this->field_0x2c + 0x1000000; + iVar7 = ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7) + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + this->field_0x28 = iVar7; + iVar6 = iVar6 + iVar7; + lVar1 = (longlong)this->field_0x8 * (longlong)param_1[1] + 0x1000000; + this->field_0x2c = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7) + + ((uint)lVar5 >> 0x19 | (int)((ulonglong)lVar5 >> 0x20) << 7); + this->field_0x18 = *param_1; + *(int *)&this->field_0x1c = param_1[1]; + *param_1 = iVar6; + iVar7 = this->field_0x2c + this->field_0x20; + param_1[1] = iVar7; + lVar1 = (longlong)iVar6 * (longlong)this->field_0x14 + 0x1000000; + *param_1 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + lVar1 = (longlong)iVar7 * (longlong)this->field_0x14 + 0x1000000; + param_1[1] = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + return; +} + + + +// Crossfeed::Reset() + +void Crossfeed::Reset() { + undefined4 uVar1; + undefined4 uVar2; + undefined4 uVar3; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 extraout_r1_01; + undefined4 extraout_r1_02; + undefined4 extraout_r1_03; + undefined4 extraout_r1_04; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr3; + undefined4 in_cr4; + undefined4 in_cr11; + undefined4 in_cr13; + double dVar4; + double dVar5; + double dVar6; + double __x; + + dVar5 = (double)(longlong)(int)(*(uint *)&this->cutoff & 0xffff); + uVar2 = 0; + coprocessor_function(0xb,6,1,in_cr0,in_cr13,in_cr0); + __x = -3.833333333333333; + uVar1 = uVar2; + pow(-3.833333333333333,dVar5); + pow(__x,dVar5); + dVar4 = 1.0 - (double)CONCAT44(extraout_r1_00,uVar2); + uVar2 = SUB84(dVar4,0); + log10(__x); + uVar3 = 0; + dVar6 = __x - (double)CONCAT44(extraout_r1_01,uVar2) * 20.0; + pow(__x,dVar5); + coprocessor_function(0xb,6,5,in_cr1,in_cr0,in_cr2); + uVar2 = SUB84(dVar6 / (double)(longlong)this->samplerate,0); + exp(__x); + coprocessor_function(0xb,2,4,in_cr11,in_cr3,in_cr11); + coprocessor_function(0xb,6,5,in_cr0,in_cr1,in_cr4); + coprocessor_function(0xb,2,1,in_cr11,in_cr11,in_cr3); + this->field_0x4 = SUB84(ROUND((double)CONCAT44(extraout_r1_03,uVar2) * 33554432.0 + 0.5),0); + this->field_0x0 = SUB84(ROUND((double)CONCAT44(extraout_r1_03,uVar2) * 33554432.0 + 0.5),0); + uVar2 = SUB84((double)CONCAT44(extraout_r1_02,uVar3) / (double)(longlong)this->samplerate,0); + exp(__x); + dVar5 = (double)CONCAT44(extraout_r1_04,uVar2); + this->field_0x10 = SUB84(ROUND(dVar5 * 33554432.0 + 0.5),0); + this->field_0xc = SUB84(ROUND(0.5 - dVar5 * 33554432.0),0); + this->field_0x8 = SUB84(ROUND((1.0 - (1.0 - dVar5) * dVar4) * 33554432.0 + 0.5),0); + this->field_0x14 = + SUB84(ROUND((1.0 / ((1.0 - dVar4) + (double)CONCAT44(extraout_r1,uVar1))) * 33554432.0 + 0.5)(0); + memset(&this->field_0x18,0,0x18); + return; +} + + + +// Crossfeed::Crossfeed() + +Crossfeed::Crossfeed() { + memset(this,0,0x30); + this->samplerate = 0xac44; + *(undefined4 *)&this->cutoff = 0x2d02bc; + Reset(this); + return this; +} + + + +// Crossfeed::SetSamplingRate(int) + +void Crossfeed::SetSamplingRate(int param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + Reset(this); + return; +} + + + +// Crossfeed::SetPreset(unsigned int) + +void Crossfeed::SetPreset(uint param_1) { + *(uint *)&this->cutoff = param_1; + Reset(this); + return; +} + + + +// Crossfeed::SetCutoff(int) + +void Crossfeed::SetCutoff(int param_1) { + SetPreset(this,param_1 | (uint)(ushort)this->feedback << 0x10); + return; +} + + + +// Crossfeed::SetFeedback(float) + +void Crossfeed::SetFeedback(float param_1) { + undefined4 in_cr7; + + coprocessor_function(10,6,1,in_cr7,in_cr7,in_cr7); + SetPreset(this,(uint)(ushort)this->cutoff); + return; +} + + + +// Crossfeed::GetCutoff() + +short Crossfeed::GetCutoff() { + return this->cutoff; +} + + + +// Crossfeed::GetFeedback() + +float Crossfeed::GetFeedback() { + return (float)(longlong)(int)(uint)(ushort)this->feedback / 10.0; +} + + + +// Crossfeed::GetLevelDelay() + +float Crossfeed::GetLevelDelay() { + int iVar1; + undefined4 in_cr7; + float fVar2; + + iVar1 = GetCutoff(this); + if (iVar1 - 300U < 0x6a5) { + fVar2 = 18700.0 / (float)(longlong)iVar1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + } + else { + fVar2 = 0.0; + } + return fVar2; +} + + + +// Crossfeed::GetPreset() + +undefined4 Crossfeed::GetPreset() { + return *(undefined4 *)&this->cutoff; +} + + + +// Crossfeed::ProcessFrames(int*, int) + +void Crossfeed::ProcessFrames(int *param_1,int param_2) { + int iVar1; + + if (param_2 < 1) { + return; + } + iVar1 = param_2 + -1; + do { + iVar1 = iVar1 + -1; + FilterSample(this,param_1); + param_1 = param_1 + 2; + } while (iVar1 != -1); + return; +} diff --git a/src/util/Crossfeed.h b/src/util/Crossfeed.h new file mode 100644 index 0000000..a7419ed --- /dev/null +++ b/src/util/Crossfeed.h @@ -0,0 +1,49 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_CROSSFEED_H +#define VIPER_CROSSFEED_H + + +class Crossfeed { + int field_0x0; + int field_0x4; + int field_0x8; + int field_0xc; + int field_0x10; + int field_0x14; + int field_0x18; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + int field_0x20; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + int field_0x28; + uint field_0x2c; + short cutoff; + short feedback; // Created by retype action + int samplerate; + +public: + ~Crossfeed(); + void FilterSample(int *param_1); + void Reset(); + Crossfeed(); + void SetSamplingRate(int param_1); + void SetPreset(uint param_1); + void SetCutoff(int param_1); + void SetFeedback(float param_1); + short GetCutoff(); + float GetFeedback(); + float GetLevelDelay(); + undefined4 GetPreset(); + void ProcessFrames(int *param_1,int param_2); +}; + + +#endif //VIPER_CROSSFEED_H diff --git a/src/util/FFT_R24_F32.cpp b/src/util/FFT_R24_F32.cpp new file mode 100644 index 0000000..d3ddc74 --- /dev/null +++ b/src/util/FFT_R24_F32.cpp @@ -0,0 +1,1090 @@ +// +// Created by mart on 2/12/21. +// + +#include "FFT_R24_F32.h" + + +// FFT_R24_F32::makect(int, int*, float*) + +void FFT_R24_F32::makect(int param_1,int *param_2,float *param_3) { + int iVar1; + undefined4 uVar2; + undefined4 extraout_r1; + int iVar3; + float *pfVar4; + float *pfVar5; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + undefined4 in_cr10; + double unaff_d8; + double dVar6; + + param_2[1] = param_1; + if (1 < param_1) { + iVar1 = param_1 >> 1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr10); + dVar6 = (double)(longlong)iVar1; + uVar2 = SUB84(dVar6,0); + cos(unaff_d8); + coprocessor_function(10,2,4,in_cr7,in_cr7,in_cr7); + *param_3 = (float)(double)CONCAT44(extraout_r1,uVar2); + param_3[iVar1] = 0.5; + if (iVar1 != 1) { + pfVar5 = param_3 + param_1; + iVar3 = 1; + pfVar4 = param_3 + 1; + do { + iVar3 = iVar3 + 1; + coprocessor_function(10,2,0,in_cr8,in_cr8,in_cr10); + cos(unaff_d8); + coprocessor_function(0xb,6,4,in_cr0,in_cr1,in_cr9); + *pfVar4 = (float)dVar6; + pfVar4 = pfVar4 + 1; + sin(unaff_d8); + coprocessor_function(0xb,6,0,in_cr0,in_cr7,in_cr9); + pfVar5 = pfVar5 + -1; + *pfVar5 = (float)dVar6; + } while (iVar3 != iVar1); + } + } + return; +} + + + +// FFT_R24_F32::bitrv2(int, int*, float*) + +void FFT_R24_F32::bitrv2(int param_1,int *param_2,float *param_3) { + float *pfVar1; + int iVar2; + float *pfVar3; + int *piVar4; + float *pfVar5; + int iVar6; + float *pfVar7; + float fVar8; + float fVar9; + float fVar10; + int iVar11; + int *local_48; + int local_40; + int *local_3c; + int *local_34; + int local_30; + int local_2c; + int local_28; + int local_24; + + *param_2 = 0; + if (param_1 < 9) { + if (param_1 != 8) { + return; + } + local_40 = 2; + local_30 = 1; + } + else { + local_30 = 1; + do { + iVar2 = local_30; + param_1 = param_1 >> 1; + iVar6 = 0; + piVar4 = param_2 + -1; + do { + piVar4 = piVar4 + 1; + iVar6 = iVar6 + 1; + piVar4[iVar2] = *piVar4 + param_1; + } while (iVar6 < iVar2); + local_30 = iVar2 << 1; + } while (iVar2 * 0x10 < param_1); + local_40 = iVar2 * 4; + if (iVar2 * 0x10 != param_1) { + iVar6 = 1; + local_34 = param_2; + do { + local_34 = local_34 + 1; + iVar2 = 0; + pfVar1 = param_3 + *local_34 + 1; + pfVar3 = param_3 + local_40 + *local_34 + 1; + piVar4 = param_2 + -1; + do { + piVar4 = piVar4 + 1; + iVar2 = iVar2 + 1; + iVar11 = iVar6 * 2 + *piVar4; + fVar9 = pfVar1[-1]; + fVar8 = *pfVar1; + fVar10 = param_3[iVar11 + 1]; + pfVar1[-1] = param_3[iVar11]; + *pfVar1 = fVar10; + param_3[iVar11] = fVar9; + param_3[iVar11 + 1] = fVar8; + fVar9 = pfVar3[-1]; + fVar10 = param_3[iVar11 + local_40 + 1]; + fVar8 = *pfVar3; + pfVar3[-1] = param_3[iVar11 + local_40]; + *pfVar3 = fVar10; + param_3[iVar11 + local_40] = fVar9; + param_3[iVar11 + local_40 + 1] = fVar8; + pfVar1 = pfVar1 + 2; + pfVar3 = pfVar3 + 2; + } while (iVar2 < iVar6); + iVar6 = iVar6 + 1; + } while (local_30 != iVar6); + return; + } + } + local_28 = *param_2; + local_24 = local_40; + local_2c = 0; + local_3c = param_2; + while( true ) { + local_28 = local_24 + local_28; + local_2c = local_2c + 1; + fVar9 = param_3[local_28 + local_40 + 1]; + fVar10 = param_3[local_28 + 1]; + fVar8 = param_3[local_28]; + param_3[local_28] = param_3[local_28 + local_40]; + param_3[local_28 + 1] = fVar9; + param_3[local_28 + local_40] = fVar8; + param_3[local_28 + local_40 + 1] = fVar10; + if (local_30 <= local_2c) break; + local_28 = local_3c[1]; + iVar6 = local_40 + local_28 + local_40; + local_48 = param_2 + -1; + pfVar1 = param_3 + local_40 + local_28 + 1; + pfVar3 = param_3 + local_40 + iVar6 + 1; + pfVar5 = param_3 + iVar6 + 1; + pfVar7 = param_3 + local_28 + 1; + do { + local_48 = local_48 + 1; + fVar10 = pfVar7[-1]; + iVar6 = local_2c * 2 + *local_48; + iVar2 = iVar6 + local_40 * 2; + fVar8 = param_3[iVar6 + 1]; + iVar11 = iVar2 - local_40; + fVar9 = *pfVar7; + pfVar7[-1] = param_3[iVar6]; + *pfVar7 = fVar8; + param_3[iVar6] = fVar10; + param_3[iVar6 + 1] = fVar9; + fVar9 = param_3[iVar2 + 1]; + iVar6 = iVar11 + local_40 * 2; + fVar8 = pfVar1[-1]; + pfVar1[-1] = param_3[iVar2]; + fVar10 = *pfVar1; + *pfVar1 = fVar9; + param_3[iVar2] = fVar8; + param_3[iVar2 + 1] = fVar10; + fVar9 = pfVar5[-1]; + fVar8 = *pfVar5; + fVar10 = param_3[iVar11 + 1]; + pfVar5[-1] = param_3[iVar11]; + *pfVar5 = fVar10; + param_3[iVar11] = fVar9; + param_3[iVar11 + 1] = fVar8; + fVar8 = pfVar3[-1]; + fVar10 = *pfVar3; + fVar9 = param_3[iVar6 + 1]; + pfVar3[-1] = param_3[iVar6]; + *pfVar3 = fVar9; + param_3[iVar6] = fVar8; + param_3[iVar6 + 1] = fVar10; + pfVar1 = pfVar1 + 2; + pfVar3 = pfVar3 + 2; + pfVar5 = pfVar5 + 2; + pfVar7 = pfVar7 + 2; + } while (local_3c != local_48); + local_24 = local_24 + 2; + local_3c = local_3c + 1; + } + return; +} + + + +// FFT_R24_F32::makewt(int, int*, float*) + +void FFT_R24_F32::makewt(int param_1,int *param_2,float *param_3) { + int iVar1; + undefined4 uVar2; + undefined4 uVar3; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 extraout_r1_01; + int iVar4; + int iVar5; + float *pfVar6; + float *pfVar7; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + undefined4 unaff_s16; + undefined4 in_stack_ffffffc8; + + *param_2 = param_1; + param_2[1] = 1; + if (2 < param_1) { + iVar1 = param_1 >> 1; + *param_3 = 1.0; + param_3[1] = 0.0; + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr9); + uVar2 = SUB84((double)(longlong)iVar1,0); + cos((double)CONCAT44(unaff_s16,in_stack_ffffffc8)); + param_3[iVar1] = (float)(double)CONCAT44(extraout_r1,uVar2); + (param_3 + iVar1)[1] = (float)(double)CONCAT44(extraout_r1,uVar2); + if (2 < iVar1) { + iVar4 = 2; + pfVar6 = param_3 + param_1; + pfVar7 = param_3 + 3; + do { + iVar5 = iVar4 + 2; + coprocessor_function(10,2,1,in_cr8,in_cr8,in_cr9); + uVar3 = SUB84((double)(longlong)iVar4,0); + uVar2 = uVar3; + cos((double)CONCAT44(unaff_s16,in_stack_ffffffc8)); + sin((double)CONCAT44(unaff_s16,in_stack_ffffffc8)); + pfVar7[-1] = (float)(double)CONCAT44(extraout_r1_00,uVar2); + *pfVar7 = (float)(double)CONCAT44(extraout_r1_01,uVar3); + pfVar6[-1] = (float)(double)CONCAT44(extraout_r1_00,uVar2); + pfVar6[-2] = (float)(double)CONCAT44(extraout_r1_01,uVar3); + iVar4 = iVar5; + pfVar6 = pfVar6 + -2; + pfVar7 = pfVar7 + 2; + } while (iVar5 < iVar1); + bitrv2(this,param_1,param_2 + 2,param_3); + return; + } + } + return; +} + + + +// FFT_R24_F32::cft1st(int, float*, float*) + +FFT_R24_F32::cft1st(int param_1,float *param_2,float *param_3) { + float *pfVar1; + float *pfVar2; + float *pfVar3; + float *pfVar4; + float *pfVar5; + float *pfVar6; + float *pfVar7; + float *pfVar8; + float *pfVar9; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr3; + undefined4 in_cr4; + undefined4 in_cr5; + undefined4 in_cr6; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + float fVar10; + float fVar11; + float fVar12; + float fVar13; + float fVar14; + float fVar15; + float fVar16; + float fVar17; + float fVar18; + float fVar19; + float fVar20; + float fVar21; + float fVar22; + float fVar23; + float fVar24; + float fVar25; + float fVar26; + float fVar27; + float *local_4c; + int local_48; + + fVar26 = param_2[4] + param_2[6]; + fVar14 = param_2[4] - param_2[6]; + fVar16 = param_2[0xd] - param_2[0xf]; + fVar27 = *param_2 + param_2[2]; + fVar25 = param_2[1] + param_2[3]; + fVar24 = param_2[5] + param_2[7]; + fVar10 = *param_2 - param_2[2]; + fVar12 = param_2[1] - param_2[3]; + fVar13 = param_2[0xc] - param_2[0xe]; + fVar18 = param_2[9] - param_2[0xb]; + fVar11 = param_2[5] - param_2[7]; + fVar19 = param_2[8] - param_2[10]; + fVar15 = fVar19 - fVar16; + fVar17 = fVar18 + fVar13; + fVar20 = param_2[8] + param_2[10]; + fVar21 = param_2[0xc] + param_2[0xe]; + fVar23 = param_2[9] + param_2[0xb]; + fVar22 = param_2[0xd] + param_2[0xf]; + *param_2 = fVar27 + fVar26; + param_2[4] = fVar27 - fVar26; + param_2[1] = fVar25 + fVar24; + param_2[5] = fVar25 - fVar24; + param_2[2] = fVar10 - fVar11; + param_2[6] = fVar10 + fVar11; + param_2[3] = fVar12 + fVar14; + param_2[7] = fVar12 - fVar14; + fVar10 = param_3[2]; + coprocessor_function(10,6,5,in_cr2,in_cr2,in_cr7); + coprocessor_function(10,2,1,in_cr4,in_cr4,in_cr7); + coprocessor_function(10,2,1,in_cr3,in_cr3,in_cr7); + coprocessor_function(10,6,1,in_cr7,in_cr5,in_cr7); + param_2[8] = fVar20 + fVar21; + param_2[0xd] = fVar20 - fVar21; + param_2[9] = fVar23 + fVar22; + param_2[0xc] = fVar22 - fVar23; + param_2[10] = fVar15 - fVar17; + param_2[0xb] = fVar15 + fVar17; + param_2[0xe] = (fVar13 - fVar18) - (fVar16 + fVar19); + param_2[0xf] = fVar10; + if (0x10 < param_1) { + local_48 = 0x10; + pfVar1 = param_2 + 0x17; + pfVar2 = param_2 + 0x15; + pfVar3 = param_2 + 0x16; + pfVar4 = param_2 + 0x14; + pfVar5 = param_2 + 0x13; + pfVar6 = param_2 + 0x11; + pfVar7 = param_2 + 0x12; + pfVar8 = param_2 + 0x10; + pfVar9 = param_2 + 0x18; + local_4c = param_3; + do { + this = (FFT_R24_F32 *)(param_3 + 4); + fVar17 = *pfVar4; + fVar18 = *pfVar5; + fVar23 = local_4c[3]; + fVar21 = param_3[5]; + fVar13 = *pfVar8 + *pfVar7; + fVar15 = *pfVar6 + fVar18; + fVar14 = fVar17 + *pfVar3; + fVar10 = *pfVar8 - *pfVar7; + fVar16 = *pfVar2 + *pfVar1; + fVar22 = *(float *)this; + local_48 = local_48 + 0x10; + fVar19 = fVar17 - *pfVar3; + fVar20 = *pfVar2 - *pfVar1; + fVar12 = *pfVar6 - fVar18; + local_4c = local_4c + 2; + fVar11 = fVar22 - (fVar23 + fVar23) * fVar21; + coprocessor_function(10,6,0,in_cr3,in_cr7,in_cr9); + fVar24 = *local_4c; + coprocessor_function(10,2,1,in_cr4,in_cr7,in_cr9); + coprocessor_function(10,6,0,in_cr4,in_cr6,in_cr8); + coprocessor_function(10,2,1,in_cr6,in_cr6,in_cr8); + coprocessor_function(10,2,4,in_cr5,in_cr5,in_cr1); + coprocessor_function(10,6,4,in_cr5,in_cr5,in_cr0); + *pfVar8 = fVar13 + fVar14; + *pfVar6 = fVar15 + fVar16; + *pfVar4 = fVar24 * (fVar13 - fVar14) - fVar17; + *pfVar2 = fVar18 + fVar24 * (fVar15 - fVar16); + *pfVar7 = fVar22 * (fVar10 - fVar20) - fVar19; + *pfVar5 = fVar21 + fVar22 * (fVar12 + fVar19); + *pfVar3 = fVar11 * (fVar10 + fVar20) - fVar20; + *pfVar1 = (fVar22 * (fVar23 + fVar23) - fVar21) + fVar11 * (fVar12 - fVar19); + fVar13 = param_2[0x1d] + param_2[0x1f]; + fVar17 = param_2[0x1d] - param_2[0x1f]; + fVar15 = param_2[0x1c] + param_2[0x1e]; + fVar18 = param_2[0x1c] - param_2[0x1e]; + fVar21 = param_3[6]; + fVar12 = param_2[0x19] + param_2[0x1b]; + fVar11 = param_2[0x19] - param_2[0x1b]; + fVar20 = param_3[7]; + fVar16 = param_2[0x1a]; + fVar19 = fVar21 - (fVar24 + fVar24) * fVar20; + fVar14 = *pfVar9 + fVar16; + fVar10 = *pfVar9 - fVar16; + coprocessor_function(10,2,4,in_cr4,in_cr7,in_cr8); + coprocessor_function(10,6,0,in_cr4,in_cr6,in_cr0); + coprocessor_function(10,2,5,in_cr5,in_cr5,in_cr1); + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr8); + coprocessor_function(10,2,0,in_cr6,in_cr6,in_cr9); + coprocessor_function(10,6,5,in_cr5,in_cr5,in_cr0); + *pfVar9 = fVar14 + fVar15; + param_2[0x19] = fVar12 + fVar13; + param_2[0x1c] = (0.0 - fVar23) * (fVar14 - fVar15) - fVar16; + param_2[0x1d] = fVar24 + (fVar12 - fVar13) * (0.0 - fVar23); + param_2[0x1a] = fVar21 * (fVar10 - fVar17) - fVar20; + param_2[0x1b] = fVar17 + fVar21 * (fVar11 + fVar18); + param_2[0x1e] = fVar19 * (fVar10 + fVar17) - fVar19; + param_2[0x1f] = (fVar21 * (fVar24 + fVar24) - fVar20) + fVar19 * (fVar11 - fVar18); + param_3 = (float *)this; + param_2 = param_2 + 0x10; + pfVar1 = pfVar1 + 0x10; + pfVar2 = pfVar2 + 0x10; + pfVar3 = pfVar3 + 0x10; + pfVar4 = pfVar4 + 0x10; + pfVar5 = pfVar5 + 0x10; + pfVar6 = pfVar6 + 0x10; + pfVar7 = pfVar7 + 0x10; + pfVar8 = pfVar8 + 0x10; + pfVar9 = pfVar9 + 0x10; + } while (local_48 < param_1); + } + return this; +} + + + +// FFT_R24_F32::cftmdl(int, int, float*, float*) + +FFT_R24_F32::cftmdl(int param_1,int param_2,float *param_3,float *param_4) { + int iVar1; + float *pfVar2; + float *pfVar3; + float *pfVar4; + float *pfVar5; + float *pfVar6; + float *pfVar7; + int iVar8; + int iVar9; + int iVar10; + int iVar11; + int iVar12; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr3; + undefined4 in_cr4; + undefined4 in_cr5; + undefined4 in_cr6; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + undefined4 in_cr10; + float fVar13; + float fVar14; + float fVar15; + float fVar16; + float fVar17; + float fVar18; + float fVar19; + float fVar20; + float fVar21; + float fVar22; + float fVar23; + float fVar24; + float fVar25; + float fVar26; + float fVar27; + float fVar28; + + iVar1 = param_2 * 4; + if (0 < param_2) { + pfVar2 = param_3 + 1; + pfVar3 = param_3 + param_2 + 1; + pfVar4 = param_3 + param_2 * 3 + 1; + pfVar5 = param_3 + param_2 * 2 + 1; + do { + fVar19 = *pfVar5 + *pfVar4; + fVar17 = *pfVar2 + *pfVar3; + fVar13 = pfVar2[-1] + pfVar3[-1]; + fVar15 = pfVar5[-1] + pfVar4[-1]; + fVar25 = *pfVar2 - *pfVar3; + fVar21 = pfVar2[-1] - pfVar3[-1]; + fVar28 = pfVar5[-1] - pfVar4[-1]; + fVar23 = *pfVar5 - *pfVar4; + pfVar2[-1] = fVar13 + fVar15; + this = (FFT_R24_F32 *)(pfVar2 + 2); + *pfVar2 = fVar17 + fVar19; + pfVar5[-1] = fVar13 - fVar15; + *pfVar5 = fVar17 - fVar19; + pfVar3[-1] = fVar21 - fVar23; + *pfVar3 = fVar25 + fVar28; + pfVar4[-1] = fVar21 + fVar23; + *pfVar4 = fVar25 - fVar28; + pfVar2 = (float *)this; + pfVar3 = pfVar3 + 2; + pfVar4 = pfVar4 + 2; + pfVar5 = pfVar5 + 2; + } while ((float *)this != param_3 + (param_2 - 1U & 0xfffffffe) + 3); + } + if (0 < param_2 != SBORROW4(iVar1,param_2 * 5)) { + pfVar2 = param_3 + iVar1 + 1; + pfVar3 = param_3 + param_2 * 6 + 1; + pfVar4 = param_3 + param_2 * 7 + 1; + pfVar5 = param_3 + param_2 * 5 + 1; + do { + fVar17 = *pfVar3 - *pfVar4; + fVar13 = pfVar3[-1] - pfVar4[-1]; + fVar19 = pfVar2[-1] - pfVar5[-1]; + fVar21 = *pfVar2 - *pfVar5; + fVar28 = *pfVar3 + *pfVar4; + fVar26 = *pfVar2 + *pfVar5; + fVar25 = pfVar3[-1] + pfVar4[-1]; + fVar15 = fVar19 - fVar17; + fVar17 = fVar17 + fVar19; + fVar19 = fVar21 + fVar13; + fVar23 = pfVar2[-1] + pfVar5[-1]; + fVar13 = fVar13 - fVar21; + coprocessor_function(10,2,1,in_cr4,in_cr4,in_cr7); + pfVar2[-1] = fVar23 + fVar25; + this = (FFT_R24_F32 *)(pfVar2 + 2); + *pfVar2 = fVar26 + fVar28; + coprocessor_function(10,6,5,in_cr2,in_cr2,in_cr7); + coprocessor_function(10,2,1,in_cr5,in_cr5,in_cr7); + pfVar3[-1] = fVar28 - fVar26; + *pfVar3 = fVar23 - fVar25; + coprocessor_function(10,2,1,in_cr3,in_cr3,in_cr7); + pfVar5[-1] = fVar15 - fVar19; + *pfVar5 = fVar15 + fVar19; + pfVar4[-1] = fVar13 - fVar17; + *pfVar4 = fVar13 + fVar17; + pfVar2 = (float *)this; + pfVar3 = pfVar3 + 2; + pfVar4 = pfVar4 + 2; + pfVar5 = pfVar5 + 2; + } while ((float *)this != param_3 + iVar1 + (param_2 - 1U & 0xfffffffe) + 3); + } + iVar1 = param_2 * 8; + if (iVar1 < param_1) { + iVar9 = param_2 * 0xc; + iVar11 = param_2 * 9; + iVar10 = param_2 * 0xd; + iVar12 = 0; + iVar8 = iVar1; + pfVar2 = param_4; + do { + fVar19 = pfVar2[3]; + fVar15 = param_4[4]; + fVar13 = pfVar2[2]; + fVar17 = fVar15 - (fVar19 + fVar19) * param_4[5]; + if (iVar8 < iVar11) { + pfVar3 = (float *)((int)param_3 + iVar12 + param_2 * 0x2c + 4); + pfVar4 = (float *)((int)param_3 + iVar12 + param_2 * 0x28 + 4); + pfVar5 = (float *)((int)param_3 + iVar12 + param_2 * 0x24 + 4); + pfVar7 = (float *)((int)param_3 + iVar12 + param_2 * 0x20 + 4); + do { + fVar16 = pfVar5[-1]; + fVar18 = pfVar4[-1]; + fVar20 = *pfVar5; + fVar22 = *pfVar4; + fVar25 = pfVar7[-1] + fVar16; + fVar28 = fVar18 + pfVar3[-1]; + fVar14 = fVar22 + *pfVar3; + fVar26 = *pfVar7 + fVar20; + fVar27 = fVar22 - *pfVar3; + fVar21 = pfVar7[-1] - fVar16; + fVar24 = fVar18 - pfVar3[-1]; + fVar23 = *pfVar7 - fVar20; + coprocessor_function(10,2,4,in_cr5,in_cr10,in_cr8); + coprocessor_function(10,6,4,in_cr4,in_cr10,in_cr0); + coprocessor_function(10,2,1,in_cr6,in_cr9,in_cr0); + coprocessor_function(10,6,0,in_cr5,in_cr9,in_cr1); + coprocessor_function(10,2,1,in_cr7,in_cr10,in_cr1); + coprocessor_function(10,6,0,in_cr6,in_cr10,in_cr2); + pfVar7[-1] = fVar25 + fVar28; + pfVar6 = pfVar7 + 2; + *pfVar7 = fVar26 + fVar14; + pfVar4[-1] = fVar13 * (fVar25 - fVar28) - fVar16; + *pfVar4 = fVar18 + fVar13 * (fVar26 - fVar14); + pfVar5[-1] = fVar15 * (fVar21 - fVar27) - fVar20; + *pfVar5 = fVar22 + fVar15 * (fVar23 + fVar24); + pfVar3[-1] = fVar17 * (fVar21 + fVar27) - fVar24; + *pfVar3 = fVar27 + fVar17 * (fVar23 - fVar24); + pfVar3 = pfVar3 + 2; + pfVar4 = pfVar4 + 2; + pfVar5 = pfVar5 + 2; + pfVar7 = pfVar6; + } while (pfVar6 != param_3 + 3 + ((iVar11 + -1) - iVar8 & 0xfffffffeU) + iVar8); + } + fVar15 = param_4[6]; + fVar13 = fVar15 - (fVar13 + fVar13) * param_4[7]; + if (iVar9 < iVar10) { + pfVar3 = (float *)((int)param_3 + iVar12 + param_2 * 0x3c + 4); + pfVar4 = (float *)((int)param_3 + iVar12 + param_2 * 0x38 + 4); + pfVar5 = (float *)((int)param_3 + iVar12 + param_2 * 0x34 + 4); + pfVar7 = (float *)((int)param_3 + iVar12 + param_2 * 0x30 + 4); + do { + fVar14 = pfVar5[-1]; + fVar16 = pfVar4[-1]; + fVar18 = *pfVar5; + fVar20 = *pfVar4; + fVar23 = pfVar7[-1] + fVar14; + fVar25 = fVar16 + pfVar3[-1]; + fVar26 = fVar20 + *pfVar3; + fVar28 = *pfVar7 + fVar18; + fVar24 = fVar20 - *pfVar3; + fVar17 = pfVar7[-1] - fVar14; + fVar22 = fVar16 - pfVar3[-1]; + fVar21 = *pfVar7 - fVar18; + coprocessor_function(10,2,4,in_cr5,in_cr7,in_cr8); + coprocessor_function(10,6,4,in_cr4,in_cr7,in_cr0); + coprocessor_function(10,2,1,in_cr6,in_cr9,in_cr0); + coprocessor_function(10,6,0,in_cr5,in_cr9,in_cr1); + coprocessor_function(10,2,1,in_cr7,in_cr10,in_cr1); + coprocessor_function(10,6,0,in_cr6,in_cr10,in_cr2); + pfVar7[-1] = fVar23 + fVar25; + pfVar6 = pfVar7 + 2; + *pfVar7 = fVar28 + fVar26; + pfVar4[-1] = (fVar23 - fVar25) * (0.0 - fVar19) - fVar14; + *pfVar4 = fVar16 + (fVar28 - fVar26) * (0.0 - fVar19); + pfVar5[-1] = fVar15 * (fVar17 - fVar24) - fVar18; + *pfVar5 = fVar20 + fVar15 * (fVar21 + fVar22); + pfVar3[-1] = fVar13 * (fVar17 + fVar24) - fVar22; + *pfVar3 = fVar24 + fVar13 * (fVar21 - fVar22); + pfVar3 = pfVar3 + 2; + pfVar4 = pfVar4 + 2; + pfVar5 = pfVar5 + 2; + pfVar7 = pfVar6; + } while (pfVar6 != param_3 + 3 + iVar9 + ((iVar10 + -1) - iVar9 & 0xfffffffeU)); + } + iVar8 = iVar8 + iVar1; + pfVar2 = pfVar2 + 2; + param_4 = param_4 + 4; + iVar11 = iVar11 + iVar1; + iVar9 = iVar9 + iVar1; + iVar10 = iVar10 + iVar1; + iVar12 = iVar12 + param_2 * 0x20; + this = (FFT_R24_F32 *)param_1; + } while (iVar8 < param_1); + } + return this; +} + + + +// FFT_R24_F32::cftfsub(int, float*, float*) + +void FFT_R24_F32::cftfsub(int param_1,float *param_2,float *param_3) { + float *pfVar1; + float *pfVar2; + int iVar3; + int iVar4; + float *pfVar5; + float *pfVar6; + int iVar7; + float *pfVar8; + float fVar9; + float fVar10; + float fVar11; + float fVar12; + float fVar13; + float fVar14; + float fVar15; + float fVar16; + + if (param_1 < 9) { + iVar4 = 8; + iVar7 = 2; + } + else { + cft1st(this,param_1,param_2,param_3); + if (0x20 < param_1) { + iVar3 = 8; + iVar4 = 0x20; + do { + iVar7 = iVar4; + cftmdl(this,param_1,iVar3,param_2,param_3); + iVar4 = iVar7 * 4; + iVar3 = iVar7; + } while (param_1 != iVar4 && param_1 + iVar7 * -4 < 0 == SBORROW4(param_1,iVar4)); + if (param_1 == iVar4) goto LAB_0006175c; + if (iVar7 < 1) { + return; + } + goto LAB_000616ac; + } + iVar4 = 0x20; + iVar7 = 8; + } + if (param_1 == iVar4) { + LAB_0006175c: + if (iVar7 < 1) { + return; + } + pfVar1 = param_2 + iVar7 * 3 + 1; + pfVar2 = param_2 + iVar7 * 2 + 1; + pfVar5 = param_2 + 1; + pfVar8 = param_2 + iVar7 + 1; + do { + fVar15 = *pfVar2 + *pfVar1; + fVar13 = *pfVar5 + *pfVar8; + fVar9 = pfVar5[-1] + pfVar8[-1]; + fVar11 = pfVar2[-1] + pfVar1[-1]; + fVar14 = *pfVar5 - *pfVar8; + fVar10 = pfVar5[-1] - pfVar8[-1]; + fVar16 = pfVar2[-1] - pfVar1[-1]; + fVar12 = *pfVar2 - *pfVar1; + pfVar5[-1] = fVar9 + fVar11; + pfVar6 = pfVar5 + 2; + *pfVar5 = fVar13 + fVar15; + pfVar2[-1] = fVar9 - fVar11; + *pfVar2 = fVar13 - fVar15; + pfVar8[-1] = fVar10 - fVar12; + *pfVar8 = fVar14 + fVar16; + pfVar1[-1] = fVar10 + fVar12; + *pfVar1 = fVar14 - fVar16; + pfVar1 = pfVar1 + 2; + pfVar2 = pfVar2 + 2; + pfVar5 = pfVar6; + pfVar8 = pfVar8 + 2; + } while (pfVar6 != param_2 + iVar7 + 1); + return; + } + LAB_000616ac: + pfVar1 = param_2 + iVar7 + 1; + pfVar2 = param_2 + 1; + do { + fVar11 = pfVar2[-1]; + fVar13 = pfVar1[-1]; + fVar15 = *pfVar2; + fVar9 = *pfVar1; + pfVar2[-1] = fVar11 + fVar13; + pfVar5 = pfVar2 + 2; + *pfVar2 = fVar15 + *pfVar1; + pfVar1[-1] = fVar11 - fVar13; + *pfVar1 = fVar15 - fVar9; + pfVar1 = pfVar1 + 2; + pfVar2 = pfVar5; + } while (pfVar5 != param_2 + iVar7 + 1); + return; +} + + + +// FFT_R24_F32::cftbsub(int, float*, float*) + +void FFT_R24_F32::cftbsub(int param_1,float *param_2,float *param_3) { + float *pfVar1; + float *pfVar2; + int iVar3; + int iVar4; + float *pfVar5; + float *pfVar6; + int iVar7; + float *pfVar8; + float fVar9; + float fVar10; + float fVar11; + float fVar12; + float fVar13; + float fVar14; + float fVar15; + float fVar16; + + if (param_1 < 9) { + iVar4 = 8; + iVar7 = 2; + } + else { + cft1st(this,param_1,param_2,param_3); + if (0x20 < param_1) { + iVar3 = 8; + iVar4 = 0x20; + do { + iVar7 = iVar4; + cftmdl(this,param_1,iVar3,param_2,param_3); + iVar4 = iVar7 * 4; + iVar3 = iVar7; + } while (param_1 != iVar4 && param_1 + iVar7 * -4 < 0 == SBORROW4(param_1,iVar4)); + if (param_1 == iVar4) goto LAB_0006191c; + if (iVar7 < 1) { + return; + } + goto LAB_00061868; + } + iVar4 = 0x20; + iVar7 = 8; + } + if (param_1 == iVar4) { + LAB_0006191c: + if (iVar7 < 1) { + return; + } + pfVar1 = param_2 + iVar7 * 3 + 1; + pfVar2 = param_2 + iVar7 * 2 + 1; + pfVar5 = param_2 + 1; + pfVar8 = param_2 + iVar7 + 1; + do { + fVar11 = *pfVar2 + *pfVar1; + fVar9 = (0.0 - *pfVar5) - *pfVar8; + fVar13 = pfVar5[-1] + pfVar8[-1]; + fVar15 = pfVar2[-1] + pfVar1[-1]; + fVar10 = pfVar5[-1] - pfVar8[-1]; + fVar12 = *pfVar2 - *pfVar1; + fVar16 = pfVar2[-1] - pfVar1[-1]; + fVar14 = *pfVar8 - *pfVar5; + pfVar5[-1] = fVar13 + fVar15; + pfVar6 = pfVar5 + 2; + *pfVar5 = fVar9 - fVar11; + pfVar2[-1] = fVar13 - fVar15; + *pfVar2 = fVar9 + fVar11; + pfVar8[-1] = fVar10 - fVar12; + *pfVar8 = fVar14 - fVar16; + pfVar1[-1] = fVar10 + fVar12; + *pfVar1 = fVar14 + fVar16; + pfVar1 = pfVar1 + 2; + pfVar2 = pfVar2 + 2; + pfVar5 = pfVar6; + pfVar8 = pfVar8 + 2; + } while (pfVar6 != param_2 + iVar7 + 1); + return; + } + LAB_00061868: + pfVar1 = param_2 + iVar7 + 1; + pfVar2 = param_2 + 1; + do { + fVar11 = pfVar2[-1]; + fVar13 = pfVar1[-1]; + fVar15 = *pfVar2; + fVar9 = *pfVar1; + pfVar2[-1] = fVar11 + fVar13; + pfVar5 = pfVar2 + 2; + *pfVar2 = (0.0 - fVar15) - *pfVar1; + pfVar1[-1] = fVar11 - fVar13; + *pfVar1 = fVar9 - fVar15; + pfVar1 = pfVar1 + 2; + pfVar2 = pfVar5; + } while (pfVar5 != param_2 + iVar7 + 1); + return; +} + + + +// FFT_R24_F32::rftfsub(int, float*, int, float*) + +void FFT_R24_F32::rftfsub(int param_1,float *param_2,int param_3,float *param_4) { + int iVar1; + int iVar2; + float *pfVar3; + float *pfVar4; + float *pfVar5; + float *pfVar6; + float *pfVar7; + undefined4 in_cr4; + undefined4 in_cr5; + undefined4 in_cr7; + float fVar8; + float extraout_s14; + float fVar9; + + iVar1 = param_1 >> 1; + iVar2 = __divsi3(param_3 << 1,iVar1,param_2,param_3,param_3); + if (iVar1 < 3) { + return; + } + pfVar7 = param_4 + (param_3 - iVar2); + pfVar3 = param_2 + param_1; + pfVar5 = param_2 + 3; + fVar9 = extraout_s14; + do { + param_4 = param_4 + iVar2; + pfVar4 = pfVar3 + -2; + fVar8 = *pfVar7; + pfVar7 = pfVar7 + -iVar2; + coprocessor_function(10,2,5,in_cr7,in_cr7,in_cr5); + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr4); + fVar9 = (0.5 - fVar8) * (pfVar5[-1] - *pfVar4) - fVar9; + fVar8 = *param_4 + (0.5 - fVar8) * (*pfVar5 + pfVar3[-1]); + pfVar5[-1] = pfVar5[-1] - fVar9; + pfVar6 = pfVar5 + 2; + *pfVar5 = *pfVar5 - fVar8; + fVar9 = *pfVar4 + fVar9; + *pfVar4 = fVar9; + pfVar3[-1] = pfVar3[-1] - fVar8; + pfVar3 = pfVar4; + pfVar5 = pfVar6; + } while (pfVar6 != param_2 + (iVar1 - 3U & 0xfffffffe) + 5); + return; +} + + + +// FFT_R24_F32::rftbsub(int, float*, int, float*) + +void FFT_R24_F32::rftbsub(int param_1,float *param_2,int param_3,float *param_4) { + int iVar1; + int iVar2; + float *pfVar3; + float *pfVar4; + float *pfVar5; + float *pfVar6; + float *pfVar7; + undefined4 in_cr4; + undefined4 in_cr5; + undefined4 in_cr7; + float fVar8; + float extraout_s14; + float fVar9; + + iVar1 = param_1 >> 1; + param_2[1] = 0.0 - param_2[1]; + iVar2 = __divsi3(param_3 << 1,iVar1); + if (2 < iVar1) { + pfVar5 = param_4 + (param_3 - iVar2); + pfVar3 = param_2 + param_1; + pfVar6 = param_2 + 3; + fVar9 = extraout_s14; + do { + param_4 = param_4 + iVar2; + pfVar4 = pfVar3 + -2; + fVar8 = *pfVar5; + pfVar5 = pfVar5 + -iVar2; + coprocessor_function(10,2,5,in_cr7,in_cr7,in_cr5); + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr4); + fVar9 = fVar9 + (0.5 - fVar8) * (pfVar6[-1] - *pfVar4); + fVar8 = (0.5 - fVar8) * (*pfVar6 + pfVar3[-1]) - *param_4; + pfVar6[-1] = pfVar6[-1] - fVar9; + pfVar7 = pfVar6 + 2; + *pfVar6 = fVar8 - *pfVar6; + fVar9 = *pfVar4 + fVar9; + *pfVar4 = fVar9; + pfVar3[-1] = fVar8 - pfVar3[-1]; + pfVar3 = pfVar4; + pfVar6 = pfVar7; + } while (pfVar7 != param_2 + (iVar1 - 3U & 0xfffffffe) + 5); + } + param_2[iVar1 + 1] = 0.0 - param_2[iVar1 + 1]; + return; +} + + + +// FFT_R24_F32::rdft(int, int, float*, int*, float*) + +void FFT_R24_F32::rdft(int param_1,int param_2,float *param_3,int *param_4, + float *param_5) { + int iVar1; + int iVar2; + int iVar3; + undefined4 in_cr6; + undefined4 in_cr7; + float fVar4; + + iVar2 = *param_4; + iVar1 = param_1 >> 2; + if (param_1 != iVar2 * 4 && param_1 + iVar2 * -4 < 0 == SBORROW4(param_1,iVar2 * 4)) { + makewt(this,iVar1,param_4,param_5); + iVar2 = iVar1; + } + iVar3 = param_4[1]; + if (param_1 != iVar3 * 4 && param_1 + iVar3 * -4 < 0 == SBORROW4(param_1,iVar3 * 4)) { + makect(this,iVar1,param_4,param_5 + iVar2); + iVar3 = iVar1; + } + if (param_2 < 0) { + fVar4 = *param_3 - param_3[1]; + coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr6); + param_3[1] = fVar4; + *param_3 = *param_3 - fVar4; + if (4 < param_1) { + rftbsub(this,param_1,param_3,iVar3,param_5 + iVar2); + bitrv2(this,param_1,param_4 + 2,param_3); + cftbsub(this,param_1,param_3,param_5); + return; + } + if (param_1 == 4) { + cftfsub(this,4,param_3,param_5); + return; + } + } + else { + if (param_1 < 5) { + if (param_1 == 4) { + cftfsub(this,4,param_3,param_5); + } + } + else { + bitrv2(this,param_1,param_4 + 2,param_3); + cftfsub(this,param_1,param_3,param_5); + rftfsub(this,param_1,param_3,iVar3,param_5 + iVar2); + } + fVar4 = *param_3; + *param_3 = fVar4 + param_3[1]; + param_3[1] = fVar4 - param_3[1]; + } + return; +} + + + +// FFT_R24_F32::FFT_R24_F32(int) + +FFT_R24_F32::FFT_R24_F32(int param_1) { + uint uVar1; + void *pvVar2; + undefined4 uVar3; + undefined4 extraout_r1; + undefined4 unaff_r4; + undefined4 unaff_r5; + uint uVar4; + bool in_ZR; + double dVar5; + + dVar5 = SQRT((double)(longlong)param_1); + if (!in_ZR) { + uVar3 = SUB84((double)(longlong)param_1,0); + sqrt((double)CONCAT44(unaff_r5,unaff_r4)); + dVar5 = (double)CONCAT44(extraout_r1,uVar3); + } + *(int *)(this + 8) = param_1; + if ((uint)(param_1 * 2) < 0x1fc00001) { + uVar1 = param_1 << 3; + } + else { + uVar1 = 0xffffffff; + } + uVar4 = SUB84(ROUND(dVar5),0) + 2; + pvVar2 = operator_new__(uVar1); + *(void **)this = pvVar2; + if (uVar4 < 0x1fc00001) { + uVar1 = uVar4 * 4; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + *(void **)(this + 4) = pvVar2; + if ((*(void **)this != nullptr) && (pvVar2 != nullptr)) { + memset(*(void **)this,0,param_1 << 3); + memset(*(void **)(this + 4),0,uVar4 * 4); + } + return this; +} + + + +// FFT_R24_F32::~FFT_R24_F32() + +FFT_R24_F32::~FFT_R24_F32() { + if (*(void **)this != nullptr) { + operator_delete__(*(void **)this); + } + if (*(void **)(this + 4) != nullptr) { + operator_delete__(*(void **)(this + 4)); + } + return this; +} + + + +// FFT_R24_F32::RDFT(float*) + +void FFT_R24_F32::RDFT(float *param_1) { + if ((*(float **)this != nullptr) && (*(int **)(this + 4) != nullptr)) { + rdft(this,*(int *)(this + 8),1,param_1,*(int **)(this + 4),*(float **)this); + } + return; +} + + + +// FFT_R24_F32::IRDFT(float*) + +void FFT_R24_F32::IRDFT(float *param_1) { + if ((*(float **)this != nullptr) && (*(int **)(this + 4) != nullptr)) { + rdft(this,*(int *)(this + 8),-1,param_1,*(int **)(this + 4),*(float **)this); + } + return; +} + diff --git a/src/util/FFT_R24_F32.h b/src/util/FFT_R24_F32.h new file mode 100644 index 0000000..f7522cd --- /dev/null +++ b/src/util/FFT_R24_F32.h @@ -0,0 +1,32 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_FFT_R24_F32_H +#define VIPER_FFT_R24_F32_H + + +class FFT_R24_F32 { + void* field_0x0; + void* field_0x4; + int field_0x8; + +public: + void makect(int param_1,int *param_2,float *param_3); + void bitrv2(int param_1,int *param_2,float *param_3); + void makewt(int param_1,int *param_2,float *param_3); + cft1st(int param_1,float *param_2,float *param_3); + cftmdl(int param_1,int param_2,float *param_3,float *param_4); + void cftfsub(int param_1,float *param_2,float *param_3); + void cftbsub(int param_1,float *param_2,float *param_3); + void rftfsub(int param_1,float *param_2,int param_3,float *param_4); + void rftbsub(int param_1,float *param_2,int param_3,float *param_4); + void rdft(int param_1,int param_2,float *param_3,int *param_4,float *param_5); + FFT_R24_F32(int param_1); + ~FFT_R24_F32(); + void RDFT(float *param_1); + void IRDFT(float *param_1); +}; + + +#endif //VIPER_FFT_R24_F32_H diff --git a/src/util/FIR.cpp b/src/util/FIR.cpp new file mode 100644 index 0000000..3e63cd3 --- /dev/null +++ b/src/util/FIR.cpp @@ -0,0 +1,240 @@ +// +// Created by mart on 2/12/21. +// + +#include "FIR.h" + +// FIR::FIR() + +FIR::FIR() { + this->field_0x0 = nullptr; + this->field_0x20 = nullptr; + this->field_0x40 = nullptr; + this->field_0x44 = 0; + this->blockLength = 0; + this->field_0x4c = '\0'; + return; +} + + + +// FIR::~FIR() + +FIR::~FIR() { + if (this->field_0x0 != nullptr) { + free(this->field_0x0); + } + if (this->field_0x20 != nullptr) { + free(this->field_0x20); + } + if (this->field_0x40 != nullptr) { + free(this->field_0x40); + } + return this; +} + + + +// FIR::GetBlockLength() + +int FIR::GetBlockLength() { + return this->blockLength; +} + + + +// FIR::Reset() + +void FIR::Reset() { + undefined4 *puVar1; + int iVar2; + + if ((this->field_0x0 != nullptr) && (-1 < this->field_0x44 + this->blockLength)) { + iVar2 = 0; + puVar1 = (undefined4 *)((int)this->field_0x0 + -4); + do { + puVar1 = puVar1 + 1; + *puVar1 = 0; + iVar2 = iVar2 + 1; + } while (iVar2 <= this->field_0x44 + this->blockLength); + } + return; +} + + + +// FIR::LoadCoefficients(int const*, int, int) + +undefined4 FIR::LoadCoefficients(int *param_1,int param_2,int param_3) { + void *pvVar1; + void *pvVar2; + int iVar3; + int iVar4; + bool bVar5; + bool bVar6; + + bVar5 = param_3 < 0; + bVar6 = param_3 == 0; + if (0 < param_3) { + bVar5 = param_2 < 0; + bVar6 = param_2 == 0; + } + iVar3 = param_3; + if (!bVar6 && !bVar5) { + iVar3 = 0; + } + if ((!bVar6 && !bVar5) && (param_1 != nullptr)) { + this->field_0x4c = (char)iVar3; + if (this->field_0x0 != nullptr) { + free(this->field_0x0); + } + if (this->field_0x20 != nullptr) { + free(this->field_0x20); + } + if (this->field_0x40 != nullptr) { + free(this->field_0x40); + } + this->field_0x0 = nullptr; + this->field_0x20 = nullptr; + this->field_0x40 = nullptr; + pvVar1 = valloc((param_2 + param_3 + 1) * 4); + this->field_0x0 = pvVar1; + pvVar1 = valloc(param_2 << 2); + this->field_0x20 = pvVar1; + pvVar1 = valloc(param_3 << 2); + this->field_0x40 = pvVar1; + if (((this->field_0x0 != nullptr) && (pvVar2 = this->field_0x20, pvVar2 != nullptr)) && + (pvVar1 != nullptr)) { + iVar3 = 0; + iVar4 = 0; + this->field_0x44 = param_2; + this->blockLength = param_3; + do { + iVar4 = iVar4 + 1; + *(undefined4 *)((int)pvVar2 + iVar3) = *(undefined4 *)((int)param_1 + iVar3); + iVar3 = iVar3 + 4; + } while (iVar4 < param_2); + Reset(this); + if (((this->field_0x0 != nullptr) && (this->field_0x20 != nullptr)) && (this->field_0x40 != nullptr)) { + this->field_0x4c = '\x01'; + return 1; + } + } + } + return 0; +} + + + +// FIR::FilterSamplesInterleaved(int*, int, int) + +void FIR::FilterSamplesInterleaved(int *param_1,int param_2,int param_3) { + undefined4 *puVar1; + longlong lVar2; + int iVar3; + int iVar4; + int *piVar5; + int iVar6; + undefined4 *puVar7; + undefined4 *puVar8; + int *piVar9; + int *piVar10; + void *pvVar12; + undefined4 *puVar13; + void *pvVar14; + int *piVar15; + int *piVar16; + int iVar17; + int iVar18; + int iVar19; + int *piVar11; + + if (this->field_0x4c != '\0') { + iVar3 = this->field_0x44; + iVar6 = this->blockLength; + iVar4 = iVar6; + if (0 < param_2) { + puVar7 = (undefined4 *)this->field_0x40; + iVar4 = 0; + puVar13 = puVar7; + do { + puVar1 = (undefined4 *)((int)param_1 + iVar4); + iVar4 = iVar4 + param_3 * 4; + puVar8 = puVar13 + 1; + *puVar13 = *puVar1; + puVar13 = puVar8; + } while (puVar8 != puVar7 + param_2); + iVar4 = this->blockLength; + } + if (param_2 < iVar4) { + puVar13 = (undefined4 *)((int)this->field_0x40 + (param_2 + 0x3fffffff) * 4); + iVar4 = param_2; + do { + puVar13 = puVar13 + 1; + *puVar13 = 0; + iVar4 = iVar4 + 1; + } while (iVar4 < this->blockLength); + } + if (0 < iVar6) { + piVar9 = (int *)this->field_0x40; + piVar16 = (int *)this->field_0x0; + piVar15 = piVar16 + iVar3 + 0x3fffffff; + piVar10 = piVar9; + do { + piVar11 = piVar10 + 1; + piVar5 = piVar15 + 1; + *piVar15 = *piVar10; + piVar15 = piVar5; + piVar10 = piVar11; + } while (piVar11 != piVar9 + iVar6); + iVar18 = 0; + iVar4 = 0; + do { + if (iVar3 < 1) { + iVar19 = 0; + } + else { + iVar19 = 0; + piVar15 = (int *)((int)this->field_0x20 + -4); + piVar5 = piVar16 + iVar3 + 0x40000000; + do { + piVar15 = piVar15 + 1; + piVar5 = piVar5 + -1; + lVar2 = (longlong)*piVar15 * (longlong)*piVar5 + 0x1000000; + iVar19 = iVar19 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + } while (piVar16 != piVar5); + } + if (iVar4 < param_2) { + piVar5 = param_1; + } + iVar17 = iVar4 + 1; + piVar16 = piVar16 + 1; + if (iVar4 < param_2) { + *(int *)((int)piVar5 + iVar18) = iVar19; + } + iVar18 = iVar18 + param_3 * 4; + iVar4 = iVar17; + } while (iVar17 != iVar6); + } + if (1 < iVar3) { + pvVar12 = this->field_0x40; + puVar13 = (undefined4 *)((int)pvVar12 + iVar6 * 4); + pvVar14 = (void *)((int)this->field_0x0 + iVar3 * 4); + do { + puVar13 = puVar13 + -1; + *(undefined4 *)((int)pvVar14 + -8) = *puVar13; + pvVar14 = (void *)((int)pvVar14 + -4); + } while (puVar13 != (undefined4 *)((int)pvVar12 + iVar3 * -4 + iVar6 * 4 + 4)); + } + } + return; +} + + + +// FIR::FilterSamples(int*, int) + +void FIR::FilterSamples(int *param_1,int param_2) { + FilterSamplesInterleaved(this,param_1,param_2,1); + return; +} diff --git a/src/util/FIR.h b/src/util/FIR.h new file mode 100644 index 0000000..d9d6634 --- /dev/null +++ b/src/util/FIR.h @@ -0,0 +1,83 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_FIR_H +#define VIPER_FIR_H + + +class FIR { + void * field_0x0; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + void * field_0x20; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + void * field_0x40; + int field_0x44; + int blockLength; + char field_0x4c; +public: + FIR(); + ~FIR(); + int GetBlockLength(); + void Reset(); + undefined4 LoadCoefficients(int *param_1,int param_2,int param_3); + void FilterSamplesInterleaved(int *param_1,int param_2,int param_3); + void FilterSamples(int *param_1,int param_2); +}; + + +#endif //VIPER_FIR_H diff --git a/src/util/FixedBiquad.cpp b/src/util/FixedBiquad.cpp new file mode 100644 index 0000000..11db9e9 --- /dev/null +++ b/src/util/FixedBiquad.cpp @@ -0,0 +1,223 @@ +// +// Created by mart on 2/12/21. +// + +#include "FixedBiquad.h" + + +// FixedBiquad::SetCoeffs(float, float, float, float, float, float) + +void FixedBiquad::SetCoeffs(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6 +) { + this->field_0x4 = 0; + this->field_0x0 = 0; + this->field_0xc = 0; + this->field_0x8 = 0; + this->field_0x1c = -SUB84(ROUND((double)((float)param_2 / (float)param_1) * 33554432.0 + 0.5),0); + this->field_0x20 = -SUB84(ROUND((double)((float)param_3 / (float)param_1) * 33554432.0 + 0.5),0); + this->field_0x10 = SUB84(ROUND((double)((float)param_4 / (float)param_1) * 33554432.0 + 0.5),0); + this->field_0x18 = SUB84(ROUND((double)((float)param_6 / (float)param_1) * 33554432.0 + 0.5),0); + this->field_0x14 = SUB84(ROUND((double)((float)param_5 / (float)param_1) * 33554432.0 + 0.5),0); + return; +} + + + +// FixedBiquad::Reset() + +void FixedBiquad::Reset() { + this->field_0x1c = 0; + this->field_0x20 = 0; + this->field_0x10 = 0; + this->field_0x14 = 0; + this->field_0x18 = 0; + this->field_0x0 = 0; + this->field_0x4 = 0; + this->field_0x8 = 0; + this->field_0xc = 0; + return; +} + + + +// FixedBiquad::FixedBiquad() + +FixedBiquad::FixedBiquad() { + Reset(this); + SetCoeffs(this,0x3f800000,0,0,0x3f800000,0,0); + return this; +} + + + +// FixedBiquad::SetHighPassParameter(float, float, float, float, float) + +void FixedBiquad::SetHighPassParameter(float param_1,float param_2,float param_3,float param_4,float param_5) { + float fVar1; + float fVar2; + int iVar3; + float fVar4; + float in_r2; + undefined in_ZR; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + undefined4 in_cr10; + undefined4 in_cr11; + undefined4 in_cr12; + undefined4 in_cr13; + float fVar5; + float __x; + float extraout_s1; + float __y; + float extraout_s1_00; + float extraout_s1_01; + float extraout_s1_02; + float extraout_s1_03; + float fVar6; + float fVar7; + float fVar8; + float fVar9; + float fVar10; + float unaff_s24; + + fVar1 = 10.0; + coprocessor_function(10,6,1,in_cr10,in_cr7,in_cr10); + fVar10 = 6.283185 / in_r2; + fVar5 = powf(param_1,param_2); + fVar2 = fVar10; + fVar5 = sinf(fVar5); + if (!(bool)in_ZR) { + fVar5 = sqrtf(fVar5); + } + fVar6 = SQRT(fVar1); + coprocessor_function(10,2,0,in_cr9,in_cr9,in_cr7); + fVar7 = fVar1 - 1.0; + fVar8 = fVar1 + 1.0; + coprocessor_function(10,2,1,in_cr9,in_cr9,in_cr7); + __x = cosf(fVar5); + coprocessor_function(10,2,4,in_cr12,in_cr9,in_cr11); + __y = extraout_s1; + fVar5 = fVar6; + if (!(bool)in_ZR) { + fVar5 = fVar1; + __x = sqrtf(__x); + __y = extraout_s1_03; + } + coprocessor_function(10,2,0,in_cr11,in_cr10,in_cr11); + coprocessor_function(10,6,5,in_cr12,in_cr8,in_cr12); + coprocessor_function(10,6,5,in_cr12,in_cr12,in_cr7); + coprocessor_function(10,2,1,in_cr13,in_cr13,in_cr8); + if (!(bool)in_ZR) { + __x = sqrtf(__x); + __y = extraout_s1_02; + } + fVar9 = fVar8 - unaff_s24; + coprocessor_function(10,2,1,in_cr12,in_cr12,in_cr8); + fVar4 = fVar6; + if (!(bool)in_ZR) { + fVar4 = fVar1; + __x = sqrtf(__x); + __y = extraout_s1_01; + } + if (!(bool)in_ZR) { + __x = sqrtf(__x); + __y = extraout_s1_00; + fVar6 = fVar1; + } + iVar3 = 0x41200000; + powf(__x,__y); + fVar7 = fVar7 - fVar10; + coprocessor_function(10,2,1,in_cr13,in_cr13,in_cr7); + coprocessor_function(10,6,5,in_cr12,in_cr12,in_cr7); + coprocessor_function(10,6,1,in_cr7,in_cr12,in_cr7); + SetCoeffs(this,(int)(fVar9 + (fVar4 + fVar4) * fVar2),(int)(fVar7 + fVar7), + (int)(fVar9 - (fVar6 + fVar6) * fVar2), + (int)(fVar8 + unaff_s24 + (fVar5 + fVar5) * fVar2),-0x40000000,iVar3); + return; +} + + + +// FixedBiquad::SetBandPassParameter(float, float, float) + +void FixedBiquad::SetBandPassParameter(int param_1,int samplerate,int param_3) { + float fVar1; + undefined4 in_cr6; + undefined4 in_cr7; + undefined4 in_cr8; + undefined4 in_cr9; + float in_s0; + float __x; + float fVar2; + float phaseStep; + + coprocessor_function(10,2,0,in_cr9,in_cr7,in_cr9); + phaseStep = 6.283185 / (float)samplerate; + fVar1 = phaseStep; + __x = sinf(in_s0); + fVar2 = fVar1 / ((float)param_3 + (float)param_3); + cosf(__x); + coprocessor_function(10,6,1,in_cr6,in_cr7,in_cr6); + coprocessor_function(10,2,1,in_cr7,in_cr8,in_cr7); + SetCoeffs(this,(int)(fVar2 + 1.0),-0x40000000,(int)(1.0 - fVar2),(int)phaseStep,0, + (int)(0.0 - fVar1 * 0.5)); + return; +} + + + +// FixedBiquad::SetLowPassParameter(float, float, float) + +void FixedBiquad::SetLowPassParameter(float param_1,float param_2,float param_3) { + float in_r2; + float in_r3; + undefined4 in_cr5; + undefined4 in_cr6; + undefined4 in_cr7; + undefined4 in_cr8; + float __x; + float fVar1; + float fVar2; + + coprocessor_function(10,6,1,in_cr8,in_cr7,in_cr8); + fVar2 = 6.283185 / in_r2; + fVar1 = fVar2; + __x = sinf(param_1); + fVar1 = fVar1 / (in_r3 + in_r3); + cosf(__x); + coprocessor_function(10,2,0,in_cr7,in_cr6,in_cr7); + coprocessor_function(10,6,5,in_cr5,in_cr6,in_cr5); + SetCoeffs(this,(int)(fVar1 + 1.0),-0x40000000,(int)(1.0 - fVar1),0x3f000000,(int)(1.0 - fVar2), + 0x3f000000); + return; +} + + + +// FixedBiquad::ProcessSample(int) + +uint FixedBiquad::ProcessSample(int param_1) { + longlong lVar1; + uint uVar2; + int iVar3; + int iVar4; + int iVar5; + + iVar3 = this->field_0x0; + iVar5 = this->field_0x4; + iVar4 = this->field_0xc; + this->field_0x4 = iVar3; + this->field_0x0 = param_1; + this->field_0xc = this->field_0x8; + lVar1 = (longlong)this->field_0x20 * (longlong)iVar4 + + (longlong)this->field_0x1c * (longlong)(int)this->field_0x8 + + (longlong)this->field_0x18 * (longlong)iVar5 + + (longlong)this->field_0x10 * (longlong)param_1 + + (longlong)this->field_0x14 * (longlong)iVar3; + uVar2 = (uint)lVar1; + uVar2 = uVar2 + 0x1000000 >> 0x19 | + ((int)((ulonglong)lVar1 >> 0x20) + (uint)(0xfeffffff < uVar2)) * 0x80; + this->field_0x8 = uVar2; + return uVar2; +} diff --git a/src/util/FixedBiquad.h b/src/util/FixedBiquad.h new file mode 100644 index 0000000..247825d --- /dev/null +++ b/src/util/FixedBiquad.h @@ -0,0 +1,31 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_FIXEDBIQUAD_H +#define VIPER_FIXEDBIQUAD_H + + +class FixedBiquad { + undefined4 field_0x0; + undefined4 field_0x4; + undefined4 field_0x8; + undefined4 field_0xc; + int field_0x10; + int field_0x14; + int field_0x18; + int field_0x1c; + int field_0x20; + +public: + void SetCoeffs(int param_1,int param_2,int param_3,int param_4,int param_5,int param_6); + void Reset(); + FixedBiquad(); + void SetHighPassParameter(float param_1,float param_2,float param_3,float param_4,float param_5); + void SetBandPassParameter(int param_1,int samplerate,int param_3); + void SetLowPassParameter(float param_1,float param_2,float param_3); + uint ProcessSample(int param_1); +}; + + +#endif //VIPER_FIXEDBIQUAD_H diff --git a/src/util/Harmonic.cpp b/src/util/Harmonic.cpp new file mode 100644 index 0000000..e686014 --- /dev/null +++ b/src/util/Harmonic.cpp @@ -0,0 +1,228 @@ +// +// Created by mart on 2/12/21. +// + +#include "Harmonic.h" + + +// Harmonic::~Harmonic() + +Harmonic::~Harmonic() { + return; +} + + + +// Harmonic::UpdateCoeffs(float const*) + +void Harmonic::UpdateCoeffs(float *param_1) { + float *pfVar1; + float *pfVar2; + int iVar3; + int iVar4; + float *pfVar5; + float *pfVar6; + char in_NG; + undefined in_ZR; + char in_OV; + undefined4 in_cr7; + float coeff; + float fVar7; + float local_9c [20]; + float afStack76 [14]; + float *coeffptr; + + fVar7 = 0.0; + iVar3 = 10; + local_9c[0] = 0.0; + local_9c[1] = 0.0; + local_9c[2] = 0.0; + local_9c[3] = 0.0; + local_9c[4] = 0.0; + local_9c[5] = 0.0; + local_9c[6] = 0.0; + local_9c[7] = 0.0; + local_9c[8] = 0.0; + local_9c[9] = 0.0; + local_9c[10] = 0.0; + coeffptr = param_1; + do { + coeff = *coeffptr; + coeffptr = coeffptr + 1; + if (!(bool)in_ZR && in_NG == in_OV) { + fVar7 = ABS(coeff); + } + in_OV = SBORROW4(iVar3,1); + iVar3 = iVar3 + -1; + in_NG = iVar3 < 0; + in_ZR = iVar3 == 0; + } while (!(bool)in_ZR); + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + this->field_0x34 = ROUND(fVar7); + coeffptr = local_9c + 1; + do { + pfVar1 = coeffptr + 1; + *coeffptr = *param_1; + param_1 = param_1 + 1; + coeffptr = pfVar1; + } while (pfVar1 != local_9c + 0xb); + coeffptr = local_9c; + do { + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + *coeffptr = *coeffptr; + coeffptr = coeffptr + 1; + } while (coeffptr != local_9c + 0xb); + pfVar1 = afStack76 + 2; + do { + pfVar6 = pfVar1 + 1; + *pfVar1 = 0.0; + *coeffptr = 0.0; + pfVar1 = pfVar6; + coeffptr = coeffptr + 1; + } while (pfVar6 != afStack76 + 0xd); + coeffptr = local_9c + 10; + pfVar1 = local_9c + 0xe; + pfVar2 = afStack76 + 5; + iVar4 = 2; + local_9c[11] = local_9c[10]; + fVar7 = local_9c[11]; + pfVar6 = pfVar1; + pfVar5 = pfVar2; + iVar3 = iVar4; + do { + do { + local_9c[11] = fVar7; + coeff = pfVar1[-2]; + iVar4 = iVar4 + -1; + fVar7 = pfVar2[-1]; + pfVar2 = pfVar2 + -1; + *pfVar2 = pfVar1[-1]; + pfVar1 = pfVar1 + -1; + *pfVar1 = (coeff + coeff) - fVar7; + fVar7 = local_9c[11]; + } while (0 < iVar4); + iVar4 = iVar3 + 1; + coeffptr = coeffptr + -1; + pfVar1 = pfVar6 + 1; + pfVar2 = pfVar5 + 1; + fVar7 = *coeffptr - afStack76[2]; + afStack76[2] = local_9c[11]; + pfVar6 = pfVar1; + pfVar5 = pfVar2; + iVar3 = iVar4; + } while (iVar4 != 0xb); + coeffptr = afStack76 + 0xd; + pfVar1 = afStack76 + 2; + do { + pfVar6 = pfVar1 + -2; + coeffptr = coeffptr + -1; + pfVar1 = pfVar1 + -1; + *pfVar1 = *pfVar6 - *coeffptr; + } while (coeffptr != afStack76 + 3); + coeffptr = local_9c + 0xc; + iVar3 = 0; + local_9c[11] = local_9c[0] * 0.5 - local_9c[11]; + while( true ) { + *(float *)((int)this->field_0x0 + iVar3) = ROUND(local_9c[11] * 3.355443e+07 + 0.5); + iVar3 = iVar3 + 4; + if (iVar3 == 0x2c) break; + local_9c[11] = *coeffptr; + coeffptr = coeffptr + 1; + } + return; +} + + + +// Harmonic::Reset() + +void Harmonic::Reset() { + this->field_0x2c = 0; + this->field_0x30 = 0; + this->field_0x38 = 0; + return; +} + + + +// Harmonic::Harmonic() + +Harmonic::Harmonic() { + UpdateCoeffs(this,FLOAT_ARRAY_000ce820); + Reset(this); + return this; +} + + + +// Harmonic::SetHarmonics(float const*) + +void Harmonic::SetHarmonics(float *param_1) { + UpdateCoeffs(this,param_1); + Reset(this); + return; +} + + + +// Harmonic::Process(int) + +int Harmonic::Process(int param_1) { + longlong lVar1; + longlong lVar2; + int iVar3; + int iVar4; + int iVar5; + + lVar1 = (longlong)(int)this->field_0x0[10] * (longlong)param_1 + 0x1000000; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[9] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[8] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + lVar2 = (longlong)(int)this->field_0x30 * 0x1ff7cee + 0x1000000; + iVar3 = this->field_0x2c; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[7] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + iVar5 = this->field_0x38; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[6] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + if (iVar5 < (int)this->field_0x34) { + this->field_0x38 = iVar5 + 1; + } + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[5] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[4] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[3] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[2] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + lVar1 = (longlong)param_1 * + (longlong) + (int)((int)this->field_0x0[1] + + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7)) + 0x1000000; + iVar4 = (int)this->field_0x0[0] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + this->field_0x2c = iVar4; + iVar3 = (iVar4 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7)) - iVar3; + this->field_0x30 = iVar3; + if (iVar5 < (int)this->field_0x34) { + iVar3 = 0; + } + return iVar3; +} diff --git a/src/util/Harmonic.h b/src/util/Harmonic.h new file mode 100644 index 0000000..1b1977e --- /dev/null +++ b/src/util/Harmonic.h @@ -0,0 +1,26 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_HARMONIC_H +#define VIPER_HARMONIC_H + + +class Harmonic { + float field_0x0[11]; + undefined4 field_0x2c; + undefined4 field_0x30; + float field_0x34; + undefined4 field_0x38; + +public: + ~Harmonic(); + void UpdateCoeffs(float *param_1); + void Reset(); + Harmonic(); + void SetHarmonics(float *param_1); + int Process(int param_1); +}; + + +#endif //VIPER_HARMONIC_H diff --git a/src/util/HiFi.cpp b/src/util/HiFi.cpp new file mode 100644 index 0000000..b547048 --- /dev/null +++ b/src/util/HiFi.cpp @@ -0,0 +1,391 @@ +// +// Created by mart on 2/13/21. +// + +#include "HiFi.h" + +// HiFi::~HiFi() + +HiFi::~HiFi() { + IIR_NOrder_BW_LH *pIVar1; + IIR_NOrder_BW_BP *pIVar2; + WaveBuffer_I32 *pWVar3; + + pIVar1 = *(IIR_NOrder_BW_LH **)(this + 8); + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar1 = *(IIR_NOrder_BW_LH **)(this + 0xc); + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar2 = *(IIR_NOrder_BW_BP **)(this + 0x10); + if (pIVar2 != nullptr) { + IIR_NOrder_BW_BP::~IIR_NOrder_BW_BP(pIVar2); + operator_delete(pIVar2); + } + pIVar1 = *(IIR_NOrder_BW_LH **)(this + 0x14); + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar1 = *(IIR_NOrder_BW_LH **)(this + 0x18); + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar2 = *(IIR_NOrder_BW_BP **)(this + 0x1c); + if (pIVar2 != nullptr) { + IIR_NOrder_BW_BP::~IIR_NOrder_BW_BP(pIVar2); + operator_delete(pIVar2); + } + pWVar3 = *(WaveBuffer_I32 **)this; + if (pWVar3 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(pWVar3); + operator_delete(pWVar3); + } + pWVar3 = *(WaveBuffer_I32 **)(this + 4); + if (pWVar3 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(pWVar3); + operator_delete(pWVar3); + } + return this; +} + + + +// HiFi::Reset() + +void HiFi::Reset(void) { + WaveBuffer_I32 **in_r0; + undefined4 in_cr0; + undefined4 in_cr1; + float in_s0; + float in_s1; + undefined8 uVar1; + float in_s2; + float extraout_s2; + float extraout_s2_00; + float extraout_s2_01; + float extraout_s2_02; + float extraout_s2_03; + WaveBuffer_I32 *pWVar2; + + uVar1 = CONCAT44(in_s1,in_s0); + if ((IIR_NOrder_BW_LH *)in_r0[2] != nullptr) { + IIR_NOrder_BW_LH::setLPF((IIR_NOrder_BW_LH *)in_r0[2],in_s0,in_s1); + uVar1 = IIR_NOrder_BW_LH::Mute((IIR_NOrder_BW_LH *)in_r0[2]); + in_s2 = extraout_s2; + } + if ((IIR_NOrder_BW_LH *)in_r0[3] != nullptr) { + IIR_NOrder_BW_LH::setHPF + ((IIR_NOrder_BW_LH *)in_r0[3],(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + uVar1 = IIR_NOrder_BW_LH::Mute((IIR_NOrder_BW_LH *)in_r0[3]); + in_s2 = extraout_s2_00; + } + if (in_r0[4] != nullptr) { + IIR_NOrder_BW_BP::setBPF((float)uVar1,(float)((ulonglong)uVar1 >> 0x20),in_s2); + uVar1 = IIR_NOrder_BW_BP::Mute((IIR_NOrder_BW_BP *)in_r0[4]); + in_s2 = extraout_s2_01; + } + if ((IIR_NOrder_BW_LH *)in_r0[5] != nullptr) { + IIR_NOrder_BW_LH::setLPF + ((IIR_NOrder_BW_LH *)in_r0[5],(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + uVar1 = IIR_NOrder_BW_LH::Mute((IIR_NOrder_BW_LH *)in_r0[5]); + in_s2 = extraout_s2_02; + } + if ((IIR_NOrder_BW_LH *)in_r0[6] != nullptr) { + IIR_NOrder_BW_LH::setHPF + ((IIR_NOrder_BW_LH *)in_r0[6],(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + uVar1 = IIR_NOrder_BW_LH::Mute((IIR_NOrder_BW_LH *)in_r0[6]); + in_s2 = extraout_s2_03; + } + if (in_r0[7] != nullptr) { + IIR_NOrder_BW_BP::setBPF((float)uVar1,(float)((ulonglong)uVar1 >> 0x20),in_s2); + IIR_NOrder_BW_BP::Mute((IIR_NOrder_BW_BP *)in_r0[7]); + } + if (*in_r0 != nullptr) { + pWVar2 = in_r0[9]; + coprocessor_function(0xb,6,5,in_cr0,in_cr0,in_cr1); + WaveBuffer_I32::Reset(*in_r0); + WaveBuffer_I32::PushZeros(*in_r0,SUB84(ROUND((double)(longlong)(int)pWVar2 / 1000000000.0),0)); + } + if (in_r0[1] != nullptr) { + pWVar2 = in_r0[9]; + coprocessor_function(0xb,6,5,in_cr0,in_cr0,in_cr1); + WaveBuffer_I32::Reset(in_r0[1]); + WaveBuffer_I32::PushZeros(in_r0[1],SUB84(ROUND((double)(longlong)(int)pWVar2 / 1000000000.0),0)) + ; + return; + } + return; +} + + + +// HiFi::HiFi() + +HiFi::HiFi() { + WaveBuffer_I32 *pWVar1; + IIR_NOrder_BW_LH *pIVar2; + IIR_NOrder_BW_BP *pIVar3; + + *(undefined4 *)(this + 0x20) = 0x2000000; + *(undefined4 *)(this + 0x24) = 0xac44; + pWVar1 = (WaveBuffer_I32 *)operator_new(0x20); + WaveBuffer_I32::WaveBuffer_I32(pWVar1,2,0x800); + *(WaveBuffer_I32 **)this = pWVar1; + pWVar1 = (WaveBuffer_I32 *)operator_new(0x20); + WaveBuffer_I32::WaveBuffer_I32(pWVar1,2,0x800); + *(WaveBuffer_I32 **)(this + 4) = pWVar1; + pIVar2 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar2,1); + *(IIR_NOrder_BW_LH **)(this + 8) = pIVar2; + pIVar2 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar2,3); + *(IIR_NOrder_BW_LH **)(this + 0xc) = pIVar2; + pIVar3 = (IIR_NOrder_BW_BP *)operator_new(0xc); + IIR_NOrder_BW_BP::IIR_NOrder_BW_BP(pIVar3,3); + *(IIR_NOrder_BW_BP **)(this + 0x10) = pIVar3; + pIVar2 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar2,1); + *(IIR_NOrder_BW_LH **)(this + 0x14) = pIVar2; + pIVar2 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar2,3); + *(IIR_NOrder_BW_LH **)(this + 0x18) = pIVar2; + pIVar3 = (IIR_NOrder_BW_BP *)operator_new(0xc); + IIR_NOrder_BW_BP::IIR_NOrder_BW_BP(pIVar3,3); + *(IIR_NOrder_BW_BP **)(this + 0x1c) = pIVar3; + Reset(); + return this; +} + + + +// HiFi::SetSamplingRate(int) + +void HiFi::SetSamplingRate(int param_1) { + *(int *)(this + 0x24) = param_1; + Reset(); + return; +} + + + +// HiFi::SetClarity(float) + +void HiFi::SetClarity(float param_1) { + float in_r1; + + *(float *)(this + 0x20) = ROUND(in_r1 * 3.355443e+07 + 0.5); + return; +} + + + +// HiFi::Process(int*, int) + +int HiFi::Process(int *param_1,int param_2) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + int iVar4; + int iVar5; + int **ppiVar6; + int *piVar7; + int **ppiVar8; + int *piVar9; + int **ppiVar10; + int *piVar11; + int *piVar12; + int *piVar13; + int *piVar14; + int **ppiVar15; + int *piVar16; + int iVar17; + int **ppiVar18; + int *piVar19; + int **ppiVar20; + int *piVar21; + int *piVar22; + int *piVar23; + int *piVar24; + int iVar25; + int *piVar26; + int iVar27; + int *local_78; + + if (0 < param_2) { + iVar4 = WaveBuffer_I32::PushZerosGetBuffer(*(WaveBuffer_I32 **)this,param_2); + iVar5 = WaveBuffer_I32::PushZerosGetBuffer(*(WaveBuffer_I32 **)(this + 4),param_2); + if (iVar4 == 0 || iVar5 == 0) { + Reset(); + return param_2; + } + ppiVar20 = *(int ***)(this + 0x10); + ppiVar15 = *(int ***)(this + 8); + ppiVar18 = *(int ***)(this + 0xc); + ppiVar6 = *(int ***)(this + 0x14); + piVar14 = *ppiVar18; + piVar12 = *ppiVar15; + ppiVar8 = *(int ***)(this + 0x18); + ppiVar10 = *(int ***)(this + 0x1c); + piVar16 = *ppiVar20; + piVar19 = ppiVar20[1]; + piVar7 = *ppiVar6; + piVar9 = *ppiVar8; + piVar11 = *ppiVar10; + piVar13 = ppiVar10[1]; + piVar21 = param_1 + 1; + piVar22 = (int *)(iVar5 + 4); + local_78 = (int *)(iVar4 + 4); + do { + iVar4 = piVar21[-1]; + iVar5 = iVar4; + if ((piVar12 != nullptr) && (piVar26 = ppiVar15[1], 0 < (int)piVar26)) { + piVar24 = piVar12; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar5 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar5 * (longlong)piVar24[2] + 0x1000000; + iVar5 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar5 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar12 + (int)piVar26 * 4); + iVar4 = piVar21[-1]; + } + iVar27 = iVar4; + if ((piVar14 != nullptr) && (piVar26 = ppiVar18[1], 0 < (int)piVar26)) { + piVar24 = piVar14; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar27 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar27 * (longlong)piVar24[2] + 0x1000000; + iVar27 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar27 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar14 + (int)piVar26 * 4); + iVar4 = piVar21[-1]; + } + if ((piVar16 != nullptr) && (piVar26 = ppiVar20[2], 0 < (int)piVar26)) { + piVar24 = piVar16; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar4 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar4 * (longlong)piVar24[2] + 0x1000000; + iVar4 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar4 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar16 + (int)piVar26 * 4); + } + if ((piVar19 != nullptr) && (piVar26 = ppiVar20[2], 0 < (int)piVar26)) { + piVar24 = piVar19; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar4 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar4 * (longlong)piVar24[2] + 0x1000000; + iVar4 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar4 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar19 + (int)piVar26 * 4); + } + piVar21[-1] = iVar27; + piVar22[-1] = iVar5; + local_78[-1] = iVar4; + iVar4 = *piVar21; + iVar5 = iVar4; + if ((piVar7 != nullptr) && (piVar26 = ppiVar6[1], 0 < (int)piVar26)) { + piVar24 = piVar7; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar5 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar5 * (longlong)piVar24[2] + 0x1000000; + iVar5 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar5 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar7 + (int)piVar26 * 4); + iVar4 = *piVar21; + } + iVar27 = iVar4; + if ((piVar9 != nullptr) && (piVar26 = ppiVar8[1], 0 < (int)piVar26)) { + piVar24 = piVar9; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar27 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar27 * (longlong)piVar24[2] + 0x1000000; + iVar27 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar27 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar9 + (int)piVar26 * 4); + iVar4 = *piVar21; + } + if ((piVar11 != nullptr) && (piVar26 = ppiVar10[2], 0 < (int)piVar26)) { + piVar24 = piVar11; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar4 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar4 * (longlong)piVar24[2] + 0x1000000; + iVar4 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar4 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar11 + (int)piVar26 * 4); + } + if ((piVar13 != nullptr) && (piVar26 = ppiVar10[2], 0 < (int)piVar26)) { + piVar24 = piVar13; + do { + piVar23 = piVar24 + 4; + lVar1 = (longlong)iVar4 * (longlong)piVar24[1] + 0x1000000; + lVar2 = (longlong)iVar4 * (longlong)piVar24[2] + 0x1000000; + iVar4 = piVar24[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar4 * (longlong)*piVar24 + 0x1000000; + piVar24[3] = ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + piVar24 = piVar23; + } while (piVar23 != piVar13 + (int)piVar26 * 4); + } + piVar26 = piVar21 + 2; + *piVar21 = iVar27; + *piVar22 = iVar5; + *local_78 = iVar4; + piVar21 = piVar26; + piVar22 = piVar22 + 2; + local_78 = local_78 + 2; + } while (piVar26 != param_1 + param_2 * 2 + 1); + iVar17 = *(int *)(this + 0x20); + lVar1 = (longlong)iVar17 * 0x2666666 + 0x1000000; + iVar4 = WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)this); + iVar5 = WaveBuffer_I32::GetCurrentBufferI32Ptr(*(WaveBuffer_I32 **)(this + 4)); + iVar27 = 0; + iVar25 = 0; + do { + iVar25 = iVar25 + 1; + lVar2 = (longlong)*(int *)((int)param_1 + iVar27) * + (longlong)(int)((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + 0x1000000; + lVar3 = (longlong)iVar17 * (longlong)*(int *)(iVar4 + iVar27) + 0x1000000; + *(uint *)((int)param_1 + iVar27) = + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7) + *(int *)(iVar5 + iVar27); + iVar27 = iVar27 + 4; + } while (iVar25 < param_2 * 2); + WaveBuffer_I32::PopSamples(*(WaveBuffer_I32 **)this,param_2,false); + WaveBuffer_I32::PopSamples(*(WaveBuffer_I32 **)(this + 4),param_2,false); + } + return param_2; +} diff --git a/src/util/HiFi.h b/src/util/HiFi.h new file mode 100644 index 0000000..92cfbf3 --- /dev/null +++ b/src/util/HiFi.h @@ -0,0 +1,31 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_HIFI_H +#define VIPER_HIFI_H + + +class HiFi { + struct WaveBuffer_I32* field_0x0; + struct WaveBuffer_I32* field_0x4; + struct IIR_NOrder_BW_LH* field_0x8; + struct IIR_NOrder_BW_LH* field_0xc; + struct IIR_NOrder_BW_BP* field_0x10; + struct IIR_NOrder_BW_LH* field_0x14; + struct IIR_NOrder_BW_LH* field_0x18; + struct IIR_NOrder_BW_BP* field_0x1c; + int field_0x20; + int field_0x24; + +public: + ~HiFi(); + void Reset(); + HiFi(); + void SetSamplingRate(int param_1); + void SetClarity(float param_1); + int Process(int *param_1,int param_2); +}; + + +#endif //VIPER_HIFI_H diff --git a/src/util/HighShelf.cpp b/src/util/HighShelf.cpp new file mode 100644 index 0000000..6acff95 --- /dev/null +++ b/src/util/HighShelf.cpp @@ -0,0 +1,151 @@ +// +// Created by mart on 2/13/21. +// + +#include "HighShelf.h" + +// HighShelf::SetSamplingRate(int) + +void HighShelf::SetSamplingRate(int param_1) { + undefined4 uVar1; + undefined4 uVar2; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 extraout_r1_01; + undefined in_ZR; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr4; + undefined4 in_cr8; + undefined4 in_cr11; + undefined4 in_cr12; + undefined4 in_cr13; + undefined4 in_cr14; + undefined4 uVar3; + int iVar5; + double unaff_d8; + double dVar6; + double dVar7; + double dVar8; + double dVar9; + double dVar4; + + coprocessor_function(0xb,2,1,in_cr8,in_cr8,in_cr1); + uVar1 = SUB84((double)*(float *)this / (double)(longlong)param_1,0); + uVar2 = uVar1; + cos(unaff_d8); + sin(unaff_d8); + dVar6 = (double)CONCAT44(extraout_r1_00,uVar1); + coprocessor_function(0xb,6,5,in_cr1,in_cr1,in_cr2); + uVar1 = SUB84((double)*(float *)(this + 8) / 40.0,0); + dVar4 = exp(unaff_d8); + uVar3 = SUB84(dVar4,0); + dVar4 = (double)CONCAT44(extraout_r1_01,uVar1); + dVar9 = dVar4 + dVar4; + if (!(bool)in_ZR) { + dVar7 = sqrt(unaff_d8); + uVar3 = SUB84(dVar7,0); + } + coprocessor_function(0xb,6,0,in_cr1,in_cr12,in_cr13); + coprocessor_function(0xb,2,0,in_cr13,in_cr13,in_cr14); + coprocessor_function(0xb,2,4,in_cr11,in_cr0,in_cr11); + coprocessor_function(0xb,6,1,in_cr2,in_cr8,in_cr2); + dVar8 = (dVar4 + 1.0) - dVar9; + dVar7 = (dVar4 - 1.0) - (double)CONCAT44(extraout_r1,uVar2); + coprocessor_function(0xb,6,5,in_cr2,in_cr2,in_cr4); + coprocessor_function(0xb,6,4,in_cr1,in_cr1,in_cr8); + coprocessor_function(0xb,2,4,in_cr8,in_cr0,in_cr8); + *(int *)(this + 0x38) = SUB84(ROUND(dVar4 * 33554432.0 + 0.5),0); + *(undefined4 *)(this + 0x20) = 0xf8000000; + *(int *)(this + 0x1c) = SUB84(ROUND((dVar4 + 1.0 + dVar9 + dVar6) * 33554432.0 + 0.5),0); + iVar5 = SUB84(ROUND((dVar6 + dVar8) * 33554432.0 + 0.5),0); + *(int *)(this + 0x24) = SUB84(ROUND(dVar4 * 33554432.0 + 0.5),0); + *(int *)(this + 0x28) = iVar5; + uVar2 = __aeabi_ldivmod(uVar3,0,0x40000,iVar5,iVar5 >> 0x1f); + *(undefined4 *)(this + 0x2c) = uVar2; + *(undefined4 *)(this + 0xc) = 0; + *(undefined4 *)(this + 0x10) = 0; + *(undefined4 *)(this + 0x14) = 0; + *(undefined4 *)(this + 0x18) = 0; + *(int *)(this + 0x30) = SUB84(ROUND((dVar7 + dVar7) * 33554432.0 + 0.5),0); + *(int *)(this + 0x34) = SUB84(ROUND((dVar8 - dVar6) * 33554432.0 + 0.5),0); + return; +} + + + +// HighShelf::SetFrequency(float) + +void HighShelf::SetFrequency(float param_1) { + undefined4 in_r1; + + *(undefined4 *)this = in_r1; + return; +} + + + +// HighShelf::SetQuality(float) + +void HighShelf::SetQuality(float param_1) { + undefined4 in_r1; + + *(undefined4 *)(this + 4) = in_r1; + return; +} + + + +// HighShelf::SetGain(float) + +void HighShelf::SetGain(float param_1) { + int in_r0; + undefined4 unaff_r4; + undefined4 in_lr; + undefined4 in_cr0; + undefined4 in_cr1; + + log10((double)CONCAT44(in_lr,unaff_r4)); + coprocessor_function(0xb,6,5,in_cr0,in_cr1,in_cr0); + *(undefined4 *)(in_r0 + 8) = 0x41a00000; + return; +} + + + +// HighShelf::Process(int) + +uint HighShelf::Process(int param_1) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + longlong lVar4; + longlong lVar5; + uint uVar6; + int iVar7; + int iVar8; + int iVar9; + + iVar8 = *(int *)(this + 0xc); + lVar1 = (longlong)*(int *)(this + 0x1c) * (longlong)param_1 + 0x1000000; + *(int *)(this + 0xc) = param_1; + iVar7 = *(int *)(this + 0x10); + lVar2 = (longlong)*(int *)(this + 0x20) * (longlong)iVar8 + 0x1000000; + iVar9 = *(int *)(this + 0x18); + *(int *)(this + 0x10) = iVar8; + lVar3 = (longlong)*(int *)(this + 0x24) * (longlong)iVar7 + 0x1000000; + *(int *)(this + 0x18) = *(int *)(this + 0x14); + lVar4 = (longlong)*(int *)(this + 0x30) * (longlong)*(int *)(this + 0x14) + 0x1000000; + lVar5 = (longlong)*(int *)(this + 0x34) * (longlong)iVar9 + 0x1000000; + lVar1 = (longlong) + (int)(((((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7)) - + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7)) - + ((uint)lVar5 >> 0x19 | (int)((ulonglong)lVar5 >> 0x20) << 7)) * + (longlong)*(int *)(this + 0x2c) + 0x1000000; + uVar6 = (uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7; + *(uint *)(this + 0x14) = uVar6; + return uVar6; +} diff --git a/src/util/HighShelf.h b/src/util/HighShelf.h new file mode 100644 index 0000000..6986a8d --- /dev/null +++ b/src/util/HighShelf.h @@ -0,0 +1,35 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_HIGHSHELF_H +#define VIPER_HIGHSHELF_H + + +class HighShelf { + float field_0x0; + float field_0x4; + float field_0x8; + int field_0xc; + int field_0x10; + int field_0x14; + int field_0x18; + int field_0x1c; + int field_0x20; + int field_0x24; + int field_0x28; + int field_0x2c; + int field_0x30; + int field_0x34; + int field_0x38; + +public: + void SetSamplingRate(int param_1); + void SetFrequency(float param_1); + void SetQuality(float param_1); + void SetGain(float param_1); + uint Process(int param_1); +}; + + +#endif //VIPER_HIGHSHELF_H diff --git a/src/util/IIRFilter.cpp b/src/util/IIRFilter.cpp new file mode 100644 index 0000000..c4b7688 --- /dev/null +++ b/src/util/IIRFilter.cpp @@ -0,0 +1,199 @@ +// +// Created by mart on 2/12/21. +// + +#include "IIRFilter.h" + +// IIRFilter::~IIRFilter() + +IIRFilter::~IIRFilter() { + MinPhaseIIRCoeffs::~MinPhaseIIRCoeffs(&this->field_0xc); + return this; +} + + + +// IIRFilter::SetBandLevel(int, float) + +double IIRFilter::SetBandLevel(int param_1,float param_2) { + uint in_r1; + undefined4 in_r3; + undefined4 unaff_r4; + undefined4 unaff_r5; + undefined4 in_lr; + undefined4 in_cr2; + undefined4 in_cr3; + undefined4 in_s1; + double dVar1; + + if (0x1e < in_r1) { + return (double)CONCAT44(in_s1,param_2); + } + dVar1 = pow((double)CONCAT44(unaff_r4,in_r3),(double)CONCAT44(in_lr,unaff_r5)); + coprocessor_function(0xb,6,5,in_cr2,in_cr3,in_cr2); + *(undefined4 *)(param_1 + in_r1 * 4 + 0x7e4) = 0x30000000; + return dVar1; +} + + + +// IIRFilter::Reset() + +void IIRFilter::Reset() { + memset(this->field_0x18,0,0x7c0); + this->field_0x7d8 = 2; + this->field_0x7dc = 1; + this->field_0x7e0 = 0; + return; +} + + + +// IIRFilter::IIRFilter(int) + +IIRFilter::IIRFilter(int param_1) { + undefined4 *puVar1; + int iVar2; + + MinPhaseIIRCoeffs::MinPhaseIIRCoeffs(&this->field_0xc); + this->enabled = false; + if ((param_1 == 10 || (param_1 & 0xffffffefU) == 0xf) || (param_1 == 0x19)) { + this->field_0x0 = param_1; + this->samplerate = 0xac44; + MinPhaseIIRCoeffs::UpdateCoeffs(&this->field_0xc,param_1,0xac44); + } + else { + this->field_0x0 = 0; + this->samplerate = 0xac44; + } + puVar1 = &this->field_0x7e0; + iVar2 = 0x1f; + do { + iVar2 = iVar2 + -1; + puVar1 = puVar1 + 1; + *puVar1 = 0x145a983; + } while (iVar2 != 0); + Reset(this); + return this; +} + + + +// IIRFilter::SetEnable(bool) + +undefined4 IIRFilter::SetEnable(bool param_1) { + char cVar1; + + cVar1 = this->enabled; + if ((bool)cVar1 == false) { + if (param_1 == false) { + return 0; + } + Reset(this); + cVar1 = this->enabled; + } + if (param_1 == (bool)cVar1) { + return 0; + } + this->enabled = param_1; + return 1; +} + + + +// IIRFilter::SetSamplingRate(int) + +void IIRFilter::SetSamplingRate(int param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + if (this->field_0x0 == 0) { + Reset(this); + return; + } + MinPhaseIIRCoeffs::UpdateCoeffs(&this->field_0xc,this->field_0x0,param_1); + Reset(this); + return; +} + + + +// IIRFilter::Process(int*, int) + +void IIRFilter::Process(int *param_1,int param_2) { + longlong lVar1; + longlong lVar2; + longlong lVar3; + int iVar4; + int iVar5; + int iVar6; + int *piVar7; + int iVar8; + int *piVar9; + int iVar10; + int iVar11; + int iVar12; + int iVar13; + int *piVar14; + int *piVar15; + int *piVar16; + int local_44; + int *local_40; + int *local_3c; + int local_34; + + if (((this->enabled != false) && + (iVar4 = MinPhaseIIRCoeffs::GetCoefficients(&this->field_0xc), iVar4 != 0)) && + (local_34 = param_2 + -1, local_3c = param_1, param_2 != 0)) { + do { + local_44 = 0; + local_40 = local_3c; + do { + iVar6 = this->field_0x0; + iVar13 = *local_40; + if (iVar6 < 1) { + iVar12 = 0; + } + else { + iVar12 = 0; + iVar10 = this->field_0x7d8; + iVar11 = this->field_0x7e0; + iVar8 = this->field_0x7dc; + piVar14 = &this->field_0x7e0; + piVar9 = (int *)(iVar4 + 8); + piVar15 = (int *)(this->field_0x18 + (iVar10 + local_44 * 8) * 4); + do { + iVar5 = piVar9[-1]; + piVar7 = piVar15 + -iVar10; + *piVar15 = iVar13; + piVar16 = piVar15 + 0x10; + lVar1 = (longlong)iVar5 * (longlong)(iVar13 - piVar7[iVar11]) + 0x1000000; + lVar2 = (longlong)*piVar9 * (longlong)piVar7[iVar8 + 3] + 0x1000000; + lVar3 = (longlong)piVar9[-2] * (longlong)(piVar7 + iVar11)[3] + 0x1000000; + iVar5 = (((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7)) - + ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7); + piVar15[3] = iVar5; + piVar14 = piVar14 + 1; + lVar1 = (longlong)iVar5 * (longlong)*piVar14 + 0x1000000; + iVar12 = iVar12 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + piVar9 = piVar9 + 4; + piVar15 = piVar16; + } while (piVar16 != (int *)(this->field_0x18 + (iVar10 + (local_44 + iVar6 * 2) * 8) * 4)) + ; + } + local_44 = local_44 + 1; + *local_40 = iVar12; + local_40 = local_40 + 1; + } while (local_44 != 2); + local_34 = local_34 + -1; + local_3c = local_3c + 2; + this->field_0x7d8 = (this->field_0x7d8 + 1) % 3; + this->field_0x7dc = (this->field_0x7dc + 1) % 3; + this->field_0x7e0 = (this->field_0x7e0 + 1) % 3; + } while (local_34 != -1); + return; + } + return; +} diff --git a/src/util/IIRFilter.h b/src/util/IIRFilter.h new file mode 100644 index 0000000..31e22dd --- /dev/null +++ b/src/util/IIRFilter.h @@ -0,0 +1,154 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_IIRFILTER_H +#define VIPER_IIRFILTER_H + + +class IIRFilter { + int field_0x0; + undefined4 samplerate; + bool enabled; // Created by retype action + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + struct MinPhaseIIRCoeffs field_0xc; + char field_0x18[1984]; + undefined4 field_0x7d8; + undefined4 field_0x7dc; + undefined4 field_0x7e0; + undefined4 field_0x7e4; + undefined field_0x7e8; + undefined field_0x7e9; + undefined field_0x7ea; + undefined field_0x7eb; + undefined field_0x7ec; + undefined field_0x7ed; + undefined field_0x7ee; + undefined field_0x7ef; + undefined field_0x7f0; + undefined field_0x7f1; + undefined field_0x7f2; + undefined field_0x7f3; + undefined field_0x7f4; + undefined field_0x7f5; + undefined field_0x7f6; + undefined field_0x7f7; + undefined field_0x7f8; + undefined field_0x7f9; + undefined field_0x7fa; + undefined field_0x7fb; + undefined field_0x7fc; + undefined field_0x7fd; + undefined field_0x7fe; + undefined field_0x7ff; + undefined field_0x800; + undefined field_0x801; + undefined field_0x802; + undefined field_0x803; + undefined field_0x804; + undefined field_0x805; + undefined field_0x806; + undefined field_0x807; + undefined field_0x808; + undefined field_0x809; + undefined field_0x80a; + undefined field_0x80b; + undefined field_0x80c; + undefined field_0x80d; + undefined field_0x80e; + undefined field_0x80f; + undefined field_0x810; + undefined field_0x811; + undefined field_0x812; + undefined field_0x813; + undefined field_0x814; + undefined field_0x815; + undefined field_0x816; + undefined field_0x817; + undefined field_0x818; + undefined field_0x819; + undefined field_0x81a; + undefined field_0x81b; + undefined field_0x81c; + undefined field_0x81d; + undefined field_0x81e; + undefined field_0x81f; + undefined field_0x820; + undefined field_0x821; + undefined field_0x822; + undefined field_0x823; + undefined field_0x824; + undefined field_0x825; + undefined field_0x826; + undefined field_0x827; + undefined field_0x828; + undefined field_0x829; + undefined field_0x82a; + undefined field_0x82b; + undefined field_0x82c; + undefined field_0x82d; + undefined field_0x82e; + undefined field_0x82f; + undefined field_0x830; + undefined field_0x831; + undefined field_0x832; + undefined field_0x833; + undefined field_0x834; + undefined field_0x835; + undefined field_0x836; + undefined field_0x837; + undefined field_0x838; + undefined field_0x839; + undefined field_0x83a; + undefined field_0x83b; + undefined field_0x83c; + undefined field_0x83d; + undefined field_0x83e; + undefined field_0x83f; + undefined field_0x840; + undefined field_0x841; + undefined field_0x842; + undefined field_0x843; + undefined field_0x844; + undefined field_0x845; + undefined field_0x846; + undefined field_0x847; + undefined field_0x848; + undefined field_0x849; + undefined field_0x84a; + undefined field_0x84b; + undefined field_0x84c; + undefined field_0x84d; + undefined field_0x84e; + undefined field_0x84f; + undefined field_0x850; + undefined field_0x851; + undefined field_0x852; + undefined field_0x853; + undefined field_0x854; + undefined field_0x855; + undefined field_0x856; + undefined field_0x857; + undefined field_0x858; + undefined field_0x859; + undefined field_0x85a; + undefined field_0x85b; + undefined field_0x85c; + undefined field_0x85d; + undefined field_0x85e; + undefined field_0x85f; + +public: + ~IIRFilter(); + double SetBandLevel(int param_1,float param_2); + void Reset(); + IIRFilter(int param_1); + undefined4 SetEnable(bool param_1); + void SetSamplingRate(int param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_IIRFILTER_H diff --git a/src/util/IIR_1st.cpp b/src/util/IIR_1st.cpp new file mode 100644 index 0000000..90934dd --- /dev/null +++ b/src/util/IIR_1st.cpp @@ -0,0 +1,447 @@ +// +// Created by mart on 2/12/21. +// + +#include "IIR_1st.h" + +// IIR_1st::Mute() + +void IIR_1st::Mute() { + this->field_0xc = 0; + return; +} + + + +// IIR_1st::IIR_1st() + +IIR_1st::IIR_1st() { + Mute(this); + return this; +} + + + +// IIR_1st::setCoefficients(float, float, float) + +void IIR_1st::setCoefficients(int param_1,int param_2,int param_3) { + this->field_0x4 = ROUND((float)param_1 * 3.355443e+07 + 0.5); + this->field_0x8 = ROUND((float)param_2 * 3.355443e+07 + 0.5); + this->field_0x0 = ROUND((float)param_3 * 3.355443e+07 + 0.5); + return; +} + + + +// IIR_1st::setLPF_BW(float, float) + +void IIR_1st::setLPF_BW(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + float in_r2; + undefined4 unaff_r4; + undefined4 in_lr; + undefined4 in_cr1; + undefined4 in_cr2; + float fVar2; + double dVar3; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + uVar1 = SUB84(3.141592653589793 / (double)in_r2,0); + tan((double)CONCAT44(in_lr,unaff_r4)); + dVar3 = (double)CONCAT44(extraout_r1,uVar1); + fVar2 = SUB84(ROUND((dVar3 / (dVar3 + 1.0)) * 33554432.0 + 0.5),0); + this->field_0x8 = fVar2; + this->field_0x0 = SUB84(ROUND(((1.0 - dVar3) / (dVar3 + 1.0)) * 33554432.0 + 0.5),0); + this->field_0x4 = fVar2; + return; +} + + + +// IIR_1st::setHPF_BW(float, float) + +void IIR_1st::setHPF_BW(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + float in_r2; + undefined4 unaff_r4; + undefined4 in_lr; + undefined4 in_cr1; + undefined4 in_cr2; + double dVar2; + double dVar3; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + uVar1 = SUB84(3.141592653589793 / (double)in_r2,0); + tan((double)CONCAT44(in_lr,unaff_r4)); + dVar3 = (double)CONCAT44(extraout_r1,uVar1) + 1.0; + dVar2 = 1.0 / dVar3; + this->field_0x4 = SUB84(ROUND(dVar2 * 33554432.0 + 0.5),0); + this->field_0x0 = + SUB84(ROUND(((1.0 - (double)CONCAT44(extraout_r1,uVar1)) / dVar3) * 33554432.0 + 0.5),0); + this->field_0x8 = SUB84(ROUND(0.5 - dVar2 * 33554432.0),0); + return; +} + + + +// IIR_1st::setLPF_A(float, float) + +void IIR_1st::setLPF_A(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + float in_r2; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr3; + undefined4 in_cr8; + double unaff_d8; + double dVar2; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr8); + uVar1 = SUB84(-3.141592653589793 / (double)in_r2,0); + exp(unaff_d8); + dVar2 = (double)CONCAT44(extraout_r1,uVar1); + this->field_0x0 = SUB84(ROUND(dVar2 * 33554432.0 + 0.5),0); + coprocessor_function(0xb,6,5,in_cr2,in_cr1,in_cr3); + this->field_0x4 = SUB84(ROUND(((1.0 - dVar2) / 1.12) * 33554432.0 + 0.5),0); + this->field_0x8 = SUB84(ROUND(dVar2 * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setHPF_A(float, float) + +void IIR_1st::setHPF_A(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + float in_r2; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr8; + double unaff_d8; + double dVar2; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr8); + uVar1 = SUB84(-3.141592653589793 / (double)in_r2,0); + exp(unaff_d8); + dVar2 = (double)CONCAT44(extraout_r1,uVar1) + 1.0; + coprocessor_function(0xb,6,4,in_cr1,in_cr1,in_cr8); + this->field_0x8 = SUB84(ROUND(0.5 - dVar2 * 33554432.0),0); + this->field_0x0 = SUB84(ROUND((double)CONCAT44(extraout_r1,uVar1) * 33554432.0 + 0.5),0); + this->field_0x4 = SUB84(ROUND(dVar2 * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setLSF_A(float, float, float) + +void IIR_1st::setLSF_A(float param_1,float param_2,float param_3) { + undefined4 uVar1; + float in_r1; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + float in_r3; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr8; + undefined4 in_cr10; + undefined4 in_cr11; + double unaff_d8; + + coprocessor_function(0xb,2,0,in_cr10,in_cr10,in_cr8); + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr11); + uVar1 = SUB84((double)in_r1 / (double)in_r3,0); + exp(unaff_d8); + this->field_0x4 = -4.25353e+37; + coprocessor_function(0xb,2,4,in_cr11,in_cr1,in_cr11); + this->field_0x0 = SUB84(ROUND(0.5 - (double)CONCAT44(extraout_r1,uVar1) * 33554432.0),0); + uVar1 = SUB84(-3.141592653589793 / (double)in_r3,0); + exp(unaff_d8); + this->field_0x8 = SUB84(ROUND((double)CONCAT44(extraout_r1_00,uVar1) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setHSF_A(float, float, float) + +void IIR_1st::setHSF_A(float param_1,float param_2,float param_3) { + undefined4 uVar1; + undefined4 uVar2; + float in_r1; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + float in_r3; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr8; + undefined4 in_cr10; + undefined4 in_cr11; + double unaff_d8; + + coprocessor_function(0xb,2,0,in_cr10,in_cr10,in_cr8); + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr11); + uVar1 = SUB84((double)in_r1 / (double)in_r3,0); + exp(unaff_d8); + coprocessor_function(0xb,2,4,in_cr11,in_cr0,in_cr11); + uVar2 = SUB84(-3.141592653589793 / (double)in_r3,0); + exp(unaff_d8); + this->field_0x0 = SUB84(ROUND((double)CONCAT44(extraout_r1,uVar1) * 33554432.0 + 0.5),0); + coprocessor_function(0xb,6,5,in_cr2,in_cr2,in_cr1); + this->field_0x4 = + SUB84(ROUND(0.5 - ((1.0 - (double)CONCAT44(extraout_r1,uVar1)) / + ((double)CONCAT44(extraout_r1_00,uVar2) - 1.0)) * 33554432.0),0); + this->field_0x8 = SUB84(ROUND((double)CONCAT44(extraout_r1_00,uVar2) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setHPFwLFS_A(float, float) + +void IIR_1st::setHPFwLFS_A(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + float in_r2; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr8; + int iVar2; + double unaff_d8; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr8); + uVar1 = SUB84(-3.141592653589793 / (double)in_r2,0); + exp(unaff_d8); + this->field_0x0 = -NAN; + iVar2 = SUB84(ROUND((double)CONCAT44(extraout_r1,uVar1) - 1.0),0); + if (iVar2 < 0) { + iVar2 = -iVar2; + } + coprocessor_function(0xb,6,5,in_cr2,in_cr2,in_cr1); + this->field_0x4 = SUB84(ROUND(0.5 - (1.12 / (double)(longlong)iVar2) * 33554432.0),0); + this->field_0x8 = SUB84(ROUND((double)CONCAT44(extraout_r1,uVar1) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setLPF_C(float, float) + +void IIR_1st::setLPF_C(float param_1,float param_2) { + float in_r1; + float in_r2; + float fVar1; + + fVar1 = SUB84(ROUND((double)(in_r1 / (in_r2 + in_r1)) * 33554432.0 + 0.5),0); + this->field_0x8 = fVar1; + this->field_0x0 = SUB84(ROUND((double)((in_r2 - in_r1) / (in_r2 + in_r1)) * 33554432.0 + 0.5),0); + this->field_0x4 = fVar1; + return; +} + + + +// IIR_1st::setHPF_C(float, float) + +void IIR_1st::setHPF_C(float param_1,float param_2) { + float in_r1; + float in_r2; + double dVar1; + + dVar1 = (double)(in_r2 / (in_r2 + in_r1)); + this->field_0x4 = SUB84(ROUND(dVar1 * 33554432.0 + 0.5),0); + this->field_0x8 = SUB84(ROUND(0.5 - dVar1 * 33554432.0),0); + this->field_0x0 = SUB84(ROUND((double)((in_r2 - in_r1) / (in_r2 + in_r1)) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setPole(float) + +void IIR_1st::setPole(float param_1) { + float in_r1; + undefined4 in_cr2; + undefined4 in_cr3; + float fVar1; + + fVar1 = ROUND(in_r1); + if ((int)fVar1 < 0) { + fVar1 = (float)-(int)fVar1; + } + coprocessor_function(0xb,6,5,in_cr3,in_cr2,in_cr3); + this->field_0x0 = SUB84(ROUND((double)in_r1 * 33554432.0 + 0.5),0); + this->field_0x4 = SUB84(ROUND((1.0 - (double)(longlong)(int)fVar1) * 33554432.0 + 0.5),0); + this->field_0x8 = 0.0; + return; +} + + + +// IIR_1st::setZero(float) + +void IIR_1st::setZero(float param_1) { + float in_r1; + undefined4 in_cr2; + undefined4 in_cr3; + float fVar1; + + fVar1 = ROUND(in_r1); + if ((int)fVar1 < 0) { + fVar1 = (float)-(int)fVar1; + } + this->field_0x0 = 0.0; + coprocessor_function(0xb,6,5,in_cr3,in_cr3,in_cr2); + this->field_0x4 = SUB84(ROUND(0.5 - ((double)(longlong)(int)fVar1 + 1.0) * 33554432.0),0); + this->field_0x8 = SUB84(ROUND((double)in_r1 * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setPoleLPF(float, float) + +void IIR_1st::setPoleLPF(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + float in_r2; + undefined in_ZR; + undefined4 in_cr1; + undefined4 in_cr2; + double unaff_d8; + double dVar2; + double dVar3; + double dVar4; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + uVar1 = SUB84(6.283185307179586 / (double)in_r2,0); + cos(unaff_d8); + dVar2 = 2.0 - (double)CONCAT44(extraout_r1,uVar1); + dVar4 = dVar2 * dVar2 - 1.0; + dVar3 = SQRT(dVar4); + if (!(bool)in_ZR) { + uVar1 = SUB84(dVar4,0); + sqrt(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1_00,uVar1); + } + this->field_0x8 = 0.0; + this->field_0x0 = SUB84(ROUND((dVar2 - dVar3) * 33554432.0 + 0.5),0); + this->field_0x4 = SUB84(ROUND((1.0 - (dVar2 - dVar3)) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setPoleHPF(float, float) + +void IIR_1st::setPoleHPF(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + float in_r2; + undefined in_ZR; + undefined4 in_cr1; + undefined4 in_cr2; + double unaff_d8; + double dVar2; + double dVar3; + double dVar4; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + uVar1 = SUB84(6.283185307179586 / (double)in_r2,0); + cos(unaff_d8); + dVar2 = (double)CONCAT44(extraout_r1,uVar1) + 2.0; + dVar4 = dVar2 * dVar2 - 1.0; + dVar3 = SQRT(dVar4); + if (!(bool)in_ZR) { + uVar1 = SUB84(dVar4,0); + sqrt(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1_00,uVar1); + } + this->field_0x8 = 0.0; + this->field_0x0 = SUB84(ROUND(0.5 - (dVar2 - dVar3) * 33554432.0),0); + this->field_0x4 = SUB84(ROUND(((dVar2 - dVar3) - 1.0) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setZeroLPF(float, float) + +void IIR_1st::setZeroLPF(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + float in_r2; + undefined in_ZR; + undefined4 in_cr1; + undefined4 in_cr2; + double unaff_d8; + double dVar2; + double dVar3; + double dVar4; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + uVar1 = SUB84(6.283185307179586 / (double)in_r2,0); + cos(unaff_d8); + dVar2 = 1.0 - ((double)CONCAT44(extraout_r1,uVar1) + (double)CONCAT44(extraout_r1,uVar1)); + dVar4 = dVar2 * dVar2 - 1.0; + dVar3 = SQRT(dVar4); + if (!(bool)in_ZR) { + uVar1 = SUB84(dVar4,0); + sqrt(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1_00,uVar1); + } + dVar4 = (dVar2 - dVar3) + 1.0; + this->field_0x0 = 0.0; + this->field_0x4 = SUB84(ROUND((1.0 / dVar4) * 33554432.0 + 0.5),0); + this->field_0x8 = SUB84(ROUND(((dVar2 - dVar3) / dVar4) * 33554432.0 + 0.5),0); + return; +} + + + +// IIR_1st::setZeroHPF(float, float) + +void IIR_1st::setZeroHPF(float param_1,float param_2) { + undefined4 uVar1; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + float in_r2; + undefined in_ZR; + undefined4 in_cr1; + undefined4 in_cr2; + double unaff_d8; + double dVar2; + double dVar3; + double dVar4; + + coprocessor_function(0xb,6,5,in_cr1,in_cr2,in_cr1); + uVar1 = SUB84(6.283185307179586 / (double)in_r2,0); + cos(unaff_d8); + dVar2 = (double)CONCAT44(extraout_r1,uVar1) + (double)CONCAT44(extraout_r1,uVar1) + 1.0; + dVar4 = dVar2 * dVar2 - 1.0; + dVar3 = SQRT(dVar4); + if (!(bool)in_ZR) { + uVar1 = SUB84(dVar4,0); + sqrt(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1_00,uVar1); + } + dVar4 = (dVar2 - dVar3) + 1.0; + this->field_0x0 = 0.0; + this->field_0x4 = SUB84(ROUND((1.0 / dVar4) * 33554432.0 + 0.5),0); + this->field_0x8 = SUB84(ROUND(((0.0 - (dVar2 - dVar3)) / dVar4) * 33554432.0 + 0.5),0); + return; +} diff --git a/src/util/IIR_1st.h b/src/util/IIR_1st.h new file mode 100644 index 0000000..14b4cc7 --- /dev/null +++ b/src/util/IIR_1st.h @@ -0,0 +1,37 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_IIR_1ST_H +#define VIPER_IIR_1ST_H + + +class IIR_1st { + float field_0x0; + float field_0x4; + float field_0x8; + undefined4 field_0xc; + +public: + void Mute(); + IIR_1st(); + void setCoefficients(int param_1,int param_2,int param_3); + void setLPF_BW(float param_1,float param_2); + void setHPF_BW(float param_1,float param_2); + void setLPF_A(float param_1,float param_2); + void setHPF_A(float param_1,float param_2); + void setLSF_A(float param_1,float param_2,float param_3); + void setHSF_A(float param_1,float param_2,float param_3); + void setHPFwLFS_A(float param_1,float param_2); + void setLPF_C(float param_1,float param_2); + void setHPF_C(float param_1,float param_2); + void setPole(float param_1); + void setZero(float param_1); + void setPoleLPF(float param_1,float param_2); + void setPoleHPF(float param_1,float param_2); + void setZeroLPF(float param_1,float param_2); + void setZeroHPF(float param_1,float param_2); +}; + + +#endif //VIPER_IIR_1ST_H diff --git a/src/util/IIR_NOrder_BW_BP.cpp b/src/util/IIR_NOrder_BW_BP.cpp new file mode 100644 index 0000000..d0799c3 --- /dev/null +++ b/src/util/IIR_NOrder_BW_BP.cpp @@ -0,0 +1,165 @@ +// +// Created by mart on 2/12/21. +// + +#include "IIR_NOrder_BW_BP.h" + +// IIR_NOrder_BW_BP::IIR_NOrder_BW_BP(int) + +IIR_NOrder_BW_BP::IIR_NOrder_BW_BP(int param_1) { + int iVar1; + uint uVar2; + IIR_1st *pIVar3; + void *pvVar4; + IIR_1st *pIVar5; + int iVar6; + uint uVar7; + + *(undefined4 *)this = 0; + *(undefined4 *)(this + 4) = 0; + *(undefined4 *)(this + 8) = 0; + if (0 < param_1) { + uVar7 = param_1 - 1; + if ((uint)param_1 < 0x7f00001) { + uVar2 = param_1 * 0x10; + } + else { + uVar2 = 0xffffffff; + } + pIVar3 = (IIR_1st *)operator_new__(uVar2); + uVar2 = uVar7; + pIVar5 = pIVar3; + do { + uVar2 = uVar2 - 1; + IIR_1st::IIR_1st(pIVar5); + pIVar5 = pIVar5 + 1; + } while (uVar2 != 0xffffffff); + *(IIR_1st **)this = pIVar3; + if ((uint)param_1 < 0x7f00001) { + uVar2 = param_1 * 0x10; + } + pIVar3 = (IIR_1st *)operator_new__(uVar2); + pIVar5 = pIVar3; + do { + uVar7 = uVar7 - 1; + IIR_1st::IIR_1st(pIVar5); + pIVar5 = pIVar5 + 1; + } while (uVar7 != 0xffffffff); + pvVar4 = *(void **)this; + *(IIR_1st **)(this + 4) = pIVar3; + if (pvVar4 != nullptr) { + if (pIVar3 != nullptr) { + iVar6 = 0; + while( true ) { + iVar1 = iVar6 * 0x10; + iVar6 = iVar6 + 1; + IIR_1st::Mute((IIR_1st *)((int)pvVar4 + iVar1)); + IIR_1st::Mute((IIR_1st *)(*(int *)(this + 4) + iVar1)); + if (iVar6 == param_1) break; + pvVar4 = *(void **)this; + } + *(int *)(this + 8) = iVar6; + return this; + } + operator_delete__(pvVar4); + pIVar3 = *(IIR_1st **)(this + 4); + } + if (pIVar3 != nullptr) { + operator_delete__(pIVar3); + return this; + } + } + return this; +} + + + +// IIR_NOrder_BW_BP::~IIR_NOrder_BW_BP() + +IIR_NOrder_BW_BP::~IIR_NOrder_BW_BP() { + if (*(void **)this != nullptr) { + operator_delete__(*(void **)this); + } + if (*(void **)(this + 4) != nullptr) { + operator_delete__(*(void **)(this + 4)); + } + return this; +} + + + +// IIR_NOrder_BW_BP::Mute() + +void IIR_NOrder_BW_BP::Mute() { + int iVar1; + int iVar2; + int iVar3; + + iVar2 = *(int *)this; + if ((iVar2 != 0) && (0 < *(int *)(this + 8))) { + iVar3 = 0; + while( true ) { + iVar1 = iVar3 * 0x10; + iVar3 = iVar3 + 1; + IIR_1st::Mute((IIR_1st *)(iVar2 + iVar1)); + if (*(int *)(this + 8) <= iVar3) break; + iVar2 = *(int *)this; + } + } + iVar2 = *(int *)(this + 4); + if (iVar2 == 0) { + return; + } + if (*(int *)(this + 8) < 1) { + return; + } + iVar3 = 0; + while( true ) { + iVar1 = iVar3 * 0x10; + iVar3 = iVar3 + 1; + IIR_1st::Mute((IIR_1st *)(iVar2 + iVar1)); + if (*(int *)(this + 8) <= iVar3) break; + iVar2 = *(int *)(this + 4); + } + return; +} + + + +// IIR_NOrder_BW_BP::setBPF(float, float, float) + +void IIR_NOrder_BW_BP::setBPF(float param_1,float param_2,float param_3) { + int *in_r0; + int iVar1; + int iVar2; + undefined8 uVar3; + + uVar3 = CONCAT44(param_2,param_1); + iVar1 = *in_r0; + if ((iVar1 != 0) && (0 < in_r0[2])) { + iVar2 = 0; + while( true ) { + uVar3 = IIR_1st::setLPF_BW((IIR_1st *)(iVar1 + iVar2 * 0x10),(float)uVar3, + (float)((ulonglong)uVar3 >> 0x20)); + iVar2 = iVar2 + 1; + if (in_r0[2] <= iVar2) break; + iVar1 = *in_r0; + } + } + iVar1 = in_r0[1]; + if (iVar1 == 0) { + return; + } + if (in_r0[2] < 1) { + return; + } + iVar2 = 0; + while( true ) { + uVar3 = IIR_1st::setHPF_BW((IIR_1st *)(iVar1 + iVar2 * 0x10),(float)uVar3, + (float)((ulonglong)uVar3 >> 0x20)); + iVar2 = iVar2 + 1; + if (in_r0[2] <= iVar2) break; + iVar1 = in_r0[1]; + } + return; +} diff --git a/src/util/IIR_NOrder_BW_BP.h b/src/util/IIR_NOrder_BW_BP.h new file mode 100644 index 0000000..5408ce3 --- /dev/null +++ b/src/util/IIR_NOrder_BW_BP.h @@ -0,0 +1,22 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_IIR_NORDER_BW_BP_H +#define VIPER_IIR_NORDER_BW_BP_H + + +class IIR_NOrder_BW_BP { + struct IIR_1st* field_0x0; + struct IIR_1st* field_0x4; + undefined4 field_0x8; + +public: + IIR_NOrder_BW_BP(int param_1); + ~IIR_NOrder_BW_BP(); + void Mute(); + void setBPF(float param_1,float param_2,float param_3); +}; + + +#endif //VIPER_IIR_NORDER_BW_BP_H diff --git a/src/util/IIR_NOrder_BW_LH.cpp b/src/util/IIR_NOrder_BW_LH.cpp new file mode 100644 index 0000000..5fe4ebb --- /dev/null +++ b/src/util/IIR_NOrder_BW_LH.cpp @@ -0,0 +1,137 @@ +// +// Created by mart on 2/12/21. +// + +#include "IIR_NOrder_BW_LH.h" + +// IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(int) + +IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(int param_1) { + uint uVar1; + IIR_1st *pIVar2; + IIR_1st *this_00; + int iVar3; + + this->field_0x0 = nullptr; + this->field_0x4 = 0; + if (0 < param_1) { + iVar3 = param_1 + -1; + if ((uint)param_1 < 0x7f00001) { + uVar1 = param_1 * 0x10; + } + else { + uVar1 = 0xffffffff; + } + pIVar2 = (IIR_1st *)operator_new__(uVar1); + this_00 = pIVar2; + do { + iVar3 = iVar3 + -1; + IIR_1st::IIR_1st(this_00); + this_00 = this_00 + 1; + } while (iVar3 != -1); + this->field_0x0 = pIVar2; + if (pIVar2 != nullptr) { + iVar3 = 0; + while( true ) { + pIVar2 = pIVar2 + iVar3; + iVar3 = iVar3 + 1; + IIR_1st::Mute(pIVar2); + if (iVar3 == param_1) break; + pIVar2 = this->field_0x0; + } + this->field_0x4 = iVar3; + } + } + return this; +} + + + +// IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH() + +IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH() { + if (this->field_0x0 != nullptr) { + operator_delete__(this->field_0x0); + } + return this; +} + + + +// IIR_NOrder_BW_LH::Mute() + +void IIR_NOrder_BW_LH::Mute() { + IIR_1st *pIVar1; + int iVar2; + + pIVar1 = this->field_0x0; + if (pIVar1 == nullptr) { + return; + } + if (this->field_0x4 < 1) { + return; + } + iVar2 = 0; + while( true ) { + pIVar1 = pIVar1 + iVar2; + iVar2 = iVar2 + 1; + IIR_1st::Mute(pIVar1); + if (this->field_0x4 <= iVar2) break; + pIVar1 = this->field_0x0; + } + return; +} + + + +// IIR_NOrder_BW_LH::setLPF(float, float) + +void IIR_NOrder_BW_LH::setLPF(float param_1,float param_2) { + IIR_1st *pIVar1; + int iVar2; + undefined8 uVar3; + + uVar3 = CONCAT44(param_2,param_1); + pIVar1 = this->field_0x0; + if (pIVar1 == nullptr) { + return; + } + if (this->field_0x4 < 1) { + return; + } + iVar2 = 0; + while( true ) { + uVar3 = IIR_1st::setLPF_BW(pIVar1 + iVar2,(float)uVar3,(float)((ulonglong)uVar3 >> 0x20)); + iVar2 = iVar2 + 1; + if (this->field_0x4 <= iVar2) break; + pIVar1 = this->field_0x0; + } + return; +} + + + +// IIR_NOrder_BW_LH::setHPF(float, float) + +void IIR_NOrder_BW_LH::setHPF(float param_1,float param_2) { + IIR_1st *pIVar1; + int iVar2; + undefined8 uVar3; + + uVar3 = CONCAT44(param_2,param_1); + pIVar1 = this->field_0x0; + if (pIVar1 == nullptr) { + return; + } + if (this->field_0x4 < 1) { + return; + } + iVar2 = 0; + while( true ) { + uVar3 = IIR_1st::setHPF_BW(pIVar1 + iVar2,(float)uVar3,(float)((ulonglong)uVar3 >> 0x20)); + iVar2 = iVar2 + 1; + if (this->field_0x4 <= iVar2) break; + pIVar1 = this->field_0x0; + } + return; +} diff --git a/src/util/IIR_NOrder_BW_LH.h b/src/util/IIR_NOrder_BW_LH.h new file mode 100644 index 0000000..e8144d4 --- /dev/null +++ b/src/util/IIR_NOrder_BW_LH.h @@ -0,0 +1,22 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_IIR_NORDER_BW_LH_H +#define VIPER_IIR_NORDER_BW_LH_H + + +class IIR_NOrder_BW_LH { + struct IIR_1st * field_0x0; + int field_0x4; + +public: + IIR_NOrder_BW_LH(int param_1); + ~IIR_NOrder_BW_LH(); + void Mute(); + void setLPF(float param_1,float param_2); + void setHPF(float param_1,float param_2); +}; + + +#endif //VIPER_IIR_NORDER_BW_LH_H diff --git a/src/util/MinPhaseIIRCoeffs.cpp b/src/util/MinPhaseIIRCoeffs.cpp new file mode 100644 index 0000000..ee9f9ce --- /dev/null +++ b/src/util/MinPhaseIIRCoeffs.cpp @@ -0,0 +1,337 @@ +// +// Created by mart on 2/12/21. +// + +#include "MinPhaseIIRCoeffs.h" + +// MinPhaseIIRCoeffs::MinPhaseIIRCoeffs() + +MinPhaseIIRCoeffs::MinPhaseIIRCoeffs() { + this->samplerate = 0xac44; + this->coefficients = nullptr; + this->field_0x8 = 0; + return; +} + + + +// MinPhaseIIRCoeffs::~MinPhaseIIRCoeffs() + +MinPhaseIIRCoeffs::~MinPhaseIIRCoeffs() { + if (this->coefficients != nullptr) { + operator_delete__(this->coefficients); + this->coefficients = nullptr; + } + return this; +} + + + +// MinPhaseIIRCoeffs::Find_F1_F2(double, double, double*, double*) + +void MinPhaseIIRCoeffs::Find_F1_F2(double param_1,double param_2,double *param_3,double *param_4) { + undefined4 uVar1; + undefined4 extraout_r1; + undefined4 in_r2; + undefined4 in_r3; + undefined4 unaff_r4; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr8; + double unaff_d8; + + uVar1 = 0; + coprocessor_function(0xb,6,5,in_cr2,in_cr0,in_cr1); + pow(unaff_d8,(double)CONCAT44(unaff_r4,in_r3)); + coprocessor_function(0xb,2,1,in_cr8,in_cr8,in_cr0); + *param_2._0_4_ = (double)CONCAT44(in_r3,in_r2) / (double)CONCAT44(extraout_r1,uVar1); + *param_2._4_4_ = (double)CONCAT44(in_r3,in_r2); + return; +} + + + +// MinPhaseIIRCoeffs::SolveRoot(double, double, double, double*) + +double * MinPhaseIIRCoeffs::SolveRoot(double param_1,double param_2,double param_3,double *param_4) { + undefined4 uVar1; + undefined4 uVar2; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 in_r2; + undefined4 in_r3; + char in_NG; + undefined in_ZR; + char in_OV; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr3; + undefined4 in_cr4; + double unaff_d8; + double dVar3; + double dVar4; + double dVar5; + double in_d20; + + dVar5 = (double)CONCAT44(in_r3,in_r2); + coprocessor_function(0xb,6,5,in_cr3,in_cr0,in_cr3); + coprocessor_function(0xb,6,5,in_cr4,in_cr1,in_cr1); + dVar4 = param_1 / (dVar5 + dVar5); + if (!(bool)in_ZR && in_NG == in_OV) { + param_4 = (double *)0xffffffff; + } + if ((bool)in_ZR || in_NG != in_OV) { + dVar5 = 0.0 - (param_2 - in_d20 / 4.0) / dVar5; + dVar3 = SQRT(dVar5); + uVar2 = SUB84(dVar5,0); + dVar5 = dVar3; + if (!(bool)in_ZR) { + uVar1 = uVar2; + sqrt(unaff_d8); + dVar5 = (double)CONCAT44(extraout_r1,uVar1); + } + *param_3._0_4_ = (0.0 - dVar4) - dVar5; + if (!(bool)in_ZR) { + sqrt(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1_00,uVar2); + } + param_4 = nullptr; + if ((bool)in_NG) { + *param_3._0_4_ = dVar3 - dVar4; + } + } + return param_4; +} + + + +// MinPhaseIIRCoeffs::UpdateCoeffs(int, int) + +undefined4 MinPhaseIIRCoeffs::UpdateCoeffs(int param_1,int samplerate) { + uint uVar1; + void *pvVar2; + undefined4 uVar3; + undefined4 uVar4; + double *extraout_r1; + undefined4 extraout_r1_00; + undefined4 extraout_r1_01; + double *pdVar5; + double *pdVar6; + int iVar7; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr3; + undefined4 in_cr4; + undefined4 in_cr8; + undefined4 in_cr9; + undefined4 in_cr10; + undefined4 in_cr11; + undefined4 in_cr12; + undefined4 in_cr13; + undefined4 in_cr14; + undefined4 in_cr15; + int iVar8; + double unaff_d13; + double unaff_d14; + double dVar9; + double dVar10; + undefined8 uVar11; + undefined4 in_stack_ffffff6c; + double local_90; + double local_80; + undefined auStack120 [8]; + double local_70; + + if ((param_1 != 10 && (param_1 & 0xffffffefU) != 0xf) && (param_1 != 0x19)) { + return 0; + } + if (samplerate < 0xac44) { + return 0; + } + this->field_0x8 = param_1; + this->samplerate = samplerate; + if (this->coefficients != nullptr) { + operator_delete__(this->coefficients); + param_1 = this->field_0x8; + this->coefficients = nullptr; + } + if ((uint)param_1 < 0x7f00001) { + uVar1 = param_1 << 4; + } + else { + uVar1 = 0xffffffff; + } + pvVar2 = operator_new__(uVar1); + this->coefficients = pvVar2; + if (pvVar2 == nullptr) { + return 0; + } + memset(pvVar2,0,this->field_0x8 << 4); + switch(this->field_0x8) { + case 10: + local_90 = 1.0; + pdVar6 = (double *)&DAT_000ce7d0; + goto LAB_00065e84; + case 0xb: + break; + case 0xc: + break; + case 0xd: + break; + case 0xe: + break; + case 0xf: + local_90 = 0.6666666666666666; + pdVar6 = (double *)&DAT_000ce598; + goto LAB_00065e84; + case 0x10: + break; + case 0x11: + break; + case 0x12: + break; + case 0x13: + break; + case 0x14: + break; + case 0x15: + break; + case 0x16: + break; + case 0x17: + break; + case 0x18: + break; + case 0x19: + pdVar6 = (double *)&DAT_000ce610; + local_90 = 0.3333333333333333; + goto LAB_00065e84; + case 0x1a: + break; + case 0x1b: + break; + case 0x1c: + break; + case 0x1d: + break; + case 0x1e: + break; + case 0x1f: + local_90 = 0.3333333333333333; + pdVar6 = (double *)&DAT_000ce6d8; + LAB_00065e84: + iVar7 = 0; + pdVar5 = extraout_r1; + do { + dVar10 = local_90; + Find_F1_F2(local_90,(double)CONCAT44(auStack120,&local_80),(double *)this,pdVar5); + dVar9 = *pdVar6; + pdVar6 = pdVar6 + 1; + iVar8 = this->samplerate; + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr15); + uVar3 = SUB84(dVar9 / (double)(longlong)iVar8,0); + cos(dVar10); + coprocessor_function(0xb,2,0,in_cr14,in_cr8,in_cr8); + coprocessor_function(0xb,2,0,in_cr12,in_cr12,in_cr15); + coprocessor_function(0xb,2,0,in_cr13,in_cr14,in_cr11); + dVar9 = local_80 / (double)(longlong)iVar8; + uVar4 = SUB84(dVar9,0); + cos(dVar10); + coprocessor_function(0xb,2,1,in_cr12,in_cr9,in_cr0); + sin(dVar10); + coprocessor_function(0xb,2,0,in_cr12,in_cr8,in_cr12); + coprocessor_function(0xb,6,1,in_cr3,in_cr9,in_cr0); + coprocessor_function(0xb,2,0,in_cr9,in_cr9,in_cr9); + coprocessor_function(0xb,6,5,in_cr0,in_cr4,in_cr4); + coprocessor_function(0xb,2,1,in_cr8,in_cr8,in_cr3); + unaff_d13 = unaff_d13 + (double)CONCAT44(extraout_r1_01,uVar4) * 0.9999999999999998; + dVar10 = ((unaff_d13 - dVar9) - 0.4999999999999999) + 0.2499999999999999; + uVar11 = SolveRoot(dVar10,((unaff_d14 * 0.125 - (double)CONCAT44(extraout_r1_00,uVar3)) + + 0.125) - 0.06249999999999999, + (double)CONCAT44(in_stack_ffffff6c,&local_70),(double *)this); + pdVar5 = (double *)((ulonglong)uVar11 >> 0x20); + if ((int)uVar11 == 0) { + coprocessor_function(0xb,6,4,in_cr1,in_cr1,in_cr15); + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr10); + pvVar2 = (void *)((int)this->coefficients + iVar7 * 0x10); + dVar9 = local_70 + 0.5; + *(int *)((int)this->coefficients + iVar7 * 0x10) = + SUB84(ROUND((local_70 + local_70) * 33554432.0 + 0.5),0); + *(int *)((int)pvVar2 + 4) = + SUB84(ROUND(((0.5 - local_70) + (0.5 - local_70)) * 33554432.0 + 0.5),0); + cos(dVar10); + pdVar5 = (double *)0x41800000; + coprocessor_function(0xb,2,1,in_cr8,in_cr8,in_cr0); + *(int *)((int)pvVar2 + 8) = SUB84(ROUND((dVar9 + dVar9) * 33554432.0 + 0.5),0); + } + iVar7 = iVar7 + 1; + } while (iVar7 < this->field_0x8); + return 1; + } + return 0; +} + + + +// MinPhaseIIRCoeffs::GetCoefficients() + +void * MinPhaseIIRCoeffs::GetCoefficients() { + return this->coefficients; +} + + + +// MinPhaseIIRCoeffs::GetIndexFrequency(int) + +undefined8 MinPhaseIIRCoeffs::GetIndexFrequency(int param_1) { + if ((-1 < param_1) && (param_1 < this->field_0x8)) { + switch(this->field_0x8) { + case 10: + return *(undefined8 *)(&DAT_000ce7d0 + param_1 * 2); + case 0xb: + break; + case 0xc: + break; + case 0xd: + break; + case 0xe: + break; + case 0xf: + return *(undefined8 *)(&DAT_000ce598 + param_1 * 2); + case 0x10: + break; + case 0x11: + break; + case 0x12: + break; + case 0x13: + break; + case 0x14: + break; + case 0x15: + break; + case 0x16: + break; + case 0x17: + break; + case 0x18: + break; + case 0x19: + return *(undefined8 *)(&DAT_000ce610 + param_1 * 2); + case 0x1a: + break; + case 0x1b: + break; + case 0x1c: + break; + case 0x1d: + break; + case 0x1e: + break; + case 0x1f: + return *(undefined8 *)(&DAT_000ce6d8 + param_1 * 8); + } + } + return 0; +} diff --git a/src/util/MinPhaseIIRCoeffs.h b/src/util/MinPhaseIIRCoeffs.h new file mode 100644 index 0000000..3be982c --- /dev/null +++ b/src/util/MinPhaseIIRCoeffs.h @@ -0,0 +1,25 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_MINPHASEIIRCOEFFS_H +#define VIPER_MINPHASEIIRCOEFFS_H + + +class MinPhaseIIRCoeffs { + void * coefficients; + int samplerate; + int field_0x8; + +public: + MinPhaseIIRCoeffs(); + ~MinPhaseIIRCoeffs(); + void Find_F1_F2(double param_1,double param_2,double *param_3,double *param_4); + double * SolveRoot(double param_1,double param_2,double param_3,double *param_4); + undefined4 UpdateCoeffs(int param_1,int samplerate); + void * GetCoefficients(); + undefined8 GetIndexFrequency(int param_1); +}; + + +#endif //VIPER_MINPHASEIIRCOEFFS_H diff --git a/src/util/MultiBiquad.cpp b/src/util/MultiBiquad.cpp new file mode 100644 index 0000000..55289bf --- /dev/null +++ b/src/util/MultiBiquad.cpp @@ -0,0 +1,240 @@ +// +// Created by mart on 2/12/21. +// + +#include "MultiBiquad.h" + + +// MultiBiquad::MultiBiquad() + +MultiBiquad::MultiBiquad() { + this->field_0x0 = 0; + this->field_0x4 = 0; + this->field_0x8 = 0; + this->field_0xc = 0; + this->field_0x10 = 0; + this->field_0x18 = 0; + this->field_0x14 = 0; + this->field_0x20 = 0; + this->field_0x1c = 0; + return; +} + + + +// MultiBiquad::RefreshFilter(MultiBiquad::FilterType( float, float, float, float, bool) + +void MultiBiquad::RefreshFilter(dword param_1,float param_2,float param_3,float param_4, + float param_5,bool param_6) { + undefined4 uVar1; + undefined4 uVar2; + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 extraout_r1_01; + undefined4 extraout_r1_02; + undefined4 extraout_r1_03; + undefined uVar3; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr2; + undefined4 in_cr3; + undefined4 in_cr4; + undefined4 in_cr9; + undefined4 in_cr10; + undefined4 in_cr11; + undefined4 in_cr12; + undefined4 in_cr13; + undefined4 in_cr14; + undefined4 in_cr15; + double unaff_d8; + double dVar4; + double dVar5; + double unaff_d12; + double dVar6; + double unaff_d14; + double unaff_d15; + double dVar7; + double in_d18; + double in_d19; + float in_stack_00000000; + float in_stack_00000004; + char in_stack_00000008; + double in_stack_ffffffa0; + double in_stack_ffffffa8; + + if (param_1 - 5 < 3) { + uVar1 = 0; + in_d18 = (double)(float)(uint)param_6 / 40.0; + pow(in_stack_ffffffa0,in_stack_ffffffa8); + dVar4 = (double)CONCAT44(extraout_r1,uVar1); + } + else { + uVar1 = 0; + in_d19 = (double)(float)(uint)param_6 / 20.0; + pow(in_stack_ffffffa0,in_stack_ffffffa8); + dVar4 = (double)CONCAT44(extraout_r1_02,uVar1); + } + coprocessor_function(0xb,6,5,in_cr0,in_cr1,in_cr0); + uVar2 = SUB84(6.283185307179586 / (double)in_stack_00000000,0); + uVar1 = uVar2; + sin(in_stack_ffffffa0); + dVar6 = (double)CONCAT44(extraout_r1_00,uVar1); + cos(in_stack_ffffffa0); + dVar5 = (double)CONCAT44(extraout_r1_01,uVar2); + uVar3 = param_1 - 6 == 1; + if (param_1 - 6 < 2) { + in_d19 = 1.0 / (double)in_stack_00000004; + if (!(bool)uVar3) { + sqrt(in_stack_ffffffa0); + } + dVar7 = SQRT(dVar4); + in_d18 = 0.5; + coprocessor_function(0xb,2,1,in_cr13,in_cr13,in_cr2); + coprocessor_function(0xb,2,1,in_cr13,in_cr13,in_cr1); + if (!(bool)uVar3) { + uVar1 = SUB84(dVar4,0); + sqrt(in_stack_ffffffa0); + dVar7 = (double)CONCAT44(extraout_r1_03,uVar1); + } + dVar7 = dVar7 + dVar7; + coprocessor_function(0xb,6,4,in_cr0,in_cr0,in_cr13); + } + else { + if (in_stack_00000008 == '\0') { + dVar7 = -1.0; + dVar6 = dVar6 / ((double)in_stack_00000004 + (double)in_stack_00000004); + } + else { + coprocessor_function(0xb,6,5,in_cr0,in_cr1,in_cr0); + coprocessor_function(0xb,2,4,in_cr9,in_cr0,in_cr9); + sinh(in_stack_ffffffa0); + dVar7 = -1.0; + coprocessor_function(0xb,2,4,in_cr13,in_cr1,in_cr13); + } + } + switch(param_1) { + case 0: + unaff_d12 = 1.0 - dVar5; + coprocessor_function(0xb,2,0,in_cr14,in_cr12,in_cr14); + goto LAB_00066c34; + case 1: + coprocessor_function(0xb,2,0,in_cr14,in_cr12,in_cr14); + unaff_d12 = 0.0 - (dVar5 + 1.0); + LAB_00066c34: + unaff_d8 = dVar6 + 1.0; + unaff_d14 = 0.5; + coprocessor_function(0xb,6,1,in_cr3,in_cr11,in_cr1); + in_stack_ffffffa8 = 1.0 - dVar6; + unaff_d15 = 0.5; + in_stack_ffffffa0 = in_d19; + break; + case 2: + coprocessor_function(0xb,6,1,in_cr2,in_cr11,in_cr1); + in_stack_ffffffa8 = 1.0 - dVar6; + unaff_d8 = dVar6 + 1.0; + unaff_d15 = 0.0 - dVar6; + unaff_d12 = 0.0; + unaff_d14 = dVar6; + in_stack_ffffffa0 = in_d18; + break; + case 3: + unaff_d12 = -2.0; + unaff_d15 = 1.0; + coprocessor_function(0xb,2,0,in_cr12,in_cr11,in_cr12); + in_stack_ffffffa8 = 1.0 - dVar6; + unaff_d8 = dVar6 + 1.0; + unaff_d14 = unaff_d15; + in_stack_ffffffa0 = -2.0; + break; + case 4: + unaff_d12 = -2.0; + coprocessor_function(0xb,2,0,in_cr12,in_cr11,in_cr12); + in_stack_ffffffa8 = 1.0 - dVar6; + unaff_d8 = dVar6 + 1.0; + unaff_d14 = in_stack_ffffffa8; + unaff_d15 = unaff_d8; + in_stack_ffffffa0 = -2.0; + break; + case 5: + unaff_d12 = -2.0; + coprocessor_function(0xb,2,0,in_cr13,in_cr13,in_cr10); + coprocessor_function(0xb,2,0,in_cr12,in_cr11,in_cr12); + in_stack_ffffffa8 = 1.0 - dVar6 / dVar4; + unaff_d8 = dVar6 / dVar4 + 1.0; + unaff_d14 = dVar6 + 1.0; + unaff_d15 = 1.0 - dVar6; + in_stack_ffffffa0 = -2.0; + break; + case 6: + unaff_d12 = dVar4 + dVar4; + coprocessor_function(0xb,6,4,in_cr3,in_cr1,in_cr11); + coprocessor_function(0xb,2,1,in_cr11,in_cr11,in_cr2); + dVar5 = (dVar4 + 1.0) - in_d19; + in_d19 = dVar4 + 1.0 + in_d19; + unaff_d8 = in_d19 + dVar7; + coprocessor_function(0xb,2,1,in_cr12,in_cr12,in_cr3); + in_stack_ffffffa8 = in_d19 - dVar7; + coprocessor_function(0xb,6,1,in_cr0,in_cr11,in_cr4); + coprocessor_function(0xb,2,0,in_cr14,in_cr14,in_cr10); + coprocessor_function(0xb,2,0,in_cr15,in_cr15,in_cr10); + unaff_d14 = dVar5 + dVar7; + unaff_d15 = dVar5 - dVar7; + in_stack_ffffffa0 = dVar7; + break; + case 7: + unaff_d12 = -2.0; + coprocessor_function(0xb,6,4,in_cr3,in_cr1,in_cr11); + coprocessor_function(0xb,2,1,in_cr11,in_cr11,in_cr2); + coprocessor_function(0xb,2,0,in_cr12,in_cr10,in_cr12); + dVar6 = dVar4 + 1.0 + in_d19; + in_d19 = (dVar4 + 1.0) - in_d19; + dVar5 = (dVar4 - 1.0) - dVar5; + unaff_d8 = in_d19 + dVar7; + coprocessor_function(0xb,2,1,in_cr12,in_cr12,in_cr3); + in_stack_ffffffa8 = in_d19 - dVar7; + coprocessor_function(0xb,2,0,in_cr14,in_cr14,in_cr10); + coprocessor_function(0xb,2,0,in_cr15,in_cr15,in_cr10); + unaff_d14 = dVar6 + dVar7; + unaff_d15 = dVar6 - dVar7; + in_stack_ffffffa0 = dVar5 + dVar5; + } + this->field_0x14 = 0; + this->field_0x18 = 0; + this->field_0x1c = 0; + this->field_0x20 = 0; + this->field_0x8 = SUB84(ROUND(((0.0 - in_stack_ffffffa0) / unaff_d8) * 33554432.0 + 0.5),0); + this->field_0xc = SUB84(ROUND(((0.0 - in_stack_ffffffa8) / unaff_d8) * 33554432.0 + 0.5),0); + this->field_0x10 = SUB84(ROUND((unaff_d14 / unaff_d8) * 33554432.0 + 0.5),0); + this->field_0x0 = SUB84(ROUND((unaff_d12 / unaff_d8) * 33554432.0 + 0.5),0); + this->field_0x4 = SUB84(ROUND((unaff_d15 / unaff_d8) * 33554432.0 + 0.5),0); + return; +} + + + +// MultiBiquad::ProcessSample(int) + +uint MultiBiquad::ProcessSample(int param_1) { + longlong lVar1; + uint uVar2; + int iVar3; + int iVar4; + int iVar5; + + iVar3 = this->field_0x14; + iVar5 = this->field_0x18; + iVar4 = this->field_0x20; + this->field_0x18 = iVar3; + this->field_0x14 = param_1; + this->field_0x20 = this->field_0x1c; + lVar1 = (longlong)(int)this->field_0xc * (longlong)iVar4 + + (longlong)(int)this->field_0x8 * (longlong)(int)this->field_0x1c + + (longlong)(int)this->field_0x4 * (longlong)iVar5 + + (longlong)(int)this->field_0x10 * (longlong)param_1 + + (longlong)(int)this->field_0x0 * (longlong)iVar3; + uVar2 = (uint)lVar1; + uVar2 = uVar2 + 0x1000000 >> 0x19 | + ((int)((ulonglong)lVar1 >> 0x20) + (uint)(0xfeffffff < uVar2)) * 0x80; + this->field_0x1c = uVar2; + return uVar2; +} diff --git a/src/util/MultiBiquad.h b/src/util/MultiBiquad.h new file mode 100644 index 0000000..0774730 --- /dev/null +++ b/src/util/MultiBiquad.h @@ -0,0 +1,27 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_MULTIBIQUAD_H +#define VIPER_MULTIBIQUAD_H + + +class MultiBiquad { + undefined4 field_0x0; + undefined4 field_0x4; + undefined4 field_0x8; + undefined4 field_0xc; + undefined4 field_0x10; + undefined4 field_0x14; + undefined4 field_0x18; + undefined4 field_0x1c; + undefined4 field_0x20; + +public: + MultiBiquad(); + void RefreshFilter(dword param_1,float param_2,float param_3,float param_4,float param_5,bool param_6); + uint ProcessSample(int param_1); +}; + + +#endif //VIPER_MULTIBIQUAD_H diff --git a/src/util/NoiseSharpening.cpp b/src/util/NoiseSharpening.cpp new file mode 100644 index 0000000..e064d1b --- /dev/null +++ b/src/util/NoiseSharpening.cpp @@ -0,0 +1,141 @@ +// +// Created by mart on 2/13/21. +// + +#include "NoiseSharpening.h" + +// NoiseSharpening::Reset() + +void NoiseSharpening::Reset(void) { + IIR_1st *in_r0; + float in_s0; + float in_s1; + undefined8 uVar1; + + IIR_1st::setLPF_BW(in_r0,in_s0,in_s1); + uVar1 = IIR_1st::Mute(in_r0); + IIR_1st::setLPF_BW(in_r0 + 1,(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + IIR_1st::Mute(in_r0 + 1); + in_r0[2].field_0x0 = 0.0; + in_r0[2].field_0x4 = 0.0; + return; +} + + + +// NoiseSharpening::NoiseSharpening() + +NoiseSharpening::NoiseSharpening() { + IIR_1st::IIR_1st((IIR_1st *)this); + IIR_1st::IIR_1st((IIR_1st *)(this + 0x10)); + *(undefined4 *)(this + 0x2c) = 0xac44; + *(undefined4 *)(this + 0x28) = 0; + Reset(); + return this; +} + + + +// NoiseSharpening::SetSamplingRate(int) + +void NoiseSharpening::SetSamplingRate(int param_1) { + if (*(int *)(this + 0x2c) == param_1) { + return; + } + *(int *)(this + 0x2c) = param_1; + Reset(); + return; +} + + + +// NoiseSharpening::SetGain(float) + +void NoiseSharpening::SetGain(float param_1) { + float in_r1; + + *(float *)(this + 0x28) = ROUND(in_r1 * 3.355443e+07 + 0.5); + return; +} + + + +// NoiseSharpening::Process(int*, int) + +void NoiseSharpening::Process(int *param_1,int param_2) { + longlong lVar1; + int iVar2; + int *piVar3; + int iVar4; + int iVar5; + int *piVar6; + int *piVar7; + bool bVar8; + undefined8 uVar9; + int local_28; + + if (0 < param_2) { + iVar4 = *param_1; + iVar2 = *(int *)(this + 0x20); + *(int *)(this + 0x20) = iVar4; + iVar5 = param_1[1]; + lVar1 = (longlong)(iVar4 - iVar2) * (longlong)*(int *)(this + 0x28) + 0x1000000; + bVar8 = param_2 * 2 != 2; + *param_1 = *param_1 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + iVar2 = *(int *)(this + 0x24); + *(int *)(this + 0x24) = iVar5; + piVar6 = (int *)(iVar5 - iVar2); + piVar3 = (int *)param_1[1]; + lVar1 = (longlong)(int)piVar6 * (longlong)*(int *)(this + 0x28) + 0x1000000; + if (bVar8) { + piVar6 = param_1; + } + iVar2 = (int)piVar3 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + if (bVar8) { + piVar3 = param_1 + param_2 * 2; + } + param_1[1] = iVar2; + if (bVar8) { + do { + iVar2 = piVar6[2]; + iVar4 = *(int *)(this + 0x20); + piVar7 = piVar6 + 2; + *(int *)(this + 0x20) = iVar2; + iVar5 = piVar6[3]; + lVar1 = (longlong)(iVar2 - iVar4) * (longlong)*(int *)(this + 0x28) + 0x1000000; + *piVar7 = *piVar7 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + iVar2 = *(int *)(this + 0x24); + *(int *)(this + 0x24) = iVar5; + lVar1 = (longlong)(iVar5 - iVar2) * (longlong)*(int *)(this + 0x28) + 0x1000000; + piVar6[3] = piVar6[3] + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + piVar6 = piVar7; + } while (piVar7 != piVar3 + -2); + } + iVar2 = 0; + piVar6 = param_1 + 1; + do { + iVar2 = iVar2 + 2; + lVar1 = (longlong)piVar6[-1] * (longlong)*(int *)(this + 4) + 0x1000000; + iVar4 = *(int *)(this + 0xc) + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar4 * (longlong)*(int *)this + 0x1000000; + uVar9 = VectorShiftRight((longlong)piVar6[-1] * (longlong)*(int *)(this + 8) + 0x1000000,0x19) + ; + local_28 = (int)uVar9; + *(uint *)(this + 0xc) = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + local_28; + piVar6[-1] = iVar4; + lVar1 = (longlong)param_1[1] * (longlong)*(int *)(this + 0x14) + 0x1000000; + iVar4 = *(int *)(this + 0x1c) + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar4 * (longlong)*(int *)(this + 0x10) + 0x1000000; + uVar9 = VectorShiftRight((longlong)param_1[1] * (longlong)*(int *)(this + 0x18) + 0x1000000, + 0x19); + local_28 = (int)uVar9; + *(uint *)(this + 0x1c) = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + local_28; + param_1[1] = iVar4; + param_1 = param_1 + 2; + piVar6 = piVar6 + 2; + } while (iVar2 + param_2 * -2 < 0 != SBORROW4(iVar2,param_2 * 2)); + } + return; +} diff --git a/src/util/NoiseSharpening.h b/src/util/NoiseSharpening.h new file mode 100644 index 0000000..4204074 --- /dev/null +++ b/src/util/NoiseSharpening.h @@ -0,0 +1,26 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_NOISESHARPENING_H +#define VIPER_NOISESHARPENING_H + + +class NoiseSharpening { + struct IIR_1st field_0x0; + struct IIR_1st field_0x10; + int field_0x20; + int field_0x24; + int field_0x28; + int field_0x2c; + +public: + void Reset(); + NoiseSharpening(); + void SetSamplingRate(int param_1); + void SetGain(float param_1); + void Process(int *param_1,int param_2); +}; + + +#endif //VIPER_NOISESHARPENING_H diff --git a/src/util/PConvSingle_F32.cpp b/src/util/PConvSingle_F32.cpp new file mode 100644 index 0000000..f2972f2 --- /dev/null +++ b/src/util/PConvSingle_F32.cpp @@ -0,0 +1,3318 @@ +// +// Created by mart on 2/12/21. +// + +#include "PConvSingle_F32.h" + + +// PConvSingle_F32::PConvSingle_F32() + +void PConvSingle_F32::PConvSingle_F32() { + *this = (PConvSingle_F32)0x0; + *(undefined4 *)(this + 4) = 0; + *(undefined4 *)(this + 8) = 0; + *(undefined4 *)(this + 0xc) = 0; + return; +} + + + +// PConvSingle_F32::ReleaseResources() + +void PConvSingle_F32::ReleaseResources() { + void *pvVar1; + void *__ptr; + int iVar2; + + __ptr = *(void **)(this + 0xc); + if (__ptr != nullptr) { + if (*(int *)((int)__ptr + 0x124) != 0) { + ffts_free(); + __ptr = *(void **)(this + 0xc); + } + if (*(int *)((int)__ptr + 0x128) != 0) { + ffts_free(); + __ptr = *(void **)(this + 0xc); + } + if (*(void **)((int)__ptr + 0x120) != nullptr) { + free(*(void **)((int)__ptr + 0x120)); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0xe0); + if (pvVar1 != nullptr) { + if (0 < *(int *)((int)__ptr + 0xc4)) { + iVar2 = 0; + do { + pvVar1 = *(void **)((int)pvVar1 + iVar2 * 4); + iVar2 = iVar2 + 1; + if (pvVar1 != nullptr) { + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0xe0); + } while (iVar2 < *(int *)((int)__ptr + 0xc4)); + } + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0x100); + if (pvVar1 != nullptr) { + if (0 < *(int *)((int)__ptr + 0xc4)) { + iVar2 = 0; + do { + pvVar1 = *(void **)((int)pvVar1 + iVar2 * 4); + iVar2 = iVar2 + 1; + if (pvVar1 != nullptr) { + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0x100); + } while (iVar2 < *(int *)((int)__ptr + 0xc4)); + } + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0xa0); + if (pvVar1 != nullptr) { + if (0 < *(int *)((int)__ptr + 0x84)) { + iVar2 = 0; + do { + pvVar1 = *(void **)((int)pvVar1 + iVar2 * 4); + iVar2 = iVar2 + 1; + if (pvVar1 != nullptr) { + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0xa0); + } while (iVar2 < *(int *)((int)__ptr + 0x84)); + } + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0xc0); + if (pvVar1 != nullptr) { + if (0 < *(int *)((int)__ptr + 0x84)) { + iVar2 = 0; + do { + pvVar1 = *(void **)((int)pvVar1 + iVar2 * 4); + iVar2 = iVar2 + 1; + if (pvVar1 != nullptr) { + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + pvVar1 = *(void **)((int)__ptr + 0xc0); + } while (iVar2 < *(int *)((int)__ptr + 0x84)); + } + free(pvVar1); + __ptr = *(void **)(this + 0xc); + } + if (*(void **)((int)__ptr + 0x60) != nullptr) { + free(*(void **)((int)__ptr + 0x60)); + __ptr = *(void **)(this + 0xc); + } + if (*(void **)((int)__ptr + 0x80) != nullptr) { + free(*(void **)((int)__ptr + 0x80)); + __ptr = *(void **)(this + 0xc); + } + if (*(void **)((int)__ptr + 0x20) != nullptr) { + free(*(void **)((int)__ptr + 0x20)); + __ptr = *(void **)(this + 0xc); + } + if (*(void **)((int)__ptr + 0x40) != nullptr) { + free(*(void **)((int)__ptr + 0x40)); + __ptr = *(void **)(this + 0xc); + } + if (*(void **)((int)__ptr + 0xc) != nullptr) { + free(*(void **)((int)__ptr + 0xc)); + __ptr = *(void **)(this + 0xc); + } + free(__ptr); + *(undefined4 *)(this + 0xc) = 0; + } + *this = (PConvSingle_F32)0x0; + *(undefined4 *)(this + 4) = 0; + *(undefined4 *)(this + 8) = 0; + return; +} + + + +// PConvSingle_F32::~PConvSingle_F32() + +PConvSingle_F32::~PConvSingle_F32() { + ReleaseResources(this); + return this; +} + + + +// PConvSingle_F32::ProcessKernel(float const*, int, int) + +undefined4 PConvSingle_F32::ProcessKernel(float *param_1,int param_2,int param_3) { + int iVar1; + void *pvVar2; + int iVar3; + undefined4 uVar4; + int extraout_r1; + int iVar5; + float *pfVar6; + int *piVar7; + float *pfVar8; + undefined4 *puVar9; + size_t sVar10; + int iVar11; + float *pfVar12; + undefined4 *puVar13; + undefined4 *puVar14; + undefined4 *puVar15; + int iVar16; + undefined4 *puVar17; + int iVar18; + int *piVar19; + int *piVar20; + undefined4 in_cr7; + undefined4 in_cr8; + float fVar21; + + iVar18 = *(int *)(this + 8); + puVar17 = *(undefined4 **)(this + 0xc); + *puVar17 = 0; + puVar17[1] = param_3; + puVar17[2] = 0; + iVar1 = __divsi3(iVar18 + param_2 + -1,iVar18); + *(int *)(this + 4) = iVar1; + puVar17[0x21] = iVar1; + puVar17[0x31] = iVar1 + 1; + pvVar2 = valloc(iVar18 << 3); + iVar1 = *(int *)(this + 0xc); + puVar17[8] = pvVar2; + if (*(int *)(iVar1 + 0x20) == 0) { + return 0; + } + pvVar2 = valloc((*(int *)(this + 8) + 1) * 8); + iVar18 = *(int *)(this + 0xc); + *(void **)(iVar1 + 0x40) = pvVar2; + if (*(int *)(iVar18 + 0x40) == 0) { + return 0; + } + sVar10 = (*(int *)(this + 8) + 1) * 4; + pvVar2 = valloc(sVar10); + *(void **)(iVar18 + 0x60) = pvVar2; + iVar1 = *(int *)(this + 0xc); + pvVar2 = valloc(sVar10); + iVar18 = *(int *)(this + 0xc); + *(void **)(iVar1 + 0x80) = pvVar2; + if (*(int *)(iVar18 + 0x60) == 0) { + return 0; + } + if (*(int *)(iVar18 + 0x80) == 0) { + return 0; + } + sVar10 = (param_3 + 1) * 4; + pvVar2 = valloc(sVar10); + iVar1 = *(int *)(this + 0xc); + *(void **)(iVar18 + 0xc) = pvVar2; + iVar18 = *(int *)(iVar1 + 0xc); + if (iVar18 == 0) { + return 0; + } + iVar11 = *(int *)(iVar1 + 0x84); + iVar3 = __divsi3(iVar11,param_3); + if (-1 < param_3) { + iVar11 = 0; + piVar7 = (int *)(iVar18 + -4); + do { + piVar7 = piVar7 + 1; + *piVar7 = iVar11; + iVar11 = iVar11 + iVar3; + } while (piVar7 != (int *)(iVar18 + (sVar10 - 4))); + iVar11 = *(int *)(iVar1 + 0x84); + } + if (*(int *)(iVar18 + 4) == 0) { + iVar3 = 1; + } + else { + iVar3 = 2; + } + __aeabi_idivmod(iVar11,param_3); + iVar5 = iVar3 + extraout_r1; + if (iVar3 < iVar5) { + piVar7 = (int *)(iVar18 + (iVar3 + 0x3fffffff) * 4); + do { + piVar19 = piVar7; + if (iVar3 <= param_3) { + do { + piVar20 = piVar19 + 1; + *piVar20 = piVar19[1] + 1; + piVar19 = piVar20; + } while (piVar20 != (int *)(iVar18 + (sVar10 - 4))); + } + iVar3 = iVar3 + 1; + piVar7 = piVar7 + 1; + } while (iVar3 != iVar5); + iVar11 = *(int *)(iVar1 + 0x84); + } + sVar10 = iVar11 << 2; + pvVar2 = valloc(sVar10); + *(void **)(iVar1 + 0xa0) = pvVar2; + iVar18 = *(int *)(this + 0xc); + pvVar2 = valloc(sVar10); + iVar1 = *(int *)(this + 0xc); + *(void **)(iVar18 + 0xc0) = pvVar2; + pvVar2 = *(void **)(iVar1 + 0xa0); + if (pvVar2 == nullptr) { + return 0; + } + if (*(int *)(iVar1 + 0xc0) == 0) { + return 0; + } + memset(pvVar2,0,sVar10); + memset(*(void **)(*(int *)(this + 0xc) + 0xc0),0,sVar10); + iVar1 = *(int *)(this + 0xc); + if (0 < *(int *)(iVar1 + 0x84)) { + iVar3 = *(int *)(iVar1 + 0xa0); + iVar18 = 0; + do { + sVar10 = (*(int *)(this + 8) + 1) * 4; + pvVar2 = valloc(sVar10); + *(void **)(iVar3 + iVar18 * 4) = pvVar2; + iVar1 = *(int *)(*(int *)(this + 0xc) + 0xc0); + pvVar2 = valloc(sVar10); + *(void **)(iVar1 + iVar18 * 4) = pvVar2; + iVar1 = *(int *)(this + 0xc); + iVar3 = *(int *)(iVar1 + 0xa0); + if (*(int *)(iVar3 + iVar18 * 4) == 0) { + return 0; + } + iVar11 = iVar18 * 4; + iVar18 = iVar18 + 1; + if (*(int *)(*(int *)(iVar1 + 0xc0) + iVar11) == 0) { + return 0; + } + } while (iVar18 < *(int *)(iVar1 + 0x84)); + } + sVar10 = *(int *)(iVar1 + 0xc4) << 2; + pvVar2 = valloc(sVar10); + *(void **)(iVar1 + 0xe0) = pvVar2; + iVar18 = *(int *)(this + 0xc); + pvVar2 = valloc(sVar10); + iVar1 = *(int *)(this + 0xc); + *(void **)(iVar18 + 0x100) = pvVar2; + pvVar2 = *(void **)(iVar1 + 0xe0); + if (pvVar2 == nullptr) { + return 0; + } + if (*(int *)(iVar1 + 0x100) == 0) { + return 0; + } + memset(pvVar2,0,sVar10); + memset(*(void **)(*(int *)(this + 0xc) + 0x100),0,sVar10); + iVar1 = *(int *)(this + 0xc); + if (0 < *(int *)(iVar1 + 0xc4)) { + iVar18 = 0; + do { + iVar3 = iVar18 * 4; + iVar1 = *(int *)(iVar1 + 0xe0); + sVar10 = (*(int *)(this + 8) + 1) * 4; + pvVar2 = valloc(sVar10); + *(void **)(iVar1 + iVar18 * 4) = pvVar2; + iVar1 = *(int *)(*(int *)(this + 0xc) + 0x100); + pvVar2 = valloc(sVar10); + *(void **)(iVar1 + iVar18 * 4) = pvVar2; + pvVar2 = *(void **)(*(int *)(*(int *)(this + 0xc) + 0xe0) + iVar18 * 4); + if (pvVar2 == nullptr) { + return 0; + } + iVar1 = iVar18 * 4; + iVar18 = iVar18 + 1; + if (*(int *)(*(int *)(*(int *)(this + 0xc) + 0x100) + iVar1) == 0) { + return 0; + } + memset(pvVar2,0,sVar10); + memset(*(void **)(*(int *)(*(int *)(this + 0xc) + 0x100) + iVar3),0,sVar10); + iVar1 = *(int *)(this + 0xc); + } while (iVar18 < *(int *)(iVar1 + 0xc4)); + } + iVar3 = *(int *)(this + 8); + pvVar2 = valloc(iVar3 << 2); + iVar18 = *(int *)(this + 0xc); + *(void **)(iVar1 + 0x120) = pvVar2; + if (*(void **)(iVar18 + 0x120) == nullptr) { + return 0; + } + memset(*(void **)(iVar18 + 0x120),0,iVar3 << 2); + iVar18 = *(int *)(this + 0xc); + uVar4 = ffts_init_1d_real(*(int *)(this + 8) << 1,0xffffffff); + iVar1 = *(int *)(this + 8); + *(undefined4 *)(iVar18 + 0x124) = uVar4; + iVar18 = *(int *)(this + 0xc); + uVar4 = ffts_init_1d_real(iVar1 << 1); + iVar1 = *(int *)(this + 0xc); + *(undefined4 *)(iVar18 + 0x128) = uVar4; + if (*(int *)(iVar1 + 0x124) == 0) { + return 0; + } + if (*(int *)(iVar1 + 0x128) == 0) { + return 0; + } + memset(*(void **)(iVar1 + 0x20),0,*(int *)(this + 8) << 3); + iVar18 = *(int *)(this + 0xc); + iVar1 = *(int *)(this + 8); + if (*(int *)(iVar18 + 0x84) < 2) { + iVar11 = 0; + iVar5 = 1; + iVar3 = iVar11; + } + else { + iVar3 = 0; + do { + iVar5 = iVar3; + pfVar6 = *(float **)(iVar18 + 0x20); + if (0 < iVar1) { + pfVar8 = param_1 + iVar1 * iVar5; + pfVar12 = pfVar6; + do { + fVar21 = *pfVar8; + pfVar8 = pfVar8 + 1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr8); + *pfVar12 = fVar21; + pfVar12 = pfVar12 + 1; + } while (pfVar12 != pfVar6 + iVar1); + } + ffts_execute(*(undefined4 *)(iVar18 + 0x124),pfVar6,*(undefined4 *)(iVar18 + 0x40)); + iVar1 = *(int *)(this + 8); + iVar18 = *(int *)(this + 0xc); + if (-1 < iVar1) { + puVar13 = *(undefined4 **)(*(int *)(iVar18 + 0xa0) + iVar5 * 4); + puVar17 = *(undefined4 **)(*(int *)(iVar18 + 0xc0) + iVar5 * 4); + puVar9 = (undefined4 *)(*(int *)(iVar18 + 0x40) + 4); + puVar14 = puVar13; + do { + puVar15 = puVar14 + 1; + *puVar14 = puVar9[-1]; + *puVar17 = *puVar9; + puVar17 = puVar17 + 1; + puVar9 = puVar9 + 2; + puVar14 = puVar15; + } while (puVar15 != puVar13 + iVar1 + 1); + } + iVar3 = iVar5 + 1; + } while (iVar3 < *(int *)(iVar18 + 0x84) + -1); + iVar11 = iVar1 * iVar3; + iVar5 = iVar5 + 2; + } + iVar16 = param_2 - iVar11; + if (iVar16 < 1) { + sVar10 = (iVar1 * iVar5 - param_2) * 4; + if (((int)sVar10 < 0) || (iVar16 < 0)) goto LAB_0006266c; + pfVar6 = *(float **)(iVar18 + 0x20); + } + else { + pfVar6 = *(float **)(iVar18 + 0x20); + pfVar8 = param_1 + iVar11; + pfVar12 = pfVar6; + do { + fVar21 = *pfVar8; + pfVar8 = pfVar8 + 1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr8); + *pfVar12 = fVar21; + pfVar12 = pfVar12 + 1; + } while (pfVar12 != pfVar6 + iVar16); + sVar10 = (iVar1 * iVar5 - param_2) * 4; + if ((int)sVar10 < 0) goto LAB_0006266c; + } + memset(pfVar6 + iVar16,0,sVar10); + iVar18 = *(int *)(this + 0xc); + LAB_0006266c: + ffts_execute(*(undefined4 *)(iVar18 + 0x124),*(undefined4 *)(iVar18 + 0x20), + *(undefined4 *)(iVar18 + 0x40)); + iVar1 = *(int *)(this + 8); + if (-1 < iVar1) { + iVar18 = *(int *)(this + 0xc); + puVar13 = *(undefined4 **)(*(int *)(iVar18 + 0xa0) + iVar3 * 4); + puVar17 = *(undefined4 **)(*(int *)(iVar18 + 0xc0) + iVar3 * 4); + puVar9 = (undefined4 *)(*(int *)(iVar18 + 0x40) + 4); + puVar14 = puVar13; + do { + puVar15 = puVar14 + 1; + *puVar14 = puVar9[-1]; + *puVar17 = *puVar9; + puVar17 = puVar17 + 1; + puVar9 = puVar9 + 2; + puVar14 = puVar15; + } while (puVar15 != puVar13 + iVar1 + 1); + } + return 1; +} + + + +// PConvSingle_F32::ProcessKernel(float const*, float, int, int) + +undefined4 PConvSingle_F32::ProcessKernel(float *param_1,float param_2,int param_3,int param_4) { +int iVar1; +void *pvVar2; +int iVar3; +undefined4 uVar4; +int extraout_r1; +int iVar5; +float *pfVar6; +int *piVar7; +int *piVar8; +float *pfVar9; +undefined4 *puVar10; +size_t sVar11; +int iVar12; +int *piVar13; +float *pfVar14; +undefined4 *puVar15; +undefined4 *puVar16; +undefined4 *puVar17; +int iVar18; +undefined4 *puVar19; +int iVar20; +undefined4 in_cr7; +undefined4 in_cr8; +float fVar21; +int in_stack_00000000; + +iVar20 = *(int *)(this + 8); +puVar19 = *(undefined4 **)(this + 0xc); +*puVar19 = 0; +puVar19[1] = in_stack_00000000; +puVar19[2] = 0; +iVar1 = __divsi3(iVar20 + param_4 + -1,iVar20); +*(int *)(this + 4) = iVar1; +puVar19[0x21] = iVar1; +puVar19[0x31] = iVar1 + 1; +pvVar2 = valloc(iVar20 << 3); +iVar1 = *(int *)(this + 0xc); +puVar19[8] = pvVar2; +if (*(int *)(iVar1 + 0x20) == 0) { +return 0; +} +pvVar2 = valloc((*(int *)(this + 8) + 1) * 8); +iVar20 = *(int *)(this + 0xc); +*(void **)(iVar1 + 0x40) = pvVar2; +if (*(int *)(iVar20 + 0x40) == 0) { +return 0; +} +sVar11 = (*(int *)(this + 8) + 1) * 4; +pvVar2 = valloc(sVar11); +*(void **)(iVar20 + 0x60) = pvVar2; +iVar1 = *(int *)(this + 0xc); +pvVar2 = valloc(sVar11); +iVar20 = *(int *)(this + 0xc); +*(void **)(iVar1 + 0x80) = pvVar2; +if (*(int *)(iVar20 + 0x60) == 0) { +return 0; +} +if (*(int *)(iVar20 + 0x80) == 0) { +return 0; +} +sVar11 = (in_stack_00000000 + 1) * 4; +pvVar2 = valloc(sVar11); +iVar1 = *(int *)(this + 0xc); +*(void **)(iVar20 + 0xc) = pvVar2; +iVar20 = *(int *)(iVar1 + 0xc); +if (iVar20 == 0) { +return 0; +} +iVar12 = *(int *)(iVar1 + 0x84); +iVar3 = __divsi3(iVar12,in_stack_00000000); +if (-1 < in_stack_00000000) { +iVar12 = 0; +piVar13 = (int *)(iVar20 + -4); +do { +piVar13 = piVar13 + 1; +*piVar13 = iVar12; +iVar12 = iVar12 + iVar3; +} while (piVar13 != (int *)(iVar20 + (sVar11 - 4))); +iVar12 = *(int *)(iVar1 + 0x84); +} +if (*(int *)(iVar20 + 4) == 0) { +iVar3 = 1; +} +else { +iVar3 = 2; +} +__aeabi_idivmod(iVar12,in_stack_00000000); +iVar5 = iVar3 + extraout_r1; +if (iVar3 < iVar5) { +piVar13 = (int *)(iVar20 + (iVar3 + 0x3fffffff) * 4); +do { +piVar7 = piVar13; +if (iVar3 <= in_stack_00000000) { +do { +piVar8 = piVar7 + 1; +*piVar8 = piVar7[1] + 1; +piVar7 = piVar8; +} while (piVar8 != (int *)(iVar20 + (sVar11 - 4))); +} +iVar3 = iVar3 + 1; +piVar13 = piVar13 + 1; +} while (iVar3 != iVar5); +iVar12 = *(int *)(iVar1 + 0x84); +} +sVar11 = iVar12 << 2; +pvVar2 = valloc(sVar11); +*(void **)(iVar1 + 0xa0) = pvVar2; +iVar20 = *(int *)(this + 0xc); +pvVar2 = valloc(sVar11); +iVar1 = *(int *)(this + 0xc); +*(void **)(iVar20 + 0xc0) = pvVar2; +pvVar2 = *(void **)(iVar1 + 0xa0); +if (pvVar2 == nullptr) { +return 0; +} +if (*(int *)(iVar1 + 0xc0) == 0) { +return 0; +} +memset(pvVar2,0,sVar11); +memset(*(void **)(*(int *)(this + 0xc) + 0xc0),0,sVar11); +iVar1 = *(int *)(this + 0xc); +if (0 < *(int *)(iVar1 + 0x84)) { +iVar3 = *(int *)(iVar1 + 0xa0); +iVar20 = 0; +do { +sVar11 = (*(int *)(this + 8) + 1) * 4; +pvVar2 = valloc(sVar11); +*(void **)(iVar3 + iVar20 * 4) = pvVar2; +iVar1 = *(int *)(*(int *)(this + 0xc) + 0xc0); +pvVar2 = valloc(sVar11); +*(void **)(iVar1 + iVar20 * 4) = pvVar2; +iVar1 = *(int *)(this + 0xc); +iVar3 = *(int *)(iVar1 + 0xa0); +if (*(int *)(iVar3 + iVar20 * 4) == 0) { +return 0; +} +iVar12 = iVar20 * 4; +iVar20 = iVar20 + 1; +if (*(int *)(*(int *)(iVar1 + 0xc0) + iVar12) == 0) { +return 0; +} +} while (iVar20 < *(int *)(iVar1 + 0x84)); +} +sVar11 = *(int *)(iVar1 + 0xc4) << 2; +pvVar2 = valloc(sVar11); +*(void **)(iVar1 + 0xe0) = pvVar2; +iVar20 = *(int *)(this + 0xc); +pvVar2 = valloc(sVar11); +iVar1 = *(int *)(this + 0xc); +*(void **)(iVar20 + 0x100) = pvVar2; +pvVar2 = *(void **)(iVar1 + 0xe0); +if (pvVar2 == nullptr) { +return 0; +} +if (*(int *)(iVar1 + 0x100) == 0) { +return 0; +} +memset(pvVar2,0,sVar11); +memset(*(void **)(*(int *)(this + 0xc) + 0x100),0,sVar11); +iVar1 = *(int *)(this + 0xc); +if (0 < *(int *)(iVar1 + 0xc4)) { +iVar20 = 0; +do { +iVar3 = iVar20 * 4; +iVar1 = *(int *)(iVar1 + 0xe0); +sVar11 = (*(int *)(this + 8) + 1) * 4; +pvVar2 = valloc(sVar11); +*(void **)(iVar1 + iVar20 * 4) = pvVar2; +iVar1 = *(int *)(*(int *)(this + 0xc) + 0x100); +pvVar2 = valloc(sVar11); +*(void **)(iVar1 + iVar20 * 4) = pvVar2; +pvVar2 = *(void **)(*(int *)(*(int *)(this + 0xc) + 0xe0) + iVar20 * 4); +if (pvVar2 == nullptr) { +return 0; +} +iVar1 = iVar20 * 4; +iVar20 = iVar20 + 1; +if (*(int *)(*(int *)(*(int *)(this + 0xc) + 0x100) + iVar1) == 0) { +return 0; +} +memset(pvVar2,0,sVar11); +memset(*(void **)(*(int *)(*(int *)(this + 0xc) + 0x100) + iVar3),0,sVar11); +iVar1 = *(int *)(this + 0xc); +} while (iVar20 < *(int *)(iVar1 + 0xc4)); +} +iVar3 = *(int *)(this + 8); +pvVar2 = valloc(iVar3 << 2); +iVar20 = *(int *)(this + 0xc); +*(void **)(iVar1 + 0x120) = pvVar2; +if (*(void **)(iVar20 + 0x120) == nullptr) { +return 0; +} +memset(*(void **)(iVar20 + 0x120),0,iVar3 << 2); +iVar20 = *(int *)(this + 0xc); +uVar4 = ffts_init_1d_real(*(int *)(this + 8) << 1,0xffffffff); +iVar1 = *(int *)(this + 8); +*(undefined4 *)(iVar20 + 0x124) = uVar4; +iVar20 = *(int *)(this + 0xc); +uVar4 = ffts_init_1d_real(iVar1 << 1); +iVar1 = *(int *)(this + 0xc); +*(undefined4 *)(iVar20 + 0x128) = uVar4; +if (*(int *)(iVar1 + 0x124) == 0) { +return 0; +} +if (*(int *)(iVar1 + 0x128) == 0) { +return 0; +} +memset(*(void **)(iVar1 + 0x20),0,*(int *)(this + 8) << 3); +iVar20 = *(int *)(this + 0xc); +iVar1 = *(int *)(this + 8); +if (*(int *)(iVar20 + 0x84) < 2) { +iVar12 = 0; +iVar5 = 1; +iVar3 = iVar12; +} +else { +iVar3 = 0; +do { +iVar5 = iVar3; +pfVar6 = *(float **)(iVar20 + 0x20); +if (0 < iVar1) { +pfVar9 = param_1 + iVar1 * iVar5; +pfVar14 = pfVar6; +do { +fVar21 = *pfVar9; +pfVar9 = pfVar9 + 1; +coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr8); +coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr8); +*pfVar14 = fVar21; +pfVar14 = pfVar14 + 1; +} while (pfVar14 != pfVar6 + iVar1); +} +ffts_execute(*(undefined4 *)(iVar20 + 0x124),pfVar6,*(undefined4 *)(iVar20 + 0x40)); +iVar1 = *(int *)(this + 8); +iVar20 = *(int *)(this + 0xc); +if (-1 < iVar1) { +puVar15 = *(undefined4 **)(*(int *)(iVar20 + 0xa0) + iVar5 * 4); +puVar19 = *(undefined4 **)(*(int *)(iVar20 + 0xc0) + iVar5 * 4); +puVar10 = (undefined4 *)(*(int *)(iVar20 + 0x40) + 4); +puVar16 = puVar15; +do { +puVar17 = puVar16 + 1; +*puVar16 = puVar10[-1]; +*puVar19 = *puVar10; +puVar19 = puVar19 + 1; +puVar10 = puVar10 + 2; +puVar16 = puVar17; +} while (puVar17 != puVar15 + iVar1 + 1); +} +iVar3 = iVar5 + 1; +} while (iVar3 < *(int *)(iVar20 + 0x84) + -1); +iVar12 = iVar1 * iVar3; +iVar5 = iVar5 + 2; +} +iVar18 = param_4 - iVar12; +if (iVar18 < 1) { +sVar11 = (iVar1 * iVar5 - param_4) * 4; +if (((int)sVar11 < 0) || (iVar18 < 0)) goto LAB_00062c64; +pfVar6 = *(float **)(iVar20 + 0x20); +} +else { +pfVar6 = *(float **)(iVar20 + 0x20); +pfVar9 = param_1 + iVar12; +pfVar14 = pfVar6; +do { +fVar21 = *pfVar9; +pfVar9 = pfVar9 + 1; +coprocessor_function(10,6,5,in_cr7,in_cr7,in_cr8); +coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr8); +*pfVar14 = fVar21; +pfVar14 = pfVar14 + 1; +} while (pfVar14 != pfVar6 + iVar18); +sVar11 = (iVar1 * iVar5 - param_4) * 4; +if ((int)sVar11 < 0) goto LAB_00062c64; +} +memset(pfVar6 + iVar18,0,sVar11); +iVar20 = *(int *)(this + 0xc); +LAB_00062c64: +ffts_execute(*(undefined4 *)(iVar20 + 0x124),*(undefined4 *)(iVar20 + 0x20), +*(undefined4 *)(iVar20 + 0x40)); +iVar1 = *(int *)(this + 8); +if (-1 < iVar1) { +iVar20 = *(int *)(this + 0xc); +puVar15 = *(undefined4 **)(*(int *)(iVar20 + 0xa0) + iVar3 * 4); +puVar19 = *(undefined4 **)(*(int *)(iVar20 + 0xc0) + iVar3 * 4); +puVar10 = (undefined4 *)(*(int *)(iVar20 + 0x40) + 4); +puVar16 = puVar15; +do { +puVar17 = puVar16 + 1; +*puVar16 = puVar10[-1]; +*puVar19 = *puVar10; +puVar19 = puVar19 + 1; +puVar10 = puVar10 + 2; +puVar16 = puVar17; +} while (puVar17 != puVar15 + iVar1 + 1); +} +return 1; +} + + + +// PConvSingle_F32::ConvSegment(float*, bool, int) + +void PConvSingle_F32::ConvSegment(float *param_1,bool param_2,int param_3) { + undefined4 uVar1; + undefined4 uVar2; + undefined4 uVar4; + undefined4 uVar6; + float *pfVar8; + float *pfVar9; + int iVar10; + float *pfVar11; + undefined8 *puVar12; + undefined4 *puVar13; + int iVar14; + undefined4 *puVar15; + undefined4 *puVar16; + int *piVar17; + int extraout_r1; + undefined4 *puVar18; + int extraout_r1_00; + undefined4 extraout_r1_01; + undefined4 *puVar19; + float *pfVar20; + undefined4 *puVar21; + undefined4 *puVar22; + int iVar23; + int iVar24; + undefined4 *puVar25; + float *pfVar26; + int iVar27; + float *pfVar28; + int iVar29; + undefined4 *puVar30; + float *pfVar31; + undefined8 *puVar32; + undefined4 *puVar33; + int iVar34; + undefined8 *puVar35; + int iVar36; + undefined4 *puVar37; + undefined8 *puVar38; + undefined4 *puVar39; + undefined4 *puVar40; + undefined4 *puVar41; + undefined4 *puVar42; + undefined4 *puVar43; + float *pfVar44; + int iVar45; + int iVar46; + undefined4 *puVar47; + undefined *puVar48; + undefined *puVar49; + undefined *puVar50; + float *pfVar51; + int iVar52; + undefined4 uVar53; + int iVar54; + longlong lVar55; + undefined4 in_cr5; + undefined4 in_cr7; + undefined in_q0 [16]; + undefined in_q1 [16]; + undefined in_q2 [16]; + float fVar56; + float fVar57; + float fVar58; + undefined in_q3 [16]; + float fVar59; + undefined in_q4 [16]; + undefined in_q5 [16]; + undefined in_q6 [16]; + undefined in_q7 [16]; + undefined in_q8 [16]; + undefined auVar60 [16]; + undefined in_q9 [16]; + undefined auVar61 [16]; + undefined in_q10 [16]; + undefined auVar62 [16]; + undefined in_q11 [16]; + undefined auVar63 [16]; + undefined auVar64 [16]; + undefined in_q12 [16]; + undefined auVar65 [16]; + undefined in_q13 [16]; + undefined auVar66 [16]; + undefined in_q14 [16]; + undefined auVar67 [16]; + undefined in_q15 [16]; + undefined auStack528 [188]; + int local_154; + float *local_150; + uint local_14c; + undefined8 uStack100; + undefined8 uStack92; + undefined8 uStack84; + undefined8 uStack76; + undefined8 uStack68; + undefined8 uStack60; + undefined8 uStack52; + undefined8 uStack44; + undefined4 uVar3; + undefined4 uVar5; + undefined4 uVar7; + + uStack100 = SUB168(in_q4,0); + uStack92 = SUB168(in_q4 >> 0x40,0); + uStack84 = SUB168(in_q5,0); + uStack76 = SUB168(in_q5 >> 0x40,0); + uStack68 = SUB168(in_q6,0); + uStack60 = SUB168(in_q6 >> 0x40,0); + uStack52 = SUB168(in_q7,0); + uStack44 = SUB168(in_q7 >> 0x40,0); + puVar50 = auStack528; + puVar48 = auStack528; + local_14c = (uint)param_2; + local_154 = param_3; + local_150 = param_1; + if (param_2 == 0) { + memcpy(*(void **)(*(int *)(this + 0xc) + 0x20),param_1,*(int *)(this + 8) << 2); + iVar10 = *(int *)(this + 8); + puVar49 = auStack528; + } + else { + iVar10 = *(int *)(this + 8); + if (param_3 == 0) { + puVar49 = auStack528; + if (0 < iVar10) { + iVar23 = 0x10; + do { + iVar10 = *(int *)(this + 0xc); + pfVar44 = param_1 + 0x10; + pfVar31 = param_1 + 0x18; + pfVar8 = (float *)0x360; + pfVar9 = (float *)0x370; + lVar55 = 2; + pfVar20 = param_1; + pfVar11 = param_1; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x368; + pfVar9 = (float *)0x378; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar11 = param_1 + 8; + pfVar28 = pfVar20 + 0x20; + iVar10 = *(int *)(iVar10 + 0x20); + pfVar26 = pfVar20 + 0x28; + pfVar8 = (float *)0x300; + pfVar9 = (float *)0x310; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x308; + pfVar9 = (float *)0x318; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar51 = pfVar20 + 0x30; + pfVar44 = pfVar20 + 0x38; + param_1 = pfVar20 + 0x40; + pfVar8 = (float *)0x340; + pfVar9 = (float *)0x350; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x348; + pfVar9 = (float *)0x358; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + puVar12 = (undefined8 *)(iVar10 + param_3 * 2); + param_3 = param_3 + 0x40; + pfVar8 = (float *)0x320; + pfVar9 = (float *)0x330; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar31; + pfVar31 = pfVar31 + 1; + *pfVar9 = *pfVar31; + pfVar31 = pfVar31 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x328; + pfVar9 = (float *)0x338; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar31; + pfVar31 = pfVar31 + 1; + *pfVar9 = *pfVar31; + pfVar31 = pfVar31 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3e0; + pfVar9 = (float *)0x3f0; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar28; + pfVar28 = pfVar28 + 1; + *pfVar9 = *pfVar28; + pfVar28 = pfVar28 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3e8; + pfVar9 = (float *)0x3f8; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar28; + pfVar28 = pfVar28 + 1; + *pfVar9 = *pfVar28; + pfVar28 = pfVar28 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3c0; + pfVar9 = (float *)0x3d0; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar26; + pfVar26 = pfVar26 + 1; + *pfVar9 = *pfVar26; + pfVar26 = pfVar26 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3c8; + pfVar9 = (float *)0x3d8; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar26; + pfVar26 = pfVar26 + 1; + *pfVar9 = *pfVar26; + pfVar26 = pfVar26 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3a0; + pfVar9 = (float *)0x3b0; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar51; + pfVar51 = pfVar51 + 1; + *pfVar9 = *pfVar51; + pfVar51 = pfVar51 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3a8; + pfVar9 = (float *)0x3b8; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar51; + pfVar51 = pfVar51 + 1; + *pfVar9 = *pfVar51; + pfVar51 = pfVar51 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x380; + pfVar9 = (float *)0x390; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x388; + pfVar9 = (float *)0x398; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + *puVar12 = CONCAT44(SUB164(in_q6,0),SUB164(in_q6,0)); + uVar53 = SUB164(in_q6 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x20) + iVar23); + *puVar12 = CONCAT44(SUB164(in_q4,0),SUB164(in_q4,0)); + uVar53 = SUB164(in_q4 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar23; + *(ulonglong *)(iVar10 + 0x10) = CONCAT44(SUB164(in_q0,0),SUB164(in_q0,0)); + uVar53 = SUB164(in_q0 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x14) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar23; + *(ulonglong *)(iVar10 + 0x20) = CONCAT44(SUB164(in_q2,0),SUB164(in_q2,0)); + uVar53 = SUB164(in_q2 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x24) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar23; + *(ulonglong *)(iVar10 + 0x30) = CONCAT44(SUB164(in_q14,0),SUB164(in_q14,0)); + uVar53 = SUB164(in_q14 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x34) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar23; + *(ulonglong *)(iVar10 + 0x40) = CONCAT44(SUB164(in_q12,0),SUB164(in_q12,0)); + uVar53 = SUB164(in_q12 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x44) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar23; + *(ulonglong *)(iVar10 + 0x50) = CONCAT44(SUB164(in_q10,0),SUB164(in_q10,0)); + uVar53 = SUB164(in_q10 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x54) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar23; + iVar23 = iVar23 + 0x80; + *(ulonglong *)(iVar10 + 0x60) = CONCAT44(SUB164(in_q8,0),SUB164(in_q8,0)); + uVar53 = SUB164(in_q8 >> 0x40,0); + *(ulonglong *)(iVar10 + 100) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(this + 8); + puVar49 = puVar48; + } while (param_3 + iVar10 * -2 < 0 != SBORROW4(param_3,iVar10 * 2)); + } + } + else { + puVar49 = auStack528; + if (0 < iVar10) { + iVar24 = 0x10; + iVar23 = 0; + do { + iVar10 = *(int *)(this + 0xc); + pfVar44 = param_1 + 0x10; + pfVar31 = param_1 + 0x18; + pfVar8 = (float *)0x360; + pfVar9 = (float *)0x370; + lVar55 = 2; + pfVar20 = param_1; + pfVar11 = param_1; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x368; + pfVar9 = (float *)0x378; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar11 = param_1 + 8; + pfVar28 = pfVar20 + 0x20; + iVar10 = *(int *)(iVar10 + 0x20); + pfVar26 = pfVar20 + 0x28; + pfVar8 = (float *)0x300; + pfVar9 = (float *)0x310; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x308; + pfVar9 = (float *)0x318; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar51 = pfVar20 + 0x30; + pfVar44 = pfVar20 + 0x38; + param_1 = pfVar20 + 0x40; + pfVar8 = (float *)0x340; + pfVar9 = (float *)0x350; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x348; + pfVar9 = (float *)0x358; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar11; + pfVar11 = pfVar11 + 1; + *pfVar9 = *pfVar11; + pfVar11 = pfVar11 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + puVar12 = (undefined8 *)(iVar10 + iVar23 * 2); + iVar23 = iVar23 + 0x40; + pfVar8 = (float *)0x320; + pfVar9 = (float *)0x330; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar31; + pfVar31 = pfVar31 + 1; + *pfVar9 = *pfVar31; + pfVar31 = pfVar31 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x328; + pfVar9 = (float *)0x338; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar31; + pfVar31 = pfVar31 + 1; + *pfVar9 = *pfVar31; + pfVar31 = pfVar31 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3e0; + pfVar9 = (float *)0x3f0; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar28; + pfVar28 = pfVar28 + 1; + *pfVar9 = *pfVar28; + pfVar28 = pfVar28 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3e8; + pfVar9 = (float *)0x3f8; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar28; + pfVar28 = pfVar28 + 1; + *pfVar9 = *pfVar28; + pfVar28 = pfVar28 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3c0; + pfVar9 = (float *)0x3d0; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar26; + pfVar26 = pfVar26 + 1; + *pfVar9 = *pfVar26; + pfVar26 = pfVar26 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3c8; + pfVar9 = (float *)0x3d8; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar26; + pfVar26 = pfVar26 + 1; + *pfVar9 = *pfVar26; + pfVar26 = pfVar26 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3a0; + pfVar9 = (float *)0x3b0; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar51; + pfVar51 = pfVar51 + 1; + *pfVar9 = *pfVar51; + pfVar51 = pfVar51 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x3a8; + pfVar9 = (float *)0x3b8; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar51; + pfVar51 = pfVar51 + 1; + *pfVar9 = *pfVar51; + pfVar51 = pfVar51 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x380; + pfVar9 = (float *)0x390; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + pfVar8 = (float *)0x388; + pfVar9 = (float *)0x398; + lVar55 = 2; + while( true ) { + *pfVar8 = *pfVar44; + pfVar44 = pfVar44 + 1; + *pfVar9 = *pfVar44; + pfVar44 = pfVar44 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + pfVar8 = pfVar8 + 1; + pfVar9 = pfVar9 + 1; + } + *puVar12 = CONCAT44(SUB164(in_q7,0),SUB164(in_q7,0)); + uVar53 = SUB164(in_q7 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x20) + iVar24); + *puVar12 = CONCAT44(SUB164(in_q5,0),SUB164(in_q5,0)); + uVar53 = SUB164(in_q5 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar24; + *(ulonglong *)(iVar10 + 0x10) = CONCAT44(SUB164(in_q1,0),SUB164(in_q1,0)); + uVar53 = SUB164(in_q1 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x14) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar24; + *(ulonglong *)(iVar10 + 0x20) = CONCAT44(SUB164(in_q3,0),SUB164(in_q3,0)); + uVar53 = SUB164(in_q3 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x24) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar24; + *(ulonglong *)(iVar10 + 0x30) = CONCAT44(SUB164(in_q15,0),SUB164(in_q15,0)); + uVar53 = SUB164(in_q15 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x34) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar24; + *(ulonglong *)(iVar10 + 0x40) = CONCAT44(SUB164(in_q13,0),SUB164(in_q13,0)); + uVar53 = SUB164(in_q13 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x44) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar24; + *(ulonglong *)(iVar10 + 0x50) = CONCAT44(SUB164(in_q11,0),SUB164(in_q11,0)); + uVar53 = SUB164(in_q11 >> 0x40,0); + *(ulonglong *)(iVar10 + 0x54) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(*(int *)(this + 0xc) + 0x20) + iVar24; + iVar24 = iVar24 + 0x80; + *(ulonglong *)(iVar10 + 0x60) = CONCAT44(SUB164(in_q9,0),SUB164(in_q9,0)); + uVar53 = SUB164(in_q9 >> 0x40,0); + *(ulonglong *)(iVar10 + 100) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(this + 8); + puVar49 = puVar50; + } while (iVar23 + iVar10 * -2 < 0 != SBORROW4(iVar23,iVar10 * 2)); + } + } + } + memset((void *)(*(int *)(*(int *)(this + 0xc) + 0x20) + iVar10 * 4),0,iVar10 * 4,*puVar49); + iVar10 = *(int *)(this + 0xc); + ffts_execute(*(undefined4 *)(iVar10 + 0x124),*(undefined4 *)(iVar10 + 0x20), + *(undefined4 *)(iVar10 + 0x40)); + iVar10 = *(int *)(this + 8); + piVar17 = *(int **)(this + 0xc); + puVar40 = (undefined4 *)piVar17[0x10]; + if (0 < iVar10) { + iVar24 = 0x10; + iVar23 = 0; + while( true ) { + iVar34 = piVar17[0x18]; + iVar10 = iVar23 << 1; + puVar16 = puVar40 + 0x10; + puVar15 = (undefined4 *)0x360; + puVar18 = (undefined4 *)0x370; + lVar55 = 2; + puVar21 = puVar40; + puVar13 = puVar40; + while( true ) { + *puVar15 = *puVar13; + puVar13 = puVar13 + 1; + *puVar18 = *puVar13; + puVar13 = puVar13 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x368; + puVar18 = (undefined4 *)0x378; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar13; + puVar13 = puVar13 + 1; + *puVar18 = *puVar13; + puVar13 = puVar13 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar40 = puVar40 + 8; + puVar37 = puVar21 + 0x18; + puVar12 = (undefined8 *)(iVar34 + iVar10); + puVar33 = puVar21 + 0x20; + puVar13 = puVar21 + 0x28; + puVar30 = puVar21 + 0x30; + puVar22 = puVar21 + 0x38; + puVar15 = (undefined4 *)0x340; + puVar18 = (undefined4 *)0x350; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar40; + puVar40 = puVar40 + 1; + *puVar18 = *puVar40; + puVar40 = puVar40 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x348; + puVar18 = (undefined4 *)0x358; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar40; + puVar40 = puVar40 + 1; + *puVar18 = *puVar40; + puVar40 = puVar40 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + iVar29 = iVar24 + 0x10; + iVar34 = iVar24 + 0x60; + puVar40 = (undefined4 *)0x300; + puVar15 = (undefined4 *)0x310; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar16; + puVar16 = puVar16 + 1; + *puVar15 = *puVar16; + puVar16 = puVar16 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x308; + puVar15 = (undefined4 *)0x318; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar16; + puVar16 = puVar16 + 1; + *puVar15 = *puVar16; + puVar16 = puVar16 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + iVar27 = iVar24 + 0x20; + iVar23 = iVar23 + 0x40; + puVar40 = puVar21 + 0x40; + puVar15 = (undefined4 *)0x320; + puVar18 = (undefined4 *)0x330; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar37; + puVar37 = puVar37 + 1; + *puVar18 = *puVar37; + puVar37 = puVar37 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x328; + puVar18 = (undefined4 *)0x338; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar37; + puVar37 = puVar37 + 1; + *puVar18 = *puVar37; + puVar37 = puVar37 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + iVar52 = iVar24 + 0x30; + puVar15 = (undefined4 *)0x3e0; + puVar18 = (undefined4 *)0x3f0; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar33; + puVar33 = puVar33 + 1; + *puVar18 = *puVar33; + puVar33 = puVar33 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x3e8; + puVar18 = (undefined4 *)0x3f8; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar33; + puVar33 = puVar33 + 1; + *puVar18 = *puVar33; + puVar33 = puVar33 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + iVar45 = iVar24 + 0x40; + puVar15 = (undefined4 *)0x3c0; + puVar18 = (undefined4 *)0x3d0; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar13; + puVar13 = puVar13 + 1; + *puVar18 = *puVar13; + puVar13 = puVar13 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x3c8; + puVar18 = (undefined4 *)0x3d8; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar13; + puVar13 = puVar13 + 1; + *puVar18 = *puVar13; + puVar13 = puVar13 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + iVar14 = iVar24 + 0x50; + puVar15 = (undefined4 *)0x3a0; + puVar18 = (undefined4 *)0x3b0; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar30; + puVar30 = puVar30 + 1; + *puVar18 = *puVar30; + puVar30 = puVar30 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x3a8; + puVar18 = (undefined4 *)0x3b8; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar30; + puVar30 = puVar30 + 1; + *puVar18 = *puVar30; + puVar30 = puVar30 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x380; + puVar18 = (undefined4 *)0x390; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar22; + puVar22 = puVar22 + 1; + *puVar18 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + puVar15 = (undefined4 *)0x388; + puVar18 = (undefined4 *)0x398; + lVar55 = 2; + while( true ) { + *puVar15 = *puVar22; + puVar22 = puVar22 + 1; + *puVar18 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar18 = puVar18 + 1; + } + *puVar12 = CONCAT44(SUB164(in_q6,0),SUB164(in_q6,0)); + uVar53 = SUB164(in_q6 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar24); + *puVar12 = CONCAT44(SUB164(in_q4,0),SUB164(in_q4,0)); + uVar53 = SUB164(in_q4 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar29); + *puVar12 = CONCAT44(SUB164(in_q0,0),SUB164(in_q0,0)); + uVar53 = SUB164(in_q0 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar27); + *puVar12 = CONCAT44(SUB164(in_q2,0),SUB164(in_q2,0)); + uVar53 = SUB164(in_q2 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar52); + *puVar12 = CONCAT44(SUB164(in_q14,0),SUB164(in_q14,0)); + uVar53 = SUB164(in_q14 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar45); + *puVar12 = CONCAT44(SUB164(in_q12,0),SUB164(in_q12,0)); + uVar53 = SUB164(in_q12 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar14); + *puVar12 = CONCAT44(SUB164(in_q10,0),SUB164(in_q10,0)); + uVar53 = SUB164(in_q10 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x60) + iVar34); + *puVar12 = CONCAT44(SUB164(in_q8,0),SUB164(in_q8,0)); + uVar53 = SUB164(in_q8 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar10); + *puVar12 = CONCAT44(SUB164(in_q7,0),SUB164(in_q7,0)); + uVar53 = SUB164(in_q7 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar24); + iVar24 = iVar24 + 0x80; + *puVar12 = CONCAT44(SUB164(in_q5,0),SUB164(in_q5,0)); + uVar53 = SUB164(in_q5 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar29); + *puVar12 = CONCAT44(SUB164(in_q1,0),SUB164(in_q1,0)); + uVar53 = SUB164(in_q1 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar27); + *puVar12 = CONCAT44(SUB164(in_q3,0),SUB164(in_q3,0)); + uVar53 = SUB164(in_q3 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar52); + *puVar12 = CONCAT44(SUB164(in_q15,0),SUB164(in_q15,0)); + uVar53 = SUB164(in_q15 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar45); + *puVar12 = CONCAT44(SUB164(in_q13,0),SUB164(in_q13,0)); + uVar53 = SUB164(in_q13 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar14); + *puVar12 = CONCAT44(SUB164(in_q11,0),SUB164(in_q11,0)); + uVar53 = SUB164(in_q11 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12 = (undefined8 *)(*(int *)(*(int *)(this + 0xc) + 0x80) + iVar34); + *puVar12 = CONCAT44(SUB164(in_q9,0),SUB164(in_q9,0)); + uVar53 = SUB164(in_q9 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(this + 8); + if (iVar23 + iVar10 * -2 < 0 == SBORROW4(iVar23,iVar10 * 2)) break; + piVar17 = *(int **)(this + 0xc); + } + piVar17 = *(int **)(this + 0xc); + puVar40 = (undefined4 *)piVar17[0x10]; + } + iVar23 = piVar17[3]; + iVar24 = *piVar17; + iVar34 = piVar17[0x18]; + uVar53 = puVar40[iVar10 * 2]; + iVar29 = *(int *)(iVar23 + iVar24 * 4); + iVar27 = piVar17[0x20]; + *(int *)(puVar49 + 0xb4) = iVar34; + iVar23 = *(int *)(iVar23 + iVar24 * 4 + 4); + *(undefined4 *)(iVar34 + iVar10 * 4) = uVar53; + uVar53 = (puVar40 + iVar10 * 2)[1]; + *(int *)(puVar49 + 0x8c) = iVar29; + *(int *)(puVar49 + 0xb8) = iVar23; + *(int *)(puVar49 + 8) = iVar27; + *(undefined4 *)(iVar27 + iVar10 * 4) = uVar53; + if (iVar29 < iVar23) { + iVar34 = piVar17[2]; + iVar29 = piVar17[0x38]; + iVar23 = piVar17[0x40]; + *(PConvSingle_F32 **)(puVar49 + 0x28) = this; + *(int *)(puVar49 + 0xb0) = *(int *)(puVar49 + 0x8c) << 2; + do { + __aeabi_idivmod(*(int *)(puVar49 + 0x8c) + iVar34,piVar17[0x31]); + iVar27 = *(int *)(iVar29 + extraout_r1 * 4); + iVar52 = *(int *)(iVar23 + extraout_r1 * 4); + iVar24 = *(int *)(piVar17[0x30] + *(int *)(puVar49 + 0xb0)); + *(undefined4 *)(puVar49 + 0x88) = *(undefined4 *)(piVar17[0x28] + *(int *)(puVar49 + 0xb0)); + if (0 < iVar10) { + iVar23 = 0; + iVar34 = 0; + *(int *)(puVar49 + 0x48) = iVar27 + 0x10; + *(int *)(puVar49 + 0x68) = iVar52 + 0x10; + *(int *)(puVar49 + 4) = iVar24; + puVar40 = *(undefined4 **)(puVar49 + 0xb4); + do { + puVar35 = (undefined8 *)(iVar23 + iVar27); + puVar32 = (undefined8 *)(iVar23 + iVar52); + puVar15 = (undefined4 *)(*(int *)(puVar49 + 0x88) + iVar23); + puVar18 = (undefined4 *)(*(int *)(puVar49 + 4) + iVar23); + auVar61 = CONCAT88(CONCAT44(puVar40[1],puVar40[1]),CONCAT44(*puVar40,*puVar40)); + puVar21 = (undefined4 *)(*(int *)(puVar49 + 8) + iVar23); + auVar62 = CONCAT88(CONCAT44(puVar18[1],puVar18[1]),CONCAT44(*puVar18,*puVar18)); + puVar12 = (undefined8 *)(*(int *)(puVar49 + 0x48) + iVar23); + iVar34 = iVar34 + 8; + auVar60 = CONCAT88(CONCAT44(puVar15[1],puVar15[1]),CONCAT44(*puVar15,*puVar15)); + puVar38 = (undefined8 *)(*(int *)(puVar49 + 0x68) + iVar23); + iVar23 = iVar23 + 0x20; + FloatVectorMultiplyAccumulate(auVar61,auVar60,2,0x10); + FloatVectorMultiplyAccumulate(auVar61,auVar62,2,0x10); + auVar63 = CONCAT88(CONCAT44(puVar40[5],puVar40[5]),CONCAT44(puVar40[4],puVar40[4])); + iVar24 = *(int *)(puVar49 + 0x28); + auVar65 = CONCAT88(CONCAT44(puVar15[5],puVar15[5]),CONCAT44(puVar15[4],puVar15[4])); + auVar61 = CONCAT88(CONCAT44(puVar18[5],puVar18[5]),CONCAT44(puVar18[4],puVar18[4])); + FloatVectorMultiplyAccumulate(auVar63,auVar65,2,0x10); + FloatVectorMultiplyAccumulate(auVar63,auVar61,2,0x10); + auVar66 = CONCAT88(CONCAT44(puVar21[1],puVar21[1]),CONCAT44(*puVar21,*puVar21)); + auVar63 = FloatVectorMultiplySubtract(auVar66,auVar62,2,0x10); + auVar64 = CONCAT88(CONCAT44(puVar21[5],puVar21[5]),CONCAT44(puVar21[4],puVar21[4])); + auVar62 = FloatVectorMultiplyAccumulate(auVar66,auVar60,2,0x10); + auVar61 = FloatVectorMultiplySubtract(auVar64,auVar61,2,0x10); + auVar60 = FloatVectorMultiplyAccumulate(auVar64,auVar65,2,0x10); + *puVar35 = CONCAT44(SUB164(auVar63,0),SUB164(auVar63,0)); + uVar53 = SUB164(auVar63 >> 0x40,0); + *(ulonglong *)((int)puVar35 + 4) = CONCAT44(uVar53,uVar53); + *puVar32 = CONCAT44(SUB164(auVar62,0),SUB164(auVar62,0)); + uVar53 = SUB164(auVar62 >> 0x40,0); + *(ulonglong *)((int)puVar32 + 4) = CONCAT44(uVar53,uVar53); + *puVar12 = CONCAT44(SUB164(auVar61,0),SUB164(auVar61,0)); + uVar53 = SUB164(auVar61 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + *puVar38 = CONCAT44(SUB164(auVar60,0),SUB164(auVar60,0)); + uVar53 = SUB164(auVar60 >> 0x40,0); + *(ulonglong *)((int)puVar38 + 4) = CONCAT44(uVar53,uVar53); + iVar10 = *(int *)(iVar24 + 8); + puVar40 = puVar40 + 8; + } while (iVar34 < iVar10); + piVar17 = *(int **)(iVar24 + 0xc); + iVar24 = *(int *)(puVar49 + 4); + iVar34 = piVar17[2]; + iVar29 = piVar17[0x38]; + iVar23 = piVar17[0x40]; + } + iVar14 = *(int *)(puVar49 + 0x8c); + iVar45 = iVar10 * 4; + iVar46 = *(int *)(puVar49 + 0xb8); + iVar54 = *(int *)(puVar49 + 0x88); + fVar59 = *(float *)(iVar24 + iVar45); + *(int *)(puVar49 + 0x8c) = iVar14 + 1; + fVar57 = *(float *)(iVar54 + iVar45); + fVar58 = *(float *)(iVar27 + iVar45); + iVar36 = *(int *)(puVar49 + 0xb4); + fVar56 = *(float *)(iVar36 + iVar45); + coprocessor_function(10,6,5,in_cr7,in_cr5,in_cr7); + *(int *)(puVar49 + 0xb0) = *(int *)(puVar49 + 0xb0) + 4; + *(float *)(iVar27 + iVar45) = fVar58 + (fVar56 * fVar57 - fVar59); + fVar56 = *(float *)(iVar36 + iVar45); + fVar57 = *(float *)(iVar24 + iVar45); + fVar58 = *(float *)(iVar52 + iVar45); + coprocessor_function(10,6,5,in_cr7,in_cr5,in_cr7); + fVar59 = fVar58 + *(float *)(iVar54 + iVar45) + fVar56 * fVar57; + in_q3 = CONCAT412(fVar59,CONCAT48(fVar58,CONCAT44(fVar57,fVar56))); + *(float *)(iVar52 + iVar45) = fVar59; + } while (iVar14 + 1 != iVar46); + this = *(PConvSingle_F32 **)(puVar49 + 0x28); + iVar24 = *piVar17; + puVar40 = (undefined4 *)piVar17[0x10]; + } + else { + iVar34 = piVar17[2]; + iVar29 = piVar17[0x38]; + iVar23 = piVar17[0x40]; + } + __aeabi_idivmod(iVar24 + 1,piVar17[1]); + *piVar17 = extraout_r1_00; + puVar15 = *(undefined4 **)(iVar29 + iVar34 * 4); + iVar24 = iVar34 * 4; + puVar18 = *(undefined4 **)(iVar23 + iVar34 * 4); + if (0 < iVar10) { + iVar23 = 0; + do { + iVar23 = iVar23 + 0x20; + uVar53 = puVar15[1]; + *(ulonglong *)(puVar49 + 0x90) = CONCAT44(*puVar15,*puVar15); + *(ulonglong *)(puVar49 + 0x98) = CONCAT44(uVar53,uVar53); + in_q4 = CONCAT88(CONCAT44(puVar15[0x1d],puVar15[0x1d]),CONCAT44(puVar15[0x1c],puVar15[0x1c])); + puVar37 = puVar40 + 0x10; + puVar33 = puVar40 + 0x18; + puVar30 = puVar40 + 0x20; + in_q3 = CONCAT88(CONCAT44(puVar18[0x15],puVar18[0x15]),CONCAT44(puVar18[0x14],puVar18[0x14])); + puVar22 = puVar40 + 0x28; + puVar39 = puVar40 + 0x30; + puVar25 = puVar40 + 0x38; + uVar53 = puVar18[1]; + *(ulonglong *)(puVar49 + 0xa0) = CONCAT44(*puVar18,*puVar18); + *(ulonglong *)(puVar49 + 0xa8) = CONCAT44(uVar53,uVar53); + puVar18 = puVar18 + 0x20; + puVar21 = (undefined4 *)0x360; + puVar13 = (undefined4 *)0x370; + lVar55 = 2; + puVar16 = puVar40; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x368; + puVar13 = (undefined4 *)0x378; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar16 = puVar40 + 8; + puVar21 = (undefined4 *)0x380; + puVar13 = (undefined4 *)0x390; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x388; + puVar13 = (undefined4 *)0x398; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3a0; + puVar13 = (undefined4 *)0x3b0; + lVar55 = 2; + while( true ) { + *puVar37 = *puVar21; + puVar37[1] = *puVar13; + puVar37 = puVar37 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3a8; + puVar13 = (undefined4 *)0x3b8; + lVar55 = 2; + while( true ) { + *puVar37 = *puVar21; + puVar37[1] = *puVar13; + puVar37 = puVar37 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3c0; + puVar13 = (undefined4 *)0x3d0; + lVar55 = 2; + while( true ) { + *puVar33 = *puVar21; + puVar33[1] = *puVar13; + puVar33 = puVar33 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3c8; + puVar13 = (undefined4 *)0x3d8; + lVar55 = 2; + while( true ) { + *puVar33 = *puVar21; + puVar33[1] = *puVar13; + puVar33 = puVar33 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3e0; + puVar13 = (undefined4 *)0x3f0; + lVar55 = 2; + while( true ) { + *puVar30 = *puVar21; + puVar30[1] = *puVar13; + puVar30 = puVar30 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3e8; + puVar13 = (undefined4 *)0x3f8; + lVar55 = 2; + while( true ) { + *puVar30 = *puVar21; + puVar30[1] = *puVar13; + puVar30 = puVar30 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x320; + puVar13 = (undefined4 *)0x330; + lVar55 = 2; + while( true ) { + *puVar22 = *puVar21; + puVar22[1] = *puVar13; + puVar22 = puVar22 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x328; + puVar13 = (undefined4 *)0x338; + lVar55 = 2; + while( true ) { + *puVar22 = *puVar21; + puVar22[1] = *puVar13; + puVar22 = puVar22 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x300; + puVar13 = (undefined4 *)0x310; + lVar55 = 2; + while( true ) { + *puVar39 = *puVar21; + puVar39[1] = *puVar13; + puVar39 = puVar39 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x308; + puVar13 = (undefined4 *)0x318; + lVar55 = 2; + while( true ) { + *puVar39 = *puVar21; + puVar39[1] = *puVar13; + puVar39 = puVar39 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x340; + puVar13 = (undefined4 *)0x350; + lVar55 = 2; + while( true ) { + *puVar25 = *puVar21; + puVar25[1] = *puVar13; + puVar25 = puVar25 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x348; + puVar13 = (undefined4 *)0x358; + lVar55 = 2; + while( true ) { + *puVar25 = *puVar21; + puVar25[1] = *puVar13; + puVar25 = puVar25 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + iVar10 = *(int *)(this + 8); + puVar15 = puVar15 + 0x20; + puVar40 = puVar40 + 0x40; + } while (iVar23 < iVar10); + iVar23 = *(int *)(this + 0xc); + puVar40 = *(undefined4 **)(iVar23 + 0x40); + puVar15 = *(undefined4 **)(*(int *)(iVar23 + 0xe0) + iVar24); + puVar18 = *(undefined4 **)(*(int *)(iVar23 + 0x100) + iVar24); + } + puVar40[iVar10 * 2] = puVar15[iVar10]; + (puVar40 + iVar10 * 2)[1] = puVar18[iVar10]; + memset(puVar15,0,iVar10 * 4 + 4,*puVar49); + memset(*(void **)(*(int *)(*(int *)(this + 0xc) + 0x100) + iVar24),0,(*(int *)(this + 8) + 1) * 4, + *puVar49); + iVar10 = *(int *)(this + 0xc); + ffts_execute(*(undefined4 *)(iVar10 + 0x128),*(undefined4 *)(iVar10 + 0x40), + *(undefined4 *)(iVar10 + 0x20)); + iVar10 = *(int *)(puVar49 + 0xc4); + puVar40 = *(undefined4 **)(*(int *)(this + 0xc) + 0x20); + uVar53 = *(undefined4 *)(*(int *)(this + 0xc) + 0x120); + *(undefined4 **)(puVar49 + 0xb0) = puVar40; + *(undefined4 *)(puVar49 + 0x90) = uVar53; + if (iVar10 == 0) { + iVar23 = *(int *)(this + 8); + if (0 < iVar23) { + puVar15 = *(undefined4 **)(puVar49 + 0x90); + puVar12 = *(undefined8 **)(puVar49 + 0xc0); + do { + auVar60 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[1],puVar40[1]), + CONCAT44(*puVar40,*puVar40)), + CONCAT88(CONCAT44(puVar15[1],puVar15[1]), + CONCAT44(*puVar15,*puVar15)),2,0x20); + iVar10 = iVar10 + 0x20; + auVar67 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[5],puVar40[5]), + CONCAT44(puVar40[4],puVar40[4])), + CONCAT88(CONCAT44(puVar15[5],puVar15[5]), + CONCAT44(puVar15[4],puVar15[4])),2,0x20); + auVar66 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[9],puVar40[9]), + CONCAT44(puVar40[8],puVar40[8])), + CONCAT88(CONCAT44(puVar15[9],puVar15[9]), + CONCAT44(puVar15[8],puVar15[8])),2,0x20); + auVar65 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[0xd],puVar40[0xd]), + CONCAT44(puVar40[0xc],puVar40[0xc])), + CONCAT88(CONCAT44(puVar15[0xd],puVar15[0xd]), + CONCAT44(puVar15[0xc],puVar15[0xc])),2,0x20); + auVar64 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[0x11],puVar40[0x11]), + CONCAT44(puVar40[0x10],puVar40[0x10])), + CONCAT88(CONCAT44(puVar15[0x11],puVar15[0x11]), + CONCAT44(puVar15[0x10],puVar15[0x10])),2,0x20); + auVar61 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[0x1d],puVar40[0x1d]), + CONCAT44(puVar40[0x1c],puVar40[0x1c])), + CONCAT88(CONCAT44(puVar15[0x1d],puVar15[0x1d]), + CONCAT44(puVar15[0x1c],puVar15[0x1c])),2,0x20); + auVar63 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[0x15],puVar40[0x15]), + CONCAT44(puVar40[0x14],puVar40[0x14])), + CONCAT88(CONCAT44(puVar15[0x15],puVar15[0x15]), + CONCAT44(puVar15[0x14],puVar15[0x14])),2,0x20); + auVar62 = FloatVectorAdd(CONCAT88(CONCAT44(puVar40[0x19],puVar40[0x19]), + CONCAT44(puVar40[0x18],puVar40[0x18])), + CONCAT88(CONCAT44(puVar15[0x19],puVar15[0x19]), + CONCAT44(puVar15[0x18],puVar15[0x18])),2,0x20); + *puVar12 = CONCAT44(SUB164(auVar60,0),SUB164(auVar60,0)); + uVar53 = SUB164(auVar60 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 4) = CONCAT44(uVar53,uVar53); + puVar12[2] = CONCAT44(SUB164(auVar67,0),SUB164(auVar67,0)); + uVar53 = SUB164(auVar67 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 0x14) = CONCAT44(uVar53,uVar53); + puVar12[4] = CONCAT44(SUB164(auVar66,0),SUB164(auVar66,0)); + uVar53 = SUB164(auVar66 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 0x24) = CONCAT44(uVar53,uVar53); + puVar12[6] = CONCAT44(SUB164(auVar65,0),SUB164(auVar65,0)); + uVar53 = SUB164(auVar65 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 0x34) = CONCAT44(uVar53,uVar53); + puVar12[8] = CONCAT44(SUB164(auVar64,0),SUB164(auVar64,0)); + uVar53 = SUB164(auVar64 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 0x44) = CONCAT44(uVar53,uVar53); + puVar12[10] = CONCAT44(SUB164(auVar63,0),SUB164(auVar63,0)); + uVar53 = SUB164(auVar63 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 0x54) = CONCAT44(uVar53,uVar53); + puVar12[0xc] = CONCAT44(SUB164(auVar62,0),SUB164(auVar62,0)); + uVar53 = SUB164(auVar62 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 100) = CONCAT44(uVar53,uVar53); + puVar12[0xe] = CONCAT44(SUB164(auVar61,0),SUB164(auVar61,0)); + uVar53 = SUB164(auVar61 >> 0x40,0); + *(ulonglong *)((int)puVar12 + 0x74) = CONCAT44(uVar53,uVar53); + iVar23 = *(int *)(this + 8); + puVar40 = puVar40 + 0x20; + puVar15 = puVar15 + 0x20; + puVar12 = puVar12 + 0x10; + } while (iVar10 < iVar23); + } + } + else { + iVar23 = *(int *)(this + 8); + if (*(int *)(puVar49 + 0xbc) == 0) { + if (0 < iVar23) { + puVar15 = *(undefined4 **)(puVar49 + 0xc0); + iVar10 = *(int *)(puVar49 + 0xbc); + puVar18 = *(undefined4 **)(puVar49 + 0xb0); + puVar40 = *(undefined4 **)(puVar49 + 0x90); + *(PConvSingle_F32 **)(puVar49 + 0x8c) = this; + do { + puVar37 = puVar15 + 0x20; + puVar33 = puVar15 + 0x28; + puVar30 = puVar15 + 0x30; + *(undefined4 **)(puVar49 + 0x88) = puVar15 + 0x38; + *(undefined4 **)(puVar49 + 0xb4) = puVar18 + 0xc; + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar16 = puVar18; + puVar22 = puVar37; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *(longlong *)(puVar49 + 8) = SUB168(in_q3,0); + *(longlong *)(puVar49 + 0x10) = SUB168(in_q3 >> 0x40,0); + *(longlong *)(puVar49 + 0x18) = SUB168(in_q4,0); + *(longlong *)(puVar49 + 0x20) = SUB168(in_q4 >> 0x40,0); + puVar12 = (undefined8 *)(puVar49 + 0x28); + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar22 = puVar33; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *puVar12 = SUB168(in_q3,0); + puVar12[1] = SUB168(in_q3 >> 0x40,0); + puVar12[2] = SUB168(in_q4,0); + puVar12[3] = SUB168(in_q4 >> 0x40,0); + puVar12 = (undefined8 *)(puVar49 + 0x48); + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar22 = puVar40; + puVar25 = puVar30; + while( true ) { + *puVar21 = *puVar25; + puVar25 = puVar25 + 1; + *puVar13 = *puVar25; + puVar25 = puVar25 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar25; + puVar25 = puVar25 + 1; + *puVar13 = *puVar25; + puVar25 = puVar25 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *puVar12 = SUB168(in_q3,0); + puVar12[1] = SUB168(in_q3 >> 0x40,0); + puVar12[2] = SUB168(in_q4,0); + puVar12[3] = SUB168(in_q4 >> 0x40,0); + puVar42 = *(undefined4 **)(puVar49 + 0x88); + auVar60 = CONCAT88(CONCAT44(puVar18[1],puVar18[1]),CONCAT44(*puVar18,*puVar18)); + puVar18 = puVar18 + 4; + puVar43 = puVar16 + 8; + puVar41 = puVar15 + 0x10; + puVar39 = puVar15 + 0x18; + auVar61 = CONCAT88(CONCAT44(puVar40[1],puVar40[1]),CONCAT44(*puVar40,*puVar40)); + puVar40 = puVar40 + 4; + iVar10 = iVar10 + 0x20; + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar25 = puVar15; + while( true ) { + *puVar21 = *puVar42; + puVar42 = puVar42 + 1; + *puVar13 = *puVar42; + puVar42 = puVar42 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar42; + puVar42 = puVar42 + 1; + *puVar13 = *puVar42; + puVar42 = puVar42 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *(longlong *)(puVar49 + 0x68) = SUB168(in_q3,0); + *(longlong *)(puVar49 + 0x70) = SUB168(in_q3 >> 0x40,0); + *(longlong *)(puVar49 + 0x78) = SUB168(in_q4,0); + *(longlong *)(puVar49 + 0x80) = SUB168(in_q4 >> 0x40,0); + puVar42 = *(undefined4 **)(puVar49 + 0xb4); + auVar63 = CONCAT88(CONCAT44(puVar18[1],puVar18[1]),CONCAT44(*puVar18,*puVar18)); + auVar62 = CONCAT88(CONCAT44(puVar40[1],puVar40[1]),CONCAT44(*puVar40,*puVar40)); + puVar13 = puVar16 + 0x14; + auVar64 = CONCAT88(CONCAT44(puVar16[0x11],puVar16[0x11]), + CONCAT44(puVar16[0x10],puVar16[0x10])); + puVar47 = puVar22 + 8; + puVar40 = (undefined4 *)0x3e0; + puVar18 = (undefined4 *)0x3f0; + lVar55 = 2; + puVar21 = puVar15; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar18 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar18 = puVar18 + 1; + } + puVar40 = (undefined4 *)0x3e8; + puVar18 = (undefined4 *)0x3f8; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar18 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar18 = puVar18 + 1; + } + puVar19 = puVar15 + 8; + FloatVectorAdd(auVar60,auVar61,2,0x20); + auVar60 = CONCAT88(CONCAT44(puVar13[1],puVar13[1]),CONCAT44(*puVar13,*puVar13)); + puVar13 = puVar22 + 0xc; + auVar65 = CONCAT88(CONCAT44(puVar43[1],puVar43[1]),CONCAT44(*puVar43,*puVar43)); + puVar43 = puVar16 + 0x18; + auVar66 = CONCAT88(CONCAT44(puVar47[1],puVar47[1]),CONCAT44(*puVar47,*puVar47)); + puVar47 = puVar22 + 0x18; + auVar61 = CONCAT88(CONCAT44(puVar42[1],puVar42[1]),CONCAT44(*puVar42,*puVar42)); + puVar42 = puVar16 + 0x1c; + puVar18 = puVar16 + 0x20; + puVar40 = (undefined4 *)0x3a0; + puVar15 = (undefined4 *)0x3b0; + lVar55 = 2; + puVar21 = puVar41; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x3a8; + puVar15 = (undefined4 *)0x3b8; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + FloatVectorAdd(auVar65,auVar66,2,0x20); + auVar65 = CONCAT88(CONCAT44(puVar13[1],puVar13[1]),CONCAT44(*puVar13,*puVar13)); + puVar13 = puVar22 + 0x1c; + puVar40 = (undefined4 *)0x3c0; + puVar15 = (undefined4 *)0x3d0; + lVar55 = 2; + puVar21 = puVar19; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x3c8; + puVar15 = (undefined4 *)0x3d8; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + FloatVectorAdd(auVar63,auVar62,2,0x20); + puVar40 = (undefined4 *)0x380; + puVar15 = (undefined4 *)0x390; + lVar55 = 2; + puVar21 = puVar39; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x388; + puVar15 = (undefined4 *)0x398; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + FloatVectorAdd(auVar61,auVar65,2,0x20); + uVar1 = *puVar43; + uVar53 = puVar43[1]; + uVar3 = *puVar42; + uVar2 = puVar42[1]; + puVar40 = puVar22 + 0x20; + auVar61 = FloatVectorAdd(auVar64,CONCAT88(CONCAT44(puVar22[0x11],puVar22[0x11]), + CONCAT44(puVar22[0x10],puVar22[0x10])),2,0x20); + *(longlong *)(puVar49 + 8) = SUB168(auVar61,0); + *(longlong *)(puVar49 + 0x10) = SUB168(auVar61 >> 0x40,0); + uVar5 = *puVar13; + uVar4 = puVar13[1]; + auVar60 = FloatVectorAdd(auVar60,CONCAT88(CONCAT44(puVar22[0x15],puVar22[0x15]), + CONCAT44(puVar22[0x14],puVar22[0x14])),2,0x20); + uVar6 = *puVar47; + uVar7 = puVar47[1]; + *(longlong *)(puVar49 + 0x28) = SUB168(auVar60,0); + *(longlong *)(puVar49 + 0x30) = SUB168(auVar60 >> 0x40,0); + auVar60 = FloatVectorAdd(CONCAT88(CONCAT44(uVar53,uVar53),CONCAT44(uVar1,uVar1)), + CONCAT88(CONCAT44(uVar7,uVar7),CONCAT44(uVar6,uVar6)),2,0x20); + *(longlong *)(puVar49 + 0x48) = SUB168(auVar60,0); + *(longlong *)(puVar49 + 0x50) = SUB168(auVar60 >> 0x40,0); + puVar15 = (undefined4 *)0x3e0; + puVar21 = (undefined4 *)0x3f0; + lVar55 = 2; + puVar13 = puVar25; + while( true ) { + *puVar13 = *puVar15; + puVar13[1] = *puVar21; + puVar13 = puVar13 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar21 = puVar21 + 1; + } + puVar15 = (undefined4 *)0x3e8; + puVar21 = (undefined4 *)0x3f8; + lVar55 = 2; + while( true ) { + *puVar13 = *puVar15; + puVar13[1] = *puVar21; + puVar13 = puVar13 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar21 = puVar21 + 1; + } + puVar15 = puVar25 + 0x40; + puVar21 = (undefined4 *)0x3c0; + puVar13 = (undefined4 *)0x3d0; + lVar55 = 2; + while( true ) { + *puVar19 = *puVar21; + puVar19[1] = *puVar13; + puVar19 = puVar19 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3c8; + puVar13 = (undefined4 *)0x3d8; + lVar55 = 2; + while( true ) { + *puVar19 = *puVar21; + puVar19[1] = *puVar13; + puVar19 = puVar19 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + auVar60 = FloatVectorAdd(CONCAT88(CONCAT44(uVar2,uVar2),CONCAT44(uVar3,uVar3)), + CONCAT88(CONCAT44(uVar4,uVar4),CONCAT44(uVar5,uVar5)),2,0x20); + puVar21 = (undefined4 *)0x3a0; + puVar13 = (undefined4 *)0x3b0; + lVar55 = 2; + while( true ) { + *puVar41 = *puVar21; + puVar41[1] = *puVar13; + puVar41 = puVar41 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3a8; + puVar13 = (undefined4 *)0x3b8; + lVar55 = 2; + while( true ) { + *puVar41 = *puVar21; + puVar41[1] = *puVar13; + puVar41 = puVar41 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *(longlong *)(puVar49 + 0x68) = SUB168(auVar60,0); + *(longlong *)(puVar49 + 0x70) = SUB168(auVar60 >> 0x40,0); + this = *(PConvSingle_F32 **)(puVar49 + 0x8c); + puVar21 = (undefined4 *)0x380; + puVar13 = (undefined4 *)0x390; + lVar55 = 2; + while( true ) { + *puVar39 = *puVar21; + puVar39[1] = *puVar13; + puVar39 = puVar39 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x388; + puVar13 = (undefined4 *)0x398; + lVar55 = 2; + while( true ) { + *puVar39 = *puVar21; + puVar39[1] = *puVar13; + puVar39 = puVar39 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar37 = *puVar21; + puVar37[1] = *puVar13; + puVar37 = puVar37 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar37 = *puVar21; + puVar37[1] = *puVar13; + puVar37 = puVar37 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar33 = *puVar21; + puVar33[1] = *puVar13; + puVar33 = puVar33 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar33 = *puVar21; + puVar33[1] = *puVar13; + puVar33 = puVar33 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar30 = *puVar21; + puVar30[1] = *puVar13; + puVar30 = puVar30 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar30 = *puVar21; + puVar30[1] = *puVar13; + puVar30 = puVar30 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + in_q3 = *(undefined (*) [16])(puVar49 + 0x68); + in_q4 = *(undefined (*) [16])(puVar49 + 0x78); + puVar16 = *(undefined4 **)(puVar49 + 0x88); + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + iVar23 = *(int *)(this + 8); + } while (iVar10 < iVar23); + } + } + else { + if (0 < iVar23) { + puVar15 = *(undefined4 **)(puVar49 + 0xc0); + iVar10 = 0; + puVar18 = *(undefined4 **)(puVar49 + 0xb0); + puVar40 = *(undefined4 **)(puVar49 + 0x90); + *(PConvSingle_F32 **)(puVar49 + 0x8c) = this; + do { + puVar37 = puVar15 + 0x20; + puVar33 = puVar15 + 0x28; + puVar30 = puVar15 + 0x30; + *(undefined4 **)(puVar49 + 0x88) = puVar15 + 0x38; + *(undefined4 **)(puVar49 + 0xb4) = puVar18 + 0xc; + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar16 = puVar18; + puVar22 = puVar37; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *(longlong *)(puVar49 + 8) = SUB168(in_q3,0); + *(longlong *)(puVar49 + 0x10) = SUB168(in_q3 >> 0x40,0); + *(longlong *)(puVar49 + 0x18) = SUB168(in_q4,0); + *(longlong *)(puVar49 + 0x20) = SUB168(in_q4 >> 0x40,0); + puVar12 = (undefined8 *)(puVar49 + 0x28); + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar22 = puVar33; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar22; + puVar22 = puVar22 + 1; + *puVar13 = *puVar22; + puVar22 = puVar22 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *puVar12 = SUB168(in_q3,0); + puVar12[1] = SUB168(in_q3 >> 0x40,0); + puVar12[2] = SUB168(in_q4,0); + puVar12[3] = SUB168(in_q4 >> 0x40,0); + puVar12 = (undefined8 *)(puVar49 + 0x48); + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar22 = puVar40; + puVar25 = puVar30; + while( true ) { + *puVar21 = *puVar25; + puVar25 = puVar25 + 1; + *puVar13 = *puVar25; + puVar25 = puVar25 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar25; + puVar25 = puVar25 + 1; + *puVar13 = *puVar25; + puVar25 = puVar25 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *puVar12 = SUB168(in_q3,0); + puVar12[1] = SUB168(in_q3 >> 0x40,0); + puVar12[2] = SUB168(in_q4,0); + puVar12[3] = SUB168(in_q4 >> 0x40,0); + puVar42 = *(undefined4 **)(puVar49 + 0x88); + auVar60 = CONCAT88(CONCAT44(puVar16[1],puVar16[1]),CONCAT44(*puVar16,*puVar16)); + puVar16 = puVar16 + 4; + puVar43 = puVar18 + 8; + puVar41 = puVar15 + 0x10; + puVar39 = puVar15 + 0x18; + auVar61 = CONCAT88(CONCAT44(puVar40[1],puVar40[1]),CONCAT44(*puVar40,*puVar40)); + puVar40 = puVar40 + 4; + iVar10 = iVar10 + 0x20; + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + puVar25 = puVar15; + while( true ) { + *puVar21 = *puVar42; + puVar42 = puVar42 + 1; + *puVar13 = *puVar42; + puVar42 = puVar42 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar21 = *puVar42; + puVar42 = puVar42 + 1; + *puVar13 = *puVar42; + puVar42 = puVar42 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *(longlong *)(puVar49 + 0x68) = SUB168(in_q3,0); + *(longlong *)(puVar49 + 0x70) = SUB168(in_q3 >> 0x40,0); + *(longlong *)(puVar49 + 0x78) = SUB168(in_q4,0); + *(longlong *)(puVar49 + 0x80) = SUB168(in_q4 >> 0x40,0); + puVar42 = *(undefined4 **)(puVar49 + 0xb4); + auVar63 = CONCAT88(CONCAT44(puVar16[1],puVar16[1]),CONCAT44(*puVar16,*puVar16)); + auVar62 = CONCAT88(CONCAT44(puVar40[1],puVar40[1]),CONCAT44(*puVar40,*puVar40)); + puVar16 = puVar18 + 0x14; + auVar64 = CONCAT88(CONCAT44(puVar18[0x11],puVar18[0x11]), + CONCAT44(puVar18[0x10],puVar18[0x10])); + puVar47 = puVar22 + 8; + puVar40 = (undefined4 *)0x3e0; + puVar21 = (undefined4 *)0x3f0; + lVar55 = 2; + puVar13 = puVar15; + while( true ) { + *puVar40 = *puVar13; + puVar13 = puVar13 + 1; + *puVar21 = *puVar13; + puVar13 = puVar13 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar21 = puVar21 + 1; + } + puVar40 = (undefined4 *)0x3e8; + puVar21 = (undefined4 *)0x3f8; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar13; + puVar13 = puVar13 + 1; + *puVar21 = *puVar13; + puVar13 = puVar13 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar21 = puVar21 + 1; + } + puVar19 = puVar15 + 8; + FloatVectorAdd(auVar60,auVar61,2,0x20); + auVar60 = CONCAT88(CONCAT44(puVar16[1],puVar16[1]),CONCAT44(*puVar16,*puVar16)); + puVar13 = puVar22 + 0xc; + auVar65 = CONCAT88(CONCAT44(puVar43[1],puVar43[1]),CONCAT44(*puVar43,*puVar43)); + puVar43 = puVar18 + 0x18; + auVar66 = CONCAT88(CONCAT44(puVar47[1],puVar47[1]),CONCAT44(*puVar47,*puVar47)); + puVar47 = puVar22 + 0x18; + auVar61 = CONCAT88(CONCAT44(puVar42[1],puVar42[1]),CONCAT44(*puVar42,*puVar42)); + puVar16 = puVar18 + 0x1c; + puVar18 = puVar18 + 0x20; + puVar40 = (undefined4 *)0x3a0; + puVar15 = (undefined4 *)0x3b0; + lVar55 = 2; + puVar21 = puVar41; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x3a8; + puVar15 = (undefined4 *)0x3b8; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + FloatVectorAdd(auVar65,auVar66,2,0x20); + auVar65 = CONCAT88(CONCAT44(puVar13[1],puVar13[1]),CONCAT44(*puVar13,*puVar13)); + puVar13 = puVar22 + 0x1c; + puVar40 = (undefined4 *)0x3c0; + puVar15 = (undefined4 *)0x3d0; + lVar55 = 2; + puVar21 = puVar19; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x3c8; + puVar15 = (undefined4 *)0x3d8; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + FloatVectorAdd(auVar63,auVar62,2,0x20); + puVar40 = (undefined4 *)0x380; + puVar15 = (undefined4 *)0x390; + lVar55 = 2; + puVar21 = puVar39; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + puVar40 = (undefined4 *)0x388; + puVar15 = (undefined4 *)0x398; + lVar55 = 2; + while( true ) { + *puVar40 = *puVar21; + puVar21 = puVar21 + 1; + *puVar15 = *puVar21; + puVar21 = puVar21 + 1; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar40 = puVar40 + 1; + puVar15 = puVar15 + 1; + } + FloatVectorAdd(auVar61,auVar65,2,0x20); + uVar53 = *puVar43; + uVar1 = puVar43[1]; + uVar2 = *puVar16; + uVar3 = puVar16[1]; + puVar40 = puVar22 + 0x20; + auVar61 = FloatVectorAdd(auVar64,CONCAT88(CONCAT44(puVar22[0x11],puVar22[0x11]), + CONCAT44(puVar22[0x10],puVar22[0x10])),2,0x20); + *(longlong *)(puVar49 + 0x18) = SUB168(auVar61,0); + *(longlong *)(puVar49 + 0x20) = SUB168(auVar61 >> 0x40,0); + uVar4 = *puVar13; + uVar5 = puVar13[1]; + auVar60 = FloatVectorAdd(auVar60,CONCAT88(CONCAT44(puVar22[0x15],puVar22[0x15]), + CONCAT44(puVar22[0x14],puVar22[0x14])),2,0x20); + uVar6 = *puVar47; + uVar7 = puVar47[1]; + *(longlong *)(puVar49 + 0x38) = SUB168(auVar60,0); + *(longlong *)(puVar49 + 0x40) = SUB168(auVar60 >> 0x40,0); + auVar60 = FloatVectorAdd(CONCAT88(CONCAT44(uVar1,uVar1),CONCAT44(uVar53,uVar53)), + CONCAT88(CONCAT44(uVar7,uVar7),CONCAT44(uVar6,uVar6)),2,0x20); + *(longlong *)(puVar49 + 0x58) = SUB168(auVar60,0); + *(longlong *)(puVar49 + 0x60) = SUB168(auVar60 >> 0x40,0); + puVar15 = (undefined4 *)0x3e0; + puVar21 = (undefined4 *)0x3f0; + lVar55 = 2; + puVar13 = puVar25; + while( true ) { + *puVar13 = *puVar15; + puVar13[1] = *puVar21; + puVar13 = puVar13 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar21 = puVar21 + 1; + } + puVar15 = (undefined4 *)0x3e8; + puVar21 = (undefined4 *)0x3f8; + lVar55 = 2; + while( true ) { + *puVar13 = *puVar15; + puVar13[1] = *puVar21; + puVar13 = puVar13 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar15 = puVar15 + 1; + puVar21 = puVar21 + 1; + } + puVar15 = puVar25 + 0x40; + puVar21 = (undefined4 *)0x3c0; + puVar13 = (undefined4 *)0x3d0; + lVar55 = 2; + while( true ) { + *puVar19 = *puVar21; + puVar19[1] = *puVar13; + puVar19 = puVar19 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3c8; + puVar13 = (undefined4 *)0x3d8; + lVar55 = 2; + while( true ) { + *puVar19 = *puVar21; + puVar19[1] = *puVar13; + puVar19 = puVar19 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + auVar60 = FloatVectorAdd(CONCAT88(CONCAT44(uVar3,uVar3),CONCAT44(uVar2,uVar2)), + CONCAT88(CONCAT44(uVar5,uVar5),CONCAT44(uVar4,uVar4)),2,0x20); + puVar21 = (undefined4 *)0x3a0; + puVar13 = (undefined4 *)0x3b0; + lVar55 = 2; + while( true ) { + *puVar41 = *puVar21; + puVar41[1] = *puVar13; + puVar41 = puVar41 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x3a8; + puVar13 = (undefined4 *)0x3b8; + lVar55 = 2; + while( true ) { + *puVar41 = *puVar21; + puVar41[1] = *puVar13; + puVar41 = puVar41 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + *(longlong *)(puVar49 + 0x78) = SUB168(auVar60,0); + *(longlong *)(puVar49 + 0x80) = SUB168(auVar60 >> 0x40,0); + this = *(PConvSingle_F32 **)(puVar49 + 0x8c); + puVar21 = (undefined4 *)0x380; + puVar13 = (undefined4 *)0x390; + lVar55 = 2; + while( true ) { + *puVar39 = *puVar21; + puVar39[1] = *puVar13; + puVar39 = puVar39 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x388; + puVar13 = (undefined4 *)0x398; + lVar55 = 2; + while( true ) { + *puVar39 = *puVar21; + puVar39[1] = *puVar13; + puVar39 = puVar39 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar37 = *puVar21; + puVar37[1] = *puVar13; + puVar37 = puVar37 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar37 = *puVar21; + puVar37[1] = *puVar13; + puVar37 = puVar37 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar33 = *puVar21; + puVar33[1] = *puVar13; + puVar33 = puVar33 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar33 = *puVar21; + puVar33[1] = *puVar13; + puVar33 = puVar33 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar30 = *puVar21; + puVar30[1] = *puVar13; + puVar30 = puVar30 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar30 = *puVar21; + puVar30[1] = *puVar13; + puVar30 = puVar30 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + in_q3 = *(undefined (*) [16])(puVar49 + 0x68); + in_q4 = *(undefined (*) [16])(puVar49 + 0x78); + puVar16 = *(undefined4 **)(puVar49 + 0x88); + puVar21 = (undefined4 *)0x330; + puVar13 = (undefined4 *)0x340; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + puVar21 = (undefined4 *)0x338; + puVar13 = (undefined4 *)0x348; + lVar55 = 2; + while( true ) { + *puVar16 = *puVar21; + puVar16[1] = *puVar13; + puVar16 = puVar16 + 2; + lVar55 = lVar55 + -1; + if (lVar55 == 0) break; + puVar21 = puVar21 + 1; + puVar13 = puVar13 + 1; + } + iVar23 = *(int *)(this + 8); + } while (iVar10 < iVar23); + } + } + } + memcpy(*(void **)(puVar49 + 0x90),(void *)(*(int *)(puVar49 + 0xb0) + iVar23 * 4),iVar23 * 4, + *puVar49); + iVar10 = *(int *)(this + 0xc); + __aeabi_idivmod(*(int *)(iVar10 + 8) + 1,*(undefined4 *)(iVar10 + 0xc4)); + *(undefined4 *)(iVar10 + 8) = extraout_r1_01; + return; +} + + + +// PConvSingle_F32::Reset() + +void PConvSingle_F32::Reset() { + int iVar1; + undefined4 *puVar2; + int iVar3; + + if (*this == (PConvSingle_F32)0x0) { + return; + } + puVar2 = *(undefined4 **)(this + 0xc); + iVar3 = 0; + *puVar2 = 0; + puVar2[2] = 0; + if (0 < (int)puVar2[0x31]) { + do { + memset(*(void **)(puVar2[0x38] + iVar3 * 4),0,(*(int *)(this + 8) + 1) * 4); + iVar1 = iVar3 * 4; + iVar3 = iVar3 + 1; + memset(*(void **)(*(int *)(*(int *)(this + 0xc) + 0x100) + iVar1),0, + (*(int *)(this + 8) + 1) * 4); + puVar2 = *(undefined4 **)(this + 0xc); + } while (iVar3 < (int)puVar2[0x31]); + } + memset((void *)puVar2[0x48],0,*(int *)(this + 8) << 2); + return; +} + + + +// PConvSingle_F32::GetFFTSize() + +int PConvSingle_F32::GetFFTSize() { + return *(int *)(this + 8) << 1; +} + + + +// PConvSingle_F32::GetSegmentSize() + +undefined4 PConvSingle_F32::GetSegmentSize() { + return *(undefined4 *)(this + 8); +} + + + +// PConvSingle_F32::GetSegmentCount() + +undefined4 PConvSingle_F32::GetSegmentCount() { + return *(undefined4 *)(this + 4); +} + + + +// PConvSingle_F32::UnloadKernel() + +void PConvSingle_F32::UnloadKernel() { + *this = (PConvSingle_F32)0x0; + ReleaseResources(this); + return; +} + + + +// PConvSingle_F32::LoadKernel(float const*, int, int) + +int PConvSingle_F32::LoadKernel(float *param_1,int param_2,int param_3) { + void *__s; + int iVar1; + + if (param_1 == nullptr) { + return 0; + } + if (((1 < param_2) && (1 < param_3)) && ((param_3 - 1U & param_3) == 0)) { + *this = (PConvSingle_F32)0x0; + ReleaseResources(this); + __s = valloc(0x140); + *(void **)(this + 0xc) = __s; + if (__s != nullptr) { + memset(__s,0,0x140); + *(int *)(this + 8) = param_3; + iVar1 = ProcessKernel(this,param_1,param_2,1); + if (iVar1 != 0) { + *this = (PConvSingle_F32)0x1; + return iVar1; + } + } + ReleaseResources(this); + return 0; + } + return 0; +} + + + +// PConvSingle_F32::LoadKernel(float const*, float, int, int) + +int PConvSingle_F32::LoadKernel(float *param_1,float param_2,int param_3,int param_4) { +void *__s; +int iVar1; +float extraout_s0; +uint in_stack_00000000; + +if (param_1 == nullptr) { +return 0; +} +if (((1 < param_4) && (1 < (int)in_stack_00000000)) && +((in_stack_00000000 - 1 & in_stack_00000000) == 0)) { +*this = (PConvSingle_F32)0x0; +ReleaseResources(this); +__s = valloc(0x140); +*(void **)(this + 0xc) = __s; +if (__s != nullptr) { +memset(__s,0,0x140); +*(uint *)(this + 8) = in_stack_00000000; +iVar1 = ProcessKernel(this,param_1,extraout_s0,param_3,param_4); +if (iVar1 != 0) { +*this = (PConvSingle_F32)0x1; +return iVar1; +} +} +ReleaseResources(this); +} +return 0; +} + + + +// PConvSingle_F32::InstanceUsable() + +PConvSingle_F32 PConvSingle_F32::InstanceUsable() { + return *this; +} + + + +// PConvSingle_F32::Convolve(float*) + +void PConvSingle_F32::Convolve(float *param_1) { + ConvSegment(this,param_1,false,0); + return; +} + + + +// PConvSingle_F32::ConvolveInterleaved(float*, int) + +void PConvSingle_F32::ConvolveInterleaved(float *param_1,int param_2) { + ConvSegment(this,param_1,true,param_2); + return; +} diff --git a/src/util/PConvSingle_F32.h b/src/util/PConvSingle_F32.h new file mode 100644 index 0000000..56f3f54 --- /dev/null +++ b/src/util/PConvSingle_F32.h @@ -0,0 +1,38 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_PCONVSINGLE_F32_H +#define VIPER_PCONVSINGLE_F32_H + + +class PConvSingle_F32 { + bool field_0x0; + char field_0x1; + char field_0x2; + char field_0x3; + int field_0x4; + int field_0x8; + void* field_0xc; + +public: + void PConvSingle_F32(); + void ReleaseResources(); + ~PConvSingle_F32(); + undefined4 ProcessKernel(float *param_1,int param_2,int param_3); + undefined4 ProcessKernel(float *param_1,float param_2,int param_3,int param_4); + void ConvSegment(float *param_1,bool param_2,int param_3); + void Reset(); + int GetFFTSize(); + undefined4 GetSegmentSize(); + undefined4 GetSegmentCount(); + void UnloadKernel(); + int LoadKernel(float *param_1,int param_2,int param_3); + int LoadKernel(float *param_1,float param_2,int param_3,int param_4); + PConvSingle_F32 InstanceUsable(); + void Convolve(float *param_1); + void ConvolveInterleaved(float *param_1,int param_2); +}; + + +#endif //VIPER_PCONVSINGLE_F32_H diff --git a/src/util/PassFilter.cpp b/src/util/PassFilter.cpp new file mode 100644 index 0000000..2a6c44d --- /dev/null +++ b/src/util/PassFilter.cpp @@ -0,0 +1,209 @@ +// +// Created by mart on 2/13/21. +// + +#include "PassFilter.h" + +// PassFilter::~PassFilter() + +PassFilter::~PassFilter() { + IIR_NOrder_BW_LH *pIVar1; + + pIVar1 = this->field_0x0; + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar1 = this->field_0x4; + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar1 = this->field_0x8; + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + pIVar1 = this->field_0xc; + if (pIVar1 != nullptr) { + IIR_NOrder_BW_LH::~IIR_NOrder_BW_LH(pIVar1); + operator_delete(pIVar1); + } + return this; +} + + + +// PassFilter::Reset() + +void PassFilter::Reset(void) { + IIR_NOrder_BW_LH **in_r0; + float in_s0; + float in_s1; + undefined8 uVar1; + + uVar1 = CONCAT44(in_s1,in_s0); + if ((*in_r0 != nullptr) && (in_r0[1] != nullptr)) { + if ((int)in_r0[4] < 0xac44) { + FixedToFP(&in_r0[4][-0xd].field_0x4,0x20,0x20,1,0,0); + } + uVar1 = IIR_NOrder_BW_LH::setLPF(*in_r0,in_s0,in_s1); + IIR_NOrder_BW_LH::setLPF(in_r0[1],(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + IIR_NOrder_BW_LH::Mute(*in_r0); + uVar1 = IIR_NOrder_BW_LH::Mute(in_r0[1]); + } + if ((in_r0[2] != nullptr) && (in_r0[3] != nullptr)) { + uVar1 = IIR_NOrder_BW_LH::setHPF(in_r0[2],(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + IIR_NOrder_BW_LH::setHPF(in_r0[3],(float)uVar1,(float)((ulonglong)uVar1 >> 0x20)); + IIR_NOrder_BW_LH::Mute(in_r0[2]); + IIR_NOrder_BW_LH::Mute(in_r0[3]); + return; + } + return; +} + + + +// PassFilter::PassFilter() + +PassFilter::PassFilter() { + IIR_NOrder_BW_LH *pIVar1; + + pIVar1 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar1,3); + this->field_0x0 = pIVar1; + pIVar1 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar1,3); + this->field_0x4 = pIVar1; + pIVar1 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar1,1); + this->field_0x8 = pIVar1; + pIVar1 = (IIR_NOrder_BW_LH *)operator_new(8); + IIR_NOrder_BW_LH::IIR_NOrder_BW_LH(pIVar1,1); + this->field_0xc = pIVar1; + this->samplerate = 0xac44; + Reset(); + return this; +} + + + +// PassFilter::SetSamplingRate(int) + +void PassFilter::SetSamplingRate(int param_1) { + if (this->samplerate == param_1) { + return; + } + this->samplerate = param_1; + Reset(); + return; +} + + + +// PassFilter::ProcessFrames(int*, int) + +void PassFilter::ProcessFrames(int *param_1,int param_2) { + longlong lVar1; + longlong lVar2; + IIR_NOrder_BW_LH *pIVar3; + IIR_NOrder_BW_LH *pIVar4; + IIR_1st *pIVar5; + IIR_NOrder_BW_LH *pIVar6; + IIR_1st *pIVar7; + int iVar8; + IIR_NOrder_BW_LH *pIVar9; + IIR_1st *pIVar10; + int iVar11; + IIR_1st *pIVar12; + int iVar13; + int *piVar14; + IIR_1st *pIVar15; + IIR_1st *pIVar16; + int local_4c; + int *local_48; + int *local_44; + + if ((((0 < param_2) && (pIVar4 = this->field_0x0, pIVar4 != nullptr)) && + (pIVar6 = this->field_0x4, pIVar6 != nullptr)) && + ((pIVar9 = this->field_0x8, pIVar9 != nullptr && (pIVar3 = this->field_0xc, pIVar3 != nullptr)))) { + pIVar12 = pIVar9->field_0x0; + local_44 = param_1 + 2; + pIVar5 = pIVar4->field_0x0; + pIVar7 = pIVar3->field_0x0; + pIVar10 = pIVar6->field_0x0; + local_4c = param_2 + -1; + piVar14 = local_44; + local_48 = param_1; + while( true ) { + iVar8 = piVar14[-2]; + iVar13 = local_48[1]; + if ((pIVar12 != nullptr) && (iVar11 = pIVar9->field_0x4, 0 < iVar11)) { + pIVar16 = pIVar12; + do { + lVar1 = (longlong)iVar8 * (longlong)(int)pIVar16->field_0x4 + 0x1000000; + pIVar15 = pIVar16 + 1; + lVar2 = (longlong)iVar8 * (longlong)(int)pIVar16->field_0x8 + 0x1000000; + iVar8 = pIVar16->field_0xc + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar8 * (longlong)(int)pIVar16->field_0x0 + 0x1000000; + pIVar16->field_0xc = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + pIVar16 = pIVar15; + } while (pIVar15 != pIVar12 + iVar11); + } + if ((pIVar5 != nullptr) && (iVar11 = pIVar4->field_0x4, 0 < iVar11)) { + pIVar16 = pIVar5; + do { + pIVar15 = pIVar16 + 1; + lVar1 = (longlong)iVar8 * (longlong)(int)pIVar16->field_0x4 + 0x1000000; + lVar2 = (longlong)iVar8 * (longlong)(int)pIVar16->field_0x8 + 0x1000000; + iVar8 = pIVar16->field_0xc + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + lVar1 = (longlong)iVar8 * (longlong)(int)pIVar16->field_0x0 + 0x1000000; + pIVar16->field_0xc = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + pIVar16 = pIVar15; + } while (pIVar15 != pIVar5 + iVar11); + } + if ((pIVar7 != nullptr) && (iVar11 = pIVar3->field_0x4, 0 < iVar11)) { + pIVar16 = pIVar7; + do { + pIVar15 = pIVar16 + 1; + lVar1 = (longlong)iVar13 * (longlong)(int)pIVar16->field_0x4 + 0x1000000; + lVar2 = (longlong)iVar13 * (longlong)(int)pIVar16->field_0x8 + 0x1000000; + iVar13 = pIVar16->field_0xc + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + ; + lVar1 = (longlong)iVar13 * (longlong)(int)pIVar16->field_0x0 + 0x1000000; + pIVar16->field_0xc = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + pIVar16 = pIVar15; + } while (pIVar15 != pIVar7 + iVar11); + } + if ((pIVar10 != nullptr) && (iVar11 = pIVar6->field_0x4, 0 < iVar11)) { + pIVar16 = pIVar10; + do { + pIVar15 = pIVar16 + 1; + lVar1 = (longlong)iVar13 * (longlong)(int)pIVar16->field_0x4 + 0x1000000; + lVar2 = (longlong)iVar13 * (longlong)(int)pIVar16->field_0x8 + 0x1000000; + iVar13 = pIVar16->field_0xc + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + ; + lVar1 = (longlong)iVar13 * (longlong)(int)pIVar16->field_0x0 + 0x1000000; + pIVar16->field_0xc = + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7) + + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + pIVar16 = pIVar15; + } while (pIVar15 != pIVar10 + iVar11); + } + local_4c = local_4c + -1; + piVar14[-2] = iVar8; + local_48[1] = iVar13; + local_48 = local_44; + if (local_4c == -1) break; + local_44 = local_44 + 2; + piVar14 = piVar14 + 2; + } + } + return; +} diff --git a/src/util/PassFilter.h b/src/util/PassFilter.h new file mode 100644 index 0000000..5c4d6e9 --- /dev/null +++ b/src/util/PassFilter.h @@ -0,0 +1,25 @@ +// +// Created by mart on 2/13/21. +// + +#ifndef VIPER_PASSFILTER_H +#define VIPER_PASSFILTER_H + + +class PassFilter { + struct IIR_NOrder_BW_LH * field_0x0; + struct IIR_NOrder_BW_LH * field_0x4; + struct IIR_NOrder_BW_LH * field_0x8; + struct IIR_NOrder_BW_LH * field_0xc; + undefined4 samplerate; + +public: + ~PassFilter(); + void Reset(); + PassFilter(); + void SetSamplingRate(int param_1); + void ProcessFrames(int *param_1,int param_2); +}; + + +#endif //VIPER_PASSFILTER_H diff --git a/src/util/PolesFilter.cpp b/src/util/PolesFilter.cpp new file mode 100644 index 0000000..2ebe29d --- /dev/null +++ b/src/util/PolesFilter.cpp @@ -0,0 +1,216 @@ +// +// Created by mart on 2/12/21. +// + +#include "PolesFilter.h" + +// PolesFilter::UpdateCoeff() + +void PolesFilter::UpdateCoeff() { + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr10; + undefined4 in_cr11; + undefined4 uVar1; + undefined4 uVar2; + double unaff_d8; + double dVar3; + undefined4 in_d17; + + memset(this,0,0x34); + memset(&this->field_0x34,0,0x34); + coprocessor_function(0xb,6,4,in_cr1,in_cr0,in_cr10); + sin(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1,in_d17) + (double)CONCAT44(extraout_r1,in_d17); + uVar1 = SUB84(ROUND(dVar3 * 33554432.0 + 0.5),0); + this->field_0x0 = uVar1; + coprocessor_function(0xb,6,0,in_cr0,in_cr11,in_cr10); + uVar2 = SUB84(dVar3,0); + sin(unaff_d8); + this->field_0x34 = uVar1; + uVar2 = SUB84(ROUND(((double)CONCAT44(extraout_r1_00,uVar2) + + (double)CONCAT44(extraout_r1_00,uVar2)) * 33554432.0 + 0.5),0); + this->field_0x4 = uVar2; + this->field_0x38 = uVar2; + return; +} + + + +// PolesFilter::PolesFilter() + +PolesFilter::PolesFilter() { + this->samplerate = 0xac44; + this->field_0x68 = 0xa0; + this->field_0x6c = 8000; + UpdateCoeff(this); + return this; +} + + + +// PolesFilter::DoFilterLeft(int, int*, int*, int*) + +void PolesFilter::DoFilterLeft(int param_1,int *param_2,int *param_3,int *param_4) { + longlong lVar1; + longlong lVar2; + int iVar3; + undefined4 uVar4; + int iVar5; + undefined4 uVar6; + int iVar7; + int iVar8; + + iVar7 = *(int *)&this->field_0x10; + iVar8 = this->field_0x4; + lVar1 = (longlong)iVar8 * (longlong)(param_1 - *(int *)&this->field_0x24) + 0x1000000; + lVar2 = (longlong)(int)this->field_0x0 * (longlong)(param_1 - *(int *)&this->field_0x14) + + 0x1000000; + uVar6 = *(undefined4 *)&this->field_0x8; + *(int *)&this->field_0x8 = param_1; + uVar4 = *(undefined4 *)&this->field_0xc; + *(undefined4 *)&this->field_0xc = uVar6; + iVar5 = *(int *)&this->field_0x24 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(undefined4 *)&this->field_0x10 = uVar4; + *(int *)&this->field_0x24 = iVar5; + iVar3 = *(int *)&this->field_0x14 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + lVar1 = (longlong)iVar8 * (longlong)(iVar5 - *(int *)&this->field_0x28) + 0x1000000; + *(int *)&this->field_0x14 = iVar3; + lVar2 = (longlong)(int)this->field_0x0 * (longlong)(iVar3 - *(int *)&this->field_0x18) + 0x1000000 + ; + iVar3 = *(int *)&this->field_0x28 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(int *)&this->field_0x28 = iVar3; + lVar1 = (longlong)iVar8 * (longlong)(iVar3 - *(int *)&this->field_0x2c) + 0x1000000; + iVar3 = *(int *)&this->field_0x18 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + lVar2 = (longlong)(int)this->field_0x0 * (longlong)(iVar3 - *(int *)&this->field_0x1c) + 0x1000000 + ; + *(int *)&this->field_0x18 = iVar3; + iVar3 = *(int *)&this->field_0x2c + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(int *)&this->field_0x2c = iVar3; + lVar1 = (longlong)iVar8 * (longlong)(iVar3 - *(int *)&this->field_0x30) + 0x1000000; + iVar3 = *(int *)&this->field_0x1c + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + *(int *)&this->field_0x1c = iVar3; + lVar2 = (longlong)(int)this->field_0x0 * (longlong)(iVar3 - *(int *)&this->field_0x20) + 0x1000000 + ; + iVar3 = *(int *)&this->field_0x30 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(int *)&this->field_0x30 = iVar3; + iVar3 = iVar7 - iVar3; + iVar5 = *(int *)&this->field_0x20 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + *(int *)&this->field_0x20 = iVar5; + *param_2 = iVar5; + *param_3 = iVar3; + *param_4 = iVar7 - (iVar5 + iVar3); + return; +} + + + +// PolesFilter::DoFilterRight(int, int*, int*, int*) + +void PolesFilter::DoFilterRight(int param_1,int *param_2,int *param_3,int *param_4) { + longlong lVar1; + longlong lVar2; + int iVar3; + undefined4 uVar4; + int iVar5; + undefined4 uVar6; + int iVar7; + int iVar8; + + iVar7 = *(int *)&this->field_0x44; + iVar8 = this->field_0x38; + lVar1 = (longlong)iVar8 * (longlong)(param_1 - *(int *)&this->field_0x58) + 0x1000000; + lVar2 = (longlong)(int)this->field_0x34 * (longlong)(param_1 - *(int *)&this->field_0x48) + + 0x1000000; + uVar6 = *(undefined4 *)&this->field_0x3c; + *(int *)&this->field_0x3c = param_1; + uVar4 = *(undefined4 *)&this->field_0x40; + *(undefined4 *)&this->field_0x40 = uVar6; + iVar5 = *(int *)&this->field_0x58 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(undefined4 *)&this->field_0x44 = uVar4; + *(int *)&this->field_0x58 = iVar5; + iVar3 = *(int *)&this->field_0x48 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + lVar1 = (longlong)iVar8 * (longlong)(iVar5 - *(int *)&this->field_0x5c) + 0x1000000; + *(int *)&this->field_0x48 = iVar3; + lVar2 = (longlong)(int)this->field_0x34 * (longlong)(iVar3 - *(int *)&this->field_0x4c) + + 0x1000000; + iVar3 = *(int *)&this->field_0x5c + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(int *)&this->field_0x5c = iVar3; + lVar1 = (longlong)iVar8 * (longlong)(iVar3 - *(int *)&this->field_0x60) + 0x1000000; + iVar3 = *(int *)&this->field_0x4c + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + lVar2 = (longlong)(int)this->field_0x34 * (longlong)(iVar3 - *(int *)&this->field_0x50) + + 0x1000000; + *(int *)&this->field_0x4c = iVar3; + iVar3 = *(int *)&this->field_0x60 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(int *)&this->field_0x60 = iVar3; + lVar1 = (longlong)iVar8 * (longlong)(iVar3 - *(int *)&this->field_0x64) + 0x1000000; + iVar3 = *(int *)&this->field_0x50 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + *(int *)&this->field_0x50 = iVar3; + lVar2 = (longlong)(int)this->field_0x34 * (longlong)(iVar3 - *(int *)&this->field_0x54) + + 0x1000000; + iVar3 = *(int *)&this->field_0x64 + ((uint)lVar1 >> 0x19 | (int)((ulonglong)lVar1 >> 0x20) << 7); + *(int *)&this->field_0x64 = iVar3; + iVar3 = iVar7 - iVar3; + iVar5 = *(int *)&this->field_0x54 + ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7); + *(int *)&this->field_0x54 = iVar5; + *param_2 = iVar5; + *param_3 = iVar3; + *param_4 = iVar7 - (iVar5 + iVar3); + return; +} + + + +// PolesFilter::SetSamplingRate(int) + +void PolesFilter::SetSamplingRate(int param_1) { + this->samplerate = param_1; + UpdateCoeff(this); + return; +} + + + +// PolesFilter::SetPassFilter(int, int) + +void PolesFilter::SetPassFilter(int param_1,int param_2) { + this->field_0x68 = param_1; + this->field_0x6c = param_2; + UpdateCoeff(this); + return; +} + + + +void PolesFilter::~ZN11PolesFilter5ResetEv() { + undefined4 extraout_r1; + undefined4 extraout_r1_00; + undefined4 in_cr0; + undefined4 in_cr1; + undefined4 in_cr10; + undefined4 in_cr11; + undefined4 uVar1; + undefined4 uVar2; + double unaff_d8; + double dVar3; + undefined4 in_d17; + + memset(this,0,0x34); + memset(&this->field_0x34,0,0x34); + coprocessor_function(0xb,6,4,in_cr1,in_cr0,in_cr10); + sin(unaff_d8); + dVar3 = (double)CONCAT44(extraout_r1,in_d17) + (double)CONCAT44(extraout_r1,in_d17); + uVar1 = SUB84(ROUND(dVar3 * 33554432.0 + 0.5),0); + this->field_0x0 = uVar1; + coprocessor_function(0xb,6,0,in_cr0,in_cr11,in_cr10); + uVar2 = SUB84(dVar3,0); + sin(unaff_d8); + this->field_0x34 = uVar1; + uVar2 = SUB84(ROUND(((double)CONCAT44(extraout_r1_00,uVar2) + + (double)CONCAT44(extraout_r1_00,uVar2)) * 33554432.0 + 0.5),0); + this->field_0x4 = uVar2; + this->field_0x38 = uVar2; + return; +} diff --git a/src/util/PolesFilter.h b/src/util/PolesFilter.h new file mode 100644 index 0000000..92e6281 --- /dev/null +++ b/src/util/PolesFilter.h @@ -0,0 +1,117 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_POLESFILTER_H +#define VIPER_POLESFILTER_H + + +class PolesFilter { + undefined4 field_0x0; + undefined4 field_0x4; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined4 field_0x34; + undefined4 field_0x38; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined field_0x60; + undefined field_0x61; + undefined field_0x62; + undefined field_0x63; + undefined field_0x64; + undefined field_0x65; + undefined field_0x66; + undefined field_0x67; + undefined4 field_0x68; + undefined4 field_0x6c; + undefined4 samplerate; + +public: + void UpdateCoeff(); + PolesFilter(); + void DoFilterLeft(int param_1,int *param_2,int *param_3,int *param_4); + void DoFilterRight(int param_1,int *param_2,int *param_3,int *param_4); + void SetSamplingRate(int param_1); + void SetPassFilter(int param_1,int param_2); + void ~ZN11PolesFilter5ResetEv(); +}; + + +#endif //VIPER_POLESFILTER_H diff --git a/src/util/Polyphase.cpp b/src/util/Polyphase.cpp new file mode 100644 index 0000000..d9ae141 --- /dev/null +++ b/src/util/Polyphase.cpp @@ -0,0 +1,160 @@ +// +// Created by mart on 2/12/21. +// + +#include "Polyphase.h" + +// Polyphase::Polyphase(int) + +Polyphase::Polyphase(int param_1) { + FIR *pFVar1; + WaveBuffer_I32 *pWVar2; + void *pvVar3; + int iVar4; + int *piVar5; + + *(undefined4 *)(this + 0x18) = 0xac44; + *(undefined4 *)this = 0; + *(undefined4 *)(this + 4) = 0; + *(undefined4 *)(this + 8) = 0; + *(undefined4 *)(this + 0xc) = 0; + *(undefined4 *)(this + 0x10) = 0; + this[0x14] = (Polyphase)0x0; + if (param_1 - 1U < 2) { + pFVar1 = (FIR *)operator_new(0x60); + FIR::FIR(pFVar1); + *(FIR **)this = pFVar1; + pFVar1 = (FIR *)operator_new(0x60); + FIR::FIR(pFVar1); + *(FIR **)(this + 4) = pFVar1; + pWVar2 = (WaveBuffer_I32 *)operator_new(0x20); + WaveBuffer_I32::WaveBuffer_I32(pWVar2,2,0x1000); + *(WaveBuffer_I32 **)(this + 8) = pWVar2; + pWVar2 = (WaveBuffer_I32 *)operator_new(0x20); + WaveBuffer_I32::WaveBuffer_I32(pWVar2,2,0x1000); + *(WaveBuffer_I32 **)(this + 0xc) = pWVar2; + pvVar3 = valloc(0x1f80); + pFVar1 = *(FIR **)this; + *(void **)(this + 0x10) = pvVar3; + if ((((pFVar1 != nullptr) && (*(int *)(this + 4) != 0)) && (*(int *)(this + 8) != 0)) && + ((*(int *)(this + 0xc) != 0 && (pvVar3 != nullptr)))) { + if (param_1 == 2) { + piVar5 = (int *)&DAT_000cea28; + iVar4 = FIR::LoadCoefficients(pFVar1,(int *)&DAT_000cea28,0x3f,0x3f0); + } + else { + piVar5 = (int *)&DAT_000ce92c; + iVar4 = FIR::LoadCoefficients(pFVar1,(int *)&DAT_000ce92c,0x3f,0x3f0); + } + if ((iVar4 != 0) && + (iVar4 = FIR::LoadCoefficients(*(FIR **)(this + 4),piVar5,0x3f,0x3f0), iVar4 != 0)) { + this[0x14] = (Polyphase)0x1; + } + } + } + return this; +} + + + +// Polyphase::~Polyphase() + +Polyphase::~Polyphase() { + FIR *pFVar1; + WaveBuffer_I32 *pWVar2; + + pFVar1 = *(FIR **)this; + if (pFVar1 != nullptr) { + FIR::~FIR(pFVar1); + operator_delete(pFVar1); + } + pFVar1 = *(FIR **)(this + 4); + if (pFVar1 != nullptr) { + FIR::~FIR(pFVar1); + operator_delete(pFVar1); + } + pWVar2 = *(WaveBuffer_I32 **)(this + 8); + if (pWVar2 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(pWVar2); + operator_delete(pWVar2); + } + pWVar2 = *(WaveBuffer_I32 **)(this + 0xc); + if (pWVar2 != nullptr) { + WaveBuffer_I32::~WaveBuffer_I32(pWVar2); + operator_delete(pWVar2); + } + if (*(void **)(this + 0x10) != nullptr) { + free(*(void **)(this + 0x10)); + } + return this; +} + + + +// Polyphase::GetLatency() + +undefined4 Polyphase::GetLatency(void) { + return 0x3f; +} + + + +// Polyphase::Reset() + +void Polyphase::Reset() { + if (*(FIR **)this != nullptr) { + FIR::Reset(*(FIR **)this); + } + if (*(FIR **)(this + 4) != nullptr) { + FIR::Reset(*(FIR **)(this + 4)); + } + if (*(WaveBuffer_I32 **)(this + 8) != nullptr) { + WaveBuffer_I32::Reset(*(WaveBuffer_I32 **)(this + 8)); + } + if (*(WaveBuffer_I32 **)(this + 0xc) == nullptr) { + return; + } + WaveBuffer_I32::Reset(*(WaveBuffer_I32 **)(this + 0xc)); + return; +} + + + +// Polyphase::SetSamplingRate(int) + +void Polyphase::SetSamplingRate(int param_1) { + if (*(int *)(this + 0x18) != param_1) { + *(int *)(this + 0x18) = param_1; + } + return; +} + + + +// Polyphase::Process(int*, int) + +int Polyphase::Process(int *param_1,int param_2) { + int iVar1; + uint uVar2; + + if ((this[0x14] != (Polyphase)0x0) && + (iVar1 = WaveBuffer_I32::PushSamples(*(WaveBuffer_I32 **)(this + 8),param_1,param_2), + iVar1 != 0)) { + while (uVar2 = WaveBuffer_I32::GetBufferOffset(), 0x3ef < uVar2) { + iVar1 = WaveBuffer_I32::PopSamples + (*(WaveBuffer_I32 **)(this + 8),*(int **)(this + 0x10),0x3f0,false); + if (iVar1 == 0x3f0) { + FIR::FilterSamplesInterleaved(*(FIR **)this,*(int **)(this + 0x10),0x3f0,2); + FIR::FilterSamplesInterleaved + (*(FIR **)(this + 4),(int *)(*(int *)(this + 0x10) + 4),0x3f0,2); + WaveBuffer_I32::PushSamples(*(WaveBuffer_I32 **)(this + 0xc),*(int **)(this + 0x10),0x3f0); + } + } + uVar2 = WaveBuffer_I32::GetBufferOffset(); + if (uVar2 < (uint)param_2) { + return 0; + } + WaveBuffer_I32::PopSamples(*(WaveBuffer_I32 **)(this + 0xc),param_1,param_2,true); + } + return param_2; +} diff --git a/src/util/Polyphase.h b/src/util/Polyphase.h new file mode 100644 index 0000000..b110f57 --- /dev/null +++ b/src/util/Polyphase.h @@ -0,0 +1,31 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_POLYPHASE_H +#define VIPER_POLYPHASE_H + + +class Polyphase { + struct FIR* field_0x0; + struct FIR* field_0x4; + struct WaveBuffer_I32* field_0x8; + struct WaveBuffer_I32* field_0xc; + void* field_0x10; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined4 field_0x18; + +public: + Polyphase(int param_1); + ~Polyphase(); + undefined4 GetLatency(); + void Reset(); + void SetSamplingRate(int param_1); + int Process(int *param_1,int param_2); +}; + + +#endif //VIPER_POLYPHASE_H diff --git a/src/util/SoftwareLimiter.cpp b/src/util/SoftwareLimiter.cpp new file mode 100644 index 0000000..a52d5db --- /dev/null +++ b/src/util/SoftwareLimiter.cpp @@ -0,0 +1,162 @@ +// +// Created by mart on 2/12/21. +// + +#include "SoftwareLimiter.h" + +// SoftwareLimiter::SetGate(float) + +void SoftwareLimiter::SetGate(float param_1) { + float in_r1; + + *(float *)&this->field_0x10 = ROUND(in_r1 * 3.355443e+07 + 0.5); + return; +} + + + +// SoftwareLimiter::Process(int) + +uint SoftwareLimiter::Process(int param_1) { + char cVar1; + longlong lVar2; + longlong lVar3; + longlong lVar4; + int iVar5; + undefined4 *puVar6; + uint in_r1; + uint uVar7; + int iVar8; + uint uVar9; + uint uVar10; + int iVar11; + uint uVar12; + uint *puVar13; + + uVar12 = *(uint *)(param_1 + 0x10); + uVar7 = (in_r1 ^ (int)in_r1 >> 0x1f) - ((int)in_r1 >> 0x1f); + uVar9 = (uint)*(byte *)(param_1 + 0xc24); + if ((int)uVar12 < (int)uVar7) { + if (uVar9 == 0) { + puVar6 = (undefined4 *)(param_1 + 0x41c); + do { + uVar9 = uVar9 + 1; + puVar6 = puVar6 + 1; + *puVar6 = 0; + } while (uVar9 != 0x200); + } + *(undefined *)(param_1 + 0xc24) = 1; + LAB_000677d8: + uVar12 = 8; + uVar9 = *(uint *)(param_1 + 0xc20); + do { + uVar10 = uVar9 ^ 1; + puVar13 = (uint *)(param_1 + 0xc20) + -(2 << (uVar12 & 0xff)); + puVar13[uVar9] = uVar7; + uVar9 = (int)uVar9 >> 1; + uVar10 = puVar13[uVar10]; + if ((int)uVar7 < (int)uVar10) { + uVar7 = uVar10; + } + uVar12 = uVar12 - 1; + } while (uVar12 != 0); + uVar12 = *(uint *)(param_1 + 0x10); + if ((int)uVar12 < (int)uVar7) { + cVar1 = *(char *)(param_1 + 0xc24); + iVar5 = *(int *)(param_1 + 0x14); + uVar9 = *(int *)(param_1 + 0xc20) + 1U & 0xff; + *(uint *)(param_1 + (*(int *)(param_1 + 0xc20) + 8) * 4) = in_r1; + *(uint *)(param_1 + 0xc20) = uVar9; + uVar9 = *(uint *)(param_1 + (uVar9 + 8) * 4); + if (cVar1 != '\0') { + iVar5 = __aeabi_ldivmod(uVar12 << 0x19,((int)uVar12 >> 0x1f) << 0x19 | uVar12 >> 7,uVar7, + (int)uVar7 >> 0x1f); + } + goto LAB_00067898; + } + *(undefined *)(param_1 + 0xc24) = 0; + } + else { + if (uVar9 != 0) goto LAB_000677d8; + } + iVar5 = *(int *)(param_1 + 0x14); + uVar7 = *(int *)(param_1 + 0xc20) + 1U & 0xff; + *(uint *)(param_1 + (*(int *)(param_1 + 0xc20) + 8) * 4) = in_r1; + *(uint *)(param_1 + 0xc20) = uVar7; + uVar9 = *(uint *)(param_1 + (uVar7 + 8) * 4); + LAB_00067898: + lVar2 = (longlong)*(int *)param_1 * (longlong)*(int *)(param_1 + 0x1c) + 0x1000000; + lVar3 = (longlong)*(int *)(param_1 + 4) * (longlong)iVar5 + 0x1000000; + lVar4 = (longlong)*(int *)(param_1 + 0xc) * (longlong)*(int *)(param_1 + 0x18) + 0x1000000; + iVar11 = ((uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7) + + ((uint)lVar3 >> 0x19 | (int)((ulonglong)lVar3 >> 0x20) << 7); + *(int *)(param_1 + 0x1c) = iVar11; + iVar8 = *(int *)(param_1 + 8) + ((uint)lVar4 >> 0x19 | (int)((ulonglong)lVar4 >> 0x20) << 7); + iVar5 = iVar11; + if (iVar8 <= iVar11) { + *(int *)(param_1 + 0x18) = iVar8; + iVar5 = iVar8; + } + lVar2 = (longlong)(int)uVar9 * (longlong)iVar5 + 0x1000000; + if (iVar11 < iVar8) { + *(int *)(param_1 + 0x18) = iVar11; + } + uVar7 = (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; + if ((int)((uVar7 ^ (int)uVar7 >> 0x1f) - ((int)uVar7 >> 0x1f)) <= (int)uVar12) { + return uVar7; + } + iVar5 = (uVar9 ^ (int)uVar9 >> 0x1f) - ((int)uVar9 >> 0x1f); + iVar5 = __aeabi_ldivmod(uVar12 << 0x19,((int)uVar12 >> 0x1f) << 0x19 | uVar12 >> 7,iVar5, + iVar5 >> 0x1f); + lVar2 = (longlong)(int)uVar9 * (longlong)iVar5 + 0x1000000; + *(int *)(param_1 + 0x18) = iVar5; + return (uint)lVar2 >> 0x19 | (int)((ulonglong)lVar2 >> 0x20) << 7; +} + + + +// SoftwareLimiter::ResetLimiter() + +void SoftwareLimiter::ResetLimiter() { + undefined4 *puVar1; + int iVar2; + + iVar2 = 0x100; + puVar1 = (undefined4 *)&this->field_0x1c; + do { + iVar2 = iVar2 + -1; + puVar1 = puVar1 + 1; + *puVar1 = 0; + } while (iVar2 != 0); + puVar1 = (undefined4 *)&this->field_0x41c; + iVar2 = 0x200; + do { + iVar2 = iVar2 + -1; + puVar1 = puVar1 + 1; + *puVar1 = 0; + } while (iVar2 != 0); + *(undefined *)&this->field_0xc24 = 0; + *(undefined4 *)&this->field_0xc20 = 0; + *(undefined4 *)&this->field_0x18 = 0x2000000; + *(undefined4 *)&this->field_0x1c = 0x2000000; + return; +} + + + +// SoftwareLimiter::SoftwareLimiter() + +SoftwareLimiter::SoftwareLimiter() { + *(undefined4 *)this = 0x1ccbfb2; + *(undefined4 *)&this->field_0x4 = 0x332618; + *(undefined4 *)&this->field_0x8 = 0xd1c; + *(undefined4 *)&this->field_0xc = 0x1fff2e5; + *(undefined4 *)&this->field_0x10 = 0x1ffffff; + *(undefined *)&this->field_0xc24 = 0; + *(undefined4 *)&this->field_0xc20 = 0; + *(undefined4 *)&this->field_0x18 = 0x2000000; + *(undefined4 *)&this->field_0x1c = 0x2000000; + *(undefined4 *)&this->field_0x14 = 0x2000000; + ResetLimiter(this); + return this; +} diff --git a/src/util/SoftwareLimiter.h b/src/util/SoftwareLimiter.h new file mode 100644 index 0000000..166658c --- /dev/null +++ b/src/util/SoftwareLimiter.h @@ -0,0 +1,3131 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_SOFTWARELIMITER_H +#define VIPER_SOFTWARELIMITER_H + + +class SoftwareLimiter { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + undefined field_0x20; + undefined field_0x21; + undefined field_0x22; + undefined field_0x23; + undefined field_0x24; + undefined field_0x25; + undefined field_0x26; + undefined field_0x27; + undefined field_0x28; + undefined field_0x29; + undefined field_0x2a; + undefined field_0x2b; + undefined field_0x2c; + undefined field_0x2d; + undefined field_0x2e; + undefined field_0x2f; + undefined field_0x30; + undefined field_0x31; + undefined field_0x32; + undefined field_0x33; + undefined field_0x34; + undefined field_0x35; + undefined field_0x36; + undefined field_0x37; + undefined field_0x38; + undefined field_0x39; + undefined field_0x3a; + undefined field_0x3b; + undefined field_0x3c; + undefined field_0x3d; + undefined field_0x3e; + undefined field_0x3f; + undefined field_0x40; + undefined field_0x41; + undefined field_0x42; + undefined field_0x43; + undefined field_0x44; + undefined field_0x45; + undefined field_0x46; + undefined field_0x47; + undefined field_0x48; + undefined field_0x49; + undefined field_0x4a; + undefined field_0x4b; + undefined field_0x4c; + undefined field_0x4d; + undefined field_0x4e; + undefined field_0x4f; + undefined field_0x50; + undefined field_0x51; + undefined field_0x52; + undefined field_0x53; + undefined field_0x54; + undefined field_0x55; + undefined field_0x56; + undefined field_0x57; + undefined field_0x58; + undefined field_0x59; + undefined field_0x5a; + undefined field_0x5b; + undefined field_0x5c; + undefined field_0x5d; + undefined field_0x5e; + undefined field_0x5f; + undefined field_0x60; + undefined field_0x61; + undefined field_0x62; + undefined field_0x63; + undefined field_0x64; + undefined field_0x65; + undefined field_0x66; + undefined field_0x67; + undefined field_0x68; + undefined field_0x69; + undefined field_0x6a; + undefined field_0x6b; + undefined field_0x6c; + undefined field_0x6d; + undefined field_0x6e; + undefined field_0x6f; + undefined field_0x70; + undefined field_0x71; + undefined field_0x72; + undefined field_0x73; + undefined field_0x74; + undefined field_0x75; + undefined field_0x76; + undefined field_0x77; + undefined field_0x78; + undefined field_0x79; + undefined field_0x7a; + undefined field_0x7b; + undefined field_0x7c; + undefined field_0x7d; + undefined field_0x7e; + undefined field_0x7f; + undefined field_0x80; + undefined field_0x81; + undefined field_0x82; + undefined field_0x83; + undefined field_0x84; + undefined field_0x85; + undefined field_0x86; + undefined field_0x87; + undefined field_0x88; + undefined field_0x89; + undefined field_0x8a; + undefined field_0x8b; + undefined field_0x8c; + undefined field_0x8d; + undefined field_0x8e; + undefined field_0x8f; + undefined field_0x90; + undefined field_0x91; + undefined field_0x92; + undefined field_0x93; + undefined field_0x94; + undefined field_0x95; + undefined field_0x96; + undefined field_0x97; + undefined field_0x98; + undefined field_0x99; + undefined field_0x9a; + undefined field_0x9b; + undefined field_0x9c; + undefined field_0x9d; + undefined field_0x9e; + undefined field_0x9f; + undefined field_0xa0; + undefined field_0xa1; + undefined field_0xa2; + undefined field_0xa3; + undefined field_0xa4; + undefined field_0xa5; + undefined field_0xa6; + undefined field_0xa7; + undefined field_0xa8; + undefined field_0xa9; + undefined field_0xaa; + undefined field_0xab; + undefined field_0xac; + undefined field_0xad; + undefined field_0xae; + undefined field_0xaf; + undefined field_0xb0; + undefined field_0xb1; + undefined field_0xb2; + undefined field_0xb3; + undefined field_0xb4; + undefined field_0xb5; + undefined field_0xb6; + undefined field_0xb7; + undefined field_0xb8; + undefined field_0xb9; + undefined field_0xba; + undefined field_0xbb; + undefined field_0xbc; + undefined field_0xbd; + undefined field_0xbe; + undefined field_0xbf; + undefined field_0xc0; + undefined field_0xc1; + undefined field_0xc2; + undefined field_0xc3; + undefined field_0xc4; + undefined field_0xc5; + undefined field_0xc6; + undefined field_0xc7; + undefined field_0xc8; + undefined field_0xc9; + undefined field_0xca; + undefined field_0xcb; + undefined field_0xcc; + undefined field_0xcd; + undefined field_0xce; + undefined field_0xcf; + undefined field_0xd0; + undefined field_0xd1; + undefined field_0xd2; + undefined field_0xd3; + undefined field_0xd4; + undefined field_0xd5; + undefined field_0xd6; + undefined field_0xd7; + undefined field_0xd8; + undefined field_0xd9; + undefined field_0xda; + undefined field_0xdb; + undefined field_0xdc; + undefined field_0xdd; + undefined field_0xde; + undefined field_0xdf; + undefined field_0xe0; + undefined field_0xe1; + undefined field_0xe2; + undefined field_0xe3; + undefined field_0xe4; + undefined field_0xe5; + undefined field_0xe6; + undefined field_0xe7; + undefined field_0xe8; + undefined field_0xe9; + undefined field_0xea; + undefined field_0xeb; + undefined field_0xec; + undefined field_0xed; + undefined field_0xee; + undefined field_0xef; + undefined field_0xf0; + undefined field_0xf1; + undefined field_0xf2; + undefined field_0xf3; + undefined field_0xf4; + undefined field_0xf5; + undefined field_0xf6; + undefined field_0xf7; + undefined field_0xf8; + undefined field_0xf9; + undefined field_0xfa; + undefined field_0xfb; + undefined field_0xfc; + undefined field_0xfd; + undefined field_0xfe; + undefined field_0xff; + undefined field_0x100; + undefined field_0x101; + undefined field_0x102; + undefined field_0x103; + undefined field_0x104; + undefined field_0x105; + undefined field_0x106; + undefined field_0x107; + undefined field_0x108; + undefined field_0x109; + undefined field_0x10a; + undefined field_0x10b; + undefined field_0x10c; + undefined field_0x10d; + undefined field_0x10e; + undefined field_0x10f; + undefined field_0x110; + undefined field_0x111; + undefined field_0x112; + undefined field_0x113; + undefined field_0x114; + undefined field_0x115; + undefined field_0x116; + undefined field_0x117; + undefined field_0x118; + undefined field_0x119; + undefined field_0x11a; + undefined field_0x11b; + undefined field_0x11c; + undefined field_0x11d; + undefined field_0x11e; + undefined field_0x11f; + undefined field_0x120; + undefined field_0x121; + undefined field_0x122; + undefined field_0x123; + undefined field_0x124; + undefined field_0x125; + undefined field_0x126; + undefined field_0x127; + undefined field_0x128; + undefined field_0x129; + undefined field_0x12a; + undefined field_0x12b; + undefined field_0x12c; + undefined field_0x12d; + undefined field_0x12e; + undefined field_0x12f; + undefined field_0x130; + undefined field_0x131; + undefined field_0x132; + undefined field_0x133; + undefined field_0x134; + undefined field_0x135; + undefined field_0x136; + undefined field_0x137; + undefined field_0x138; + undefined field_0x139; + undefined field_0x13a; + undefined field_0x13b; + undefined field_0x13c; + undefined field_0x13d; + undefined field_0x13e; + undefined field_0x13f; + undefined field_0x140; + undefined field_0x141; + undefined field_0x142; + undefined field_0x143; + undefined field_0x144; + undefined field_0x145; + undefined field_0x146; + undefined field_0x147; + undefined field_0x148; + undefined field_0x149; + undefined field_0x14a; + undefined field_0x14b; + undefined field_0x14c; + undefined field_0x14d; + undefined field_0x14e; + undefined field_0x14f; + undefined field_0x150; + undefined field_0x151; + undefined field_0x152; + undefined field_0x153; + undefined field_0x154; + undefined field_0x155; + undefined field_0x156; + undefined field_0x157; + undefined field_0x158; + undefined field_0x159; + undefined field_0x15a; + undefined field_0x15b; + undefined field_0x15c; + undefined field_0x15d; + undefined field_0x15e; + undefined field_0x15f; + undefined field_0x160; + undefined field_0x161; + undefined field_0x162; + undefined field_0x163; + undefined field_0x164; + undefined field_0x165; + undefined field_0x166; + undefined field_0x167; + undefined field_0x168; + undefined field_0x169; + undefined field_0x16a; + undefined field_0x16b; + undefined field_0x16c; + undefined field_0x16d; + undefined field_0x16e; + undefined field_0x16f; + undefined field_0x170; + undefined field_0x171; + undefined field_0x172; + undefined field_0x173; + undefined field_0x174; + undefined field_0x175; + undefined field_0x176; + undefined field_0x177; + undefined field_0x178; + undefined field_0x179; + undefined field_0x17a; + undefined field_0x17b; + undefined field_0x17c; + undefined field_0x17d; + undefined field_0x17e; + undefined field_0x17f; + undefined field_0x180; + undefined field_0x181; + undefined field_0x182; + undefined field_0x183; + undefined field_0x184; + undefined field_0x185; + undefined field_0x186; + undefined field_0x187; + undefined field_0x188; + undefined field_0x189; + undefined field_0x18a; + undefined field_0x18b; + undefined field_0x18c; + undefined field_0x18d; + undefined field_0x18e; + undefined field_0x18f; + undefined field_0x190; + undefined field_0x191; + undefined field_0x192; + undefined field_0x193; + undefined field_0x194; + undefined field_0x195; + undefined field_0x196; + undefined field_0x197; + undefined field_0x198; + undefined field_0x199; + undefined field_0x19a; + undefined field_0x19b; + undefined field_0x19c; + undefined field_0x19d; + undefined field_0x19e; + undefined field_0x19f; + undefined field_0x1a0; + undefined field_0x1a1; + undefined field_0x1a2; + undefined field_0x1a3; + undefined field_0x1a4; + undefined field_0x1a5; + undefined field_0x1a6; + undefined field_0x1a7; + undefined field_0x1a8; + undefined field_0x1a9; + undefined field_0x1aa; + undefined field_0x1ab; + undefined field_0x1ac; + undefined field_0x1ad; + undefined field_0x1ae; + undefined field_0x1af; + undefined field_0x1b0; + undefined field_0x1b1; + undefined field_0x1b2; + undefined field_0x1b3; + undefined field_0x1b4; + undefined field_0x1b5; + undefined field_0x1b6; + undefined field_0x1b7; + undefined field_0x1b8; + undefined field_0x1b9; + undefined field_0x1ba; + undefined field_0x1bb; + undefined field_0x1bc; + undefined field_0x1bd; + undefined field_0x1be; + undefined field_0x1bf; + undefined field_0x1c0; + undefined field_0x1c1; + undefined field_0x1c2; + undefined field_0x1c3; + undefined field_0x1c4; + undefined field_0x1c5; + undefined field_0x1c6; + undefined field_0x1c7; + undefined field_0x1c8; + undefined field_0x1c9; + undefined field_0x1ca; + undefined field_0x1cb; + undefined field_0x1cc; + undefined field_0x1cd; + undefined field_0x1ce; + undefined field_0x1cf; + undefined field_0x1d0; + undefined field_0x1d1; + undefined field_0x1d2; + undefined field_0x1d3; + undefined field_0x1d4; + undefined field_0x1d5; + undefined field_0x1d6; + undefined field_0x1d7; + undefined field_0x1d8; + undefined field_0x1d9; + undefined field_0x1da; + undefined field_0x1db; + undefined field_0x1dc; + undefined field_0x1dd; + undefined field_0x1de; + undefined field_0x1df; + undefined field_0x1e0; + undefined field_0x1e1; + undefined field_0x1e2; + undefined field_0x1e3; + undefined field_0x1e4; + undefined field_0x1e5; + undefined field_0x1e6; + undefined field_0x1e7; + undefined field_0x1e8; + undefined field_0x1e9; + undefined field_0x1ea; + undefined field_0x1eb; + undefined field_0x1ec; + undefined field_0x1ed; + undefined field_0x1ee; + undefined field_0x1ef; + undefined field_0x1f0; + undefined field_0x1f1; + undefined field_0x1f2; + undefined field_0x1f3; + undefined field_0x1f4; + undefined field_0x1f5; + undefined field_0x1f6; + undefined field_0x1f7; + undefined field_0x1f8; + undefined field_0x1f9; + undefined field_0x1fa; + undefined field_0x1fb; + undefined field_0x1fc; + undefined field_0x1fd; + undefined field_0x1fe; + undefined field_0x1ff; + undefined field_0x200; + undefined field_0x201; + undefined field_0x202; + undefined field_0x203; + undefined field_0x204; + undefined field_0x205; + undefined field_0x206; + undefined field_0x207; + undefined field_0x208; + undefined field_0x209; + undefined field_0x20a; + undefined field_0x20b; + undefined field_0x20c; + undefined field_0x20d; + undefined field_0x20e; + undefined field_0x20f; + undefined field_0x210; + undefined field_0x211; + undefined field_0x212; + undefined field_0x213; + undefined field_0x214; + undefined field_0x215; + undefined field_0x216; + undefined field_0x217; + undefined field_0x218; + undefined field_0x219; + undefined field_0x21a; + undefined field_0x21b; + undefined field_0x21c; + undefined field_0x21d; + undefined field_0x21e; + undefined field_0x21f; + undefined field_0x220; + undefined field_0x221; + undefined field_0x222; + undefined field_0x223; + undefined field_0x224; + undefined field_0x225; + undefined field_0x226; + undefined field_0x227; + undefined field_0x228; + undefined field_0x229; + undefined field_0x22a; + undefined field_0x22b; + undefined field_0x22c; + undefined field_0x22d; + undefined field_0x22e; + undefined field_0x22f; + undefined field_0x230; + undefined field_0x231; + undefined field_0x232; + undefined field_0x233; + undefined field_0x234; + undefined field_0x235; + undefined field_0x236; + undefined field_0x237; + undefined field_0x238; + undefined field_0x239; + undefined field_0x23a; + undefined field_0x23b; + undefined field_0x23c; + undefined field_0x23d; + undefined field_0x23e; + undefined field_0x23f; + undefined field_0x240; + undefined field_0x241; + undefined field_0x242; + undefined field_0x243; + undefined field_0x244; + undefined field_0x245; + undefined field_0x246; + undefined field_0x247; + undefined field_0x248; + undefined field_0x249; + undefined field_0x24a; + undefined field_0x24b; + undefined field_0x24c; + undefined field_0x24d; + undefined field_0x24e; + undefined field_0x24f; + undefined field_0x250; + undefined field_0x251; + undefined field_0x252; + undefined field_0x253; + undefined field_0x254; + undefined field_0x255; + undefined field_0x256; + undefined field_0x257; + undefined field_0x258; + undefined field_0x259; + undefined field_0x25a; + undefined field_0x25b; + undefined field_0x25c; + undefined field_0x25d; + undefined field_0x25e; + undefined field_0x25f; + undefined field_0x260; + undefined field_0x261; + undefined field_0x262; + undefined field_0x263; + undefined field_0x264; + undefined field_0x265; + undefined field_0x266; + undefined field_0x267; + undefined field_0x268; + undefined field_0x269; + undefined field_0x26a; + undefined field_0x26b; + undefined field_0x26c; + undefined field_0x26d; + undefined field_0x26e; + undefined field_0x26f; + undefined field_0x270; + undefined field_0x271; + undefined field_0x272; + undefined field_0x273; + undefined field_0x274; + undefined field_0x275; + undefined field_0x276; + undefined field_0x277; + undefined field_0x278; + undefined field_0x279; + undefined field_0x27a; + undefined field_0x27b; + undefined field_0x27c; + undefined field_0x27d; + undefined field_0x27e; + undefined field_0x27f; + undefined field_0x280; + undefined field_0x281; + undefined field_0x282; + undefined field_0x283; + undefined field_0x284; + undefined field_0x285; + undefined field_0x286; + undefined field_0x287; + undefined field_0x288; + undefined field_0x289; + undefined field_0x28a; + undefined field_0x28b; + undefined field_0x28c; + undefined field_0x28d; + undefined field_0x28e; + undefined field_0x28f; + undefined field_0x290; + undefined field_0x291; + undefined field_0x292; + undefined field_0x293; + undefined field_0x294; + undefined field_0x295; + undefined field_0x296; + undefined field_0x297; + undefined field_0x298; + undefined field_0x299; + undefined field_0x29a; + undefined field_0x29b; + undefined field_0x29c; + undefined field_0x29d; + undefined field_0x29e; + undefined field_0x29f; + undefined field_0x2a0; + undefined field_0x2a1; + undefined field_0x2a2; + undefined field_0x2a3; + undefined field_0x2a4; + undefined field_0x2a5; + undefined field_0x2a6; + undefined field_0x2a7; + undefined field_0x2a8; + undefined field_0x2a9; + undefined field_0x2aa; + undefined field_0x2ab; + undefined field_0x2ac; + undefined field_0x2ad; + undefined field_0x2ae; + undefined field_0x2af; + undefined field_0x2b0; + undefined field_0x2b1; + undefined field_0x2b2; + undefined field_0x2b3; + undefined field_0x2b4; + undefined field_0x2b5; + undefined field_0x2b6; + undefined field_0x2b7; + undefined field_0x2b8; + undefined field_0x2b9; + undefined field_0x2ba; + undefined field_0x2bb; + undefined field_0x2bc; + undefined field_0x2bd; + undefined field_0x2be; + undefined field_0x2bf; + undefined field_0x2c0; + undefined field_0x2c1; + undefined field_0x2c2; + undefined field_0x2c3; + undefined field_0x2c4; + undefined field_0x2c5; + undefined field_0x2c6; + undefined field_0x2c7; + undefined field_0x2c8; + undefined field_0x2c9; + undefined field_0x2ca; + undefined field_0x2cb; + undefined field_0x2cc; + undefined field_0x2cd; + undefined field_0x2ce; + undefined field_0x2cf; + undefined field_0x2d0; + undefined field_0x2d1; + undefined field_0x2d2; + undefined field_0x2d3; + undefined field_0x2d4; + undefined field_0x2d5; + undefined field_0x2d6; + undefined field_0x2d7; + undefined field_0x2d8; + undefined field_0x2d9; + undefined field_0x2da; + undefined field_0x2db; + undefined field_0x2dc; + undefined field_0x2dd; + undefined field_0x2de; + undefined field_0x2df; + undefined field_0x2e0; + undefined field_0x2e1; + undefined field_0x2e2; + undefined field_0x2e3; + undefined field_0x2e4; + undefined field_0x2e5; + undefined field_0x2e6; + undefined field_0x2e7; + undefined field_0x2e8; + undefined field_0x2e9; + undefined field_0x2ea; + undefined field_0x2eb; + undefined field_0x2ec; + undefined field_0x2ed; + undefined field_0x2ee; + undefined field_0x2ef; + undefined field_0x2f0; + undefined field_0x2f1; + undefined field_0x2f2; + undefined field_0x2f3; + undefined field_0x2f4; + undefined field_0x2f5; + undefined field_0x2f6; + undefined field_0x2f7; + undefined field_0x2f8; + undefined field_0x2f9; + undefined field_0x2fa; + undefined field_0x2fb; + undefined field_0x2fc; + undefined field_0x2fd; + undefined field_0x2fe; + undefined field_0x2ff; + undefined field_0x300; + undefined field_0x301; + undefined field_0x302; + undefined field_0x303; + undefined field_0x304; + undefined field_0x305; + undefined field_0x306; + undefined field_0x307; + undefined field_0x308; + undefined field_0x309; + undefined field_0x30a; + undefined field_0x30b; + undefined field_0x30c; + undefined field_0x30d; + undefined field_0x30e; + undefined field_0x30f; + undefined field_0x310; + undefined field_0x311; + undefined field_0x312; + undefined field_0x313; + undefined field_0x314; + undefined field_0x315; + undefined field_0x316; + undefined field_0x317; + undefined field_0x318; + undefined field_0x319; + undefined field_0x31a; + undefined field_0x31b; + undefined field_0x31c; + undefined field_0x31d; + undefined field_0x31e; + undefined field_0x31f; + undefined field_0x320; + undefined field_0x321; + undefined field_0x322; + undefined field_0x323; + undefined field_0x324; + undefined field_0x325; + undefined field_0x326; + undefined field_0x327; + undefined field_0x328; + undefined field_0x329; + undefined field_0x32a; + undefined field_0x32b; + undefined field_0x32c; + undefined field_0x32d; + undefined field_0x32e; + undefined field_0x32f; + undefined field_0x330; + undefined field_0x331; + undefined field_0x332; + undefined field_0x333; + undefined field_0x334; + undefined field_0x335; + undefined field_0x336; + undefined field_0x337; + undefined field_0x338; + undefined field_0x339; + undefined field_0x33a; + undefined field_0x33b; + undefined field_0x33c; + undefined field_0x33d; + undefined field_0x33e; + undefined field_0x33f; + undefined field_0x340; + undefined field_0x341; + undefined field_0x342; + undefined field_0x343; + undefined field_0x344; + undefined field_0x345; + undefined field_0x346; + undefined field_0x347; + undefined field_0x348; + undefined field_0x349; + undefined field_0x34a; + undefined field_0x34b; + undefined field_0x34c; + undefined field_0x34d; + undefined field_0x34e; + undefined field_0x34f; + undefined field_0x350; + undefined field_0x351; + undefined field_0x352; + undefined field_0x353; + undefined field_0x354; + undefined field_0x355; + undefined field_0x356; + undefined field_0x357; + undefined field_0x358; + undefined field_0x359; + undefined field_0x35a; + undefined field_0x35b; + undefined field_0x35c; + undefined field_0x35d; + undefined field_0x35e; + undefined field_0x35f; + undefined field_0x360; + undefined field_0x361; + undefined field_0x362; + undefined field_0x363; + undefined field_0x364; + undefined field_0x365; + undefined field_0x366; + undefined field_0x367; + undefined field_0x368; + undefined field_0x369; + undefined field_0x36a; + undefined field_0x36b; + undefined field_0x36c; + undefined field_0x36d; + undefined field_0x36e; + undefined field_0x36f; + undefined field_0x370; + undefined field_0x371; + undefined field_0x372; + undefined field_0x373; + undefined field_0x374; + undefined field_0x375; + undefined field_0x376; + undefined field_0x377; + undefined field_0x378; + undefined field_0x379; + undefined field_0x37a; + undefined field_0x37b; + undefined field_0x37c; + undefined field_0x37d; + undefined field_0x37e; + undefined field_0x37f; + undefined field_0x380; + undefined field_0x381; + undefined field_0x382; + undefined field_0x383; + undefined field_0x384; + undefined field_0x385; + undefined field_0x386; + undefined field_0x387; + undefined field_0x388; + undefined field_0x389; + undefined field_0x38a; + undefined field_0x38b; + undefined field_0x38c; + undefined field_0x38d; + undefined field_0x38e; + undefined field_0x38f; + undefined field_0x390; + undefined field_0x391; + undefined field_0x392; + undefined field_0x393; + undefined field_0x394; + undefined field_0x395; + undefined field_0x396; + undefined field_0x397; + undefined field_0x398; + undefined field_0x399; + undefined field_0x39a; + undefined field_0x39b; + undefined field_0x39c; + undefined field_0x39d; + undefined field_0x39e; + undefined field_0x39f; + undefined field_0x3a0; + undefined field_0x3a1; + undefined field_0x3a2; + undefined field_0x3a3; + undefined field_0x3a4; + undefined field_0x3a5; + undefined field_0x3a6; + undefined field_0x3a7; + undefined field_0x3a8; + undefined field_0x3a9; + undefined field_0x3aa; + undefined field_0x3ab; + undefined field_0x3ac; + undefined field_0x3ad; + undefined field_0x3ae; + undefined field_0x3af; + undefined field_0x3b0; + undefined field_0x3b1; + undefined field_0x3b2; + undefined field_0x3b3; + undefined field_0x3b4; + undefined field_0x3b5; + undefined field_0x3b6; + undefined field_0x3b7; + undefined field_0x3b8; + undefined field_0x3b9; + undefined field_0x3ba; + undefined field_0x3bb; + undefined field_0x3bc; + undefined field_0x3bd; + undefined field_0x3be; + undefined field_0x3bf; + undefined field_0x3c0; + undefined field_0x3c1; + undefined field_0x3c2; + undefined field_0x3c3; + undefined field_0x3c4; + undefined field_0x3c5; + undefined field_0x3c6; + undefined field_0x3c7; + undefined field_0x3c8; + undefined field_0x3c9; + undefined field_0x3ca; + undefined field_0x3cb; + undefined field_0x3cc; + undefined field_0x3cd; + undefined field_0x3ce; + undefined field_0x3cf; + undefined field_0x3d0; + undefined field_0x3d1; + undefined field_0x3d2; + undefined field_0x3d3; + undefined field_0x3d4; + undefined field_0x3d5; + undefined field_0x3d6; + undefined field_0x3d7; + undefined field_0x3d8; + undefined field_0x3d9; + undefined field_0x3da; + undefined field_0x3db; + undefined field_0x3dc; + undefined field_0x3dd; + undefined field_0x3de; + undefined field_0x3df; + undefined field_0x3e0; + undefined field_0x3e1; + undefined field_0x3e2; + undefined field_0x3e3; + undefined field_0x3e4; + undefined field_0x3e5; + undefined field_0x3e6; + undefined field_0x3e7; + undefined field_0x3e8; + undefined field_0x3e9; + undefined field_0x3ea; + undefined field_0x3eb; + undefined field_0x3ec; + undefined field_0x3ed; + undefined field_0x3ee; + undefined field_0x3ef; + undefined field_0x3f0; + undefined field_0x3f1; + undefined field_0x3f2; + undefined field_0x3f3; + undefined field_0x3f4; + undefined field_0x3f5; + undefined field_0x3f6; + undefined field_0x3f7; + undefined field_0x3f8; + undefined field_0x3f9; + undefined field_0x3fa; + undefined field_0x3fb; + undefined field_0x3fc; + undefined field_0x3fd; + undefined field_0x3fe; + undefined field_0x3ff; + undefined field_0x400; + undefined field_0x401; + undefined field_0x402; + undefined field_0x403; + undefined field_0x404; + undefined field_0x405; + undefined field_0x406; + undefined field_0x407; + undefined field_0x408; + undefined field_0x409; + undefined field_0x40a; + undefined field_0x40b; + undefined field_0x40c; + undefined field_0x40d; + undefined field_0x40e; + undefined field_0x40f; + undefined field_0x410; + undefined field_0x411; + undefined field_0x412; + undefined field_0x413; + undefined field_0x414; + undefined field_0x415; + undefined field_0x416; + undefined field_0x417; + undefined field_0x418; + undefined field_0x419; + undefined field_0x41a; + undefined field_0x41b; + undefined field_0x41c; + undefined field_0x41d; + undefined field_0x41e; + undefined field_0x41f; + undefined field_0x420; + undefined field_0x421; + undefined field_0x422; + undefined field_0x423; + undefined field_0x424; + undefined field_0x425; + undefined field_0x426; + undefined field_0x427; + undefined field_0x428; + undefined field_0x429; + undefined field_0x42a; + undefined field_0x42b; + undefined field_0x42c; + undefined field_0x42d; + undefined field_0x42e; + undefined field_0x42f; + undefined field_0x430; + undefined field_0x431; + undefined field_0x432; + undefined field_0x433; + undefined field_0x434; + undefined field_0x435; + undefined field_0x436; + undefined field_0x437; + undefined field_0x438; + undefined field_0x439; + undefined field_0x43a; + undefined field_0x43b; + undefined field_0x43c; + undefined field_0x43d; + undefined field_0x43e; + undefined field_0x43f; + undefined field_0x440; + undefined field_0x441; + undefined field_0x442; + undefined field_0x443; + undefined field_0x444; + undefined field_0x445; + undefined field_0x446; + undefined field_0x447; + undefined field_0x448; + undefined field_0x449; + undefined field_0x44a; + undefined field_0x44b; + undefined field_0x44c; + undefined field_0x44d; + undefined field_0x44e; + undefined field_0x44f; + undefined field_0x450; + undefined field_0x451; + undefined field_0x452; + undefined field_0x453; + undefined field_0x454; + undefined field_0x455; + undefined field_0x456; + undefined field_0x457; + undefined field_0x458; + undefined field_0x459; + undefined field_0x45a; + undefined field_0x45b; + undefined field_0x45c; + undefined field_0x45d; + undefined field_0x45e; + undefined field_0x45f; + undefined field_0x460; + undefined field_0x461; + undefined field_0x462; + undefined field_0x463; + undefined field_0x464; + undefined field_0x465; + undefined field_0x466; + undefined field_0x467; + undefined field_0x468; + undefined field_0x469; + undefined field_0x46a; + undefined field_0x46b; + undefined field_0x46c; + undefined field_0x46d; + undefined field_0x46e; + undefined field_0x46f; + undefined field_0x470; + undefined field_0x471; + undefined field_0x472; + undefined field_0x473; + undefined field_0x474; + undefined field_0x475; + undefined field_0x476; + undefined field_0x477; + undefined field_0x478; + undefined field_0x479; + undefined field_0x47a; + undefined field_0x47b; + undefined field_0x47c; + undefined field_0x47d; + undefined field_0x47e; + undefined field_0x47f; + undefined field_0x480; + undefined field_0x481; + undefined field_0x482; + undefined field_0x483; + undefined field_0x484; + undefined field_0x485; + undefined field_0x486; + undefined field_0x487; + undefined field_0x488; + undefined field_0x489; + undefined field_0x48a; + undefined field_0x48b; + undefined field_0x48c; + undefined field_0x48d; + undefined field_0x48e; + undefined field_0x48f; + undefined field_0x490; + undefined field_0x491; + undefined field_0x492; + undefined field_0x493; + undefined field_0x494; + undefined field_0x495; + undefined field_0x496; + undefined field_0x497; + undefined field_0x498; + undefined field_0x499; + undefined field_0x49a; + undefined field_0x49b; + undefined field_0x49c; + undefined field_0x49d; + undefined field_0x49e; + undefined field_0x49f; + undefined field_0x4a0; + undefined field_0x4a1; + undefined field_0x4a2; + undefined field_0x4a3; + undefined field_0x4a4; + undefined field_0x4a5; + undefined field_0x4a6; + undefined field_0x4a7; + undefined field_0x4a8; + undefined field_0x4a9; + undefined field_0x4aa; + undefined field_0x4ab; + undefined field_0x4ac; + undefined field_0x4ad; + undefined field_0x4ae; + undefined field_0x4af; + undefined field_0x4b0; + undefined field_0x4b1; + undefined field_0x4b2; + undefined field_0x4b3; + undefined field_0x4b4; + undefined field_0x4b5; + undefined field_0x4b6; + undefined field_0x4b7; + undefined field_0x4b8; + undefined field_0x4b9; + undefined field_0x4ba; + undefined field_0x4bb; + undefined field_0x4bc; + undefined field_0x4bd; + undefined field_0x4be; + undefined field_0x4bf; + undefined field_0x4c0; + undefined field_0x4c1; + undefined field_0x4c2; + undefined field_0x4c3; + undefined field_0x4c4; + undefined field_0x4c5; + undefined field_0x4c6; + undefined field_0x4c7; + undefined field_0x4c8; + undefined field_0x4c9; + undefined field_0x4ca; + undefined field_0x4cb; + undefined field_0x4cc; + undefined field_0x4cd; + undefined field_0x4ce; + undefined field_0x4cf; + undefined field_0x4d0; + undefined field_0x4d1; + undefined field_0x4d2; + undefined field_0x4d3; + undefined field_0x4d4; + undefined field_0x4d5; + undefined field_0x4d6; + undefined field_0x4d7; + undefined field_0x4d8; + undefined field_0x4d9; + undefined field_0x4da; + undefined field_0x4db; + undefined field_0x4dc; + undefined field_0x4dd; + undefined field_0x4de; + undefined field_0x4df; + undefined field_0x4e0; + undefined field_0x4e1; + undefined field_0x4e2; + undefined field_0x4e3; + undefined field_0x4e4; + undefined field_0x4e5; + undefined field_0x4e6; + undefined field_0x4e7; + undefined field_0x4e8; + undefined field_0x4e9; + undefined field_0x4ea; + undefined field_0x4eb; + undefined field_0x4ec; + undefined field_0x4ed; + undefined field_0x4ee; + undefined field_0x4ef; + undefined field_0x4f0; + undefined field_0x4f1; + undefined field_0x4f2; + undefined field_0x4f3; + undefined field_0x4f4; + undefined field_0x4f5; + undefined field_0x4f6; + undefined field_0x4f7; + undefined field_0x4f8; + undefined field_0x4f9; + undefined field_0x4fa; + undefined field_0x4fb; + undefined field_0x4fc; + undefined field_0x4fd; + undefined field_0x4fe; + undefined field_0x4ff; + undefined field_0x500; + undefined field_0x501; + undefined field_0x502; + undefined field_0x503; + undefined field_0x504; + undefined field_0x505; + undefined field_0x506; + undefined field_0x507; + undefined field_0x508; + undefined field_0x509; + undefined field_0x50a; + undefined field_0x50b; + undefined field_0x50c; + undefined field_0x50d; + undefined field_0x50e; + undefined field_0x50f; + undefined field_0x510; + undefined field_0x511; + undefined field_0x512; + undefined field_0x513; + undefined field_0x514; + undefined field_0x515; + undefined field_0x516; + undefined field_0x517; + undefined field_0x518; + undefined field_0x519; + undefined field_0x51a; + undefined field_0x51b; + undefined field_0x51c; + undefined field_0x51d; + undefined field_0x51e; + undefined field_0x51f; + undefined field_0x520; + undefined field_0x521; + undefined field_0x522; + undefined field_0x523; + undefined field_0x524; + undefined field_0x525; + undefined field_0x526; + undefined field_0x527; + undefined field_0x528; + undefined field_0x529; + undefined field_0x52a; + undefined field_0x52b; + undefined field_0x52c; + undefined field_0x52d; + undefined field_0x52e; + undefined field_0x52f; + undefined field_0x530; + undefined field_0x531; + undefined field_0x532; + undefined field_0x533; + undefined field_0x534; + undefined field_0x535; + undefined field_0x536; + undefined field_0x537; + undefined field_0x538; + undefined field_0x539; + undefined field_0x53a; + undefined field_0x53b; + undefined field_0x53c; + undefined field_0x53d; + undefined field_0x53e; + undefined field_0x53f; + undefined field_0x540; + undefined field_0x541; + undefined field_0x542; + undefined field_0x543; + undefined field_0x544; + undefined field_0x545; + undefined field_0x546; + undefined field_0x547; + undefined field_0x548; + undefined field_0x549; + undefined field_0x54a; + undefined field_0x54b; + undefined field_0x54c; + undefined field_0x54d; + undefined field_0x54e; + undefined field_0x54f; + undefined field_0x550; + undefined field_0x551; + undefined field_0x552; + undefined field_0x553; + undefined field_0x554; + undefined field_0x555; + undefined field_0x556; + undefined field_0x557; + undefined field_0x558; + undefined field_0x559; + undefined field_0x55a; + undefined field_0x55b; + undefined field_0x55c; + undefined field_0x55d; + undefined field_0x55e; + undefined field_0x55f; + undefined field_0x560; + undefined field_0x561; + undefined field_0x562; + undefined field_0x563; + undefined field_0x564; + undefined field_0x565; + undefined field_0x566; + undefined field_0x567; + undefined field_0x568; + undefined field_0x569; + undefined field_0x56a; + undefined field_0x56b; + undefined field_0x56c; + undefined field_0x56d; + undefined field_0x56e; + undefined field_0x56f; + undefined field_0x570; + undefined field_0x571; + undefined field_0x572; + undefined field_0x573; + undefined field_0x574; + undefined field_0x575; + undefined field_0x576; + undefined field_0x577; + undefined field_0x578; + undefined field_0x579; + undefined field_0x57a; + undefined field_0x57b; + undefined field_0x57c; + undefined field_0x57d; + undefined field_0x57e; + undefined field_0x57f; + undefined field_0x580; + undefined field_0x581; + undefined field_0x582; + undefined field_0x583; + undefined field_0x584; + undefined field_0x585; + undefined field_0x586; + undefined field_0x587; + undefined field_0x588; + undefined field_0x589; + undefined field_0x58a; + undefined field_0x58b; + undefined field_0x58c; + undefined field_0x58d; + undefined field_0x58e; + undefined field_0x58f; + undefined field_0x590; + undefined field_0x591; + undefined field_0x592; + undefined field_0x593; + undefined field_0x594; + undefined field_0x595; + undefined field_0x596; + undefined field_0x597; + undefined field_0x598; + undefined field_0x599; + undefined field_0x59a; + undefined field_0x59b; + undefined field_0x59c; + undefined field_0x59d; + undefined field_0x59e; + undefined field_0x59f; + undefined field_0x5a0; + undefined field_0x5a1; + undefined field_0x5a2; + undefined field_0x5a3; + undefined field_0x5a4; + undefined field_0x5a5; + undefined field_0x5a6; + undefined field_0x5a7; + undefined field_0x5a8; + undefined field_0x5a9; + undefined field_0x5aa; + undefined field_0x5ab; + undefined field_0x5ac; + undefined field_0x5ad; + undefined field_0x5ae; + undefined field_0x5af; + undefined field_0x5b0; + undefined field_0x5b1; + undefined field_0x5b2; + undefined field_0x5b3; + undefined field_0x5b4; + undefined field_0x5b5; + undefined field_0x5b6; + undefined field_0x5b7; + undefined field_0x5b8; + undefined field_0x5b9; + undefined field_0x5ba; + undefined field_0x5bb; + undefined field_0x5bc; + undefined field_0x5bd; + undefined field_0x5be; + undefined field_0x5bf; + undefined field_0x5c0; + undefined field_0x5c1; + undefined field_0x5c2; + undefined field_0x5c3; + undefined field_0x5c4; + undefined field_0x5c5; + undefined field_0x5c6; + undefined field_0x5c7; + undefined field_0x5c8; + undefined field_0x5c9; + undefined field_0x5ca; + undefined field_0x5cb; + undefined field_0x5cc; + undefined field_0x5cd; + undefined field_0x5ce; + undefined field_0x5cf; + undefined field_0x5d0; + undefined field_0x5d1; + undefined field_0x5d2; + undefined field_0x5d3; + undefined field_0x5d4; + undefined field_0x5d5; + undefined field_0x5d6; + undefined field_0x5d7; + undefined field_0x5d8; + undefined field_0x5d9; + undefined field_0x5da; + undefined field_0x5db; + undefined field_0x5dc; + undefined field_0x5dd; + undefined field_0x5de; + undefined field_0x5df; + undefined field_0x5e0; + undefined field_0x5e1; + undefined field_0x5e2; + undefined field_0x5e3; + undefined field_0x5e4; + undefined field_0x5e5; + undefined field_0x5e6; + undefined field_0x5e7; + undefined field_0x5e8; + undefined field_0x5e9; + undefined field_0x5ea; + undefined field_0x5eb; + undefined field_0x5ec; + undefined field_0x5ed; + undefined field_0x5ee; + undefined field_0x5ef; + undefined field_0x5f0; + undefined field_0x5f1; + undefined field_0x5f2; + undefined field_0x5f3; + undefined field_0x5f4; + undefined field_0x5f5; + undefined field_0x5f6; + undefined field_0x5f7; + undefined field_0x5f8; + undefined field_0x5f9; + undefined field_0x5fa; + undefined field_0x5fb; + undefined field_0x5fc; + undefined field_0x5fd; + undefined field_0x5fe; + undefined field_0x5ff; + undefined field_0x600; + undefined field_0x601; + undefined field_0x602; + undefined field_0x603; + undefined field_0x604; + undefined field_0x605; + undefined field_0x606; + undefined field_0x607; + undefined field_0x608; + undefined field_0x609; + undefined field_0x60a; + undefined field_0x60b; + undefined field_0x60c; + undefined field_0x60d; + undefined field_0x60e; + undefined field_0x60f; + undefined field_0x610; + undefined field_0x611; + undefined field_0x612; + undefined field_0x613; + undefined field_0x614; + undefined field_0x615; + undefined field_0x616; + undefined field_0x617; + undefined field_0x618; + undefined field_0x619; + undefined field_0x61a; + undefined field_0x61b; + undefined field_0x61c; + undefined field_0x61d; + undefined field_0x61e; + undefined field_0x61f; + undefined field_0x620; + undefined field_0x621; + undefined field_0x622; + undefined field_0x623; + undefined field_0x624; + undefined field_0x625; + undefined field_0x626; + undefined field_0x627; + undefined field_0x628; + undefined field_0x629; + undefined field_0x62a; + undefined field_0x62b; + undefined field_0x62c; + undefined field_0x62d; + undefined field_0x62e; + undefined field_0x62f; + undefined field_0x630; + undefined field_0x631; + undefined field_0x632; + undefined field_0x633; + undefined field_0x634; + undefined field_0x635; + undefined field_0x636; + undefined field_0x637; + undefined field_0x638; + undefined field_0x639; + undefined field_0x63a; + undefined field_0x63b; + undefined field_0x63c; + undefined field_0x63d; + undefined field_0x63e; + undefined field_0x63f; + undefined field_0x640; + undefined field_0x641; + undefined field_0x642; + undefined field_0x643; + undefined field_0x644; + undefined field_0x645; + undefined field_0x646; + undefined field_0x647; + undefined field_0x648; + undefined field_0x649; + undefined field_0x64a; + undefined field_0x64b; + undefined field_0x64c; + undefined field_0x64d; + undefined field_0x64e; + undefined field_0x64f; + undefined field_0x650; + undefined field_0x651; + undefined field_0x652; + undefined field_0x653; + undefined field_0x654; + undefined field_0x655; + undefined field_0x656; + undefined field_0x657; + undefined field_0x658; + undefined field_0x659; + undefined field_0x65a; + undefined field_0x65b; + undefined field_0x65c; + undefined field_0x65d; + undefined field_0x65e; + undefined field_0x65f; + undefined field_0x660; + undefined field_0x661; + undefined field_0x662; + undefined field_0x663; + undefined field_0x664; + undefined field_0x665; + undefined field_0x666; + undefined field_0x667; + undefined field_0x668; + undefined field_0x669; + undefined field_0x66a; + undefined field_0x66b; + undefined field_0x66c; + undefined field_0x66d; + undefined field_0x66e; + undefined field_0x66f; + undefined field_0x670; + undefined field_0x671; + undefined field_0x672; + undefined field_0x673; + undefined field_0x674; + undefined field_0x675; + undefined field_0x676; + undefined field_0x677; + undefined field_0x678; + undefined field_0x679; + undefined field_0x67a; + undefined field_0x67b; + undefined field_0x67c; + undefined field_0x67d; + undefined field_0x67e; + undefined field_0x67f; + undefined field_0x680; + undefined field_0x681; + undefined field_0x682; + undefined field_0x683; + undefined field_0x684; + undefined field_0x685; + undefined field_0x686; + undefined field_0x687; + undefined field_0x688; + undefined field_0x689; + undefined field_0x68a; + undefined field_0x68b; + undefined field_0x68c; + undefined field_0x68d; + undefined field_0x68e; + undefined field_0x68f; + undefined field_0x690; + undefined field_0x691; + undefined field_0x692; + undefined field_0x693; + undefined field_0x694; + undefined field_0x695; + undefined field_0x696; + undefined field_0x697; + undefined field_0x698; + undefined field_0x699; + undefined field_0x69a; + undefined field_0x69b; + undefined field_0x69c; + undefined field_0x69d; + undefined field_0x69e; + undefined field_0x69f; + undefined field_0x6a0; + undefined field_0x6a1; + undefined field_0x6a2; + undefined field_0x6a3; + undefined field_0x6a4; + undefined field_0x6a5; + undefined field_0x6a6; + undefined field_0x6a7; + undefined field_0x6a8; + undefined field_0x6a9; + undefined field_0x6aa; + undefined field_0x6ab; + undefined field_0x6ac; + undefined field_0x6ad; + undefined field_0x6ae; + undefined field_0x6af; + undefined field_0x6b0; + undefined field_0x6b1; + undefined field_0x6b2; + undefined field_0x6b3; + undefined field_0x6b4; + undefined field_0x6b5; + undefined field_0x6b6; + undefined field_0x6b7; + undefined field_0x6b8; + undefined field_0x6b9; + undefined field_0x6ba; + undefined field_0x6bb; + undefined field_0x6bc; + undefined field_0x6bd; + undefined field_0x6be; + undefined field_0x6bf; + undefined field_0x6c0; + undefined field_0x6c1; + undefined field_0x6c2; + undefined field_0x6c3; + undefined field_0x6c4; + undefined field_0x6c5; + undefined field_0x6c6; + undefined field_0x6c7; + undefined field_0x6c8; + undefined field_0x6c9; + undefined field_0x6ca; + undefined field_0x6cb; + undefined field_0x6cc; + undefined field_0x6cd; + undefined field_0x6ce; + undefined field_0x6cf; + undefined field_0x6d0; + undefined field_0x6d1; + undefined field_0x6d2; + undefined field_0x6d3; + undefined field_0x6d4; + undefined field_0x6d5; + undefined field_0x6d6; + undefined field_0x6d7; + undefined field_0x6d8; + undefined field_0x6d9; + undefined field_0x6da; + undefined field_0x6db; + undefined field_0x6dc; + undefined field_0x6dd; + undefined field_0x6de; + undefined field_0x6df; + undefined field_0x6e0; + undefined field_0x6e1; + undefined field_0x6e2; + undefined field_0x6e3; + undefined field_0x6e4; + undefined field_0x6e5; + undefined field_0x6e6; + undefined field_0x6e7; + undefined field_0x6e8; + undefined field_0x6e9; + undefined field_0x6ea; + undefined field_0x6eb; + undefined field_0x6ec; + undefined field_0x6ed; + undefined field_0x6ee; + undefined field_0x6ef; + undefined field_0x6f0; + undefined field_0x6f1; + undefined field_0x6f2; + undefined field_0x6f3; + undefined field_0x6f4; + undefined field_0x6f5; + undefined field_0x6f6; + undefined field_0x6f7; + undefined field_0x6f8; + undefined field_0x6f9; + undefined field_0x6fa; + undefined field_0x6fb; + undefined field_0x6fc; + undefined field_0x6fd; + undefined field_0x6fe; + undefined field_0x6ff; + undefined field_0x700; + undefined field_0x701; + undefined field_0x702; + undefined field_0x703; + undefined field_0x704; + undefined field_0x705; + undefined field_0x706; + undefined field_0x707; + undefined field_0x708; + undefined field_0x709; + undefined field_0x70a; + undefined field_0x70b; + undefined field_0x70c; + undefined field_0x70d; + undefined field_0x70e; + undefined field_0x70f; + undefined field_0x710; + undefined field_0x711; + undefined field_0x712; + undefined field_0x713; + undefined field_0x714; + undefined field_0x715; + undefined field_0x716; + undefined field_0x717; + undefined field_0x718; + undefined field_0x719; + undefined field_0x71a; + undefined field_0x71b; + undefined field_0x71c; + undefined field_0x71d; + undefined field_0x71e; + undefined field_0x71f; + undefined field_0x720; + undefined field_0x721; + undefined field_0x722; + undefined field_0x723; + undefined field_0x724; + undefined field_0x725; + undefined field_0x726; + undefined field_0x727; + undefined field_0x728; + undefined field_0x729; + undefined field_0x72a; + undefined field_0x72b; + undefined field_0x72c; + undefined field_0x72d; + undefined field_0x72e; + undefined field_0x72f; + undefined field_0x730; + undefined field_0x731; + undefined field_0x732; + undefined field_0x733; + undefined field_0x734; + undefined field_0x735; + undefined field_0x736; + undefined field_0x737; + undefined field_0x738; + undefined field_0x739; + undefined field_0x73a; + undefined field_0x73b; + undefined field_0x73c; + undefined field_0x73d; + undefined field_0x73e; + undefined field_0x73f; + undefined field_0x740; + undefined field_0x741; + undefined field_0x742; + undefined field_0x743; + undefined field_0x744; + undefined field_0x745; + undefined field_0x746; + undefined field_0x747; + undefined field_0x748; + undefined field_0x749; + undefined field_0x74a; + undefined field_0x74b; + undefined field_0x74c; + undefined field_0x74d; + undefined field_0x74e; + undefined field_0x74f; + undefined field_0x750; + undefined field_0x751; + undefined field_0x752; + undefined field_0x753; + undefined field_0x754; + undefined field_0x755; + undefined field_0x756; + undefined field_0x757; + undefined field_0x758; + undefined field_0x759; + undefined field_0x75a; + undefined field_0x75b; + undefined field_0x75c; + undefined field_0x75d; + undefined field_0x75e; + undefined field_0x75f; + undefined field_0x760; + undefined field_0x761; + undefined field_0x762; + undefined field_0x763; + undefined field_0x764; + undefined field_0x765; + undefined field_0x766; + undefined field_0x767; + undefined field_0x768; + undefined field_0x769; + undefined field_0x76a; + undefined field_0x76b; + undefined field_0x76c; + undefined field_0x76d; + undefined field_0x76e; + undefined field_0x76f; + undefined field_0x770; + undefined field_0x771; + undefined field_0x772; + undefined field_0x773; + undefined field_0x774; + undefined field_0x775; + undefined field_0x776; + undefined field_0x777; + undefined field_0x778; + undefined field_0x779; + undefined field_0x77a; + undefined field_0x77b; + undefined field_0x77c; + undefined field_0x77d; + undefined field_0x77e; + undefined field_0x77f; + undefined field_0x780; + undefined field_0x781; + undefined field_0x782; + undefined field_0x783; + undefined field_0x784; + undefined field_0x785; + undefined field_0x786; + undefined field_0x787; + undefined field_0x788; + undefined field_0x789; + undefined field_0x78a; + undefined field_0x78b; + undefined field_0x78c; + undefined field_0x78d; + undefined field_0x78e; + undefined field_0x78f; + undefined field_0x790; + undefined field_0x791; + undefined field_0x792; + undefined field_0x793; + undefined field_0x794; + undefined field_0x795; + undefined field_0x796; + undefined field_0x797; + undefined field_0x798; + undefined field_0x799; + undefined field_0x79a; + undefined field_0x79b; + undefined field_0x79c; + undefined field_0x79d; + undefined field_0x79e; + undefined field_0x79f; + undefined field_0x7a0; + undefined field_0x7a1; + undefined field_0x7a2; + undefined field_0x7a3; + undefined field_0x7a4; + undefined field_0x7a5; + undefined field_0x7a6; + undefined field_0x7a7; + undefined field_0x7a8; + undefined field_0x7a9; + undefined field_0x7aa; + undefined field_0x7ab; + undefined field_0x7ac; + undefined field_0x7ad; + undefined field_0x7ae; + undefined field_0x7af; + undefined field_0x7b0; + undefined field_0x7b1; + undefined field_0x7b2; + undefined field_0x7b3; + undefined field_0x7b4; + undefined field_0x7b5; + undefined field_0x7b6; + undefined field_0x7b7; + undefined field_0x7b8; + undefined field_0x7b9; + undefined field_0x7ba; + undefined field_0x7bb; + undefined field_0x7bc; + undefined field_0x7bd; + undefined field_0x7be; + undefined field_0x7bf; + undefined field_0x7c0; + undefined field_0x7c1; + undefined field_0x7c2; + undefined field_0x7c3; + undefined field_0x7c4; + undefined field_0x7c5; + undefined field_0x7c6; + undefined field_0x7c7; + undefined field_0x7c8; + undefined field_0x7c9; + undefined field_0x7ca; + undefined field_0x7cb; + undefined field_0x7cc; + undefined field_0x7cd; + undefined field_0x7ce; + undefined field_0x7cf; + undefined field_0x7d0; + undefined field_0x7d1; + undefined field_0x7d2; + undefined field_0x7d3; + undefined field_0x7d4; + undefined field_0x7d5; + undefined field_0x7d6; + undefined field_0x7d7; + undefined field_0x7d8; + undefined field_0x7d9; + undefined field_0x7da; + undefined field_0x7db; + undefined field_0x7dc; + undefined field_0x7dd; + undefined field_0x7de; + undefined field_0x7df; + undefined field_0x7e0; + undefined field_0x7e1; + undefined field_0x7e2; + undefined field_0x7e3; + undefined field_0x7e4; + undefined field_0x7e5; + undefined field_0x7e6; + undefined field_0x7e7; + undefined field_0x7e8; + undefined field_0x7e9; + undefined field_0x7ea; + undefined field_0x7eb; + undefined field_0x7ec; + undefined field_0x7ed; + undefined field_0x7ee; + undefined field_0x7ef; + undefined field_0x7f0; + undefined field_0x7f1; + undefined field_0x7f2; + undefined field_0x7f3; + undefined field_0x7f4; + undefined field_0x7f5; + undefined field_0x7f6; + undefined field_0x7f7; + undefined field_0x7f8; + undefined field_0x7f9; + undefined field_0x7fa; + undefined field_0x7fb; + undefined field_0x7fc; + undefined field_0x7fd; + undefined field_0x7fe; + undefined field_0x7ff; + undefined field_0x800; + undefined field_0x801; + undefined field_0x802; + undefined field_0x803; + undefined field_0x804; + undefined field_0x805; + undefined field_0x806; + undefined field_0x807; + undefined field_0x808; + undefined field_0x809; + undefined field_0x80a; + undefined field_0x80b; + undefined field_0x80c; + undefined field_0x80d; + undefined field_0x80e; + undefined field_0x80f; + undefined field_0x810; + undefined field_0x811; + undefined field_0x812; + undefined field_0x813; + undefined field_0x814; + undefined field_0x815; + undefined field_0x816; + undefined field_0x817; + undefined field_0x818; + undefined field_0x819; + undefined field_0x81a; + undefined field_0x81b; + undefined field_0x81c; + undefined field_0x81d; + undefined field_0x81e; + undefined field_0x81f; + undefined field_0x820; + undefined field_0x821; + undefined field_0x822; + undefined field_0x823; + undefined field_0x824; + undefined field_0x825; + undefined field_0x826; + undefined field_0x827; + undefined field_0x828; + undefined field_0x829; + undefined field_0x82a; + undefined field_0x82b; + undefined field_0x82c; + undefined field_0x82d; + undefined field_0x82e; + undefined field_0x82f; + undefined field_0x830; + undefined field_0x831; + undefined field_0x832; + undefined field_0x833; + undefined field_0x834; + undefined field_0x835; + undefined field_0x836; + undefined field_0x837; + undefined field_0x838; + undefined field_0x839; + undefined field_0x83a; + undefined field_0x83b; + undefined field_0x83c; + undefined field_0x83d; + undefined field_0x83e; + undefined field_0x83f; + undefined field_0x840; + undefined field_0x841; + undefined field_0x842; + undefined field_0x843; + undefined field_0x844; + undefined field_0x845; + undefined field_0x846; + undefined field_0x847; + undefined field_0x848; + undefined field_0x849; + undefined field_0x84a; + undefined field_0x84b; + undefined field_0x84c; + undefined field_0x84d; + undefined field_0x84e; + undefined field_0x84f; + undefined field_0x850; + undefined field_0x851; + undefined field_0x852; + undefined field_0x853; + undefined field_0x854; + undefined field_0x855; + undefined field_0x856; + undefined field_0x857; + undefined field_0x858; + undefined field_0x859; + undefined field_0x85a; + undefined field_0x85b; + undefined field_0x85c; + undefined field_0x85d; + undefined field_0x85e; + undefined field_0x85f; + undefined field_0x860; + undefined field_0x861; + undefined field_0x862; + undefined field_0x863; + undefined field_0x864; + undefined field_0x865; + undefined field_0x866; + undefined field_0x867; + undefined field_0x868; + undefined field_0x869; + undefined field_0x86a; + undefined field_0x86b; + undefined field_0x86c; + undefined field_0x86d; + undefined field_0x86e; + undefined field_0x86f; + undefined field_0x870; + undefined field_0x871; + undefined field_0x872; + undefined field_0x873; + undefined field_0x874; + undefined field_0x875; + undefined field_0x876; + undefined field_0x877; + undefined field_0x878; + undefined field_0x879; + undefined field_0x87a; + undefined field_0x87b; + undefined field_0x87c; + undefined field_0x87d; + undefined field_0x87e; + undefined field_0x87f; + undefined field_0x880; + undefined field_0x881; + undefined field_0x882; + undefined field_0x883; + undefined field_0x884; + undefined field_0x885; + undefined field_0x886; + undefined field_0x887; + undefined field_0x888; + undefined field_0x889; + undefined field_0x88a; + undefined field_0x88b; + undefined field_0x88c; + undefined field_0x88d; + undefined field_0x88e; + undefined field_0x88f; + undefined field_0x890; + undefined field_0x891; + undefined field_0x892; + undefined field_0x893; + undefined field_0x894; + undefined field_0x895; + undefined field_0x896; + undefined field_0x897; + undefined field_0x898; + undefined field_0x899; + undefined field_0x89a; + undefined field_0x89b; + undefined field_0x89c; + undefined field_0x89d; + undefined field_0x89e; + undefined field_0x89f; + undefined field_0x8a0; + undefined field_0x8a1; + undefined field_0x8a2; + undefined field_0x8a3; + undefined field_0x8a4; + undefined field_0x8a5; + undefined field_0x8a6; + undefined field_0x8a7; + undefined field_0x8a8; + undefined field_0x8a9; + undefined field_0x8aa; + undefined field_0x8ab; + undefined field_0x8ac; + undefined field_0x8ad; + undefined field_0x8ae; + undefined field_0x8af; + undefined field_0x8b0; + undefined field_0x8b1; + undefined field_0x8b2; + undefined field_0x8b3; + undefined field_0x8b4; + undefined field_0x8b5; + undefined field_0x8b6; + undefined field_0x8b7; + undefined field_0x8b8; + undefined field_0x8b9; + undefined field_0x8ba; + undefined field_0x8bb; + undefined field_0x8bc; + undefined field_0x8bd; + undefined field_0x8be; + undefined field_0x8bf; + undefined field_0x8c0; + undefined field_0x8c1; + undefined field_0x8c2; + undefined field_0x8c3; + undefined field_0x8c4; + undefined field_0x8c5; + undefined field_0x8c6; + undefined field_0x8c7; + undefined field_0x8c8; + undefined field_0x8c9; + undefined field_0x8ca; + undefined field_0x8cb; + undefined field_0x8cc; + undefined field_0x8cd; + undefined field_0x8ce; + undefined field_0x8cf; + undefined field_0x8d0; + undefined field_0x8d1; + undefined field_0x8d2; + undefined field_0x8d3; + undefined field_0x8d4; + undefined field_0x8d5; + undefined field_0x8d6; + undefined field_0x8d7; + undefined field_0x8d8; + undefined field_0x8d9; + undefined field_0x8da; + undefined field_0x8db; + undefined field_0x8dc; + undefined field_0x8dd; + undefined field_0x8de; + undefined field_0x8df; + undefined field_0x8e0; + undefined field_0x8e1; + undefined field_0x8e2; + undefined field_0x8e3; + undefined field_0x8e4; + undefined field_0x8e5; + undefined field_0x8e6; + undefined field_0x8e7; + undefined field_0x8e8; + undefined field_0x8e9; + undefined field_0x8ea; + undefined field_0x8eb; + undefined field_0x8ec; + undefined field_0x8ed; + undefined field_0x8ee; + undefined field_0x8ef; + undefined field_0x8f0; + undefined field_0x8f1; + undefined field_0x8f2; + undefined field_0x8f3; + undefined field_0x8f4; + undefined field_0x8f5; + undefined field_0x8f6; + undefined field_0x8f7; + undefined field_0x8f8; + undefined field_0x8f9; + undefined field_0x8fa; + undefined field_0x8fb; + undefined field_0x8fc; + undefined field_0x8fd; + undefined field_0x8fe; + undefined field_0x8ff; + undefined field_0x900; + undefined field_0x901; + undefined field_0x902; + undefined field_0x903; + undefined field_0x904; + undefined field_0x905; + undefined field_0x906; + undefined field_0x907; + undefined field_0x908; + undefined field_0x909; + undefined field_0x90a; + undefined field_0x90b; + undefined field_0x90c; + undefined field_0x90d; + undefined field_0x90e; + undefined field_0x90f; + undefined field_0x910; + undefined field_0x911; + undefined field_0x912; + undefined field_0x913; + undefined field_0x914; + undefined field_0x915; + undefined field_0x916; + undefined field_0x917; + undefined field_0x918; + undefined field_0x919; + undefined field_0x91a; + undefined field_0x91b; + undefined field_0x91c; + undefined field_0x91d; + undefined field_0x91e; + undefined field_0x91f; + undefined field_0x920; + undefined field_0x921; + undefined field_0x922; + undefined field_0x923; + undefined field_0x924; + undefined field_0x925; + undefined field_0x926; + undefined field_0x927; + undefined field_0x928; + undefined field_0x929; + undefined field_0x92a; + undefined field_0x92b; + undefined field_0x92c; + undefined field_0x92d; + undefined field_0x92e; + undefined field_0x92f; + undefined field_0x930; + undefined field_0x931; + undefined field_0x932; + undefined field_0x933; + undefined field_0x934; + undefined field_0x935; + undefined field_0x936; + undefined field_0x937; + undefined field_0x938; + undefined field_0x939; + undefined field_0x93a; + undefined field_0x93b; + undefined field_0x93c; + undefined field_0x93d; + undefined field_0x93e; + undefined field_0x93f; + undefined field_0x940; + undefined field_0x941; + undefined field_0x942; + undefined field_0x943; + undefined field_0x944; + undefined field_0x945; + undefined field_0x946; + undefined field_0x947; + undefined field_0x948; + undefined field_0x949; + undefined field_0x94a; + undefined field_0x94b; + undefined field_0x94c; + undefined field_0x94d; + undefined field_0x94e; + undefined field_0x94f; + undefined field_0x950; + undefined field_0x951; + undefined field_0x952; + undefined field_0x953; + undefined field_0x954; + undefined field_0x955; + undefined field_0x956; + undefined field_0x957; + undefined field_0x958; + undefined field_0x959; + undefined field_0x95a; + undefined field_0x95b; + undefined field_0x95c; + undefined field_0x95d; + undefined field_0x95e; + undefined field_0x95f; + undefined field_0x960; + undefined field_0x961; + undefined field_0x962; + undefined field_0x963; + undefined field_0x964; + undefined field_0x965; + undefined field_0x966; + undefined field_0x967; + undefined field_0x968; + undefined field_0x969; + undefined field_0x96a; + undefined field_0x96b; + undefined field_0x96c; + undefined field_0x96d; + undefined field_0x96e; + undefined field_0x96f; + undefined field_0x970; + undefined field_0x971; + undefined field_0x972; + undefined field_0x973; + undefined field_0x974; + undefined field_0x975; + undefined field_0x976; + undefined field_0x977; + undefined field_0x978; + undefined field_0x979; + undefined field_0x97a; + undefined field_0x97b; + undefined field_0x97c; + undefined field_0x97d; + undefined field_0x97e; + undefined field_0x97f; + undefined field_0x980; + undefined field_0x981; + undefined field_0x982; + undefined field_0x983; + undefined field_0x984; + undefined field_0x985; + undefined field_0x986; + undefined field_0x987; + undefined field_0x988; + undefined field_0x989; + undefined field_0x98a; + undefined field_0x98b; + undefined field_0x98c; + undefined field_0x98d; + undefined field_0x98e; + undefined field_0x98f; + undefined field_0x990; + undefined field_0x991; + undefined field_0x992; + undefined field_0x993; + undefined field_0x994; + undefined field_0x995; + undefined field_0x996; + undefined field_0x997; + undefined field_0x998; + undefined field_0x999; + undefined field_0x99a; + undefined field_0x99b; + undefined field_0x99c; + undefined field_0x99d; + undefined field_0x99e; + undefined field_0x99f; + undefined field_0x9a0; + undefined field_0x9a1; + undefined field_0x9a2; + undefined field_0x9a3; + undefined field_0x9a4; + undefined field_0x9a5; + undefined field_0x9a6; + undefined field_0x9a7; + undefined field_0x9a8; + undefined field_0x9a9; + undefined field_0x9aa; + undefined field_0x9ab; + undefined field_0x9ac; + undefined field_0x9ad; + undefined field_0x9ae; + undefined field_0x9af; + undefined field_0x9b0; + undefined field_0x9b1; + undefined field_0x9b2; + undefined field_0x9b3; + undefined field_0x9b4; + undefined field_0x9b5; + undefined field_0x9b6; + undefined field_0x9b7; + undefined field_0x9b8; + undefined field_0x9b9; + undefined field_0x9ba; + undefined field_0x9bb; + undefined field_0x9bc; + undefined field_0x9bd; + undefined field_0x9be; + undefined field_0x9bf; + undefined field_0x9c0; + undefined field_0x9c1; + undefined field_0x9c2; + undefined field_0x9c3; + undefined field_0x9c4; + undefined field_0x9c5; + undefined field_0x9c6; + undefined field_0x9c7; + undefined field_0x9c8; + undefined field_0x9c9; + undefined field_0x9ca; + undefined field_0x9cb; + undefined field_0x9cc; + undefined field_0x9cd; + undefined field_0x9ce; + undefined field_0x9cf; + undefined field_0x9d0; + undefined field_0x9d1; + undefined field_0x9d2; + undefined field_0x9d3; + undefined field_0x9d4; + undefined field_0x9d5; + undefined field_0x9d6; + undefined field_0x9d7; + undefined field_0x9d8; + undefined field_0x9d9; + undefined field_0x9da; + undefined field_0x9db; + undefined field_0x9dc; + undefined field_0x9dd; + undefined field_0x9de; + undefined field_0x9df; + undefined field_0x9e0; + undefined field_0x9e1; + undefined field_0x9e2; + undefined field_0x9e3; + undefined field_0x9e4; + undefined field_0x9e5; + undefined field_0x9e6; + undefined field_0x9e7; + undefined field_0x9e8; + undefined field_0x9e9; + undefined field_0x9ea; + undefined field_0x9eb; + undefined field_0x9ec; + undefined field_0x9ed; + undefined field_0x9ee; + undefined field_0x9ef; + undefined field_0x9f0; + undefined field_0x9f1; + undefined field_0x9f2; + undefined field_0x9f3; + undefined field_0x9f4; + undefined field_0x9f5; + undefined field_0x9f6; + undefined field_0x9f7; + undefined field_0x9f8; + undefined field_0x9f9; + undefined field_0x9fa; + undefined field_0x9fb; + undefined field_0x9fc; + undefined field_0x9fd; + undefined field_0x9fe; + undefined field_0x9ff; + undefined field_0xa00; + undefined field_0xa01; + undefined field_0xa02; + undefined field_0xa03; + undefined field_0xa04; + undefined field_0xa05; + undefined field_0xa06; + undefined field_0xa07; + undefined field_0xa08; + undefined field_0xa09; + undefined field_0xa0a; + undefined field_0xa0b; + undefined field_0xa0c; + undefined field_0xa0d; + undefined field_0xa0e; + undefined field_0xa0f; + undefined field_0xa10; + undefined field_0xa11; + undefined field_0xa12; + undefined field_0xa13; + undefined field_0xa14; + undefined field_0xa15; + undefined field_0xa16; + undefined field_0xa17; + undefined field_0xa18; + undefined field_0xa19; + undefined field_0xa1a; + undefined field_0xa1b; + undefined field_0xa1c; + undefined field_0xa1d; + undefined field_0xa1e; + undefined field_0xa1f; + undefined field_0xa20; + undefined field_0xa21; + undefined field_0xa22; + undefined field_0xa23; + undefined field_0xa24; + undefined field_0xa25; + undefined field_0xa26; + undefined field_0xa27; + undefined field_0xa28; + undefined field_0xa29; + undefined field_0xa2a; + undefined field_0xa2b; + undefined field_0xa2c; + undefined field_0xa2d; + undefined field_0xa2e; + undefined field_0xa2f; + undefined field_0xa30; + undefined field_0xa31; + undefined field_0xa32; + undefined field_0xa33; + undefined field_0xa34; + undefined field_0xa35; + undefined field_0xa36; + undefined field_0xa37; + undefined field_0xa38; + undefined field_0xa39; + undefined field_0xa3a; + undefined field_0xa3b; + undefined field_0xa3c; + undefined field_0xa3d; + undefined field_0xa3e; + undefined field_0xa3f; + undefined field_0xa40; + undefined field_0xa41; + undefined field_0xa42; + undefined field_0xa43; + undefined field_0xa44; + undefined field_0xa45; + undefined field_0xa46; + undefined field_0xa47; + undefined field_0xa48; + undefined field_0xa49; + undefined field_0xa4a; + undefined field_0xa4b; + undefined field_0xa4c; + undefined field_0xa4d; + undefined field_0xa4e; + undefined field_0xa4f; + undefined field_0xa50; + undefined field_0xa51; + undefined field_0xa52; + undefined field_0xa53; + undefined field_0xa54; + undefined field_0xa55; + undefined field_0xa56; + undefined field_0xa57; + undefined field_0xa58; + undefined field_0xa59; + undefined field_0xa5a; + undefined field_0xa5b; + undefined field_0xa5c; + undefined field_0xa5d; + undefined field_0xa5e; + undefined field_0xa5f; + undefined field_0xa60; + undefined field_0xa61; + undefined field_0xa62; + undefined field_0xa63; + undefined field_0xa64; + undefined field_0xa65; + undefined field_0xa66; + undefined field_0xa67; + undefined field_0xa68; + undefined field_0xa69; + undefined field_0xa6a; + undefined field_0xa6b; + undefined field_0xa6c; + undefined field_0xa6d; + undefined field_0xa6e; + undefined field_0xa6f; + undefined field_0xa70; + undefined field_0xa71; + undefined field_0xa72; + undefined field_0xa73; + undefined field_0xa74; + undefined field_0xa75; + undefined field_0xa76; + undefined field_0xa77; + undefined field_0xa78; + undefined field_0xa79; + undefined field_0xa7a; + undefined field_0xa7b; + undefined field_0xa7c; + undefined field_0xa7d; + undefined field_0xa7e; + undefined field_0xa7f; + undefined field_0xa80; + undefined field_0xa81; + undefined field_0xa82; + undefined field_0xa83; + undefined field_0xa84; + undefined field_0xa85; + undefined field_0xa86; + undefined field_0xa87; + undefined field_0xa88; + undefined field_0xa89; + undefined field_0xa8a; + undefined field_0xa8b; + undefined field_0xa8c; + undefined field_0xa8d; + undefined field_0xa8e; + undefined field_0xa8f; + undefined field_0xa90; + undefined field_0xa91; + undefined field_0xa92; + undefined field_0xa93; + undefined field_0xa94; + undefined field_0xa95; + undefined field_0xa96; + undefined field_0xa97; + undefined field_0xa98; + undefined field_0xa99; + undefined field_0xa9a; + undefined field_0xa9b; + undefined field_0xa9c; + undefined field_0xa9d; + undefined field_0xa9e; + undefined field_0xa9f; + undefined field_0xaa0; + undefined field_0xaa1; + undefined field_0xaa2; + undefined field_0xaa3; + undefined field_0xaa4; + undefined field_0xaa5; + undefined field_0xaa6; + undefined field_0xaa7; + undefined field_0xaa8; + undefined field_0xaa9; + undefined field_0xaaa; + undefined field_0xaab; + undefined field_0xaac; + undefined field_0xaad; + undefined field_0xaae; + undefined field_0xaaf; + undefined field_0xab0; + undefined field_0xab1; + undefined field_0xab2; + undefined field_0xab3; + undefined field_0xab4; + undefined field_0xab5; + undefined field_0xab6; + undefined field_0xab7; + undefined field_0xab8; + undefined field_0xab9; + undefined field_0xaba; + undefined field_0xabb; + undefined field_0xabc; + undefined field_0xabd; + undefined field_0xabe; + undefined field_0xabf; + undefined field_0xac0; + undefined field_0xac1; + undefined field_0xac2; + undefined field_0xac3; + undefined field_0xac4; + undefined field_0xac5; + undefined field_0xac6; + undefined field_0xac7; + undefined field_0xac8; + undefined field_0xac9; + undefined field_0xaca; + undefined field_0xacb; + undefined field_0xacc; + undefined field_0xacd; + undefined field_0xace; + undefined field_0xacf; + undefined field_0xad0; + undefined field_0xad1; + undefined field_0xad2; + undefined field_0xad3; + undefined field_0xad4; + undefined field_0xad5; + undefined field_0xad6; + undefined field_0xad7; + undefined field_0xad8; + undefined field_0xad9; + undefined field_0xada; + undefined field_0xadb; + undefined field_0xadc; + undefined field_0xadd; + undefined field_0xade; + undefined field_0xadf; + undefined field_0xae0; + undefined field_0xae1; + undefined field_0xae2; + undefined field_0xae3; + undefined field_0xae4; + undefined field_0xae5; + undefined field_0xae6; + undefined field_0xae7; + undefined field_0xae8; + undefined field_0xae9; + undefined field_0xaea; + undefined field_0xaeb; + undefined field_0xaec; + undefined field_0xaed; + undefined field_0xaee; + undefined field_0xaef; + undefined field_0xaf0; + undefined field_0xaf1; + undefined field_0xaf2; + undefined field_0xaf3; + undefined field_0xaf4; + undefined field_0xaf5; + undefined field_0xaf6; + undefined field_0xaf7; + undefined field_0xaf8; + undefined field_0xaf9; + undefined field_0xafa; + undefined field_0xafb; + undefined field_0xafc; + undefined field_0xafd; + undefined field_0xafe; + undefined field_0xaff; + undefined field_0xb00; + undefined field_0xb01; + undefined field_0xb02; + undefined field_0xb03; + undefined field_0xb04; + undefined field_0xb05; + undefined field_0xb06; + undefined field_0xb07; + undefined field_0xb08; + undefined field_0xb09; + undefined field_0xb0a; + undefined field_0xb0b; + undefined field_0xb0c; + undefined field_0xb0d; + undefined field_0xb0e; + undefined field_0xb0f; + undefined field_0xb10; + undefined field_0xb11; + undefined field_0xb12; + undefined field_0xb13; + undefined field_0xb14; + undefined field_0xb15; + undefined field_0xb16; + undefined field_0xb17; + undefined field_0xb18; + undefined field_0xb19; + undefined field_0xb1a; + undefined field_0xb1b; + undefined field_0xb1c; + undefined field_0xb1d; + undefined field_0xb1e; + undefined field_0xb1f; + undefined field_0xb20; + undefined field_0xb21; + undefined field_0xb22; + undefined field_0xb23; + undefined field_0xb24; + undefined field_0xb25; + undefined field_0xb26; + undefined field_0xb27; + undefined field_0xb28; + undefined field_0xb29; + undefined field_0xb2a; + undefined field_0xb2b; + undefined field_0xb2c; + undefined field_0xb2d; + undefined field_0xb2e; + undefined field_0xb2f; + undefined field_0xb30; + undefined field_0xb31; + undefined field_0xb32; + undefined field_0xb33; + undefined field_0xb34; + undefined field_0xb35; + undefined field_0xb36; + undefined field_0xb37; + undefined field_0xb38; + undefined field_0xb39; + undefined field_0xb3a; + undefined field_0xb3b; + undefined field_0xb3c; + undefined field_0xb3d; + undefined field_0xb3e; + undefined field_0xb3f; + undefined field_0xb40; + undefined field_0xb41; + undefined field_0xb42; + undefined field_0xb43; + undefined field_0xb44; + undefined field_0xb45; + undefined field_0xb46; + undefined field_0xb47; + undefined field_0xb48; + undefined field_0xb49; + undefined field_0xb4a; + undefined field_0xb4b; + undefined field_0xb4c; + undefined field_0xb4d; + undefined field_0xb4e; + undefined field_0xb4f; + undefined field_0xb50; + undefined field_0xb51; + undefined field_0xb52; + undefined field_0xb53; + undefined field_0xb54; + undefined field_0xb55; + undefined field_0xb56; + undefined field_0xb57; + undefined field_0xb58; + undefined field_0xb59; + undefined field_0xb5a; + undefined field_0xb5b; + undefined field_0xb5c; + undefined field_0xb5d; + undefined field_0xb5e; + undefined field_0xb5f; + undefined field_0xb60; + undefined field_0xb61; + undefined field_0xb62; + undefined field_0xb63; + undefined field_0xb64; + undefined field_0xb65; + undefined field_0xb66; + undefined field_0xb67; + undefined field_0xb68; + undefined field_0xb69; + undefined field_0xb6a; + undefined field_0xb6b; + undefined field_0xb6c; + undefined field_0xb6d; + undefined field_0xb6e; + undefined field_0xb6f; + undefined field_0xb70; + undefined field_0xb71; + undefined field_0xb72; + undefined field_0xb73; + undefined field_0xb74; + undefined field_0xb75; + undefined field_0xb76; + undefined field_0xb77; + undefined field_0xb78; + undefined field_0xb79; + undefined field_0xb7a; + undefined field_0xb7b; + undefined field_0xb7c; + undefined field_0xb7d; + undefined field_0xb7e; + undefined field_0xb7f; + undefined field_0xb80; + undefined field_0xb81; + undefined field_0xb82; + undefined field_0xb83; + undefined field_0xb84; + undefined field_0xb85; + undefined field_0xb86; + undefined field_0xb87; + undefined field_0xb88; + undefined field_0xb89; + undefined field_0xb8a; + undefined field_0xb8b; + undefined field_0xb8c; + undefined field_0xb8d; + undefined field_0xb8e; + undefined field_0xb8f; + undefined field_0xb90; + undefined field_0xb91; + undefined field_0xb92; + undefined field_0xb93; + undefined field_0xb94; + undefined field_0xb95; + undefined field_0xb96; + undefined field_0xb97; + undefined field_0xb98; + undefined field_0xb99; + undefined field_0xb9a; + undefined field_0xb9b; + undefined field_0xb9c; + undefined field_0xb9d; + undefined field_0xb9e; + undefined field_0xb9f; + undefined field_0xba0; + undefined field_0xba1; + undefined field_0xba2; + undefined field_0xba3; + undefined field_0xba4; + undefined field_0xba5; + undefined field_0xba6; + undefined field_0xba7; + undefined field_0xba8; + undefined field_0xba9; + undefined field_0xbaa; + undefined field_0xbab; + undefined field_0xbac; + undefined field_0xbad; + undefined field_0xbae; + undefined field_0xbaf; + undefined field_0xbb0; + undefined field_0xbb1; + undefined field_0xbb2; + undefined field_0xbb3; + undefined field_0xbb4; + undefined field_0xbb5; + undefined field_0xbb6; + undefined field_0xbb7; + undefined field_0xbb8; + undefined field_0xbb9; + undefined field_0xbba; + undefined field_0xbbb; + undefined field_0xbbc; + undefined field_0xbbd; + undefined field_0xbbe; + undefined field_0xbbf; + undefined field_0xbc0; + undefined field_0xbc1; + undefined field_0xbc2; + undefined field_0xbc3; + undefined field_0xbc4; + undefined field_0xbc5; + undefined field_0xbc6; + undefined field_0xbc7; + undefined field_0xbc8; + undefined field_0xbc9; + undefined field_0xbca; + undefined field_0xbcb; + undefined field_0xbcc; + undefined field_0xbcd; + undefined field_0xbce; + undefined field_0xbcf; + undefined field_0xbd0; + undefined field_0xbd1; + undefined field_0xbd2; + undefined field_0xbd3; + undefined field_0xbd4; + undefined field_0xbd5; + undefined field_0xbd6; + undefined field_0xbd7; + undefined field_0xbd8; + undefined field_0xbd9; + undefined field_0xbda; + undefined field_0xbdb; + undefined field_0xbdc; + undefined field_0xbdd; + undefined field_0xbde; + undefined field_0xbdf; + undefined field_0xbe0; + undefined field_0xbe1; + undefined field_0xbe2; + undefined field_0xbe3; + undefined field_0xbe4; + undefined field_0xbe5; + undefined field_0xbe6; + undefined field_0xbe7; + undefined field_0xbe8; + undefined field_0xbe9; + undefined field_0xbea; + undefined field_0xbeb; + undefined field_0xbec; + undefined field_0xbed; + undefined field_0xbee; + undefined field_0xbef; + undefined field_0xbf0; + undefined field_0xbf1; + undefined field_0xbf2; + undefined field_0xbf3; + undefined field_0xbf4; + undefined field_0xbf5; + undefined field_0xbf6; + undefined field_0xbf7; + undefined field_0xbf8; + undefined field_0xbf9; + undefined field_0xbfa; + undefined field_0xbfb; + undefined field_0xbfc; + undefined field_0xbfd; + undefined field_0xbfe; + undefined field_0xbff; + undefined field_0xc00; + undefined field_0xc01; + undefined field_0xc02; + undefined field_0xc03; + undefined field_0xc04; + undefined field_0xc05; + undefined field_0xc06; + undefined field_0xc07; + undefined field_0xc08; + undefined field_0xc09; + undefined field_0xc0a; + undefined field_0xc0b; + undefined field_0xc0c; + undefined field_0xc0d; + undefined field_0xc0e; + undefined field_0xc0f; + undefined field_0xc10; + undefined field_0xc11; + undefined field_0xc12; + undefined field_0xc13; + undefined field_0xc14; + undefined field_0xc15; + undefined field_0xc16; + undefined field_0xc17; + undefined field_0xc18; + undefined field_0xc19; + undefined field_0xc1a; + undefined field_0xc1b; + undefined field_0xc1c; + undefined field_0xc1d; + undefined field_0xc1e; + undefined field_0xc1f; + undefined field_0xc20; + undefined field_0xc21; + undefined field_0xc22; + undefined field_0xc23; + undefined field_0xc24; + undefined field_0xc25; + undefined field_0xc26; + undefined field_0xc27; + +public: + void SetGate(float param_1); + uint Process(int param_1); + void ResetLimiter(); + SoftwareLimiter(); +}; + + +#endif //VIPER_SOFTWARELIMITER_H diff --git a/src/util/TimeConstDelay.cpp b/src/util/TimeConstDelay.cpp new file mode 100644 index 0000000..194f3a9 --- /dev/null +++ b/src/util/TimeConstDelay.cpp @@ -0,0 +1,76 @@ +// +// Created by mart on 2/12/21. +// + +#include "TimeConstDelay.h" + +// TimeConstDelay::TimeConstDelay() + +TimeConstDelay::TimeConstDelay() { + *(undefined4 *)this = 0; + *(undefined4 *)(this + 4) = 0; + *(undefined4 *)(this + 8) = 0; + return; +} + + + +// TimeConstDelay::~TimeConstDelay() + +TimeConstDelay::~TimeConstDelay() { + if (*(void **)this != nullptr) { + operator_delete__(*(void **)this); + *(undefined4 *)this = 0; + } + return this; +} + + + +// TimeConstDelay::SetParameters(unsigned int, float) + +void TimeConstDelay::SetParameters(uint param_1,float param_2) { + uint uVar1; + void *__s; + float in_r2; + float fVar2; + + fVar2 = ROUND((float)(ulonglong)param_1 * in_r2 + 0.5); + *(float *)(this + 8) = fVar2; + if (*(void **)this != nullptr) { + operator_delete__(*(void **)this); + fVar2 = *(float *)(this + 8); + } + if ((uint)fVar2 < 0x1fc00001) { + uVar1 = (int)fVar2 << 2; + } + else { + uVar1 = 0xffffffff; + } + __s = operator_new__(uVar1); + *(void **)this = __s; + memset(__s,0,*(int *)(this + 8) << 2); + *(undefined4 *)(this + 4) = 0; + return; +} + + + +// TimeConstDelay::ProcessSample(int) + +undefined4 TimeConstDelay::ProcessSample(int param_1) { + undefined4 in_r1; + undefined4 extraout_r1; + int iVar1; + undefined4 uVar2; + + iVar1 = *(int *)param_1; + if (iVar1 != 0) { + uVar2 = *(undefined4 *)(iVar1 + *(int *)(param_1 + 4) * 4); + *(undefined4 *)(iVar1 + *(int *)(param_1 + 4) * 4) = in_r1; + __aeabi_idivmod(*(int *)(param_1 + 4) + 1,*(undefined4 *)(param_1 + 8)); + *(undefined4 *)(param_1 + 4) = extraout_r1; + return uVar2; + } + return 0; +} diff --git a/src/util/TimeConstDelay.h b/src/util/TimeConstDelay.h new file mode 100644 index 0000000..76f3ae9 --- /dev/null +++ b/src/util/TimeConstDelay.h @@ -0,0 +1,22 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_TIMECONSTDELAY_H +#define VIPER_TIMECONSTDELAY_H + + +class TimeConstDelay { + undefined4 field_0x0; + undefined4 field_0x4; + undefined4 field_0x8; + +public: + TimeConstDelay(); + ~TimeConstDelay(); + void SetParameters(uint param_1,float param_2); + undefined4 ProcessSample(int param_1); +}; + + +#endif //VIPER_TIMECONSTDELAY_H diff --git a/src/util/WaveBuffer_I32.cpp b/src/util/WaveBuffer_I32.cpp new file mode 100644 index 0000000..5f87de3 --- /dev/null +++ b/src/util/WaveBuffer_I32.cpp @@ -0,0 +1,265 @@ +// +// Created by mart on 2/12/21. +// + +#include "WaveBuffer_I32.h" + + +// WaveBuffer_I32::WaveBuffer_I32(unsigned int, unsigned int) + +WaveBuffer_I32::WaveBuffer_I32(uint param_1,uint param_2) { + void *pvVar1; + + *(uint *)(this + 0xc) = param_1; + *(uint *)(this + 4) = param_2 * param_1; + *(undefined4 *)(this + 8) = 0; + pvVar1 = valloc(param_2 * param_1 * 4); + *(void **)this = pvVar1; + return this; +} + + + +// WaveBuffer_I32::~WaveBuffer_I32() + +WaveBuffer_I32::~WaveBuffer_I32() { + if (*(void **)this != nullptr) { + free(*(void **)this); + } + *(undefined4 *)this = 0; + return this; +} + + + +// WaveBuffer_I32::PushZerosGetBuffer(unsigned int) + +void * WaveBuffer_I32::PushZerosGetBuffer(uint param_1) { + uint uVar1; + int iVar2; + void *pvVar3; + int iVar4; + + pvVar3 = *(void **)this; + if (pvVar3 == nullptr) { + return nullptr; + } + if (param_1 != 0) { + iVar4 = *(int *)(this + 8); + iVar2 = *(int *)(this + 0xc); + uVar1 = iVar2 * param_1 + iVar4; + if (*(uint *)(this + 4) < uVar1) { + pvVar3 = valloc(uVar1 * 4); + if (pvVar3 == nullptr) { + return nullptr; + } + memcpy(pvVar3,*(void **)this,*(int *)(this + 8) << 2); + free(*(void **)this); + iVar4 = *(int *)(this + 8); + iVar2 = *(int *)(this + 0xc); + *(void **)this = pvVar3; + *(uint *)(this + 4) = iVar2 * param_1 + iVar4; + } + pvVar3 = (void *)((int)pvVar3 + iVar4 * 4); + memset(pvVar3,0,iVar2 * param_1 * 4); + *(uint *)(this + 8) = *(int *)(this + 0xc) * param_1 + *(int *)(this + 8); + return pvVar3; + } + return (void *)((int)pvVar3 + *(int *)(this + 8) * 4); +} + + + +// WaveBuffer_I32::PushZeros(unsigned int) + +undefined4 WaveBuffer_I32::PushZeros(uint param_1) { + uint uVar1; + int iVar2; + int iVar3; + void *__dest; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (param_1 != 0) { + iVar2 = *(int *)(this + 8); + iVar3 = *(int *)(this + 0xc); + uVar1 = iVar3 * param_1 + iVar2; + if (*(uint *)(this + 4) < uVar1) { + __dest = valloc(uVar1 * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,*(void **)this,*(int *)(this + 8) << 2); + free(*(void **)this); + iVar2 = *(int *)(this + 8); + iVar3 = *(int *)(this + 0xc); + *(void **)this = __dest; + *(uint *)(this + 4) = iVar3 * param_1 + iVar2; + } + memset((void *)((int)__dest + iVar2 * 4),0,iVar3 * param_1 * 4); + *(uint *)(this + 8) = *(int *)(this + 0xc) * param_1 + *(int *)(this + 8); + return 1; + } + return 1; +} + + + +// WaveBuffer_I32::PushSamples(int*, unsigned int) + +undefined4 WaveBuffer_I32::PushSamples(int *param_1,uint param_2) { + uint uVar1; + int iVar2; + int iVar3; + void *__dest; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (param_2 != 0) { + iVar2 = *(int *)(this + 8); + iVar3 = *(int *)(this + 0xc); + uVar1 = iVar3 * param_2 + iVar2; + if (*(uint *)(this + 4) < uVar1) { + __dest = valloc(uVar1 * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,*(void **)this,*(int *)(this + 8) << 2); + free(*(void **)this); + iVar2 = *(int *)(this + 8); + iVar3 = *(int *)(this + 0xc); + *(void **)this = __dest; + *(uint *)(this + 4) = iVar3 * param_2 + iVar2; + } + memcpy((void *)((int)__dest + iVar2 * 4),param_1,iVar3 * param_2 * 4); + *(uint *)(this + 8) = *(int *)(this + 0xc) * param_2 + *(int *)(this + 8); + return 1; + } + return 1; +} + + + +// WaveBuffer_I32::PopSamples(unsigned int, bool) + +uint WaveBuffer_I32::PopSamples(uint param_1,bool param_2) { + uint uVar1; + void *__dest; + uint uVar2; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (*(int *)(this + 4) == 0) { + return 0; + } + uVar1 = *(uint *)(this + 8); + uVar2 = *(int *)(this + 0xc) * param_1; + if (uVar2 < uVar1 || uVar2 - uVar1 == 0) { + *(uint *)(this + 8) = uVar1 - uVar2; + memmove(__dest,(void *)((int)__dest + uVar2 * 4),(uVar1 - uVar2) * 4); + return param_1; + } + if (param_2 == false) { + return 0; + } + uVar1 = __udivsi3(); + *(undefined4 *)(this + 8) = 0; + return uVar1; +} + + + +// WaveBuffer_I32::PopSamples(int*, unsigned int, bool) + +uint WaveBuffer_I32::PopSamples(int *param_1,uint param_2,bool param_3) { + uint uVar1; + int iVar2; + void *__src; + uint uVar3; + + __src = *(void **)this; + if (__src == nullptr) { + return 0; + } + if (*(int *)(this + 4) == 0) { + return 0; + } + uVar3 = *(uint *)(this + 8); + uVar1 = *(int *)(this + 0xc) * param_2; + if (uVar1 < uVar3 || uVar1 - uVar3 == 0) { + memcpy(param_1,__src,uVar1 * 4); + iVar2 = *(int *)(this + 8) - *(int *)(this + 0xc) * param_2; + *(int *)(this + 8) = iVar2; + memmove(*(void **)this,(void *)((int)*(void **)this + *(int *)(this + 0xc) * param_2 * 4), + iVar2 * 4); + return param_2; + } + if (param_3 == false) { + return 0; + } + uVar1 = __udivsi3(uVar3); + memcpy(param_1,__src,uVar3 << 2); + *(undefined4 *)(this + 8) = 0; + return uVar1; +} + + + +// WaveBuffer_I32::Reset() + +void WaveBuffer_I32::Reset() { + *(undefined4 *)(this + 8) = 0; + return; +} + + + +// WaveBuffer_I32::SetBufferOffset(unsigned int) + +void WaveBuffer_I32::SetBufferOffset(uint param_1) { + uint uVar1; + int iVar2; + + iVar2 = *(int *)(this + 0xc); + uVar1 = __udivsi3(*(undefined4 *)(this + 4),iVar2); + if (param_1 <= uVar1) { + *(uint *)(this + 8) = iVar2 * param_1; + } + return; +} + + + +// WaveBuffer_I32::GetBufferOffset() + +void WaveBuffer_I32::GetBufferOffset(void) { + int in_r0; + + __udivsi3(*(undefined4 *)(in_r0 + 8),*(undefined4 *)(in_r0 + 0xc)); + return; +} + + + +// WaveBuffer_I32::GetBufferSize() + +void WaveBuffer_I32::GetBufferSize(void) { + int in_r0; + + __udivsi3(*(undefined4 *)(in_r0 + 4),*(undefined4 *)(in_r0 + 0xc)); + return; +} + + + +// WaveBuffer_I32::GetCurrentBufferI32Ptr() + +undefined4 WaveBuffer_I32::GetCurrentBufferI32Ptr() { + return *(undefined4 *)this; +} diff --git a/src/util/WaveBuffer_I32.h b/src/util/WaveBuffer_I32.h new file mode 100644 index 0000000..84b4d1c --- /dev/null +++ b/src/util/WaveBuffer_I32.h @@ -0,0 +1,31 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_WAVEBUFFER_I32_H +#define VIPER_WAVEBUFFER_I32_H + + +class WaveBuffer_I32 { + void* field_0x0; + uint field_0x4; + undefined4 field_0x8; + uint field_0xc; + +public: + WaveBuffer_I32(uint param_1,uint param_2); + ~WaveBuffer_I32(); + void * PushZerosGetBuffer(uint param_1); + undefined4 PushZeros(uint param_1); + undefined4 PushSamples(int *param_1,uint param_2); + uint PopSamples(uint param_1,bool param_2); + uint PopSamples(int *param_1,uint param_2,bool param_3); + void Reset(); + void SetBufferOffset(uint param_1); + void GetBufferOffset(); + void GetBufferSize(); + undefined4 GetCurrentBufferI32Ptr(); +}; + + +#endif //VIPER_WAVEBUFFER_I32_H diff --git a/src/util/WaveBuffer_R32.cpp b/src/util/WaveBuffer_R32.cpp new file mode 100644 index 0000000..9672142 --- /dev/null +++ b/src/util/WaveBuffer_R32.cpp @@ -0,0 +1,809 @@ +// +// Created by mart on 2/12/21. +// + +#include "WaveBuffer_R32.h" + + + +// WaveBuffer_R32::WaveBuffer_R32(unsigned int, unsigned int) + +WaveBuffer_R32::WaveBuffer_R32(uint param_1,uint param_2) { + void *pvVar1; + + *(uint *)&this->field_0xc = param_1; + *(uint *)&this->field_0x4 = param_2 * param_1; + *(undefined4 *)&this->field_0x8 = 0; + pvVar1 = valloc(param_2 * param_1 * 4); + *(void **)this = pvVar1; + return this; +} + + + +// WaveBuffer_R32::~WaveBuffer_R32() + +WaveBuffer_R32::~WaveBuffer_R32() { + if (*(void **)this != nullptr) { + free(*(void **)this); + } + *(undefined4 *)this = 0; + return this; +} + + + +// WaveBuffer_R32::Short2Float(short*, float*, unsigned int) + +void WaveBuffer_R32::Short2Float(short *param_1,float *param_2,uint param_3) { + bool bVar1; + undefined4 uVar2; + int iVar3; + undefined8 *puVar4; + short *psVar5; + float *pfVar6; + uint uVar7; + uint uVar8; + uint uVar9; + undefined4 in_cr7; + undefined auVar10 [16]; + + uVar7 = *(int *)&this->field_0xc * param_3; + if (uVar7 < 4) { + iVar3 = uVar7 - 1; + if (uVar7 != 0) { + psVar5 = param_1 + uVar7; + pfVar6 = param_2 + uVar7; + do { + psVar5 = psVar5 + -1; + iVar3 = iVar3 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + pfVar6 = pfVar6 + -1; + *pfVar6 = (float)(longlong)(int)*psVar5; + } while (iVar3 != -1); + } + } + else { + uVar9 = uVar7 & 3; + if (uVar7 >> 2 != 0) { + puVar4 = (undefined8 *)param_2; + uVar7 = uVar7 >> 2; + psVar5 = param_1; + do { + uVar2 = CONCAT22(*psVar5,*psVar5); + psVar5 = psVar5 + 4; + auVar10 = VectorCopyLong(CONCAT44(uVar2,uVar2),2,0); + auVar10 = FixedToFP(auVar10,0x20,0x20,0,0,0); + auVar10 = FloatVectorMult(auVar10,ZEXT816(0x3800010038000100) & + ZEXT816(0x3800010038000100) << 0x40,2,0x20); + uVar8 = uVar7 - 1; + *puVar4 = CONCAT44(SUB164(auVar10,0),SUB164(auVar10,0)); + uVar2 = SUB164(auVar10 >> 0x40,0); + *(ulonglong *)((int)puVar4 + 4) = CONCAT44(uVar2,uVar2); + puVar4 = puVar4 + 2; + bVar1 = 0 < (int)uVar7; + uVar7 = uVar8; + } while (uVar8 != 0 && bVar1); + } + if (uVar9 != 0) { + psVar5 = param_1 + uVar9; + pfVar6 = param_2 + uVar9; + iVar3 = uVar9 - 1; + do { + psVar5 = psVar5 + -1; + iVar3 = iVar3 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + pfVar6 = pfVar6 + -1; + *pfVar6 = (float)(longlong)(int)*psVar5; + } while (iVar3 != -1); + return; + } + } + return; +} + + + +// WaveBuffer_R32::Float2Short(float*, short*, unsigned int) + +void WaveBuffer_R32::Float2Short(float *param_1,short *param_2,uint param_3) { + bool bVar1; + undefined auVar2 [16]; + float fVar3; + int iVar4; + ulonglong *puVar5; + float *pfVar6; + short *psVar7; + uint uVar8; + uint uVar9; + uint uVar10; + float *pfVar11; + undefined4 in_cr7; + ulonglong uVar12; + undefined auVar13 [16]; + undefined auVar14 [16]; + + uVar8 = *(int *)&this->field_0xc * param_3; + if (uVar8 < 4) { + iVar4 = uVar8 - 1; + if (uVar8 != 0) { + pfVar6 = param_1 + uVar8; + psVar7 = param_2 + uVar8; + do { + pfVar6 = pfVar6 + -1; + iVar4 = iVar4 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + psVar7 = psVar7 + -1; + *psVar7 = SUB42(ROUND(*pfVar6),0); + } while (iVar4 != -1); + } + } + else { + uVar10 = uVar8 & 3; + if (uVar8 >> 2 != 0) { + auVar2 = ZEXT816(0x3f8000003f800000) & ZEXT816(0x3f8000003f800000) << 0x40; + auVar14 = FloatVectorNeg(auVar2,2,0x20); + puVar5 = (ulonglong *)param_2; + uVar8 = uVar8 >> 2; + pfVar6 = param_1; + do { + fVar3 = *pfVar6; + pfVar11 = pfVar6 + 1; + pfVar6 = pfVar6 + 4; + auVar13 = FloatVectorMin(CONCAT88(CONCAT44(*pfVar11,*pfVar11),CONCAT44(fVar3,fVar3)),auVar2, + 2,0x20); + auVar13 = FloatVectorMax(auVar13,auVar14,2,0x20); + auVar13 = FloatVectorMult(auVar13,ZEXT816(0x46fffe0046fffe00) & + ZEXT816(0x46fffe0046fffe00) << 0x40,2,0x20); + auVar13 = FPToFixed(auVar13,0x20,0x20,0x10,0,3); + uVar12 = VectorRoundShiftRightNarrow(auVar13,0x10); + uVar9 = uVar8 - 1; + uVar12 = uVar12 & 0xffff | (uVar12 & 0xffff) << 0x10; + *puVar5 = uVar12 | uVar12 << 0x20; + puVar5 = puVar5 + 1; + bVar1 = 0 < (int)uVar8; + uVar8 = uVar9; + } while (uVar9 != 0 && bVar1); + } + if (uVar10 != 0) { + pfVar6 = param_1 + uVar10; + psVar7 = param_2 + uVar10; + iVar4 = uVar10 - 1; + do { + pfVar6 = pfVar6 + -1; + iVar4 = iVar4 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + psVar7 = psVar7 + -1; + *psVar7 = SUB42(ROUND(*pfVar6),0); + } while (iVar4 != -1); + return; + } + } + return; +} + + + +// WaveBuffer_R32::Int2Float(int*, float*, unsigned int) + +void WaveBuffer_R32::Int2Float(int *param_1,float *param_2,uint param_3) { + undefined4 uVar1; + int iVar2; + uint uVar3; + int *piVar4; + float *pfVar5; + undefined8 *puVar6; + uint uVar7; + uint uVar8; + undefined4 in_cr7; + undefined auVar9 [16]; + int iVar10; + undefined auVar11 [16]; + undefined auVar12 [16]; + undefined auVar13 [16]; + undefined auVar14 [16]; + undefined auVar15 [16]; + undefined auVar16 [16]; + undefined auVar17 [16]; + + uVar7 = *(int *)&this->field_0xc * param_3; + if (uVar7 < 0x20) { + iVar2 = uVar7 - 1; + if (uVar7 != 0) { + piVar4 = param_1 + uVar7; + pfVar5 = param_2 + uVar7; + do { + piVar4 = piVar4 + -1; + iVar2 = iVar2 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + pfVar5 = pfVar5 + -1; + *pfVar5 = (float)(longlong)*piVar4; + } while (iVar2 != -1); + } + } + else { + uVar8 = uVar7 & 0xffffffe0; + if (uVar8 != 0) { + uVar3 = 0; + piVar4 = param_1; + puVar6 = (undefined8 *)param_2; + do { + uVar3 = uVar3 + 0x20; + auVar9 = FixedToFP(CONCAT88(CONCAT44(piVar4[1],piVar4[1]),CONCAT44(*piVar4,*piVar4)),0x20, + 0x20,0,0,0); + auVar17 = FixedToFP(CONCAT88(CONCAT44(piVar4[5],piVar4[5]),CONCAT44(piVar4[4],piVar4[4])), + 0x20,0x20,0,0,0); + param_1 = piVar4 + 0x20; + auVar16 = FixedToFP(CONCAT88(CONCAT44(piVar4[9],piVar4[9]),CONCAT44(piVar4[8],piVar4[8])), + 0x20,0x20,0,0,0); + param_2 = (float *)(puVar6 + 0x10); + auVar15 = FixedToFP(CONCAT88(CONCAT44(piVar4[0xd],piVar4[0xd]), + CONCAT44(piVar4[0xc],piVar4[0xc])),0x20,0x20,0,0,0); + auVar14 = FixedToFP(CONCAT88(CONCAT44(piVar4[0x11],piVar4[0x11]), + CONCAT44(piVar4[0x10],piVar4[0x10])),0x20,0x20,0,0,0); + auVar13 = FixedToFP(CONCAT88(CONCAT44(piVar4[0x15],piVar4[0x15]), + CONCAT44(piVar4[0x14],piVar4[0x14])),0x20,0x20,0,0,0); + auVar12 = FixedToFP(CONCAT88(CONCAT44(piVar4[0x19],piVar4[0x19]), + CONCAT44(piVar4[0x18],piVar4[0x18])),0x20,0x20,0,0,0); + auVar11 = FixedToFP(CONCAT88(CONCAT44(piVar4[0x1d],piVar4[0x1d]), + CONCAT44(piVar4[0x1c],piVar4[0x1c])),0x20,0x20,0,0,0); + auVar9 = FloatVectorMult(auVar9,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + auVar17 = FloatVectorMult(auVar17,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + auVar16 = FloatVectorMult(auVar16,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + *puVar6 = CONCAT44(SUB164(auVar9,0),SUB164(auVar9,0)); + uVar1 = SUB164(auVar9 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 4) = CONCAT44(uVar1,uVar1); + auVar15 = FloatVectorMult(auVar15,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + auVar14 = FloatVectorMult(auVar14,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + puVar6[2] = CONCAT44(SUB164(auVar17,0),SUB164(auVar17,0)); + uVar1 = SUB164(auVar17 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x14) = CONCAT44(uVar1,uVar1); + auVar13 = FloatVectorMult(auVar13,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + auVar12 = FloatVectorMult(auVar12,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + puVar6[4] = CONCAT44(SUB164(auVar16,0),SUB164(auVar16,0)); + uVar1 = SUB164(auVar16 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x24) = CONCAT44(uVar1,uVar1); + auVar9 = FloatVectorMult(auVar11,CONCAT88(0x3300000033000000,0x3300000033000000),2,0x20); + puVar6[6] = CONCAT44(SUB164(auVar15,0),SUB164(auVar15,0)); + uVar1 = SUB164(auVar15 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x34) = CONCAT44(uVar1,uVar1); + puVar6[8] = CONCAT44(SUB164(auVar14,0),SUB164(auVar14,0)); + uVar1 = SUB164(auVar14 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x44) = CONCAT44(uVar1,uVar1); + puVar6[10] = CONCAT44(SUB164(auVar13,0),SUB164(auVar13,0)); + uVar1 = SUB164(auVar13 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x54) = CONCAT44(uVar1,uVar1); + puVar6[0xc] = CONCAT44(SUB164(auVar12,0),SUB164(auVar12,0)); + uVar1 = SUB164(auVar12 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 100) = CONCAT44(uVar1,uVar1); + puVar6[0xe] = CONCAT44(SUB164(auVar9,0),SUB164(auVar9,0)); + uVar1 = SUB164(auVar9 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x74) = CONCAT44(uVar1,uVar1); + piVar4 = param_1; + puVar6 = (undefined8 *)param_2; + } while (uVar3 < uVar8); + } + iVar2 = (uVar7 - uVar8) + -1; + if (uVar7 - uVar8 != 0) { + do { + iVar10 = *param_1; + param_1 = param_1 + 1; + iVar2 = iVar2 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + *param_2 = (float)(longlong)iVar10; + param_2 = (float *)((int)param_2 + 4); + } while (iVar2 != -1); + return; + } + } + return; +} + + + +// WaveBuffer_R32::Float2Int(float*, int*, unsigned int) + +void WaveBuffer_R32::Float2Int(float *param_1,int *param_2,uint param_3) { + undefined4 uVar1; + int iVar2; + uint uVar3; + float *pfVar4; + float *pfVar5; + undefined8 *puVar6; + uint uVar7; + uint uVar8; + undefined4 in_cr7; + float fVar9; + undefined in_q3 [16]; + float fVar11; + undefined auVar10 [16]; + undefined auVar12 [16]; + undefined auVar13 [16]; + undefined auVar14 [16]; + undefined auVar15 [16]; + undefined auVar16 [16]; + undefined auVar17 [16]; + undefined auVar18 [16]; + + uVar7 = *(int *)&this->field_0xc * param_3; + if (uVar7 < 0x20) { + iVar2 = uVar7 - 1; + if (uVar7 != 0) { + auVar10 = CONCAT412(SUB164(in_q3 >> 0x60,0), + CONCAT48(0x3f000000, + SUB128(CONCAT84(SUB168(in_q3 >> 0x40,0),0x4c000000),0) << 0x20)); + pfVar4 = param_1 + uVar7; + pfVar5 = (float *)(param_2 + uVar7); + do { + pfVar4 = pfVar4 + -1; + iVar2 = iVar2 + -1; + fVar9 = SUB164(auVar10 >> 0x40,0) + *pfVar4 * SUB164(auVar10 >> 0x20,0); + fVar11 = ROUND(fVar9); + auVar10 = CONCAT412(fVar11,SUB1612(CONCAT124(SUB1612(CONCAT412(*pfVar4,SUB1612(auVar10,0)) + >> 0x20,0),fVar9),0)); + pfVar5 = pfVar5 + -1; + *pfVar5 = fVar11; + } while (iVar2 != -1); + } + } + else { + uVar8 = uVar7 & 0xffffffe0; + if (uVar8 != 0) { + uVar3 = 0; + pfVar4 = param_1; + puVar6 = (undefined8 *)param_2; + do { + uVar3 = uVar3 + 0x20; + auVar10 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[1],pfVar4[1]),CONCAT44(*pfVar4,*pfVar4)), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + auVar18 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[5],pfVar4[5]), + CONCAT44(pfVar4[4],pfVar4[4])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + param_1 = pfVar4 + 0x20; + auVar17 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[9],pfVar4[9]), + CONCAT44(pfVar4[8],pfVar4[8])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + param_2 = (int *)(puVar6 + 0x10); + auVar16 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[0xd],pfVar4[0xd]), + CONCAT44(pfVar4[0xc],pfVar4[0xc])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + auVar15 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[0x11],pfVar4[0x11]), + CONCAT44(pfVar4[0x10],pfVar4[0x10])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + auVar14 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[0x15],pfVar4[0x15]), + CONCAT44(pfVar4[0x14],pfVar4[0x14])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + auVar13 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[0x19],pfVar4[0x19]), + CONCAT44(pfVar4[0x18],pfVar4[0x18])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + auVar12 = FloatVectorMult(CONCAT88(CONCAT44(pfVar4[0x1d],pfVar4[0x1d]), + CONCAT44(pfVar4[0x1c],pfVar4[0x1c])), + CONCAT88(0x4c0000004c000000,0x4c0000004c000000),2,0x20); + auVar10 = FPToFixed(auVar10,0x20,0x20,0,0,3); + auVar18 = FPToFixed(auVar18,0x20,0x20,0,0,3); + auVar17 = FPToFixed(auVar17,0x20,0x20,0,0,3); + *puVar6 = CONCAT44(SUB164(auVar10,0),SUB164(auVar10,0)); + uVar1 = SUB164(auVar10 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 4) = CONCAT44(uVar1,uVar1); + auVar16 = FPToFixed(auVar16,0x20,0x20,0,0,3); + auVar15 = FPToFixed(auVar15,0x20,0x20,0,0,3); + puVar6[2] = CONCAT44(SUB164(auVar18,0),SUB164(auVar18,0)); + uVar1 = SUB164(auVar18 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x14) = CONCAT44(uVar1,uVar1); + auVar14 = FPToFixed(auVar14,0x20,0x20,0,0,3); + auVar13 = FPToFixed(auVar13,0x20,0x20,0,0,3); + puVar6[4] = CONCAT44(SUB164(auVar17,0),SUB164(auVar17,0)); + uVar1 = SUB164(auVar17 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x24) = CONCAT44(uVar1,uVar1); + auVar10 = FPToFixed(auVar12,0x20,0x20,0,0,3); + puVar6[6] = CONCAT44(SUB164(auVar16,0),SUB164(auVar16,0)); + uVar1 = SUB164(auVar16 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x34) = CONCAT44(uVar1,uVar1); + puVar6[8] = CONCAT44(SUB164(auVar15,0),SUB164(auVar15,0)); + uVar1 = SUB164(auVar15 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x44) = CONCAT44(uVar1,uVar1); + puVar6[10] = CONCAT44(SUB164(auVar14,0),SUB164(auVar14,0)); + uVar1 = SUB164(auVar14 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x54) = CONCAT44(uVar1,uVar1); + puVar6[0xc] = CONCAT44(SUB164(auVar13,0),SUB164(auVar13,0)); + uVar1 = SUB164(auVar13 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 100) = CONCAT44(uVar1,uVar1); + puVar6[0xe] = CONCAT44(SUB164(auVar10,0),SUB164(auVar10,0)); + uVar1 = SUB164(auVar10 >> 0x40,0); + *(ulonglong *)((int)puVar6 + 0x74) = CONCAT44(uVar1,uVar1); + pfVar4 = param_1; + puVar6 = (undefined8 *)param_2; + } while (uVar3 < uVar8); + } + iVar2 = (uVar7 - uVar8) + -1; + if (uVar7 - uVar8 != 0) { + do { + fVar9 = *param_1; + param_1 = param_1 + 1; + iVar2 = iVar2 + -1; + coprocessor_function(10,6,4,in_cr7,in_cr7,in_cr7); + *param_2 = (int)ROUND(fVar9); + param_2 = (int *)((int)param_2 + 4); + } while (iVar2 != -1); + return; + } + } + return; +} + + + +// WaveBuffer_R32::PushZerosGetBuffer(unsigned int) + +void * WaveBuffer_R32::PushZerosGetBuffer(uint param_1) { + uint uVar1; + int iVar2; + void *pvVar3; + int iVar4; + + pvVar3 = *(void **)this; + if (pvVar3 == nullptr) { + return nullptr; + } + if (param_1 != 0) { + iVar4 = *(int *)&this->field_0x8; + iVar2 = *(int *)&this->field_0xc; + uVar1 = iVar2 * param_1 + iVar4; + if (*(uint *)&this->field_0x4 < uVar1) { + pvVar3 = valloc(uVar1 * 4); + if (pvVar3 == nullptr) { + return nullptr; + } + memcpy(pvVar3,*(void **)this,*(int *)&this->field_0x8 << 2); + free(*(void **)this); + iVar4 = *(int *)&this->field_0x8; + iVar2 = *(int *)&this->field_0xc; + *(void **)this = pvVar3; + *(uint *)&this->field_0x4 = iVar2 * param_1 + iVar4; + } + pvVar3 = (void *)((int)pvVar3 + iVar4 * 4); + memset(pvVar3,0,iVar2 * param_1 * 4); + *(uint *)&this->field_0x8 = *(int *)&this->field_0xc * param_1 + *(int *)&this->field_0x8; + return pvVar3; + } + return (void *)((int)pvVar3 + *(int *)&this->field_0x8 * 4); +} + + + +// WaveBuffer_R32::PushZeros(unsigned int) + +undefined4 WaveBuffer_R32::PushZeros(uint param_1) { + uint uVar1; + int iVar2; + int iVar3; + void *__dest; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (param_1 != 0) { + iVar2 = *(int *)&this->field_0x8; + iVar3 = *(int *)&this->field_0xc; + uVar1 = iVar3 * param_1 + iVar2; + if (*(uint *)&this->field_0x4 < uVar1) { + __dest = valloc(uVar1 * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,*(void **)this,*(int *)&this->field_0x8 << 2); + free(*(void **)this); + iVar2 = *(int *)&this->field_0x8; + iVar3 = *(int *)&this->field_0xc; + *(void **)this = __dest; + *(uint *)&this->field_0x4 = iVar3 * param_1 + iVar2; + } + memset((void *)((int)__dest + iVar2 * 4),0,iVar3 * param_1 * 4); + *(uint *)&this->field_0x8 = *(int *)&this->field_0xc * param_1 + *(int *)&this->field_0x8; + return 1; + } + return 1; +} + + + +// WaveBuffer_R32::PushSamples(short*, unsigned int) + +undefined4 WaveBuffer_R32::PushSamples(short *param_1,uint param_2) { + uint uVar1; + int iVar2; + void *__dest; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (param_2 != 0) { + iVar2 = *(int *)&this->field_0x8; + uVar1 = *(int *)&this->field_0xc * param_2 + iVar2; + if (*(uint *)&this->field_0x4 < uVar1) { + __dest = valloc(uVar1 * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,*(void **)this,*(int *)&this->field_0x8 << 2); + free(*(void **)this); + iVar2 = *(int *)&this->field_0x8; + *(void **)this = __dest; + *(uint *)&this->field_0x4 = *(int *)&this->field_0xc * param_2 + iVar2; + } + Short2Float(this,param_1,(float *)((int)__dest + iVar2 * 4),param_2); + *(uint *)&this->field_0x8 = *(int *)&this->field_0xc * param_2 + *(int *)&this->field_0x8; + return 1; + } + return 1; +} + + + +// WaveBuffer_R32::PushSamples(int*, unsigned int) + +undefined4 WaveBuffer_R32::PushSamples(int *param_1,uint param_2) { + uint uVar1; + int iVar2; + void *__dest; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (param_2 != 0) { + iVar2 = *(int *)&this->field_0x8; + uVar1 = *(int *)&this->field_0xc * param_2 + iVar2; + if (*(uint *)&this->field_0x4 < uVar1) { + __dest = valloc(uVar1 * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,*(void **)this,*(int *)&this->field_0x8 << 2); + free(*(void **)this); + iVar2 = *(int *)&this->field_0x8; + *(void **)this = __dest; + *(uint *)&this->field_0x4 = *(int *)&this->field_0xc * param_2 + iVar2; + } + Int2Float(this,param_1,(float *)((int)__dest + iVar2 * 4),param_2); + *(uint *)&this->field_0x8 = *(int *)&this->field_0xc * param_2 + *(int *)&this->field_0x8; + return 1; + } + return 1; +} + + + +// WaveBuffer_R32::PushSamples(float*, unsigned int) + +undefined4 WaveBuffer_R32::PushSamples(float *param_1,uint param_2) { + uint uVar1; + int iVar2; + int iVar3; + void *__dest; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (param_2 != 0) { + iVar2 = *(int *)&this->field_0x8; + iVar3 = *(int *)&this->field_0xc; + uVar1 = iVar3 * param_2 + iVar2; + if (*(uint *)&this->field_0x4 < uVar1) { + __dest = valloc(uVar1 * 4); + if (__dest == nullptr) { + return 0; + } + memcpy(__dest,*(void **)this,*(int *)&this->field_0x8 << 2); + free(*(void **)this); + iVar2 = *(int *)&this->field_0x8; + iVar3 = *(int *)&this->field_0xc; + *(void **)this = __dest; + *(uint *)&this->field_0x4 = iVar3 * param_2 + iVar2; + } + memcpy((void *)((int)__dest + iVar2 * 4),param_1,iVar3 * param_2 * 4); + *(uint *)&this->field_0x8 = *(int *)&this->field_0xc * param_2 + *(int *)&this->field_0x8; + return 1; + } + return 1; +} + + + +// WaveBuffer_R32::PopSamples(unsigned int, bool) + +uint WaveBuffer_R32::PopSamples(uint param_1,bool param_2) { + uint uVar1; + void *__dest; + uint uVar2; + + __dest = *(void **)this; + if (__dest == nullptr) { + return 0; + } + if (*(int *)&this->field_0x4 == 0) { + return 0; + } + uVar1 = *(uint *)&this->field_0x8; + uVar2 = *(int *)&this->field_0xc * param_1; + if (uVar2 < uVar1 || uVar2 - uVar1 == 0) { + *(uint *)&this->field_0x8 = uVar1 - uVar2; + memmove(__dest,(void *)((int)__dest + uVar2 * 4),(uVar1 - uVar2) * 4); + return param_1; + } + if (param_2 == false) { + return 0; + } + uVar1 = __udivsi3(); + *(undefined4 *)&this->field_0x8 = 0; + return uVar1; +} + + + +// WaveBuffer_R32::PopSamples(short*, unsigned int, bool) + +uint WaveBuffer_R32::PopSamples(short *param_1,uint param_2,bool param_3) { + int iVar1; + uint uVar2; + int iVar3; + float *pfVar4; + uint uVar5; + + pfVar4 = *(float **)this; + if (pfVar4 == nullptr) { + return 0; + } + if (*(int *)&this->field_0x4 == 0) { + return 0; + } + uVar2 = *(uint *)&this->field_0x8; + uVar5 = *(int *)&this->field_0xc * param_2; + if (uVar5 < uVar2 || uVar5 - uVar2 == 0) { + Float2Short(this,pfVar4,param_1,param_2); + iVar1 = *(int *)&this->field_0xc * param_2; + iVar3 = *(int *)&this->field_0x8 - iVar1; + *(int *)&this->field_0x8 = iVar3; + memmove(*(void **)this,(void *)((int)*(void **)this + iVar1 * 4),iVar3 * 4); + return param_2; + } + if (param_3 == false) { + return 0; + } + uVar2 = __udivsi3(uVar2); + Float2Short(this,pfVar4,param_1,uVar2); + *(undefined4 *)&this->field_0x8 = 0; + return uVar2; +} + + + +// WaveBuffer_R32::PopSamples(int*, unsigned int, bool) + +uint WaveBuffer_R32::PopSamples(int *param_1,uint param_2,bool param_3) { + int iVar1; + uint uVar2; + int iVar3; + float *pfVar4; + uint uVar5; + + pfVar4 = *(float **)this; + if (pfVar4 == nullptr) { + return 0; + } + if (*(int *)&this->field_0x4 == 0) { + return 0; + } + uVar2 = *(uint *)&this->field_0x8; + uVar5 = *(int *)&this->field_0xc * param_2; + if (uVar5 < uVar2 || uVar5 - uVar2 == 0) { + Float2Int(this,pfVar4,param_1,param_2); + iVar1 = *(int *)&this->field_0xc * param_2; + iVar3 = *(int *)&this->field_0x8 - iVar1; + *(int *)&this->field_0x8 = iVar3; + memmove(*(void **)this,(void *)((int)*(void **)this + iVar1 * 4),iVar3 * 4); + return param_2; + } + if (param_3 == false) { + return 0; + } + uVar2 = __udivsi3(uVar2); + Float2Int(this,pfVar4,param_1,uVar2); + *(undefined4 *)&this->field_0x8 = 0; + return uVar2; +} + + + +// WaveBuffer_R32::PopSamples(float*, unsigned int, bool) + +uint WaveBuffer_R32::PopSamples(float *param_1,uint param_2,bool param_3) { + int iVar1; + uint uVar2; + int iVar3; + void *__src; + uint uVar4; + + __src = *(void **)this; + if (__src == nullptr) { + return 0; + } + if (*(int *)&this->field_0x4 == 0) { + return 0; + } + uVar4 = *(uint *)&this->field_0x8; + uVar2 = *(int *)&this->field_0xc * param_2; + if (uVar2 < uVar4 || uVar2 - uVar4 == 0) { + memcpy(param_1,__src,uVar2 * 4); + iVar1 = *(int *)&this->field_0xc * param_2; + iVar3 = *(int *)&this->field_0x8 - iVar1; + *(int *)&this->field_0x8 = iVar3; + memmove(*(void **)this,(void *)((int)*(void **)this + iVar1 * 4),iVar3 * 4); + return param_2; + } + if (param_3 == false) { + return 0; + } + uVar2 = __udivsi3(uVar4); + memcpy(param_1,__src,uVar4 << 2); + *(undefined4 *)&this->field_0x8 = 0; + return uVar2; +} + + + +// WaveBuffer_R32::Reset() + +void WaveBuffer_R32::Reset() { + *(undefined4 *)&this->field_0x8 = 0; + return; +} + + + +// WaveBuffer_R32::SetBufferOffset(unsigned int) + +void WaveBuffer_R32::SetBufferOffset(uint param_1) { + uint uVar1; + int iVar2; + + iVar2 = *(int *)&this->field_0xc; + uVar1 = __udivsi3(*(undefined4 *)&this->field_0x4,iVar2); + if (param_1 <= uVar1) { + *(uint *)&this->field_0x8 = iVar2 * param_1; + } + return; +} + + + +// WaveBuffer_R32::GetBufferOffset() + +void WaveBuffer_R32::GetBufferOffset(void) { + int in_r0; + + __udivsi3(*(undefined4 *)(in_r0 + 8),*(undefined4 *)(in_r0 + 0xc)); + return; +} + + + +// WaveBuffer_R32::GetBufferSize() + +void WaveBuffer_R32::GetBufferSize(void) { + int in_r0; + + __udivsi3(*(undefined4 *)(in_r0 + 4),*(undefined4 *)(in_r0 + 0xc)); + return; +} + + + +// WaveBuffer_R32::GetCurrentBufferR32Ptr() + +undefined4 WaveBuffer_R32::GetCurrentBufferR32Ptr() { + return *(undefined4 *)this; +} diff --git a/src/util/WaveBuffer_R32.h b/src/util/WaveBuffer_R32.h new file mode 100644 index 0000000..4998193 --- /dev/null +++ b/src/util/WaveBuffer_R32.h @@ -0,0 +1,67 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_WAVEBUFFER_R32_H +#define VIPER_WAVEBUFFER_R32_H + + +class WaveBuffer_R32 { + undefined field_0x0; + undefined field_0x1; + undefined field_0x2; + undefined field_0x3; + undefined field_0x4; + undefined field_0x5; + undefined field_0x6; + undefined field_0x7; + undefined field_0x8; + undefined field_0x9; + undefined field_0xa; + undefined field_0xb; + undefined field_0xc; + undefined field_0xd; + undefined field_0xe; + undefined field_0xf; + undefined field_0x10; + undefined field_0x11; + undefined field_0x12; + undefined field_0x13; + undefined field_0x14; + undefined field_0x15; + undefined field_0x16; + undefined field_0x17; + undefined field_0x18; + undefined field_0x19; + undefined field_0x1a; + undefined field_0x1b; + undefined field_0x1c; + undefined field_0x1d; + undefined field_0x1e; + undefined field_0x1f; + +public: + WaveBuffer_R32(uint param_1,uint param_2); + ~WaveBuffer_R32(); + void Short2Float(short *param_1,float *param_2,uint param_3); + void Float2Short(float *param_1,short *param_2,uint param_3); + void Int2Float(int *param_1,float *param_2,uint param_3); + void Float2Int(float *param_1,int *param_2,uint param_3); + void * PushZerosGetBuffer(uint param_1); + undefined4 PushZeros(uint param_1); + undefined4 PushSamples(short *param_1,uint param_2); + undefined4 PushSamples(int *param_1,uint param_2); + undefined4 PushSamples(float *param_1,uint param_2); + uint PopSamples(uint param_1,bool param_2); + uint PopSamples(short *param_1,uint param_2,bool param_3); + uint PopSamples(int *param_1,uint param_2,bool param_3); + uint PopSamples(float *param_1,uint param_2,bool param_3); + void Reset(); + void SetBufferOffset(uint param_1); + void GetBufferOffset(); + void GetBufferSize(); + undefined4 GetCurrentBufferR32Ptr(); +}; + + +#endif //VIPER_WAVEBUFFER_R32_H diff --git a/src/util/eFilter.cpp b/src/util/eFilter.cpp new file mode 100644 index 0000000..9fc164d --- /dev/null +++ b/src/util/eFilter.cpp @@ -0,0 +1,62 @@ +// +// Created by mart on 2/12/21. +// + +#include "eFilter.h" + +// eFilter::Mute() + +void eFilter::Mute() { + IIR_1st::Mute((IIR_1st *)this); + IIR_1st::Mute(&this->field_0x10); + IIR_1st::Mute(&this->field_0x20); + IIR_1st::Mute(&this->field_0x30); + return; +} + + + +// eFilter::setLPF(float) + +void eFilter::setLPF(float param_1) { + IIR_1st *in_r0; + float in_r1; + float fVar1; + + in_r0[4].field_0x0 = ROUND(in_r1); + fVar1 = (float)IIR_1st::setPole(in_r0,param_1); + IIR_1st::setPole(in_r0 + 1,fVar1); + return; +} + + + +// eFilter::setHPF(float) + +void eFilter::setHPF(float param_1) { + int in_r0; + float in_r1; + float fVar1; + + *(float *)(in_r0 + 0x44) = ROUND(in_r1); + fVar1 = (float)IIR_1st::setZero((IIR_1st *)(in_r0 + 0x20),param_1); + IIR_1st::setZero((IIR_1st *)(in_r0 + 0x30),fVar1); + return; +} + + + +// eFilter::eFilter() + +eFilter::eFilter() { + float fVar1; + + IIR_1st::IIR_1st((IIR_1st *)this); + IIR_1st::IIR_1st(&this->field_0x10); + IIR_1st::IIR_1st(&this->field_0x20); + fVar1 = (float)IIR_1st::IIR_1st(&this->field_0x30); + fVar1 = (float)setLPF(fVar1); + setHPF(fVar1); + Mute(this); + return this; +} diff --git a/src/util/eFilter.h b/src/util/eFilter.h new file mode 100644 index 0000000..3ebce66 --- /dev/null +++ b/src/util/eFilter.h @@ -0,0 +1,23 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_EFILTER_H +#define VIPER_EFILTER_H + + +class eFilter { + struct IIR_1st field_0x0; + struct IIR_1st field_0x10; + struct IIR_1st field_0x20; + struct IIR_1st field_0x30; + +public: + void Mute(); + void setLPF(float param_1); + void setHPF(float param_1); + eFilter(); +}; + + +#endif //VIPER_EFILTER_H diff --git a/src/util/misc.cpp b/src/util/misc.cpp new file mode 100644 index 0000000..c3fea44 --- /dev/null +++ b/src/util/misc.cpp @@ -0,0 +1,55 @@ +// +// Created by mart on 2/12/21. +// + +#include "misc.h" + +uint FUN_00063c3c(byte *param_1,int param_2) { + byte *pbVar1; + int iVar3; + uint uVar4; + uint uVar5; + uint *puVar6; + uint uStack1036; + uint local_408 [256]; + byte *pbVar2; + + puVar6 = &uStack1036; + uVar5 = 0; + do { + iVar3 = 8; + uVar4 = uVar5; + do { + if ((uVar4 & 1) == 0) { + uVar4 = uVar4 >> 1; + } + else { + uVar4 = uVar4 >> 1 ^ 0xedb88320; + } + iVar3 = iVar3 + -1; + } while (iVar3 != 0); + uVar5 = uVar5 + 1; + puVar6 = puVar6 + 1; + *puVar6 = uVar4; + } while (uVar5 != 0x100); + if (param_2 == 0) { + return 0; + } + uVar5 = 0xffffffff; + pbVar2 = param_1; + do { + pbVar1 = pbVar2 + 1; + uVar5 = local_408[(*pbVar2 ^ uVar5) & 0xff] ^ uVar5 >> 8; + pbVar2 = pbVar1; + } while (pbVar1 != param_1 + param_2); + return ~uVar5; +} + +float FUN_00067ef8(float param_1,float param_2) { + undefined4 in_cr0; + + coprocessor_function(10,6,4,in_cr0,in_cr0,in_cr0); + param_2 = -1.0 / param_2; + expf(param_1); + return 1.0 - param_2; +} diff --git a/src/util/misc.h b/src/util/misc.h new file mode 100644 index 0000000..29a2152 --- /dev/null +++ b/src/util/misc.h @@ -0,0 +1,96 @@ +// +// Created by mart on 2/12/21. +// + +#ifndef VIPER_MISC_H +#define VIPER_MISC_H + +#include +#include +#include + +typedef unsigned char undefined; +typedef unsigned char byte; +typedef long long longlong; +typedef unsigned int uint; +typedef unsigned long long ulonglong; +typedef unsigned int undefined4; +typedef unsigned long long undefined8; + +#define OK 0 + +union audio_buffer { + int * s32; + short * s16; + byte * s8; + void * raw; +}; + +struct buffer_provider_t { + int (* getBuffer)(void *, struct audio_buffer_t *); + int (* releaseBuffer)(void *, struct audio_buffer_t *); + void * cookie; +}; + +struct audio_buffer_t { + int frameCount; + union audio_buffer buffer; +}; + +struct buffer_config_t { + struct audio_buffer_t buffer; + uint samplingRate; + uint channels; + struct buffer_provider_t bufferProvider; + byte format; + byte accessMode; + short mask; +}; + +struct effect_config_t { + struct buffer_config_t inputCfg; + struct buffer_config_t outputCfg; +}; + +struct audio_buffer_s { // PlaceHolder Structure +}; + +typedef struct effect_uuid_s { // PlaceHolder Structure + int field_0x0; + short field_0x4; + short field_0x6; + short field_0x8; + char field_0xa; + char field_0xb; + char field_0xc; + char field_0xd; + char field_0xe; + char field_0xf; +} effect_uuid_t; + +typedef struct effect_descriptor_s { + effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect + effect_uuid_t uuid; // UUID for this particular implementation + uint32_t apiVersion; // Version of the effect control API implemented + uint32_t flags; // effect engine capabilities/requirements flags (see below) + uint16_t cpuLoad; // CPU load indication (see below) + uint16_t memoryUsage; // Data Memory usage (see below) + char name[64]; // human readable effect name + char implementor[64]; // human readable effect implementor name +} effect_descriptor_t; + +// Dummy replacement +void __android_log_print(int n, const std::string& name, const std::string& fmt, ...) { + va_list ap; + + std::cout << "[" << name << "]: "; + va_start(ap, fmt); + printf(fmt.c_str(), ap); + va_end(ap); + std::cout << "\n"; +} + +uint FUN_00063c3c(byte *param_1,int param_2); +float FUN_00067ef8(float param_1,float param_2); + +#endif //VIPER_MISC_H