diff options
author | Chris Johnson <jinx6568@sover.net> | 2020-05-28 07:27:31 -0400 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2020-05-28 07:27:31 -0400 |
commit | 3c0d151e1a8014ece2a3982ec0e7b364e23a7575 (patch) | |
tree | 49b6d5ab10e32050b65a67394c94a0977746884a /plugins/MacVST/Ditherbox | |
parent | 897c0830e603a950e838a3753f89334bdf56bb71 (diff) | |
download | airwindows-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/Ditherbox')
-rwxr-xr-x | plugins/MacVST/Ditherbox/source/DitherboxProc.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp b/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp index 4115687..4906413 100755 --- a/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp +++ b/plugins/MacVST/Ditherbox/source/DitherboxProc.cpp @@ -443,7 +443,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl 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; @@ -518,7 +518,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl 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; @@ -602,7 +602,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl 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; @@ -683,7 +683,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl 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; @@ -1447,7 +1447,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt 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; @@ -1522,7 +1522,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt 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; @@ -1606,7 +1606,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt 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; @@ -1687,7 +1687,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt 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; |