[FFmpeg-cvslog] libutvideoenc: Add support for the new BT.709 FourCCs for YCbCr

Jan Ekström git at videolan.org
Mon Mar 3 13:38:10 CET 2014


ffmpeg | branch: master | Jan Ekström <jeebjp at gmail.com> | Sat Feb 15 01:58:14 2014 -0500| [40feed524854eeaff67860e8932f792a0e373c8a] | committer: Michael Niedermayer

libutvideoenc: 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 at khirnov.net>

This applies commit 5de64bb3 (the source of the above commit message)
to libutvideoenc as well.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=40feed524854eeaff67860e8932f792a0e373c8a
---

 libavcodec/libutvideoenc.cpp |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
index ad70669..f0d5619 100644
--- a/libavcodec/libutvideoenc.cpp
+++ b/libavcodec/libutvideoenc.cpp
@@ -44,12 +44,18 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
     case AV_PIX_FMT_YUV420P:
         in_format = UTVF_YV12;
         avctx->bits_per_coded_sample = 12;
-        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');
         break;
     case AV_PIX_FMT_YUYV422:
         in_format = UTVF_YUYV;
         avctx->bits_per_coded_sample = 16;
-        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');
         break;
     case AV_PIX_FMT_BGR24:
         in_format = UTVF_NFCC_BGR_BU;



More information about the ffmpeg-cvslog mailing list