summaryrefslogtreecommitdiffstats
path: root/libswscale/x86/rgb2rgb.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-25 06:32:23 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-25 06:32:45 +0200
commit034fc7bf129152b94958f4b74b9c81590350ce59 (patch)
treedf83c0f966ce07a832588a54dca4e57ba97575be /libswscale/x86/rgb2rgb.c
parentd1adad3cca407f493c3637e20ecd4f7124e69212 (diff)
parent9bbd6a4cd89da4bfc9fd36fea5777a539a542b40 (diff)
downloadffmpeg-streaming-034fc7bf129152b94958f4b74b9c81590350ce59.zip
ffmpeg-streaming-034fc7bf129152b94958f4b74b9c81590350ce59.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits) configure: enable memalign_hack automatically when needed swscale: unbreak the build on non-x86 systems. swscale: remove if(bitexact) branch from functions. swscale: remove if(canMMX2BeUsed) conditional. swscale: remove swScale_{c,MMX,MMX2} duplication. swscale: use emms_c(). Move emms_c() from libavcodec to libavutil. tiff: set palette in the context when specified in TIFF_PAL tag rtsp: use strtoul to parse rtptime and seq values. pgssubdec: fix incorrect colors. dvdsubdec: fix incorrect colors. ape: Allow demuxing of files with metadata tags. swscale: remove dead macro WRITEBGR24OLD. swscale: remove AMD3DNOW "optimizations". swscale: remove duplicate code in ppc/ subdirectory. swscale: remove duplicated x86/ functions. swscale: force --enable-runtime-cpudetect and remove SWS_CPU_CAPS_*. vsrc_buffer.h: add file doxy vsrc_buffer: tweak error message in init() msmpeg4: reindent. ... Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/x86/rgb2rgb.c')
-rw-r--r--libswscale/x86/rgb2rgb.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index 0f468a7..81b29f3 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -27,6 +27,7 @@
#include "config.h"
#include "libavutil/x86_cpu.h"
+#include "libavutil/cpu.h"
#include "libavutil/bswap.h"
#include "libswscale/rgb2rgb.h"
#include "libswscale/swscale.h"
@@ -122,16 +123,16 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
32-bit C version, and and&add trick by Michael Niedermayer
*/
-void rgb2rgb_init_x86(int flags)
+void rgb2rgb_init_x86(void)
{
-#if HAVE_MMX2 || HAVE_AMD3DNOW || HAVE_MMX
- if (flags & SWS_CPU_CAPS_SSE2)
- rgb2rgb_init_SSE2();
- else if (flags & SWS_CPU_CAPS_MMX2)
- rgb2rgb_init_MMX2();
- else if (flags & SWS_CPU_CAPS_3DNOW)
- rgb2rgb_init_3DNOW();
- else if (flags & SWS_CPU_CAPS_MMX)
+ int cpu_flags = av_get_cpu_flags();
+
+ if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX)
rgb2rgb_init_MMX();
-#endif /* HAVE_MMX2 || HAVE_AMD3DNOW || HAVE_MMX */
+ if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW)
+ rgb2rgb_init_3DNOW();
+ if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2)
+ rgb2rgb_init_MMX2();
+ if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
+ rgb2rgb_init_SSE2();
}
OpenPOWER on IntegriCloud