core: Add ARM NEON optimized sample conversion code

final:
* includes some minor style fixes and build-time changes to allow
  building a single binary for neon and non-neon systems
v4:
* fix for sample length < 4
v3:
* convert from intrinsics to inline assembly
v2:
* load and store data with vld1/vld1q and vst1/vst1q, resp., to work
  around alignment issues of compiler-generated vldmia instruction
* remove redundant check for NEON flags

Ubuntu/Linaro gcc 4.6.3
arm-linux-gnueabi-gcc -O2 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon

runtime on beagle-xm:

D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_from_float
I: [pulseaudio] sconv_neon.c: NEON: 3754 usec.
I: [pulseaudio] sconv_neon.c: ref: 58594 usec.
D: [pulseaudio] sconv_neon.c: checking NEON sconv_s16le_to_float
I: [pulseaudio] sconv_neon.c: NEON: 1831 usec.
I: [pulseaudio] sconv_neon.c: ref: 10528 usec.
I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.

conversion may be off by one for some samples due to rounding issues
tests: Fix test description in cpu-test

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
tests: Implement test code for ARM NEON sconv s16_to_float

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
sconv: Fix NEON sconv rounding code

Rounding with 0.5 causes us to always round up for any value of the form
x.5. IEEE754 specifies round-to-nearest-even as the behaviour in this
case. This might not always be possible with NEON code, but this change
gets us much closer to it.
tests: Allow off-by-one error in sconv test

With some optimised sconv implementations (read NEON), rounding
inaccuracy might lead to a difference of 1 with the reference
implementation. The inaccuracy is worth the performance gain.

Also increases floating-point accuracy while printing errors to make
errors easier to analyse.
tests: Increase sconv cpu-test timeout

This takes longer on ARM CPUs, especially older ones.
tests: Print average outer-loop iteration time in cpu-test
tests: Minor cpu-test fixes for non-NEON builds

The s16->float test is only run on ARM with NEOn at the moment, so we
don't define that code in other cases.
build: Add a2dp-codecs.h to libbluetooth-util sources.
core: Fix warning on non-win32 builds
tests: Run svolume test for various sample alignments

Allows us to make sure that svolume works independently of sample
alignment, and that performance doesn't degrade based on this.
tests: Make cpu-test less verbose

Drops the correctness debug output since we want to run this several
times, and the output becomes much more verbose than required.
tests: Run svolume on different channel counts

This adds checks to run svolume tests with 1, 2 and 3 channels (we don't
run Orc with 3 channels since only 1/2-ch are implemented there).
tests: Fix a cpu-test debug message

We align at sample granularity and not byte granularity (which might
violate arch alignment requirements).
build-sys: Drop -Wvla from compiler flags

Since we mandate C99 support, not reason to keep this around.
core: Proper poll() emulation to fix pacat and friends on Windows

Currently, Windows versions of pacat and friends fail because the current
poll emulation is not sufficient (it only works for socket fds).

Luckily Gnulib has a much better emulation that seems to work good enough.
The implementation has been largely copied (except a few bug fix
regarding timeout handling, to be pushed upstream) and works on pipes
and files as well. The copy has been obtained through their gnulib-tool utility,
which gives a LGPLv2.1+ licensed file.

This fixes the "Assertion (!e->dead) failed" error coming and lets pacat
and friends stream happily to/from a server (I didn't actually test parec).
core-util: Don't error out on existing runtime directory.

When compiling without HAVE_SYMLINK the runtime dir is a real directory,
which is attempted to be created. In the case it already exists we shouldn't
error out. The HAVE_SYMLINK-enabled code already does this.
memblockq: Fix the order of setting minreq and prebuf.
resampler: Make sure that there are no overflows when multiplying potentially big numbers.

This fixes at least one crash that has been observed. The
multiplication in trivial_resample() overflowed when
resampling from 96 kHz to 48 kHz, causing an assertion
error:

Assertion 'o_index * fz < pa_memblock_get_length(output->memblock)' failed at pulsecore/resampler.c:1521, function trivial_resample(). Aborting.

Without the assertion, the memcpy() after the assertion
would have overwritten some random heap memory.
loopback: Use the real sample spec once it's known.

When module-loopback is loaded without arguments, the ss and
map variables are initialized with dummy values. This caused
a problem, because also pa_memblockq_new() was called with
the dummy values, making it work incorrectly. The base was
set to 1 instead of the real frame size, which in turn
caused alignment related crashes.