Quote from an audio engineer NR9V:
There is a minor issue of a small amount of crossover distortion though as a result of `ast_slinear_saturated_multiply_float()` not rounding the float. This could result in some quiet but potentially audible distortion artifacts in lower volume parts of the signal. If you have for example a sign wave function with a max amplitude of just a few samples, all samples between -1 and 1 will be truncated to zero, resulting in the waveform no longer being a sine wave and in harmonic distortion.
Resolves: #1176
*input = 32767;
else if (res < -32768)
*input = -32768;
+ else if (res > 0)
+ *input = (short) (res + 0.5);
else
- *input = (short) res;
+ *input = (short) (res - 0.5);
+
}
static force_inline void ast_slinear_saturated_divide(short *input, short *value)
*input = 32767;
else if (res < -32768)
*input = -32768;
+ else if (res > 0)
+ *input = (short) (res + 0.5);
else
- *input = (short) res;
+ *input = (short) (res - 0.5);
+
}
#ifdef localtime_r