[MPlayer-dev-eng] shared liba52 and mm_accel macros

Finn Thain fthain at telegraphics.com.au
Fri Mar 16 01:38:36 CET 2007


Hi,

I've just finished porting mplayer's SIMD accelerated liba52 to the shared 
library (upstream 0.7.4) on my system. I had to add the necessary 
autotools guff, but it works fine on altivec.

Only real problem is the MM_ACCEL_* macros. These values are checked at 
runtime, so the shared library has to agree with the apps that link with 
it, otherwise there's no acceleration (or worse).

What I found was that mplayer has, in liba52_changes.diff,

--- include/mm_accel.h	2006-06-12 15:05:00.000000000 +0200
+++ liba52/mm_accel.h	2006-06-05 02:23:04.000000000 +0200
@@ -30,7 +34,12 @@
 /* x86 accelerations */
 #define MM_ACCEL_X86_MMX	0x80000000
 #define MM_ACCEL_X86_3DNOW	0x40000000
+#define MM_ACCEL_X86_3DNOWEXT	0x08000000
 #define MM_ACCEL_X86_MMXEXT	0x20000000
+#define MM_ACCEL_X86_SSE	0x10000000
+
+/* PPC accelerations */
+#define MM_ACCEL_PPC_ALTIVEC	0x00010000
... 


Whereas xine has, in xineutils.h,

/* generic accelerations */
#define MM_ACCEL_MLIB           0x00000001

/* x86 accelerations */
#define MM_ACCEL_X86_MMX        0x80000000
#define MM_ACCEL_X86_3DNOW      0x40000000
#define MM_ACCEL_X86_MMXEXT     0x20000000
#define MM_ACCEL_X86_SSE        0x10000000
#define MM_ACCEL_X86_SSE2       0x08000000

/* powerpc accelerations and features */
#define MM_ACCEL_PPC_ALTIVEC    0x04000000
#define MM_ACCEL_PPC_CACHE32    0x02000000

/* SPARC accelerations */

#define MM_ACCEL_SPARC_VIS      0x01000000
#define MM_ACCEL_SPARC_VIS2     0x00800000
...


FWIW, libdts has, in dts.h,

/* x86 accelerations */
#define MM_ACCEL_X86_MMX	0x80000000
#define MM_ACCEL_X86_3DNOW	0x40000000
#define MM_ACCEL_X86_MMXEXT	0x20000000
...


Note that there are a couple of issues here:

1) 0x08000000 is MM_ACCEL_X86_3DNOWEXT and MM_ACCEL_X86_SSE2.

2) MM_ACCEL_PPC_ALTIVEC is 0x00010000 and 0x04000000.


So my question is, is there an authoratitive source for these macros?

If not, can mplayer and liba52 be changed to match xine? The reason I 
suggest that mplayer change rather than the others is that it seems 
mplayer doesn't link dynamically with other packages with respect to 
mm_accel values. (Correct me if I'm wrong.)

I would like to get mplayer's liba52 acceleration into the upstream code. 
Has anyone attempted that before? It seems that project hasn't made a 
release for years.

Of course, xine will have to change too, but I can't try to push any 
patches to them unless there is consensus upon the actual values. If there 
was, they could go into /usr/include/liba52/mm_accel.h (or whatever).

Thanks,

Finn Thain



More information about the MPlayer-dev-eng mailing list