[MPlayer-dev-eng] [PATCH] AltiVec: dct64 for mp3lib, IMDCT for liba52, detection code
Daniel Egger
degger at fhm.edu
Thu Jan 16 17:03:39 CET 2003
Am Don, 2003-01-16 um 16.22 schrieb Romain Dolbeau:
> 1) An altivec-optimized DCT64 for mp3lib
> (partially, it seems roughly three times as fast as
> the C code according to quick-n-dirty gprof tests)
> This one is bit-perfect.
Cool, my code started breaking a few months ago and never recovered
so I couldn't contribute it. :( Not that vectorized mp3 decoding
has ever been one of my top priorities, but your implementation
is really nice (though Darwin specific).
> 2) An AltiVec-enhanced IMDCT for liba52 (liba52/imdct.c)
> It's nearly bit-perfect, I have a couple of lsb
> changed in a 128 frames sample. I can't hear the
> differences :-)
This is *really* cool.
> 3) AltiVec detection code ("borrowed" from FFmpeg) &
> enough code to enable the AltiVec IMDCT in liba52
> and mp3lib.
Hm, this code is certainly suboptimal because it'll only work
with Darwin; what about simply executing an altivec instruction
and catching the trap, I think libmpeg2 does that. An alternative
would be checking the CPU capabilities directly but this requires
root privileges.
> If there's any problem with this patch please tell me.
> (and in particular how to add cpu-specific
> optimisation to mp3lib, it seems a bit x86-centric...)
There's one problem: Depending on the compiler you're using
which in turn depends on the version of Darwin you have, you
might need a -mabi=altivec to ensure proper register saving
over a context switch (not so much because of the other changes
because you don't seem to pass vector registers as parameters
or use varargs).
--
Servus,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030116/87dec175/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list