[FFmpeg-devel] [PATCH 2/5] swscale: preparation for use of AV_CPU_FLAG_*
Michael Niedermayer
michaelni
Tue Sep 28 02:28:47 CEST 2010
On Tue, Sep 28, 2010 at 12:25:00AM +0200, Janne Grunau wrote:
> add dsp_mask to swsContext and AVOptions to fill them
> add function to convert sws_cpu_caps* to av_cpu_flag*
[...]
> @@ -748,6 +755,26 @@ SwsContext *sws_alloc_context(void){
> return c;
> }
>
> +static unsigned sws_cpu_caps2av_cpu_flags(int flags)
> +{
> + unsigned 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;
> + if (ARCH_BFIN && flags & SWS_CPU_CAPS_BFIN)
> + cpuflags |= AV_CPU_FLAG_BFIN;
> +
> + return cpuflags;
> +}
> +
> int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter){
> int i;
> int usesVFilter, usesHFilter;
please put compatibility code under if version so they will be removed with the
next major bump
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100928/5718bd30/attachment.pgp>
More information about the ffmpeg-devel
mailing list