From 2e939afd73a74113cda92eb65859cdf40080c830 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 12 Mar 2019 16:42:11 +0100 Subject: [PATCH] video-color: add more color primaries formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They correspond to index 10, 11, 12 and 22 from ITU-T H.273, Table 2 – Interpretation of colour primaries (ColourPrimaries) value --- gst-libs/gst/video/video-color.c | 12 +++++++++++- gst-libs/gst/video/video-color.h | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-color.c b/gst-libs/gst/video/video-color.c index 46a5240ba4..e2cac8203d 100644 --- a/gst-libs/gst/video/video-color.c +++ b/gst-libs/gst/video/video-color.c @@ -269,6 +269,8 @@ gst_video_colorimetry_is_equal (const GstVideoColorimetry * cinfo, #define WP_C 0.31006, 0.31616 #define WP_D65 0.31271, 0.32902 +#define WP_CENTRE (1/3), (1/3) +#define WP_WHITE 0.314, 0.351 static const GstVideoColorPrimariesInfo color_primaries[] = { {GST_VIDEO_COLOR_PRIMARIES_UNKNOWN, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, @@ -285,7 +287,15 @@ static const GstVideoColorPrimariesInfo color_primaries[] = { {GST_VIDEO_COLOR_PRIMARIES_BT2020, WP_D65, 0.708, 0.292, 0.170, 0.797, 0.131, 0.046}, {GST_VIDEO_COLOR_PRIMARIES_ADOBERGB, WP_D65, 0.64, 0.33, 0.21, 0.71, 0.15, - 0.06} + 0.06}, + {GST_VIDEO_COLOR_PRIMARIES_SMPTEST428, WP_CENTRE, 1.0, 0.0, 0.0, 1.0, 0.0, + 0.0}, + {GST_VIDEO_COLOR_PRIMARIES_SMPTERP431, WP_WHITE, 0.68, 0.32, 0.265, 0.69, + 0.15, 0.06}, + {GST_VIDEO_COLOR_PRIMARIES_SMPTEEG432, WP_D65, 0.68, 0.32, 0.265, 0.69, 0.15, + 0.06}, + {GST_VIDEO_COLOR_PRIMARIES_EBU3213, WP_D65, 0.63, 0.34, 0.295, 0.605, 0.155, + 0.077}, }; /** diff --git a/gst-libs/gst/video/video-color.h b/gst-libs/gst/video/video-color.h index 6efd9150a3..31a7fab081 100644 --- a/gst-libs/gst/video/video-color.h +++ b/gst-libs/gst/video/video-color.h @@ -127,6 +127,10 @@ gdouble gst_video_color_transfer_decode (GstVideoTransferFunction func, gdo * @GST_VIDEO_COLOR_PRIMARIES_FILM: Generic film * @GST_VIDEO_COLOR_PRIMARIES_BT2020: BT2020 primaries. Since: 1.6 * @GST_VIDEO_COLOR_PRIMARIES_ADOBERGB: Adobe RGB primaries. Since: 1.8 + * @GST_VIDEO_COLOR_PRIMARIES_SMPTEST428: SMPTE ST 428 primaries. Since: 1.16 + * @GST_VIDEO_COLOR_PRIMARIES_SMPTERP431: SMPTE RP 431 primaries. Since: 1.16 + * @GST_VIDEO_COLOR_PRIMARIES_SMPTEEG432: SMPTE EG 432 primaries. Since: 1.16 + * @GST_VIDEO_COLOR_PRIMARIES_EBU3213: EBU 3213 primaries. Since: 1.16 * * The color primaries define the how to transform linear RGB values to and from * the CIE XYZ colorspace. @@ -140,7 +144,11 @@ typedef enum { GST_VIDEO_COLOR_PRIMARIES_SMPTE240M, GST_VIDEO_COLOR_PRIMARIES_FILM, GST_VIDEO_COLOR_PRIMARIES_BT2020, - GST_VIDEO_COLOR_PRIMARIES_ADOBERGB + GST_VIDEO_COLOR_PRIMARIES_ADOBERGB, + GST_VIDEO_COLOR_PRIMARIES_SMPTEST428, + GST_VIDEO_COLOR_PRIMARIES_SMPTERP431, + GST_VIDEO_COLOR_PRIMARIES_SMPTEEG432, + GST_VIDEO_COLOR_PRIMARIES_EBU3213, } GstVideoColorPrimaries; /**