]> code.delx.au - pulseaudio/commit
resampler: Improve s16<-->s32 conversion, use s16 work format if input or output...
authorPeter Meerwald <p.meerwald@bct-electronic.com>
Wed, 30 Jan 2013 10:04:05 +0000 (11:04 +0100)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 1 Feb 2013 08:10:30 +0000 (10:10 +0200)
commit3a3c4eb4622feb8115d1387f33a4bfa722e0061a
treef83de073a9be3616bfe6ea0831c0298c1c3d00a0
parent4b3de4422e8b65f9b7da4fe03ceaeda6391280b2
resampler: Improve s16<-->s32 conversion, use s16 work format if input or output is s16

Problem: s16 to s32 conversion is performed as s16->float->s32 (via work
format float) for resamplers TRIVIAL, COPY, PEAKS.
Precision and efficiency suffers: e.g. 0x9fff results in 0x9ffe4001 (instead
of 0x9fff0000) and there are two sample format conversions instead of one
conversion.

Solution: If input or output format is s16, then choose the work format
to be s16 as well.

If remapping is to be performed, we could stick to work format float32ne for
precision reseans. This is debateable.

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
src/pulsecore/resampler.c