hi_mpi_isp_set_ae_route_sf_attr
Description
Sets the AE allocation policy attributes for short frames in WDR mode.
Prototype
hi_s32 hi_mpi_isp_set_ae_route_sf_attr(hi_vi_pipe vi_pipe, const hi_isp_ae_route *ae_route_sf_attr)
Constraints
- This MPI is used to set the AE allocation route for short frames in WDR mode. The exposure of short frames calculated by the AE is allocated based on the configured route. You can also set the exposure-first , gain-first, and iris-first modes.
- Note the following limitations when allocating AE route:
- A maximum of 16 nodes are supported. Each node has the exposure time, gain, and iris components. The gain includes analog gain, digital gain, and ISP digital gain.
- 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.
- 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, 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 gain component increases, the allocation policy of the route is 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 AE allocation policy for the DC-Iris and manual iris, the exposure time is allocated first, and then the gain is allocated. According to the default AE allocation policy for the P-Iris, the iris is adjusted to the maximum size, and then the exposure time and 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 AE route for short frames 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 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 the WDR mode, if an AE route for short frames is configured in cmos.c, the route in cmos.c is used after the switching. Otherwise, the default AE route for short frames is used.
- In 2-to-1 WDR mode, when the frame rate or resolution is switched, if the maximum exposure time set by the user is greater than half of the maximum exposure time allowed by one frame after the switching, the maximum exposure time of the allocated route is updated to half of the maximum exposure time allowed by the frame after the switching.
- In the previous situations, the effective AE route may be different from that configured by calling the MPI. In this case, you can
use hi_mpi_isp_query_exposure_info to obtain the effective AE route for short frames.
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
vi_pipe |
Input |
VI pipe ID Value range: [0, 8) |
ae_route_sf_attr |
Input |
Pointer to the data structure of the AE route attributes for short frames |
Returns
- 0: success
- Other values: failure. For details, see Error Codes.
Example
hi_vi_pipe vi_pipe = 0;
hi_isp_ae_route ae_route_sf_attr;
hi_u32 route_node [3][3] = {{100,1024,1},{20000,1024,1},{20000,16384,1}};
hi_mpi_isp_set_ae_route_sf_attr(vi_pipe, & ae_route_sf_attr);
ae_route_sf_attr.total_num = 3;
memcpy(ae_route_sf_attr. route_node, route_node, sizeof(route_node));
hi_mpi_isp_set_ae_route_sf_attr(vi_pipe, & ae_route_sf_attr);