From kde-multimedia Tue Nov 28 14:16:26 2000 From: Stefan Westerfeld Date: Tue, 28 Nov 2000 14:16:26 +0000 To: kde-multimedia Subject: Optimized mp3 X-MARC-Message: https://marc.info/?l=kde-multimedia&m=97542094811812 Hi! On Sat, Nov 25, 2000 at 05:23:42PM -0800, Charles Samuels wrote: > Let's put it this way: > I ran winders95 on a P133. I play MP3s just fine. I switched to linux, and > kmp3 could play MP3s file. Now I use a dual P2/300, and I don't mind a media > player that takes 20% of my entire computer (that's 40% of a P2/300) I've done some optimizations in the last two days. MP3 playing is now 50% faster than it used to be (code is in the CVS). What I did was this: * inline Mpegtoraw::putraw * inline Mpegtoraw::get1bit/getbits9 * use a table, to make huffman decoding a simple table lookup in most cases * avoid float -> int -> float conversions for mp3 decoding * resample only if necessary (i.e. don't if artsd and the mp3 are 44100 Hz) Overall this means, that KDE2.1 will perform significantly better than KDE2.0. Besides the above mpeglib optimizations, artsd has evolved over the post-2.0 period, too. Still, playing an mp3 with artsd and mpeglib is slower than playing it purely with a standalone player. I have tested it with a stripped down version of splay that plays a certain mp3 in 11 seconds, whereas rendering it with mpeglib/aRts takes 16 seconds. Where we loose these additional 5 seconds, I can not say. Some things to try might be - improve the interface between aRts and mpeglib - improve the aRts flowsystem - improve the mp3 decompression itself - write a new mp3 PlayObject which is unthreaded and does not use mpeglib It is a lot easier to do benchmarks with the new program "playtofile" which I've put into the CVS (kdelibs/arts/examples) than it is without (you need to compile mpeglib without defining PTHREADEDMPEG). It allows you to look how long decompressing a file takes if you do it as fast as possible, which gives a good base for benchmarking the threaded code. If anybody is interested in looking into this further, please go ahead. I can give you the code of the stripped down splay version I used for testing (one possibility might be turning that into a PlayObject). Cu... Stefan -- -* Stefan Westerfeld, stefan@space.twc.de (PGP!), Hamburg/Germany KDE Developer, project infos at http://space.twc.de/~stefan/kde *- _______________________________________________ Kde-multimedia mailing list Kde-multimedia@master.kde.org http://master.kde.org/mailman/listinfo/kde-multimedia