bugfix: make clipper symmetrical
This commit is contained in:
parent
77c4851119
commit
6ccb93615f
1 changed files with 11 additions and 2 deletions
|
|
@ -10,7 +10,16 @@ void Clipper::process(const float *in, float *out, uint32_t frames) {
|
||||||
void Clipper::processStereo(const float *inLeft, const float *inRight,
|
void Clipper::processStereo(const float *inLeft, const float *inRight,
|
||||||
float *outLeft, float *outRight, uint32_t frames) {
|
float *outLeft, float *outRight, uint32_t frames) {
|
||||||
for (uint32_t i = 0; i < frames; ++i) {
|
for (uint32_t i = 0; i < frames; ++i) {
|
||||||
outLeft[i] = inLeft[i] > clip_ ? clip_ : inLeft[i];
|
|
||||||
outRight[i] = inRight[i] > clip_ ? clip_ : inRight[i];
|
if (outLeft[i] > 0) {
|
||||||
|
outLeft[i] = inLeft[i] > clip_ ? clip_ : inLeft[i];
|
||||||
|
} else {
|
||||||
|
outLeft[i] = inLeft[i] < -clip_ ? -clip_ : inLeft[i];
|
||||||
|
}
|
||||||
|
if (outRight[i] > 0) {
|
||||||
|
outRight[i] = inRight[i] > clip_ ? clip_ : inRight[i];
|
||||||
|
} else {
|
||||||
|
outRight[i] = inRight[i] < -clip_ ? -clip_ : inRight[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue