← Documents Documentation/userspace-api/media/v4l/metafmt-vsp1-hgt.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

Renesas VSP1 2-D Histogram

VSP1 HGT의 6×32 Hue/Saturation bucket, overlap 가중치와 메모리 배치를 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/metafmt-vsp1-hgt.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

metafmt-vsp1-hgt.rst:1-129

HGT는 S/8로 32개 saturation 칸을 정하고 순환하는 6개 Hue area의 중앙·겹침 규칙으로 weighted histogram을 계산합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 .. _v4l2-meta-fmt-vsp1-hgt:
4
5 *******************************
6 V4L2_META_FMT_VSP1_HGT ('VSPT')
7 *******************************
8
9 Renesas R-Car VSP1 2-D Histogram Data
10
11
12 Description
13 ===========
14
15 This format describes histogram data generated by the Renesas R-Car VSP1
16 2-D Histogram (HGT) engine.
17
18 The VSP1 HGT is a histogram computation engine that operates on HSV
19 data. It operates on a possibly cropped and subsampled input image and
20 computes the sum, maximum and minimum of the S component as well as a
21 weighted frequency histogram based on the H and S components.
22
23 The histogram is a matrix of 6 Hue and 32 Saturation buckets, 192 in
24 total. Each HSV value is added to one or more buckets with a weight
25 between 1 and 16 depending on the Hue areas configuration. Finding the
26 corresponding buckets is done by inspecting the H and S value independently.
27
28 The Saturation position **n** (0 - 31) of the bucket in the matrix is
29 found by the expression:
30
31 n = S / 8
32
33 The Hue position **m** (0 - 5) of the bucket in the matrix depends on
34 how the HGT Hue areas are configured. There are 6 user configurable Hue
35 Areas which can be configured to cover overlapping Hue values:
36
37 .. raw:: latex
38
39 \small
40
41 ::
42
43 Area 0 Area 1 Area 2 Area 3 Area 4 Area 5
44 ________ ________ ________ ________ ________ ________
45 \ /| |\ /| |\ /| |\ /| |\ /| |\ /| |\ /
46 \ / | | \ / | | \ / | | \ / | | \ / | | \ / | | \ /
47 X | | X | | X | | X | | X | | X | | X
48 / \ | | / \ | | / \ | | / \ | | / \ | | / \ | | / \
49 / \| |/ \| |/ \| |/ \| |/ \| |/ \| |/ \
50 5U 0L 0U 1L 1U 2L 2U 3L 3U 4L 4U 5L 5U 0L
51 <0..............................Hue Value............................255>
52
53
54 .. raw:: latex
55
56 \normalsize
57
58 When two consecutive areas don't overlap (n+1L is equal to nU) the boundary
59 value is considered as part of the lower area.
60
61 Pixels with a hue value included in the centre of an area (between nL and nU
62 included) are attributed to that single area and given a weight of 16. Pixels
63 with a hue value included in the overlapping region between two areas (between
64 n+1L and nU excluded) are attributed to both areas and given a weight for each
65 of these areas proportional to their position along the diagonal lines
66 (rounded down).
67
68 The Hue area setup must match one of the following constrains:
69
70 ::
71
72 0L <= 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U
73
74 ::
75
76 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U <= 0L
77
78 **Byte Order.**
79 All data is stored in memory in little endian format. Each cell in the tables
80 contains one byte.
81
82 .. flat-table:: VSP1 HGT Data - (776 bytes)
83 :header-rows: 2
84 :stub-columns: 0
85
86 * - Offset
87 - :cspan:`4` Memory
88 * -
89 - [31:24]
90 - [23:16]
91 - [15:8]
92 - [7:0]
93 * - 0
94 - -
95 - S max [7:0]
96 - -
97 - S min [7:0]
98 * - 4
99 - :cspan:`4` S sum [31:0]
100 * - 8
101 - :cspan:`4` Histogram bucket (m=0, n=0) [31:0]
102 * - 12
103 - :cspan:`4` Histogram bucket (m=0, n=1) [31:0]
104 * -
105 - :cspan:`4` ...
106 * - 132
107 - :cspan:`4` Histogram bucket (m=0, n=31) [31:0]
108 * - 136
109 - :cspan:`4` Histogram bucket (m=1, n=0) [31:0]
110 * -
111 - :cspan:`4` ...
112 * - 264
113 - :cspan:`4` Histogram bucket (m=2, n=0) [31:0]
114 * -
115 - :cspan:`4` ...
116 * - 392
117 - :cspan:`4` Histogram bucket (m=3, n=0) [31:0]
118 * -
119 - :cspan:`4` ...
120 * - 520
121 - :cspan:`4` Histogram bucket (m=4, n=0) [31:0]
122 * -
123 - :cspan:`4` ...
124 * - 648
125 - :cspan:`4` Histogram bucket (m=5, n=0) [31:0]
126 * -
127 - :cspan:`4` ...
128 * - 772
129 - :cspan:`4` Histogram bucket (m=5, n=31) [31:0]
130

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Hue·Saturation bucket과 겹침 가중치

1-77

`V4L2_META_FMT_VSP1_HGT`는 Renesas R-Car VSP1 2-D Histogram(HGT) 엔진의 출력입니다. crop 및 subsampling된 HSV 영상에서 S 성분의 합·최대·최소와 H/S 기반 weighted frequency histogram을 계산합니다.

Histogram은 Hue 6칸과 Saturation 32칸으로 이루어진 6×32 행렬, 총 192 bucket입니다. 각 HSV 값은 Hue area 설정에 따라 한 개 또는 두 개 bucket에 1~16의 가중치로 더해집니다. H와 S를 독립적으로 검사해 bucket을 찾습니다.

Bucket 좌표
항목설명
Saturation 위치 `n`0~31이며 `n = S / 8`입니다.
Hue 위치 `m`0~5이며 사용자가 설정한 6개 Hue Area의 lower/upper 경계로 결정합니다.
중앙 구간 `nL <= H <= nU`해당 area 하나에만 포함하고 weight 16을 줍니다.
겹침 구간 `n+1L <= H < nU`연속한 두 area에 모두 넣고 대각선상의 위치에 비례한 두 weight를 각각 내림해 적용합니다.
비겹침 경계 `n+1L == nU`경계값은 더 낮은 번호의 area에 속합니다.

S 위치 n과 H 위치 m의 계산 규칙입니다.

Hue Area 순환 도식
Area 0: 중앙 0L..0U, 끝에서 Area 5와 겹치고 앞에서 Area 1과 겹침Area 1: 중앙 1L..1U, Area 0·2와 겹침Area 2: 중앙 2L..2U, Area 1·3과 겹침Area 3: 중앙 3L..3U, Area 2·4와 겹침Area 4: 중앙 4L..4U, Area 3·5와 겹침Area 5: 중앙 5L..5U, Area 4와 겹친 뒤 Hue 255→0 경계에서 Area 0으로 순환

원문의 겹치는 사다리꼴 ASCII 그림을 같은 순환 관계로 구조화했습니다.

허용되는 Hue 경계 순서
항목설명
일반 순서`0L <= 0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U`
0번 area가 wrap`0U <= 1L <= 1U <= 2L <= 2U <= 3L <= 3U <= 4L <= 4U <= 5L <= 5U <= 0L`

0L이 0U 앞 또는 순환 끝에 놓이는 두 표현 가운데 하나를 만족해야 합니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

.. _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

776바이트 little-endian HGT 배치

78-129

모든 필드는 little endian이며 표의 각 cell은 한 바이트입니다. 앞 8바이트에 S 범위와 합을 두고 이후 192개 bucket을 Hue-major 순서로 32비트씩 저장합니다.

HGT 메모리 배치
항목설명
offset 0S min [7:0], S max [7:0]
offset 4S sum [31:0]
offset 8~132m=0, n=0~31
offset 136~260m=1, n=0~31
offset 264~388m=2, n=0~31
offset 392~516m=3, n=0~31
offset 520~644m=4, n=0~31
offset 648~772m=5, n=0~31

Hue 위치 m마다 Saturation 위치 n=0~31이 연속됩니다.

**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]