mirror of
https://github.com/AndroidAudioMods/ViPERFX_RE.git
synced 2025-06-08 02:29:40 +08:00
Merge pull request #21 from xddxdd/fix-stereo3dsurround
Fix Stereo3DSurround remainder handling
This commit is contained in:
commit
0aebad3049
@ -28,14 +28,14 @@ void Stereo3DSurround::Process(float *samples, uint32_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (remainder > 0) {
|
if (remainder > 0) {
|
||||||
for (uint32_t i = pairs; i < pairs + remainder; i++) {
|
for (uint32_t i = 4 * pairs; i < 2 * size; i += 2) {
|
||||||
float a = samples[2 * i];
|
float a = samples[i];
|
||||||
float b = samples[2 * i + 1];
|
float b = samples[i + 1];
|
||||||
float c = this->coeffLeft * (a + b);
|
float c = this->coeffLeft * (a + b);
|
||||||
float d = this->coeffRight * (b - a);
|
float d = this->coeffRight * (b - a);
|
||||||
|
|
||||||
samples[2 * i] = c - d;
|
samples[i] = c - d;
|
||||||
samples[2 * i + 1] = c + d;
|
samples[i + 1] = c + d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user