요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _yuv-luma-only:
*****************
Luma-Only Formats
*****************
This family of formats only store the luma component of a Y'CbCr image. They
are often referred to as greyscale formats.
.. note::
- In all the tables that follow, bit 7 is the most significant bit in a byte.
- Formats are described with the minimum number of pixels needed to create a
byte-aligned repeating pattern. `...` indicates repetition of the pattern.
- Y'\ :sub:`x`\ [9:2] denotes bits 9 to 2 of the Y' value for pixel at column
`x`.
- `0` denotes padding bits set to 0.
.. raw:: latex
\tiny
.. tabularcolumns:: |p{3.6cm}|p{2.4cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|
.. flat-table:: Luma-Only Image Formats
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
- Byte 4
- Byte 5
- Byte 6
* .. _V4L2-PIX-FMT-GREY:
- ``V4L2_PIX_FMT_GREY``
- 'GREY'
- Y'\ :sub:`0`\ [7:0]
- ...
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-IPU3-Y10:
- ``V4L2_PIX_FMT_IPU3_Y10``
- 'ip3y'
- Y'\ :sub:`0`\ [7:0]
- Y'\ :sub:`1`\ [5:0] Y'\ :sub:`0`\ [9:8]
- Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [9:6]
- Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [9:4]
- Y'\ :sub:`3`\ [9:2]
- ...
- ...
* .. _V4L2-PIX-FMT-Y10:
- ``V4L2_PIX_FMT_Y10``
- 'Y10 '
- Y'\ :sub:`0`\ [7:0]
- `000000` Y'\ :sub:`0`\ [9:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y10BPACK:
- ``V4L2_PIX_FMT_Y10BPACK``
- 'Y10B'
- Y'\ :sub:`0`\ [9:2]
- Y'\ :sub:`0`\ [1:0] Y'\ :sub:`1`\ [9:4]
- Y'\ :sub:`1`\ [3:0] Y'\ :sub:`2`\ [9:6]
- Y'\ :sub:`2`\ [5:0] Y'\ :sub:`3`\ [9:8]
- Y'\ :sub:`3`\ [7:0]
- ...
- ...
* .. _V4L2-PIX-FMT-Y10P:
- ``V4L2_PIX_FMT_Y10P``
- 'Y10P'
- Y'\ :sub:`0`\ [9:2]
- Y'\ :sub:`1`\ [9:2]
- Y'\ :sub:`2`\ [9:2]
- Y'\ :sub:`3`\ [9:2]
- Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [1:0] Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [1:0]
- ...
- ...
* .. _V4L2-PIX-FMT-Y12:
- ``V4L2_PIX_FMT_Y12``
- 'Y12 '
- Y'\ :sub:`0`\ [7:0]
- `0000` Y'\ :sub:`0`\ [11:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y012:
- ``V4L2_PIX_FMT_Y012``
- 'Y012'
- Y'\ :sub:`0`\ [3:0] `0000`
- Y'\ :sub:`0`\ [11:4]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y12P:
- ``V4L2_PIX_FMT_Y12P``
- 'Y12P'
- Y'\ :sub:`0`\ [11:4]
- Y'\ :sub:`1`\ [11:4]
- Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [3:0]
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y14:
- ``V4L2_PIX_FMT_Y14``
- 'Y14 '
- Y'\ :sub:`0`\ [7:0]
- `00` Y'\ :sub:`0`\ [13:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y14P:
- ``V4L2_PIX_FMT_Y14P``
- 'Y14P'
- Y'\ :sub:`0`\ [13:6]
- Y'\ :sub:`1`\ [13:6]
- Y'\ :sub:`2`\ [13:6]
- Y'\ :sub:`3`\ [13:6]
- Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [5:0]
- Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [5:2]
- Y'\ :sub:`3`\ [5:0] Y'\ :sub:`2`\ [5:4]
* .. _V4L2-PIX-FMT-Y16:
- ``V4L2_PIX_FMT_Y16``
- 'Y16 '
- Y'\ :sub:`0`\ [7:0]
- Y'\ :sub:`0`\ [15:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y16-BE:
- ``V4L2_PIX_FMT_Y16_BE``
- 'Y16 ' | (1U << 31)
- Y'\ :sub:`0`\ [15:8]
- Y'\ :sub:`0`\ [7:0]
- ...
- ...
- ...
- ...
- ...
.. raw:: latex
\normalsize
.. note::
For the Y16 and Y16_BE formats, the actual sampling precision may be lower
than 16 bits. For example, 10 bits per pixel uses values in the range 0 to
1023. For the IPU3_Y10 format 25 pixels are packed into 32 bytes, which
leaves the 6 most significant bits of the last byte padded with 0.
For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
padding zeros in the 4 low bits, in contrast to the Y12 format, which has
its padding located in the most significant bits of the 16 bit word.
The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
specification.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
표 읽는 법
1-20이 포맷 계열은 Y'CbCr 영상에서 휘도 성분만 저장하며 흔히 회색조 포맷이라고 부릅니다. 아래 표에서는 바이트 안의 bit 7이 최상위 비트입니다. 각 포맷은 바이트 정렬 반복 패턴을 만드는 데 필요한 최소 픽셀 수로 설명하고, `...`는 그 패턴의 반복을 뜻합니다.
`Y'x[9:2]`는 열 `x`의 Y' 값에서 bit 9부터 bit 2까지를 뜻합니다. 표의 `0`은 반드시 0으로 설정하는 패딩 비트입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _yuv-luma-only:
*****************
Luma-Only Formats
*****************
This family of formats only store the luma component of a Y'CbCr image. They
are often referred to as greyscale formats.
.. note::
- In all the tables that follow, bit 7 is the most significant bit in a byte.
- Formats are described with the minimum number of pixels needed to create a
byte-aligned repeating pattern. `...` indicates repetition of the pattern.
- Y'\ :sub:`x`\ [9:2] denotes bits 9 to 2 of the Y' value for pixel at column
`x`.
- `0` denotes padding bits set to 0.
8·10·12비트 휘도 포맷
21-118한 반복 단위의 바이트 구성을 왼쪽에서 오른쪽 순서로 표시합니다.
.. raw:: latex
\tiny
.. tabularcolumns:: |p{3.6cm}|p{2.4cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|
.. flat-table:: Luma-Only Image Formats
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
- Byte 4
- Byte 5
- Byte 6
* .. _V4L2-PIX-FMT-GREY:
- ``V4L2_PIX_FMT_GREY``
- 'GREY'
- Y'\ :sub:`0`\ [7:0]
- ...
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-IPU3-Y10:
- ``V4L2_PIX_FMT_IPU3_Y10``
- 'ip3y'
- Y'\ :sub:`0`\ [7:0]
- Y'\ :sub:`1`\ [5:0] Y'\ :sub:`0`\ [9:8]
- Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [9:6]
- Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [9:4]
- Y'\ :sub:`3`\ [9:2]
- ...
- ...
* .. _V4L2-PIX-FMT-Y10:
- ``V4L2_PIX_FMT_Y10``
- 'Y10 '
- Y'\ :sub:`0`\ [7:0]
- `000000` Y'\ :sub:`0`\ [9:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y10BPACK:
- ``V4L2_PIX_FMT_Y10BPACK``
- 'Y10B'
- Y'\ :sub:`0`\ [9:2]
- Y'\ :sub:`0`\ [1:0] Y'\ :sub:`1`\ [9:4]
- Y'\ :sub:`1`\ [3:0] Y'\ :sub:`2`\ [9:6]
- Y'\ :sub:`2`\ [5:0] Y'\ :sub:`3`\ [9:8]
- Y'\ :sub:`3`\ [7:0]
- ...
- ...
* .. _V4L2-PIX-FMT-Y10P:
- ``V4L2_PIX_FMT_Y10P``
- 'Y10P'
- Y'\ :sub:`0`\ [9:2]
- Y'\ :sub:`1`\ [9:2]
- Y'\ :sub:`2`\ [9:2]
- Y'\ :sub:`3`\ [9:2]
- Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [1:0] Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [1:0]
- ...
- ...
* .. _V4L2-PIX-FMT-Y12:
- ``V4L2_PIX_FMT_Y12``
- 'Y12 '
- Y'\ :sub:`0`\ [7:0]
- `0000` Y'\ :sub:`0`\ [11:8]
- ...
- ...
- ...
- ...
- ...
12·14·16비트 휘도 포맷
119-197패딩 위치, 패킹 방식과 바이트 순서가 포맷 식별의 핵심입니다.
* .. _V4L2-PIX-FMT-Y012:
- ``V4L2_PIX_FMT_Y012``
- 'Y012'
- Y'\ :sub:`0`\ [3:0] `0000`
- Y'\ :sub:`0`\ [11:4]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y12P:
- ``V4L2_PIX_FMT_Y12P``
- 'Y12P'
- Y'\ :sub:`0`\ [11:4]
- Y'\ :sub:`1`\ [11:4]
- Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [3:0]
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y14:
- ``V4L2_PIX_FMT_Y14``
- 'Y14 '
- Y'\ :sub:`0`\ [7:0]
- `00` Y'\ :sub:`0`\ [13:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y14P:
- ``V4L2_PIX_FMT_Y14P``
- 'Y14P'
- Y'\ :sub:`0`\ [13:6]
- Y'\ :sub:`1`\ [13:6]
- Y'\ :sub:`2`\ [13:6]
- Y'\ :sub:`3`\ [13:6]
- Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [5:0]
- Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [5:2]
- Y'\ :sub:`3`\ [5:0] Y'\ :sub:`2`\ [5:4]
* .. _V4L2-PIX-FMT-Y16:
- ``V4L2_PIX_FMT_Y16``
- 'Y16 '
- Y'\ :sub:`0`\ [7:0]
- Y'\ :sub:`0`\ [15:8]
- ...
- ...
- ...
- ...
- ...
* .. _V4L2-PIX-FMT-Y16-BE:
- ``V4L2_PIX_FMT_Y16_BE``
- 'Y16 ' | (1U << 31)
- Y'\ :sub:`0`\ [15:8]
- Y'\ :sub:`0`\ [7:0]
- ...
- ...
- ...
- ...
- ...
정밀도, 패딩과 MIPI 패킹
198-215`Y16`과 `Y16_BE`는 저장 단위가 16비트여도 실제 샘플링 정밀도가 더 낮을 수 있습니다. 예를 들어 픽셀당 10비트라면 값 범위는 0~1023입니다. `IPU3_Y10`은 25픽셀을 32바이트에 패킹하므로 마지막 바이트의 최상위 6비트가 0 패딩으로 남습니다.
`Y012`는 12비트 데이터를 16비트 워드의 상위 12비트에 두고 하위 4비트를 0으로 채웁니다. 반대로 `Y12`는 데이터를 하위 12비트에 두고 최상위 4비트를 패딩합니다.
`Y10P`, `Y12P`, `Y14P`처럼 `P`가 붙은 변형은 MIPI CSI-2 명세가 정의한 RAW10, RAW12, RAW14 패킹 방식을 각각 따릅니다.
유효 정밀도와 저장 정렬을 따로 확인해야 합니다.
.. raw:: latex
\normalsize
.. note::
For the Y16 and Y16_BE formats, the actual sampling precision may be lower
than 16 bits. For example, 10 bits per pixel uses values in the range 0 to
1023. For the IPU3_Y10 format 25 pixels are packed into 32 bytes, which
leaves the 6 most significant bits of the last byte padded with 0.
For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
padding zeros in the 4 low bits, in contrast to the Y12 format, which has
its padding located in the most significant bits of the 16 bit word.
The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
specification.
요약·해설
pixfmt-yuv-luma.rst:1-215GREY부터 Y16_BE까지 휘도 전용 포맷의 패킹, 패딩 및 엔디언 차이를 정리합니다.