Skip to content

Commit

Permalink
Fix Stereo3DSurround remainder handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xddxdd committed Jan 10, 2024
1 parent eb65772 commit 40191e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/viper/utils/Stereo3DSurround.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ void Stereo3DSurround::Process(float *samples, uint32_t size) {
}

if (remainder > 0) {
for (uint32_t i = pairs; i < pairs + remainder; i++) {
float a = samples[2 * i];
float b = samples[2 * i + 1];
for (uint32_t i = 4 * pairs; i < 2 * size; i += 2) {
float a = samples[i];
float b = samples[i + 1];
float c = this->coeffLeft * (a + b);
float d = this->coeffRight * (b - a);

samples[2 * i] = c - d;
samples[2 * i + 1] = c + d;
samples[i] = c - d;
samples[i + 1] = c + d;
}
}
}
Expand Down

0 comments on commit 40191e4

Please sign in to comment.