This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l-utils: sync-with-kernel
Author:  Hans Verkuil <hans.verk...@cisco.com>
Date:    Tue Apr 11 08:38:54 2017 +0200

Main change is a fix for v4l2-tpg-core.c.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>

 contrib/freebsd/include/linux/videodev2.h | 4 ++--
 include/linux/videodev2.h                 | 4 ++--
 utils/common/v4l2-tpg-core.c              | 9 ++++++++-
 3 files changed, 12 insertions(+), 5 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=e748123b973e899cd6f0c08272a165661bd8386f
diff --git a/contrib/freebsd/include/linux/videodev2.h 
b/contrib/freebsd/include/linux/videodev2.h
index 80684a2d7282..3e4d244a8165 100644
--- a/contrib/freebsd/include/linux/videodev2.h
+++ b/contrib/freebsd/include/linux/videodev2.h
@@ -392,8 +392,7 @@ 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, XV601 or XV709: those
-        * are full range.
+        * limited range, except for COLORSPACE_JPEG: this is full range.
         */
        V4L2_QUANTIZATION_DEFAULT     = 0,
        V4L2_QUANTIZATION_FULL_RANGE  = 1,
@@ -690,6 +689,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_Y12I     v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 
12-bit L/R interleaved */
 #define V4L2_PIX_FMT_Z16      v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 
16-bit */
 #define V4L2_PIX_FMT_MT21C    v4l2_fourcc('M', 'T', '2', '1') /* Mediatek 
compressed block mode  */
+#define V4L2_PIX_FMT_INZI     v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar 
Greyscale 10-bit and Depth 16-bit */
 
 /* SDR formats - used only for Software Defined Radio devices */
 #define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 7266a625626b..2b2b000a46a8 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -358,8 +358,7 @@ 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, XV601 or XV709: those
-        * are full range.
+        * limited range, except for COLORSPACE_JPEG: this is full range.
         */
        V4L2_QUANTIZATION_DEFAULT     = 0,
        V4L2_QUANTIZATION_FULL_RANGE  = 1,
@@ -656,6 +655,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_Y12I     v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 
12-bit L/R interleaved */
 #define V4L2_PIX_FMT_Z16      v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 
16-bit */
 #define V4L2_PIX_FMT_MT21C    v4l2_fourcc('M', 'T', '2', '1') /* Mediatek 
compressed block mode  */
+#define V4L2_PIX_FMT_INZI     v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar 
Greyscale 10-bit and Depth 16-bit */
 
 /* SDR formats - used only for Software Defined Radio devices */
 #define V4L2_SDR_FMT_CU8          v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
diff --git a/utils/common/v4l2-tpg-core.c b/utils/common/v4l2-tpg-core.c
index bd3283bf49aa..7d66ddeca0dd 100644
--- a/utils/common/v4l2-tpg-core.c
+++ b/utils/common/v4l2-tpg-core.c
@@ -917,7 +917,14 @@ static void precalculate_color(struct tpg_data *tpg, int k)
                y >>= 4;
                cb >>= 4;
                cr >>= 4;
-               if (tpg->real_quantization == V4L2_QUANTIZATION_LIM_RANGE) {
+               /*
+                * XV601/709 use the header/footer margins to encode R', G'
+                * and B' values outside the range [0-1]. So do not clamp
+                * XV601/709 values.
+                */
+               if (tpg->real_quantization == V4L2_QUANTIZATION_LIM_RANGE &&
+                   tpg->real_ycbcr_enc != V4L2_YCBCR_ENC_XV601 &&
+                   tpg->real_ycbcr_enc != V4L2_YCBCR_ENC_XV709) {
                        y = clamp(y, 16, 235);
                        cb = clamp(cb, 16, 240);
                        cr = clamp(cr, 16, 240);

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to