[MPlayer-dev-eng] mplayer/mencoder on Mac OS X

phildev phildev at mac.com
Fri Aug 25 00:02:08 CEST 2006


Hello all,

I'm new here, and indeed, I'll have to learn a lot before I'll be  
able to submit things.

But in that case, imho,  that's required.

I was wondering why my mencoder pentium_m Mac OS X  version was very  
slow compared to the same operation when I used a powerpc Mac OS X  
binary.

The 2 Macs are similar in respect to other time consuming  
applications, and I couldn't understand why mencoder was so  
different. (>10 times worst)

(55 fps on the powerpc version, 4 fps on the mac intel.)

I decided to use an Apple profiling tool, Shark for people who know,  
and I found the culprit: a considerable amount of nop instructions  
was executed by the processor in the libavcodec/i386/dsputil_mmx.c  
before reaching a usefull instruction (1 << 15 in that case to be  
more precise)

A recent change seems to have introduced an issue with the .align  
macro instruction. On Mac OS X, the .align requires that the  
parameter is a power of 2.

I discovered the configure script had a problem:  when the test is  
made, a simple line "asm { .align 3 } ;" is compiled that give an  
error, saying main() is not defined. The .align 1<<x macro expansion  
is guessed and will generate a lot of nop instructions when used.

Applying a simple change in the configure script (changing the line  
to: main() { asm { .align 3 }; } , the Mac OS X Intel and PowerPC  
versions compiled fine and I got similar results on my two Macs.

I didn't make a patch file, but I think it will be trivial to change  
things without it.

Thanks in advance for your attention,
--
Philippe



More information about the MPlayer-dev-eng mailing list