]> code.delx.au - pulseaudio/commit
resampler: Resample first followed by remapping if have more out channels than in...
authorPeter Meerwald <p.meerwald@bct-electronic.com>
Mon, 2 Dec 2013 16:27:01 +0000 (17:27 +0100)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Tue, 28 Jan 2014 21:08:54 +0000 (23:08 +0200)
commit537f430c993ee5d83a8c58e8121b457c904d6cdb
treebe687ad3986b9282648c4c5fe90ce57d4f2f8da9
parentb51d28bbbf0b544789be7fe6b3d2a148cf0a500a
resampler: Resample first followed by remapping if have more out channels than in channels

Reintroduces a cleaned-up version of commit 30ce3a14e5ae1cd316a18bec95b831c07ac57a1a which
was reverted by 1ce71cbd8206d1be59ac62274ad83cdbe693a96a; for more information see
http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/17479/focus=17487

The patch intends to reduce computational load when resampling AND remapping. The PA
resampler performs the following steps:

sample format conversion -> remapping -> resampling -> sample format conversion

In case the number of output channels is higher than the number of input channels, the
resampler has to be run more often than necessary. E.g. in case of mono to 4-channel remapping,
the resampler runs on 4 channels separately.

To ímprove this, the PA resampler pipeline is made adaptive:

if out-channels <= in-channels:
  sample format conversion -> remapping -> resampling -> sample format conversion
if out-channels > in-channels:
  sample format conversion -> resampling -> remapping -> sample format conversion

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