[MPlayer-dev-eng] [PATCH] (new version) AltiVec: dct64 for mp3lib, IMDCT for liba52, detection code

Romain Dolbeau dolbeau at irisa.fr
Fri Jan 17 11:28:24 CET 2003


Daniel Egger wrote:

> 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.

Checking CPU capabilities requires supervisor mode (mfmsr is a
supervisor-level instruction).

But indeed libmpeg2 does it throught catching SIGILL, and I
added that to my code. Seems to work for positive detection
in MacOSX. BTW the libmpeg2 inside mplayer seems out-of-date,
as there's none of the new AltiVec code.

Attached is the new version of my patch. I've kept the
Darwin-specific code as it's cleaner.

####
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.

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 :-)

3) AltiVec detection code ("borrowed" from FFmpeg and
    libmpeg2) & enough code to enable the AltiVec IMDCT
    in liba52 and the DCT64 in mp3lib.
####

-- 
Romain Dolbeau
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-4.patch.gz
Type: application/gzip
Size: 8874 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030117/41dabed8/attachment.bin>


More information about the MPlayer-dev-eng mailing list