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

@ -108,8 +108,8 @@ void FireAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF
{
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;
@ -840,6 +840,7 @@ void FireAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF
}
//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));
@ -847,7 +848,8 @@ void FireAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF
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;
@ -958,8 +960,8 @@ void FireAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32
{
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;
@ -1690,6 +1692,7 @@ void FireAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32
}
//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));
@ -1697,7 +1700,8 @@ void FireAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32
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;