요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=========================================================
Raspberry Pi PiSP Back End Memory-to-Memory ISP (pisp-be)
=========================================================
The PiSP Back End
=================
The PiSP Back End is a memory-to-memory Image Signal Processor (ISP) which reads
image data from DRAM memory and performs image processing as specified by the
application through the parameters in a configuration buffer, before writing
pixel data back to memory through two distinct output channels.
The ISP registers and programming model are documented in the `Raspberry Pi
Image Signal Processor (PiSP) Specification document`_
The PiSP Back End ISP processes images in tiles. The handling of image
tessellation and the computation of low-level configuration parameters is
realized by a free software library called `libpisp
<https://github.com/raspberrypi/libpisp>`_.
The full image processing pipeline, which involves capturing RAW Bayer data from
an image sensor through a MIPI CSI-2 compatible capture interface, storing them
in DRAM memory and processing them in the PiSP Back End to obtain images usable
by an application is implemented in `libcamera <https://libcamera.org>`_ as
part of the Raspberry Pi platform support.
The pisp-be driver
==================
The Raspberry Pi PiSP Back End (pisp-be) driver is located under
drivers/media/platform/raspberrypi/pisp-be. It uses the `V4L2 API` to register
a number of video capture and output devices, the `V4L2 subdev API` to register
a subdevice for the ISP that connects the video devices in a single media graph
realized using the `Media Controller (MC) API`.
The media topology registered by the `pisp-be` driver is represented below:
.. _pips-be-topology:
.. kernel-figure:: raspberrypi-pisp-be.dot
:alt: Diagram of the default media pipeline topology
:align: center
The media graph registers the following video device nodes:
- pispbe-input: output device for images to be submitted to the ISP for
processing.
- pispbe-tdn_input: output device for temporal denoise.
- pispbe-stitch_input: output device for image stitching (HDR).
- pispbe-output0: first capture device for processed images.
- pispbe-output1: second capture device for processed images.
- pispbe-tdn_output: capture device for temporal denoise.
- pispbe-stitch_output: capture device for image stitching (HDR).
- pispbe-config: output device for ISP configuration parameters.
pispbe-input
------------
Images to be processed by the ISP are queued to the `pispbe-input` output device
node. For a list of image formats supported as input to the ISP refer to the
`Raspberry Pi Image Signal Processor (PiSP) Specification document`_.
pispbe-tdn_input, pispbe-tdn_output
-----------------------------------
The `pispbe-tdn_input` output video device receives images to be processed by
the temporal denoise block which are captured from the `pispbe-tdn_output`
capture video device. Userspace is responsible for maintaining queues on both
devices, and ensuring that buffers completed on the output are queued to the
input.
pispbe-stitch_input, pispbe-stitch_output
-----------------------------------------
To realize HDR (high dynamic range) image processing the image stitching and
tonemapping blocks are used. The `pispbe-stitch_output` writes images to memory
and the `pispbe-stitch_input` receives the previously written frame to process
it along with the current input image. Userspace is responsible for maintaining
queues on both devices, and ensuring that buffers completed on the output are
queued to the input.
pispbe-output0, pispbe-output1
------------------------------
The two capture devices write to memory the pixel data as processed by the ISP.
pispbe-config
-------------
The `pispbe-config` output video devices receives a buffer of configuration
parameters that define the desired image processing to be performed by the ISP.
The format of the ISP configuration parameter is defined by
:c:type:`pisp_be_tiles_config` C structure and the meaning of each parameter is
described in the `Raspberry Pi Image Signal Processor (PiSP) Specification
document`_.
ISP configuration
=================
The ISP configuration is described solely by the content of the parameters
buffer. The only parameter that userspace needs to configure using the V4L2 API
is the image format on the output and capture video devices for validation of
the content of the parameters buffer.
.. _Raspberry Pi Image Signal Processor (PiSP) Specification document: https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
PiSP Back End 개요
1-28PiSP Back End는 DRAM memory에서 image data를 읽는 memory-to-memory Image Signal Processor(ISP)입니다. Application이 configuration buffer의 parameter로 지정한 image processing을 수행한 뒤, 서로 구분된 두 output channel을 통해 pixel data를 memory에 다시 기록합니다.
ISP register와 programming model은 Raspberry Pi Image Signal Processor(PiSP) Specification document(https://datasheets.raspberrypi.com/camera/raspberry-pi-image-signal-processor-specification.pdf)에 설명되어 있습니다.
PiSP Back End ISP는 image를 tile 단위로 처리합니다. Image tessellation 처리와 low-level configuration parameter 계산은 free software library인 libpisp(https://github.com/raspberrypi/libpisp)가 담당합니다.
전체 image processing pipeline은 MIPI CSI-2 compatible capture interface로 image sensor의 RAW Bayer data를 capture하고, 이를 DRAM memory에 저장한 뒤, application이 사용할 수 있는 image를 얻도록 PiSP Back End에서 처리합니다. 이 pipeline은 Raspberry Pi platform 지원의 일부로 libcamera(https://libcamera.org)에 구현되어 있습니다.
pisp-be driver와 media graph
29-46Raspberry Pi PiSP Back End(`pisp-be`) driver는 `drivers/media/platform/raspberrypi/pisp-be`에 있습니다. 이 driver는 `V4L2 API`로 여러 video capture/output device를 등록하고, `V4L2 subdev API`로 ISP subdevice를 등록합니다. ISP subdevice는 `Media Controller (MC) API`로 구성한 하나의 media graph에서 video device들을 연결합니다.
원문의 `raspberrypi-pisp-be.dot` graph는 `pispbe` entity의 input port 0, 1, 2, 7과 output port 3, 4, 5, 6에 여덟 video node가 연결된 기본 topology를 나타냅니다.
DOT 원본의 `/dev/video0-7` mapping과 각 processing path를 구조화했습니다. `pispbe-config`는 pixel stream이 아니라 ISP parameter buffer를 공급합니다.
등록되는 video device node
47-58| Node | Device | Queue direction | 용도 |
|---|---|---|---|
| pispbe-input | /dev/video0 | output | ISP 처리 대상 image 입력 |
| pispbe-tdn_input | /dev/video1 | output | Temporal denoise 이전 frame 입력 |
| pispbe-stitch_input | /dev/video2 | output | HDR stitching 이전 frame 입력 |
| pispbe-output0 | /dev/video3 | capture | 첫 번째 처리 image 출력 |
| pispbe-output1 | /dev/video4 | capture | 두 번째 처리 image 출력 |
| pispbe-tdn_output | /dev/video5 | capture | Temporal denoise frame 출력 |
| pispbe-stitch_output | /dev/video6 | capture | HDR stitching frame 출력 |
| pispbe-config | /dev/video7 | output | ISP configuration parameter 입력 |
pispbe-input
59-65ISP에서 처리할 image는 `pispbe-input` output device node에 queue합니다. ISP가 input으로 지원하는 image format 목록은 Raspberry Pi Image Signal Processor(PiSP) Specification document를 참고하십시오.
pispbe-tdn_input과 pispbe-tdn_output
66-74`pispbe-tdn_input` output video device는 temporal denoise block이 처리할 image를 받으며, 처리 결과는 `pispbe-tdn_output` capture video device에서 capture됩니다. Userspace는 두 device의 queue를 모두 유지하고, output에서 완료된 buffer가 다시 input에 queue되도록 해야 합니다.
pispbe-stitch_input과 pispbe-stitch_output
75-84HDR(high dynamic range) image processing은 image stitching과 tonemapping block으로 구현합니다. `pispbe-stitch_output`은 image를 memory에 기록하고, `pispbe-stitch_input`은 앞서 기록한 frame을 받아 현재 input image와 함께 처리합니다. Userspace는 두 device의 queue를 유지하고, output에서 완료된 buffer를 input에 queue해야 합니다.
pispbe-output0과 pispbe-output1
85-89두 capture device는 ISP가 처리한 pixel data를 memory에 기록합니다.
pispbe-config
90-100`pispbe-config` output video device는 ISP가 수행할 image processing을 정의하는 configuration parameter buffer를 받습니다.
ISP configuration parameter format은 `pisp_be_tiles_config` C structure로 정의되며, 각 parameter의 의미는 Raspberry Pi Image Signal Processor(PiSP) Specification document에 설명되어 있습니다.
ISP configuration
101-109ISP configuration은 오직 parameter buffer의 내용으로 설명됩니다. Userspace가 `V4L2 API`로 설정해야 하는 유일한 parameter는 output/capture video device의 image format이며, 이는 parameter buffer 내용의 validation에 사용됩니다.
PiSP BE data flow
raspberrypi-pisp-be.rst:1-109PiSP BE는 DRAM의 input image와 configuration buffer를 받아 tile 기반 processing을 수행하고 두 일반 output, temporal denoise feedback, HDR stitching feedback을 각각 video queue로 노출합니다. Userspace는 feedback output buffer를 대응 input queue로 되돌려야 합니다.