Skip to content

Commit 0aebad3

Browse files
authored
Merge pull request #21 from xddxdd/fix-stereo3dsurround
Fix Stereo3DSurround remainder handling
2 parents 11133be + 40191e4 commit 0aebad3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/viper/utils/Stereo3DSurround.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ void Stereo3DSurround::Process(float *samples, uint32_t size) {
2828
}
2929

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

37-
samples[2 * i] = c - d;
38-
samples[2 * i + 1] = c + d;
37+
samples[i] = c - d;
38+
samples[i + 1] = c + d;
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)