From patchwork Thu Aug 18 14:33:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 9288295 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 DB513607FF for ; Thu, 18 Aug 2016 14:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDEA92922D for ; Thu, 18 Aug 2016 14:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2673292A7; Thu, 18 Aug 2016 14:36:47 +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=ham 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 3A7C82922D for ; Thu, 18 Aug 2016 14:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768108AbcHROf4 (ORCPT ); Thu, 18 Aug 2016 10:35:56 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34340 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768358AbcHROfq (ORCPT ); Thu, 18 Aug 2016 10:35:46 -0400 Received: by mail-lf0-f65.google.com with SMTP id k135so1878475lfb.1; Thu, 18 Aug 2016 07:33:57 -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; bh=KOfPKzbg1R7FeFxs9j82Yus6UDc11Nie70Brn08Ak0w=; b=WY3hy3F2N8KVZxr/YqEmDdk3i8GKrU2CaTgPoeKdjMoZSwqbp0t5oggNl+sQsaAsKd IsHEiwp6gxKRgN+GxmsHYeWcAzQaUKLpHLOgp5Zb4Mdj4wRghbxHLHEqzgeWEM3sghyE 82CzIbwvDD98cyGTVW9i/aF50hdQ3Uq/XxeqSmRV5zotjhkcPgdyqk58tCav5W4BdwjM msrlB9+RLErq/eLhsLouseV7dY4XZKp/VxxbKxk/SklzRdMO+iVbbj16oRgVztYIgsh9 D+Ft2Nt5OV7c214f8A3+rlMhPVV9m5zN7bOatP9CrpIeL5taJKQwlt5RL/sP8q0oW8Sr C4tw== 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; bh=KOfPKzbg1R7FeFxs9j82Yus6UDc11Nie70Brn08Ak0w=; b=PcroWRW8ohFqeKd3qGmzsPaiHEvJY40XnWHqpPsDUsRVwfI6dpOUvXX+dQFri8OHVw D97H1GGGcmlEwB9/HpgQZ0CiAJywUhw9Dyr830hPC9r7sbDWcywvINqBlLXoLipTfbZs VH7l4WSlKuZATm/7bBssutdigOAcf1pcKVjygECXTtLZaYSke60R3o4o4fwnXo9j+S6D Pe823Ls8x0MjmwegaiVwUT5tnXlcXadRuDwFXMODP790Pci6xL4LRyY4oG4C9BgkWrpt z5Vs6iNPVyjc7FQaU8Pqg28fQ/U9svl9ngnQWMVP17Jba8N/c1nuX1e9r5MwmjD9/Zhu 2tuw== X-Gm-Message-State: AEkoousdL7XRFPLuEg9D/Ok1Qdtb18BmL59qTvhzUDL1OQR21o/svh3gVvtVTGLcs/nH2Q== X-Received: by 10.25.24.85 with SMTP id o82mr638977lfi.23.1471530836919; Thu, 18 Aug 2016 07:33:56 -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 p21sm389218lfp.4.2016.08.18.07.33.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 07:33:55 -0700 (PDT) From: Ricardo Ribalda Delgado To: Mauro Carvalho Chehab , Hans Verkuil , Markus Heiser , Laurent Pinchart , Helen Mae Koike Fornazier , Antti Palosaari , Philipp Zabel , Shuah Khan , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v5 11/12] [media] Documentation: Add HSV encodings Date: Thu, 18 Aug 2016 16:33:37 +0200 Message-Id: <1471530818-7928-12-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471530818-7928-1-git-send-email-ricardo.ribalda@gmail.com> References: <1471530818-7928-1-git-send-email-ricardo.ribalda@gmail.com> 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 | 41 ++++++++++++++++++++-- Documentation/media/uapi/v4l/pixfmt-packed-hsv.rst | 3 +- Documentation/media/videodev2.h.rst.exceptions | 4 +++ 5 files changed, 68 insertions(+), 6 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 94271c8a3f68..b95099226e52 100644 --- a/Documentation/media/uapi/v4l/pixfmt-006.rst +++ b/Documentation/media/uapi/v4l/pixfmt-006.rst @@ -19,9 +19,18 @@ 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 +:ref:`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. + quantization. :ref:`HSV formats ` are always full range. .. _v4l2-colorspace: @@ -242,6 +251,34 @@ needs to be filled in. +.. _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 roughly 1.41 degrees. + + + .. _v4l2-quantization: .. flat-table:: V4L2 Quantization Methods @@ -261,7 +298,7 @@ needs to be filled in. - Use the default quantization encoding as defined by the colorspace. This is always full range for R'G'B' (except for the - BT.2020 colorspace) and usually limited range for Y'CbCr. + BT.2020 colorspace) and HSV. It is usually limited range for Y'CbCr. - .. row 3 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