[mythtv] Working frontend on Mac OS X Intel

Todd Ignasiak ignasiak at gmail.com
Sat Mar 18 03:44:32 UTC 2006


On 3/17/06, Joe Rumsey <joe at rumsey.org> wrote:
> >> I tried your patch last night, built the latest SVN version, and I was
>  >> able to get video on my Mini.   This is a big step forward!
>  >>
>  >> On my system, displaying HD video took more than 100% of one CPU.
>  >> So, playback was a bit choppy.    I'll try to throw Apple's profiler
>  >> on it, and see where the major cpu drains are.
>  >> _______________________________________________
>  >>
>  > I did a build last night with Joe Rumsey's patch along with the ffmpeg
>  > patches that deal with OS X's weird/outdated assembler and I'm able to
>  > play live HD on my MacBook via wireless.
>  >
>  > Anyone know if it's safe to turn on the Mac acceleration code?
>
>
> Part of the patch was replacing an inline asm Altivec function with a plain
> old C function, that is obviously going to slow things down.  The core duo
> does support MMX, and SSE, but we're building it without MMX because of
> compiler differences with what it's usually built with.  Doing the work to
> get it building MMX-enabled ought to help a lot.


After re-enabling the MMX stuff, my CPU utilization went from
~130-150% down to 85-95% (on a Mac Mini Core Duo 1.66GHz, viewing
1080i NCAA Basketball).   Without MMX, the video was choppy, with MMX
it's smooth.

Here is what shark shows as the top CPU users in both versions:

Without MMX:
------------------
simple_idct_add                 37.2%
non_vec_yuv420_2vuy     12.8%
simple_idct_put                     9.4%
__memcpy                              6.6%
mpeg_decode_mb                6.3%
ml_set_interrupts_enabled  3.7%

With MMX:
--------------
non_vec_yuv420_2vuy        18.6%
mpeg_decode_mb                12.4%
__memcpy                                 9.3%
ml_set_interrupts_enabled    7.3%
ff_simple_idct_put_mmx         5.7%
ff_simple_idct_put_mmx         5.5%

MMX makes a huge difference in the MPEG2 iDCT.  But, the YUV2VUY is
still unoptimized (as opposed to the Altivec code in the PowerPC
version), so there is still some room for some good performance
improvement.


More information about the mythtv-dev mailing list