[x265] [PATCH] sei: the mastering display color primaries will typically be RGB

Steve Borho steve at borho.org
Fri May 1 21:56:21 CEST 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1430510161 18000
#      Fri May 01 14:56:01 2015 -0500
# Node ID f7f596db7fd748c0fec0c90f236fd7625c6eb4e5
# Parent  ffb2b036c91c503bccc28d88636d089177c3a1fe
sei: the mastering display color primaries will typically be RGB

The HEVCv2 spec doesn't say what color space the three channels must be, but it
does say that if they are RGB they should be in GBR order. Since RGB seems most
likely, I've changed the format and help to make the order more clear

  display_primaries_x[ c ] and display_primaries_y[ c ] specify the
  normalized x and y chromaticity coordinates, respectively, of the
  colour primary component c of the mastering display in increments of
  0.00002, according to the CIE 1931 definition of x and y as specified
  in ISO 11664-1 (see also ISO 11664-3 and CIE 15). For describing
  mastering displays that use red, green and blue colour primaries, it
  is suggested that index value c equal to 0 should correspond to the
  green primary, c equal to 1 should correspond to the blue primary and
  c equal to 2 should correspond to the red colour primary (see also
  Annex E and Table E.3).  The values of display_primaries_x[ c ] and
  display_primaries_y[ c ] shall be in the range of 0 to 50 000,
  inclusive.

diff -r ffb2b036c91c -r f7f596db7fd7 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Fri May 01 12:34:09 2015 -0500
+++ b/doc/reST/cli.rst	Fri May 01 14:56:01 2015 -0500
@@ -1493,12 +1493,12 @@
 
 	SMPTE ST 2086 mastering display color volume SEI info, specified as
 	a string which is parsed when the stream header SEI are emitted. The
-	string format is "Y(%hu,%hu)U(%hu,%hu)V(%hu,%hu)WP(%hu,%hu)L(%u,%u)"
+	string format is "G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)"
 	where %hu are unsigned 16bit integers and %u are unsigned 32bit
-	integers. The SEI includes X,Y display primaries for YUV channels,
+	integers. The SEI includes X,Y display primaries for RGB channels,
 	white point X,Y and max,min luminance values.
 
-	Example: Y(10,12)U(5,13)V(5,13)WP(100,100)L(1000,100)
+	Example: G(10,12)B(5,13)R(5,13)WP(100,100)L(1000,100)
 
 	Note that this string value will need to be escaped or quoted to
 	protect against shell expansion on many platforms
diff -r ffb2b036c91c -r f7f596db7fd7 source/encoder/sei.h
--- a/source/encoder/sei.h	Fri May 01 12:34:09 2015 -0500
+++ b/source/encoder/sei.h	Fri May 01 14:56:01 2015 -0500
@@ -126,7 +126,7 @@
 
     bool parse(const char* value)
     {
-        return sscanf(value, "Y(%hu,%hu)U(%hu,%hu)V(%hu,%hu)WP(%hu,%hu)L(%u,%u)",
+        return sscanf(value, "G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)",
                       &displayPrimaryX[0], &displayPrimaryY[0],
                       &displayPrimaryX[1], &displayPrimaryY[1],
                       &displayPrimaryX[2], &displayPrimaryY[2],
diff -r ffb2b036c91c -r f7f596db7fd7 source/x265.h
--- a/source/x265.h	Fri May 01 12:34:09 2015 -0500
+++ b/source/x265.h	Fri May 01 14:56:01 2015 -0500
@@ -1102,9 +1102,9 @@
 
     /* SMPTE ST 2086 mastering display color volume SEI info, specified as a
      * string which is parsed when the stream header SEI are emitted. The string
-     * format is "Y(%hu,%hu)U(%hu,%hu)V(%hu,%hu)WP(%hu,%hu)L(%u,%u)" where %hu
+     * format is "G(%hu,%hu)B(%hu,%hu)R(%hu,%hu)WP(%hu,%hu)L(%u,%u)" where %hu
      * are unsigned 16bit integers and %u are unsigned 32bit integers. The SEI
-     * includes X,Y display primaries for YUV channels, white point X,Y and
+     * includes X,Y display primaries for RGB channels, white point X,Y and
      * max,min luminance values. */
     const char* masteringDisplayColorVolume;
 


More information about the x265-devel mailing list