[pulseaudio-discuss] Fwd: Pulse Audio Sample Cache & resampling

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Feb 14 06:24:09 PST 2007


> I've done some testing and for resampling 8 seconds of float data
> from 96kHz to 44.1kHz I measured the following times:
> 
>    Speex resampler  : 0m2.644s
>    SRC fastest Sinc : 0m0.562s
>    SRC medium Sinc  : 0m1.124s
>    SRC best Sinc    : 0m3.773s
> 
> For SRC I used sndfile-resample which is distributed with the SRC source
> code. To test speex, I replaced calls to SRC in sndfile-resample.c with
> calls to the speex resampler.

What quality setting did you use? If you kept the default in
testresampler.c, you had quality 10 (highest, 256 taps), which is sort
of consistent with what I reported earlier. The difference can probably
be explained by compiling options and the fact that I tested with sweep.
In any case, I'm expecting a speedup by about 4x when I convert the code
to SSE, which is the ultimate reason for the different design decisions
I made (the inner loop is already a plain inner product on 4-vectors).
The other main different design decision I made was to sacrifice some
performance (more operations) to do cubic interpolation and save about
an order of magnitude on memory (irrelevant for PC, significant for DSPs).

> The speex resampler also doesn't match SRC fastest in terms of quality.
> I've got some preliminary spectrograms here:
> 
>     http://www.mega-nerd.com/tmp/SRC_best_sinc.png
>     http://www.mega-nerd.com/tmp/SRC_medium_sinc.png
>     http://www.mega-nerd.com/tmp/SRC_fastest_sinc.png
>     http://www.mega-nerd.com/tmp/speex_resampled.png
> 
> An explanation of how these plots are generated is here:
> 
>     http://www.mega-nerd.com/erikd/Blog/CodeHacking/SecretRabbitCode/index.html

OK, I need to carefully look at these to understand what they mean
exactly and to see whether that's normal, a bug in the implementation, a
bug in the design, irrelevant, ... The actual bandwidth (-3dB cutoff)
seems to match SRC highest quality, which is good (and expected). The
highest components are relatively close to those of SRC, but obviously,
there's other "stuff" all over the place. Most of that is below -100 dB,
so it could just be the fact that I haven't yet written the code to use
double internally for high quality settings.

Of course, I still have a bit of filter tuning work to do...

> I'm still in the process of readying the software that generates these
> plots for release.

Actually, can you send me the chirp that you used to generate the plots,
that would be useful even before you make the software available.

> BTW, the code current in SVN segfaults for me. I'm still using
> revision 12455.

Oops, should have "done it your way" :-) Sorry about that. I think it's
fixed now (well, I did fix a segfault). Can you confirm?

Cheers,

	Jean-Marc



More information about the pulseaudio-discuss mailing list