← Documents Documentation/userspace-api/media/v4l/yuv-formats.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

YUV 형식

YUV의 luma·chroma 분리, subsampling 비율과 centered·co-sited sample 위치를 구조화 도식으로 설명합니다.

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

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

1. 요약·해설

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

요약·해설

yuv-formats.rst:1-274

같은 subsampling 비율이라도 chroma siting이 다르면 C가 대표하는 공간 위치가 달라지므로 pixel format 이름과 함께 centered·co-sited 규칙을 확인해야 합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 .. _yuv-formats:
4
5 ***********
6 YUV Formats
7 ***********
8
9 YUV is the format native to TV broadcast and composite video signals. It
10 separates the brightness information (Y) from the color information (U
11 and V or Cb and Cr). The color information consists of red and blue
12 *color difference* signals, this way the green component can be
13 reconstructed by subtracting from the brightness component. See
14 :ref:`colorspaces` for conversion examples. YUV was chosen because
15 early television would only transmit brightness information. To add
16 color in a way compatible with existing receivers a new signal carrier
17 was added to transmit the color difference signals.
18
19
20 Subsampling
21 ===========
22
23 YUV formats commonly encode images with a lower resolution for the chroma
24 components than for the luma component. This compression technique, taking
25 advantage of the human eye being more sensitive to luminance than color
26 differences, is called chroma subsampling.
27
28 While many combinations of subsampling factors in the horizontal and vertical
29 direction are possible, common factors are 1 (no subsampling), 2 and 4, with
30 horizontal subsampling always larger than or equal to vertical subsampling.
31 Common combinations are named as follows.
32
33 - `4:4:4`: No subsampling
34 - `4:2:2`: Horizontal subsampling by 2, no vertical subsampling
35 - `4:2:0`: Horizontal subsampling by 2, vertical subsampling by 2
36 - `4:1:1`: Horizontal subsampling by 4, no vertical subsampling
37 - `4:1:0`: Horizontal subsampling by 4, vertical subsampling by 4
38
39 Subsampling the chroma component effectively creates chroma values that can be
40 located in different spatial locations:
41
42 - .. _yuv-chroma-centered:
43
44 The subsampled chroma value may be calculated by simply averaging the chroma
45 value of two consecutive pixels. It effectively models the chroma of a pixel
46 sited between the two original pixels. This is referred to as centered or
47 interstitially sited chroma.
48
49 - .. _yuv-chroma-cosited:
50
51 The other option is to subsample chroma values in a way that place them in
52 the same spatial sites as the pixels. This may be performed by skipping every
53 other chroma sample (creating aliasing artifacts), or with filters using an
54 odd number of taps. This is referred to as co-sited chroma.
55
56 The following examples show different combination of chroma siting in a 4x4
57 image.
58
59 .. flat-table:: 4:2:2 subsampling, interstitially sited
60 :header-rows: 1
61 :stub-columns: 1
62
63 * -
64 - 0
65 -
66 - 1
67 -
68 - 2
69 -
70 - 3
71 * - 0
72 - Y
73 - C
74 - Y
75 -
76 - Y
77 - C
78 - Y
79 * - 1
80 - Y
81 - C
82 - Y
83 -
84 - Y
85 - C
86 - Y
87 * - 2
88 - Y
89 - C
90 - Y
91 -
92 - Y
93 - C
94 - Y
95 * - 3
96 - Y
97 - C
98 - Y
99 -
100 - Y
101 - C
102 - Y
103
104 .. flat-table:: 4:2:2 subsampling, co-sited
105 :header-rows: 1
106 :stub-columns: 1
107
108 * -
109 - 0
110 -
111 - 1
112 -
113 - 2
114 -
115 - 3
116 * - 0
117 - Y/C
118 -
119 - Y
120 -
121 - Y/C
122 -
123 - Y
124 * - 1
125 - Y/C
126 -
127 - Y
128 -
129 - Y/C
130 -
131 - Y
132 * - 2
133 - Y/C
134 -
135 - Y
136 -
137 - Y/C
138 -
139 - Y
140 * - 3
141 - Y/C
142 -
143 - Y
144 -
145 - Y/C
146 -
147 - Y
148
149 .. flat-table:: 4:2:0 subsampling, horizontally interstitially sited, vertically co-sited
150 :header-rows: 1
151 :stub-columns: 1
152
153 * -
154 - 0
155 -
156 - 1
157 -
158 - 2
159 -
160 - 3
161 * - 0
162 - Y
163 - C
164 - Y
165 -
166 - Y
167 - C
168 - Y
169 * - 1
170 - Y
171 -
172 - Y
173 -
174 - Y
175 -
176 - Y
177 * - 2
178 - Y
179 - C
180 - Y
181 -
182 - Y
183 - C
184 - Y
185 * - 3
186 - Y
187 -
188 - Y
189 -
190 - Y
191 -
192 - Y
193
194 .. flat-table:: 4:1:0 subsampling, horizontally and vertically interstitially sited
195 :header-rows: 1
196 :stub-columns: 1
197
198 * -
199 - 0
200 -
201 - 1
202 -
203 - 2
204 -
205 - 3
206 * - 0
207 - Y
208 -
209 - Y
210 -
211 - Y
212 -
213 - Y
214 * -
215 -
216 -
217 -
218 -
219 -
220 -
221 -
222 * - 1
223 - Y
224 -
225 - Y
226 -
227 - Y
228 -
229 - Y
230 * -
231 -
232 -
233 -
234 - C
235 -
236 -
237 -
238 * - 2
239 - Y
240 -
241 - Y
242 -
243 - Y
244 -
245 - Y
246 * -
247 -
248 -
249 -
250 -
251 -
252 -
253 -
254 * - 3
255 - Y
256 -
257 - Y
258 -
259 - Y
260 -
261 - Y
262
263
264 .. toctree::
265 :maxdepth: 1
266
267 pixfmt-packed-yuv
268 pixfmt-yuv-planar
269 pixfmt-yuv-luma
270 pixfmt-y8i
271 pixfmt-y12i
272 pixfmt-y16i
273 pixfmt-uv8
274 pixfmt-m420
275

3. 한국어 전문 번역

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

YUV의 구성과 역사적 배경

1-18

YUV는 텔레비전 방송과 composite video signal의 본래 형식입니다. 밝기 정보 `Y`를 색 정보 `U`, `V` 또는 `Cb`, `Cr`과 분리합니다.

색 정보는 빨강과 파랑의 color difference signal로 구성되며, 밝기 성분에서 이 차이 신호를 빼 녹색 성분을 재구성할 수 있습니다. 구체적인 변환 예는 colorspace 문서를 참조합니다.

초기 텔레비전은 밝기만 전송했습니다. 기존 수신기와 호환성을 유지하면서 색을 추가하기 위해 color difference signal을 전달하는 새 반송파를 더했고, 이 역사적 요구가 YUV 계열 구조의 배경입니다.

YUV 성분
성분정보역할
`Y`Luma영상의 밝기와 세부 윤곽
`U`/`Cb`Blue difference파랑 계열 색차
`V`/`Cr`Red difference빨강 계열 색차

밝기와 두 색차 성분의 역할을 구분합니다.

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

.. _yuv-formats:

***********
YUV Formats
***********

YUV is the format native to TV broadcast and composite video signals. It
separates the brightness information (Y) from the color information (U
and V or Cb and Cr). The color information consists of red and blue
*color difference* signals, this way the green component can be
reconstructed by subtracting from the brightness component. See
:ref:`colorspaces` for conversion examples. YUV was chosen because
early television would only transmit brightness information. To add
color in a way compatible with existing receivers a new signal carrier
was added to transmit the color difference signals.

Chroma subsampling 비율

19-38

YUV 형식은 흔히 luma보다 chroma를 낮은 해상도로 저장합니다. 사람의 눈이 색 차이보다 밝기 변화에 더 민감하다는 특성을 이용한 압축 기법을 chroma subsampling이라 합니다.

가로·세로 방향의 계수는 여러 조합이 가능하지만 보통 1, 2, 4를 사용하고 가로 subsampling은 세로 subsampling보다 크거나 같습니다.

일반적인 YUV subsampling
표기가로세로
`4:4:4`감소 없음감소 없음
`4:2:2`2로 subsampling감소 없음
`4:2:0`2로 subsampling2로 subsampling
`4:1:1`4로 subsampling감소 없음
`4:1:0`4로 subsampling4로 subsampling

표기별 가로와 세로 chroma 해상도 감소를 정리합니다.


Subsampling
===========

YUV formats commonly encode images with a lower resolution for the chroma
components than for the luma component. This compression technique, taking
advantage of the human eye being more sensitive to luminance than color
differences, is called chroma subsampling.

While many combinations of subsampling factors in the horizontal and vertical
direction are possible, common factors are 1 (no subsampling), 2 and 4, with
horizontal subsampling always larger than or equal to vertical subsampling.
Common combinations are named as follows.

- `4:4:4`: No subsampling
- `4:2:2`: Horizontal subsampling by 2, no vertical subsampling
- `4:2:0`: Horizontal subsampling by 2, vertical subsampling by 2
- `4:1:1`: Horizontal subsampling by 4, no vertical subsampling
- `4:1:0`: Horizontal subsampling by 4, vertical subsampling by 4

Centered와 co-sited chroma

39-58

Chroma를 subsampling하면 계산된 chroma 값이 원래 픽셀 격자의 어느 공간 위치를 대표하는지 결정해야 합니다.

Centered 또는 interstitially sited 방식은 연속한 두 픽셀의 chroma를 평균해 두 원래 픽셀 사이에 위치한 가상 픽셀의 chroma로 모델링합니다.

Co-sited 방식은 chroma 값을 luma 픽셀과 같은 공간 위치에 둡니다. 다른 chroma sample을 건너뛰면 aliasing artifact가 생길 수 있고, 홀수 tap filter를 사용해 같은 위치의 값을 계산할 수도 있습니다.

Chroma siting 비교
방식C 위치대표 계산
Centered / interstitial인접한 두 Y 픽셀 사이두 chroma sample 평균
Co-sitedY 픽셀과 같은 위치sample 건너뛰기 또는 홀수 tap filter

subsampled chroma가 대표하는 공간 위치가 다릅니다.

Subsampling the chroma component effectively creates chroma values that can be
located in different spatial locations:

- .. _yuv-chroma-centered:

  The subsampled chroma value may be calculated by simply averaging the chroma
  value of two consecutive pixels. It effectively models the chroma of a pixel
  sited between the two original pixels. This is referred to as centered or
  interstitially sited chroma.

- .. _yuv-chroma-cosited:

  The other option is to subsample chroma values in a way that place them in
  the same spatial sites as the pixels. This may be performed by skipping every
  other chroma sample (creating aliasing artifacts), or with filters using an
  odd number of taps. This is referred to as co-sited chroma.

The following examples show different combination of chroma siting in a 4x4
image.

4:2:2, 가로 interstitial 배치

59-103

4:2:2 interstitial 배치에서는 모든 행에 Y가 네 개 있고, C는 가로 픽셀 0과 1 사이 및 2와 3 사이에 위치합니다. 세로 subsampling은 없습니다.

4:2:2 interstitial 4×4 샘플 위치
x=0x=0.5x=1x=2x=2.5x=3
0YCYYCY
1YCYYCY
2YCYYCY
3YCYYCY

각 행에서 C가 두 Y 사이에 놓입니다.

.. flat-table:: 4:2:2 subsampling, interstitially sited
    :header-rows: 1
    :stub-columns: 1

    * -
      - 0
      -
      - 1
      -
      - 2
      -
      - 3
    * - 0
      - Y
      - C
      - Y
      -
      - Y
      - C
      - Y
    * - 1
      - Y
      - C
      - Y
      -
      - Y
      - C
      - Y
    * - 2
      - Y
      - C
      - Y
      -
      - Y
      - C
      - Y
    * - 3
      - Y
      - C
      - Y
      -
      - Y
      - C
      - Y

4:2:2, co-sited 배치

104-148

4:2:2 co-sited 배치에서는 모든 행의 x=0과 x=2 픽셀 위치에 Y와 C가 함께 있고, x=1과 x=3에는 Y만 있습니다.

4:2:2 co-sited 4×4 샘플 위치
x=0x=1x=2x=3
0Y/CYY/CY
1Y/CYY/CY
2Y/CYY/CY
3Y/CYY/CY

C가 짝수 열의 Y와 같은 위치를 공유합니다.

.. flat-table:: 4:2:2 subsampling, co-sited
    :header-rows: 1
    :stub-columns: 1

    * -
      - 0
      -
      - 1
      -
      - 2
      -
      - 3
    * - 0
      - Y/C
      -
      - Y
      -
      - Y/C
      -
      - Y
    * - 1
      - Y/C
      -
      - Y
      -
      - Y/C
      -
      - Y
    * - 2
      - Y/C
      -
      - Y
      -
      - Y/C
      -
      - Y
    * - 3
      - Y/C
      -
      - Y
      -
      - Y/C
      -
      - Y

4:2:0, 가로 interstitial·세로 co-sited 배치

149-193

이 4:2:0 예시는 가로로는 C가 두 Y 사이에 있고 세로로는 0행과 2행의 Y 위치와 같은 높이에 있습니다. 1행과 3행에는 chroma sample이 없습니다.

4:2:0 혼합 siting 4×4 샘플 위치
x=0x=0.5x=1x=2x=2.5x=3
0YCYYCY
1YYYY
2YCYYCY
3YYYY

C는 짝수 행에서 가로 픽셀 사이에만 존재합니다.

.. flat-table:: 4:2:0 subsampling, horizontally interstitially sited, vertically co-sited
    :header-rows: 1
    :stub-columns: 1

    * -
      - 0
      -
      - 1
      -
      - 2
      -
      - 3
    * - 0
      - Y
      - C
      - Y
      -
      - Y
      - C
      - Y
    * - 1
      - Y
      -
      - Y
      -
      - Y
      -
      - Y
    * - 2
      - Y
      - C
      - Y
      -
      - Y
      - C
      - Y
    * - 3
      - Y
      -
      - Y
      -
      - Y
      -
      - Y

4:1:0, 가로·세로 interstitial 배치

194-262

4:1:0 interstitial 예시에서는 모든 정수 좌표에 Y가 있지만, 하나의 C가 4×4 luma 블록의 가로·세로 중앙 사이 위치를 대표합니다.

4:1:0 interstitial 4×4 샘플 위치
세로 위치x=0x=1x=1.5x=2x=3
y=0YYYY
y=1YYYY
y=1.5C
y=2YYYY
y=3YYYY

C는 4×4 Y 격자의 중앙 interstitial 위치에 놓입니다.

.. flat-table:: 4:1:0 subsampling, horizontally and vertically interstitially sited
    :header-rows: 1
    :stub-columns: 1

    * -
      - 0
      -
      - 1
      -
      - 2
      -
      - 3
    * - 0
      - Y
      -
      - Y
      -
      - Y
      -
      - Y
    * -
      -
      -
      -
      -
      -
      -
      -
    * - 1
      - Y
      -
      - Y
      -
      - Y
      -
      - Y
    * -
      -
      -
      -
      - C
      -
      -
      -
    * - 2
      - Y
      -
      - Y
      -
      - Y
      -
      - Y
    * -
      -
      -
      -
      -
      -
      -
      -
    * - 3
      - Y
      -
      - Y
      -
      - Y
      -
      - Y

세부 YUV 형식 문서

263-274

이 개요 아래에는 packed YUV, planar YUV, luma-only, Y8I, Y12I, Y16I, UV8, M420 형식의 개별 문서가 연결됩니다. 실제 메모리 바이트 순서와 plane 배치는 해당 pixel format 문서에서 확인해야 합니다.

YUV 하위 문서
문서주제
`pixfmt-packed-yuv`한 plane에 묶인 YUV 표본
`pixfmt-yuv-planar`여러 plane 또는 연속 plane의 YUV
`pixfmt-yuv-luma`luma 중심 형식
`pixfmt-y8i`, `pixfmt-y12i`, `pixfmt-y16i`interleaved 또는 고비트 깊이 luma
`pixfmt-uv8`chroma 전용 형식
`pixfmt-m420`M420 배치

형식 계열별 상세 설명으로 이동합니다.


.. toctree::
    :maxdepth: 1

    pixfmt-packed-yuv
    pixfmt-yuv-planar
    pixfmt-yuv-luma
    pixfmt-y8i
    pixfmt-y12i
    pixfmt-y16i
    pixfmt-uv8
    pixfmt-m420