요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
NPCM video driver
=================
This driver is used to control the Video Capture/Differentiation (VCD) engine
and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. The VCD can
capture a frame from digital video input and compare two frames in memory, and
the ECE can compress the frame data into HEXTILE format.
Driver-specific Controls
------------------------
V4L2_CID_NPCM_CAPTURE_MODE
~~~~~~~~~~~~~~~~~~~~~~~~~~
The VCD engine supports two modes:
- COMPLETE mode:
Capture the next complete frame into memory.
- DIFF mode:
Compare the incoming frame with the frame stored in memory, and updates the
differentiated frame in memory.
Application can use ``V4L2_CID_NPCM_CAPTURE_MODE`` control to set the VCD mode
with different control values (enum v4l2_npcm_capture_mode):
- ``V4L2_NPCM_CAPTURE_MODE_COMPLETE``: will set VCD to COMPLETE mode.
- ``V4L2_NPCM_CAPTURE_MODE_DIFF``: will set VCD to DIFF mode.
V4L2_CID_NPCM_RECT_COUNT
~~~~~~~~~~~~~~~~~~~~~~~~
If using V4L2_PIX_FMT_HEXTILE format, VCD will capture frame data and then ECE
will compress the data into HEXTILE rectangles and store them in V4L2 video
buffer with the layout defined in Remote Framebuffer Protocol:
::
(RFC 6143, https://www.rfc-editor.org/rfc/rfc6143.html#section-7.6.1)
+--------------+--------------+-------------------+
| No. of bytes | Type [Value] | Description |
+--------------+--------------+-------------------+
| 2 | U16 | x-position |
| 2 | U16 | y-position |
| 2 | U16 | width |
| 2 | U16 | height |
| 4 | S32 | encoding-type (5) |
+--------------+--------------+-------------------+
| HEXTILE rectangle data |
+-------------------------------------------------+
Application can get the video buffer through VIDIOC_DQBUF, and followed by
calling ``V4L2_CID_NPCM_RECT_COUNT`` control to get the number of HEXTILE
rectangles in this buffer.
References
----------
include/uapi/linux/npcm-video.h
**Copyright** |copy| 2022 Nuvoton Technologies
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
VCD와 ECE 엔진
1-11이 문서는 GPL-2.0 라이선스를 따르며 표준 기호 정의를 포함합니다.
NPCM 비디오 드라이버는 Nuvoton NPCM SoC의 Video Capture/Differentiation(VCD) 엔진과 Encoding Compression Engine(ECE)을 제어합니다. VCD는 디지털 비디오 입력에서 프레임을 캡처하고 메모리에 있는 두 프레임을 비교할 수 있으며, ECE는 프레임 데이터를 HEXTILE 형식으로 압축할 수 있습니다.
입력 프레임은 캡처 또는 차분 처리 뒤 필요하면 HEXTILE로 압축됩니다.
.. SPDX-License-Identifier: GPL-2.0
.. include:: <isonum.txt>
NPCM video driver
=================
This driver is used to control the Video Capture/Differentiation (VCD) engine
and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. The VCD can
capture a frame from digital video input and compare two frames in memory, and
the ECE can compress the frame data into HEXTILE format.
V4L2_CID_NPCM_CAPTURE_MODE
12-35VCD 엔진은 COMPLETE와 DIFF의 두 모드를 지원합니다.
COMPLETE 모드는 다음 전체 프레임을 메모리에 캡처합니다. DIFF 모드는 들어오는 프레임을 메모리에 저장된 프레임과 비교하고, 차이가 난 프레임 영역을 메모리에 갱신합니다.
애플리케이션은 `V4L2_CID_NPCM_CAPTURE_MODE` 컨트롤과 `enum v4l2_npcm_capture_mode` 값을 사용해 VCD 모드를 설정할 수 있습니다.
컨트롤 값과 VCD 동작을 대응시킵니다.
Driver-specific Controls
------------------------
V4L2_CID_NPCM_CAPTURE_MODE
~~~~~~~~~~~~~~~~~~~~~~~~~~
The VCD engine supports two modes:
- COMPLETE mode:
Capture the next complete frame into memory.
- DIFF mode:
Compare the incoming frame with the frame stored in memory, and updates the
differentiated frame in memory.
Application can use ``V4L2_CID_NPCM_CAPTURE_MODE`` control to set the VCD mode
with different control values (enum v4l2_npcm_capture_mode):
- ``V4L2_NPCM_CAPTURE_MODE_COMPLETE``: will set VCD to COMPLETE mode.
- ``V4L2_NPCM_CAPTURE_MODE_DIFF``: will set VCD to DIFF mode.
V4L2_CID_NPCM_RECT_COUNT와 HEXTILE
36-60`V4L2_PIX_FMT_HEXTILE` 형식을 사용하면 VCD가 프레임 데이터를 캡처한 뒤 ECE가 이를 HEXTILE 사각형으로 압축합니다. 결과는 Remote Framebuffer Protocol의 RFC 6143 7.6.1절이 정의한 레이아웃으로 V4L2 비디오 버퍼에 저장됩니다.
원문의 ASCII 표를 같은 바이트 순서의 구조화 표로 다시 구성합니다.
애플리케이션은 `VIDIOC_DQBUF`로 비디오 버퍼를 가져온 다음 `V4L2_CID_NPCM_RECT_COUNT` 컨트롤을 호출해 그 버퍼에 들어 있는 HEXTILE 사각형 수를 얻습니다.
버퍼를 dequeue한 뒤 같은 버퍼의 사각형 개수를 조회합니다.
V4L2_CID_NPCM_RECT_COUNT
~~~~~~~~~~~~~~~~~~~~~~~~
If using V4L2_PIX_FMT_HEXTILE format, VCD will capture frame data and then ECE
will compress the data into HEXTILE rectangles and store them in V4L2 video
buffer with the layout defined in Remote Framebuffer Protocol:
::
(RFC 6143, https://www.rfc-editor.org/rfc/rfc6143.html#section-7.6.1)
+--------------+--------------+-------------------+
| No. of bytes | Type [Value] | Description |
+--------------+--------------+-------------------+
| 2 | U16 | x-position |
| 2 | U16 | y-position |
| 2 | U16 | width |
| 2 | U16 | height |
| 4 | S32 | encoding-type (5) |
+--------------+--------------+-------------------+
| HEXTILE rectangle data |
+-------------------------------------------------+
Application can get the video buffer through VIDIOC_DQBUF, and followed by
calling ``V4L2_CID_NPCM_RECT_COUNT`` control to get the number of HEXTILE
rectangles in this buffer.
참고 자료와 저작권
61-66관련 UAPI 헤더는 `include/uapi/linux/npcm-video.h`입니다.
저작권은 2022 Nuvoton Technologies에 있습니다.
References
----------
include/uapi/linux/npcm-video.h
**Copyright** |copy| 2022 Nuvoton Technologies
요약·해설
npcm-video.rst:1-66NPCM 드라이버는 VCD로 전체 프레임 또는 차분 프레임을 만들고 ECE로 HEXTILE 사각형을 생성합니다. 애플리케이션은 VIDIOC_DQBUF 뒤 RECT_COUNT를 조회해 같은 버퍼의 사각형 개수를 해석해야 합니다.