[Ffmpeg-devel] [PATCH] fix mpegaudiodec on ARM and benchmark
Michael Niedermayer
michaelni
Thu Aug 24 00:51:09 CEST 2006
Hi
On Thu, Aug 24, 2006 at 12:08:22AM +0200, Aurelien Jacobs wrote:
[...]
> > > asm("smull %0, %1, %2, %3 \n\t"\
> > > - "mov %0, %0, lsr #%4\n\t"\
> > > - "add %1, %0, %1, lsl #%5\n\t"\
> > > - : "=r"(lo), "=r"(hi)\
> > > + "mov %0, %0, lsr %4\n\t"\
> > > + "add %1, %0, %1, lsl %5\n\t"\
> > > + : "=&r"(lo), "=&r"(hi)\
> > > : "r"(b), "r"(a), "i"(FRAC_BITS), "i"(32-FRAC_BITS));\
> > > hi; })
> > > # define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
> > > -# define MULH(a, b) ({ int lo, hi; asm ("smull %0, %1, %2, %3" : "=r"(lo), "=r"(hi) : "r"(b),"r"(a)); hi; })
> > > +# define MULH(a, b) ({ int lo, hi; asm ("smull %0, %1, %2, %3" : "=&r"(lo), "=&r"(hi) : "r"(b),"r"(a)); hi; })
> >
> > i think not all 4 of the & are needed, but iam not sure ...
>
> If I remove any one of them, I get a load of messages like this one:
> {standard input}: Assembler messages:
> {standard input}:630: rdhi, rdlo and rm must all be different
> Note that I'm cross-compiling with gcc-4.1 if that's relevant.
hmm ok, then they probably are needed, feel free to commit the patch ...
[...]
> Setting -march=armv5te (which is exactly what my Xscale is) is quite
> slower, I don't understand why:
> BENCHMARKs: VC: 0.000s VO: 0.000s A: 206.553s Sys: 0.438s = 206.991s
> BENCHMARK%: VC: 0.0000% VO: 0.0000% A: 99.7882% Sys: 0.2118% = 100.0000%
maybe bugreport to gcc devels?
>
>
> Now I also benchmarked libmad. It's still "slightly" faster !
> BENCHMARKs: VC: 0.000s VO: 0.000s A: 54.212s Sys: 0.407s = 54.618s
> BENCHMARK%: VC: 0.0000% VO: 0.0000% A: 99.2554% Sys: 0.7446% = 100.0000%
>
> Then I benchmarked ffmp3 r6050 (patched) with --disable-libavcodec_mpegaudio_hp
> BENCHMARKs: VC: 0.000s VO: 0.000s A: 78.751s Sys: 0.419s = 79.171s
> BENCHMARK%: VC: 0.0000% VO: 0.0000% A: 99.4702% Sys: 0.5298% = 100.0000%
> Pretty impressive ! Not so far from libmad !
next thing you could try are the different bitstream readers, the default is
probably not good on arm as it does unaligned reads
see the #defines at the top of libavcodec/bitstream.h
note, if anything fails compilation or such please report it ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list