aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/videodev2.h
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2017-03-01 12:31:20 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-03-22 10:13:26 -0300
commit79e92dc0ecc64dd221383960a8bc3399c6723d03 (patch)
tree7856e96485bc1124bd7c3c3a515d908a1ae78cee /include/uapi/linux/videodev2.h
parent[media] tw5864: use dev_warn instead of WARN to shut up warning (diff)
downloadlinux-dev-79e92dc0ecc64dd221383960a8bc3399c6723d03.tar.xz
linux-dev-79e92dc0ecc64dd221383960a8bc3399c6723d03.zip
[media] videodev2.h: map xvYCC601/709 to limited range quantization
The xvYCC601/709 encodings were mapped by default to full range quantization. This is actually wrong since these encodings use limited range quantization, but accept values outside of the limited range. This makes sense since for values within the limited range it behaves exactly the same as BT.601 or Rec. 709. The only difference is that with the xvYCC encodings the values outside of the limited range also produce value colors. Talking to people who know a lot more about this than I do made me realize that mapping xvYCC to full range quantization was wrong, so this patch corrects this and also improves the documentation. These formats are very rare, and since the formula for decoding these Y'CbCr encodings is actually fixed and independent of the quantization field value it is safe to make this change. The main advantage is that keeps the V4L2 specification in sync with the corresponding colorspace, HDMI and CEA861 standards when it comes to these xvYCC formats. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/uapi/linux/videodev2.h')
-rw-r--r--include/uapi/linux/videodev2.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 45184a2ef66c..316be62f3a45 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -378,8 +378,7 @@ enum v4l2_quantization {
#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb_or_hsv, colsp, ycbcr_enc) \
(((is_rgb_or_hsv) && (colsp) == V4L2_COLORSPACE_BT2020) ? \
V4L2_QUANTIZATION_LIM_RANGE : \
- (((is_rgb_or_hsv) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
- (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \
+ (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \
V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
enum v4l2_priority {