summaryrefslogtreecommitdiff
path: root/libavfilter/x86
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-04 00:32:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-04 00:32:31 +0200
commit86e107a7d468666189506d3edd4f4b5ca14cd59e (patch)
tree7270750bbe78c241461a844d7c1c8de3696e3765 /libavfilter/x86
parentaf392efe51d5cc3536cb3c75bce8954179222d18 (diff)
parent1a068bfefd5da09f596e5079b39b418933bad0ea (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: cosmetics: Consistently use C-style comments with multiple inclusion guards anm: fix a few Doxygen comments misc typo and wording fixes attributes: add av_noreturn attributes: drop pointless define guards configure: do not disable av_always_inline with --enable-small flvdec: initial stream switch support avplay: fix write on freed memory for rawvideo snow: remove a VLA used for edge emulation x86: lavfi: fix gradfun/yadif build with mmx/sse disabled snow: remove the runs[] VLA. snow: Check mallocs at init flacdec: remove redundant setting of avctx->sample_fmt Conflicts: ffplay.c libavcodec/h264.c libavcodec/snow.c libavcodec/snow.h libavcodec/snowdec.c libavcodec/snowenc.c libavformat/flvdec.c libavutil/attributes.h tools/patcheck Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/x86')
-rw-r--r--libavfilter/x86/gradfun.c24
-rw-r--r--libavfilter/x86/yadif.c16
2 files changed, 24 insertions, 16 deletions
diff --git a/libavfilter/x86/gradfun.c b/libavfilter/x86/gradfun.c
index 7600539b6f..6511746a72 100644
--- a/libavfilter/x86/gradfun.c
+++ b/libavfilter/x86/gradfun.c
@@ -26,9 +26,9 @@
DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F};
DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
+#if HAVE_MMX2
static void gradfun_filter_line_mmx2(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers)
{
-#if HAVE_MMX2
intptr_t x;
if (width & 3) {
x = width & ~3;
@@ -71,12 +71,12 @@ static void gradfun_filter_line_mmx2(uint8_t *dst, const uint8_t *src, const uin
"rm"(thresh), "m"(*dithers), "m"(*pw_7f)
:"memory"
);
-#endif
}
+#endif
+#if HAVE_SSSE3
static void gradfun_filter_line_ssse3(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers)
{
-#if HAVE_SSSE3
intptr_t x;
if (width & 7) {
// could be 10% faster if I somehow eliminated this
@@ -118,12 +118,12 @@ static void gradfun_filter_line_ssse3(uint8_t *dst, const uint8_t *src, const ui
"rm"(thresh), "m"(*dithers), "m"(*pw_7f)
:"memory"
);
-#endif // HAVE_SSSE3
}
+#endif // HAVE_SSSE3
+#if HAVE_SSE
static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width)
{
-#if HAVE_SSE
#define BLURV(load)\
intptr_t x = -2*width;\
__asm__ volatile(\
@@ -161,17 +161,23 @@ static void gradfun_blur_line_sse2(uint16_t *dc, uint16_t *buf, const uint16_t *
} else {
BLURV("movdqa");
}
-#endif // HAVE_SSE
}
+#endif // HAVE_SSE
av_cold void ff_gradfun_init_x86(GradFunContext *gf)
{
int cpu_flags = av_get_cpu_flags();
- if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2)
+#if HAVE_MMX2
+ if (cpu_flags & AV_CPU_FLAG_MMX2)
gf->filter_line = gradfun_filter_line_mmx2;
- if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3)
+#endif
+#if HAVE_SSSE3
+ if (cpu_flags & AV_CPU_FLAG_SSSE3)
gf->filter_line = gradfun_filter_line_ssse3;
- if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
+#endif
+#if HAVE_SSE
+ if (cpu_flags & AV_CPU_FLAG_SSE2)
gf->blur_line = gradfun_blur_line_sse2;
+#endif
}
diff --git a/libavfilter/x86/yadif.c b/libavfilter/x86/yadif.c
index 22799a3c5f..373d9b8c97 100644
--- a/libavfilter/x86/yadif.c
+++ b/libavfilter/x86/yadif.c
@@ -24,10 +24,6 @@
#include "libavcodec/x86/dsputil_mmx.h"
#include "libavfilter/yadif.h"
-static void yadif_filter_line_ssse3(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode);
-static void yadif_filter_line_sse2(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode);
-static void yadif_filter_line_mmx(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode);
-
DECLARE_ASM_CONST(16, const xmm_reg, pb_1) = {0x0101010101010101ULL, 0x0101010101010101ULL};
DECLARE_ASM_CONST(16, const xmm_reg, pw_1) = {0x0001000100010001ULL, 0x0001000100010001ULL};
@@ -57,10 +53,16 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
{
int cpu_flags = av_get_cpu_flags();
- if (HAVE_MMX && cpu_flags & AV_CPU_FLAG_MMX)
+#if HAVE_MMX
+ if (cpu_flags & AV_CPU_FLAG_MMX)
yadif->filter_line = yadif_filter_line_mmx;
- if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2)
+#endif
+#if HAVE_SSE
+ if (cpu_flags & AV_CPU_FLAG_SSE2)
yadif->filter_line = yadif_filter_line_sse2;
- if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3)
+#endif
+#if HAVE_SSSE3
+ if (cpu_flags & AV_CPU_FLAG_SSSE3)
yadif->filter_line = yadif_filter_line_ssse3;
+#endif
}