요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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
**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]
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을 찾습니다.
S 위치 n과 H 위치 m의 계산 규칙입니다.
원문의 겹치는 사다리꼴 ASCII 그림을 같은 순환 관계로 구조화했습니다.
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비트씩 저장합니다.
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]
요약·해설
metafmt-vsp1-hgt.rst:1-129HGT는 S/8로 32개 saturation 칸을 정하고 순환하는 6개 Hue area의 중앙·겹침 규칙으로 weighted histogram을 계산합니다.