ffmpeg | branch: master | Limin Wang <lance.lmw...@gmail.com> | Fri Jun  4 
19:46:39 2021 +0800| [43295ae6a9245d8b58c15e5053994c87d95a9689] | committer: 
Limin Wang

swscale/swscale_unscaled: don't use the optimized bgr24toYV12 unscaled 
conversion when width%2

Reviewed-by: Michael Niedermayer <mich...@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmw...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=43295ae6a9245d8b58c15e5053994c87d95a9689
---

 libswscale/swscale_unscaled.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index c4dd8a4d83..e8e297509b 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -1978,6 +1978,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
     const enum AVPixelFormat dstFormat = c->dstFormat;
     const int flags = c->flags;
     const int dstH = c->dstH;
+    const int dstW = c->dstW;
     int needsDither;
 
     needsDither = isAnyRGB(dstFormat) &&
@@ -2033,7 +2034,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
     /* bgr24toYV12 */
     if (srcFormat == AV_PIX_FMT_BGR24 &&
         (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) 
&&
-        !(flags & SWS_ACCURATE_RND))
+        !(flags & SWS_ACCURATE_RND) && !(dstW&1))
         c->swscale = bgr24ToYv12Wrapper;
 
     /* RGB/BGR -> RGB/BGR (no dither needed forms) */

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to