]> code.delx.au - pulseaudio/commit
resampler: Support speex resampler compiled with FIXED_POINT
authorAlexander E. Patrakov <patrakov@gmail.com>
Tue, 13 May 2014 15:50:52 +0000 (21:50 +0600)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 23 May 2014 10:23:26 +0000 (13:23 +0300)
commitac984f59d36ef555bc5b0df9af1cd48193d0d14f
treef9f698ab480ef39a149878b208c9a68c1d2801dc
parent2ef960b14579c085215bdf882325688924cc70e9
resampler: Support speex resampler compiled with FIXED_POINT

speex_resample_float() does not work with speex compiled with
--enable-fixed-point, because speex expects its float input
to be normalized to ±32768 instead of the more usual ±1.

It is possible to fix speex_resample_float(), as demonstrated at
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-May/020617.html
However, a better idea is to avoid using the speex-float resampler and
the associated s16 <-> float conversions that speex will immediately undo
internally if it is known that speex has been compiled with FIXED_POINT.
So, transparently change speex-float-* to speex-fixed-* in that case.

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Reported-by: Fahad Arslan <fahad_arslan@mentor.com>
Cc: Damir Jelić <poljarinho@gmail.com>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
FIXED_POINT detection is based on code by Peter Meerwald.
src/pulsecore/resampler.c