ISP SDK

The topic provides basic information about the Image Signal Processing (ISP) block in JH-7110 and the associated ISP drivers developed under the Linux OS.

Function Introduction

The ISP processor provides algorithms and real-time image information feedback. Since some parameters of the algorithms are initially uncertain, the algorithms must work with adaptive control methods in firmware. The adaptive control method obtains the image information, recalculates related parameter values such as the exposure time and gain, and estimates the parameter values required by the next frame to control the sensor, and ISP logic. This ensures that the image quality is automatically adjusted.

The following diagram shows the operating mode of the ISP.
Figure 1. ISP Operation Mode

The light signals onto the photosensitive area of the sensor. After photoelectric conversion, the sensor transmits Bayer raw images to the ISP. The ISP processes the images based on related algorithms and outputs the images in the Bayer/YUV spatial domain to the firmware and display module. During this process, the ISP controls the sensor by using the firmware and implementing the functions including Automatic Exposure (AE), and Automatic White Balance (AWB). The firmware is driven by the interrupts of the ISP module. The StarFive Tuning Tools adjust the quality of the online images of the ISP over the Ethernet port.

ISP SDK Architecture

The ISP SDK consists of the IOCTL library, device library, control library, module library, sensor library, pipeline library, and ISP flow control application.
Figure 2. ISP SDK Architecture
Table 1. ISP SDK Components
Component Description
IOCTL Library Provides the ISP register read/write and buffer allocate/release functions to service the module unit.

IOCTRL objects are contained in the libCI_User.a file.

Device Library Provides the basic device operations. For example, open, close, ioctl, initiate, allocate buffer, and release buffer.

Device objects are contained in the libISPC.a file.

Control Library Includes the 3A algorithm and other basic algorithms for adaptive control. For example, AE/AWB/SAT. These adaptive controls are based on the ISO and color temperature.

Control objects are contained in the libISPC.a file.

Module Library Provides the parameter conversion and the ISP register program.

Module objects are contained in the libISPC.a file.

Sensor Library Provides the exposure time and sensor gain calculation and program.

Sensor objects are contained in the libSensorapi.a file.

Pipeline Library Provides the device/control/module management.

Pipeline objects are contained in the libISPC.a file.

ISP Control Application (stf_isp_ctrl) Monitors the video device stream on/off and establishes/tears down the pipeline for the ISP adaptive control.
Figure 3. ISP SDK File Structure

ISP Control Application Workflow

The ISP Control application invokes the ISP SDK API to make the ISP hardware keep processing every stream automatically. It uses the SDK library to operate the ISP mainly in the following steps:

  1. Fetch the statistical collection data.
  2. Pass the statistics data to registered controls for the adaptive control.
  3. Loop registered modules to convert the high-level parameters to ISP register values.
  4. Send these register values to kernel driver through the IOCTL command.
  5. Program the ISP.
  6. Return the statistics buffer to video device after completing the registers update.
Figure 4. ISP Control Workflow
The following diagram shows the loop of all registered controls.
Figure 5. Loop of All Registered Controls
The following diagram shows the loop of all registered modules.
Figure 6. Loop of All Registered Modules