0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002
0003 .. _v4l2-meta-fmt-vsp1-hgt:
0004
0005 *******************************
0006 V4L2_META_FMT_VSP1_HGT ('VSPT')
0007 *******************************
0008
0009 Renesas R-Car VSP1 2-D Histogram Data
0010
0011
0012 Description
0013 ===========
0014
0015 This format describes histogram data generated by the Renesas R-Car VSP1
0016 2-D Histogram (HGT) engine.
0017
0018 The VSP1 HGT is a histogram computation engine that operates on HSV
0019 data. It operates on a possibly cropped and subsampled input image and
0020 computes the sum, maximum and minimum of the S component as well as a
0021 weighted frequency histogram based on the H and S components.
0022
0023 The histogram is a matrix of 6 Hue and 32 Saturation buckets, 192 in
0024 total. Each HSV value is added to one or more buckets with a weight
0025 between 1 and 16 depending on the Hue areas configuration. Finding the
0026 corresponding buckets is done by inspecting the H and S value independently.
0027
0028 The Saturation position **n** (0 - 31) of the bucket in the matrix is
0029 found by the expression:
0030
0031 n = S / 8
0032
0033 The Hue position **m** (0 - 5) of the bucket in the matrix depends on
0034 how the HGT Hue areas are configured. There are 6 user configurable Hue
0035 Areas which can be configured to cover overlapping Hue values:
0036
0037 .. raw:: latex
0038
0039 \small
0040
0041 ::
0042
0043 Area 0 Area 1 Area 2 Area 3 Area 4 Area 5
0044 ________ ________ ________ ________ ________ ________
0045 \ /| |\ /| |\ /| |\ /| |\ /| |\ /| |\ /
0046 \ / | | \ / | | \ / | | \ / | | \ / | | \ / | | \ /
0047 X | | X | | X | | X | | X | | X | | X
0048 / \ | | / \ | | / \ | | / \ | | / \ | | / \ | | / \
0049 / \| |/ \| |/ \| |/ \| |/ \| |/ \| |/ \
0050 5U 0L 0U 1L 1U 2L 2U 3L 3U 4L 4U 5L 5U 0L
0051 <0..............................Hue Value............................255>
0052
0053
0054 .. raw:: latex
0055
0056 \normalsize
0057
0058 When two consecutive areas don't overlap (n+1L is equal to nU) the boundary
0059 value is considered as part of the lower area.
0060
0061 Pixels with a hue value included in the centre of an area (between nL and nU
0062 included) are attributed to that single area and given a weight of 16. Pixels
0063 with a hue value included in the overlapping region between two areas (between
0064 n+1L and nU excluded) are attributed to both areas and given a weight for each
0065 of these areas proportional to their position along the diagonal lines
0066 (rounded down).
0067
0068 The Hue area setup must match one of the following constrains:
0069
0070 ::
0071
0072 0L <= 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U
0073
0074 ::
0075
0076 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U <= 0L
0077
0078 **Byte Order.**
0079 All data is stored in memory in little endian format. Each cell in the tables
0080 contains one byte.
0081
0082 .. flat-table:: VSP1 HGT Data - (776 bytes)
0083 :header-rows: 2
0084 :stub-columns: 0
0085
0086 * - Offset
0087 - :cspan:`4` Memory
0088 * -
0089 - [31:24]
0090 - [23:16]
0091 - [15:8]
0092 - [7:0]
0093 * - 0
0094 - -
0095 - S max [7:0]
0096 - -
0097 - S min [7:0]
0098 * - 4
0099 - :cspan:`4` S sum [31:0]
0100 * - 8
0101 - :cspan:`4` Histogram bucket (m=0, n=0) [31:0]
0102 * - 12
0103 - :cspan:`4` Histogram bucket (m=0, n=1) [31:0]
0104 * -
0105 - :cspan:`4` ...
0106 * - 132
0107 - :cspan:`4` Histogram bucket (m=0, n=31) [31:0]
0108 * - 136
0109 - :cspan:`4` Histogram bucket (m=1, n=0) [31:0]
0110 * -
0111 - :cspan:`4` ...
0112 * - 264
0113 - :cspan:`4` Histogram bucket (m=2, n=0) [31:0]
0114 * -
0115 - :cspan:`4` ...
0116 * - 392
0117 - :cspan:`4` Histogram bucket (m=3, n=0) [31:0]
0118 * -
0119 - :cspan:`4` ...
0120 * - 520
0121 - :cspan:`4` Histogram bucket (m=4, n=0) [31:0]
0122 * -
0123 - :cspan:`4` ...
0124 * - 648
0125 - :cspan:`4` Histogram bucket (m=5, n=0) [31:0]
0126 * -
0127 - :cspan:`4` ...
0128 * - 772
0129 - :cspan:`4` Histogram bucket (m=5, n=31) [31:0]