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

Ed Wildgoose lists at wildgooses.com
Wed Oct 20 00:19:37 CEST 2004


D Richard Felker III wrote:

>On Tue, Oct 19, 2004 at 04:07:19PM +0100, Ed Wildgoose wrote:
>  
>
>>Do you have any benchmarks of the performance of the highest quality 
>>encoder in mplayer on your 500Mhz machine?  It would be interesting to 
>>compare.  On my P2.8 it takes around 45% CPU (well, something of that 
>>order), to do 6 channel conversion using mplayer (from 48Khz to 44Khz) 
>>on highest quality.
>>    
>>
>
>can you explain what you mean by "on highest quality"? i just tried
>and got the following results:
>
>-af resample=44100:0:2 (exact freq float resample): produces white noise
>-af resample=44100:0:1 (exact freq integer resample): 10.1%
>-af resample=44100:1:1 (inexact freq integer resample): 10.1%
>-af resample=44100:0:0 (linint): 7.2%
>
>these percentages are the audio percentage from mplayer statusline.
>they should be approximately accurate with low system load and as long
>as the system is fast enough to play the movie.
>  
>

Hmm, interesting.  I think I may have done my earlier benchmarks 
incorrectly.  mplayer with "-vo null" uses about 45-50% on my machine, 
but with the video playing then it runs more like 6-10% normally (alsa 
output), and 13-15% with any of the above resampling options (except 
linint which is basically free) and jack output at 44100Khz.  This is 
playing a film with a 6 channel audio track at 48Khz (ie a non integer 
resample)

Certainly 5% CPU to do resampling is very good!  However, I suspect that 
it's just too low to be doing it "properly" (where properly means burn 
CPU like crazy...).  I will investigate the code a little more, but 
libsamplerate (for a benchmark) will be chewing 20%+ CPU in order to do 
this resampling (unless I messed up those benchmarks as well...).  
Brutefir is chewing more CPU than mplayer and it's only doing 
crossovers... (And brutefir uses FFTW which is one of the fastest fir 
implementations out there)

So looks like I might have been wrong about the high CPU, and your few 
percent is actually spot on.  I still suspect however, that the 
resampled audio quality is fair bit lower than if I play it back at the 
correct rate (which there is no reason for it to be), but I will do some 
better testing first.

Thanks for the thoughts.  However, I am still interested in your 
thoughts on how to use the lavc resampler?

Ed W




More information about the MPlayer-dev-eng mailing list