[FFmpeg-devel] [PATCH] libswscale/swscale.c: Clarify what exactly 'data is not aligned' to

Franziska Thul franziskavon1999 at gmx.de
Sat Dec 19 20:50:39 EET 2020


libswscale/swscale.c emits a Warning that 'data is not aligned', but doesn't explain
why, leaving users without any clue on how to address this issue.
This patch simply adds that data is not aligned 'to 16 pixel boundaries'.

Idealy, the warning would say which values are not aligned, too, but since the
variables' uses are probably explained elsewhere, I could only speculate.

---
 libswscale/swscale.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 9cb7e8f6ac..69349a7349 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -311,8 +311,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
         static int warnedAlready = 0; // FIXME maybe move this into the context
         if (flags & SWS_PRINT_INFO && !warnedAlready) {
             av_log(c, AV_LOG_WARNING,
-                   "Warning: dstStride is not aligned!\n"
-                   "         ->cannot do aligned memory accesses anymore\n");
+                   "Warning: dstStride is not aligned to a 16 pixel boundary! Cannot do aligned memory accesses anymore.\n");
             warnedAlready = 1;
         }
     }
@@ -325,7 +324,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
         static int warnedAlready=0;
         int cpu_flags = av_get_cpu_flags();
         if (HAVE_MMXEXT && (cpu_flags & AV_CPU_FLAG_SSE2) && !warnedAlready){
-            av_log(c, AV_LOG_WARNING, "Warning: data is not aligned! This can lead to a speed loss\n");
+            av_log(c, AV_LOG_WARNING, "Warning: data is not aligned to a 16 pixel boundary! This can lead to a speed loss.\n");
             warnedAlready=1;
         }
     }
--
2.20.1



More information about the ffmpeg-devel mailing list