[mythtv] Building 0.20svn on MacOS x86? Change reverted

Todd Ignasiak ignasiak at gmail.com
Wed Jul 19 16:02:24 UTC 2006

On 7/19/06, Nigel Pearson <nigel at ind.tansu.com.au> wrote:
> >> So, now the conversion routine is set to NULL when altivec is not
> >> available.   The change before defaulted to a non altivec routine.
> >> (shown here: http://www.mythtv.org/wiki/index.php/Myth_on_Mac_x86)
>         Isaac is right, 'twas never committed.
> Todd, I suspect you must have had some of
> those patches in your local SVN HEAD tree?
>         I didn't commit the patch on the Wiki
> because I was never happy with it, and thought
> it would wait until I got a Intel Core Mac to
> do some testing on. That ain't happened yet,
> so I will have to use my brain instead:
> 1) videoout_quartz.cpp and yuv2rgb.*
> @ -1315,10 +1315,12 @@
>       data->windowedMode =
> gContext->GetNumSetting("RunFrontendInWindow", 0);
>       data->correctGamma = gContext->GetNumSetting("MacGammaCorrect", 0);
> +#ifdef HAVE_ALTIVEC
>       if (gContext->GetNumSetting("MacYuvConversion", 1))
>           data->yuvConverter = yuv2vuy_init_altivec();
>       else
> -        data->yuvConverter = NULL;
> +#endif
> +        data->yuvConverter = yuv2vuy_init_plain();
> Note that on an AltiVec machine, if the user doesn't have
> "Use Altivec-enhanced color space conversion" set then the
> converter is still set to NULL, and there is no crashing.
> Every occurrence of data->yuvConverter has an if around it.
> I am at a loss to explain why this is needed?

Yeah, I'm not sure why this behaves differently than the PPC version.
I asked on Apple's quicktime mailing list, and submitted a ticket, but
didn't get an answer.   But, I can confirm that when it's set to NULL
it crashes every time.

Your mod above works fine on my system.

FYI - with the plain software routine, this is one of the major CPU
users.   I have looked around for some MMX code for this in other
projects, but didn't find any.  I have also heard that hardware
colorspace conversion is possible, but that's getting into some
advanced quicktime stuff..

> 2) libs/libavcodec/liba52/resample.c
> @@ -13,14 +13,14 @@
>   #include "resample_c.c"
> -#ifdef ARCH_X86
> +#ifdef HAVE_MMX
>   #include "resample_mmx.c"
>   #endif
>   #endif
>   void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
>   void* tmp;
> -#ifdef ARCH_X86
> +#ifdef HAVE_MMX
>       if(mm_accel&MM_ACCEL_X86_MMX){
>          tmp=a52_resample_MMX(flags,chans);
>          if(tmp){
> mythtv-0.19/libs/libavcodec/msmpeg4.c
> @@ -725,7 +725,7 @@
>          necessitate to modify mpegvideo.c. The problem comes from the
>          fact they decided to store the quantized DC (which would lead
>          to problems if Q could vary !) */
> -#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined PIC
> +#if defined(HAVE_MMX) && (defined(ARCH_X86) || defined(ARCH_X86_64))
> && !defined PIC
>       asm volatile(
>           "movl %3, %%eax         \n\t"
> Probably safe, but I don't understand why:
> 1) other non-MMX X86 users haven't complained about this.
> 2) it is even necessary, given that Intel Core cpus have MMX,
> and the configure script seems to set HAVE_MMX on an Intel Mac

  The problem is that the MMX assembly patch linked on the wiki needs
to be applied so that Apple's tools don't puke on that code.   They
are just syntax changes needed because of the old tools Apple includes
( http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-February/007608.html

With the patch applied, everything compiles fine, and performance is
improved a great deal, just like the other platforms.  But, without
that patch, they will need to configure with --disable-mmx to get it
to build, and this section would still compile because it's ifdef'd on
ARCH_X86.    So, I guess HAVE_MMX is more accurate.

That mmx patch could be incorporated into the osx_packager.pl.
Without it, my Core Duo (1.66GHz) mini can't play HD video smoothly.
With MMX enabled, it can.

I updated the Wiki page with the current status for building 0.20svn:


More information about the mythtv-dev mailing list