Remove dithers

This commit is contained in:
Roland Rabien 2023-10-20 18:49:05 -07:00
commit a376041ab8
14 changed files with 356 additions and 78 deletions

View file

@ -102,8 +102,8 @@ void GrindAmp::processReplacing(float **inputs, float **outputs, VstInt32 sample
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
//if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
//if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
double drySampleL = inputSampleL;
double drySampleR = inputSampleR;
@ -812,6 +812,7 @@ void GrindAmp::processReplacing(float **inputs, float **outputs, VstInt32 sample
}
//begin 32 bit stereo floating point dither
/*
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
@ -819,7 +820,8 @@ void GrindAmp::processReplacing(float **inputs, float **outputs, VstInt32 sample
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*/
*out1 = inputSampleL;
*out2 = inputSampleR;
@ -923,8 +925,8 @@ void GrindAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt3
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
//if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
//if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
double drySampleL = inputSampleL;
double drySampleR = inputSampleR;
@ -1633,6 +1635,7 @@ void GrindAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt3
}
//begin 64 bit stereo floating point dither
/*
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
@ -1640,7 +1643,8 @@ void GrindAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt3
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*/
*out1 = inputSampleL;
*out2 = inputSampleR;