aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2017-02-10 04:18:36 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-23 11:44:37 -0500
commit7b071234537686546c5f05fdcb40a33ade2f6b04 (patch)
tree02333fe8c7bf1713b09499a8ee47f583d9e2b6ff /include/uapi/linux
parent8629aed2387cd22d1bde76e798034c3ea31018f7 (diff)
videodev2.h: go back to limited range Y'CbCr for SRGB and, ADOBERGB
commit 35879ee4769099905fa3bda0b21e73d434e2df6a upstream. This reverts 'commit 7e0739cd9c40 ("[media] videodev2.h: fix sYCC/AdobeYCC default quantization range"). The problem is that many drivers can convert R'G'B' content (often from sensors) to Y'CbCr, but they all produce limited range Y'CbCr. To stay backwards compatible the default quantization range for sRGB and AdobeRGB Y'CbCr encoding should be limited range, not full range, even though the corresponding standards specify full range. Update the V4L2_MAP_QUANTIZATION_DEFAULT define accordingly and also update the documentation. Fixes: 7e0739cd9c40 ("[media] videodev2.h: fix sYCC/AdobeYCC default quantization range") Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/videodev2.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 94f123f3e04e..7f34d3c67648 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -349,8 +349,8 @@ enum v4l2_quantization {
349 /* 349 /*
350 * The default for R'G'B' quantization is always full range, except 350 * The default for R'G'B' quantization is always full range, except
351 * for the BT2020 colorspace. For Y'CbCr the quantization is always 351 * for the BT2020 colorspace. For Y'CbCr the quantization is always
352 * limited range, except for COLORSPACE_JPEG, SRGB, ADOBERGB, 352 * limited range, except for COLORSPACE_JPEG, XV601 or XV709: those
353 * XV601 or XV709: those are full range. 353 * are full range.
354 */ 354 */
355 V4L2_QUANTIZATION_DEFAULT = 0, 355 V4L2_QUANTIZATION_DEFAULT = 0,
356 V4L2_QUANTIZATION_FULL_RANGE = 1, 356 V4L2_QUANTIZATION_FULL_RANGE = 1,
@@ -365,8 +365,7 @@ enum v4l2_quantization {
365#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \ 365#define V4L2_MAP_QUANTIZATION_DEFAULT(is_rgb, colsp, ycbcr_enc) \
366 (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \ 366 (((is_rgb) && (colsp) == V4L2_COLORSPACE_BT2020) ? V4L2_QUANTIZATION_LIM_RANGE : \
367 (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \ 367 (((is_rgb) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \
368 (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \ 368 (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) ? \
369 (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \
370 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) 369 V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE))
371 370
372enum v4l2_priority { 371enum v4l2_priority {