mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
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>
This commit is contained in:
parent
29b244ffc1
commit
43295ae6a9
@ -1978,6 +1978,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
|
|||||||
const enum AVPixelFormat dstFormat = c->dstFormat;
|
const enum AVPixelFormat dstFormat = c->dstFormat;
|
||||||
const int flags = c->flags;
|
const int flags = c->flags;
|
||||||
const int dstH = c->dstH;
|
const int dstH = c->dstH;
|
||||||
|
const int dstW = c->dstW;
|
||||||
int needsDither;
|
int needsDither;
|
||||||
|
|
||||||
needsDither = isAnyRGB(dstFormat) &&
|
needsDither = isAnyRGB(dstFormat) &&
|
||||||
@ -2033,7 +2034,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
|
|||||||
/* bgr24toYV12 */
|
/* bgr24toYV12 */
|
||||||
if (srcFormat == AV_PIX_FMT_BGR24 &&
|
if (srcFormat == AV_PIX_FMT_BGR24 &&
|
||||||
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
|
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
|
||||||
!(flags & SWS_ACCURATE_RND))
|
!(flags & SWS_ACCURATE_RND) && !(dstW&1))
|
||||||
c->swscale = bgr24ToYv12Wrapper;
|
c->swscale = bgr24ToYv12Wrapper;
|
||||||
|
|
||||||
/* RGB/BGR -> RGB/BGR (no dither needed forms) */
|
/* RGB/BGR -> RGB/BGR (no dither needed forms) */
|
||||||
|
Loading…
Reference in New Issue
Block a user