On Tue, Apr 26, 2011 at 12:27:46AM +0200, Janne Grunau wrote:
> use AV_CPU_FLAG_* internally and deprecate SWS_CPU_CAPS_*.
> add cpu_flags to swsContext and use AVOptions to set it.
> auto detection is only done if no SWS_CPU_CAPS are set in flags and
> cpu_flags does not contain AV_CPU_FLAG_FORCE.
>
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,9 @@ libavutil: 2011-04-18
>
> API changes, most recent first:
>
> +2011-04-26 - xxxxxxx - lsws 1.1.0 - swscale.h
> + Deprecate SWS_CPU_CAPS* and AV_CPU_FLAGS* instead
This sentence no verb.
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -172,7 +173,7 @@ static double getSplineCoeff(double a, double b, double
> c, double d, double dist
>
> static int initFilter(int16_t **outFilter, int16_t **filterPos, int
> *outFilterSize, int xInc,
> - int srcW, int dstW, int filterAlign, int one, int
> flags,
> + int srcW, int dstW, int filterAlign, int one, int
> flags, int cpu_flags,
> SwsVector *srcFilter, SwsVector *dstFilter, double
> param[2])
This function has 17 (!!!) parameters to begin with, I'm not sure
adding another is the way forward.
> @@ -676,6 +677,45 @@ static void getSubSampleFactors(int *h, int *v, enum
> PixelFormat format)
>
> +#if FF_API_SWS_CPUFLAGS
> +#if CONFIG_RUNTIME_CPUDETECT
> +static int sws_cpu_caps2av_cpu_flags(int flags)
> +{
> + int cpuflags = 0;
> +
> + if (ARCH_X86 && flags & SWS_CPU_CAPS_MMX)
> + cpuflags |= AV_CPU_FLAG_MMX;
> + if (ARCH_X86 && flags & SWS_CPU_CAPS_MMX2)
> + cpuflags |= AV_CPU_FLAG_MMX2;
> + if (ARCH_X86 && flags & SWS_CPU_CAPS_3DNOW)
> + cpuflags |= AV_CPU_FLAG_3DNOW;;
> + if (ARCH_X86 && flags & SWS_CPU_CAPS_SSE2)
> + cpuflags |= AV_CPU_FLAG_SSE2;
> + if (ARCH_PPC && flags & SWS_CPU_CAPS_ALTIVEC)
> + cpuflags |= AV_CPU_FLAG_ALTIVEC;
> +
> + return cpuflags;
> +}
4 space indentation please, not 8 :)
> @@ -762,16 +802,17 @@ int sws_init_context(SwsContext *c, SwsFilter
> *srcFilter, SwsFilter *dstFilter)
> #endif
> - if (!rgb15to16) sws_rgb2rgb_init(flags);
> + if (!rgb15to16) sws_rgb2rgb_init(cpu_flags);
nit: Maybe break this line while you're at it..
> @@ -1094,31 +1140,31 @@ int sws_init_context(SwsContext *c, SwsFilter
> *srcFilter, SwsFilter *dstFilter)
> if (isPlanarYUV(dstFormat)) {
> if (c->vLumFilterSize==1)
> - av_log(c, AV_LOG_VERBOSE, "using 1-tap %s \"scaler\" for
> vertical scaling (YV12 like)\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
> + av_log(c, AV_LOG_VERBOSE, "using 1-tap %s \"scaler\" for
> vertical scaling (YV12 like)\n", (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX) ?
> "MMX" : "C");
extra good karma for breaking long lines here and below
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel