From 11791f7ce5c9620913169e7cb44d37661895fdfa Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Mon, 13 Dec 2021 16:19:44 +0900 Subject: [PATCH] video-info: Don't assume colorimetry of UHD resolution as BT.2020 BT.2020 color primaries are designed to cover much wider range of CIE chromaticity than BT.709, and also it's used for both SDR and HDR contents. So, the incorrect assumption (i.e., BT.709 as a BT.2020) is risky and resulting image color tends to be visually very wrong. Unless there's obvious clue, don't consider color space of high resolution video stream as BT.2020 Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c index 6365573..0269b97 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c @@ -150,7 +150,6 @@ gst_video_info_init (GstVideoInfo * info) #define DEFAULT_RGB 2 #define DEFAULT_GRAY 3 #define DEFAULT_UNKNOWN 4 -#define DEFAULT_YUV_UHD 5 static const GstVideoColorimetry default_color[] = { MAKE_COLORIMETRY (_16_235, BT601, BT601, SMPTE170M), @@ -158,7 +157,6 @@ static const GstVideoColorimetry default_color[] = { MAKE_COLORIMETRY (_0_255, RGB, SRGB, BT709), MAKE_COLORIMETRY (_0_255, BT601, UNKNOWN, UNKNOWN), MAKE_COLORIMETRY (_UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN), - MAKE_COLORIMETRY (_16_235, BT2020, BT2020_12, BT2020), }; static void @@ -167,10 +165,7 @@ set_default_colorimetry (GstVideoInfo * info) const GstVideoFormatInfo *finfo = info->finfo; if (GST_VIDEO_FORMAT_INFO_IS_YUV (finfo)) { - if (info->height >= 2160) { - info->chroma_site = GST_VIDEO_CHROMA_SITE_H_COSITED; - info->colorimetry = default_color[DEFAULT_YUV_UHD]; - } else if (info->height > 576) { + if (info->height > 576) { info->chroma_site = GST_VIDEO_CHROMA_SITE_H_COSITED; info->colorimetry = default_color[DEFAULT_YUV_HD]; } else { -- 2.7.4