From a830915b78e2d96f08dc93b2d1c4330448b83ffd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 9 Oct 2013 18:43:42 +0200 Subject: swscale: Use full resolution chroma for yuv2rgb when the input has full chroma See Ticket3028 Signed-off-by: Michael Niedermayer --- libswscale/utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libswscale/utils.c') diff --git a/libswscale/utils.c b/libswscale/utils.c index 3daa4f4fad..5693291d13 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1208,6 +1208,16 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, flags |= SWS_FULL_CHR_H_INT; c->flags = flags; } + + if ( c->chrSrcHSubSample == 0 + && c->chrSrcVSubSample == 0 + && c->dither != SWS_DITHER_BAYER //SWS_FULL_CHR_H_INT is currently not supported with SWS_DITHER_BAYER + && !(c->flags & SWS_FAST_BILINEAR) + ) { + av_log(c, AV_LOG_DEBUG, "Forcing full internal H chroma due to input having non subsampled chroma\n"); + flags |= SWS_FULL_CHR_H_INT; + c->flags = flags; + } } if (c->dither == SWS_DITHER_AUTO) { -- cgit v1.2.3