← Documents Documentation/userspace-api/media/drivers/npcm-video.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / Drivers

NPCM video driver

NPCM VCD/ECE의 전체 프레임·차분 캡처와 HEXTILE 버퍼 레이아웃을 설명합니다.

Source pathDocumentation/userspace-api/media/drivers/npcm-video.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

npcm-video.rst:1-66

NPCM 드라이버는 VCD로 전체 프레임 또는 차분 프레임을 만들고 ECE로 HEXTILE 사각형을 생성합니다. 애플리케이션은 VIDIOC_DQBUF 뒤 RECT_COUNT를 조회해 같은 버퍼의 사각형 개수를 해석해야 합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 .. include:: <isonum.txt>
4
5 NPCM video driver
6 =================
7
8 This driver is used to control the Video Capture/Differentiation (VCD) engine
9 and Encoding Compression Engine (ECE) present on Nuvoton NPCM SoCs. The VCD can
10 capture a frame from digital video input and compare two frames in memory, and
11 the ECE can compress the frame data into HEXTILE format.
12
13 Driver-specific Controls
14 ------------------------
15
16 V4L2_CID_NPCM_CAPTURE_MODE
17 ~~~~~~~~~~~~~~~~~~~~~~~~~~
18
19 The VCD engine supports two modes:
20
21 - COMPLETE mode:
22
23 Capture the next complete frame into memory.
24
25 - DIFF mode:
26
27 Compare the incoming frame with the frame stored in memory, and updates the
28 differentiated frame in memory.
29
30 Application can use ``V4L2_CID_NPCM_CAPTURE_MODE`` control to set the VCD mode
31 with different control values (enum v4l2_npcm_capture_mode):
32
33 - ``V4L2_NPCM_CAPTURE_MODE_COMPLETE``: will set VCD to COMPLETE mode.
34 - ``V4L2_NPCM_CAPTURE_MODE_DIFF``: will set VCD to DIFF mode.
35
36 V4L2_CID_NPCM_RECT_COUNT
37 ~~~~~~~~~~~~~~~~~~~~~~~~
38
39 If using V4L2_PIX_FMT_HEXTILE format, VCD will capture frame data and then ECE
40 will compress the data into HEXTILE rectangles and store them in V4L2 video
41 buffer with the layout defined in Remote Framebuffer Protocol:
42 ::
43
44 (RFC 6143, https://www.rfc-editor.org/rfc/rfc6143.html#section-7.6.1)
45
46 +--------------+--------------+-------------------+
47 | No. of bytes | Type [Value] | Description |
48 +--------------+--------------+-------------------+
49 | 2 | U16 | x-position |
50 | 2 | U16 | y-position |
51 | 2 | U16 | width |
52 | 2 | U16 | height |
53 | 4 | S32 | encoding-type (5) |
54 +--------------+--------------+-------------------+
55 | HEXTILE rectangle data |
56 +-------------------------------------------------+
57
58 Application can get the video buffer through VIDIOC_DQBUF, and followed by
59 calling ``V4L2_CID_NPCM_RECT_COUNT`` control to get the number of HEXTILE
60 rectangles in this buffer.
61
62 References
63 ----------
64 include/uapi/linux/npcm-video.h
65
66 **Copyright** |copy| 2022 Nuvoton Technologies
67

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 형식으로 압축할 수 있습니다.

NPCM 캡처 경로
디지털 비디오 프레임 입력VCD가 전체 프레임을 캡처하거나 이전 프레임과 비교ECE가 결과 데이터를 HEXTILE 사각형으로 압축V4L2 비디오 버퍼에 결과 저장

입력 프레임은 캡처 또는 차분 처리 뒤 필요하면 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-35

VCD 엔진은 COMPLETE와 DIFF의 두 모드를 지원합니다.

COMPLETE 모드는 다음 전체 프레임을 메모리에 캡처합니다. DIFF 모드는 들어오는 프레임을 메모리에 저장된 프레임과 비교하고, 차이가 난 프레임 영역을 메모리에 갱신합니다.

애플리케이션은 `V4L2_CID_NPCM_CAPTURE_MODE` 컨트롤과 `enum v4l2_npcm_capture_mode` 값을 사용해 VCD 모드를 설정할 수 있습니다.

NPCM 캡처 모드
항목설명
V4L2_NPCM_CAPTURE_MODE_COMPLETE다음 전체 프레임을 메모리에 캡처
V4L2_NPCM_CAPTURE_MODE_DIFF입력 프레임과 저장 프레임을 비교해 차분 프레임 갱신

컨트롤 값과 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 비디오 버퍼에 저장됩니다.

HEXTILE 사각형 버퍼 레이아웃
바이트 수형식 [값]설명
2U16x-position
2U16y-position
2U16width
2U16height
4S32encoding-type (5)
가변HEXTILE payloadHEXTILE rectangle data

원문의 ASCII 표를 같은 바이트 순서의 구조화 표로 다시 구성합니다.

애플리케이션은 `VIDIOC_DQBUF`로 비디오 버퍼를 가져온 다음 `V4L2_CID_NPCM_RECT_COUNT` 컨트롤을 호출해 그 버퍼에 들어 있는 HEXTILE 사각형 수를 얻습니다.

HEXTILE 버퍼 소비 순서
VCD가 프레임 캡처ECE가 HEXTILE 사각형으로 압축RFC 6143 레이아웃으로 V4L2 버퍼 저장애플리케이션이 VIDIOC_DQBUF 호출V4L2_CID_NPCM_RECT_COUNT로 사각형 수 조회

버퍼를 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