resampler: Precompute some common filter coefficients

While this is quite fast on x86 (order of a few microseconds), the
computation can take a few milliseconds on ARM (measured at 1.9ms (32000
-> 48000) and 3.3ms (32000 -> 44100) on a Cortex A53).

Let's precompute some common rates so that we can avoid this overhead on
each stream (or any other audioconvert) instantiation. The approach
taken here is to write a little program to create the resampler
instance, and run that on the host at compile-time to generate some
common rate conversions.
This commit is contained in:
Arun Raghavan 2024-08-07 12:30:10 -04:00
parent 46f89d8009
commit 70a7bae5d7
5 changed files with 260 additions and 1 deletions

View file

@ -84,6 +84,10 @@ option('audioconvert',
description: 'Enable audioconvert spa plugin integration',
type: 'feature',
value: 'enabled')
option('resampler-precomp-tuples',
description: 'Array of "inrate,outrate[,quality]" tuples to precompute resampler coefficients for',
type: 'array',
value: [ '32000,44100', '32000,48000', '48000,44100', '44100,48000' ])
option('bluez5',
description: 'Enable bluez5 spa plugin integration',
type: 'feature',