요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _jpeg-controls:
**********************
JPEG Control Reference
**********************
The JPEG class includes controls for common features of JPEG encoders
and decoders. Currently it includes features for codecs implementing
progressive baseline DCT compression process with Huffman entropy
coding.
.. _jpeg-control-id:
JPEG Control IDs
================
``V4L2_CID_JPEG_CLASS (class)``
The JPEG class descriptor. Calling
:ref:`VIDIOC_QUERYCTRL` for this control will
return a description of this control class.
``V4L2_CID_JPEG_CHROMA_SUBSAMPLING (menu)``
The chroma subsampling factors describe how each component of an
input image is sampled, in respect to maximum sample rate in each
spatial dimension. See :ref:`itu-t81`, clause A.1.1. for more
details. The ``V4L2_CID_JPEG_CHROMA_SUBSAMPLING`` control determines
how Cb and Cr components are downsampled after converting an input
image from RGB to Y'CbCr color space.
.. tabularcolumns:: |p{7.5cm}|p{10.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_444``
- No chroma subsampling, each pixel has Y, Cr and Cb values.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_422``
- Horizontally subsample Cr, Cb components by a factor of 2.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_420``
- Subsample Cr, Cb components horizontally and vertically by 2.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_411``
- Horizontally subsample Cr, Cb components by a factor of 4.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_410``
- Subsample Cr, Cb components horizontally by 4 and vertically by 2.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY``
- Use only luminance component.
``V4L2_CID_JPEG_RESTART_INTERVAL (integer)``
The restart interval determines an interval of inserting RSTm
markers (m = 0..7). The purpose of these markers is to additionally
reinitialize the encoder process, in order to process blocks of an
image independently. For the lossy compression processes the restart
interval unit is MCU (Minimum Coded Unit) and its value is contained
in DRI (Define Restart Interval) marker. If
``V4L2_CID_JPEG_RESTART_INTERVAL`` control is set to 0, DRI and RSTm
markers will not be inserted.
.. _jpeg-quality-control:
``V4L2_CID_JPEG_COMPRESSION_QUALITY (integer)``
Determines trade-off between image quality and size.
It provides simpler method for applications to control image quality,
without a need for direct reconfiguration of luminance and chrominance
quantization tables. In cases where a driver uses quantization tables
configured directly by an application, using interfaces defined
elsewhere, ``V4L2_CID_JPEG_COMPRESSION_QUALITY`` control should be set by
driver to 0.
The value range of this control is driver-specific. Only positive,
non-zero values are meaningful. The recommended range is 1 - 100,
where larger values correspond to better image quality.
.. _jpeg-active-marker-control:
``V4L2_CID_JPEG_ACTIVE_MARKER (bitmask)``
Specify which JPEG markers are included in compressed stream. This
control is valid only for encoders.
.. flat-table::
:header-rows: 0
:stub-columns: 0
* - ``V4L2_JPEG_ACTIVE_MARKER_APP0``
- Application data segment APP\ :sub:`0`.
* - ``V4L2_JPEG_ACTIVE_MARKER_APP1``
- Application data segment APP\ :sub:`1`.
* - ``V4L2_JPEG_ACTIVE_MARKER_COM``
- Comment segment.
* - ``V4L2_JPEG_ACTIVE_MARKER_DQT``
- Quantization tables segment.
* - ``V4L2_JPEG_ACTIVE_MARKER_DHT``
- Huffman tables segment.
For more details about JPEG specification, refer to :ref:`itu-t81`,
:ref:`jfif`, :ref:`w3c-jpeg-jfif`.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
JPEG codec 클래스
1-23JPEG 클래스는 JPEG encoder와 decoder의 공통 기능을 제어합니다. 현재 Huffman entropy coding을 사용하는 progressive baseline DCT 압축 과정을 구현한 codec 기능을 포함합니다.
`V4L2_CID_JPEG_CLASS`는 JPEG 클래스 설명자이며 `VIDIOC_QUERYCTRL`로 조회하면 이 제어 클래스의 설명을 반환합니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. _jpeg-controls:
**********************
JPEG Control Reference
**********************
The JPEG class includes controls for common features of JPEG encoders
and decoders. Currently it includes features for codecs implementing
progressive baseline DCT compression process with Huffman entropy
coding.
.. _jpeg-control-id:
JPEG Control IDs
================
``V4L2_CID_JPEG_CLASS (class)``
The JPEG class descriptor. Calling
:ref:`VIDIOC_QUERYCTRL` for this control will
return a description of this control class.
Chroma subsampling
24-58Chroma subsampling factor는 각 공간 축의 최대 sample rate에 비해 입력 이미지의 각 성분을 얼마나 자주 sampling하는지 나타냅니다. 자세한 정의는 ITU-T T.81 A.1.1을 따릅니다. `V4L2_CID_JPEG_CHROMA_SUBSAMPLING`은 RGB를 Y'CbCr로 변환한 뒤 Cb와 Cr을 어떤 비율로 downsample할지 정합니다.
Luma 해상도에 대한 chroma의 수평·수직 sampling 비율을 선택합니다.
`V4L2_CID_JPEG_RESTART_INTERVAL`은 RSTm marker 삽입 간격을 정합니다. m은 0부터 7까지 순환하며 encoder 상태를 다시 초기화해 이미지 block들을 독립적으로 처리하게 합니다.
``V4L2_CID_JPEG_CHROMA_SUBSAMPLING (menu)``
The chroma subsampling factors describe how each component of an
input image is sampled, in respect to maximum sample rate in each
spatial dimension. See :ref:`itu-t81`, clause A.1.1. for more
details. The ``V4L2_CID_JPEG_CHROMA_SUBSAMPLING`` control determines
how Cb and Cr components are downsampled after converting an input
image from RGB to Y'CbCr color space.
.. tabularcolumns:: |p{7.5cm}|p{10.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_444``
- No chroma subsampling, each pixel has Y, Cr and Cb values.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_422``
- Horizontally subsample Cr, Cb components by a factor of 2.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_420``
- Subsample Cr, Cb components horizontally and vertically by 2.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_411``
- Horizontally subsample Cr, Cb components by a factor of 4.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_410``
- Subsample Cr, Cb components horizontally by 4 and vertically by 2.
* - ``V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY``
- Use only luminance component.
``V4L2_CID_JPEG_RESTART_INTERVAL (integer)``
The restart interval determines an interval of inserting RSTm
markers (m = 0..7). The purpose of these markers is to additionally
reinitialize the encoder process, in order to process blocks of an
image independently. For the lossy compression processes the restart
Restart interval, quality와 marker
59-105Lossy JPEG에서 restart interval의 단위는 MCU(Minimum Coded Unit)이고 값은 DRI(Define Restart Interval) marker에 기록됩니다. 제어값이 0이면 DRI와 RSTm marker를 삽입하지 않습니다.
`V4L2_CID_JPEG_COMPRESSION_QUALITY`는 이미지 품질과 크기의 trade-off를 정하며 application이 luminance와 chrominance quantization table을 직접 다시 구성하지 않아도 되는 단순한 인터페이스입니다. Application이 다른 인터페이스로 quantization table을 직접 제공하는 드라이버는 이 제어를 0으로 설정해야 합니다.
Quality 범위는 드라이버별이며 양의 0이 아닌 값만 의미가 있습니다. 권장 범위는 1부터 100까지이고 값이 클수록 이미지 품질이 좋습니다.
`V4L2_CID_JPEG_ACTIVE_MARKER`는 압축 stream에 포함할 JPEG marker를 bitmask로 지정하며 encoder에서만 유효합니다.
Encoder가 출력 stream에 넣을 부가 segment와 table을 선택합니다.
JPEG 규격의 세부 사항은 ITU-T T.81, JFIF와 W3C JPEG JFIF 참조 문서를 따릅니다.
interval unit is MCU (Minimum Coded Unit) and its value is contained
in DRI (Define Restart Interval) marker. If
``V4L2_CID_JPEG_RESTART_INTERVAL`` control is set to 0, DRI and RSTm
markers will not be inserted.
.. _jpeg-quality-control:
``V4L2_CID_JPEG_COMPRESSION_QUALITY (integer)``
Determines trade-off between image quality and size.
It provides simpler method for applications to control image quality,
without a need for direct reconfiguration of luminance and chrominance
quantization tables. In cases where a driver uses quantization tables
configured directly by an application, using interfaces defined
elsewhere, ``V4L2_CID_JPEG_COMPRESSION_QUALITY`` control should be set by
driver to 0.
The value range of this control is driver-specific. Only positive,
non-zero values are meaningful. The recommended range is 1 - 100,
where larger values correspond to better image quality.
.. _jpeg-active-marker-control:
``V4L2_CID_JPEG_ACTIVE_MARKER (bitmask)``
Specify which JPEG markers are included in compressed stream. This
control is valid only for encoders.
.. flat-table::
:header-rows: 0
:stub-columns: 0
* - ``V4L2_JPEG_ACTIVE_MARKER_APP0``
- Application data segment APP\ :sub:`0`.
* - ``V4L2_JPEG_ACTIVE_MARKER_APP1``
- Application data segment APP\ :sub:`1`.
* - ``V4L2_JPEG_ACTIVE_MARKER_COM``
- Comment segment.
* - ``V4L2_JPEG_ACTIVE_MARKER_DQT``
- Quantization tables segment.
* - ``V4L2_JPEG_ACTIVE_MARKER_DHT``
- Huffman tables segment.
For more details about JPEG specification, refer to :ref:`itu-t81`,
:ref:`jfif`, :ref:`w3c-jpeg-jfif`.
요약·해설
ext-ctrls-jpeg.rst:1-105JPEG 제어는 chroma sampling 비율과 독립 decoding 단위, 품질 목표, encoder가 넣을 marker를 명시합니다.