diff options
author | Damien Zammit <damien@zamaudio.com> | 2019-06-29 12:23:07 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2019-06-29 12:23:07 +1000 |
commit | 82b18110e5c625732c13500cf5fd2ba4a64a1d3f (patch) | |
tree | 4bb0cacaa272be5dda8a55841a79b29fea1304b0 /plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp | |
parent | 551903a38ad69268dfcfcd33da0127de57410aa9 (diff) |
Compressors: 5% speedup by using fabsf instead of fabs && reduce MAX_SAMPLES
Diffstat (limited to 'plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp')
-rw-r--r-- | plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp b/plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp index ff45585..a263aa7 100644 --- a/plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp +++ b/plugins/ZaMultiCompX2/ZaMultiCompX2UI.cpp @@ -320,12 +320,12 @@ void ZaMultiCompX2UI::compcurve(float in, int k, float *outx, float* outy) { float xg, yg; yg = 0.f; - xg = (in==0.f) ? -160.f : to_dB(fabs(in)); + xg = (in==0.f) ? -160.f : to_dB(fabsf(in)); xg = sanitize_denormal(xg); if (2.f*(xg-thresdb)<-width) { yg = xg; - } else if (2.f*fabs(xg-thresdb)<=width) { + } else if (2.f*fabsf(xg-thresdb)<=width) { yg = xg + (1.f/ratio-1.f)*(xg-thresdb+width/2.f)*(xg-thresdb+width/2.f)/(2.f*width); } else if (2.f*(xg-thresdb)>width) { yg = thresdb + (xg-thresdb)/ratio; @@ -342,7 +342,7 @@ void ZaMultiCompX2UI::compdot(float in, int k, float *outx, float* outy) { float xg, yg; yg = 0.f; - xg = (in==0.f) ? -160.f : to_dB(fabs(in)); + xg = (in==0.f) ? -160.f : to_dB(fabsf(in)); xg = sanitize_denormal(xg); yg = xg - fLedRedValue[k]; yg = sanitize_denormal(yg); |