[FFmpeg-devel] [PATCH] swscale: Return swScale_*() for RUNTIME_CPUDETECT depending on HAVE_* flags.

Ronald S. Bultje rsbultje
Fri Feb 4 15:07:49 CET 2011


Hi,

On Thu, Feb 3, 2011 at 3:18 PM, Eric Appleman <erappleman at gmail.com> wrote:
> This is based on a patch by ramiro from back in 2009. I've found it essential in
> my builds for compiling ffmpeg with cpudetect on mingw32.
>
> diff --git a/swscale.c b/swscale.c
> index 375171f..50f81be 100644
> --- a/swscale.c
> +++ b/swscale.c
> @@ -1262,16 +1262,25 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
>
> ?#if ARCH_X86
> ? ? // ordered per speed fastest first
> - ? ?if (flags & SWS_CPU_CAPS_MMX2) {
> +#if HAVE_MMX2
> + ? ? ?if (flags & SWS_CPU_CAPS_MMX2) {
> ? ? ? ? sws_init_swScale_MMX2(c);
> ? ? ? ? return swScale_MMX2;
> - ? ?} else if (flags & SWS_CPU_CAPS_3DNOW) {
> + ? ?} else
> +#endif

if (HAVE_... && flags & SWS_CPU_CAPS_...) {

I'll commit that variant shortly.

Ronald



More information about the ffmpeg-devel mailing list