Fix options to SoX v14 invocation.

Newer SoX option lists use `-e signed` or `-e unsigned` and `-b BITS_PER_SAMPLE`.

This also compensates for the longer option string buffer.
Unbiased sample conversion: Rescale also when reducing bit width

This makes the routines consistent in case of multiple conversions.

This scaling also makes the conversions equivalent to adding zeros
or cutting off bits in PCM space, so the conversions should give similar
results to most other programs.
In biased mode, use dithering when increasing bit width.

In the biased mode, the quantization levels for the different widths are
not aligned so use dithering to avoid distortion.
Dithering: Fix sign error causing 1/2 lsb added offset.
dither_convert: Use scale factor table to avoid numerical problems

In case data is converted to float and back again without change, we want
dithering to have no effect. To avoid rounding problems we need to have
the maximum dither amount a tiny bit less than half an LSB. A separate
test program was used to search for the optimum constants. In case of
conversion from float to 24/32-bit PCM, we disable dithering.
convert_inc: Use signed routines for 32-bit-to-float conversions
conversion_selftest: Update to test all dither/convert modes
Merge pull request #1 from h3xx/master

Add support for invoking SoX version 14.x.x
Add support for "unpacked" 24-bit samples using 32 bits/sample
dataformat.c: Fix build breakage by commit dba82dcb
Use local float-to-PCM converters instead of libsndfile's

To get the same treatment of samples for files opened with libsndfile as
for native wav/raw files, avoid using the sf_readf_float functions with
normalization. Instead, use the sf_readf_int/short functions and convert
locally when needed.

This gives bit-exactness when transferring between internal (wav) files
and libsndfile formats and avoids the assymetric normalization done by
libsndfile.
Add support for both float endiannesses

The CPU has to support one of the endiannesses natively, the other is
converted via byteswap as needed.
wav_save: Handle floating-point data without calling libsndfile

This fixes an internal inconsistency when saving large files, where the
native large file extension gets used in the record+save case but
libsndfile's gets used in the edit+save case.
sox_dialog_apply_proc: Fix logic error by commit 8a345d58
datasource_clone_df: Remove incorrect assertion

This assertion would trip when converting from float to PCM using
"Convert sample format" and the "don't change data" option was set.
datasource_open_sndfile: Don't enable auto normalization on read

We don't need this anymore for PCM files since we're reading those as int.
convert_array: Bugs fixed

Some errors introduced in recent commits:
- Called wrong function in convert routine
- Used samplebytes instead of samplesize in byteswap call
- Count was used after it was destroyed in convert loop
- byteswap assertion triggered on element_size==8
dataformat: Make conversion routines report number of clipped samples
Make clipping checks exact for 32-bit and add extra check for large values

lrint/lrintf may wrap or give other undefined values for out-of-range
inputs. Therefore, add extra check that input value is within a reasonable
range (+/- 2.0). The values between 1.0 and 2.0 are caught by looking at
the output value. For 32-bit, we take some extra steps since the whole
output range is used.
Fix dithering noise

Triangular dithering with +/- 0.5 LSB range is not statistically correct to
use as dither noise, It should be either +/- 0.5 LSB rectangular or
+/- 1 LSB triangular to get the right expected value.

We replace the dithering with a +/- 0.5 LSB rectangular dither. The reason
for choosing this dither is that it is the variant which adds the least
amount of noise and it also preserves bit-exactness in case the values are located
exactly on the quantization levels. The latter can happen for example when
loading and saving lower-bit sources and some samples are unchanged by an
effect.