aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2014-02-02 15:04:58 +0200
committerAnton Khirnov <anton@khirnov.net>2014-02-04 10:59:28 +0100
commit5de64bb34d68d6c224dca90003172d7a27958825 (patch)
tree52c4ff3059cf530858adc8d20c87753953f6ca5a
parentde203abd71baae7f120313259b45cf935c85203e (diff)
downloadffmpeg-5de64bb34d68d6c224dca90003172d7a27958825.tar.gz
utvideoenc: Add support for the new BT.709 FourCCs for YCbCr
With cli usage the decoder might have not set the colorspace during encoder init, manual colorspace override might be needed in such cases. Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/utvideoenc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index dd8d07ebf8..47a4f3a25f 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -83,7 +83,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
c->planes = 3;
- avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
+ if (avctx->colorspace == AVCOL_SPC_BT709)
+ avctx->codec_tag = MKTAG('U', 'L', 'H', '0');
+ else
+ avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
original_format = UTVIDEO_420;
break;
case AV_PIX_FMT_YUV422P:
@@ -93,7 +96,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
c->planes = 3;
- avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
+ if (avctx->colorspace == AVCOL_SPC_BT709)
+ avctx->codec_tag = MKTAG('U', 'L', 'H', '2');
+ else
+ avctx->codec_tag = MKTAG('U', 'L', 'Y', '2');
original_format = UTVIDEO_422;
break;
default: