aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacVST/NaturalizeDither
diff options
context:
space:
mode:
authorChris Johnson <jinx6568@sover.net>2020-05-28 07:27:31 -0400
committerChris Johnson <jinx6568@sover.net>2020-05-28 07:27:31 -0400
commit3c0d151e1a8014ece2a3982ec0e7b364e23a7575 (patch)
tree49b6d5ab10e32050b65a67394c94a0977746884a /plugins/MacVST/NaturalizeDither
parent897c0830e603a950e838a3753f89334bdf56bb71 (diff)
downloadairwindows-lv2-port-3c0d151e1a8014ece2a3982ec0e7b364e23a7575.tar.gz
airwindows-lv2-port-3c0d151e1a8014ece2a3982ec0e7b364e23a7575.tar.bz2
airwindows-lv2-port-3c0d151e1a8014ece2a3982ec0e7b364e23a7575.zip
Laserbat spotted an interesting bug in legacy NJAD code!
Diffstat (limited to 'plugins/MacVST/NaturalizeDither')
-rwxr-xr-xplugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp b/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp
index 7bd2210..e0b2d86 100755
--- a/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp
+++ b/plugins/MacVST/NaturalizeDither/source/NaturalizeDitherProc.cpp
@@ -140,7 +140,7 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3
totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9];
totalA /= 1000;
- if (totalA = 0) totalA = 1;
+ if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD.
bynL[1] /= totalA;
bynL[2] /= totalA;
bynL[3] /= totalA;
@@ -215,7 +215,7 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3
totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9];
totalA /= 1000;
- if (totalA = 0) totalA = 1;
+ if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD.
bynR[1] /= totalA;
bynR[2] /= totalA;
bynR[3] /= totalA;
@@ -374,7 +374,7 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs,
totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9];
totalA /= 1000;
- if (totalA = 0) totalA = 1;
+ if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD.
bynL[1] /= totalA;
bynL[2] /= totalA;
bynL[3] /= totalA;
@@ -449,7 +449,7 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs,
totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9];
totalA /= 1000;
- if (totalA = 0) totalA = 1;
+ if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD.
bynR[1] /= totalA;
bynR[2] /= totalA;
bynR[3] /= totalA;