* Replace bit shift with integer division - Shifting doesn't behave
nicely for negative numbers, for example -2 >> 8 equals -1. This
introduces distortion
* Use rounding from 0.5 up - Truncating introduces distortion, because
the interval of numbers that round to 0 is disproportionaly big (-1, 1).
* Replace random number generation with a faster algorithm
With all theese changes, the code is also a bit faster.
By reducing bit-depth of audio, quantization noise is introduced. If the
bit depth is reduced by consistent rounding (either always down, always
up, or always to nearest) the quantization noise is correlated with the
input signal and percieved as distortion. Adding a small amount of noise
to the input signal before reducing the bit-depth causes random
rounding, which makes the noise uncorrelated and uniformly spread
through the whole spectrum.
This avoids pops and buzzing caused by integer overflow when the input
sample falls outside of the range [-1.0, 1.0] (I encountered this when
using jack capture).
- added (const char *) attribute to param_u union to avoid casting away
const warnings
- added also (const void *) and (volatile void *) for the rest
- there was a typo in computing requested_mtu causing violating sequence
point evaluation order
- alsa_get_pcm_state_name: added attribute unused
- audio/utils.cpp: different signdness
- audio/utils.cpp: different signdness
- split capture filter: useless dispose_frame
- video_compress: not copying whole string (with strncpy)