linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Colorspace fixes
@ 2016-08-04  9:28 Hans Verkuil
  2016-08-04  9:28 ` [PATCH 1/7] videodev2.h: fix sYCC/AdobeYCC default quantization range Hans Verkuil
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media

From: Hans Verkuil <hans.verkuil@cisco.com>

This patch series fixes a number of bugs/documentation mistakes w.r.t.
colorspaces.

The main one is that the V4L2_YCBCR_ENC_SYCC was mistakenly added. It turns
out it is identical to the BT.601 Y'CbCr encoding. So the use of the old SYCC
define has been removed from the kernel and documentation.

Some other changes: a 4th decimal was added to the BT.601 conversion matrices,
the default Y'CbCr quantization range for sRGB and AdobeRGB is full range
instead of limited range, and two textual mistakes were fixed in the doc.

Hans Verkuil (7):
  videodev2.h: fix sYCC/AdobeYCC default quantization range
  vivid: don't mention the obsolete sYCC Y'CbCr encoding
  v4l2-tpg-core: drop SYCC, use higher precision 601 conversion matrix
  videodev2.h: put V4L2_YCBCR_ENC_SYCC under #ifndef __KERNEL__
  pixfmt.rst: drop V4L2_YCBCR_ENC_SYCC from the documentation
  pixfmt-007.rst: fix a messed up note in the DCI-P3 doc
  pixfmt-007.rst: fix copy-and-paste error in SMPTE-240M doc

 Documentation/media/uapi/v4l/pixfmt-006.rst   | 10 +----
 Documentation/media/uapi/v4l/pixfmt-007.rst   | 58 +++++++++++++--------------
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 14 +++----
 drivers/media/platform/vivid/vivid-ctrls.c    |  3 +-
 include/uapi/linux/videodev2.h                | 21 ++++++----
 5 files changed, 50 insertions(+), 56 deletions(-)

-- 
2.8.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/7] videodev2.h: fix sYCC/AdobeYCC default quantization range
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  2016-08-04  9:28 ` [PATCH 2/7] vivid: don't mention the obsolete sYCC Y'CbCr encoding Hans Verkuil
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

The default quantization range of the Y'CbCr encodings of sRGB
and AdobeRGB are full range instead of limited range according to
the corresponding standards.

Fix this in the V4L2_MAP_QUANTIZATION_DEFAULT macro.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/media/uapi/v4l/pixfmt-007.rst | 4 ++--
 include/uapi/linux/videodev2.h              | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 8c946b0..017f166 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -339,7 +339,7 @@ The :ref:`adobergb` standard defines the colorspace used by computer
 graphics that use the AdobeRGB colorspace. This is also known as the
 :ref:`oprgb` standard. The default transfer function is
 ``V4L2_XFER_FUNC_ADOBERGB``. The default Y'CbCr encoding is
-``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is limited
+``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full
 range. The chromaticities of the primary colors and the white reference
 are:
 
@@ -412,7 +412,7 @@ the following ``V4L2_YCBCR_ENC_601`` encoding:
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
 [-0.5…0.5]. This transform is identical to one defined in SMPTE
-170M/BT.601. The Y'CbCr quantization is limited range.
+170M/BT.601. The Y'CbCr quantization is full range.
 
 
 .. _col-bt2020:
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 724f43e..12773f2 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -345,8 +345,8 @@ enum v4l2_quantization {
 	/*
 	 * The default for R'G'B' quantization is always full range, except
 	 * for the BT2020 colorspace. For Y'CbCr the quantization is always
-	 * limited range, except for COLORSPACE_JPEG, SYCC, XV601 or XV709:
-	 * those are full range.
+	 * limited range, except for COLORSPACE_JPEG, SRGB, ADOBERGB,
+	 * XV601 or XV709: those are full range.
 	 */
 	V4L2_QUANTIZATION_DEFAULT     = 0,
 	V4L2_QUANTIZATION_FULL_RANGE  = 1,
@@ -361,7 +361,8 @@ enum v4l2_quantization {
 #define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
 	(((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \
 	 (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
-	  (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \
+	  (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \
+	  (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \
 	 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
 
 enum v4l2_priority {
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/7] vivid: don't mention the obsolete sYCC Y'CbCr encoding
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
  2016-08-04  9:28 ` [PATCH 1/7] videodev2.h: fix sYCC/AdobeYCC default quantization range Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  2016-08-04  9:28 ` [PATCH 3/7] v4l2-tpg-core: drop SYCC, use higher precision 601 conversion matrix Hans Verkuil
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

This encoding is identical to the 601 encoding. The old duplicate
SYCC define is about to be removed for use in the kernel, so remove
its use in vivid first.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/platform/vivid/vivid-ctrls.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c
index b98089c..aceb38d 100644
--- a/drivers/media/platform/vivid/vivid-ctrls.c
+++ b/drivers/media/platform/vivid/vivid-ctrls.c
@@ -761,7 +761,7 @@ static const char * const vivid_ctrl_ycbcr_enc_strings[] = {
 	"Rec. 709",
 	"xvYCC 601",
 	"xvYCC 709",
-	"sYCC",
+	"",
 	"BT.2020",
 	"BT.2020 Constant Luminance",
 	"SMPTE 240M",
@@ -773,6 +773,7 @@ static const struct v4l2_ctrl_config vivid_ctrl_ycbcr_enc = {
 	.id = VIVID_CID_YCBCR_ENC,
 	.name = "Y'CbCr Encoding",
 	.type = V4L2_CTRL_TYPE_MENU,
+	.menu_skip_mask = 1 << 5,
 	.max = ARRAY_SIZE(vivid_ctrl_ycbcr_enc_strings) - 2,
 	.qmenu = vivid_ctrl_ycbcr_enc_strings,
 };
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/7] v4l2-tpg-core: drop SYCC, use higher precision 601 conversion matrix
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
  2016-08-04  9:28 ` [PATCH 1/7] videodev2.h: fix sYCC/AdobeYCC default quantization range Hans Verkuil
  2016-08-04  9:28 ` [PATCH 2/7] vivid: don't mention the obsolete sYCC Y'CbCr encoding Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  2016-08-04  9:28 ` [PATCH 4/7] videodev2.h: put V4L2_YCBCR_ENC_SYCC under #ifndef __KERNEL__ Hans Verkuil
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

The SYCC Y'CbCr encoding is identical to the 601 encoding. Since the
SYCC define is about to be removed for use in the kernel we need to
drop it in the TPG code as well.

This patch also adds a 4th decimal to the 601 conversion matrix.
That was specified by the sYCC spec and it makes sense to use this
across the board.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/media/uapi/v4l/pixfmt-007.rst   | 30 +++++++++++++--------------
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 14 ++++++-------
 2 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 017f166..1f64477 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -89,11 +89,11 @@ Inverse Transfer function:
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_601`` encoding:
 
-    Y' = 0.299R' + 0.587G' + 0.114B'
+    Y' = 0.2990R' + 0.5870G' + 0.1140B'
 
-    Cb = -0.169R' - 0.331G' + 0.5B'
+    Cb = -0.1687R' - 0.3313G' + 0.5B'
 
-    Cr = 0.5R' - 0.419G' - 0.081B'
+    Cr = 0.5R' - 0.4187G' - 0.0813B'
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
 [-0.5…0.5]. This conversion to Y'CbCr is identical to the one defined in
@@ -221,11 +221,11 @@ similar to the BT.601 encoding, but it allows for R', G' and B' values
 that are outside the range [0…1]. The resulting Y', Cb and Cr values are
 scaled and offset:
 
-    Y' = (219 / 256) * (0.299R' + 0.587G' + 0.114B') + (16 / 256)
+    Y' = (219 / 256) * (0.2990R' + 0.5870G' + 0.1140B') + (16 / 256)
 
-    Cb = (224 / 256) * (-0.169R' - 0.331G' + 0.5B')
+    Cb = (224 / 256) * (-0.1687R' - 0.3313G' + 0.5B')
 
-    Cr = (224 / 256) * (0.5R' - 0.419G' - 0.081B')
+    Cr = (224 / 256) * (0.5R' - 0.4187G' - 0.0813B')
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
 [-0.5…0.5]. The non-standard xvYCC 709 or xvYCC 601 encodings can be
@@ -404,11 +404,11 @@ Inverse Transfer function:
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_601`` encoding:
 
-    Y' = 0.299R' + 0.587G' + 0.114B'
+    Y' = 0.2990R' + 0.5870G' + 0.1140B'
 
-    Cb = -0.169R' - 0.331G' + 0.5B'
+    Cb = -0.1687R' - 0.3313G' + 0.5B'
 
-    Cr = 0.5R' - 0.419G' - 0.081B'
+    Cr = 0.5R' - 0.4187G' - 0.0813B'
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
 [-0.5…0.5]. This transform is identical to one defined in SMPTE
@@ -775,11 +775,11 @@ Inverse Transfer function:
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_601`` encoding:
 
-    Y' = 0.299R' + 0.587G' + 0.114B'
+    Y' = 0.2990R' + 0.5870G' + 0.1140B'
 
-    Cb = -0.169R' - 0.331G' + 0.5B'
+    Cb = -0.1687R' - 0.3313G' + 0.5B'
 
-    Cr = 0.5R' - 0.419G' - 0.081B'
+    Cr = 0.5R' - 0.4187G' - 0.0813B'
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
 [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
@@ -865,11 +865,11 @@ Inverse Transfer function:
 The luminance (Y') and color difference (Cb and Cr) are obtained with
 the following ``V4L2_YCBCR_ENC_601`` encoding:
 
-    Y' = 0.299R' + 0.587G' + 0.114B'
+    Y' = 0.2990R' + 0.5870G' + 0.1140B'
 
-    Cb = -0.169R' - 0.331G' + 0.5B'
+    Cb = -0.1687R' - 0.3313G' + 0.5B'
 
-    Cr = 0.5R' - 0.419G' - 0.081B'
+    Cr = 0.5R' - 0.4187G' - 0.0813B'
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
 [-0.5…0.5]. The Y'CbCr quantization is limited range. This transform is
diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index 3ec3ceb..1684810 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -504,14 +504,14 @@ static void color_to_ycbcr(struct tpg_data *tpg, int r, int g, int b,
 #define COEFF(v, r) ((int)(0.5 + (v) * (r) * 256.0))
 
 	static const int bt601[3][3] = {
-		{ COEFF(0.299, 219),  COEFF(0.587, 219),  COEFF(0.114, 219)  },
-		{ COEFF(-0.169, 224), COEFF(-0.331, 224), COEFF(0.5, 224)    },
-		{ COEFF(0.5, 224),    COEFF(-0.419, 224), COEFF(-0.081, 224) },
+		{ COEFF(0.299, 219),   COEFF(0.587, 219),   COEFF(0.114, 219)   },
+		{ COEFF(-0.1687, 224), COEFF(-0.3313, 224), COEFF(0.5, 224)     },
+		{ COEFF(0.5, 224),     COEFF(-0.4187, 224), COEFF(-0.0813, 224) },
 	};
 	static const int bt601_full[3][3] = {
-		{ COEFF(0.299, 255),  COEFF(0.587, 255),  COEFF(0.114, 255)  },
-		{ COEFF(-0.169, 255), COEFF(-0.331, 255), COEFF(0.5, 255)    },
-		{ COEFF(0.5, 255),    COEFF(-0.419, 255), COEFF(-0.081, 255) },
+		{ COEFF(0.299, 255),   COEFF(0.587, 255),   COEFF(0.114, 255)   },
+		{ COEFF(-0.1687, 255), COEFF(-0.3313, 255), COEFF(0.5, 255)     },
+		{ COEFF(0.5, 255),     COEFF(-0.4187, 255), COEFF(-0.0813, 255) },
 	};
 	static const int rec709[3][3] = {
 		{ COEFF(0.2126, 219),  COEFF(0.7152, 219),  COEFF(0.0722, 219)  },
@@ -558,7 +558,6 @@ static void color_to_ycbcr(struct tpg_data *tpg, int r, int g, int b,
 
 	switch (tpg->real_ycbcr_enc) {
 	case V4L2_YCBCR_ENC_601:
-	case V4L2_YCBCR_ENC_SYCC:
 		rgb2ycbcr(full ? bt601_full : bt601, r, g, b, y_offset, y, cb, cr);
 		break;
 	case V4L2_YCBCR_ENC_XV601:
@@ -674,7 +673,6 @@ static void ycbcr_to_color(struct tpg_data *tpg, int y, int cb, int cr,
 
 	switch (tpg->real_ycbcr_enc) {
 	case V4L2_YCBCR_ENC_601:
-	case V4L2_YCBCR_ENC_SYCC:
 		ycbcr2rgb(full ? bt601_full : bt601, y, cb, cr, y_offset, r, g, b);
 		break;
 	case V4L2_YCBCR_ENC_XV601:
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/7] videodev2.h: put V4L2_YCBCR_ENC_SYCC under #ifndef __KERNEL__
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
                   ` (2 preceding siblings ...)
  2016-08-04  9:28 ` [PATCH 3/7] v4l2-tpg-core: drop SYCC, use higher precision 601 conversion matrix Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  2016-08-04  9:28 ` [PATCH 5/7] pixfmt.rst: drop V4L2_YCBCR_ENC_SYCC from the documentation Hans Verkuil
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

This define is a duplicate of V4L2_YCBCR_ENC_601. So mark it as
'should not be used' and put it under #ifndef __KERNEL__ to
prevent drivers from referring to it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 include/uapi/linux/videodev2.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 12773f2..8c5468c 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -292,13 +292,11 @@ enum v4l2_ycbcr_encoding {
 	 * various colorspaces:
 	 *
 	 * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M,
-	 * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_ADOBERGB and
-	 * V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601
+	 * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB,
+	 * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601
 	 *
 	 * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709
 	 *
-	 * V4L2_COLORSPACE_SRGB: V4L2_YCBCR_ENC_SYCC
-	 *
 	 * V4L2_COLORSPACE_BT2020: V4L2_YCBCR_ENC_BT2020
 	 *
 	 * V4L2_COLORSPACE_SMPTE240M: V4L2_YCBCR_ENC_SMPTE240M
@@ -317,8 +315,14 @@ enum v4l2_ycbcr_encoding {
 	/* Rec. 709/EN 61966-2-4 Extended Gamut -- HDTV */
 	V4L2_YCBCR_ENC_XV709          = 4,
 
-	/* sYCC (Y'CbCr encoding of sRGB) */
+#ifndef __KERNEL__
+	/*
+	 * sYCC (Y'CbCr encoding of sRGB), identical to ENC_601. It was added
+	 * originally due to a misunderstanding of the sYCC standard. It should
+	 * not be used, instead use V4L2_YCBCR_ENC_601.
+	 */
 	V4L2_YCBCR_ENC_SYCC           = 5,
+#endif
 
 	/* BT.2020 Non-constant Luminance Y'CbCr */
 	V4L2_YCBCR_ENC_BT2020         = 6,
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/7] pixfmt.rst: drop V4L2_YCBCR_ENC_SYCC from the documentation
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
                   ` (3 preceding siblings ...)
  2016-08-04  9:28 ` [PATCH 4/7] videodev2.h: put V4L2_YCBCR_ENC_SYCC under #ifndef __KERNEL__ Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  2016-08-04  9:28 ` [PATCH 6/7] pixfmt-007.rst: fix a messed up note in the DCI-P3 doc Hans Verkuil
  2016-08-04  9:28 ` [PATCH 7/7] pixfmt-007.rst: fix copy-and-paste error in SMPTE-240M doc Hans Verkuil
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

The V4L2_YCBCR_ENC_SYCC encoding is identical to V4L2_YCBCR_ENC_601.
Remove V4L2_YCBCR_ENC_SYCC from the documentation since it should not
be used.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/media/uapi/v4l/pixfmt-006.rst | 10 ++--------
 Documentation/media/uapi/v4l/pixfmt-007.rst | 12 ++++--------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-006.rst b/Documentation/media/uapi/v4l/pixfmt-006.rst
index 987b9a8..94271c8 100644
--- a/Documentation/media/uapi/v4l/pixfmt-006.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-006.rst
@@ -224,23 +224,17 @@ needs to be filled in.
 
     -  .. row 7
 
-       -  ``V4L2_YCBCR_ENC_SYCC``
-
-       -  Use the extended gamut sYCC encoding.
-
-    -  .. row 8
-
        -  ``V4L2_YCBCR_ENC_BT2020``
 
        -  Use the default non-constant luminance BT.2020 Y'CbCr encoding.
 
-    -  .. row 9
+    -  .. row 8
 
        -  ``V4L2_YCBCR_ENC_BT2020_CONST_LUM``
 
        -  Use the constant luminance BT.2020 Yc'CbcCrc encoding.
 
-    -  .. row 10
+    -  .. row 9
 
        -  ``V4L2_YCBCR_ENC_SMPTE_240M``
 
diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 1f64477..0f9ce74 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -241,7 +241,7 @@ Colorspace sRGB (V4L2_COLORSPACE_SRGB)
 The :ref:`srgb` standard defines the colorspace used by most webcams
 and computer graphics. The default transfer function is
 ``V4L2_XFER_FUNC_SRGB``. The default Y'CbCr encoding is
-``V4L2_YCBCR_ENC_SYCC``. The default Y'CbCr quantization is full range.
+``V4L2_YCBCR_ENC_601``. The default Y'CbCr quantization is full range.
 The chromaticities of the primary colors and the white reference are:
 
 
@@ -313,8 +313,7 @@ Inverse Transfer function:
     L = ((L' + 0.055) / 1.055) :sup:`2.4` for L' > 0.04045
 
 The luminance (Y') and color difference (Cb and Cr) are obtained with
-the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by
-:ref:`sycc`:
+the following ``V4L2_YCBCR_ENC_601`` encoding as defined by :ref:`sycc`:
 
     Y' = 0.2990R' + 0.5870G' + 0.1140B'
 
@@ -323,11 +322,8 @@ the following ``V4L2_YCBCR_ENC_SYCC`` encoding as defined by
     Cr = 0.5R' - 0.4187G' - 0.0813B'
 
 Y' is clamped to the range [0…1] and Cb and Cr are clamped to the range
-[-0.5…0.5]. The ``V4L2_YCBCR_ENC_SYCC`` quantization is always full
-range. Although this Y'CbCr encoding looks very similar to the
-``V4L2_YCBCR_ENC_XV601`` encoding, it is not. The
-``V4L2_YCBCR_ENC_XV601`` scales and offsets the Y'CbCr values before
-quantization, but this encoding does not do that.
+[-0.5…0.5]. This transform is identical to one defined in SMPTE
+170M/BT.601. The Y'CbCr quantization is full range.
 
 
 .. _col-adobergb:
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/7] pixfmt-007.rst: fix a messed up note in the DCI-P3 doc
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
                   ` (4 preceding siblings ...)
  2016-08-04  9:28 ` [PATCH 5/7] pixfmt.rst: drop V4L2_YCBCR_ENC_SYCC from the documentation Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  2016-08-04  9:28 ` [PATCH 7/7] pixfmt-007.rst: fix copy-and-paste error in SMPTE-240M doc Hans Verkuil
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

The text of the note included text that shouldn't have been part
of the note. Move that out of the note into the proper place.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/media/uapi/v4l/pixfmt-007.rst | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 0f9ce74..6ca475a 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -532,13 +532,13 @@ Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3)
 The :ref:`smpte431` standard defines the colorspace used by cinema
 projectors that use the DCI-P3 colorspace. The default transfer function
 is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
-``V4L2_YCBCR_ENC_709``.
+``V4L2_YCBCR_ENC_709``. The default Y'CbCr quantization is limited range.
 
-.. note:: Note that this colorspace does not specify a
+.. note:: Note that this colorspace standard does not specify a
    Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
-   default Y'CbCr encoding was picked because it is the HDTV encoding. The
-   default Y'CbCr quantization is limited range. The chromaticities of the
-   primary colors and the white reference are:
+   default Y'CbCr encoding was picked because it is the HDTV encoding.
+
+The chromaticities of the primary colors and the white reference are:
 
 
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 7/7] pixfmt-007.rst: fix copy-and-paste error in SMPTE-240M doc
  2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
                   ` (5 preceding siblings ...)
  2016-08-04  9:28 ` [PATCH 6/7] pixfmt-007.rst: fix a messed up note in the DCI-P3 doc Hans Verkuil
@ 2016-08-04  9:28 ` Hans Verkuil
  6 siblings, 0 replies; 8+ messages in thread
From: Hans Verkuil @ 2016-08-04  9:28 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Instead of referring to Y', Cb and Cr, it referred to Yc', Cbc and
Crc, which were accidentally copied from the BT.2020 constant luminance
text.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 Documentation/media/uapi/v4l/pixfmt-007.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/media/uapi/v4l/pixfmt-007.rst b/Documentation/media/uapi/v4l/pixfmt-007.rst
index 6ca475a..2513cf3 100644
--- a/Documentation/media/uapi/v4l/pixfmt-007.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-007.rst
@@ -685,7 +685,7 @@ the following ``V4L2_YCBCR_ENC_SMPTE240M`` encoding:
 
     Cr = 0.5R' - 0.4451G' - 0.0549B'
 
-Yc' is clamped to the range [0…1] and Cbc and Crc are clamped to the
+Y' is clamped to the range [0…1] and Cb and Cr are clamped to the
 range [-0.5…0.5]. The Y'CbCr quantization is limited range.
 
 
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-04  9:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04  9:28 [PATCH 0/7] Colorspace fixes Hans Verkuil
2016-08-04  9:28 ` [PATCH 1/7] videodev2.h: fix sYCC/AdobeYCC default quantization range Hans Verkuil
2016-08-04  9:28 ` [PATCH 2/7] vivid: don't mention the obsolete sYCC Y'CbCr encoding Hans Verkuil
2016-08-04  9:28 ` [PATCH 3/7] v4l2-tpg-core: drop SYCC, use higher precision 601 conversion matrix Hans Verkuil
2016-08-04  9:28 ` [PATCH 4/7] videodev2.h: put V4L2_YCBCR_ENC_SYCC under #ifndef __KERNEL__ Hans Verkuil
2016-08-04  9:28 ` [PATCH 5/7] pixfmt.rst: drop V4L2_YCBCR_ENC_SYCC from the documentation Hans Verkuil
2016-08-04  9:28 ` [PATCH 6/7] pixfmt-007.rst: fix a messed up note in the DCI-P3 doc Hans Verkuil
2016-08-04  9:28 ` [PATCH 7/7] pixfmt-007.rst: fix copy-and-paste error in SMPTE-240M doc Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).