요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _packed-yuv:
******************
Packed YUV formats
******************
Similarly to the packed RGB formats, the packed YUV formats store the Y, Cb and
Cr components consecutively in memory. They may apply subsampling to the chroma
components and thus differ in how they interlave the three components.
.. note::
- In all the tables that follow, bit 7 is the most significant bit in a byte.
- 'Y', 'Cb' and 'Cr' denote bits of the luma, blue chroma (also known as
'U') and red chroma (also known as 'V') components respectively. 'A'
denotes bits of the alpha component (if supported by the format), and 'X'
denotes padding bits.
4:4:4 Subsampling
=================
These formats do not subsample the chroma components and store each pixels as a
full triplet of Y, Cb and Cr values.
The next table lists the packed YUV 4:4:4 formats with less than 8 bits per
component. They are named based on the order of the Y, Cb and Cr components as
seen in a 16-bit word, which is then stored in memory in little endian byte
order, and on the number of bits for each component. For instance the YUV565
format stores a pixel in a 16-bit word [15:0] laid out at as [Y'\ :sub:`4-0`
Cb\ :sub:`5-0` Cr\ :sub:`4-0`], and stored in memory in two bytes,
[Cb\ :sub:`2-0` Cr\ :sub:`4-0`] followed by [Y'\ :sub:`4-0` Cb\ :sub:`5-3`].
.. raw:: latex
\begingroup
\scriptsize
\setlength{\tabcolsep}{2pt}
.. tabularcolumns:: |p{3.5cm}|p{0.96cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|
.. flat-table:: Packed YUV 4:4:4 Image Formats (less than 8bpc)
:header-rows: 2
:stub-columns: 0
* - Identifier
- Code
- :cspan:`7` Byte 0 in memory
- :cspan:`7` Byte 1
* -
-
- 7
- 6
- 5
- 4
- 3
- 2
- 1
- 0
- 7
- 6
- 5
- 4
- 3
- 2
- 1
- 0
* .. _V4L2-PIX-FMT-YUV444:
- ``V4L2_PIX_FMT_YUV444``
- 'Y444'
- Cb\ :sub:`3`
- Cb\ :sub:`2`
- Cb\ :sub:`1`
- Cb\ :sub:`0`
- Cr\ :sub:`3`
- Cr\ :sub:`2`
- Cr\ :sub:`1`
- Cr\ :sub:`0`
- a\ :sub:`3`
- a\ :sub:`2`
- a\ :sub:`1`
- a\ :sub:`0`
- Y'\ :sub:`3`
- Y'\ :sub:`2`
- Y'\ :sub:`1`
- Y'\ :sub:`0`
* .. _V4L2-PIX-FMT-YUV555:
- ``V4L2_PIX_FMT_YUV555``
- 'YUVO'
- Cb\ :sub:`2`
- Cb\ :sub:`1`
- Cb\ :sub:`0`
- Cr\ :sub:`4`
- Cr\ :sub:`3`
- Cr\ :sub:`2`
- Cr\ :sub:`1`
- Cr\ :sub:`0`
- a
- Y'\ :sub:`4`
- Y'\ :sub:`3`
- Y'\ :sub:`2`
- Y'\ :sub:`1`
- Y'\ :sub:`0`
- Cb\ :sub:`4`
- Cb\ :sub:`3`
* .. _V4L2-PIX-FMT-YUV565:
- ``V4L2_PIX_FMT_YUV565``
- 'YUVP'
- Cb\ :sub:`2`
- Cb\ :sub:`1`
- Cb\ :sub:`0`
- Cr\ :sub:`4`
- Cr\ :sub:`3`
- Cr\ :sub:`2`
- Cr\ :sub:`1`
- Cr\ :sub:`0`
- Y'\ :sub:`4`
- Y'\ :sub:`3`
- Y'\ :sub:`2`
- Y'\ :sub:`1`
- Y'\ :sub:`0`
- Cb\ :sub:`5`
- Cb\ :sub:`4`
- Cb\ :sub:`3`
.. raw:: latex
\endgroup
.. note::
For the YUV444 and YUV555 formats, the value of alpha bits is undefined
when reading from the driver, ignored when writing to the driver, except
when alpha blending has been negotiated for a :ref:`Video Overlay
<overlay>` or :ref:`Video Output Overlay <osd>`.
The next table lists the packed YUV 4:4:4 formats with 8 bits per component.
They are named based on the order of the Y, Cb and Cr components as stored in
memory, and on the total number of bits per pixel. For instance, the VUYX32
format stores a pixel with Cr\ :sub:`7-0` in the first byte, Cb\ :sub:`7-0` in
the second byte and Y'\ :sub:`7-0` in the third byte.
.. flat-table:: Packed YUV Image Formats (8bpc)
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
* .. _V4L2-PIX-FMT-YUV32:
- ``V4L2_PIX_FMT_YUV32``
- 'YUV4'
- A\ :sub:`7-0`
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
* .. _V4L2-PIX-FMT-AYUV32:
- ``V4L2_PIX_FMT_AYUV32``
- 'AYUV'
- A\ :sub:`7-0`
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
* .. _V4L2-PIX-FMT-XYUV32:
- ``V4L2_PIX_FMT_XYUV32``
- 'XYUV'
- X\ :sub:`7-0`
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
* .. _V4L2-PIX-FMT-VUYA32:
- ``V4L2_PIX_FMT_VUYA32``
- 'VUYA'
- Cr\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Y'\ :sub:`7-0`
- A\ :sub:`7-0`
* .. _V4L2-PIX-FMT-VUYX32:
- ``V4L2_PIX_FMT_VUYX32``
- 'VUYX'
- Cr\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Y'\ :sub:`7-0`
- X\ :sub:`7-0`
* .. _V4L2-PIX-FMT-YUVA32:
- ``V4L2_PIX_FMT_YUVA32``
- 'YUVA'
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
- A\ :sub:`7-0`
* .. _V4L2-PIX-FMT-YUVX32:
- ``V4L2_PIX_FMT_YUVX32``
- 'YUVX'
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
- X\ :sub:`7-0`
* .. _V4L2-PIX-FMT-YUV24:
- ``V4L2_PIX_FMT_YUV24``
- 'YUV3'
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
- -\
.. note::
- The alpha component is expected to contain a meaningful value that can be
used by drivers and applications.
- The padding bits contain undefined values that must be ignored by all
applications and drivers.
The next table lists the packed YUV 4:4:4 formats with 12 bits per component.
Expand the bits per component to 16 bits, data in the high bits, zeros in the low bits,
arranged in little endian order, storing 1 pixel in 6 bytes.
.. flat-table:: Packed YUV 4:4:4 Image Formats (12bpc)
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 1-0
- Byte 3-2
- Byte 5-4
- Byte 7-6
- Byte 9-8
- Byte 11-10
* .. _V4L2-PIX-FMT-YUV48-12:
- ``V4L2_PIX_FMT_YUV48_12``
- 'Y312'
- Y'\ :sub:`0`
- Cb\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`1`
- Cr\ :sub:`1`
4:2:2 Subsampling
=================
These formats, commonly referred to as YUYV or YUY2, subsample the chroma
components horizontally by 2, storing 2 pixels in a container. The container
is 32-bits for 8-bit formats, and 64-bits for 10+-bit formats.
The packed YUYV formats with more than 8 bits per component are stored as four
16-bit little-endian words. Each word's most significant bits contain one
component, and the least significant bits are zero padding.
.. raw:: latex
\footnotesize
.. tabularcolumns:: |p{3.4cm}|p{1.2cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|
.. flat-table:: Packed YUV 4:2:2 Formats in 32-bit container
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
- Byte 4
- Byte 5
- Byte 6
- Byte 7
* .. _V4L2-PIX-FMT-UYVY:
- ``V4L2_PIX_FMT_UYVY``
- 'UYVY'
- Cb\ :sub:`0`
- Y'\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`2`
- Y'\ :sub:`2`
- Cr\ :sub:`2`
- Y'\ :sub:`3`
* .. _V4L2-PIX-FMT-VYUY:
- ``V4L2_PIX_FMT_VYUY``
- 'VYUY'
- Cr\ :sub:`0`
- Y'\ :sub:`0`
- Cb\ :sub:`0`
- Y'\ :sub:`1`
- Cr\ :sub:`2`
- Y'\ :sub:`2`
- Cb\ :sub:`2`
- Y'\ :sub:`3`
* .. _V4L2-PIX-FMT-YUYV:
- ``V4L2_PIX_FMT_YUYV``
- 'YUYV'
- Y'\ :sub:`0`
- Cb\ :sub:`0`
- Y'\ :sub:`1`
- Cr\ :sub:`0`
- Y'\ :sub:`2`
- Cb\ :sub:`2`
- Y'\ :sub:`3`
- Cr\ :sub:`2`
* .. _V4L2-PIX-FMT-YVYU:
- ``V4L2_PIX_FMT_YVYU``
- 'YVYU'
- Y'\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`0`
- Y'\ :sub:`2`
- Cr\ :sub:`2`
- Y'\ :sub:`3`
- Cb\ :sub:`2`
.. tabularcolumns:: |p{3.4cm}|p{1.2cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|
.. flat-table:: Packed YUV 4:2:2 Formats in 64-bit container
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Word 0
- Word 1
- Word 2
- Word 3
* .. _V4L2-PIX-FMT-Y210:
- ``V4L2_PIX_FMT_Y210``
- 'Y210'
- Y'\ :sub:`0` (bits 15-6)
- Cb\ :sub:`0` (bits 15-6)
- Y'\ :sub:`1` (bits 15-6)
- Cr\ :sub:`0` (bits 15-6)
* .. _V4L2-PIX-FMT-Y212:
- ``V4L2_PIX_FMT_Y212``
- 'Y212'
- Y'\ :sub:`0` (bits 15-4)
- Cb\ :sub:`0` (bits 15-4)
- Y'\ :sub:`1` (bits 15-4)
- Cr\ :sub:`0` (bits 15-4)
* .. _V4L2-PIX-FMT-Y216:
- ``V4L2_PIX_FMT_Y216``
- 'Y216'
- Y'\ :sub:`0` (bits 15-0)
- Cb\ :sub:`0` (bits 15-0)
- Y'\ :sub:`1` (bits 15-0)
- Cr\ :sub:`0` (bits 15-0)
.. raw:: latex
\normalsize
**Color Sample Location:**
Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
horizontally.
4:1:1 Subsampling
=================
This format subsamples the chroma components horizontally by 4, storing 8
pixels in 12 bytes.
.. raw:: latex
\scriptsize
.. tabularcolumns:: |p{2.9cm}|p{0.8cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|
.. flat-table:: Packed YUV 4:1:1 Formats
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
- Byte 4
- Byte 5
- Byte 6
- Byte 7
- Byte 8
- Byte 9
- Byte 10
- Byte 11
* .. _V4L2-PIX-FMT-Y41P:
- ``V4L2_PIX_FMT_Y41P``
- 'Y41P'
- Cb\ :sub:`0`
- Y'\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`4`
- Y'\ :sub:`2`
- Cr\ :sub:`4`
- Y'\ :sub:`3`
- Y'\ :sub:`4`
- Y'\ :sub:`5`
- Y'\ :sub:`6`
- Y'\ :sub:`7`
.. raw:: latex
\normalsize
.. note::
Do not confuse ``V4L2_PIX_FMT_Y41P`` with
:ref:`V4L2_PIX_FMT_YUV411P <V4L2-PIX-FMT-YUV411P>`. Y41P is derived from
"YUV 4:1:1 **packed**", while YUV411P stands for "YUV 4:1:1 **planar**".
**Color Sample Location:**
Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
horizontally.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Component 표기와 packing 원칙
1-21Packed RGB와 마찬가지로 packed YUV는 Y, Cb, Cr component를 memory에 연속 저장합니다. Chroma component에 subsampling을 적용할 수 있으므로 세 component를 interleave하는 순서와 한 chroma sample이 담당하는 luma pixel 수가 형식마다 달라집니다.
뒤의 모든 표에서 공통으로 쓰는 bit 표기입니다.
FourCC 하나를 실제 sample로 읽는 기준입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _packed-yuv:
******************
Packed YUV formats
******************
Similarly to the packed RGB formats, the packed YUV formats store the Y, Cb and
Cr components consecutively in memory. They may apply subsampling to the chroma
components and thus differ in how they interlave the three components.
.. note::
- In all the tables that follow, bit 7 is the most significant bit in a byte.
- 'Y', 'Cb' and 'Cr' denote bits of the luma, blue chroma (also known as
'U') and red chroma (also known as 'V') components respectively. 'A'
denotes bits of the alpha component (if supported by the format), and 'X'
denotes padding bits.
4:4:4, component당 8 bit 미만
22-1534:4:4 형식은 chroma를 subsampling하지 않으므로 pixel마다 Y, Cb, Cr triplet 전체를 저장합니다. Component당 8 bit 미만인 형식 이름은 16-bit word에서 보이는 Y/Cb/Cr 순서와 각 bit 수를 반영하며, 완성된 word는 little-endian byte 순서로 memory에 저장됩니다.
예를 들어 YUV565의 16-bit word `[15:0]`은 `[Y'[4:0] Cb[5:0] Cr[4:0]]`이고 memory에서는 먼저 `[Cb[2:0] Cr[4:0]]`, 다음 byte에 `[Y'[4:0] Cb[5:3]]`가 옵니다.
Byte 0이 낮은 주소입니다.
YUV444와 YUV555를 driver에서 읽을 때 alpha bit 값은 정의되지 않고 driver에 쓸 때는 무시됩니다. 예외는 Video Overlay 또는 Video Output Overlay에서 alpha blending을 협상한 경우이며, 이때만 alpha bit가 실제 blending 값으로 쓰입니다.
Overlay 협상 여부가 alpha 의미를 바꿉니다.
4:4:4 Subsampling
=================
These formats do not subsample the chroma components and store each pixels as a
full triplet of Y, Cb and Cr values.
The next table lists the packed YUV 4:4:4 formats with less than 8 bits per
component. They are named based on the order of the Y, Cb and Cr components as
seen in a 16-bit word, which is then stored in memory in little endian byte
order, and on the number of bits for each component. For instance the YUV565
format stores a pixel in a 16-bit word [15:0] laid out at as [Y'\ :sub:`4-0`
Cb\ :sub:`5-0` Cr\ :sub:`4-0`], and stored in memory in two bytes,
[Cb\ :sub:`2-0` Cr\ :sub:`4-0`] followed by [Y'\ :sub:`4-0` Cb\ :sub:`5-3`].
.. raw:: latex
\begingroup
\scriptsize
\setlength{\tabcolsep}{2pt}
.. tabularcolumns:: |p{3.5cm}|p{0.96cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|p{0.52cm}|
.. flat-table:: Packed YUV 4:4:4 Image Formats (less than 8bpc)
:header-rows: 2
:stub-columns: 0
* - Identifier
- Code
- :cspan:`7` Byte 0 in memory
- :cspan:`7` Byte 1
* -
-
- 7
- 6
- 5
- 4
- 3
- 2
- 1
- 0
- 7
- 6
- 5
- 4
- 3
- 2
- 1
- 0
* .. _V4L2-PIX-FMT-YUV444:
- ``V4L2_PIX_FMT_YUV444``
- 'Y444'
- Cb\ :sub:`3`
- Cb\ :sub:`2`
- Cb\ :sub:`1`
- Cb\ :sub:`0`
- Cr\ :sub:`3`
- Cr\ :sub:`2`
- Cr\ :sub:`1`
- Cr\ :sub:`0`
- a\ :sub:`3`
- a\ :sub:`2`
- a\ :sub:`1`
- a\ :sub:`0`
- Y'\ :sub:`3`
- Y'\ :sub:`2`
- Y'\ :sub:`1`
- Y'\ :sub:`0`
* .. _V4L2-PIX-FMT-YUV555:
- ``V4L2_PIX_FMT_YUV555``
- 'YUVO'
- Cb\ :sub:`2`
- Cb\ :sub:`1`
- Cb\ :sub:`0`
- Cr\ :sub:`4`
- Cr\ :sub:`3`
- Cr\ :sub:`2`
- Cr\ :sub:`1`
- Cr\ :sub:`0`
- a
- Y'\ :sub:`4`
- Y'\ :sub:`3`
- Y'\ :sub:`2`
- Y'\ :sub:`1`
- Y'\ :sub:`0`
- Cb\ :sub:`4`
- Cb\ :sub:`3`
* .. _V4L2-PIX-FMT-YUV565:
- ``V4L2_PIX_FMT_YUV565``
- 'YUVP'
- Cb\ :sub:`2`
- Cb\ :sub:`1`
- Cb\ :sub:`0`
- Cr\ :sub:`4`
- Cr\ :sub:`3`
- Cr\ :sub:`2`
- Cr\ :sub:`1`
- Cr\ :sub:`0`
- Y'\ :sub:`4`
- Y'\ :sub:`3`
- Y'\ :sub:`2`
- Y'\ :sub:`1`
- Y'\ :sub:`0`
- Cb\ :sub:`5`
- Cb\ :sub:`4`
- Cb\ :sub:`3`
.. raw:: latex
\endgroup
.. note::
For the YUV444 and YUV555 formats, the value of alpha bits is undefined
when reading from the driver, ignored when writing to the driver, except
when alpha blending has been negotiated for a :ref:`Video Overlay
<overlay>` or :ref:`Video Output Overlay <osd>`.
4:4:4, 8·12 bpc
154-2888-bpc 형식 이름은 memory에 저장되는 Y, Cb, Cr 순서와 pixel당 총 bit 수를 반영합니다. 예를 들어 VUYX32는 첫 byte에 Cr, 둘째 byte에 Cb, 셋째 byte에 Y를 저장하고 마지막 byte는 padding입니다.
A는 의미 있는 alpha이고 X는 반드시 무시해야 하는 padding입니다.
Alpha component에는 driver와 application이 실제로 사용할 수 있는 의미 있는 값을 넣어야 합니다. 반대로 X padding bit의 값은 정의되지 않으므로 모든 driver와 application이 무시해야 합니다.
`V4L2_PIX_FMT_YUV48_12` (`Y312`)는 component당 12 bit를 16-bit word의 상위 12 bit로 확장하고 하위 4 bit를 0으로 채웁니다. Word는 little-endian이며 pixel 하나가 Y, Cb, Cr 세 word, 즉 6 byte를 차지합니다. 원문 표는 연속 pixel 0과 1을 `Y0 Cb0 Cr0 Y1 Cb1 Cr1` 순서로 보여 줍니다.
각 16-bit word의 high 12 bit만 sample이고 low 4 bit는 0입니다.
The next table lists the packed YUV 4:4:4 formats with 8 bits per component.
They are named based on the order of the Y, Cb and Cr components as stored in
memory, and on the total number of bits per pixel. For instance, the VUYX32
format stores a pixel with Cr\ :sub:`7-0` in the first byte, Cb\ :sub:`7-0` in
the second byte and Y'\ :sub:`7-0` in the third byte.
.. flat-table:: Packed YUV Image Formats (8bpc)
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
* .. _V4L2-PIX-FMT-YUV32:
- ``V4L2_PIX_FMT_YUV32``
- 'YUV4'
- A\ :sub:`7-0`
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
* .. _V4L2-PIX-FMT-AYUV32:
- ``V4L2_PIX_FMT_AYUV32``
- 'AYUV'
- A\ :sub:`7-0`
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
* .. _V4L2-PIX-FMT-XYUV32:
- ``V4L2_PIX_FMT_XYUV32``
- 'XYUV'
- X\ :sub:`7-0`
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
* .. _V4L2-PIX-FMT-VUYA32:
- ``V4L2_PIX_FMT_VUYA32``
- 'VUYA'
- Cr\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Y'\ :sub:`7-0`
- A\ :sub:`7-0`
* .. _V4L2-PIX-FMT-VUYX32:
- ``V4L2_PIX_FMT_VUYX32``
- 'VUYX'
- Cr\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Y'\ :sub:`7-0`
- X\ :sub:`7-0`
* .. _V4L2-PIX-FMT-YUVA32:
- ``V4L2_PIX_FMT_YUVA32``
- 'YUVA'
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
- A\ :sub:`7-0`
* .. _V4L2-PIX-FMT-YUVX32:
- ``V4L2_PIX_FMT_YUVX32``
- 'YUVX'
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
- X\ :sub:`7-0`
* .. _V4L2-PIX-FMT-YUV24:
- ``V4L2_PIX_FMT_YUV24``
- 'YUV3'
- Y'\ :sub:`7-0`
- Cb\ :sub:`7-0`
- Cr\ :sub:`7-0`
- -\
.. note::
- The alpha component is expected to contain a meaningful value that can be
used by drivers and applications.
- The padding bits contain undefined values that must be ignored by all
applications and drivers.
The next table lists the packed YUV 4:4:4 formats with 12 bits per component.
Expand the bits per component to 16 bits, data in the high bits, zeros in the low bits,
arranged in little endian order, storing 1 pixel in 6 bytes.
.. flat-table:: Packed YUV 4:4:4 Image Formats (12bpc)
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 1-0
- Byte 3-2
- Byte 5-4
- Byte 7-6
- Byte 9-8
- Byte 11-10
* .. _V4L2-PIX-FMT-YUV48-12:
- ``V4L2_PIX_FMT_YUV48_12``
- 'Y312'
- Y'\ :sub:`0`
- Cb\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`1`
- Cr\ :sub:`1`
4:2:2 packed container
289-4214:2:2 형식은 chroma를 수평으로 2:1 subsampling하고 pixel 두 개를 한 container에 저장합니다. 8-bit 형식의 container는 32 bit이고 10 bit 이상 형식은 64 bit입니다. 8-bit 표는 이해를 돕기 위해 연속 네 pixel, 즉 두 container의 byte 순서를 보여 줍니다.
Chroma index 0은 Y0·Y1, index 2는 Y2·Y3에 공유됩니다.
Component당 8 bit보다 큰 packed YUYV 형식은 16-bit little-endian word 네 개로 저장합니다. 각 word의 most significant bit 쪽에 component를 놓고 남는 least significant bit는 0 padding입니다.
모두 Word 0..3이 Y0, Cb0, Y1, Cr0 순서입니다.
4:2:2 chroma sample은 수평 방향에서 두 luma sample 사이에 놓이는 interstitially sited, 즉 centered 위치를 사용합니다.
한 Cb/Cr pair를 두 luma pixel에 결합합니다.
4:2:2 Subsampling
=================
These formats, commonly referred to as YUYV or YUY2, subsample the chroma
components horizontally by 2, storing 2 pixels in a container. The container
is 32-bits for 8-bit formats, and 64-bits for 10+-bit formats.
The packed YUYV formats with more than 8 bits per component are stored as four
16-bit little-endian words. Each word's most significant bits contain one
component, and the least significant bits are zero padding.
.. raw:: latex
\footnotesize
.. tabularcolumns:: |p{3.4cm}|p{1.2cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|
.. flat-table:: Packed YUV 4:2:2 Formats in 32-bit container
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
- Byte 4
- Byte 5
- Byte 6
- Byte 7
* .. _V4L2-PIX-FMT-UYVY:
- ``V4L2_PIX_FMT_UYVY``
- 'UYVY'
- Cb\ :sub:`0`
- Y'\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`2`
- Y'\ :sub:`2`
- Cr\ :sub:`2`
- Y'\ :sub:`3`
* .. _V4L2-PIX-FMT-VYUY:
- ``V4L2_PIX_FMT_VYUY``
- 'VYUY'
- Cr\ :sub:`0`
- Y'\ :sub:`0`
- Cb\ :sub:`0`
- Y'\ :sub:`1`
- Cr\ :sub:`2`
- Y'\ :sub:`2`
- Cb\ :sub:`2`
- Y'\ :sub:`3`
* .. _V4L2-PIX-FMT-YUYV:
- ``V4L2_PIX_FMT_YUYV``
- 'YUYV'
- Y'\ :sub:`0`
- Cb\ :sub:`0`
- Y'\ :sub:`1`
- Cr\ :sub:`0`
- Y'\ :sub:`2`
- Cb\ :sub:`2`
- Y'\ :sub:`3`
- Cr\ :sub:`2`
* .. _V4L2-PIX-FMT-YVYU:
- ``V4L2_PIX_FMT_YVYU``
- 'YVYU'
- Y'\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`0`
- Y'\ :sub:`2`
- Cr\ :sub:`2`
- Y'\ :sub:`3`
- Cb\ :sub:`2`
.. tabularcolumns:: |p{3.4cm}|p{1.2cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|p{0.8cm}|
.. flat-table:: Packed YUV 4:2:2 Formats in 64-bit container
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Word 0
- Word 1
- Word 2
- Word 3
* .. _V4L2-PIX-FMT-Y210:
- ``V4L2_PIX_FMT_Y210``
- 'Y210'
- Y'\ :sub:`0` (bits 15-6)
- Cb\ :sub:`0` (bits 15-6)
- Y'\ :sub:`1` (bits 15-6)
- Cr\ :sub:`0` (bits 15-6)
* .. _V4L2-PIX-FMT-Y212:
- ``V4L2_PIX_FMT_Y212``
- 'Y212'
- Y'\ :sub:`0` (bits 15-4)
- Cb\ :sub:`0` (bits 15-4)
- Y'\ :sub:`1` (bits 15-4)
- Cr\ :sub:`0` (bits 15-4)
* .. _V4L2-PIX-FMT-Y216:
- ``V4L2_PIX_FMT_Y216``
- 'Y216'
- Y'\ :sub:`0` (bits 15-0)
- Cb\ :sub:`0` (bits 15-0)
- Y'\ :sub:`1` (bits 15-0)
- Cr\ :sub:`0` (bits 15-0)
.. raw:: latex
\normalsize
**Color Sample Location:**
Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
horizontally.
4:1:1 Y41P packing
422-4824:1:1 형식은 chroma를 수평으로 4:1 subsampling하며 pixel 8개를 12 byte에 저장합니다. `V4L2_PIX_FMT_Y41P` (`Y41P`)의 두 chroma pair는 각각 luma pixel 네 개에 공유됩니다.
Pixel 8개를 나타내는 byte 순서입니다.
`V4L2_PIX_FMT_Y41P`를 `V4L2_PIX_FMT_YUV411P`와 혼동하면 안 됩니다. Y41P는 YUV 4:1:1 packed에서 유래하지만 YUV411P는 YUV 4:1:1 planar를 뜻합니다.
4:1:1 chroma sample 역시 수평 방향에서 interstitially sited, 즉 centered 위치를 사용합니다.
4:1:1 Subsampling
=================
This format subsamples the chroma components horizontally by 4, storing 8
pixels in 12 bytes.
.. raw:: latex
\scriptsize
.. tabularcolumns:: |p{2.9cm}|p{0.8cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|
.. flat-table:: Packed YUV 4:1:1 Formats
:header-rows: 1
:stub-columns: 0
* - Identifier
- Code
- Byte 0
- Byte 1
- Byte 2
- Byte 3
- Byte 4
- Byte 5
- Byte 6
- Byte 7
- Byte 8
- Byte 9
- Byte 10
- Byte 11
* .. _V4L2-PIX-FMT-Y41P:
- ``V4L2_PIX_FMT_Y41P``
- 'Y41P'
- Cb\ :sub:`0`
- Y'\ :sub:`0`
- Cr\ :sub:`0`
- Y'\ :sub:`1`
- Cb\ :sub:`4`
- Y'\ :sub:`2`
- Cr\ :sub:`4`
- Y'\ :sub:`3`
- Y'\ :sub:`4`
- Y'\ :sub:`5`
- Y'\ :sub:`6`
- Y'\ :sub:`7`
.. raw:: latex
\normalsize
.. note::
Do not confuse ``V4L2_PIX_FMT_Y41P`` with
:ref:`V4L2_PIX_FMT_YUV411P <V4L2-PIX-FMT-YUV411P>`. Y41P is derived from
"YUV 4:1:1 **packed**", while YUV411P stands for "YUV 4:1:1 **planar**".
**Color Sample Location:**
Chroma samples are :ref:`interstitially sited<yuv-chroma-centered>`
horizontally.
요약·해설
pixfmt-packed-yuv.rst:1-482Packed YUV는 subsampling 비율과 FourCC에 따라 Y·Cb·Cr·alpha/padding의 memory 순서를 정하며 10-bit 이상 4:2:2는 16-bit little-endian word를 사용합니다.