Alexander Chemeris wrote:> Hi, > > On 5/27/08, Thorvald Natvig <thorvald at natvig.com> wrote: > >> And here's a patch for Intel Math Kernel Library. This allows commercial >> users of Speex to use a high-speed FFT library that isn't GPL'd. (You do >> need to pay for it though). This is 3 times faster than the default FFT in >> speex, and also faster than FFTW3 since MKL has native support for the >> complex packing Speex uses. >> > > That's definitely cool, but from what I can see on this FAQ I do need to pay > if I'm willing to use it for commercial purposes: > http://www.intel.com/cd/software/products/asmo-na/eng/266854.htm > > Btw, have you benchmarked speex with this and without this optimization > as a hole and how much percents do you achieve? I assume FFT is a big > portion of Speex's CPU load, but it would be great to see numbers. :) > >Yes, MKL is commercial software and you do need to pay for it, but unlike FFTW it's not GPL. FFTW is useless for any closed-source program that wishes to use Speex, so this is the non-GPL alternative. Speex itself doesn't use FFT, it's only used for the preprocessor and the echo canceller. The last time I benchmarked, FFTs were about 60% of the preprocessor CPU (and 64% was mentioned in the IRC channel). So in theory, using MKL will halve the CPU requirement of the preprocessor.
I did some benchmarking. On a P4 Xeon 3.4 Ghz, 64-bit, GCC 4.3, -O3 -fprofile-use -ffast-math -ftree-vectorize, running the preprocessor with 320 sample frames (16khz): KISS: 89us / frame Small: 88us / frame FFTW3: 76 us / frame MKL: 75 us / frame According to callgrind, with MKL 18.4% of CPU time is spent in the FFTs vs 37.9% with Small, meaning those previous numbers are for a different architecture, compiler or optimization flags. So, in reality, we're saving only 20% off the preprocessor time. Looking at the output, you can shave 50% off what remains if you SSE optimize the entire code (and I'm not doing that ;))
> Yes, MKL is commercial software and you do need to pay for it, but > unlike FFTW it's not GPL. FFTW is useless for any closed-source program > that wishes to use Speex, so this is the non-GPL alternative.Considering that FFTW also sells licenses for non-GPL use, I tend to prefer the FFTW licensing over MKL. Note that GPL doesn't mean non-commercial. When RedHat sells a Linux CD, it's commercial although there's lots of GPL software included. In any case, since there's probably people who want MKL, I'll probably merge that too after I can have a look at it. Cheers, Jean-Marc
On 5/28/08, Thorvald Natvig <thorvald at natvig.com> wrote:> Alexander Chemeris wrote: > > On 5/27/08, Thorvald Natvig <thorvald at natvig.com> wrote: > > > And here's a patch for Intel Math Kernel Library. This allows > commercial > > > users of Speex to use a high-speed FFT library that isn't GPL'd. (You do > > > need to pay for it though). This is 3 times faster than the default FFT > in > > > speex, and also faster than FFTW3 since MKL has native support for the > > > complex packing Speex uses. > > That's definitely cool, but from what I can see on this FAQ I do need to pay > > if I'm willing to use it for commercial purposes: > > http://www.intel.com/cd/software/products/asmo-na/eng/266854.htm > > > Yes, MKL is commercial software and you do need to pay for it, but unlike > FFTW it's not GPL. FFTW is useless for any closed-source program that wishes > to use Speex, so this is the non-GPL alternative.Sorry, misread you sentence, I thought you mean that you do not need to pay for MKL, in spite of the fact it is non-GPL (that is like freely distributed, but closed). Now I see you meant different thing. :) -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000
On 5/28/08, Jean-Marc Valin <jean-marc.valin at usherbrooke.ca> wrote:> > Yes, MKL is commercial software and you do need to pay for it, but > > unlike FFTW it's not GPL. FFTW is useless for any closed-source program > > that wishes to use Speex, so this is the non-GPL alternative. > > Considering that FFTW also sells licenses for non-GPL use, I tend to > prefer the FFTW licensing over MKL. Note that GPL doesn't mean > non-commercial. When RedHat sells a Linux CD, it's commercial although > there's lots of GPL software included. In any case, since there's > probably people who want MKL, I'll probably merge that too after I can > have a look at it.Don't compare apples with oranges. Distribution of commercial software and commercial distribution of free sofware aren't the same. And I think it is no doubt that most commercial software have closed sourced, and that GPL and closed sources are not compatible. :) PS This is not to blame you, just to keep things clean. I hate when such things are messed. And thanks to you for kind accceptance of all these kinds of patches. -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000
Jean-Marc Valin wrote on 5/28/2008 2:13 AM:>> Yes, MKL is commercial software and you do need to pay for it, but >> unlike FFTW it's not GPL. FFTW is useless for any closed-source program >> that wishes to use Speex, so this is the non-GPL alternative. >> > > Considering that FFTW also sells licenses for non-GPL use, I tend to > prefer the FFTW licensing over MKL. Note that GPL doesn't mean > non-commercial. When RedHat sells a Linux CD, it's commercial although > there's lots of GPL software included. In any case, since there's > probably people who want MKL, I'll probably merge that too after I can > have a look at it. > >Another bad thing bith MKL - it doesn't support ARM family of CPUs :(