[MPlayer-dev-eng] [PATCH] Bug with SWS_FAST_BILINEAR and runtime CPU detection in libswscale

Michael Niedermayer michaelni at gmx.at
Sat Aug 12 13:27:09 CEST 2006


Hi

On Fri, Aug 11, 2006 at 08:40:06PM -0400, Jason Tackaberry wrote:
> When runtime CPU detection is enabled, swscale_template.c will be
> compiled three times, with HAVE_MMX, HAVE_MMX2/HAVE_MMX, and then
> HAVE_3DNOW.  It will compile with HAVE_3DNOW last:
> 
>         //3DNOW versions
>         #ifdef COMPILE_3DNOW
>         #undef RENAME
>         #define HAVE_MMX
>         #undef HAVE_MMX2
>         #define HAVE_3DNOW
>         #define RENAME(a) a ## _3DNow
>         #include "swscale_template.c"
>         #endif
> 
> The compile then proceeds onto the rest of the code in swscale.c, but
> note that HAVE_MMX2 is now undefined, even though swscale_template.c
> will have been compiled with HAVE_MMX2.  This causes a problem in
> hyscale and hcscale when SWS_FAST_BILINEAR is used, because the code
> path followed for HAVE_MMX2 expects the mmx2FilterPos to be non-null (it
> is dereferenced in the asm code).  However, the code that allocates the
> memory for this in swscale.c doesn't get compiled because in swscale.c
> HAVE_MMX2 got undefined.
> 
> The attached patch fixes this problem by redefining HAVE_* when they
> have a corresponding COMPILE_* define

rejected, AFAIK the problem was introduced with the r19339 change, the 
solution is to reverse that

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-dev-eng mailing list