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

Michael Niedermayer michaelni at gmx.at
Tue Oct 19 23:48:42 CEST 2004


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

[...]
-- 
Michael

"I do not agree with what you have to say, but I'll defend to the death your
right to say it." -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff
Type: text/x-diff
Size: 5736 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20041019/b4d222e3/attachment.diff>
-------------- next part --------------

    Converter 3 : ZOH Interpolator
    Zero order hold interpolator, very fast, poor quality.
	Signal-to-Noise Ratio Test 0 : Pass
	Signal-to-Noise Ratio Test 1 : Pass
	Signal-to-Noise Ratio Test 2 : Pass
	Signal-to-Noise Ratio Test 3 : Pass
	Signal-to-Noise Ratio Test 4 : Pass
	Signal-to-Noise Ratio Test 5 : Pass
	Signal-to-Noise Ratio Test 6 : Pass
	Signal-to-Noise Ratio Test 7 : Pass
    Worst case Signal-to-Noise Ratio : 10.28 dB.
    Worst case conversion rate       : 1638400 samples/sec.
    Bandwith test not performed on this converter.

    Converter 4 : Linear Interpolator
    Linear interpolator, very fast, poor quality.
	Signal-to-Noise Ratio Test 0 : Pass
	Signal-to-Noise Ratio Test 1 : Pass
	Signal-to-Noise Ratio Test 2 : Pass
	Signal-to-Noise Ratio Test 3 : Pass
	Signal-to-Noise Ratio Test 4 : Pass
	Signal-to-Noise Ratio Test 5 : Pass
	Signal-to-Noise Ratio Test 6 : Pass
	Signal-to-Noise Ratio Test 7 : Pass
    Worst case Signal-to-Noise Ratio : 22.88 dB.
    Worst case conversion rate       : 1638400 samples/sec.
    Bandwith test not performed on this converter.

    Converter 2 : Fastest Sinc Interpolator
    Band limited sinc interpolation, fastest, 97dB SNR, 80% BW.
	Signal-to-Noise Ratio Test 0 : Pass
	Signal-to-Noise Ratio Test 1 : Pass
	Signal-to-Noise Ratio Test 2 : Pass
	Signal-to-Noise Ratio Test 3 : Pass
	Signal-to-Noise Ratio Test 4 : Pass
	Signal-to-Noise Ratio Test 5 : Pass
	Signal-to-Noise Ratio Test 6 : Pass
	Signal-to-Noise Ratio Test 7 : Pass
	Signal-to-Noise Ratio Test 8 : Pass
    Worst case Signal-to-Noise Ratio : 102.42 dB.
    Worst case conversion rate       : 409600 samples/sec.
    Measured -3dB rolloff point      : 80.21 %.

    Converter 1 : Medium Sinc Interpolator
    Band limited sinc interpolation, medium quality, 97dB SNR, 90% BW.
	Signal-to-Noise Ratio Test 0 : Pass
	Signal-to-Noise Ratio Test 1 : Pass
	Signal-to-Noise Ratio Test 2 : Pass
	Signal-to-Noise Ratio Test 3 : Pass
	Signal-to-Noise Ratio Test 4 : Pass
	Signal-to-Noise Ratio Test 5 : Pass
	Signal-to-Noise Ratio Test 6 : Pass
	Signal-to-Noise Ratio Test 7 : Pass
	Signal-to-Noise Ratio Test 8 : Pass
    Worst case Signal-to-Noise Ratio : 98.99 dB.
    Worst case conversion rate       : 234057 samples/sec.
    Measured -3dB rolloff point      : 90.66 %.

    Converter 0 : Best Sinc Interpolator
    Band limited sinc interpolation, best quality, 97dB SNR, 96% BW.
	Signal-to-Noise Ratio Test 0 : Pass
	Signal-to-Noise Ratio Test 1 : Pass
	Signal-to-Noise Ratio Test 2 : Pass
	Signal-to-Noise Ratio Test 3 : Pass
	Signal-to-Noise Ratio Test 4 : Pass
	Signal-to-Noise Ratio Test 5 : Pass
	Signal-to-Noise Ratio Test 6 : Pass
	Signal-to-Noise Ratio Test 7 : Pass
	Signal-to-Noise Ratio Test 8 : Pass
    Worst case Signal-to-Noise Ratio : 97.43 dB.
    Worst case conversion rate       : 84021 samples/sec.
    Measured -3dB rolloff point      : 96.94 %.

    Converter 99 : (null)
    (null)
	Signal-to-Noise Ratio Test 0 : Pass
	Signal-to-Noise Ratio Test 1 : Pass
	Signal-to-Noise Ratio Test 2 : Pass
	Signal-to-Noise Ratio Test 3 : Pass
	Signal-to-Noise Ratio Test 4 : Pass
	Signal-to-Noise Ratio Test 5 : Pass
	Signal-to-Noise Ratio Test 6 : Pass
	Signal-to-Noise Ratio Test 7 : Pass
	Signal-to-Noise Ratio Test 8 : Pass
    Worst case Signal-to-Noise Ratio : 68.05 dB.
    Worst case conversion rate       : 3276800 samples/sec.
    Measured -3dB rolloff point      : 92.70 %.



More information about the MPlayer-dev-eng mailing list