요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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.
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
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.
.. 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
.. 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
.. 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
.. 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
.. toctree::
:maxdepth: 1
pixfmt-packed-yuv
pixfmt-yuv-planar
pixfmt-yuv-luma
pixfmt-y8i
pixfmt-y12i
pixfmt-y16i
pixfmt-uv8
pixfmt-m420
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
YUV의 구성과 역사적 배경
1-18YUV는 텔레비전 방송과 composite video signal의 본래 형식입니다. 밝기 정보 `Y`를 색 정보 `U`, `V` 또는 `Cb`, `Cr`과 분리합니다.
색 정보는 빨강과 파랑의 color difference signal로 구성되며, 밝기 성분에서 이 차이 신호를 빼 녹색 성분을 재구성할 수 있습니다. 구체적인 변환 예는 colorspace 문서를 참조합니다.
초기 텔레비전은 밝기만 전송했습니다. 기존 수신기와 호환성을 유지하면서 색을 추가하기 위해 color difference signal을 전달하는 새 반송파를 더했고, 이 역사적 요구가 YUV 계열 구조의 배경입니다.
밝기와 두 색차 성분의 역할을 구분합니다.
.. 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-38YUV 형식은 흔히 luma보다 chroma를 낮은 해상도로 저장합니다. 사람의 눈이 색 차이보다 밝기 변화에 더 민감하다는 특성을 이용한 압축 기법을 chroma subsampling이라 합니다.
가로·세로 방향의 계수는 여러 조합이 가능하지만 보통 1, 2, 4를 사용하고 가로 subsampling은 세로 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-58Chroma를 subsampling하면 계산된 chroma 값이 원래 픽셀 격자의 어느 공간 위치를 대표하는지 결정해야 합니다.
Centered 또는 interstitially sited 방식은 연속한 두 픽셀의 chroma를 평균해 두 원래 픽셀 사이에 위치한 가상 픽셀의 chroma로 모델링합니다.
Co-sited 방식은 chroma 값을 luma 픽셀과 같은 공간 위치에 둡니다. 다른 chroma sample을 건너뛰면 aliasing artifact가 생길 수 있고, 홀수 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-1034:2:2 interstitial 배치에서는 모든 행에 Y가 네 개 있고, C는 가로 픽셀 0과 1 사이 및 2와 3 사이에 위치합니다. 세로 subsampling은 없습니다.
각 행에서 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-1484:2:2 co-sited 배치에서는 모든 행의 x=0과 x=2 픽셀 위치에 Y와 C가 함께 있고, x=1과 x=3에는 Y만 있습니다.
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이 없습니다.
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-2624:1:0 interstitial 예시에서는 모든 정수 좌표에 Y가 있지만, 하나의 C가 4×4 luma 블록의 가로·세로 중앙 사이 위치를 대표합니다.
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 문서에서 확인해야 합니다.
형식 계열별 상세 설명으로 이동합니다.
.. toctree::
:maxdepth: 1
pixfmt-packed-yuv
pixfmt-yuv-planar
pixfmt-yuv-luma
pixfmt-y8i
pixfmt-y12i
pixfmt-y16i
pixfmt-uv8
pixfmt-m420
요약·해설
yuv-formats.rst:1-274같은 subsampling 비율이라도 chroma siting이 다르면 C가 대표하는 공간 위치가 달라지므로 pixel format 이름과 함께 centered·co-sited 규칙을 확인해야 합니다.