[media] vivid: BT.2020 R'G'B' is limited range
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 8 Mar 2015 07:53:33 +0000 (04:53 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 2 Apr 2015 21:11:02 +0000 (18:11 -0300)
According to the standard the R'G'B' BT.2020 colorspace is limited
range, not full range. Fix this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/vivid/vivid-tpg.c

index 34493f4..acb73b6 100644 (file)
@@ -1265,6 +1265,10 @@ static void tpg_recalc(struct tpg_data *tpg)
                                                V4L2_QUANTIZATION_LIM_RANGE;
                                        break;
                                }
+                       } else if (tpg->colorspace == V4L2_COLORSPACE_BT2020) {
+                               /* R'G'B' BT.2020 is limited range */
+                               tpg->real_quantization =
+                                       V4L2_QUANTIZATION_LIM_RANGE;
                        }
                }
                tpg_precalculate_colors(tpg);