aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-06-04 19:46:39 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-06-06 12:34:05 +0800
commit43295ae6a9245d8b58c15e5053994c87d95a9689 (patch)
tree8779240d6ef017e454b4c17b41914516c82f658c /libswscale
parent29b244ffc15abe2c24d2145f63048e8b3bdaa303 (diff)
downloadffmpeg-43295ae6a9245d8b58c15e5053994c87d95a9689.tar.gz
swscale/swscale_unscaled: don't use the optimized bgr24toYV12 unscaled conversion when width%2
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale_unscaled.c3
1 files changed, 2 insertions, 1 deletions
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) */