I'm looking to stream audio off a ts-7800 using icecast. I found a
(mostly) fixed-point mp3 encoder (build details below). Its has
few features but seems to work OK. On a ts-7260 running armel(EABI) it
encoded a 1 minute 32khz 16-bit stereo wav file in 40 seconds.
The author included ARM assembler for the fixed-point arithmetic but I
could not get this to work so I replaced it - hopefully correctly - with
simple C. Not sure if the assembler would be faster. I'd guess rest
of the code could be tweaked to run faster.
Andrew
mkdir mp3encoder
cd mp3encoder
wget http://www.mp3-tech.org/programmer/sources/shinefixed.zip
unzip shinefixed.zip
perl -pi -e 'if (/^#include/) {tr/A-Z/a-z/;s/"l/"L/};s/^extern long mul.*//' *.c
cat <<eof >>types.h
#define mul(a1, a2) (((int64_t)(a1)*((int64_t)(a2))) >> 32)
#define muls(a1, a2) (((int64_t)(a1)*((int64_t)(a2))) >> 31)
#define mulr(a1, a2) (((int64_t)(a1)*((int64_t)(a2)) + (((int64_t)1)<<31)) >>
32)
#define mulsr(a1, a2) (((int64_t)(a1)*((int64_t)(a2)) + (((int64_t)1)<<31)) >>
31)
eof
mv riscos.c riscos.c.uneeded
gcc -fargument-noalias-global -funroll-loops -mtune=arm9tdmi -march=armv4t
-O3 -o mp3encoder *.c -lm
|