[MPlayer-dev-eng] [PATCH] fix for -srate bug

Michael Niedermayer michaelni at gmx.at
Wed Oct 20 21:33:56 CEST 2004


Hi

On Tuesday 19 October 2004 23:48, Michael Niedermayer wrote:
> Hi
>
> On Tuesday 19 October 2004 14:52, Michael Niedermayer wrote:
> [...]
>
> > > ive just downloaded libsamplerate-0.1.2, theres no asm in there except
> > > a lrintf() implementation and its pure floating point code with divides
> > > and modulo in the innermost loop, so it cannot be as fast as u claim
> > > unless i missed some integer resampler
> >
> > there are also a few test programs inculded in libsamplerate, see
> > attachment for the output of one
> >
> > especially interresting is:
> >     Worst case Signal-to-Noise Ratio : 97.43 dB.
> >     Worst case conversion rate       : 84021 samples/sec.
> >     Measured -3dB rolloff point      : 96.96 %.
> >
> > which shows that the resampler from which u quoted the scores is not
> > capable of resampling 44khz stereo in realtime on an idle 500mhz p3
>
> to answer the question, how does libavcodecs resampler perform, i added
> support for it in that test proggy, see attached diff & output
> i also had to change the rolloff calculation, as it searched for the 3db
> attenuation during upsampling and libavcodec doesnt have such a large
> attenuation during upsampling, so it does the test with downsampling now
>
> summary:
> lavc is at least twice as fast as the fastest converter from libsamplerate
> (the benchmark routine should be replaced with rdtsc to find out by how
> much exactly, it could be much more)
> the -3db rolloff point of lavc is at 92.70 %, the one from the best
> converter of libsamplerate is at 96.94 % and the second best is at 90.66 %
> the SN ratio of lavc is 68.05 dB while libsamplerates 3 best converters are
> around 100 db and the 2 remaining at 10-20, the reason for the lower SN
> ratio is almost certainly caused by the 16bit in/output used in lavc while
> libsamplerate uses floats

next try :)
    Converter 0 : Best Sinc Interpolator
    Band limited sinc interpolation, best quality, 97dB SNR, 96% BW.
    Worst case Signal-to-Noise Ratio : 97.43 dB.
    Worst case conversion rate       : 86232 samples/sec.
    Measured -3dB rolloff point      : 96.94 %.

    libavcodec default
    Worst case Signal-to-Noise Ratio : 68.18 dB.
    Worst case conversion rate       : 3276800 samples/sec.
    Measured -3dB rolloff point      : 92.72 %.

    libavcodec 22bit coeff, 2.5x longer filter, linear interpolation between 
polyphase entries
    Worst case Signal-to-Noise Ratio : 108.65 dB.
    Worst case conversion rate       : 327680 samples/sec.
    Measured -3dB rolloff point      : 97.02 %

    libavcodec 22bit coeff, 16x longer filter, linear interpolation between 
polyphase entries
    Worst case Signal-to-Noise Ratio : 104.81 dB.
    Worst case conversion rate       : 43116 samples/sec.
    Measured -3dB rolloff point      : 99.51 %

the difference for the default filter is probably caused by a 10l bugfix 
(padding samples wherent memset(0))

wc -l libavcodec/resample2.c
247 libavcodec/resample2.c

cat libsamplerate-0.1.2/src/*.{c,h} | wc -l
26989

[...]
-- 
Michael

"I do not agree with what you have to say, but I'll defend to the death your
right to say it." -- Voltaire




More information about the MPlayer-dev-eng mailing list