summaryrefslogtreecommitdiff
path: root/libswscale/swscale.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-31 01:36:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-10-31 01:53:37 +0100
commitf44ad92c3fc87daa0e2e9f5499662050be8b2bf3 (patch)
treed34db36fb1627b9a28ecaef0e208cd2e2f165938 /libswscale/swscale.c
parentfbf4b390d02ac53ce8558016c791d7e21b8ebfa4 (diff)
sws: print a warning on unaligned input on SSE2+
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index d5dfa07a31..bde730773d 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -2539,6 +2539,18 @@ static int swScale(SwsContext *c, const uint8_t* src[],
}
}
+ if ((int)dst[0]%16 || (int)dst[1]%16 || (int)dst[2]%16 || (int)src[0]%16 || (int)src[1]%16 || (int)src[2]%16
+ || dstStride[0]%16 || dstStride[1]%16 || dstStride[2]%16 || dstStride[3]%16
+ || srcStride[0]%16 || srcStride[1]%16 || srcStride[2]%16 || srcStride[3]%16
+ ) {
+ static int warnedAlready=0;
+ int cpu_flags = av_get_cpu_flags();
+ if (HAVE_MMX2 && (cpu_flags & AV_CPU_FLAG_SSE2) && !warnedAlready){
+ av_log(c, AV_LOG_WARNING, "Warning: data is not aligned! This can lead to a speedloss\n");
+ warnedAlready=1;
+ }
+ }
+
/* Note the user might start scaling the picture in the middle so this
will not get executed. This is not really intended but works
currently, so people might do it. */