[FFmpeg-devel] [PATCH] swscale C code and the GPL

Michael Niedermayer michaelni
Thu Jun 25 19:50:15 CEST 2009


On Thu, Jun 25, 2009 at 05:16:59PM +0200, Diego Biurrun wrote:
> Here is a patch that fixes a false dependency of the C code in swscale
> on the GPL.  I'm not 100% sure about the last hunk, the rest should be
> correct.
> 
> Diego

>  swscale.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 063e24e6798072a6a3955b963e820e1dc5583f77  swscale_gpl.diff
> Index: libswscale/swscale.c
> ===================================================================
> --- libswscale/swscale.c	(revision 29389)
> +++ libswscale/swscale.c	(working copy)
> @@ -1301,7 +1301,7 @@
>  
>  //Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
>  //Plain C versions
> -#if (!HAVE_MMX && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL
> +#if ((!HAVE_MMX || !CONFIG_GPL) && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT
>  #define COMPILE_C
>  #endif
>  

as this changes just the HAVE_ALTIVEC == 1 case, its for the altivec
maintainer to decide



> @@ -1972,10 +1972,10 @@
>  
>  static SwsFunc getSwsFunc(SwsContext *c)
>  {
> -#if CONFIG_RUNTIME_CPUDETECT && CONFIG_GPL
> +#if CONFIG_RUNTIME_CPUDETECT
>      int flags = c->flags;
>  
> -#if ARCH_X86
> +#if ARCH_X86 && CONFIG_GPL
>      // ordered per speed fastest first
>      if (flags & SWS_CPU_CAPS_MMX2) {
>          sws_init_swScale_MMX2(c);

redundant



> @@ -2003,7 +2003,7 @@
>  #endif
>      sws_init_swScale_C(c);
>      return swScale_C;
> -#endif /* ARCH_X86 */
> +#endif /* ARCH_X86 && CONFIG_GPL */
>  #else //CONFIG_RUNTIME_CPUDETECT
>  #if   HAVE_MMX2
>      sws_init_swScale_MMX2(c);

> @@ -2565,7 +2565,7 @@
>          __asm__ volatile("emms\n\t"::: "memory");
>  #endif
>  
> -#if !CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL //ensure that the flags match the compiled variant if cpudetect is off
> +#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off
>      flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN);
>  #if   HAVE_MMX2
>      flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2;

i suspect this change is correct

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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090625/236551dd/attachment.pgp>



More information about the ffmpeg-devel mailing list