changeset 30976:6955998c187e

Change ifdefs to make more sense: HAVE_SSSE3 should only be around SSSE3-code, not around MMX code etc.
author reimar
date Mon, 05 Apr 2010 16:38:40 +0000
parents 72e4e8f983f9
children 0b45d6af9ffe
files libmpcodecs/vf_gradfun.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vf_gradfun.c	Mon Apr 05 15:58:38 2010 +0000
+++ b/libmpcodecs/vf_gradfun.c	Mon Apr 05 16:38:40 2010 +0000
@@ -91,7 +91,7 @@
     }
 }
 
-#if HAVE_SSSE3
+#if HAVE_MMX2
 static void filter_line_mmx2(uint8_t *dst, uint8_t *src, uint16_t *dc,
                              int width, int thresh, const uint16_t *dithers)
 {
@@ -138,7 +138,9 @@
         :"memory"
     );
 }
+#endif
 
+#if HAVE_SSSE3
 static void filter_line_ssse3(uint8_t *dst, uint8_t *src, uint16_t *dc,
                               int width, int thresh, const uint16_t *dithers)
 {
@@ -184,7 +186,9 @@
         :"memory"
     );
 }
+#endif // HAVE_SSSE3
 
+#if HAVE_6REGS && HAVE_SSE2
 #define BLURV(load)\
     intptr_t x = -2*width;\
     __asm__ volatile(\
@@ -218,7 +222,6 @@
         :"memory"\
     );
 
-#if HAVE_6REGS
 static void blur_line_sse2(uint16_t *dc, uint16_t *buf, uint16_t *buf1,
                            uint8_t *src, int sstride, int width)
 {
@@ -228,8 +231,7 @@
         BLURV("movdqa");
     }
 }
-#endif // HAVE_6REGS
-#endif // HAVE_SSSE3
+#endif // HAVE_6REGS && HAVE_SSE2
 
 static void filter(struct vf_priv_s *ctx, uint8_t *dst, uint8_t *src,
                    int width, int height, int dstride, int sstride, int r)
@@ -383,13 +385,15 @@
 
     vf->priv->blur_line = blur_line_c;
     vf->priv->filter_line = filter_line_c;
-#if HAVE_SSSE3
-#if HAVE_6REGS
+#if HAVE_6REGS && HAVE_SSE2
     if (gCpuCaps.hasSSE2)
         vf->priv->blur_line = blur_line_sse2;
 #endif
+#if HAVE_MMX2
     if (gCpuCaps.hasMMX2)
         vf->priv->filter_line = filter_line_mmx2;
+#endif
+#if HAVE_SSSE3
     if (gCpuCaps.hasSSSE3)
         vf->priv->filter_line = filter_line_ssse3;
 #endif