Skip to main content

7.3.5 ISP Image System

Overview

AE

The AE algorithm operates by analyzing the histogram to calculate the new exposure value (EV) relative to the AE target set in the calibration. The AE target is dynamically controlled by the algorithm to ensure correct exposure for both low dynamic range (LDR) and high dynamic range (HDR) scenes. For example, in LDR scenes, the AE target will be based on AE_LDR_Target (18% gray target). For HDR scenes, the algorithm dynamically modifies the AE target to prevent overexposure in highlight areas. The local tone mapping engine (Iridix) ensures that shadows are displayed and properly exposed. The HDR target value needs to be calibrated based on the dynamic range of the sensor, and the Iridix engine is used to restore the content in the low-illuminated areas.

Important Concepts

Exposure Time: The time taken for the image sensor to accumulate charge internally, which is the time from the start of exposure until the charge is read out, determining the duration of light exposure for the sensor. The exposure time can be measured in terms of line length.

Exposure Gain: The total amplification factor for the output charge of the sensor, which can be either digital or analog gain. Analog gain introduces slightly less noise, so analog gain is generally preferred.

Basic Principles

The AE algorithm calculates the new EV value by analyzing the histogram statistics and combining it with the calibrated AE target value. To ensure accurate exposure in both low dynamic range and high dynamic range scenes, the algorithm dynamically adjusts the AE target value.

AWB

The AWB module is responsible for color stability because the image sensor's response to neutral tones depends on the lighting conditions of the scene and does not possess the color constancy under different lighting color temperatures as perceived by the human eye, making it particularly apparent in neutral tones such as white and gray. Therefore, the white balance module needs to restore the colors of objects that appear white to the human eye, so that they are also displayed as white in the photos. The AWB algorithm handles a wide range of lighting conditions and spectra to avoid undesirable color casts.

Important Concepts

Color Temperature: The spectral characteristics of the radiation light from a blackbody with a certain surface temperature.

Color Constancy: The tendency of human perception to perceive the surface color of objects as stable even when the illumination conditions change.

Basic Principles

The white balance channel correction is completed based on AWB statistical information and the algorithm's static correction results. The correction results are not updated in the frame data but are instead updated as part of the configuration in the next frame.

Demosaic

The Demosaic unit is responsible for reconstructing a full-color image from the (spatially undersampled) color samples obtained from an image sensor output covered with a color filter array (CFA). In addition, this module provides advanced control for image sharpening.

Digital camera sensor elements can only record the intensity of light falling on them and cannot distinguish between different colors, thus producing only grayscale images. To capture color information, filters must be placed on each pixel sensor, allowing only specific colors of light to pass through. The filters used must be able to reconstruct a full-color image with red, green, and blue (RGB) values for each pixel. The most common type of color filter array is known as the "Bayer array" because the filters are arranged in an RGGB pattern for every 2x2 pixel group.

Half of all pixels are green (G), and one-quarter each are red (R) and blue (B). Green cells in the same row as blue are marked as Gb, and green cells in the same row as red are marked as Gr. The pattern can start with R, Gr, Gb, or B. Bayer Pattern

This arrangement of the color filter essentially results in undersampled color information. The demosaic unit is responsible for reconstructing a full-color image (with R, G, B information for each pixel) from this incomplete color information. Demosaic AlgorithmThe module consists of many filters, which reconstruct the chroma channel based on the interpolated luma channel. It also takes into account the signal-related sensor noise (based on earlier determined noise profile) to maintain sharpness of edges and smoothness of regions while interpolating missing pixel components. Therefore, the interpolation of missing pixel components includes the noise of the sensor. The built-in sharpening minimizes amplification of high-frequency noise.

Sharpen

Also known as backend sharpening, this module is designed to work in synergy with the Sharpen module of the Demosaic module. The sharpening in the Demosaic module controls sharpening in the RGB domain to achieve the required resolution, but excessive sharpening can lead to artifacts and unnatural textures.

Dark areas use the configuration registers: luma thresh low and luma slope low;

Bright areas use the configuration registers: luma thresh high and luma slope high. The following image shows the effect of these four parameters on the sharpening effect:

Gamma

This module encodes the output gamma and is typically set to match the BT.709 or sRGB gamma curves.

This module applies gamma LUT to each of the three (R, G, B) color channels.

In a typical configuration, the LUT consists of 129 uniformly spaced nodes labeled 0...128, and linear interpolation is applied between these nodes in hardware.

Each data value is a 16-bit unsigned integer, so it can be expected that Gamma[0] = 0 and Gamma[128] = 0xFFFF, and the other 127 values define the gamma correction curve.

Note:

Adaptive contrast enhancement is dynamically performed by the Iridix module. The LUT should be statically modified according to the desired output gamma characteristics. Gamma also affects the AE, CCM, and Iridix modules, so these modules need to be revalidated when gamma changes.

Iridix

Iridix® uses local tone mapping for dynamic range compression (DRC) to attempt to recover details from low-visibility areas in HDR scenes without affecting the global image. Overall, it increases the available tone range for local regions by increasing the gain relative to the scene content.

CNR

The CNR module corrects the color of each pixel in the YUV space by intelligently estimating the average chroma of the surrounding pixels, reducing chroma noise in the image. In this process, the module maintains the integrity of the intensity information in the image and only processes its chroma part.

Internally, this module operates in the YUV domain. It first converts the RGB image to the YUV domain, and then further subdivides it based on the color component, separately processing the U and V channels. Finally, it converts the YUV back to the RGB domain.

Note: This YUV is not directly outputted. The CNR module will convert RGB to YUV and output it to IPU or DDR.

The processing for U and V involves applying a Gaussian kernel to each U and V channel in the respective segments and configuring them with corresponding offset or slope parameters. To minimize hardware implementation or reduce the number of large kernels, vertical Gaussian filtering is replaced by emerging recursive filters.

Furthermore, to further reduce area, the color channels are downsampled before processing and upsampled again at the output stage. The output U and V channels are a blend of the processed U and V channels and the original U and V channels, configured by incremental offset or slope parameters. The processed U and V, along with the unprocessed Y, are then converted back to the RGB domain.

CCM

In most cases, standard colors may not provide the best image quality. Depending on the application or customer preference, the CCM module can correct and adjust the colors. This module alters the chromatic values of the image to match the chromatic values of a standard color space.

The module applies linear color correction to the input {R, G, B} or {R, G, B, Ir} pixel values. The coefficient matrix is calculated as follows:

In1, In2, In3, and In4 are the inputs (corresponding to R, G, B, and Ir, respectively), and A11 to A34 are the configurable matrix coefficients. The coefficients are 13-bit values in the s4.8 fixed-point format, with the MSbit (12 bits) as the sign bit. The MSbit (12 bits) for negative values is set to 1.

Note: If the CFA pattern is RGGB, the IR coefficient and the IR channel offset must be set to zero.

Sinter

Sinter® is an advanced spatial noise reduction module that combines a set of algorithms to suppress sensor noise. The filter operates in the RAW data domain and effectively reduces the noise perceived by the human eye in the image while maintaining texture and details, resulting in more natural-looking processed images.

The module can be simplified by using an externally generated sensor Noise Profile LUT. Once the LUT table is correctly configured, the module can be controlled with a minimal set of registers. In most cases, only the Sinter:Thresh Long and Sinter:Thresh Short registers need to be modified to adjust the strength of the noise filter.

The Sinter:Thresh Long and Sinter:Thresh Short registers correspond to long exposure and short exposure, respectively, for WDR mode. When the exposure ratio is 1 or WDR mode is disabled, the Sinter:Thresh Long and Sinter:Thresh Short should be set to the same value. The thresholds are determined from images captured with various ISO values during a standard calibration process and modulated by the system gain. If the image is created using frame-switching, these values should be set accordingly based on the exposure ratio.

Temper

The Temper module is a motion-adaptive temporal noise filter. It recursively averages the current frame with previous historical frames based on the level of local motion detected in the current frame. The filter works in the RAW domain and requires two frames of external storage with a data width of video width + 4 bits.

Note: The video width is larger in WDR mode.

The recursion depth can be adjusted by increasing or decreasing the Recursion_Limit, which in turn affects the number of effective frames used for recursive averaging. Increasing this parameter will result in a smaller recursion depth, smaller denoising effect, and minimum motion artifacts.

When the Recursion_Limit is set to 0, up to 16 frames can be averaged.

When the Recursion_Limit is set to 0xf, no frames are averaged, which is equivalent to disabling Temper.

The threshold of Temper is used to adjust the strength of the Temper noise filter. The performance of this module is ensured by an externally generated sensor Noise Profile LUT. The reference data is stored in DDR through DMA, with 2 read DMAs and 2 write DMAs managing the storage of the reference data.

Mesh Shading

Due to uneven optical refraction of the lens, there can be a phenomenon of a bright center and dark surroundings in the image. Mesh shading correction provides further correction for non-linear color distortion and fine-tunes the effects caused by radial shading correction.

This module applies mesh shading correction to the image using a maximum 64x64 grid. The mesh correction has 3 pages (R/G/B) of correction tables and 4 different modes:

Setting Mesh Alpha Mode = 0

Setting Mesh Alpha Mode = 1

Setting Mesh Alpha Mode = 2

Setting Mesh Alpha Mode = 3

Radial Shading

Radial shading is a correction method for lens shading that corresponds to mesh shading. It corrects the effects of eccentric and elliptical shading using the radial nature of lens shading.

The radial shading coefficients are stored in a 32-bit, 4x129 entry LUT, with coefficients in x.12 format where the lower 12 bits represent the decimal portion. For each color plane, the coefficients are stored from the center to the outer edge.

Color Space Conversion

This module converts the input {R, G, B} pixel values to {Y, U, V} values using standard 3x3 matrix multiplication and vector offset. If the conversion is not activated, the ISP outputs pixel in RGB format.

If needed, the parameters can be modified to provide different conversions. Taking BT.709 as an example, the formula is as follows:

The corresponding parameters in the calibration for RGB2YUV_CONVERSION are as follows:

Where, if the coefficients (Coefft11, Coefft12, Coefft13, Coefft21, Coefft22, Coefft23, Coefft31, Coefft32, Coefft33) are positive, the corresponding parameters in calibration are Coefft11 * 256 rounded to the nearest integer; if the coefficients are negative, the corresponding parameters in calibration are (|Coefft11 * 256| + 1<<15) rounded to the nearest integer. The parameters in calibration for Coefft01 (Coefft02, Coefft01) are Coefft01 (Coefft02, Coefft01) * 1024 rounded to the nearest integer.

Statistical information

The 3A statistical information includes AWB, AE, and AF.

The statistical information collected by the AWB module is used for software white balance adjustment. It accumulates area-level R/G and B/G statistical information and also collects frame-level statistical information.

The AE automatic exposure statistical information is used to adjust sensor exposure. This is done by collecting 5-bin and 1024-bin histograms.

The AF module calculates the statistical sharpness value in the image. Software uses this value/statistical information to adjust the lens for optimal focus in the region of interest (ROI). This module computes edge values for both the region and the entire image.

The ISP provides programmable markers for each statistical module.

AWB Statistical Information

AWB has both global and area statistical information.

Global statistical information: the mean values of R/G and B/G for the entire image and the number of valid statistical points.

Area statistical information: supports up to 33x33 blocks in the image, with each block outputting the mean values of R/G, B/G, and the number of valid statistical points.

The AWB_stats_mode register can be used to configure the type of mean: R/G, B/G, or G/R, G/B.

Through register configuration, valid pixels can be limited:

The values Cb_Ref_Min/Max and Cr_Ref_Min/Max limit the maximum and minimum values of R/G and B/G.

Additionally, Cb_Ref_Low/High and Cr_Ref_Low/High can be used to limit a smaller range of R/G and B/G.

Global statistical information is stored in three registers: AWB RG, AWB BG, and SUM.

Area statistical information:

AE Statistical Information

Automatic exposure (AE) statistical information is collected after applying black level, white balance, and ISP gain. It includes two types of histograms:5-bin local and global histograms;

1024-bin global histogram;

5-bin histogram

Using adjustable histogram bin boundaries, generate a 5-bin normalized histogram for each region and the entire image. Statistics_Hist_Thresh[i][j] is used to define the intensity threshold between bin i and bin j.

Statistics_Hist[i] provides the globally normalized pixel count for bin i, with the sum normalized to 0xFFFF.

The histogram that does not provide the intermediate bins but can be calculated by software:

The internal table containing Histx data provides the normalized values of the histogram for each region, as shown in the table below for mxn regions. The order of the regions is the raster order starting from the top left corner of the image. For each region, the sum of the histogram data is normalized to 0xFFFF.

Supports up to

33x33 blocks.

1024-bin histogram

Construct a global 1024-bin histogram for the entire image. The global histogram can be weighted for regions but is not normalized. ISP Firmware performs the normalization of the statistical data.

AF statistics

Automatic focus (AF) statistics consist of the region of interest (ROI) or region-based, normalized contrast indicators of the entire image. The CPU uses this contrast measure to determine the position of the lens for optimal focusing.

The sharpness evaluation function of the AF statistics module calculates the contrast in four directions of each pixel, as shown in the following figure:

It should be noted that the AF statistics module does not support modifying the coefficients of the sharpness evaluation function. Users can modify the kernel to change the pixel position for sharpness calculation to adapt to different scenes. The sharpness calculation under different kernels of the AF statistics module is shown in the following figure.

For the AF module, the regions can be configured by software. The module calculates the contrast measure for each pixel in the region and accumulates it over the entire region. For each pixel, the contrast is calculated along the four directions. In addition, kernel selection configuration parameters can be used to control the angular direction of the diagonals, as shown in the table above. To improve the response under low light and low-pass imaging conditions, the calculated contrast is in four levels (sum of four contrasts).

These region measure standards are not weighted in the hardware, but the software can apply region-based weights after calculation.

The following figure shows that the best focusing can be achieved when the AF contrast indicator reaches its maximum point:

AF measure data calculation

The accumulated contrast measure standards for each region are stored in a floating-point format with 16-bit mantissa and 5-bit exponent. In addition to the contrast indicator, we also accumulate the squared image and fourth power image data in that region, as shown in the following figures. The value I2 refers to the sum of squares of the differences between the pixel values in the four directions shown in Figure 1, and I4 refers to the sum of fourth powers of the differences between the pixel values in the four directions in Figure 1. E4 refers to the accumulation of the fourth powers of the pixel differences under four kernels, as shown in Figure 2. The 16-bit mantissa stores the mantissa, and the 5-bit exponent stores the exponent. Register1 and Register2 are combined to form a 64-bit value. Users do not need to calculate it directly but can directly obtain the cv value using HB_ISP_GetMeteringData.

The statistical information accumulated for each region is shown in the following table:

The AF region data is stored in the following format:

In addition to the region statistics, AF also accumulates the normalized fourth edge sum, which is stored in a 32-bit register.

Auto Level Statistics

1024-bin statistics data provided by the iridix module.

Average Brightness and Variance Statistics

Statistics information on the average brightness of the YUV domain and the variance of the average brightness provided by the ISP. This module always uses a fixed region size of 32x16 (horizontal x vertical), and the minimum frame resolution required for the available results from this statistical module is 512x256. These statistics are stored in the SRAM at 512 locations, with each location containing the 10-bit (LSB) average value information and 12-bit (MSB) variance information of the average brightness for each region. The storage format is 10 bits reserved + 12 bits brightness variance + 10 bits average brightness.

Functional Description

Interactive Data

Algorithm Library and ISP Firmware Interaction Diagram

The contents in MEM are divided into two parts: data provided to the algorithm library and values passed from the algorithm library to the ISP driver. If the AWB in the ISP driver receives values from algorithm configuration, it will update the ISP register space.

  • This is the context (corresponding to a sensor), and there are multiple sets of data structures for multiple sensors.

  • The yellow blocks are replaceable parts, the Algo Lib needs several callback interfaces (see "API Reference" section), and also requires some input and output data (see "Data Structures" section).

  • The Sensor Driver includes commonly used sensor gain and exposure configuration methods, which generally do not need to be modified.

Interaction Data between Algorithm Library and ISP Firmware

ModuleISP Fw -> Algorithm LibraryAlgorithm Library -> ISP Fw
AEstats_data[ISP_FULL_HISTOGRAM_SIZE]ae_exposure
histogram_sumae_exposure_ratio
hist4[33 * 33]frame_id
AWBstats_data[MAX_AWB_ZONES]awb_red_gain
curr_AWB_ZONESawb_green_even_gain
awb_green_odd_gain
awb_blue_gain
temperature_detected
p_high
light_source_candidate
awb_warming[3]
mix_light_contrast
frame_id
AFstats_data[AF_ZONES_COUNT_MAX][2]frame_to_skip
zones_horizaf_position
zones_vertaf_last_sharp
frame_num
skip_cur_frame
zoom_step_info
Gammastats_data[ISP_FULL_HISTOGRAM_SIZE]gamma_gain
frame_id
IridixN/A(using AE statistics data from AE algorithm)strength_target
iridix_dark_enh
iridix_global_DG
iridix_contrast
frame_id

Development Notes

ISP Firmware consists of two parts, the user space and the kernel space. The kernel space Firmware initializes with the system startup, while the user space Firmware (including the default 3A algorithm) is started by the HB_VIN_StartPipe interface. During the Firmware startup process, the external 3A algorithm is chosen as a priority. If there is no registered external 3A algorithm, the default 3A algorithm will be used. Each type of algorithm has two corresponding input parameters - statistical data (stats) and input parameters (input), and one output parameter - output parameters (output). After the statistical data for each frame is ready, the ISP Firmware calls the proc_func callback function and passes in the two input parameters. The proc_func is the actual algorithm implementation, and after the algorithm calculation, the output parameters should be filled. The ISP Firmware will then apply the output parameters to the Sensor or ISP hardware.

AE Algorithm Registration

AE registers the callback function with the ISP Firmware:

FromUser ImplementationTo
AELIBinit_funcISP Firmware
proc_func
deinit_func

Interface Description:

Callback FunctionDescription
init_funcAlgorithm initialization function
proc_funcActual algorithm implementation, such as target and exposure calculation. Called by ISP Firmware when the AE statistical data for each frame is ready. The proc_func passes the input parameters and the parameters to be passed out. See Structural Description for details.
deinit_funcAlgorithm deinitialization function

AWB Algorithm Registration

AWB registers the callback function with the ISP Firmware:

FromUser ImplementationTo
AWBLIBinit_funcISP Firmware
proc_func
deinit_func

Interface Description:

Callback FunctionDescription
init_funcAlgorithm initialization function
proc_funcActual algorithm implementation. Called by ISP Firmware when the AWB statistical data for each frame is ready. The proc_func passes the input parameters and the parameters to be passed out. See Structural Description for details.
deinit_funcAlgorithm deinitialization function

AF Algorithm Registration

AF registers callback functions to ISP Firmware:

FromUser implementationTo
AFLIBinit_funcISP Firmware
proc_func
deinit_func

Interface description:

Callback functionDescription
init_funcAlgorithm initialization function
proc_funcActual algorithm implementation, called by ISP Firmware when AF statistics data is ready for each frame. See structure description for input and output parameters
deinit_funcAlgorithm de-initialization function

Example of algorithm registration

Taking AWB algorithm as an example:

ISP_AWB_FUNC_S stAwbFunc = {

.init_func = awb_init_func,

.proc_func = awb_proc_func,

.deinit_func = awb_deinit_func,

};

HB_ISP_AWBLibRegCallback(0, "libawb.so", &stAwbFunc);

void *awb_init_func(uint32_t ctx_id)

{

pr_info("ctx id is %d", ctx_id);

return NULL;

}

int32_t awb_proc_func(void *awb_ctx, awb_stats_data_t *stats, awb_input_data_t *input, awb_output_data_t *output)

{
awb_acamera_core_obj_t *p_awb_core_obj = (awb_acamera_core_obj_t *)awb_ctx;awb_acamera_input_t *p_acamera_input = (awb_acamera_input_t *)input->acamera_input;

awb_calibration_data_t *p_cali_data = &( p_acamera_input->cali_data );

awb_acamera_output_t *p_acamera_output = (awb_acamera_output_t *)output->acamera_output;

// Specific algorithm implementation, input and statistical data are passed for calculation

awb_calc_avg_weighted_gr_gb_mesh( p_awb_core_obj, stats, input );

awb_detect_light_source( p_awb_core_obj );

awb_calculate_warming_effect( p_awb_core_obj, p_cali_data );

// Assign calculation results to output parameters

p_acamera_output->rg_coef = p_awb_core_obj->rg_coef;

p_acamera_output->bg_coef = p_awb_core_obj->bg_coef;

p_acamera_output->temperature_detected = p_awb_core_obj->temperature_detected;

p_acamera_output->p_high = p_awb_core_obj->p_high;

p_acamera_output->light_source_candidate = p_awb_core_obj->light_source_candidate;

memcpy( p_acamera_output->awb_warming, p_awb_core_obj->awb_warming, sizeof( p_acamera_output->awb_warming ) );

p_acamera_output->awb_converged = p_awb_core_obj->awb_converged;

return 0;

}

int32_t awb_deinit_func(void *awb_ctx)

{

pr_info("done");

return 0;

}

API Reference

HB_ISP_SetFWState/HB_ISP_GetFWState【Function Declaration】

int HB_ISP_SetFWState(uint8_t pipeId, const ISP_FW_STATE_E enState);

int HB_ISP_GetFWState(uint8_t pipeId, ISP_FW_STATE_E *penState);

【Function Description】

Set/Get the state of ISP Firmware.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
penStateISP Firmware stateInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetRegister/HB_ISP_GetRegister

【Function Declaration】

int HB_ISP_SetRegister(uint8_t pipeId, uint32_t u32Addr, uint32_t u32Value);

int HB_ISP_GetRegister(uint8_t pipeId, uint32_t u32Addr, uint32_t *pu32Value);

【Function Description】

Set/Get ISP register.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
u32AddrISP register addressInput
u32ValueValue to setInput

【Return Value】| Parameter name | Description | Input/Output | |----------------|---------------------------------|--------------| | pipeId | Pipeline index number | Input | | cname | Calibration library information | Input |

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Important points】

【Reference code】

HB_ISP_SetModuleControl/ HB_ISP_GetModuleControl

【Function declaration】

int HB_ISP_SetModuleControl(uint8_t pipeId, const ISP_MODULE_CTRL_U *punModCtrl);

int HB_ISP_GetModuleControl(uint8_t pipeId, ISP_MODULE_CTRL_U *punModCtrl);

【Function description】

Set/get the bypass status of each module inside ISP.

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline index numberInput
punModCtrlBypass control of each module inside ISPInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Important points】

【Reference code】

HB_ISP_SwitchScence

【Function declaration】

int HB_ISP_SwitchScence(uint8_t pipeId, const char *cname);

【Function description】

Set calibration library.

【Parameter description】| Parameter | Description | Input/Output | |------------|---------------------|--------------| | pipeId | Pipeline index number | Input | | cname | Calibration library path | Input |

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_StartI2CBus/HB_ISP_StopI2CBus

【Function Declaration】

int HB_ISP_StartI2CBus(uint8_t pipeId);

void HB_ISP_StopI2CBus(uint8_t pipeId);

【Function Description】

Starts, stops writing to I2C bus.

【Parameter Description】

ParameterDescriptionInput/Output
pipeIdPipeline index numberInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】Before StartI2CBus, HB_ISP_GetSetInit initialization and sensor initialization are required.

【Reference Code】

HB_ISP_SendI2CData

【Function Declaration】

int HB_ISP_SendI2CData(ISP_I2C_DATA_S data);

【Function Description】

Write I2C data.

【Parameter Description】

Parameter NameDescriptionInput/Output
datadata to be sentInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

HB_ISP_StartI2CBus interface should be called before using it to start the I2C write thread.

【Reference Code】

HB_ISP_AELibRegCallback

【Function Declaration】

int HB_ISP_AELibRegCallback(uint8_t pipeId, char *name, ISP_AE_FUNC_S *pstAeFunc);

【Function Description】

Register AE algorithm library.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
nameLibrary name, fixed 20 chars lengthInput, optional
pstAeFuncAE algorithm callback function pointerInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

HB_VIN_StartPipe will start the ISP algorithm and the algorithm registration should be done before calling the HB_VIN_StartPipe function.

【Reference code】see [Algorithm Registration Example](#_Algorithm Registration Example)

HB_ISP_AWBLibRegCallback

【Function declaration】

int HB_ISP_AWBLibRegCallback(uint8_t pipeId, char *name,
ISP_AWB_FUNC_S *pstAWBFunc);

【Function description】

Register the AWB algorithm library.

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline index numberInput
nameLibrary name, fixed 20 charactersInput Reserved item, can be omitted
pstAWBFuncAWB algorithm callback function pointerInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Caution】

HB_VIN_StartPipe will start the ISP algorithm and the algorithm registration should be done before calling the HB_VIN_StartPipe function.

【Reference code】see [Algorithm Registration Example](#_Algorithm Registration Example)

HB_ISP_AFLibRegCallback

【Function declaration】

int HB_ISP_AFLibRegCallback(uint8_t pipeId, char *name,
ISP_AF_FUNC_S *pstAFFunc);

【Function description】

Register the AF algorithm library.

【Parameter description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
nameLibrary name, fixed-copy 20 characters longInput
pstAFFuncAF algorithm callback function pointerInput

【Return value】

Return ValueDescription
0Success
Non-zeroFailure

【Caution】

HB_VIN_StartPipe will start the ISP algorithm, and algorithm registration needs to be done before calling HB_VIN_StartPipe function.

【Reference code】

See [Algorithm Registration Example](#_Algorithm Registration Example)

HB_ISP_AELibUnRegCallback

【Function Declaration】

int HB_ISP_AELibUnRegCallback(uint8_t pipeId);

【Description】

Unregister AE algorithm library.

【Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Caution】

【Reference code】

HB_ISP_AWBLibUnRegCallback

【Function Declaration】

int HB_ISP_AWBLibUnRegCallback(uint8_t pipeId);

【Description】

Unregister the AWB algorithm library.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_AFLibUnRegCallback

【Function Declaration】

int HB_ISP_AFLibUnRegCallback(uint8_t pipeId);

【Description】

Unregister the AF algorithm library.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

Note:

  1. If using the default 3A algorithm, there is no need to concern yourself with the interfaces in this chapter.

  2. Zoom and aperture control algorithms are not included. Users can implement their own and provide output parameters to modify the ISP (Image Signal Processor) firmware for adaptation.

HB_ISP_GetSetInit/HB_ISP_GetSetExit

【Function Declaration】

int HB_ISP_GetSetInit(void);

int HB_ISP_GetSetExit(void);

【Description】

Initialization before getting/setting parameters.

【Parameter Description】None

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

Only need to call once in the same process, before calling all Get/Set functions, first call HB_ISP_GetSetInit for initialization.

【Reference Code】

HB_ISP_SetAeAttr/HB_ISP_GetAeAttr

【Function Declaration】

int HB_ISP_SetAeAttr(uint8_t pipeId, const ISP_AE_ATTR_S *pstAeAttr);

int HB_ISP_GetAeAttr(uint8_t pipeId, ISP_AE_ATTR_S *pstAeAttr);

【Description】

Set AE algorithm attributes.

【Parameter Description】| Parameter Name | Description | Input/Output | |----------------|------------------|--------------| | pipeId | Pipeline index | Input | | pstAeAttr | Pointer to AE parameters | Input |

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

set is only for manual mode, when getting different modes, pass the corresponding mode value.

【Reference Code】

HB_ISP_SetAfAttr/HB_ISP_GetAfAttr

【Function Declaration】

int HB_ISP_SetAfAttr(uint8_t pipeId, ISP_AF_ATTR_S *pstAfAttr);

int HB_ISP_GetAfAttr(uint8_t pipeId, ISP_AF_ATTR_S *pstAfAttr);

【Function Description】

Set AF-ZOOM attribute.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstAfAttrPointer to AF parametersInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetAwbAttr/HB_ISP_GetAwbAttr【Function Declaration】

int HB_ISP_SetAwbAttr(uint8_t pipeId, const ISP_AWB_ATTR_S *pstAwbAttr);

int HB_ISP_GetAwbAttr(uint8_t pipeId, ISP_AWB_ATTR_S *pstAwbAttr);

【Description】

Set AWB algorithm attributes.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAwbAttrPointer to AWB parametersInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

Set is only for manual mode. When getting, pass different modes to obtain corresponding values.

【Referenced Code】

HB_ISP_SetBlackLevelAttr/HB_ISP_GetBlackLevelAttr

【Function Declaration】

int HB_ISP_SetBlackLevelAttr(uint8_t pipeId, const ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);

int HB_ISP_GetBlackLevelAttr(uint8_t pipeId, ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);

【Description】

Set black level attributes.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstBlackLevelAttrPointer to black level parameterInput
 
[Return Values]
Return ValueDescription
0Success
Non-zeroFailure

[Note]

Set is only applicable to manual mode. When getting, different modes can be passed to obtain the corresponding values.

In auto mode, the black_level value is interpolated based on the current exposure gain using calibration parameters BLACK_LEVEL_B/BLACK_LEVEL_GB/BLACK_LEVEL_GR/BLACK_LEVEL_R.

In manual mode, the black_level value can be set by the user.

[Reference Code]

HB_ISP_SetDemosaicAttr/HB_ISP_GetDemosaicAttr

[Function Declaration]

int HB_ISP_SetDemosaicAttr(uint8_t pipeId, const
ISP_DEMOSAIC_ATTR_S *pstDemosaicAttr);

int HB_ISP_GetDemosaicAttr(uint8_t pipeId,
ISP_DEMOSAIC_ATTR_S *pstDemosaicAttr);

[Functional Description]

Set demosaic module attributes.

[Parameter Description]

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstDemosaicAttrPointer to demosaic parametersInput

[Return Values]

Return ValueDescription
0Success
Non-zeroFailure

[Note]

HB_ISP_SetSharpenAttr/HB_ISP_GetSharpenAttr

【Function declaration】

int HB_ISP_SetSharpenAttr(uint8_t pipeId, const
ISP_SHARPEN_ATTR_S *pstSharpenAttr);

int HB_ISP_GetSharpenAttr(uint8_t pipeId,
ISP_SHARPEN_ATTR_S *pstSharpenAttr);

【Description】

Set the sharpen attribute.

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline indexInput
pstSharpenAttrPointer to sharpen attributeInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Notes】

【Reference code】

HB_ISP_SetGammaAttr/HB_ISP_GetGammaAttr

【Function declaration】

int HB_ISP_SetGammaAttr(uint8_t pipeId, const
ISP_GAMMA_ATTR_S *pstGammaAttr);

int HB_ISP_GetGammaAttr(uint8_t pipeId,
ISP_GAMMA_ATTR_S *pstGammaAttr);

【Description】

Set the gamma attribute.

【Parameter description】| Parameter Name | Description | Input/Output | |--------------|---------------------|-----------| | pipeId | Pipeline Index | Input | | pstGammaAttr | Pointer to Gamma Parameters | Input |

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

【Reference Code】

HB_ISP_SetIridixAttr/HB_ISP_GetIridixAttr

【Function Declaration】

int HB_ISP_SetIridixAttr(uint8_t pipeId, const ISP_IRIDIX_ATTR_S *pstIridixAttr);

int HB_ISP_GetIridixAttr(uint8_t pipeId,
ISP_IRIDIX_ATTR_S *pstIridixAttr);

【Function Description】

Set Iridix module attributes.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline IndexInput
pstIridixAttrPointer to Iridix ParametersInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

【Reference Code】

HB_ISP_SetIridixStrengthLevel/HB_ISP_GetIridixStrengthLevel

【Function Declaration】

int HB_ISP_SetIridixStrengthLevel(uint8_t pipeId, uint16_t level);

int HB_ISP_GetIridixStrengthLevel(uint8_t pipeId, uint16_t *level);

【Function Description】

Set the Iridix strength level.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
levelStrength level, range [0, 255]Input

【Return Value】

Return ValueDescription
0Success
non-zeroFailure

【Note】

【Reference Code】

HB_ISP_SetCnrAttr/HB_ISP_GetCnrAttr

【Function Declaration】

int HB_ISP_SetCnrAttr(uint8_t pipeId, const ISP_CNR_ATTR_S *pstCnrAttr);

int HB_ISP_GetCnrAttr(uint8_t pipeId, ISP_CNR_ATTR_S *pstCnrAttr);

【Function Description】

Set the chroma noise reduction module attributes.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstCnrAttrPointer to chroma noise reduction parametersInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetSinterAttr/HB_ISP_GetSinterAttr

【Function Declaration】

int HB_ISP_SetSinterAttr(uint8_t pipeId, const ISP_SINTER_ATTR_S *pstSinterAttr);

int HB_ISP_GetSinterAttr(uint8_t pipeId,
ISP_SINTER_ATTR_S *pstSinterAttr);

【Function Description】

Set the attributes of the spatial noise reduction module.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstSinterAttrPointer to the spatial noise reduction parameterInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetTemperAttr/HB_ISP_GetTemperAttr

【Function Declaration】

int HB_ISP_SetTemperAttr(uint8_t pipeId, const
ISP_TEMPER_ATTR_S *pstTemperAttr);

int HB_ISP_GetTemperAttr(uint8_t pipeId,
ISP_TEMPER_ATTR_S *pstTemperAttr);

【Function Description】【Setting the temporal domain denoising module properties】

【Parameter description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstTemperAttrPointer to denoising parameters in the temporal domainInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Notes】

【Reference code】

HB_ISP_SetMeshShadingAttr/HB_ISP_GetMeshShadingAttr

【Function declaration】

int HB_ISP_SetMeshShadingAttr(uint8_t pipeId, const
MESH_SHADING_ATTR_S *pstMeshShadingAttr);

int HB_ISP_GetMeshShadingAttr(uint8_t pipeId,
MESH_SHADING_ATTR_S *pstMeshShadingAttr);

【Function description】

Set the properties of the Mesh Shading module.

【Parameter description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstMeshShadingAttrPointer to Mesh Shading parametersInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Notes】

HB_ISP_SetMeshShadingLUT/HB_ISP_GetMeshShadingLUT

【Function Declaration】

int HB_ISP_SetMeshShadingLUT(uint8_t pipeId, const
MESH_SHADING_LUT_S *pstMeshShadingLUT);

int HB_ISP_GetMeshShadingLUT(uint8_t pipeId, MESH_SHADING_LUT_S *pstMeshShadingLUT);

【Function Description】

Set the LUT table of the Mesh Shading module.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstMeshShadingLUTPointer to the MeshShading LUT tableInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetRadialShadingAttr/HB_ISP_GetRadialShadingAttr

【Function Declaration】

int HB_ISP_SetRadialShadingAttr(uint8_t pipeId, const
RADIAL_SHADING_ATTR_S *pstRadialShadingAttr);

int HB_ISP_GetRadialShadingAttr(uint8_t pipeId,
RADIAL_SHADING_ATTR_S *pstRadialShadingAttr);

【Function Description】

Set the attributes of the Radial Shading module.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstRadialShadingAttrPointer to Radial Shading parametersInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetRadialShadingLUT/HB_ISP_GetRadialShadingLUT

【Function Declaration】

int HB_ISP_SetRadialShadingLUT(uint8_t pipeId, const
RADIAL_SHADING_LUT_S *pstRadialShadingLUT);

int HB_ISP_GetRadialShadingLUT(uint8_t pipeId,
RADIAL_SHADING_LUT_S *pstRadialShadingLUT);

【Function Description】

Set the LUT table for Radial Shading module.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstRadialShadingLUTPointer to Radial Shading LUT tableInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetCSCAttr/HB_ISP_GetCSCAttr

【Function Declaration】

int HB_ISP_SetCSCAttr(uint8_t pipeId, const ISP_CSC_ATTR_S *pstCSCAttr);

int HB_ISP_GetCSCAttr(uint8_t pipeId, ISP_CSC_ATTR_S *pstCSCAttr);

【Function Description】

Set the attributes of the Color Space Conversion (CSC) module.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstCSCAttrPointer to CSC attributesInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】

HB_ISP_SetSceneModesAttr/HB_ISP_GetSceneModesAttr

【Function Declaration】

int HB_ISP_SetSceneModesAttr(uint8_t pipeId, const ISP_SCENE_MODES_ATTR_S *pstSceneModesAttr);

int HB_ISP_GetSceneModesAttr(uint8_t pipeId, ISP_SCENE_MODES_ATTR_S *pstSceneModesAttr);

【Function Description】

Set the scene modes.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstSceneModesAttrPointer to scene mode parametersInput

【Return Value】 Translate the Chinese parts in the following content into English while preserving the original format and content:

Return ValueDescription
0Success
Non-zeroFailure

【Precautions】

【Reference Code】

HB_ISP_SetAwbZoneInfo/HB_ISP_GetAwbZoneInfo

【Function Declaration】

int HB_ISP_GetAwbZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S *awbZoneInfo);

int HB_ISP_SetAwbZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S awbZoneInfo);

【Description】

Get/Set AWB zone information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
awbZoneInfoPointer to AWB zone information (for Get); AWB zone information data structure (for Set)Input

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Precautions】None

【Reference Code】None

HB_ISP_SetAfZoneInfo/HB_ISP_GetAfZoneInfo

【Function Declaration】

int HB_ISP_GetAfZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S *afZoneInfo);

int HB_ISP_SetAfZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S *afZoneInfo);

【Description】Access/Set AF zones information.

[Parameter Description]

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
afZoneInfoPointer to AF zones information (for getting); AF zones information data structure (for setting)Input

[Return Value]

Return ValueDescription
0Success
Non-zeroFailure

[Notes] None

[Reference Code] None

HB_ISP_SetAe5binZoneInfo/HB_ISP_GetAe5binZoneInfo

[Function Declaration]

int HB_ISP_GetAe5binZoneInfo(uint8_t pipeId,
ISP_ZONE_ATTR_S *ae5binZoneInfo);

int HB_ISP_SetAe5binZoneInfo(uint8_t pipeId,
ISP_ZONE_ATTR_S ae5binZoneInfo);

[Function Description]

Access/Set AE 5bin zones information.

[Parameter Description]

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
ae5binZoneInfoPointer to AE 5bin zones information (for getting); AE 5BIN zones information data structure (for setting)Input

[Return Value]

Return ValueDescription
0Success
Non-zeroFailure

[Notes]

HB_ISP_SetAfKernelInfo/HB_ISP_GetAfKernelInfo

【Function Declaration】

int HB_ISP_GetAfKernelInfo(uint8_t pipeId, uint32_t *af_kernel);

int HB_ISP_SetAfKernelInfo(uint8_t pipeId, uint32_t af_kernel);

【Description】

Get/Set AF KERNEL information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
af_kernelPointer to af_kernel pointer (for getting); af_kernel data information (for setting)Input

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

This interface is mainly used for applications to obtain or modify current af statistical data kernel.

【Reference Code】

HB_ISP_SetAeParam/HB_ISP_GetAeParam

Function Declaration

int HB_ISP_SetAeParam(uint8_t pipeId, const ISP_AE_PARAM_S *pstAeParam);

int HB_ISP_GetAeParam(uint8_t pipeId, ISP_AE_PARAM_S *pstAeParam);

Function Description

Sets/gets AE parameter information, including line and total gain.

Parameter Descriptions

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstAeParamPointer to AE parameter structureInput

Return Values

Return ValueDescription
0Success
Non-zeroFailure

Cautionary Notes

Reference Code: None

HB_ISP_SetAeRoiInfo/HB_ISP_GetAeRoiInfo

Function Declaration

int HB_ISP_SetAeRoiInfo(uint8_t pipeId, ISP_AE_ROI_ATTR_S aeRoiInfo);

int HB_ISP_GetAeRoiInfo(uint8_t pipeId, ISP_AE_ROI_ATTR_S *aeRoiInfo);

Function Description

Sets the ROI (Region of Interest) weight area for AE, allowing dynamic calls.

Parameter Descriptions

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
aeRoiInfoROI attribute structureOutput

Return Values

Return ValueDescription
0Success
Non-zeroFailure

Cautionary Note

The ROI region setting is independent from the 3A-AE ROI weighting setup. Only one of these functions can be used at any given time.

Reference Code: None

HB_ISP_SetAwbStatAreaAttr / HB_ISP_GetAwbStatAreaAttr

Function Declaration

int HB_ISP_GetAwbStatAreaAttr(uint8_t pipeId, ISP_AWB_STAT_AREA_ATTR_S *pstAwbStatAreaAttr);

int HB_ISP_SetAwbStatAreaAttr(uint8_t pipeId, ISP_AWB_STAT_AREA_ATTR_S *pstAwbStatAreaAttr);

Function Description

Sets or retrieves the AWB statistical data area range.

Parameter Descriptions

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAwbStatAreaAttrStatistical data area range parametersOutput

Return Values

Return ValueDescription
0Success
Non-zeroFailure

Cautionary Notes

Reference Code: None provided (since this is a function description rather than actual code)

HB_ISP_GetAeFullHist

【Function Declaration】

int HB_ISP_GetAeFullHist(uint8_t pipeId, uint32_t *pu32AeFullHist);

【Description】

Get AE statistical data.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pu32AeFullHistPointer to AE statistical dataOutput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

This interface is mainly for application use. If some strategy judgments are made based on statistical information, the 3A algorithm library does not need to use this interface.

【Reference Code】

#define HB_ISP_FULL_HISTOGRAM_SIZE 1024

int i;

uint32_t ae[HB_ISP_FULL_HISTOGRAM_SIZE];

memset(ae, 0, sizeof(ae));

HB_ISP_GetAeFullHist(0, ae);

printf("\n--AE--\n");

for (i = 0; i \< HB_ISP_FULL_HISTOGRAM_SIZE; i++) {

printf("%-8d ", ae[i]);

if ((i + 1) % 8 == 0)

printf("\n");

}

HB_ISP_GetAwbZoneHist

【Function Declaration】

int HB_ISP_GetAwbZoneHist(uint8_t pipeId,
ISP_STATISTICS_AWB_ZONE_ATTR_S
*pstAwbZonesAttr);

【Function Description】

Get AWB statistical data.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

This interface is mainly for application use, such as using statistical information for certain strategy judgments. The 3A algorithm library does not need to use this interface.

【Reference Code】

HB_ISP_GetAe5binZoneHist

【Function Declaration】

int HB_ISP_GetAe5binZoneHist(uint8_t
pipeId, ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S
*pst32Ae5bin);

【Function Description】

Gets AE 5bin statistical data.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pst32Ae5binPointer to AE 5bin statistical dataOutput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

This interface is mainly for application use, such as using statistical information for certain strategy judgments. The 3A algorithm library does not need to use this interface.

【Reference Code】


ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S ae_5bin[HB_ISP_MAX_AE_5BIN_ZONES];ISP_ZONE_ATTR_S ae5binZoneInfo;

memset(ae_5bin, 0, sizeof(ae_5bin));

HB_ISP_GetAe5binZoneHist(ctx_idx, ae_5bin);

HB_ISP_GetAfZoneHist

[Function Declaration]

int HB_ISP_GetAfZoneHist(uint8_t pipeId, af_stats_data_t *pstAfZonesAttr);

[Function Description]

Get AF statistics data.

[Parameter Description]

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAfZonesAttrPointer to AF statistics dataOutput

[Return Value]

Return ValueDescription
0Success
Non-zeroFailure

[Notes]

  1. This interface is mainly for application use, such as making certain strategy judgments based on statistical information. The 3A algorithm library does not need to use this interface.

  2. This interface has several data caches. If you want to get real-time data, please use the HB_ISP_GetMeteringData interface to obtain it. HB_ISP_GetMeteringData gets real-time data.

[Reference Code]

uint32_t af_data[HB_ISP_AF_ZONES_COUNT_MAX * 2];

af_stats_data_t af;

ISP_ZONE_ATTR_S afZoneInfo;

memset(af_data, 0, sizeof(af_data));

af.zones_stats = (uint32_t *)&af_data;HB_ISP_GetAfZoneHist(ctx_idx, &af);

HB_ISP_GetMeteringData

【Function Declaration】

int HB_ISP_GetMeteringData(uint8_t pipeId, void *data, ISP_METERING_DATA_TYPE_E type, int latest_flag);

【Description】

Get AF/LUMVAR statistics data.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
dataPointer to AF/LUMVAR statistics dataOutput
typeType of statistics data (AF/LUMVAR)Input
latest_flagFlag indicating whether to get the latest dataInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

  1. The value fv obtained from this interface can be directly used for focusing calculation.

  2. It is not necessary to call the HB_ISP_GetVDTTimeOut frame interrupt interface to obtain the latest value, calling this interface directly will return the latest value.

HB_ISP_GetVDTTimeOut

【Function Declaration】

int HB_ISP_GetVDTTimeOut(uint8_t pipeId, uint8_t vdt_type, uint64_t timeout);

【Description】

Get ISP FRAME_START or FRAME_END information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
vdt_typeSelect for getting ISP frame_start or frame_endInput
timeoutTimeout return timeInput

【Return Value】

Return ValueDescription
0FS/FE Synchronization
Non-zeroTimeout return

【Notes】

This interface is mainly used by applications for timing synchronization.

【Reference Code】None

HB_ISP_GetLumaZoneHist

【Function Declaration】

int HB_ISP_GetLumaZoneHist(uint8_t pipeId, ISP_STATISTICS_LUMVAR_ZONE_ATTR_S
*pst32Luma);

【Function Description】

Get the mean and variance of LUMVAR statistical information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pst32LumaPointer to lumvar statistical informationOutput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】None

HB_ISP_SetAEControl/ HB_ISP_GetAEControl

【Function Declaration】

int HB_ISP_SetAEControl(uint8_t pipeId, const ISP_AE_CONTROL *pstAeControl);

int HB_ISP_GetAEControl(uint8_t pipeId, ISP_AE_CONTROL *pstAeControl);

【Function Description】

Set/Get AE control information

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAeControlPointer to AE control informationInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailed

【Note】

【Reference Code】N/A

HB_ISP_SetAECorrection/ HB_ISP_GetAECorrection

【Function Declaration】

int HB_ISP_SetAECorrection(uint8_t pipeId, const ISP_AE_CORRECTION *pstAeCorrection);

int HB_ISP_GetAECorrection(uint8_t pipeId, ISP_AE_CORRECTION *pstAeCorrection);

【Function Description】

Set/Get AE correction information

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAeCorrectionPointer to AE correction informationInput

【Return Value】

Return ValueDescription
0Success
non-0Failed

【Attention】

【Reference Code】None

HB_ISP_Set_AE_5bin_Hist/ HB_ISP_Get_AE_5bin_Hist

【Function Declaration】

int HB_ISP_Set_AE_5bin_Hist(uint8_t pipeId, const ISP_5BIN_HIST * pAe5binHist);

int HB_ISP_Get_AE_5bin_Hist(uint8_t pipeId, ISP_5BIN_HIST * pAe5binHist);

【Function Description】

Set/Get the 5bin statistical information of AE

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pAe5binHistPointer to AE 5bin statistics informationInput

【Return Value】

Return ValueDescription
0Success
non-0Failed

【Attention】

【Reference Code】None

HB_ISP_SetExposureRatioAdjustment/ HB_ISP_GetExposureRatioAdjustment

【Function Declaration】

int HB_ISP_SetExposureRatioAdjustment(uint8_t pipeId, const ISP_EXP_RATIO_ADJ *pstExpRatioAdj);

int HB_ISP_GetExposureRatioAdjustment(uint8_t pipeId, ISP_EXP_RATIO_ADJ *pstExpRatioAdj);

【Function Description】

Set/Get Exposure Ratio Adjustment

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstExpRatioAdjPointer to ratioInput
of exposure

【Return Value】

Return ValueDescription
0Success
non-zeroFailure

【Notes】

【Reference Code】None

HB_ISP_SetExposurePartitionLuts/ HB_ISP_GetExposurePartitionLuts

【Function Declaration】

int HB_ISP_SetExposurePartitionLuts(uint8_t pipeId, const ISP_EXP_PAT_LUTS
*pstExpPatLuts);

int HB_ISP_SetExposurePartitionLuts(uint8_t pipeId, ISP_EXP_PAT_LUTS
*pstExpPatLuts);

【Function Description】

Set/Get LUT information for exposure partition

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstExpPatLutsPointer to partitionInput
LUT table

【Return Value】

Return ValueDescription
0Success
non-zeroFailure

【注意事项】

【参考代码】无

HB_ISP_SetAwbBgMaxGain/HB_ISP_GetAwbBgMaxGain

【函数声明】

int HB_ISP_SetAwbBgMaxGain(uint8_t pipeId, const ISP_AWB_BG_MAX_GAIN
*pstAwbBgMaxGain) ;

int HB_ISP_GetAwbBgMaxGain(uint8_t pipeId, ISP_AWB_BG_MAX_GAIN
*pstAwbBgMaxGain);

【功能描述】

Set/Get AWB BG maximum gain.

【参数描述】

参数名称描述输入/输出
pipeIdPipeline indexInput
pstAwbBgMaxGainPointer to the maximum gain of AWB BGInput

【返回值】

返回值描述
0Success
Non-zeroFailure

【注意事项】

【参考代码】无

HB_ISP_SetCcmSaturationStrength/ HB_ISP_GetCcmSaturationStrength

【函数声明】

int HB_ISP_SetCcmSaturationStrength(uint8_t pipeId, const ISP_CCM_SATURA_STRENG
*pstCcmSatStre);

int HB_ISP_GetCcmSaturationStrength(uint8_t pipeId, ISP_CCM_SATURA_STRENG
*pstCcmSatStre);

【功能描述】

Set/Get CCM saturation strength information.【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstCcmSatStrePointer to CCM saturation strengthInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】None

HB_ISP_SetCcmMtLs/ HB_ISP_GetCcmMtLs

【Function Declaration】

int HB_ISP_SetCcmMtLs(uint8_t pipeId, const ISP_MT_ABSOLUTE_LS *pstMtAbsoluteLs);

int HB_ISP_GetCcmMtLs(uint8_t pipeId, ISP_MT_ABSOLUTE_LS *pstMtAbsoluteLs);

【Function Description】

Set/Get CCM Mt Ls

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstMtAbsoluteLsPointer to CCM Mt LsInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】None

HB_ISP_SetCcmAttr/HB_ISP_GetCcmAttr【Function Declaration】

int HB_ISP_SetCcmAttr(uint8_t pipeId, const ISP_CCM_ONE_GAIN_THRESHOLD *pstOneGainThreshold);

int HB_ISP_GetCcmAttr(uint8_t pipeId, ISP_CCM_ONE_GAIN_THRESHOLD *pstOneGainThreshold);

【Function Description】

Set/Get CCM attributes

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstOneGainThresholdPointer to CCM attributeInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】 None

【Reference Code】 N/A

HB_ISP_SetGammaEv1/HB_ISP_GetGammaEv1

【Function Declaration】

int HB_ISP_SetGammaEv1(uint8_t pipeId, const ISP_GAMMA_EV1 *pstGammaEv1);

int HB_ISP_GetGammaEv1(uint8_t pipeId, ISP_GAMMA_EV1 *pstGammaEv1);

【Function Description】

Set/Get Gamma Ev1 properties

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstGammaEv1Pointer to Gamma Ev1Input
Return ValueDescription
0Success
Non-zeroFailure

【Notice】

【Reference Code】N/A

HB_ISP_SetGammaEv2 / HB_ISP_GetGammaEv2

【Function Declaration】

int HB_ISP_SetGammaEv2(uint8_t pipeId, const ISP_GAMMA_EV2 *pstGammaEv2);

int HB_ISP_GetGammaEv2(uint8_t pipeId, ISP_GAMMA_EV2 *pstGammaEv2);

【Function Description】

Set/Get the Gamma Ev2 property.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstGammaEv2Pointer to Gamma Ev2Input

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notice】

【Reference Code】N/A

HB_ISP_SetGammaThreshold / HB_ISP_GetGammaThreshold

【Function Declaration】

int HB_ISP_SetGammaThreshold(uint8_t pipeId, const ISP_GAMMA_THRESHOLD *pstGammaThd);

int HB_ISP_GetGammaThreshold(uint8_t pipeId, ISP_GAMMA_THRESHOLD *pstGammaThd);

【Function Description】

Set/Get Gamma threshold

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstGammaThdPointer to Gamma thresholdInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Caution】

【Reference Code】None

HB_ISP_GetEvToLuxStatustAttr/ HB_ISP_SetEvToLuxStatustAttr

【Function Declaration】

int HB_ISP_GetEvToLuxStatustAttr(uint8_t pipeId, uint8_t
*pstEvToLuxStatustAttr);

int HB_ISP_SetEvToLuxStatustAttr(uint8_t pipeId, const uint8_t
*pstEvToLuxStatustAttr);

【Function Description】

Get evtolux attribute

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstEvToLuxStatustAttrPointer to evtolux attributeOutput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Reference code】None

HB_ISP_SetCctCtrlAttr/ HB_ISP_GetCctCtrlAttr

【Function declaration】

int HB_ISP_SetCctCtrlAttr(uint8_t pipeId, const ISP_AWB_CCT_CTRL_S
*pstCctAttr);

int HB_ISP_GetCctCtrlAttr(uint8_t pipeId, ISP_AWB_CCT_CTRL_S *pstCctAttr);

【Description】

Set/Get CCT attributes

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline indexInput
pstCctAttrPointer to CCT attributesInput

【Return value】

ReturnDescription
0Success
Non-zeroFailure

【Notice】

【Reference code】None

HB_ISP_SetAwbAvgCoeff/HB_ISP_GetAwbAvgCoeff

【Function declaration】

int HB_ISP_SetAwbAvgCoeff(uint8_t pipeId, uint8_t Coeff);

int HB_ISP_GetAwbAvgCoeff(uint8_t pipeId, uint8_t *Coeff);

【Description】

Set AWB average coefficients

【Parameter description】

| Parameter name | Description | Input/Output | |--------|-----------------------------| | pipeId | Pipeline index | | Coeff | Pointer to AWB average coefficients, smaller values result in fewer convergence steps, larger values result in more convergence steps |

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Note】

【Reference code】N/A

HB_ISP_SetMixLightAttr/HB_ISP_GetMixLightAttr

【Function declaration】

int HB_ISP_SetMixLightAttr(uint8_t pipeId, const ISP_MIX_LIGHT_PARAM_S
*pstMixLightAttr);

int HB_ISP_GetMixLightAttr(uint8_t pipeId, ISP_MIX_LIGHT_PARAM_S
*pstMixLightAttr);

【Description】

Set MIX LIGHT attributes

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline indexInput
pstMixLightAttrPointer to MIX LIGHT attributesInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Note】

【Reference code】N/A

HB_ISP_SetSkyCtrlAttr/ HB_ISP_GetSkyCtrlAttr

【Function declaration】

int HB_ISP_SetSkyCtrlAttr(uint8_t pipeId, const ISP_SKY_PARAM_S *pstSkyCtrlAttr);

int HB_ISP_GetSkyCtrlAttr(uint8_t pipeId, ISP_SKY_PARAM_S *pstSkyCtrlAttr);

【Function Description】

Set outdoor daylight attributes

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstSkyCtrlAttrPointer to outdoor daylight attributeInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】N/A

HB_ISP_ApiCtrl

【Function Declaration】

int HB_ISP_ApiCtrl(uint8_t pipeId, uint8_t direction, int type, int cmd,
uint32_t *val);

【Function Description】

Api Control

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
directionSet/GetInput
typeMajor TypeInput
cmdMinor TypeInput
valValue for Get/Set operationInput

【Return Value】| Return | Description | |--------|------| | 0 | Success | | Non-zero | Failure |

【Notes】

【Reference code】N/A

HB_ISP_GetTempLut/ HB_ISP_SetTempLut

【Function declaration】

int HB_ISP_GetTempLut(uint8_t pipeId, TEMPER_NP_LUT_S *pstTemperLUT);

int HB_ISP_SetTempLut(uint8_t pipeId, TEMPER_NP_LUT_S *pstTemperLUT);

【Function description】

Set / Get the temper lut table

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline indexInput
pstTemperLUTPointer to the temper lut table.Input

【Return】

ReturnDescription
0Success
Non-zeroFailure

【Notes】

【Reference code】N/A

HB_ISP_SetAwbRgBgWeightAttr/ HB_ISP_GetAwbRgBgWeightAttr

【Function declaration】

int HB_ISP_SetAwbRgBgWeightAttr(uint8_t pipeId, const ISP_MESH_RGBG_WEIGHT_S
*pstWeightAttr);

int HB_ISP_GetAwbRgBgWeightAttr(uint8_t pipeId, ISP_MESH_RGBG_WEIGHT_S
*pstWeightAttr);

【Function description】Setting/Getting AWB RG BG weight table

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstWeightAttrPointer to Plank curve weight tableInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】None

HB_ISP_GetAwbLsWeightAtt/ HB_ISP_SetAwbLsWeightAttr

【Function Declaration】

int HB_ISP_GetAwbLsWeightAttr(uint8_t pipeId, ISP_MESH_LS_WEIGHT_S *pstWeightAttr);

int HB_ISP_SetAwbLsWeightAttr(uint8_t pipeId, const ISP_MESH_LS_WEIGHT_S *pstWeightAttr);

【Function Description】

Setting/Getting AWB LS weight attribute

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstWeightAttrPointer to isolated light sourceInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

HB_ISP_GetAwbDefultParmAttr/ HB_ISP_SetAwbDefultParmAttr

【Function Declaration】

int HB_ISP_GetAwbDefultParmAttr(uint8_t pipeId, ISP_AWB_DEFAULT_PARAM_S
*pstAwbAttr);

int HB_ISP_SetAwbDefultParmAttr(uint8_t pipeId, const ISP_AWB_DEFAULT_PARAM_S
*pstAwbAttr);

【Description】

Set/Get the CALIBRATION_CT30POS parameter

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAwbAttrPointer to the awb U30 array idInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

【Reference Code】N/A

HB_ISP_SetAwbColorTempWeightAttr/ HB_ISP_GetAwbColorTempWeightAttr

【Function Declaration】

int HB_ISP_SetAwbColorTempWeightAttr(uint8_t pipeId, const
ISP_MESH_COLOR_TEMP_WEIGHT_S *pstWeightAttr);

int HB_ISP_GetAwbColorTempWeightAttr(uint8_t pipeId,
ISP_MESH_COLOR_TEMP_WEIGHT_S *pstWeightAttr);

【Description】

Set/Get the CALIBRATION_MESH_COLOR_TEMPERATURE attribute

【Parameter Description】| Parameter Name | Description | Input/Output | |----------------|-------------------------|--------------| | pipeId | Pipeline index number | Input | | pstWeightAttr | Pointer to the weight table for color temperature | Input |

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

【Reference Code】N/A

HB_ISP_SetAwbPosStatusAttr/ HB_ISP_GetAwbPosStatusAttr

【Function Declaration】

int HB_ISP_SetAwbPosStatusAttr(uint8_t pipeId, const ISP_AWB_POS_STATUS_S *pstPosAttr);

int HB_ISP_GetAwbPosStatusAttr(uint8_t pipeId, ISP_AWB_POS_STATUS_S *pstPosAttr);

【Function Description】

Set/Get AWB position status

CALIBRATION_RG_POS

CALIBRATION_BG_POS

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstPosAttrPointer to rgain/bgain arrayInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】【Reference code】None

HB_ISP_SetAwbLightSourceAttr/ HB_ISP_GetAwbLightSourceAttr

【Function declaration】

int HB_ISP_SetAwbLightSourceAttr(uint8_t pipeId, const ISP_AWB_LIGHT_SOURCE_S *pstLightAttr);

int HB_ISP_GetAwbLightSourceAttr(uint8_t pipeId, ISP_AWB_LIGHT_SOURCE_S *pstLightAttr);

【Description】

Set/get awb light source attributes

COLOR_TEMP

CT_RG_POS_CALC

CT_BG_POS_CALC

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline indexInput
pstLightAttrPointer to light source attributeInput

【Return value】

Return valueDescription
0Success
Non-zeroFailure

【Notes】

【Reference code】None

HB_ISP_GetWdrOffsetAttr/ HB_ISP_SetWdrOffsetAttr

【Function declaration】

int HB_ISP_GetWdrOffsetAttr(uint8_t pipeId, ISP_WDR_OFFSET_S *pstWdrOffsetAttr);

int HB_ISP_SetWdrOffsetAttr(uint8_t pipeId, ISP_WDR_OFFSET_S *pstWdrOffsetAttr);【Function Description】

Set/Get WDR Offset Attribute

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstWdrOffsetAttrPointer to WDR offset attributeInput

【Return Value】

Return ValueDescription
0Success
NonzeroFailure

【Notes】

【Reference Code】None

HB_ISP_SetHdrAexpTypeAttr

【Function Declaration】

int HB_ISP_SetHdrAexpTypeAttr(uint8_t pipeId, ISP_HDR_AEXP_S *pstAexpTypeAttr,
uint32_t scale_bottom, uint32_t scale_top);

【Function Description】

Set HDR AE1024bin weight attribute

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAexpTypeAttrSelect long and short framesInput
scale_bottomScaling at low binInput
scale_topStop at high binInput

【Return Value】

Return ValueDescription
0Success
NonzeroFailure

【参考代码】无

HB_ISP_GetAfStatus

【函数声明】

int HB_ISP_GetAfStatus(uint8_t pipeId, ISP_AF_STATUS_E *pstAfStatusAttr);

【功能描述】

获取af状态

【参数描述】

参数名称描述输入/输出
pipeIdPipeline index输入
pstAfStatusAttrPointer to AF status输出

【返回值】

返回值描述
0成功
Nonzero失败

【注意事项】

【参考代码】无

HB_ISP_GetAfInfo

【函数声明】

int HB_ISP_GetAfInfo(uint8_t pipeId, ISP_AF_LENS_INFO_S *ptrLenInfo);

【功能描述】

获取af信息

AF_MANUAL_CONTROL

AF_RANGE_LOW

AF_RANGE_HIGH

【参数描述】| Parameter Name | Description | Input/Output | |----------------|-----------------------------|--------------| | pipeId | Pipeline index number | Input | | ptrLenInfo | Pointer to af information | Output |

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Sample Code】N/A

HB_ISP_SetAfManualPos

【Function Declaration】

int HB_ISP_SetAfManualPos(uint8_t pipeId, ISP_AF_MODE_E stAfModeAttr, uint32_t pos);

【Function Description】

Set af mode

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
stAfModeAttrPointer to af mode typeInput
posEffective only in manual modeInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Sample Code】N/A

HB_ISP_SetFlickerStatus/HB_ISP_GetFlickerStatus

【Function Declaration】

int HB_ISP_SetFlickerStatus(uint8_t pipeId, uint32_t flicker_enable, uint32_t flicker_frequency);

int HB_ISP_GetFlickerStatus(uint8_t pipeId, uint32_t *flicker_enable, uint32_t flicker_frequency);

【Function Description】

Set/Get flicker status

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
flicker_enableEnable flickerInput
flicker_frequencyflicker frequencyInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

flicker_frequency is the frequency value, e.g., input 50 for 50Hz and input 60 for 60Hz. Under 50Hz, flicker limits the exposure time to 10ms. If the exposure time is less than 10ms due to high brightness of the light source, flicker will not be increased to 10ms again. You can use HB_ISP_SetAeMinIntertime(uint8_t pipeId, uint32_t stAeMinTime) to fix the minimum time at 10ms.

【Reference Code】None

HB_ISP_SetAeAttrEx/HB_ISP_GetAeAttrEx

【Function Declaration】

int HB_ISP_SetAeAttrEx(uint8_t pipeId, const ISP_AE_ATTR_EX_S *pstAeAttrEx);

int HB_ISP_GetAeAttrEx(uint8_t pipeId, ISP_AE_ATTR_EX_S *pstAeAttrEx);

【Function Description】

Set ae attributes

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
pstAeAttrExPointer to ae parametersOutput
ReturnsDescription
0Successful
Non-zeroFailed

【Notes】

【Reference code】None

HB_ISP_GetAeWeight/HB_ISP_SetAeWeight

【Function declaration】

int HB_ISP_GetAeWeight(uint8_t pipeId, AE_ZONES_WEIGHT_S *pstAeWeightLUT);

int HB_ISP_SetAeWeight(uint8_t pipeId, AE_ZONES_WEIGHT_S *pstAeWeightLUT);

【Description】

Set/Get ae weight

【Parameter description】

Parameter nameDescriptionInput/Output
pipeIdPipeline indexInput
pstAeWeightLUTPointer to ae weight tableOutput

【Returns】

ReturnsDescription
0Successful
Non-zeroFailed

【Notes】

【Reference code】None

HB_ISP_GetAeMinIntertime/HB_ISP_SetAeMinIntertime

【Function declaration】

int HB_ISP_GetAeMinIntertime(uint8_t pipeId, uint32_t *pstAeMinTime);

int HB_ISP_SetAeMinIntertime(uint8_t pipeId, uint32_t stAeMinTime);

【Description】Setting/Getting ae minimum intertime

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
pstAeMinTimePointer to minimum intertime, in linesOutput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

This interface is valid for both auto exposure and manual exposure functions.

【Reference Code】None

HB_GetAwbTemperatureInfo

【Function Declaration】

int HB_GetAwbTemperatureInfo(uint8_t pipeId, uint32_t *temper);

【Function Description】

Get awb temperature information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
temperPointer to temperatureOutput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】None

HB_ISP_SetAwbTolerance

【Function Declaration】

int HB_ISP_SetAwbTolerance(uint8_t pipeId, uint8_t Tolerance);

【Function Description】

Set awb tolerance information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
Toleranceawb tolerance value, [1, 50]Input

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Notes】

【Reference Code】None

HB_GetAwbModeInfo/HB_SetAwbModeInfo

【Function Declaration】

int HB_GetAwbModeInfo(uint8_t pipeId, ISP_AWB_MODE_E *ptrAwbMode);

int HB_SetAwbModeInfo(uint8_t pipeId, ISP_AWB_MODE_E AwbMode);

【Function Description】

Set/Get awb mode information.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
ptrAwbModePointer to the awb modeInput
Return ValueDescription
0Success
Non-zeroFailure

【Note】

【Reference Code】None

HB_GetAwbGainByTemp

【Function Declaration】

int HB_GetAwbGainByTemp(uint8_t pipeId, uint16_t ColorTemp, int16_t Shift, ISP_AWB_ATTR_S *pstAwbAttr);

【Description】

Get rgain and bgain calculated by the plank curve formula of awb color temperature.

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline indexInput
ColorTempColor temperature value in Kelvin, range [1500~10000]Input
ShiftThe position and distance between the white point and the Planckian curve, range [-64~64]Input
pstAwbAttrPointer to AwbAttrInput

【Return Value】

Return ValueDescription
0Success
Non-zeroFailure

【Note】

【Reference Code】None

HB_ISP_SetAfSpeed

【Function Declaration】

int HB_ISP_SetAfSpeed(uint8_t pipeId, uint32_t speed);

【Description】Set AF focus steps

【Parameter Description】

Parameter NameDescriptionInput/Output
pipeIdPipeline index numberInput
speedAF focus stepsInput

【Return Value】

Return ValueDescription
0Success
non-zeroFailure

【Notes】

【Reference Code】None

Data Structure

HB_ISP_FW_STATE_E

【Structure Definition】

typedef enum HB_ISP_FW_STATE_E {

ISP_FW_STATE_RUN = 0,

ISP_FW_STATE_FREEZE,

} ISP_FW_STATE_E;

【Function Description】

【Member Explanation】

MemberMeaning
ISP_FW_STATE_RUNFirmware is running normally
ISP_FW_STATE_FREEZEFirmware is frozen

HB_ISP_MODULE_CTRL_U

【Structure Definition】

typedef union HB_ISP_MODULE_CTRL_U {

uint64_t u64Value;

struct {

uint64_t bitBypassVideoTestGen : 1 ;

uint64_t bitBypassInputFormatter : 1 ;

uint64_t bitBypassDecompander : 1 ;

uint64_t bitBypassSensorOffsetWDR : 1 ;

uint64_t bitBypassGainWDR : 1 ;

uint64_t bitBypassFrameStitch : 1 ;

uint64_t bitBypassDigitalGain : 1 ;

uint64_t bitBypassFrontendSensorOffset : 1 ;

uint64_t bitBypassFeSqrt : 1 ;

uint64_t bitBypassRAWFrontend : 1 ;

uint64_t bitBypassDefectPixel : 1 ;

uint64_t bitBypassSinter : 1 ;

uint64_t bitBypassTemper : 1 ;

uint64_t bitBypassCaCorrection : 1 ;

uint64_t bitBypassSquareBackend : 1 ;

uint64_t bitBypassSensorOffsetPreShading: 1 ;

uint64_t bitBypassRadialShading : 1 ;

uint64_t bitBypassMeshShading : 1 ;

uint64_t bitBypassWhiteBalance : 1 ;

uint64_t bitBypassIridixGain : 1 ;

uint64_t bitBypassIridix : 1 ;

uint64_t bitBypassMirror : 1 ;

uint64_t bitBypassDemosaicRGB : 1 ;
【Structure Definition】
```c
typedef union HB_ISP_MODULE_CTRL_U {

uint64_t u64Value;

struct {

uint64_t bitBypassVideoTestGen : 1 ;

uint64_t bitBypassInputFormatter : 1 ;

uint64_t bitBypassDecompander : 1 ;

uint64_t bitBypassSensorOffsetWDR : 1 ;

uint64_t bitBypassGainWDR : 1 ;

uint64_t bitBypassFrameStitch : 1 ;

uint64_t bitBypassDigitalGain : 1 ;

uint64_t bitBypassFrontendSensorOffset : 1 ;

uint64_t bitBypassFeSqrt : 1 ;

uint64_t bitBypassRAWFrontend : 1 ;

uint64_t bitBypassDefectPixel : 1 ;

uint64_t bitBypassSinter : 1 ;

uint64_t bitBypassTemper : 1 ;

uint64_t bitBypassCaCorrection : 1 ;

uint64_t bitBypassSquareBackend : 1 ;

uint64_t bitBypassSensorOffsetPreShading: 1 ;

uint64_t bitBypassRadialShading : 1 ;

uint64_t bitBypassMeshShading : 1 ;

uint64_t bitBypassWhiteBalance : 1 ;

uint64_t bitBypassIridixGain : 1 ;

uint64_t bitBypassIridix : 1 ;

uint64_t bitBypassMirror : 1 ;

uint64_t bitBypassDemosaicRGB : 1 ;

uint64_t bitBypassPfCorrection : 1 ;

uint64_t bitBypassCCM : 1 ;

uint64_t bitBypassCNR : 1 ;

uint64_t bitBypass3Dlut : 1 ;

uint64_t bitBypassNonequGamma : 1 ;

uint64_t bitBypassFrCrop : 1 ;

uint64_t bitBypassFrGammaRGB : 1 ;

uint64_t bitBypassFrSharpen : 1 ;

uint64_t bitBypassFrCsConv : 1 ;

uint64_t bitBypassRAW : 1 ;

uint64_t bitRsv : 31 ;
};

} ISP_MODULE_CTRL_U;

【Description】This structure defines the bit fields for controlling the bypass of different modules.

HB_ISP_I2C_DATA_S

【Structure Definition】

typedef struct HB_ISP_I2C_DATA_S {

uint8_t u8DevId;

uint8_t u8IntPos;

uint8_t u8Update;

uint8_t u8DelayFrameNum;

uint32_t u32RegAddr;

uint32_t u32AddrByteNum;

uint32_t u32Data;

uint32_t u32DataByteNum;

} ISP_I2C_DATA_S;

【Function Description】

【Member Description】

MemberMeaning
u8DevIdpipeline id
u8IntPos0 frame_start 1 frame_done
u8Update0 update_disable 1 update_enable
u8DelayFrameNumdelay frame [0,5]
u32RegAddrsensor reg addr eg. 0x3058
u32AddrByteNumsensor reg num[0,4] eg.2
u32DataData to write
u32DataByteNumsensor reg num[0,4]

HB_ISP_AE_FUNC_S

【Structure Definition】

typedef struct HB_ISP_AE_FUNC_S {

void *( *init_func )( uint32_t ctx_id );

int32_t ( *proc_func )( void *ae_ctx, ae_stats_data_t *stats, ae_input_data_t *input, ae_output_data_t *output );

int32_t ( *deinit_func )( void *ae_ctx );

} ISP_AE_FUNC_S;

【Function Description】

Define the callback function structure of AE algorithm library.

【Member Description】

MemberMeaning
init_funcDescription: Initialization of AE algorithm. Parameters: ctx_id input parameter, corresponding to different instances. Returns: pointer to the instance.
proc_funcDescription: AE algorithm processing. Parameters: ae_ctx input parameter, which is the return value of init_func and corresponds to an instance. stats input parameter, corresponding to AE statistical data. input input parameter, parameters passed to the algorithm by ISP Firmware. output output parameter, output result of AE algorithm that will be configured to ISP Firmware. Returns: 0 on success, non-zero on failure.
deinit_funcDescription: Deinitialization of AE. Parameters: ae_ctx input parameter, which is the return value of init_func and corresponds to an instance. Returns: 0 on success, non-zero on failure.

ae_stats_data_t

Struct Definition:

typedef struct _ae_stats_data_ {
uint32_t *fullhist;
uint32_t fullhist_size;
uint32_t fullhist_sum;
uint16_t *zone_hist;
uint32_t zone_hist_size;
} ae_stats_data_t;

Function Description:

This defines the structure for AE (Automatic Exposure) statistical data. For more details on the statistics, refer to the section on "AE Statistics Information."

Member Descriptions:

MemberMeaning
fullhistPointer to global statistics
fullhist_sizeSize of the statistics buffer
fullhist_sumNumber of points included in the statistics
zone_histPointer to area statistics
zone_hist_sizeSize of the area statistics buffer

ae_input_data_t

Struct Definition:

typedef struct _ae_input_data_ {
void *custom_input;
void *acamera_input;
} ae_input_data_t;

Function Description:

This defines the structure for input parameters to the AE algorithm.

Member Descriptions:

MemberMeaning
custom_inputNo specific meaning
acamera_inputAE algorithm input, actually of type ae_acamera_input_t

ae_acamera_input_t

Struct Definition:

typedef struct _ae_acamera_input_ {
ae_balanced_param_t *ae_ctrl;
ae_misc_info_t misc_info;
ae_calibration_data_t cali_data;
ae_5bin_info_t ae_5bin_data;
uint32_t ctx_id;
} ae_acamera_input_t;

Function Description:

This contains the parameters passed to the AE algorithm, including nested structures:

Nested Structures:

typedef struct _ae_balanced_param_t {

uint32_t pi_coeff;

uint32_t target_point;

uint32_t tail_weight;

uint32_t long_clip;

uint32_t er_avg_coeff;

uint32_t hi_target_prc;

uint32_t hi_target_p;

uint32_t enable_iridix_gdg;

uint32_t AE_tol;

} ae_balanced_param_t;

typedef struct _ae_misc_info_ {

int32_t sensor_exp_number;

int32_t total_gain;

int32_t max_exposure_log2;

uint32_t global_max_exposure_ratio;

uint32_t iridix_contrast;

uint32_t global_exposure;

uint8_t global_ae_compensation;

uint8_t global_manual_exposure;

uint8_t global_manual_exposure_ratio;

uint8_t global_exposure_ratio;

} ae_misc_info_t;

typedef struct _ae_calibration_data_ {

uint8_t *ae_corr_lut;

uint32_t ae_corr_lut_len;

uint32_t *ae_exp_corr_lut;

uint32_t ae_exp_corr_lut_len;

modulation_entry_t *ae_hdr_target;

uint32_t ae_hdr_target_len;

modulation_entry_t *ae_exp_ratio_adjustment;

uint32_t ae_exp_ratio_adjustment_len;

} ae_calibration_data_t;

typedef struct _ae_5bin_info_ {

uint32_t zones_size;

uint16_t zones_v;

uint16_t zones_h;

uint16_t threshold0_1;

uint16_t threshold1_2;

uint16_t threshold3_4;

uint16_t threshold4_5;

uint16_t normal_bin0;

uint16_t normal_bin1;

uint16_t normal_bin3;

uint16_t normal_bin4;

} ae_5bin_info_t;

modulation_entry_t define:

typedef struct _modulation_entry_t {  
    uint16_t x, y;
} modulation_entry_t;

ae_output_data_t

Struct Definition:

typedef struct _ae_output_data_ {
void *custom_output;
void *acamera_output;
} ae_output_data_t;

Function Description:

This defines the structure for output parameters from the AE algorithm.

Member Descriptions:

MemberMeaning
custom_outputNo specific meaning
acamera_outputAE algorithm's output, forcibly cast to ae_acamera_output_t

ae_acamera_output_t

Structure Definition:

typedef struct _ae_acamera_output_ {
int32_t exposure_log2;
uint32_t exposure_ratio;
uint8_t ae_converged;
uint16_t sensor_ctrl_enable;
ae_out_info_t ae_out_info;
ae_1024bin_weight_t ae_1024bin_weight;
} ae_acamera_output_t;

Function Description:

This defines the structure for the output of the AE algorithm.

Member Descriptions:

MemberMeaning
exposure_log2Exposure target range [0, uint32_t]
exposure_ratioExposure ratio range [0, 64]
ae_convergedAE algorithm status, converged (1) or in progress (0)
sensor_ctrl_enableSensor control enable, 1 enabled, 0 disabled
ae_out_infoAE-related control information
ae_1024bin_weightGlobal statistical information weights

ae_out_info_t

Structure Definition:

typedef struct _ae_out_info_ {
uint32_t line[4];
uint32_t line_num;
uint32_t sensor_again[4];
uint32_t sensor_again_num;
uint32_t sensor_dgain[4];
uint32_t sensor_dgain_num;
uint32_t isp_dgain;
} ae_out_info_t;

Function Description:

This defines the structure for AE control parameters.

Member Descriptions:

MemberMeaning
line[4]Sensor shutter values (lines)
line_numNumber of shutter values (1 to 4)
sensor_again[4]Sensor again parameters (0 to 255)
sensor_again_numNumber of sensor again parameters (1 to 4)
sensor_dgain[4]Sensor dgain parameters (0 to 255)
sensor_dgain_numNumber of sensor dgain parameters (1 to 4)
isp_dgainISP dgain parameter (0 to 255)

ae_1024bin_weight_t

Structure Definition:

typedef struct _ae_1024bin_weight_ {
uint32_t zones_size;
uint8_t zones_weight[ISP_METERING_ZONES_AE5_V * ISP_METERING_ZONES_AE5_H];
} ae_1024bin_weight_t;

Function Description:

This defines the structure for AE statistical weight parameters.

Member Descriptions:

MemberMeaning
zones_sizeNumber of statistical blocks (0 to 1089)
zones_weightWeight for each block (0 to 15)

HB_ISP_AWB_FUNC_S

Structure Definition:

typedef struct HB_ISP_AWB_FUNC_S {
void* (*init_func)(uint32_t ctx_id);
int32_t (*proc_func)(void* awb_ctx, awb_stats_data_t* stats, awb_input_data_t* input, awb_output_data_t* output);
int32_t (*deinit_func)(void* awb_ctx);
} ISP_AWB_FUNC_S;

Function Description:

This defines the callback function structure for the AWB algorithm library.

Member Descriptions:

MemberMeaning
init_funcDescription: Initializes the AWB algorithm. Input: ctx_id (context identifier). Output: Pointer to instance.
proc_funcDescription: Processes the AWB algorithm. Input: awb_ctx (instance pointer), stats (statistics), input, output. Return: 0 on success, non-zero on failure.
deinit_funcDescription: Deinitializes the AWB algorithm. Input: awb_ctx (instance pointer). Return: 0 on success, non-zero on failure.

awb_stats_data_t

Struct Definition:

typedef struct _awb_stats_data_ {
awb_zone_t *awb_zones;
uint32_t zones_size;
} awb_stats_data_t;

Function Description:

This defines the structure for AWB statistical data. For more details on the AWB statistics, refer to the Statistical Information section.

Member Descriptions:

MemberMeaning
awb_zonesPointer to an array of zone statistics
zones_sizeNumber of zones

awb_zone_t

Struct Definition:

typedef struct _awb_zone_t {
uint16_t rg;
uint16_t bg;
uint32_t sum;
} awb_zone_t;

Function Description:

This defines the structure for AWB zone statistical information.

Member Descriptions:

MemberMeaning
rgWeighted average R/G or G/R mean
bgWeighted average B/G or G/B mean
sumTotal number of pixels included in the statistics

awb_input_data_t

【Structure Definition】

typedef struct _awb_input_data_ {

void *custom_input;

void *acamera_input;

} awb_input_data_t;

【Function Description】

Defines the structure of input parameters for AWB algorithm.

【Member Description】

MemberMeaning
custom_inputNo meaning
acamera_inputParameters required by AWB algorithm, actually of type awb_acamera_input_t

awb_acamera_input_t

【Structure Definition】

typedef struct _awb_acamera_input_ {

awb_misc_info_t misc_info;

awb_calibration_data_t cali_data;

} awb_acamera_input_t;

【Function Description】Parameters passed to AWB algorithm.

Including the following structures:

typedef struct _awb_misc_info_ {

uint16_t log2_gain;

int cur_exposure_log2;

uint32_t iridix_contrast;

uint8_t global_manual_awb;

uint16_t global_awb_red_gain;

uint16_t global_awb_blue_gain;

} awb_misc_info_t;

typedef unsigned short ( *calibration_light_src_t )[2];

typedef struct _awb_calibration_data_ {

calibration_light_src_t cali_light_src;

uint32_t cali_light_src_len;

uint32_t *cali_evtolux_ev_lut;

uint32_t cali_evtolux_ev_lut_len;

uint32_t *cali_evtolux_lux_lut;

uint32_t cali_evtolux_lux_lut_len;

uint8_t *cali_awb_avg_coef;

uint32_t cali_awb_avg_coef_len;

uint16_t *cali_rg_pos;

uint32_t cali_rg_pos_len;

uint16_t *cali_bg_pos;

uint32_t cali_bg_pos_len;

uint16_t *cali_color_temp;

uint32_t cali_color_temp_len;

uint16_t *cali_ct_rg_pos_calc;

uint32_t cali_ct_rg_pos_calc_len;

uint16_t *cali_ct_bg_pos_calc;

uint32_t cali_ct_bg_pos_calc_len;

modulation_entry_t *cali_awb_bg_max_gain;

uint32_t cali_awb_bg_max_gain_len;

uint16_t *cali_mesh_ls_weight;

uint16_t *cali_mesh_rgbg_weight;

uint8_t *cali_evtolux_probability_enable;

uint32_t *cali_awb_mix_light_param;

uint16_t *cali_ct65pos;

uint16_t *cali_ct40pos;

uint16_t *cali_ct30pos;

uint16_t *cali_sky_lux_th;

uint16_t *cali_wb_strength;

uint16_t *cali_mesh_color_temperature;

uint16_t *cali_awb_warming_ls_a;

uint16_t *cali_awb_warming_ls_d75;

uint16_t *cali_awb_warming_ls_d50;

uint16_t *cali_awb_colour_preference;

} awb_calibration_data_t;

awb_output_data_t

Structure Definition:

typedef struct _awb_output_data_ {
void *custom_output;
void *acamera_output;
} awb_output_data_t;

Function Description:

This defines the structure for parameters output by the AWB algorithm.

Member Descriptions:

MemberMeaning
custom_outputNo specific meaning
acamera_outputOutput result of the AWB algorithm, forcibly converted to awb_acamera_output_t type

awb_acamera_output_t

Structure Definition:

typedef struct _awb_acamera_output_ {
uint16_t rg_coef;
uint16_t bg_coef;
int32_t temperature_detected;
uint8_t p_high;
uint8_t light_source_candidate;
int32_t awb_warming[3];
uint8_t awb_converged;
} awb_acamera_output_t;

Function Description:

This defines the structure for the output of the AWB algorithm's results.

Member Descriptions:

MemberMeaning
rg_coefR Gain
bg_coefB Gain
temperature_detectedColor temperature value
p_highHigh color temperature threshold for CCM control
light_source_candidateLight source indicator for CCM switching
awb_warming[3]CCM coefficients for R/G/B
awb_convergedAWB algorithm status: converged, active, or inactive

HB_ISP_AF_FUNC_S

Structure Definition:

typedef struct HB_ISP_AF_FUNC_S {
void *(*init_func)(uint32_t ctx_id);
int32_t (*proc_func)(void *af_ctx, af_stats_data_t *stats, af_input_data_t *input, af_output_data_t *output);
int32_t (*deinit_func)(void *af_ctx);
} ISP_AF_FUNC_S;

Function Description:

This defines the callback function structure for the AF algorithm library.

Member Descriptions:

MemberMeaning
init_funcDescription: Initializes the AF algorithm. Input: ctx_id (instance ID). Output: Pointer to instance context.
proc_funcDescription: Processes the AF algorithm. Input: af_ctx (context from init_func), stats, input, and output.
deinit_funcDescription: Deinitializes the AF algorithm. Input: af_ctx (context from init_func). Output: Success/failed.

af_stats_data_t

Structure Definition:

typedef struct _af_stats_data_ {
uint32_t *zones_stats;
uint32_t zones_size;
} af_stats_data_t;

Function Description:

This defines the structure for AF statistical data. Detailed descriptions of AF statistics can be found in the Statistical Information section.

Member Descriptions:

MemberMeaning
zones_statsPointer to AF stats
zones_sizeSize of zones

af_input_data_t

Structure Definition:

typedef struct _af_input_data_ {
void *custom_input;
void *acamera_input;
} af_input_data_t;

Function Description:

This defines the structure for input parameters to the AF algorithm.

Member Descriptions:

MemberMeaning
custom_inputParameters used by the AF algorithm
acamera_inputInput used by the AF algorithm, actual type: af_acamera_input_t

af_acamera_input_t

Structure Definition

typedef struct _af_acamera_input_ {

af_info_t af_info;

af_misc_info_t misc_info;

af_calibration_data_t cali_data;

} af_acamera_input_t;

Function Description

Parameters passed to the AF algorithm.

Contains the following structs:

typedef struct _af_lms_param_t {

uint32_t pos_min_down;
uint32_t pos_min;
uint32_t pos_min_up;
uint32_t pos_inf_down;
uint32_t pos_inf;
uint32_t pos_inf_up;
uint32_t pos_macro_down;
uint32_t pos_macro;
uint32_t pos_macro_up;
uint32_t pos_max_down;
uint32_t pos_max;
uint32_t pos_max_up;
uint32_t fast_search_positions;
uint32_t skip_frames_init;
uint32_t skip_frames_move;
uint32_t dynamic_range_th;
uint32_t spot_tolerance;
uint32_t exit_th;
uint32_t caf_trigger_th;
uint32_t caf_stable_th;
uint32_t print_debug;

} af_lms_param_t;

typedef struct _af_info_ {

uint8_t af_mode;
uint8_t refocus_required;
uint8_t zones_horiz;
uint8_t zones_vert;
uint32_t roi;
uint32_t af_pos_manual;
uint32_t zoom_step_info;

} af_info_t;

typedef struct _af_misc_info_ {

int16_t accel_angle;
uint16_t lens_min_step;

} af_misc_info_t;

typedef struct _af_calibration_data_ {

af_lms_param_t *af_param;
uint16_t *af_zone_whgh_h;
uint32_t af_zone_whgh_h_len;
uint16_t *af_zone_whgh_v;
uint32_t af_zone_whgh_v_len;

} af_calibration_data_t;

af_output_data_t

Structure Definition

typedef struct _af_output_data_ {

void *custom_output;

void *acamera_output;

} af_output_data_t;

Function Description

Defines the structure for the AF algorithm output parameters.

Member Descriptions

MemberMeaning
custom_outputNo specific meaning
acamera_outputOutput result of the AF algorithm, forced to be converted to af_acamera_output_t type in code

af_acamera_output_t

Structure Definition

typedef struct _af_acamera_output_ {

uint16_t af_lens_pos;
int32_t af_sharp_val;
af_state_t state;

} af_acamera_output_t;

Function Description

Structure defining the output of the AF algorithm.

Member Descriptions

MemberMeaning
af_lens_posLens position
af_sharp_valSharpness value
stateEnum type: af_state_t { AF_STATE_INACTIVE, AF_STATE_SCAN, AF_STATE_FOCUSED, AF_STATE_UNFOCUSED }

HB_ISP_OP_TYPE_E

Structure Definition

typedef enum HB_ISP_OP_TYPE_E {

OP_TYPE_AUTO = 0,

OP_TYPE_MANUAL,

} ISP_OP_TYPE_E;

Member Descriptions

MemberMeaning
OP_TYPE_AUTOAuto mode
OP_TYPE_MANUALManual mode

HB_ISP_AE_ATTR_S

Structure Definition:

typedef struct HB_ISP_AE_ATTR_S {
uint32_t u32MaxExposureRatio;
uint32_t u32MaxIntegrationTime;
uint32_t u32MaxSensorAnalogGain;
uint32_t u32MaxSensorDigitalGain;
uint32_t u32MaxIspDigitalGain;
uint32_t u32Exposure;
uint32_t u32ExposureRatio;
uint32_t u32IntegrationTime;
uint32_t u32SensorAnalogGain;
uint32_t u32SensorDigitalGain;
uint32_t u32IspDigitalGain;
ISP_OP_TYPE_E enOpType;
} ISP_AE_ATTR_S;

Function Description:

The index-to-actual multiplier conversion relationship is: y = 2^(x/32); for example, setting the gain value to 96 results in an actual amplification factor of 2^(96/32) = 8x.

Member Descriptions:

MemberMeaning
u32ExposureControls the exposure time parameter
u32ExposureRatioControls the exposure ratio parameter
u32IntegrationTimeControls the integration time parameter
u32SensorAnalogGainControls the sensor analog gain parameter. Values: [0-255]
u32SensorDigitalGainControls the sensor digital gain parameter. Values: [0-255]
u32IspDigitalGainControls the ISP digital gain parameter. Values: [0-255]
u32MaxExposureRatioControls the maximum exposure ratio parameter
u32MaxIntegrationTimeControls the maximum integration time parameter
u32MaxSensorAnalogGainControls the maximum sensor analog gain parameter. Values: [0-255]
u32MaxSensorDigitalGainControls the maximum sensor digital gain parameter. Values: [0-255]
u32MaxIspDigitalGainControls the maximum ISP digital gain parameter. Values: [0-255]
enOpTypeSee the ISP_OP_TYPE_E structure definition below. Since there is no Auto mode, for the Set interface, setting Auto changes the mode to Auto, and setting Manual changes the mode to Manual while setting the Manual parameter; for the Get interface, setting Auto or Manual retrieves the parameter values for different modes.

HB_ISP_AF_ATTR_S

Structure Definition:

typedef struct HB_ISP_AF_ATTR_S {
uint32_t u32ZoomPos;
ISP_OP_TYPE_E enOpType;
} ISP_AF_ATTR_S;

Function Description:

Member Descriptions:

MemberMeaning
uint32_t u32ZoomPosControls the zoom parameter. Values: [10-80]
enOpTypeReserved, not used

HB_ISP_AWB_ATTR_S

Structure Definition:

typedef struct HB_ISP_AWB_ATTR_S {
uint32_t u32RGain;
uint32_t u32BGain;
ISP_OP_TYPE_E enOpType;
} ISP_AWB_ATTR_S;

Function Description:

Member Descriptions:

MemberMeaning
u32RGainControls the awb_red_gain parameter. Values: [0-4096] format: unsigned 4.8 bit fixed-point
u32BGainControls the awb_blue_gain parameter. Values: [0-4096] format: unsigned 4.8 bit fixed-point
enOpTypeSee the ISP_OP_TYPE_E structure definition. No Auto parameter; for Set, Auto changes to Auto, Manual changes to Manual with Manual value. For Get, Auto or Manual retrieves parameters for respective modes.

HB_ISP_BLACK_LEVEL_ATTR_S

Structure Definition:

typedef struct HB_ISP_BLACK_LEVEL_ATTR_S {
uint32_t u32OffsetR;
uint32_t u32OffsetGr;
uint32_t u32OffsetGb;
uint32_t u32OffsetB;
ISP_OP_TYPE_E enOpType;
} ISP_BLACK_LEVEL_ATTR_S;

Function Description:

Black level parameters.

Member Descriptions:

MemberMeaning
u32OffsetRBlack offset subtraction for each channel in linear domain: Channel 00 (R). Values: [0-1048575]
u32OffsetGrBlack offset subtraction for each channel in linear domain: Channel 01 (Gr). Values: [0-1048575]
u32OffsetGbBlack offset subtraction for each channel in linear domain: Channel 10 (Gb). Values: [0-1048575]
u32OffsetBBlack offset subtraction for each channel in linear domain: Channel 11 (B). Values: [0-1048575]
enOpTypeSee the ISP_OP_TYPE_E structure definition. No Auto parameter; for Set, Auto changes to Auto, Manual changes to Manual with Manual parameter. For Get, Auto or Manual retrieves parameters based on the mode.

HB_ISP_DEMOSAIC_ATTR_S

Structure Definition

typedef struct HB_ISP_DEMOSAIC_ATTR_S {
uint32_t u32FcSlope; // Slope (strength) of false color correction
uint32_t u32FcAliasSlope; // Slope (strength) of false color correction after blending with saturation value in 2.6 unsigned format
uint32_t u32FcAliasThresh; // Threshold of false color correction after blending with saturation value in 0.8 unsigned format
ISP_CTRL_PARAM_ATTR_S VhParam; // Vertical/Horizontal blending parameters: Slope, Threshold, and Offset
ISP_CTRL_PARAM_ATTR_S AaParam; // Angular (45/135) blending parameters: Slope, Threshold, and Offset
ISP_CTRL_PARAM_ATTR_S VaParam; // Vertical gradient blending parameters: Slope, Threshold, and Offset
ISP_CTRL_PARAM_ATTR_S UuParam; // Horizontal gradient blending parameters: Slope, Threshold, and Offset
ISP_CTRL_PARAM_ATTR_S UuShParam; // Horizontal gradient blending for shadows: Slope, Threshold, and Offset
uint32_t u32SharpLumaLowD; // Low sharpness threshold for luma component (directional)
ISP_CTRL_PARAMA_ATTR_S SharpLumaHighD; // High sharpness threshold for luma component (directional)
uint32_t u32SharpLumaLowUD; // Low sharpness threshold for luma component (uniform)
ISP_CTRL_PARAMA_ATTR_S SharpLumaHighUD; // High sharpness threshold for luma component (uniform)
uint32_t u32MinDstrength; // Minimum destination strength
uint32_t u32MinUDstrength; // Minimum uniform direction strength
uint32_t u32MaxDstrength; // Maximum destination strength
uint32_t u32MaxUDstrength; // Maximum uniform direction strength
uint16_t u16NpOffset[ISP_AUTO_ISO_STRENGTH_NUM][2]; // Noise profile offsets for different ISO strengths
} ISP_DEMOSAIC_ATTR_S;

typedef struct HB_ISP_CTRL_PARAM_ATTR_S {
uint32_t u32Offset; // Parameter offset
uint32_t u32Thresh; // Parameter threshold
uint32_t u32Slope; // Parameter slope
} ISP_CTRL_PARAM_ATTR_S;

typedef struct HB_ISP_CTRL_PARAMA_ATTR_S {
uint32_t u32Thresh; // Parameter threshold
uint32_t u32Slope; // Parameter slope
} ISP_CTRL_PARAMA_ATTR_S;

Function Description

Member Descriptions

#define ISP_AUTO_ISO_STRENGTH_NUM 16

MemberMeaning
u32FcSlopeSlope (strength) of false color correction
u32FcAliasSlopeSlope (strength) of false color correction after blending with saturation value in 2.6 unsigned format
u32FcAliasThreshThreshold of false color correction after blending with saturation valuet in in 0.8 unsigned format
VhParamSlope of vertical/horizontal blending threshold in 4.4 logarithmic format. High values will tend to favor one direction over the other (depending on VH Thresh) while lower values will give smoother blending. Threshold for the range of vertical/horizontal blending The threshold defines the difference of vertical and horizontal gradients at which the vertical gradient will start to be taken into account in the blending (if VH Offset is set to 0). Setting the offset not null (or the slope low) will include proportion of the vertical gradient in the blending before even the gradient difference reaches the threshold (see VH Offset for more details). Offset for vertical/horizontal blending threshold
AaParamSlope of angular (45/135) blending threshold in 4.4 format. High values will tend to favor one direction over the other (depending on AA Thresh) while lower values will give smoother blending. Threshold for the range of angular (45/135) blending. The threshold defines the difference of 45 and 135 gradients at which the 45 gradient will start to be taken into account in the blending (if AA Offset is set to 0). Setting the offset not null (or the slope low) will include proportion of the 45 gradient in the blending before even the gradient difierence reaches the threshold (see AA Offset for more details). Offset for angular (A45/A135) blending threshold. This register has great impact on how AA Thresh is used. Setting this register to a value offset tells the blending process to weight the 45 and 135 gradients, at the threshold, with respectively offset/16 and 255 - (offset/16). If AA Thresh not equals to 0, these same blending weights apply from -AA Thresh to +AA Thresh.
VaParamSlope [7:0] Slope of VH-AA blending threshold in 4.4 log format. High values will tend to favor one direction over the other (depending on VA Thresh) while lower values will give smoother blending. Threshold for the range of VH-AA blending. The threshold defines the difference of VH and AA gradients at which the VH gradient will start to be taken into account in the blending (if VA Offset is set to 0). Setting the offset not null (or the slope low) will include proportion of the VH gradient in the blending before even the gradient difference reaches the threshold (see VA Offiset for more details). Offset for VH-AA blending threshold. This register has great impact on how VA Thresh is used. Setting this register to a value offset tells the blending process to weight the VH and AA gradients, at the threshold, with respectively offset/16 and 255 - (offset/16). If VA Thresh not equals to 0, these same blending weights apply from -VA Thresh to +VA Thresh.
UuParamSlope [7:0] Slope of undefined blending threshold in 4.4 logarithmic format Threshold for the range of undefined blending Offset for undefined blending threshold
UuShParamThreshold for the range of undefined blending Offset for undefined blending threshold Slope of undefined blending threshold in 4.4 logarithmic format
SharpLumaLowDthresh Intensity values above this value will be sharpen Slope Linear threshold slope corresponding to luma_thresh_low_d offset Linear threshold offset corresponding to luma_thresh_low_d
SharpLumaHighDthresh Intensity values below this value will be sharpen Slope Linear threshold slope corresponding to luma_thresh_high_d
SharpLumaLowUDthresh Intensity values above this value will be sharpen offset Linear threshold offset corresponding to luma_thresh_low_ud Slope Linear threshold slope corresponding to luma_thresh_low_ud
SharpLumaHighUDthresh Intensity values below this value will be sharpen Slope Linear threshold slope corresponding to luma_thresh_high_ud
u32MinDstrengthMin threshold for the directional L_L in signed 2's complement s.12 format
u32MinUDstrengthMin threshold for the un-directional L_Lu in signed 2's complement s.12 format
u32MaxDstrengthMax threshold for the directional L_L in signed 2's complement s1+0.12 format
u32MaxUDstrengthMax threshold for the undirectional L_Lu in signed 2's complement s1+0.12 format
u16NpOffsetNoise profile offset in logarithmic 4.4 format

HB_ISP_SHARPEN_ATTR_S

【Structure Definition】

typedef struct HB_ISP_SHARPEN_AUTO_ATTR_S {
uint16_t u16SharpFR[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t u16SharpAltD[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t u16SharpAltDU[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t u16SharpAltUD[ISP_AUTO_ISO_STRENGTH_NUM][2];
} ISP_SHARPEN_AUTO_ATTR_S;

typedef struct HB_ISP_SHARPEN_MANUAL_ATTR_S {
uint32_t u32Strength;
uint32_t u32SharpAltD;
uint32_t u32SharpAltUd;
uint32_t u32SharpAltLd;
uint32_t u32SharpAltLdu;
uint32_t u32SharpAltLu;
} ISP_SHARPEN_MANUAL_ATTR_S;

typedef struct HB_ISP_CTRL_PARAM_ATTR_S {
uint32_t u32Offset;
uint32_t u32Thresh;
uint32_t u32Slope;
} ISP_CTRL_PARAM_ATTR_S;

typedef struct HB_ISP_SHARPEN_ATTR_S {
ISP_CTRL_PARAM_ATTR_S LumaLow;
ISP_CTRL_PARAM_ATTR_S LumaHigh;
uint32_t u32ClipStrMax;
uint32_t u32ClipStrMin;
uint32_t u32AlphaUndershoot;
uint32_t u32SadAmp;
ISP_SHARPEN_MANUAL_ATTR_S stManual;
ISP_SHARPEN_AUTO_ATTR_S stAuto;
ISP_OP_TYPE_E enOpType;
} ISP_SHARPEN_ATTR_S;

【Function Description】

【Member Descriptions】

MemberMeaning
u16SharpFRControls the strength of the sharpening effect. u5.4 value.
u16SharpAltDSharpness strength for L_Ld in unsigned 4.4 format. Range: [0-255].
u16SharpAltDUSharpness strength for L_Ldu in unsigned 4.4 format. Range: [0-255].
u16SharpAltUDSharpness strength for L_Lu in unsigned 4.4 format. Range: [0-255].
MemberMeaning
u32StrengthSharpen intensity.
u32SharpAltDSigned 4.4 format directional sharp mask strength. Range: [-255, 255].
u32SharpAltUdSigned 4.4 format non-directional sharp mask strength. Range: [-255, 255].
u32SharpAltLdSharpness strength for L_Ld in unsigned 4.4 format. Range: [0-255].
u32SharpAltLduSharpness strength for L_Ldu in unsigned 4.4 format. Range: [0-255].
u32SharpAltLuSharpness strength for L_Lu in unsigned 4.4 format. Range: [0-255].
MemberMeaning
LumaLowControl parameters for low luminance areas (offset, thresh, slope).
LumaHighControl parameters for high luminance areas (offset, thresh, slope).
u32ClipStrMaxMaximum threshold for clipping. Values range from 0 to 16383.
u32ClipStrMinMinimum threshold for clipping. Values range from 0 to 16383.
u32AlphaUndershootUndershoot/overshoot parameter. 0 means only undershoot, 255 means only overshoot. Range: [0-255].
u32SadAmpHigh-frequency fusion parameter in demosaicing and sharpening.
stManualManual mode parameters.
stAutoAuto mode parameters.
enOpTypeSelection between auto and manual modes.

ISP_GAMMA_ATTR_S

Structure Definition

typedef struct HB_ISP_GAMMA_ATTR_S {
uint16_t au16Gamma[129];
} ISP_GAMMA_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
au16GammaArray containing the 129 gamma correction look-up table (LUT) values, typically for color correction

ISP_IRIDIX_ATTR_S

Structure Definition

typedef struct HB_ISP_IRIDIX_ATTR_S {
ISP_OP_TYPE_E enOpType;
ISP_IRIDIX_AUTO_ATTR_S stAuto;
ISP_IRIDIX_MANUAL_ATTR_S stManual;
uint32_t u32BlackLevel;
uint32_t u32WhiteLevel;
uint32_t u32Svariance;
uint32_t u32Bright_pr;
uint32_t u32Contrast;
uint32_t u32IridixOn;
uint32_t u32FilterMux;
uint32_t u32VarianceSpace;
uint32_t u32VarianceIntensity;
uint32_t u32SlopeMax;
uint32_t u32SlopeMin;
uint32_t u32FwdPerceptCtrl;
uint32_t u32RevPerceptCtrl;
uint32_t u32FwdAlpha;
uint32_t u32RevAlpha;
uint32_t u32GtmSelect;
} ISP_IRIDIX_ATTR_S;

typedef struct HB_ISP_IRIDIX_AUTO_ATTR_S {
uint8_t u8AvgCoef;
uint32_t au32EvLimNoStr[2];
uint32_t u32EvLimFullStr;
uint32_t au32StrengthDkEnhControl[15];
} ISP_IRIDIX_AUTO_ATTR_S;

typedef struct HB_ISP_IRIDIX_MANUAL_ATTR_S {
uint32_t u32RoiHorStart;
uint32_t u32RoiHorEnd;
uint32_t u32RoiVerStart;
uint32_t u32RoiVerEnd;
uint32_t u32StrengthInRoi;
uint32_t u32StrengthOutRoi;
uint32_t u32DarkEnh;
} ISP_IRIDIX_MANUAL_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
enOpTypeEnum for operation type; see ISP_OP_TYPE_E structure definition.
u8AvgCoefThe average coefficient value for Iridix
au32EvLimNoStrThe Expose Value maximum value, in terms of EV_log2 without Strength
u32EvLimFullStrThe Expose Value maximum value, in terms of EV_log2 with Strength
au32StrengthDkEnhControlStrength and dark enhancement control: [0] - dark_prc [1] - bright_prc [2] - min_dk: minimum dark enhancement [3] - max_dk: maximum dark enhancement [4] - pD_cut_min: minimum intensity cut for dark regions where dk_enh will be applied [5] - pD_cut_max: maximum intensity cut for dark regions where dk_enh will be applied [6] - dark contrast min [7] - dark contrast max [8] - min_str: iridix strength in percentage [9] - max_str: iridix strength in percentage: 50 = 1x gain, 100 = 2x gain [10] - dark_prc_gain_target: target in histogram (percentage) for dark_prc after iridix application [11] - contrast_min: clip factor of strength for LDR scenes. [12] - contrast_max: clip factor of strength for HDR scenes. [13] - Maximum Iridix gain [14] - Debug print
u32RoiHorStartHorizontal starting point of ROI Values: [0-65535]
u32RoiHorEndHorizontal ending point of ROI Values: [0-65535]
u32RoiVerStartVertical starting point of ROI Values: [0-65535]
u32RoiVerEndVertical ending point of ROI Values: [0-65535]
u32StrengthInRoiManual Strength value for inside of ROI Values: [0-65535], e.g., 8.8 for 256x intensity (1x), 512x intensity (2x). u32StrengthInRoi employs controlled strategy, while u32StrengthOutRoi does not. Suggest setting u32StrengthInRoi for the entire region and leaving u32StrengthOutRoi at default. Max intensity is 1023; setting it to 1024 flips the effect.
u32StrengthOutRoiManual Strength value for outside of ROI Values: [0-65535]
u32DarkEnhManual Dark Enhance value to control Iridix core Values: [0-65535]
u32BlackLevelIridix black level. Values below this will not be affected by Iridix.
u32WhiteLevelIridix white level. Values above this will not be affected by Iridix.
u32SvarianceIridix8 transform sensitivity to different areas of the image
u32Bright_prManual Bright_Preserve value to control Iridix core
u32ContrastIridix8 contrast control parameter
u32IridixOnIridix enable: 0=off, 1=on
u32FilterMuxSelects between Iridix8 and Iridix7: 1 for Iridix8, 0 for Iridix7
u32VarianceSpaceSets the degree of spatial sensitivity in Irdx7F algorithm
u32VarianceIntensitySets the degree of luminance sensitivity in Irdx7F algorithm
u32SlopeMax, u32SlopeMinLimits the maximum and minimum slope (gain) generated by the adaptive algorithm
u32FwdPerceptCtrl, u32RevPerceptCtrlIridix gamma processing selection: 0=pass through, 1=gamma_dl, 2=sqrt, 3=gamma_lut.
u32FwdAlpha, u32RevAlphaAlpha for gamma_dl
u32GtmSelectGlobal Tone map selection: 0 - local TM, 1 - full global TM

HB_ISP_CNR_ATTR_S

Structure Definition

typedef struct HB_ISP_CNR_ATTR_S {
uint16_t u16UvDelta12Slope[ISP_AUTO_ISO_STRENGTH_NUM][2];
} ISP_CNR_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
u16UvDelta12SlopeStrength values for color noise reduction in 12 steps

HB_ISP_SINTER_ATTR_S

Structure Definition

typedef struct HB_ISP_SINTER_AUTO_ATTR_S {
uint16_t aau16Strength[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t aau16Strength1[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t aau16Strength4[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t aau16Thresh1[ISP_AUTO_ISO_STRENGTH_NUM][2];
uint16_t aau16Thresh4[ISP_AUTO_ISO_STRENGTH_NUM][2];
} ISP_SINTER_AUTO_ATTR_S;

typedef struct HB_ISP_SINTER_MANUAL_PARAM_ATTR_S {
uint32_t u32GlobalStrength;
uint32_t u32Thresh1h;
uint32_t u32Thresh4h;
uint32_t u32Thresh1v;
uint32_t u32Thresh4v;
uint32_t u32Strength1;
uint32_t u32Strength4;
uint32_t u32NoiseLevel0;
uint32_t u32NoiseLevel1;
uint32_t u32NoiseLevel2;
uint32_t u32NoiseLevel3;
uint32_t u32IntConfig;
uint32_t u32SadFiltThresh;
} ISP_SINTER_MANUAL_PARAM_ATTR_S;

typedef struct HB_ISP_SINTER_ATTR_S {
ISP_OP_TYPE_E enOpType;
ISP_SINTER_AUTO_ATTR_S stAuto;
ISP_SINTER_MANUAL_PARAM_ATTR_S stManual;
} ISP_SINTER_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
aau16StrengthGlobal offset for noise reduction
aau16Strength1Effect of noise reduction on high spatial frequencies
aau16Strength4Effect of noise reduction on low spatial frequencies
aau16Thresh1Noise threshold for high horizontal/vertical spatial frequencies
aau16Thresh4Noise threshold for low horizontal/vertical spatial frequencies
u32GlobalStrengthGlobal fundamental noise reduction intensity, with each frequency band's noise reduction on top of this intensity.
u32Thresh1hHorizontal high-frequency noise threshold
u32Thresh4hHorizontal low-frequency noise threshold
u32Thresh1vVertical high-frequency noise threshold
u32Thresh4vVertical low-frequency noise threshold
u32Strength1High-frequency noise reduction strength
u32Strength4Low-frequency noise reduction strength
u32NoiseLevel0VS frame noise level
u32NoiseLevel1S frame noise level
u32NoiseLevel2M frame noise level
u32NoiseLevel3L frame noise level
u32IntConfigFusion intensity
u32SadFiltThreshBlock matching differential filter threshold
enOpTypeSelection between auto and manual modes (auto/manual)
stAutoAuto mode parameters
stManualManual mode parameters

HB_ISP_TEMPER_ATTR_S

Structure Definition

typedef struct HB_ISP_TEMPER_ATTR_S {
uint16_t aau16strength[16][2];
uint32_t u32RecursionLimit;
uint32_t u32LutEnable;
} ISP_TEMPER_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
aau16strengthNoise reduction effect for temporal frequencies
u32RecursionLimitControls the filter history length; low values result in a longer history and stronger temporal filtering. Range: [0, 16]
u32LutEnableChooses between LUT or exp_mask. Range: [0, 3]

HB_MESH_SHADING_ATTR_S

Structure Definition

typedef struct HB_MESH_SHADING_ATTR_S {
uint32_t u32Enable;
uint32_t u32MeshScale;
uint32_t u32MeshAlphaMode;
uint32_t u32MeshWidth;
uint32_t u32MeshHeight;
uint32_t u32ShadingStrength;
} MESH_SHADING_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
u32EnableEnables lens mesh shading correction: 0=off, 1=on.
u32MeshScaleSelects mesh shading correction precision and gain range; higher values result in increased precision and gain. Range: 00 -> 0..2 to 07 -> 1..9 (float).
u32MeshAlphaModeSets alpha blending between mesh shading tables; 0 = no blending, 1 = 2 banks (odd/even bytes), 2 = 4 banks per dword.
u32MeshWidthNumber of horizontal nodes; valid values: [0-63]
u32MeshHeightNumber of vertical nodes; valid values: [0-63]
u32ShadingStrengthMesh strength in 4.12 format, e.g., 0 = no correction, 4096 = correction to match mesh data. Can adjust shading based on AE. Range: [0-4096]

HB_MESH_SHADING_LUT_S

Structure Definition

typedef struct HB_MESH_SHADING_LUT_S {
uint8_t au8LsAR[1024];
uint8_t au8LsAG[1024];
uint8_t au8LsAB[1024];
uint8_t au8LsTl84R[1024];
uint8_t au8LsTl84G[1024];
uint8_t au8LsTl84B[1024];
uint8_t au8LsD65R[1024];
uint8_t au8LsD65G[1024];
uint8_t au8LsD65B[1024];
} MESH_SHADING_LUT_S;

Function Description

Member Descriptions

MemberMeaning
au8LsARMesh shading R correction table under 'a' light
au8LsAGMesh shading G correction table under 'a' light
au8LsABMesh shading B correction table under 'a' light
au8LsTl84RMesh shading R correction table under TL84 light
au8LsTl84GMesh shading G correction table under TL84 light
au8LsTl84BMesh shading B correction table under TL84 light
au8LsD65RMesh shading R correction table under D65 light
au8LsD65GMesh shading G correction table under D65 light
au8LsD65BMesh shading B correction table under D65 light

HB_RADIAL_SHADING_ATTR_S

Structure Definition

typedef struct HB_RADIAL_SHADING_ATTR_S {
uint32_t u32Enable;
uint32_t u32CenterRX;
uint32_t u32CenterRY;
uint32_t u32CenterGX;
uint32_t u32CenterGY;
uint32_t u32CenterBX;
uint32_t u32CenterBY;
uint32_t u32OffCenterMultRX;
uint32_t u32OffCenterMultRY;
uint32_t u32OffCenterMultGX;
uint32_t u32OffCenterMultGY;
uint32_t u32OffCenterMultBX;
uint32_t u32OffCenterMultBY;
} RADIAL_SHADING_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
u32EnableSet to 1 to enable radial shading correction.
u32CenterRXX coordinates for R shading map center. Values: [0-65535]
u32CenterRYY coordinates for R shading map center. Values: [0-65535]
u32CenterGXX coordinates for G shading map center. Values: [0-65535]
u32CenterGYY coordinates for G shading map center. Values: [0-65535]
u32CenterBXX coordinates for B shading map center. Values: [0-65535]
u32CenterBYY coordinates for B shading map center. Values: [0-65535]
u32OffCenterMultRXScaling factor for R, G, B radial table to image edge. Calculated as 2^31 / (R^2), where R is the max distance to edge in pixels. Values: [0-65535]
u32OffCenterMultRY
u32OffCenterMultGX
u32OffCenterMultGY
u32OffCenterMultBX
u32OffCenterMultBY

HB_RADIAL_SHADING_LUT_S

Structure Definition

typedef struct HB_RADIAL_SHADING_LUT_S {
uint16_t au16RGain[129];
uint16_t au16GGain[129];
uint16_t au16BGain[129];
} RADIAL_SHADING_LUT_S;

Function Description

Member Descriptions

MemberMeaning
au16RgainCorrective R gain array
au16GgainCorrective G gain array
au16BgainCorrective B gain array

HB_ISP_CSC_ATTR_S

Structure Definition

typedef struct HB_ISP_CSC_ATTR_S {
uint32_t u32ClipMinY;
uint32_t u32ClipMaxY;
uint32_t u32ClipMinUV;
uint32_t u32ClipMaxUV;
uint32_t u32MaskRY;
uint32_t u32MaskGU;
uint32_t u32MaskBV;
uint16_t aau16Coefft[12];
} ISP_CSC_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
u32ClipMinYMinimal Y value. Values below this threshold are clipped. Range: [0-1023]
u32ClipMaxYMaximal Y value. Values above this threshold are clipped. Range: [0-1023]
u32ClipMinUVMinimal Cb/Cr value. Values below this threshold are clipped. Range: [0-1023]
u32ClipMaxUVMaximal Cb/Cr value. Values above this threshold are clipped. Range: [0-1023]
u32MaskRYData mask for channel 1 (R or Y). Bitwise AND with video data. Range: [0-1023]
u32MaskGUData mask for channel 2 (G or U). Bitwise AND with video data. Range: [0-1023]
u32MaskBVData mask for channel 3 (B or V). Bitwise AND with video data. Range: [0-1023]
aau16Coefft[12]Coefficients in the 3x3 conversion matrix. Includes offset coefficients. Range: [0-65535] (Refer to Section 1.13 for coefficient details)

HB_ISP_SCENE_MODES_ATTR_S

Structure Definition

typedef struct HB_ISP_SCENE_MODES_ATTR_S {
uint32_t u32ColorMode;
uint32_t u32BrightnessStrength;
uint32_t u32ContrastStrength;
uint32_t u32SaturationStrength;
uint32_t u32HueTheta;
} ISP_SCENE_MODES_ATTR_S;

Function Description

Member Descriptions

MemberMeaning
u32ColorModeSelect the ISP color mode. Values: {NORMAL} {BLACK_AND_WHITE} {NEGATIVE} {SEPIA} {VIVID} Default: {NORMAL}
u32BrightnessStrengthControls exact brightness level. Range: [0-255] Key: 128 = Standard Brightness, etc. Default: 128
u32ContrastStrengthControls exact contrast level. Range: [0-255] Key: 128 = Standard Contrast, etc. Default: 128
u32SaturationStrengthControls exact saturation level. Range: [0-255] Key: 128 = Standard Saturation, etc. Default: 128
u32HueThetaControls exact hue angle. Range: [0-360] Key: 128 = Standard Hue, etc. Default: 180

HB_ISP_STATISTICS_AWB_ZONE_ATTR_S

Structure Definition:

typedef struct HB_ISP_STATISTICS_AWB_ZONE_ATTR_S {
uint16_t u16Rg;
uint16_t u16Bg;
uint32_t u32Sum;
} ISP_STATISTICS_AWB_ZONE_ATTR_S;

Function Description:

AWB zone statistics parameters.

Member Descriptions:

MemberMeaning
u16RgAverage Green/Red or Red/Green ratio
u16BgAverage Green/Blue or Blue/Green ratio
u32SumNumber of pixels used for AWB

HB_ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S

Structure Definition:

typedef struct HB_ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S {
uint16_t u16Hist0;
uint16_t u16Hist1;
uint16_t u16Hist3;
uint16_t u16Hist4;
} ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S;

Function Description:

AE-5bin zone statistics.

Member Descriptions:

MemberMeaning
u16Hist05-bin histogram for hist0
u16Hist15-bin histogram for hist1
u16Hist35-bin histogram for hist3
u16Hist45-bin histogram for hist4

HB_ISP_AE_PARAM_S

Structure Definition:

typedef struct HB_ISP_AE_PARAM_S {
uint32_t u32TotalGain;
ISP_OP_TYPE_E GainOpType;
uint32_t u32IntegrationTime;
uint32_t u32ExposureRatio;
ISP_OP_TYPE_E IntegrationOpType;
} ISP_AE_PARAM_S;

Function Description:

Member Descriptions:

MemberMeaning
u32TotalGainTotal exposure time (ae_total_gain = sensor_again + sensor_dgain + isp_dgain), range [0, 765]
GainOpTypeManual/Auto gain selection
u32IntegrationTimeLine control (in microseconds)
u32ExposureRatioExposure ratio value, valid in HDR mode
IntegrationOpTypeManual/Auto line selection

HB_ISP_AE_ROI_ATTR_S

Structure Definition:

typedef struct HB_ISP_AE_ROI_ATTR_S {
uint8_t u8XStart;
uint8_t u8YStart;
uint8_t u8XEnd;
uint8_t u8YEnd;
} ISP_AE_ROI_ATTR_S;

Function Description:

Member Descriptions:

MemberMeaning
u8XStartROI x-coordinate start, [0, 255]
u8YStartROI y-coordinate start, [0, 255]
u8XEndROI x-coordinate end, [0, 255]
u8YEndROI y-coordinate end, [0, 255]

ISP_ZONE_ATTR_S

Structure Definition:

typedef struct HB_ISP_ZONE_ATTR_S {
uint8_t u8Horiz;
uint8_t u8Vert;
} ISP_ZONE_ATTR_S;

Function Description:

For adjusting AF/AWB zones.

Member Descriptions:

MemberMeaning
u8HorizHorizontal zones count
u8VertVertical zones count

HB_ISP_STATISTICS_LUMVAR_ZONE_ATTR_S

Structure Definition:

typedef struct HB_ISP_STATISTICS_LUMVAR_ZONE_ATTR_S {
uint16_t u16Var;
uint16_t u16Mean;
} ISP_STATISTICS_LUMVAR_ZONE_ATTR_S;

Function Description:

Member Descriptions:

MemberMeaning
u16VarLuminance variance statistic
u16MeanLuminance mean statistic

ISP_AWB_STAT_AREA_ATTR_S

Structure Definition:

typedef struct HB_ISP_AWB_STAT_AREA_ATTR_S {
uint32_t u32WhiteLevel; // Upper limit of valid data for AWB, range: [0, 1023]
uint32_t u32BlackLevel; // Lower limit of valid data for AWB, range: [0, 1023]
uint32_t u32CrRefMax; // Maximum reference value for Cr channel, range: [0, 4095]
uint32_t u32CrRefMin; // Minimum reference value for Cr channel, range: [0, 4095]
uint32_t u32CbRefMax; // Maximum reference value for Cb channel, range: [0, 4095]
uint32_t u32CbRefMin; // Minimum reference value for Cb channel, range: [0, 4095]
uint32_t u32CrRefHigh; // High reference value for Cr channel, range: [0, 4095]
uint32_t u32CrRefLow; // Low reference value for Cr channel, range: [0, 4095]
uint32_t u32CbRefHigh; // High reference value for Cb channel, range: [0, 4095]
uint32_t u32CbRefLow; // Low reference value for Cb channel, range: [0, 4095]
} ISP_AWB_STAT_AREA_ATTR_S;

Function Description:

Member Descriptions:

MemberMeaning
u32WhiteLevelMaximum valid data for white balance calibration
u32BlackLevelMinimum valid data for white balance calibration
Other membersStatistical data range, see section 1.14.1 for details

HB_ISP_AE_CONTROL

Structure Definition:

typedef struct HB_ISP_AE_CONTROL {
uint32_t u32AeControl[9]; // AE control module
uint16_t u16AeControlHdrTarget[8][2]; // AE HDR target control, target modulated by total gain
} ISP_AE_CONTROL;

Function Description:

Member Descriptions:

MemberMeaning
u32AeControlControl parameters for the AE module
u16AeControlHdrTargetTarget values for AE HDR control, adjusted by total gain

HB_ISP_AE_CORRECTION

Structure Definition:

typedef struct HB_ISP_AE_CORRECTION {
uint8_t u8AeCorrection[12]; // Calibration values for fine-tuning AE compensation
uint32_t u32AeEXPCorrection[12]; // Calibration values for fine-tuning exposure value settings
} ISP_AE_CORRECTION;

Function Description:

Member Descriptions:

MemberMeaning
u8AeCorrectionCalibration values for adjusting the strength of the AE compensation parameter
u32AeEXPCorrectionCalibration values for setting the exposure value nodes using fine-tuning parameters

HB_ISP_5BIN_HIST

Structure Definition:

typedef struct HB_ISP_5BIN_HIST {
uint16_t u16HistThresh01; // AE 5-bin histogram threshold for bin 1
uint16_t u16HistThresh12; // AE 5-bin histogram threshold for bin 2
uint16_t u16HistThresh23; // AE 5-bin histogram threshold for bin 3
uint16_t u16HistThresh34; // AE 5-bin histogram threshold for bin 4
} ISP_5BIN_HIST;

Function Description:

Member Descriptions:

MemberMeaning
u16HistThresh01Value for AE 5-bin histogram bin 1
u16HistThresh12Value for AE 5-bin histogram bin 2
u16HistThresh23Value for AE 5-bin histogram bin 3
u16HistThresh34Value for AE 5-bin histogram bin 4

Note:

Due to hardware resource constraints, the first four values in the 5-bin AE histogram can be used to compute the remaining bins.

HB_ISP_EXP_RATIO_ADJ

Structure Definition:

typedef struct HB_ISP_EXP_RATIO_ADJ {
uint16_t u16ExpRatioAdj[4][2]; // Adjustments for pixel clipping in long exposures
} ISP_EXP_RATIO_ADJ;

Function Description:

Member Descriptions:

MemberMeaning
u16ExpRatioAdjPixel clipping adjustments for long exposure scenarios

HB_ISP_EXP_PAT_LUTS

Structure Definition:

typedef struct HB_ISP_EXP_PAT_LUTS {
uint16_t u16ExpPatLuts[2][10];
} ISP_EXP_PAT_LUTS;

Function Description:

Member Descriptions:

MemberMeaning
u16ExpPatLutsPartition lookup tables to split exposure value, also known as expos, corresponding to API->TALGORITHMS->AE_SPLIT_BALANCED. Range: [10]-[19] (exp_time, gain, exp_time unit: ms, gain unit: 1 = 1x gain, 2 = 2x gain.)

HB_ISP_AWB_MAX_BGAIN

Structure Definition:

typedef struct HB_ISP_AWB_MAX_BGAIN {
uint16_t u16AwbBgMaxGain[3][2];
} ISP_AWB_BG_MAX_GAIN;

Function Description:

Member Descriptions:

MemberMeaning
u32AwbBgMaxGainMaximum AWB background gain based on total gain

HB_ISP_CCM_SATURA_STRENG

Structure Definition:

typedef struct HB_ISP_CCM_SATURA_STRENG {
uint16_t u16CcmSatStre[9][2];
} ISP_CCM_SATURA_STRENG;

Function Description:

Member Descriptions:

MemberMeaning
u16CcmSatStreLookup table for Saturation Strength values

HB_ISP_MT_ABSOLUTE_LS

Structure Definition:

typedef struct HB_ISP_MT_ABSOLUTE_LS {
uint16_t u16AbsoluteLsACcm[9];
uint16_t u16AbsoluteLsD40Ccm[9];
uint16_t u16AbsoluteLsD50Ccm[9];
uint16_t u16AbsoluteLsU30Ccm[9];
} ISP_MT_ABSOLUTE_LS;

Function Description:

Member Descriptions:

MemberMeaning
u16AbsoluteLsACcmCalibration values for CCM under A lighting conditions
u16AbsoluteLsD40CcmCalibration values for CCM under D40 lighting conditions
u16AbsoluteLsD50CcmCalibration values for CCM under D50 lighting conditions
u16AbsoluteLsU30CcmCalibration values for CCM under U30 lighting conditions

HB_ISP_CCM_ONE_GAIN_THRESHOLD

Structure Definition:

typedef struct HB_ISP_CCM_ONE_GAIN_THRESHOLD {
uint16_t u16CcmOneGainThreshold;
} ISP_CCM_ONE_GAIN_THRESHOLD;

Function Description:

Member Descriptions:

MemberMeaning
u16CcmOneGainThresholdThreshold value for a single-gain Color Correction Matrix

HB_ISP_GAMMA_EV1

Structure Definition:

typedef struct HB_ISP_GAMMA_EV1 {
uint16_t u16GammaEv1[129];
} ISP_GAMMA_EV1;

Function Description:

Member Descriptions:

MemberMeaning
u16GammaEv1Dynamic gamma lut-1 values

HB_ISP_GAMMA_EV2

Structure Definition

typedef struct HB_ISP_GAMMA_EV2 {
uint16_t u16GammaEv2[129];
} ISP_GAMMA_EV2;

Function Description

Member Descriptions

MemberMeaning
u16GammaEv2Dynamic gamma lookup table (lut-2) values

HB_ISP_GAMMA_THRESHOLD

Structure Definition

typedef struct HB_ISP_GAMMA_THRESHOLD {
uint32_t u32GammaThreshold[3];
} ISP_GAMMA_THRESHOLD;

Function Description

Member Descriptions

MemberMeaning
u32GammaThresholdArray of log2 exposure value thresholds (exposure_log2 = sensor_gain * sensor_dgain * line * isp_dgain). Index 0 is off, 1 is on. If the interface version has only two elements, it defaults to off.

HB_ISP_AWB_CCT_CTRL_S

Structure Definition

typedef struct HB_ISP_AWB_CCT_CTRL_S {
uint16_t u16AwbColourPre[4];
uint16_t u16AwbWarmLsA[3];
uint16_t u16AwbWarmLsD75[3];
uint16_t u16AwbWarmLsD50[3];
} ISP_AWB_CCT_CTRL_S;

Function Description

Member Descriptions

MemberMeaning
u16AwbColourPreCalibration values for auto white balance color preference CCT
u16AwbWarmLsACalibration values for auto white balance under A lighting conditions
u16AwbWarmLsD75Calibration values for auto white balance under D75 lighting conditions
u16AwbWarmLsD50Calibration values for auto white balance under D65 lighting conditions

HB_ISP_MIX_LIGHT_PARAM_S

Structure Definition

typedef struct HB_ISP_MIX_LIGHT_PARAM_S {
uint32_t u32MixLightParm[8];
} ISP_MIX_LIGHT_PARAM_S;

Function Description

Member Descriptions

MemberMeaning
u32MixLightParmArray of mix light parameters, including enable/disable, lux boundaries, contrast threshold, and LUT ranges

HB_ISP_SKY_PARAM_S

Structure Definition

typedef struct HB_ISP_SKY_PARAM_S {
uint16_t u16SkyLuxTh;
uint16_t u16WbStrength[3];
uint16_t u16Ct65Pos;
uint16_t u16Ct40Pos;
} ISP_SKY_PARAM_S;

Function Description

Member Descriptions

MemberMeaning
u16SkyLuxThSky scene luminosity threshold value for detection
u16WbStrengthWhite Balance gain adjuster strength values for sky scenes, applied to RG and BG channels
u16Ct65PosPosition in the color temperature array closest to 1e6/6500, in calibration_COLOR_TEMP units
u16Ct40PosPosition in the color temperature array closest to 1e6/4000, in calibration_COLOR_TEMP units

HB_TMPER_NP_LUT_S

Structure Definition:

typedef struct HB_TMPER_NP_LUT_S {
uint8_t au8Np[128];
} TEMPER_NP_LUT_S;

Function Description:

NOISE_PROFILE--LUT

Member Descriptions:

MemberMeaning
au8NpThe lookup table for noise profile calibrations, corresponding to Control Tool's Dynamic calibrations under AE_ZONE_WGHT_HOR, AE_ZONE_WGHT_VER. This area's weight value is calculated as (int(ae_zone_wght_ver * ae_zone_wght_hor) / 16) - (int(ae_zone_wght_ver * ae_zone_wght_hor/16 > 1 ? 1 : 0)) (where int(ae_zone_wght_ver * ae_zone_wght_hor/16 > 1) is 1 if the product is greater than 1, else 0).

HB_ISP_MESH_RGBG_WEIGHT_S

Structure Definition:

typedef struct HB_ISP_MESH_RGBG_WEIGHT_S {
uint16_t u16MeshRgbgWeight[15][15];
} ISP_MESH_RGBG_WEIGHT_S;

Function Description:

Member Descriptions:

MemberMeaning
u16MeshRgbgWeightCalibration LUT for AWB (Automatic White Balance) weighting.

HB_ISP_MESH_LS_WEIGHT_S

Structure Definition:

typedef struct HB_ISP_MESH_LS_WEIGHT_S {
uint16_t u16MeshLsWeight[15][15];
} ISP_MESH_LS_WEIGHT_S;

Function Description:

Member Descriptions:

MemberMeaning
u16MeshLsWeightCalibration LUT for extra light source weighting set during calibration in CALIBRATION_LIGHT_SRC.

HB_ISP_AWB_DEFAULT_PARAM_S

Structure Definition:

typedef struct HB_ISP_AWB_DEFAULT_PARAM_S {
uint16_t u16Ct30Pos;
} ISP_AWB_DEFAULT_PARAM_S;

Function Description:

Member Descriptions:

MemberMeaning
u16Ct30PosThe position in the color temperature scale closest to 1e6/3000 in the CALIBRATION_COLOR_TEMP array.

HB_ISP_MESH_COLOR_TEMP_WEIGHT_S

Structure Definition:

typedef struct HB_ISP_MESH_COLOR_TEMP_WEIGHT_S {
uint16_t u16MeshColorTempWeight[15][15];
} ISP_MESH_COLOR_TEMP_WEIGHT_S;

Function Description:

Member Descriptions:

MemberMeaning
u16MeshColorTempWeightWB (White Balance) calibration values for estimating color temperatures.

HB_ISP_AWB_POS_STATUS_S

Structure Definition:

typedef struct HB_ISP_AWB_POS_STATUS_S {
uint16_t u16AwbRgPos[15];
uint16_t u16AwbBgPos[15];
} ISP_AWB_POS_STATUS_S;

Function Description:

Member Descriptions:

MemberMeaning
u16AwbRgPosRed-Green position values
u16AwbBgPosBlue-Green position values

HB_ISP_AWB_LIGHT_SOURCE_S

Structure Definition:

typedef struct HB_ISP_AWB_LIGHT_SOURCE_S {
uint16_t u16ColorTemp[7];
uint16_t u16RgPosCalc[7];
uint16_t u16BgPosCalc[7];
} ISP_AWB_LIGHT_SOURCE_S;

Function Description:

Member Descriptions:

MemberMeaning
u16ColorTempAn array of values to set the temperature for specific light sources in the calibration process.
u16RgPosCalcLUT (Look-up Table) containing R:G calibration points for light sources used in the calibration process.
u16BgPosCalcLUT containing B:G calibration points for light sources used in the calibration process.

HB_ISP_WDR_OFFSET_S

Structure Definition:

typedef struct HB_ISP_WDR_OFFSET_S {
uint32_t u32WdrLR; // WDR mode long frame R offset
uint32_t u32WdrLGr; // WDR mode long frame Gr offset
uint32_t u32WdrLGb; // WDR mode long frame Gb offset
uint32_t u32WdrLB; // WDR mode long frame B offset
uint32_t u32WdrMR; // WDR mode medium frame R offset
uint32_t u32WdrMGr; // WDR mode medium frame Gr offset
uint32_t u32WdrMGb; // WDR mode medium frame Gb offset
uint32_t u32WdrMB; // WDR mode medium frame B offset
uint32_t u32WdrSR; // WDR mode short frame R offset
uint32_t u32WdrSGr; // WDR mode short frame Gr offset
uint32_t u32WdrSGb; // WDR mode short frame Gb offset
uint32_t u32WdrSB; // WDR mode short frame B offset
uint32_t u32WdrVsR; // WDR mode very short frame R offset
uint32_t u32WdrVsGr; // WDR mode very short frame Gr offset
uint32_t u32WdrVsGb; // WDR mode very short frame Gb offset
uint32_t u32WdrVsB; // WDR mode very short frame B offset
} ISP_WDR_OFFSET_S;

Function Description:

This structure defines the offsets for different frame types in WDR (Wide Dynamic Range) mode.

Member Descriptions:

MemberMeaning
u32WdrLRLong frame R offset in WDR mode
u32WdrLGrLong frame Green (Gr) offset in WDR mode
u32WdrLGbLong frame Blue (Gb) offset in WDR mode
u32WdrLBLong frame Blue (B) offset in WDR mode
u32WdrMRMedium frame R offset in WDR mode
u32WdrMGrMedium frame Green (Gr) offset in WDR mode
u32WdrMGbMedium frame Blue (Gb) offset in WDR mode
u32WdrMBMedium frame Blue (B) offset in WDR mode
u32WdrSRShort frame R offset in WDR mode
u32WdrSGrShort frame Green (Gr) offset in WDR mode
u32WdrSGbShort frame Blue (Gb) offset in WDR mode
u32WdrSBShort frame Blue (B) offset in WDR mode
u32WdrVsRVery short frame R offset in WDR mode
u32WdrVsGrVery short frame Green (Gr) offset in WDR mode
u32WdrVsGbVery short frame Blue (Gb) offset in WDR mode
u32WdrVsBVery short frame Blue (B) offset in WDR mode

HB_ISP_AF_LENS_INFO_S

Structure Definition:

typedef struct HB_ISP_AF_LENS_INFO_S {
uint32_t pos; // AF_MODE position
uint32_t range_low; // AF_RANGE_LOW range lower bound
uint32_t range_high; // AF_RANGE_HIGH range upper bound
} ISP_AF_LENS_INFO_S;

Function Description:

This structure holds information about the autofocus lens settings.

Member Descriptions:

MemberMeaning
posPosition of the autofocus mode setting
range_lowLower bound of the autofocus range
range_highUpper bound of the autofocus range

HB_ISP_AE_ATTR_EX_S

Structure Definition:

typedef struct HB_ISP_AE_ATTR_EX_S {
uint32_t u32Compensation; // AE_COMPENSATION_ID, default: 128, range: [0,255]
uint32_t u32Speed; // Convergence speed, frames to reach target
uint32_t u32Tolerance; // Tolerance level
uint32_t u32AeTarget; // AE target, input range [0,255], output range [0,256]
} ISP_AE_ATTR_EX_S;

Function Description:

This structure contains extended attributes for automatic exposure control.

Member Descriptions:

MemberMeaning
u32CompensationCompensation value (default 128, adjusts by 1/32 steps), 0-255 range, with 128 indicating no adjustment
u32SpeedSpeed of convergence to the target, larger values mean slower changes in exposure
u32ToleranceLevel of tolerance for exposure adjustments
u32AeTargetTarget exposure, input range 0-255, output range is 0-256 due to potential scaling during conversion

HB_AE_ZONES_WEIGHT_S

Structure Definition:

typedef struct HB_AE_ZONES_WEIGHT_S {
uint8_t au8Np[1089]; // Array of AE zones weights
} AE_ZONES_WEIGHT_S;

Function Description:

This structure holds the weights for each area in the exposure metering zones.

Member Descriptions:

MemberMeaning
au8NpArray of 1089 AE zone weights

Additional Information:

The AE (Analog Exposure) area weighting table is determined by both AE_ZONE_WGHT_VER and AE_ZONE_WGHT_HOR. These two look-up tables (LUTs), as shown in the Control Tool screenshot, consist of 32 values each, with a 16-bit precision. The values range from 0 to 15, where 0 indicates no counting for that block, 1 counts once, 2 counts twice, and so on. The value 15 has a special meaning, which counts the block 16 times.

image-20221118175019755

AE_ZONES_WEIGHT, also depicted in the Control Tool, divides the entire image into horz_zones (33) by vore_zones (33) blocks, resulting in a total of 1089 values. The weight for each zone can be calculated using the formula: (int(ae_zone_wght_ver * ae_zone_wght_hor) / 16) - (int(ae_zone_wght_ver * ae_zone_wght_hor/16 > 1 ? 1 : 0)). If ae_zone_wght_ver * ae_zone_wgt_hor divided by 16 is greater than 1, it returns 1; otherwise, it returns 0.

image-20221118180830337

AE_ZONE_WGHT_HOR represents the weight coefficient for rows along the vertical axis. A data point controls a specific number of columns based on the horz_zones, which is calculated as 1 + int((horz_zones - 1) / AE_ZONE_WGHT_HOR's LUT length). For example, with a 33x33 grid, a single index in AE_ZONE_WGHT_HOR would control 2 columns (since 1 + int((33 - 1) / 32) = 2). The center index (half the LUT length) of AE_ZONE_WGHT_HOR's LUT controls the middle column(s). As shown in images 1-4, the indices to the left and right of the center point determine the columns they control.

image-20221118184855810

Figure 1

image-20221118183608168

Figure 2

image-20221118185143974

Figure 3

image-20221118185333583

Figure 4

AE_ZONE_WGHT_VER follows a similar pattern for the horizontal axis, with the LUT index controlling the row count according to the same principle as AE_ZONE_WGHT_HOR.

Sample ISP Code Reference:

The ISP (Image Signal Processor) system code reference can be found in the sample_isp section.