From patchwork Mon Jul 18 12:42:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 9234517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7FE06075D for ; Mon, 18 Jul 2016 12:43:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8D81205AD for ; Mon, 18 Jul 2016 12:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CBC126490; Mon, 18 Jul 2016 12:43:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2776F205AD for ; Mon, 18 Jul 2016 12:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbcGRMmu (ORCPT ); Mon, 18 Jul 2016 08:42:50 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33962 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbcGRMmn (ORCPT ); Mon, 18 Jul 2016 08:42:43 -0400 Received: by mail-lf0-f67.google.com with SMTP id l69so6709595lfg.1; Mon, 18 Jul 2016 05:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n0M7FUhvmCAECfe4dkK+ez/3ZVDNAMOJgfUoFXUfZgw=; b=CrXPfy/HYdx3rzDH1Lf8x6mgazgDUwGu1ezN8ar+EAedHLBu4SC4U569AYJGh+5QJZ SqXsqaHBaveJ6xq4qPWX99GLKIqOZuiSRt23j1XMGlHlELK+CtT6maSRHIwOhsEYPdd7 F7ZeZIhLisx3cYTTGQuuLQVuOoXeg9Ee2jd+cf/idwTiT4QcXpQxwb64/ppDrcfibns7 mBElHsaN9+YFnmQml7yqakhgX1rJgZgiSZX5Ncww9JivBFNGrsIgSmPJ6tGs99jK/YzS lHiqm6M5suWZRA/D563nJRBzSkjul3YXz+tIe2nEoVsJUqSi7gUhkDPrIbCLt55xBL5g uYmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n0M7FUhvmCAECfe4dkK+ez/3ZVDNAMOJgfUoFXUfZgw=; b=mt4RcpaNR9Q7+VhJ8F5+OWMTD9OCoJg0fxPkudCvZJldWloSp8DFvPm+6XfPY6kBrU 4M4mE3NhxntbM5XIVYJz3EfrgxLopkE7JFl0jZtTsldZ58hB7dqCnAXUZPkHb+JlD9pS uULpmcwUwmbYQalsB3QFIrplVpQL4rs/6rpj4bULSbQT2SCA1slbZlSBYlce/4OhVg6j Bzd2XeqhXSdr30FxQPV14w92tSYNmOnqSfvcBZMGSMjU/CDWQY6nLiSDXwaXhqtAIxfL zK9QPtrOzmZXGJFFfcfe0J8NWYkmqEQlKX1MfL88ftGH8f7esQngtos4r9ndeOmOEgNL xl7A== X-Gm-Message-State: ALyK8tLCJpDup1H2X2OCh+IkhhJWKzKQQ6kd/vtwLBKhO2Ov9eHc3gDLSJBYeqM5dLiN9g== X-Received: by 10.25.79.132 with SMTP id d126mr7615474lfb.68.1468845756342; Mon, 18 Jul 2016 05:42:36 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id 205sm4571672ljj.47.2016.07.18.05.42.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 05:42:35 -0700 (PDT) From: Ricardo Ribalda Delgado To: Jonathan Corbet , Mauro Carvalho Chehab , Hans Verkuil , Markus Heiser , Laurent Pinchart , Helen Mae Koike Fornazier , Antti Palosaari , Philipp Zabel , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v4 11/12] [media] Documentation: Add HSV encodings Date: Mon, 18 Jul 2016 14:42:15 +0200 Message-Id: <1468845736-19651-12-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468845736-19651-1-git-send-email-ricardo.ribalda@gmail.com> References: <1468845736-19651-1-git-send-email-ricardo.ribalda@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Describe the hsv_enc field and its use. Signed-off-by: Ricardo Ribalda Delgado --- Documentation/media/uapi/v4l/pixfmt-002.rst | 12 ++++++- Documentation/media/uapi/v4l/pixfmt-003.rst | 14 ++++++-- Documentation/media/uapi/v4l/pixfmt-006.rst | 38 ++++++++++++++++++++++ Documentation/media/uapi/v4l/pixfmt-packed-hsv.rst | 3 +- Documentation/media/videodev2.h.rst.exceptions | 4 +++ 5 files changed, 67 insertions(+), 4 deletions(-) diff --git a/Documentation/media/uapi/v4l/pixfmt-002.rst b/Documentation/media/uapi/v4l/pixfmt-002.rst index fae9b2d40a85..9a59e87b590f 100644 --- a/Documentation/media/uapi/v4l/pixfmt-002.rst +++ b/Documentation/media/uapi/v4l/pixfmt-002.rst @@ -177,6 +177,16 @@ Single-planar format structure - .. row 13 + - enum :ref:`v4l2_hsv_encoding ` + + - ``hsv_enc`` + + - This information supplements the ``colorspace`` and must be set by + the driver for capture streams and by the application for output + streams, see :ref:`colorspaces`. + + - .. row 14 + - enum :ref:`v4l2_quantization ` - ``quantization`` @@ -185,7 +195,7 @@ Single-planar format structure the driver for capture streams and by the application for output streams, see :ref:`colorspaces`. - - .. row 14 + - .. row 15 - enum :ref:`v4l2_xfer_func ` diff --git a/Documentation/media/uapi/v4l/pixfmt-003.rst b/Documentation/media/uapi/v4l/pixfmt-003.rst index 25c54872fbe1..f212d1feaaa0 100644 --- a/Documentation/media/uapi/v4l/pixfmt-003.rst +++ b/Documentation/media/uapi/v4l/pixfmt-003.rst @@ -138,6 +138,16 @@ describing all planes of that format. - .. row 10 + - enum :ref:`v4l2_hsv_encoding ` + + - ``hsv_enc`` + + - This information supplements the ``colorspace`` and must be set by + the driver for capture streams and by the application for output + streams, see :ref:`colorspaces`. + + - .. row 11 + - enum :ref:`v4l2_quantization ` - ``quantization`` @@ -146,7 +156,7 @@ describing all planes of that format. the driver for capture streams and by the application for output streams, see :ref:`colorspaces`. - - .. row 11 + - .. row 12 - enum :ref:`v4l2_xfer_func ` @@ -156,7 +166,7 @@ describing all planes of that format. the driver for capture streams and by the application for output streams, see :ref:`colorspaces`. - - .. row 12 + - .. row 13 - __u8 diff --git a/Documentation/media/uapi/v4l/pixfmt-006.rst b/Documentation/media/uapi/v4l/pixfmt-006.rst index 987b9a8a9eb4..ef7518077e8a 100644 --- a/Documentation/media/uapi/v4l/pixfmt-006.rst +++ b/Documentation/media/uapi/v4l/pixfmt-006.rst @@ -19,6 +19,15 @@ colorspace field of struct :ref:`v4l2_pix_format ` or struct :ref:`v4l2_pix_format_mplane ` needs to be filled in. +.. _hsv-colorspace: + +On :ref:`HSV formats ` the *Hue* is defined as the angle on +the cylindrical color representation. Usually this angle is measured in +degrees, i.e. 0-360. When we map this angle value into 8 bits, there are +two basic ways to do it: Divide the angular value by 2 (0-179), or use the +whole range, 0-255, dividing the angular value by 1.41. The +`v4l2_hsv_encoding ` field specify which encoding is used. + .. note:: The default R'G'B' quantization is full range for all colorspaces except for BT.2020 which uses limited range R'G'B' quantization. @@ -286,3 +295,32 @@ needs to be filled in. - Use the limited range quantization encoding. I.e. the range [0…1] is mapped to [16…235]. Cb and Cr are mapped from [-0.5…0.5] to [16…240]. + + + +.. _v4l2-hsv-encoding: + +.. flat-table:: V4L2 HSV Encodings + :header-rows: 1 + :stub-columns: 0 + + + - .. row 1 + + - Identifier + + - Details + + - .. row 2 + + - ``V4L2_HSV_ENC_180`` + + - For the Hue, each LSB is two degrees. + + - .. row 3 + + - ``V4L2_HSV_ENC_256`` + + - For the Hue, the 360 degrees are mapped into 8 bits, i.e. each + LSB is roughtly 1.41 degrees. + diff --git a/Documentation/media/uapi/v4l/pixfmt-packed-hsv.rst b/Documentation/media/uapi/v4l/pixfmt-packed-hsv.rst index 60ac821e309d..c0239fd2c216 100644 --- a/Documentation/media/uapi/v4l/pixfmt-packed-hsv.rst +++ b/Documentation/media/uapi/v4l/pixfmt-packed-hsv.rst @@ -14,7 +14,8 @@ Packed HSV formats Description =========== -The *hue* (h) is measured in degrees, one LSB represents two degrees. +The *hue* (h) is measured in degrees, the equivalence between degrees and LSBs +depends on the hsv-encoding used, see :ref:`colorspaces`. The *saturation* (s) and the *value* (v) are measured in percentage of the cylinder: 0 being the smallest value and 255 the maximum. diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions index 9bb9a6cc39d8..b47fef566d5f 100644 --- a/Documentation/media/videodev2.h.rst.exceptions +++ b/Documentation/media/videodev2.h.rst.exceptions @@ -87,6 +87,10 @@ replace symbol V4L2_YCBCR_ENC_XV601 v4l2-ycbcr-encoding replace symbol V4L2_YCBCR_ENC_XV709 v4l2-ycbcr-encoding replace symbol V4L2_YCBCR_ENC_SMPTE240M v4l2-ycbcr-encoding +# Documented enum v4l2_hsv_encoding +replace symbol V4L2_HSV_ENC_180 v4l2-hsv-encoding +replace symbol V4L2_HSV_ENC_256 v4l2-hsv-encoding + # Documented enum v4l2_quantization replace symbol V4L2_QUANTIZATION_DEFAULT v4l2-quantization replace symbol V4L2_QUANTIZATION_FULL_RANGE v4l2-quantization