aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-04 10:21:39 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-04-14 10:31:49 +0200
commit54f38fcae536ea202ce7d6a359521492fba30c1f (patch)
treedd1a2b36d8de0b13702f2716526ad3b91650e090 /Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst
parentmedia: docs: split uAPI info from imx.rst (diff)
downloadwireguard-linux-54f38fcae536ea202ce7d6a359521492fba30c1f.tar.xz
wireguard-linux-54f38fcae536ea202ce7d6a359521492fba30c1f.zip
media: docs: move uAPI book to userspace-api/media
Since 2017, there is an space reserved for userspace API, created by changeset 1d596dee3862 ("docs: Create a user-space API guide"). As the media subsystem was one of the first subsystems to use Sphinx, until this patch, we were keeping things on a separate place. Let's just use the new location, as having all uAPI altogether will likely make things easier for developers. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst')
-rw-r--r--Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst136
1 files changed, 136 insertions, 0 deletions
diff --git a/Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst b/Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst
new file mode 100644
index 000000000000..e165320cc1ff
--- /dev/null
+++ b/Documentation/userspace-api/media/v4l/pixfmt-meta-vsp1-hgt.rst
@@ -0,0 +1,136 @@
+.. Permission is granted to copy, distribute and/or modify this
+.. document under the terms of the GNU Free Documentation License,
+.. Version 1.1 or any later version published by the Free Software
+.. Foundation, with no Invariant Sections, no Front-Cover Texts
+.. and no Back-Cover Texts. A copy of the license is included at
+.. Documentation/userspace-api/media/fdl-appendix.rst.
+..
+.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
+
+.. _v4l2-meta-fmt-vsp1-hgt:
+
+*******************************
+V4L2_META_FMT_VSP1_HGT ('VSPT')
+*******************************
+
+Renesas R-Car VSP1 2-D Histogram Data
+
+
+Description
+===========
+
+This format describes histogram data generated by the Renesas R-Car VSP1
+2-D Histogram (HGT) engine.
+
+The VSP1 HGT is a histogram computation engine that operates on HSV
+data. It operates on a possibly cropped and subsampled input image and
+computes the sum, maximum and minimum of the S component as well as a
+weighted frequency histogram based on the H and S components.
+
+The histogram is a matrix of 6 Hue and 32 Saturation buckets, 192 in
+total. Each HSV value is added to one or more buckets with a weight
+between 1 and 16 depending on the Hue areas configuration. Finding the
+corresponding buckets is done by inspecting the H and S value independently.
+
+The Saturation position **n** (0 - 31) of the bucket in the matrix is
+found by the expression:
+
+ n = S / 8
+
+The Hue position **m** (0 - 5) of the bucket in the matrix depends on
+how the HGT Hue areas are configured. There are 6 user configurable Hue
+Areas which can be configured to cover overlapping Hue values:
+
+.. raw:: latex
+
+ \small
+
+::
+
+ Area 0 Area 1 Area 2 Area 3 Area 4 Area 5
+ ________ ________ ________ ________ ________ ________
+ \ /| |\ /| |\ /| |\ /| |\ /| |\ /| |\ /
+ \ / | | \ / | | \ / | | \ / | | \ / | | \ / | | \ /
+ X | | X | | X | | X | | X | | X | | X
+ / \ | | / \ | | / \ | | / \ | | / \ | | / \ | | / \
+ / \| |/ \| |/ \| |/ \| |/ \| |/ \| |/ \
+ 5U 0L 0U 1L 1U 2L 2U 3L 3U 4L 4U 5L 5U 0L
+ <0..............................Hue Value............................255>
+
+
+.. raw:: latex
+
+ \normalsize
+
+When two consecutive areas don't overlap (n+1L is equal to nU) the boundary
+value is considered as part of the lower area.
+
+Pixels with a hue value included in the centre of an area (between nL and nU
+included) are attributed to that single area and given a weight of 16. Pixels
+with a hue value included in the overlapping region between two areas (between
+n+1L and nU excluded) are attributed to both areas and given a weight for each
+of these areas proportional to their position along the diagonal lines
+(rounded down).
+
+The Hue area setup must match one of the following constrains:
+
+::
+
+ 0L <= 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U
+
+::
+
+ 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U <= 0L
+
+**Byte Order.**
+All data is stored in memory in little endian format. Each cell in the tables
+contains one byte.
+
+.. flat-table:: VSP1 HGT Data - (776 bytes)
+ :header-rows: 2
+ :stub-columns: 0
+
+ * - Offset
+ - :cspan:`4` Memory
+ * -
+ - [31:24]
+ - [23:16]
+ - [15:8]
+ - [7:0]
+ * - 0
+ - -
+ - S max [7:0]
+ - -
+ - S min [7:0]
+ * - 4
+ - :cspan:`4` S sum [31:0]
+ * - 8
+ - :cspan:`4` Histogram bucket (m=0, n=0) [31:0]
+ * - 12
+ - :cspan:`4` Histogram bucket (m=0, n=1) [31:0]
+ * -
+ - :cspan:`4` ...
+ * - 132
+ - :cspan:`4` Histogram bucket (m=0, n=31) [31:0]
+ * - 136
+ - :cspan:`4` Histogram bucket (m=1, n=0) [31:0]
+ * -
+ - :cspan:`4` ...
+ * - 264
+ - :cspan:`4` Histogram bucket (m=2, n=0) [31:0]
+ * -
+ - :cspan:`4` ...
+ * - 392
+ - :cspan:`4` Histogram bucket (m=3, n=0) [31:0]
+ * -
+ - :cspan:`4` ...
+ * - 520
+ - :cspan:`4` Histogram bucket (m=4, n=0) [31:0]
+ * -
+ - :cspan:`4` ...
+ * - 648
+ - :cspan:`4` Histogram bucket (m=5, n=0) [31:0]
+ * -
+ - :cspan:`4` ...
+ * - 772
+ - :cspan:`4` Histogram bucket (m=5, n=31) [31:0]