From 4eb93bed4e9b6daca7d3dd716a7517cd53dd5a95 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 25 Jan 2013 21:51:25 +0100 Subject: swscale: GBRP output support Signed-off-by: Michael Niedermayer Signed-off-by: Derek Buitenhuis --- libswscale/utils.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'libswscale/utils.c') diff --git a/libswscale/utils.c b/libswscale/utils.c index f0a2b464fc..a65922bdec 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -163,7 +163,7 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { [AV_PIX_FMT_YUV444P9LE] = { 1, 1 }, [AV_PIX_FMT_YUV444P10BE] = { 1, 1 }, [AV_PIX_FMT_YUV444P10LE] = { 1, 1 }, - [AV_PIX_FMT_GBRP] = { 1, 0 }, + [AV_PIX_FMT_GBRP] = { 1, 1 }, [AV_PIX_FMT_GBRP9LE] = { 1, 0 }, [AV_PIX_FMT_GBRP9BE] = { 1, 0 }, [AV_PIX_FMT_GBRP10LE] = { 1, 0 }, @@ -938,10 +938,21 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat); getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat); + if (dstFormat == AV_PIX_FMT_GBRP) { + if (!(flags & SWS_FULL_CHR_H_INT)) { + av_log(c, AV_LOG_DEBUG, + "%s output is not supported with half chroma resolution, switching to full\n", + av_get_pix_fmt_name(dstFormat)); + flags |= SWS_FULL_CHR_H_INT; + c->flags = flags; + } + } + /* reuse chroma for 2 pixels RGB/BGR unless user wants full * chroma interpolation */ if (flags & SWS_FULL_CHR_H_INT && isAnyRGB(dstFormat) && + dstFormat != AV_PIX_FMT_GBRP && dstFormat != AV_PIX_FMT_RGBA && dstFormat != AV_PIX_FMT_ARGB && dstFormat != AV_PIX_FMT_BGRA && -- cgit v1.2.3