hi_isp_ae_info

Description

Defines the statistics provided by the ISP for the AE algorithm library.

Definition

typedef struct {
    hi_u32  frame_cnt;    /* the counting of frame */
    hi_isp_fe_ae_stat_1 *fe_ae_stat1;
    hi_isp_fe_ae_stat_2 *fe_ae_stat2;
    hi_isp_fe_ae_stat_3 *fe_ae_stat3;
    hi_isp_fe_ae_stitch_stat_3 *fe_ae_sti_stat;
    hi_isp_fe_ae_stat_1 *be_ae_stat1;
    hi_isp_fe_ae_stat_2 *be_ae_stat2;
    hi_isp_fe_ae_stat_3 *be_ae_stat3;
    hi_isp_fe_ae_stitch_stat_3 *be_ae_sti_stat;
} hi_isp_ae_info;

Members

Member

Description

frame_cnt

Counts of frames. The value range is [0, 0xFFFFFFFF].

fe_ae_stat1

Total number of pixels involved in statistics

Total number of pixels involved in weight statistics

Statistics array of the 1024-segment histogram. The value range is [0, 0xFFFFFFFF].

fe_ae_stat2

Average value of R component in global statistics. The value range is [0, 0xFFFF].

Average value of Gr component in global statistics. The value range is [0, 0xFFFF].

Average value of Gb component in global statistics. The value range is [0, 0xFFFF].

Average value of B component in global statistics. The value range is [0, 0xFFFF].

fe_ae_stat3

Average values of components R, Gr, Gb, and B during zoned statistics. The value range is [0, 0xFFFF].

fe_ae_sti_stat

Average values of the R, Gr, Gb, and B components during zoned statistics after stitching. This parameter is valid in stitching mode, and the value range is [0, 0xFFFF].

Only average values of zoned statistics of pipes in stitching are valid, and the average values of other pipes are invalid.

be_ae_stat1

Total number of pixels involved in statistics

Total number of pixels involved in weight statistics

Statistics array of the 1024-segment histogram. The value range is [0, 0xFFFFFFFF].

be_ae_stat2

Average value of R component in global statistics. The value range is [0, 0xFFFF].

Average value of Gr component in global statistics. The value range is [0, 0xFFFF].

Average value of Gb component in global statistics. The value range is [0, 0xFFFF].

Average value of B component in global statistics. The value range is [0, 0xFFFF].

be_ae_stat3

Average values of components R, Gr, Gb, and B during zoned statistics. The value range is [0, 0xFFFF].

be_ae_sti_stat

Average values of the R, Gr, Gb, and B components during zoned statistics after stitching. This parameter is valid in stitching mode, and the value range is [0, 0xFFFF].

Only average values of zoned statistics of pipes in stitching are valid, and the average values of other pipes are invalid.

Restrictions

  • The operation frequency (for example, once per two frames) of the AE algorithm library can be controlled by setting frame_cnt.
  • fe_ae_stat1 and be_ae_stat1 indicate global 1024-segment histogram statistics in the FE and BE, respectively. The statistics are collected from upper 10-bit data in the input data streams, and data in each bin indicates the number of pixels corresponding to the grayscale value. Global 1024-segment histograms are affected by zone weights, and the sum of the data in 1024 bins is the number of pixels involved in weight statistics. Currently, only Gr channel statistics are used in the AE algorithm. In the scenario with a large red region, R and Gb channel statistics are used. In the scenario with a large blue region, B and Gr channel statistics are used.
  • When data_rate of MIPI and VI DEV is set to DATA_RATE_X2, the numbers of pixel_count and pixel_weight in fe_ae_stat1 are halved.
  • fe_ae_stat2 and be_ae_stat2 indicate the average values of the global components R, Gr, Gb, and B when only the upper 16 bits of the components are collected for statistics in FE and BE, respectively. The value range is [0, 0xFFFF]. The average values of the global components R, Gr, Gb, and B are affected by zone weights.
  • fe_ae_stat3 and be_ae_stat3 indicate the average values of the components R, Gr, Gb, and B for each zone in the 15 x 17 zones when only the upper 16 bits of the components are collected for statistics in FE and BE, respectively. The value range is [0, 0xFFFF].
  • For the AE statistical module, the input data can be collected for statistics after root extraction. Root extraction is performed after the input data is normalized to 1. Take the 1024-segment histogram statistics with 12-bit input data and 2048 being a pixel value as an example. If root extraction is disabled, the upper 10 bits are directly used for statistics, and data in the histogram is the number of bin pixels corresponding to grayscale value 512 plus 1. If root extraction is enabled, the pixel value 2048 is normalized to 1, and the value 0.5 is obtained. Then, root extraction is performed to obtain the value 0.707, which can be represented as 724 in 10-bit data. In this case, data in the histogram is the number of bin pixels corresponding to grayscale value 724 plus 1. This proves that a small pixel value is greatly increased after data root extraction, meaning that the statistical precision of the dark region is improved by decreasing the statistical precision of the bright region. It is recommended that data root extraction be enabled in WDR mode and disabled in linear mode. In root extraction, the statistical precision is 11 bits and the lower 5-bit value is 0. Therefore, the maximum value of 16-bit data is 0xFFE0. In addition, the position of the AE statistical module in the ISP pipeline can be changed. For details, see Statistics.
Table 1 Default configurations for members in hi_isp_ae_info

Member

Main Statistics

Default Position

Black Level

Weight Table Impact

fe_ae_stat1

1024-segment histogram before WDR fusion

After FE-WB

Not reduced

Yes

fe_ae_stat2

Global mean value before WDR fusion

After FE-WB

Not reduced

Yes

fe_ae_stat3

Mean value for blocks before WDR fusion

After FE-WB

Not reduced

No

be_ae_stat1

1024-segment histogram after WDR fusion

After BE-WB

Reduced

Yes

be_ae_stat2

Global mean value after WDR fusion

After BE-WB

Reduced

Yes

be_ae_stat3

Mean value for blocks after WDR fusion

After BE-WB

Reduced

No

  • The description in the table is valid only when the default ISP setting is used. The statistics are affected by the black level configuration and the position of AE statistics.
  • The statistics information before WDR fusion (FE) is fixed after the WB module and cannot be configured. When the FE statistics are used, the black level must be subtracted. A 10-bit black level should be subtracted from the histogram, and a 16-bit black level should be subtracted from the average value. The FE statistics before WDR fusion (FE) are affected by gains of the processing modules before FE AE (In the Atlas 200/500 A2 Inference Product, DG/WB is configured for the procesing modules before FE AE.). The algorithm ensures that FE gain values of the modules are the same as those of the BE. Therefore, you do not need to configure the FE gain separately.
  • In linear mode, you are advised to use the 1024-segment histogram before WDR fusion (FE). In WDR mode, you are advised to use the 1024-segment histogram before WDR fusion (FE) or the 1024-segment histogram in root extraction mode after WDR fusion (BE). When the service load is heavy, the real-time performance before WDR fusion (FE) is better. Therefore, the FE statistics are recommended. If the AE algorithm provided by the SDK uses the BE statistics, the non-root extraction mode is used for the BE statistics in linear mode, and the root extraction mode is used for the BE statistics in WDR mode by default. Otherwise, an exception may occur in the AE algorithm.