hi_mpi_isp_set_ae_route_sf_attr_ex
Description
Sets the extended attributes of the AE allocation policy for short frames in WDR mode. The exposure of short frames calculated by the AE algorithm is allocated based on the configured route. You can set the allocation priorities of the exposure time, sensor analog gain, sensor digital gain, ISP digital gain, and iris as required.
Prototype
hi_s32 hi_mpi_isp_set_ae_route_sf_attr_ex(hi_vi_pipe vi_pipe, const hi_isp_ae_route_ex *ae_route_sf_attr_ex)
Constraints
- This API is used to set the extended attributes of the AE allocation policy for short frames in WDR mode. The exposure of short frames calculated by the AE algorithm is allocated based on the configured route. You can set the allocation priorities of the exposure time, sensor analog gain, sensor digital gain, ISP digital gain, and iris as required.
- You can choose whether to validate the extended attributes of the AE allocation policy by configuring ae_route_ex_valid of hi_mpi_isp_set_exposure_attr. If ae_route_ex_valid is set to HI_TRUE, the extended AE route is used. Otherwise, the normal AE route prevails.
- Note the following limitations when allocating the extended AE route:
At most 16 nodes are supported. Each node has five components, including the exposure time, sensor analog gain, sensor digital gain, ISP digital gain, and iris.
The unit of the exposure time for a node is μs, and the exposure time cannot be set to 0. It cannot be too small. Otherwise, the number of actual corresponding exposure lines is 0 and exceptions may occur. The exposure time of a node must be less than or equal to half of the maximum exposure time of the sensor.
Only the P-Iris component is used. The iris component is invalid when the DC-Iris or the manual iris is used because the DC-Iris cannot be precisely controlled. That is, when the iris type is DC-Iris, the node iris component has no effect on exposure allocation. The iris component is controllable only when short frames are set as the priority frames.
The node exposure is the product of the exposure time, sensor analog gain, sensor digital gain, ISP digital gain, and iris. The node exposure is monotonically increasing. To be specific, the exposure of a node is greater than or equal to that of the previous node. The exposure of the first node is the lowest, and the exposure of the last one is the highest.
If the exposure of adjacent nodes increases, the value of a component should increase while the values of other components remain unchanged. The component with an increased value determines the allocation policy of the route. For example, if the value of the sensor analog gain component increases, the allocation policy of the route is sensor analog gain first.
The nodes cannot be configured to have the same exposure.
You can set the route based on the application scenario. The allocation route can be dynamically switched.
The AE allocation route cannot be used to limit the maximum and minimum values of exposure parameters. If the current exposure value is not within the configured route range, that is, the exposure value exceeds the range between the first node and the last node, the exposure parameter allocation exceeds the node limit but does not exceed the limit of the parameter.
According to the default extended AE allocation policy for the DC-Iris and manual iris, the exposure time, sensor analog gain, sensor digital gain, and ISP digital gain are allocated in sequence. According to the default extended AE allocation policy for the P-Iris, the iris is adjusted to the maximum size, and then the exposure time, sensor analog gain, sensor digital gain, and ISP digital gain are allocated in sequence. If the current exposure does not fall within the configured route range, the default allocation policy is used.
When the DC-Iris and P-Iris are switched in online mode, the extended AE route is reset to the default allocation policy that matches the iris type. You can configure the AE route for short frames as required when switching the iris type.
When long frames take the priority, separate gain configuration is disabled, and the linear mode is used, the extended AE route for short frames does not take effect.
If the maximum exposure time is changed during automatic frame rate reduction, the changed value is updated to the allocation route.
During the switchover between the linear mode and WDR mode, if the extended AE route for short frames is configured in cmos.c and the identifier of the extended AE route (ae_route_ex_valid) in cmos.c is set to HI_TRUE, the extended AE route for short frames in cmos.c is used after mode switching. Otherwise, the default AE route for short frames is used.
In 2-to-1 WDR mode, during the frame rate switching or resolution switching, if the configured maximum target exposure time is greater than the maximum exposure time allowed by one frame after switching, the maximum exposure time for the allocation route is changed to the maximum exposure time allowed by one frame after switching.
During automatic frame rate reduction, switchover between the liner mode and WDR mode, frame rate or resolution switching, priority frame switching, separate configuration and switching of gains, or when the maximum/minimum value of the exposure time or gain is limited, the extended AE route for short frames that takes effect may be different from that configured in the MPI. In this case, you can call hi_mpi_isp_query_exposure_info to obtain the extended AE route for short frames that takes effect.
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
vi_pipe |
Input |
VI pipe ID Value range: [0, 8) |
ae_route_sf_attr_ex |
Input |
Pointer to the extended AE allocation attributes for short frames |
Returns
- 0: success
- Other values: failure. For details, see Error Codes.
Example
hi_vi_pipe vi_pipe = 0;
hi_isp_exposure_attr exp_attr;
hi_isp_ae_route_ex ae_route_sf_attr_ex;
hi_u32 route_ex_node [6][5]
= {{ 30, 1024, 1024, 1024, 0},
{ 30, 1024, 1024, 1024, 10},
{ 30, 16384, 1024, 1024, 10},
{20000, 16384, 1024, 1024, 10},
{20000, 16384, 16384, 1024, 10},
{20000, 16384, 16384, 4096, 10}};
hi_mpi_isp_get_ae_route_sf_attr_ex(vi_pipe, & ae_route_sf_attr_ex);
hi_mpi_isp_get_exposure_attr(vi_pipe, &exp_attr);
exp_attr.ae_route_ex_valid = HI_TRUE;
ae_route_sf_attr_ex.total_num = 6;
memcpy(ae_route_sf_attr_ex.route_ex_node, route_ex_node, sizeof(route_ex_node)); hi_mpi_isp_get_ae_route_sf_attr_ex(vi_pipe, & ae_route_sf_attr_ex);
hi_mpi_isp_set_exposure_attr(vi_pipe, &exp_attr);