archlinuxarm/PKGBUILDs — Issue #121: Speex should be compiled with a few ARM optimizations
Author: cb22
Created: 2011-12-30 20:23:27+00:00
State: open

The default PKGBUILD for Speex runs fine, but it is rather slow - it uses floating point and doesn't have any specific optimizations enabled:

```
[root@roof ~]# time speexenc src.wav fc.spx
Warning: Speex is only optimized for 8, 16 and 32 kHz. It will still work at 44100 Hz but your mileage may vary
Encoding 44100 Hz audio using ultra-wideband (sub-band CELP) mode (stereo)

real	3m31.192s
user	3m27.734s
sys	0m0.188s

[root@roof ~]# time speexdec fc.spx fc-out.wav
Decoding 44100 Hz audio using wideband (sub-band CELP) mode (stereo)
Encoded with Speex 1.2rc1

real	0m40.292s
user	0m31.727s
sys	0m0.703s

```

Adding `--enable-fixed-point --disable-float-api --enable-arm5e-asm` to the configure arguments in the PKGBUILD yields quite a significant speed up:

```
[root@roof ~]# time speexenc src.wav fc2.spx
Warning: Speex is only optimized for 8, 16 and 32 kHz. It will still work at 44100 Hz but your mileage may vary
Encoding 44100 Hz audio using ultra-wideband (sub-band CELP) mode (stereo)

real	1m2.456s
user	0m57.172s
sys	0m0.234s

[root@roof ~]# time speexdec fc.spx fc-out.wav
Decoding 44100 Hz audio using wideband (sub-band CELP) mode (stereo)
Encoded with Speex 1.2rc1

real	0m10.879s
user	0m9.836s
sys	0m0.563s
```

This was all on a Beagle C4 with the CPU locked to 600MHz. I'm sure there are more extensive optimizations that can be done (like using the DSP on Beagles at least) but a ~3x speed up by changing a few configure options isn't too bad ;)