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

Diego Biurrun diego at biurrun.de
Mon Mar 19 23:27:07 CET 2007


On Fri, Mar 16, 2007 at 11:38:36AM +1100, Finn Thain wrote:
> 
> 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.

So you're working on upstream liba52?  Nice to hear, I thought the
project was orphaned.

> 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,
> 
> /* 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
> 
> 
> 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?

Not that I know of.

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

Changing MPlayer should be fine, just send a patch.

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

I don't think so..

Diego



More information about the MPlayer-dev-eng mailing list