40. Statistical information

40.1. Overview

This section describes the 3A statistics provided by ISP and the configuration method.

40.2. API Reference

The interface of statistical information must call CVI_ISP_Init interface.

40.2.1. CVI_ISP_SetStatisticsConfig

【Description】

Set ISP statistics configuration.

【Syntax】

CVI_S32 CVI_ISP_SetStatisticsConfig(VI_PIPE ViPipe, const ISP_STATISTICS_CFG_S *pstStatCfg);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstStatCfg

ISP statistics configuration

Input

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

// Set AE / AWB / AF related statistic window setting
VI_PIPE ViPipe = 0;
ISP_STATISTICS_CFG_S stsCfg;

// Set AE0 windows ROI.
stsCfg.stAECfg.stCrop[0].bEnable = 1;
stsCfg.stAECfg.stCrop[0].u16X = stsCfg.stAECfg.stCrop[0].u16Y = 0;
stsCfg.stAECfg.stCrop[0].u16W = 1920;
stsCfg.stAECfg.stCrop[0].u16H = 1080;

// Set the window number of AWB statistic value in x & y direction.
stsCfg.stWBCfg.u16ZoneRow = AWB_ZONE_ORIG_ROW;
stsCfg.stWBCfg.u16ZoneCol = AWB_ZONE_ORIG_COLUMN;

// Set AWB window ROI.
stsCfg.stWBCfg.stCrop.u16X = stsCfg.stWBCfg.stCrop.u16Y = 0;
stsCfg.stWBCfg.stCrop.u16W = 1920;
stsCfg.stWBCfg.stCrop.u16H = 1080;

// Set AWB statistical brightness threshold.
stsCfg.stWBCfg.u16BlackLevel = 0;
stsCfg.stWBCfg.u16WhiteLevel = 4095;

// Set the AF statistics switch.
stsCfg.stFocusCfg.stConfig.bEnable = 1;

// Set the preprocessing switch of AF statistics.
stsCfg.stFocusCfg.stConfig.stRawCfg.PreGammaEn = 0;
stsCfg.stFocusCfg.stConfig.stPreFltCfg.PreFltEn = 1;

// Set the window number of AF statistic value in x & y direction.
stsCfg.stFocusCfg.stConfig.u16Hwnd = 17;
stsCfg.stFocusCfg.stConfig.u16Vwnd = 15;

// Set AF window ROI.
stsCfg.stFocusCfg.stConfig.stCrop.bEnable = 1;
stsCfg.stFocusCfg.stConfig.stCrop.u16X = AF_XOFFSET_MIN;
stsCfg.stFocusCfg.stConfig.stCrop.u16Y = AF_YOFFSET_MIN;
stsCfg.stFocusCfg.stConfig.stCrop.u16W = 1920 - AF_XOFFSET_MIN * 2;
stsCfg.stFocusCfg.stConfig.stCrop.u16H = 1080 - AF_YOFFSET_MIN * 2;

// Set the AF horizontal low pass filter coefficient.
stsCfg.stFocusCfg.stConfig.u8HFltShift = 1;
stsCfg.stFocusCfg.stConfig.s8HVFltLpCoeff[0] = 1;
stsCfg.stFocusCfg.stConfig.s8HVFltLpCoeff[1] = 2;
stsCfg.stFocusCfg.stConfig.s8HVFltLpCoeff[2] = 3;
stsCfg.stFocusCfg.stConfig.s8HVFltLpCoeff[3] = 5;
stsCfg.stFocusCfg.stConfig.s8HVFltLpCoeff[4] = 10;

// Set the AF horizontal high pass filter coefficient.
stsCfg.stFocusCfg.stHParam_FIR0.s8HFltHpCoeff[0] = 0;
stsCfg.stFocusCfg.stHParam_FIR0.s8HFltHpCoeff[1] = 0;
stsCfg.stFocusCfg.stHParam_FIR0.s8HFltHpCoeff[2] = 13;
stsCfg.stFocusCfg.stHParam_FIR0.s8HFltHpCoeff[3] = 24;
stsCfg.stFocusCfg.stHParam_FIR0.s8HFltHpCoeff[4] = 0;

// Set the AF vertical high pass filter coefficient.
stsCfg.stFocusCfg.stVParam_FIR.s8VFltHpCoeff[0] = 13;
stsCfg.stFocusCfg.stVParam_FIR.s8VFltHpCoeff[1] = 24;
stsCfg.stFocusCfg.stVParam_FIR.s8VFltHpCoeff[2] = 0;

// Set the value switch of each statistical value.
stsCfg.unKey.bit1FEAeGloStat = stsCfg.unKey.bit1FEAeLocStat =
stsCfg.unKey.bit1AwbStat1 = stsCfg.unKey.bit1AwbStat2 = stsCfg.unKey.bit1FEAfStat = 1;
CVI_ISP_SetStatisticsConfig(ViPipe, &stsCfg);

// Set the AF low pass filter coefficient rule.
AF low pass filter has nine parameters {x0, x1, x2, x3, x4, x5, x6, x7, x8} . The last four parameters are symmetrical with the first four parameters (x0 = x8, x1 = x7, x2 = x6, x3 = x5) . Users only need to set the first five parameters (x0 ~ x5).

// Set the AF level high pass filter coefficient rule.
AF high pass filter has nine parameters {x0, x1, x2, x3, x4, x5, x6, x7, x8}. The last four parameters are the same as the first four parameters, with the same number but opposite sign: (x0 = -x8, x1 = -x7, x2 = -x6, x3 = -x5). Users only need to set the first five parameters (x0 ~ x5).
// Set the AF vertical high pass filter coefficient rule.
AF horizontal high pass filter has five parameters: {x0, x1, X2, X3, X4}. The last two parameters are the same as the first two parameters, but the positive and negative signs are opposite: (x0 = - x4, X1 = - x3). Users only need to set the first three parameters (x0 ~ x2).

filter example of parameter setting

the band through which the filter can pass

Filter parameters x0

Filter parameters x1

Filter parameters x2

0.1 ~ 0.2

20

16

0

0.1 ~ 0.5

17

20

0

0.1 ~ 0.6

13

24

0

0.1 ~ 0.7

12

25

0

0.1 ~ 0.8

-10

-27

0

0.2 ~ 0.9

-10

27

0

【Related Topic】

40.2.2. CVI_ISP_GetStatisticsConfig

【Description】

Get ISP statistics configuration.

【Syntax】

CVI_S32 CVI_ISP_GetStatisticsConfig(VI_PIPE ViPipe, ISP_STATISTICS_CFG_S *pstStatCfg);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstStatCfg

ISP statistics configuration

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

40.2.3. CVI_ISP_GetAEStatistics

【Description】

Get ISP AE statistics information.

【Syntax】

CVI_S32 CVI_ISP_GetAEStatistics(VI_PIPE ViPipe, ISP_AE_STATISTICS_S *pstAeStat);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstAeStat

AE statistics

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

//Configure AE window weight
#define AE_ZONE_ROW 15
#define AE_ZONE_COLUMN 17

ISP_AE_WIN_STATISTICS_CFG_S  aeWinCfg;
CVI_U8 i,j;
VI_PIPE ViPipe = 0;
CVI_U8 u8Weighttable[AE_ZONE_ROW][ AE_ZONE_COLUMN]={
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 },
{ 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 8, 8, 8, 8, 8, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 8, 8, 8, 8, 8, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 8, 8, 8, 8, 8, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 8, 8, 8, 8, 8, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 8, 8, 8, 8, 8, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 1 },
{ 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1 },
{ 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 1 },
{ 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1 },};

CVI_ISP_GetAEWinStatistics(ViPipe, &aeWinCfg);
for (i = 0; i < AE_ZONE_ROW; i++)
{
    for (j = 0; j < AE_ZONE_COLUMN; j++)
    {
        aeWinCfg.au8Weight[i][j] = u8Weighttable[i][j];
    }
}
CVI_ISP_SetAEWinStatistics(ViPipe, &aeWinCfg);

【Related Topic】

None.

40.2.4. CVI_ISP_GetWBStatistics

【Description】

Get ISP AWB statistics information.

【Syntax】

CVI_S32 CVI_ISP_GetWBStatistics(VI_PIPE ViPipe, ISP_WB_STATISTICS_S *pstAwbStat);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstAwbStat

AWB statistics

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

None.

40.2.5. CVI_ISP_GetFocusStatistics

【Description】

Get ISP AF statistics information.

【Syntax】

CVI_S32 CVI_ISP_GetFocusStatistics(VI_PIPE ViPipe, ISP_AF_STATISTICS_S *pstAfStat);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstAfStat

AF statistics

Output

【Return Value】

Return Value

Description

0

Success

Non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

None.

40.3. Data Types

40.3.1. ISP_STATISTICS_CTRL_U

【Description】

Define ISP statistics information enablement.

【Syntax】

 typedef union _ISP_STATISTICS_CTRL_U {
  CVI_U64 u64Key;
  struct {
    CVI_U64 bit1FEAeGloStat : 1; /* [0] */
    CVI_U64 bit1FEAeLocStat : 1; /* [1] */
    CVI_U64 bit1AwbStat1 : 1; /* [2] */
    CVI_U64 bit1AwbStat2 : 1; /* [3] */
    CVI_U64 bit1FEAfStat : 1; /* [4] */
    CVI_U64 bit14Rsv : 59; /* [5:63] */
} ISP_STATISTICS_CTRL_U;

【Member】

Member

Description

bit1FEAeGloStat

AE global statistics enable

bit1FEAeLocStat

AE block statistics enable

bit1AwbStat1

AWB global statistics enable

bit1AwbStat2

AWB block statistics enable

bit1FEAfStat

AF block statistics enable

bit14Rsv

Reserved bit

【Note】

None.

【Related Data Type and Interface】

None.

40.3.2. ISP_AE_STATISTICS_CFG_S

【Description】

Configure AE statistics.

【Syntax】

 typedef struct _ISP_AE_STATISTICS_CFG_S {
    CVI_BOOL bHisStatisticsEnable; /*RW; Range:[0x0,0x1]*/
    ISP_AE_CROP_S stCrop[AE_MAX_NUM];
    ISP_AE_FACE_CROP_S stFaceCrop[FACE_WIN_NUM];
    CVI_BOOL fast2A_ena; /*RW; Range:[0x0,0x1]*/
    CVI_U8 fast2A_ae_low; /*RW; Range:[0x0,0xFF]*/
    CVI_U8 fast2A_ae_high; /*RW; Range:[0x0,0xFF]*/
    CVI_U16 fast2A_awb_top; /*RW; Range:[0x0,0xFFF]*/
    CVI_U16 fast2A_awb_bot; /*RW; Range:[0x0,0xFFF]*/
    CVI_U16 over_exp_thr; /*RW; Range:[0x0,0x3FF]*/
    CVI_U8 au8Weight[AE_WEIGHT_ZONE_ROW][AE_WEIGHT_ZONE_COLUMN]; /*RW; Range:[0x0, 0xF]*/
} ISP_AE_STATISTICS_CFG_S;

【Member】

Member

Description

enAESwitch

HiSilicon compatible parameter, currently not used

stHistConfig

HiSilicon compatible parameter, currently not used

enFourPlaneMode

HiSilicon compatible parameter, currently not used

enHistMode

HiSilicon compatible parameter, currently not used

enAverMode

HiSilicon compatible parameter, currently not used

enMaxGainMode

HiSilicon compatible parameter, currently not used

stCrop[AE_MAX_NUM];

AE statistical value input image cropping setting

au8Weight[AE_ZONE_ROW][AE_ZONE_COLUMN]

AE window 17 x 15 weight setting

bHisStatisticsEnable

AE/Hist sts enable

u8StatisticsShiftBits

The AE statistics should be scaled down by a few bits

u16RGain

Whether the R channel passes through RGain

u16GGain

Whether the G channel passes through GGain

u16BGain

Whether the B channel passes through BGain

【Note】

None.

【Related Data Type and Interface】

  • CVI_ISP_SetAEWinStatistics

40.3.3. ISP_AE_CROP_S

【Description】

Set AE statistics input image reduction.

【Syntax】

 typedef struct _ ISP_AE_CROP_S {
  CVI_BOOL bEnable;
  CVI_U16 u16X;
  CVI_U16 u16Y;
  CVI_U16 u16W;
  CVI_U16 u16H;
} ISP_AE_CROP_S;

【Member】

Member

Description

bEnable

Enable Cro; 0 is not enabled, the whole picture will be set as the clipping setting; 1 is enabled

u16X

Start position of CropX, the value should be greater than 0

u16Y

Start position of CropY, the value should be greater than 0

u16W

Crop width

u16H

Crop height

【Note】

None.

【Related Data Type and Interface】

None.

40.3.4. ISP_AE_FACE_CROP_S

【Description】

Set face AE statistics input image reduction.

【Syntax】

 typedef struct _ISP_AE_FACE_CROP_S {
  CVI_BOOL bEnable;
  CVI_U16 u16X;
  CVI_U16 u16Y;
  CVI_U16 u16W;
  CVI_U16 u16H;
} ISP_AE_FACE_CROP_S;

【Member】

Member

Description

bEnable

Enable Cro; 0 is not enabled, the whole picture will be set as the clipping setting; 1 is enabled

u16X

Start position of CropX, the value should be greater than 0

u16Y

Start position of CropY, the value should be greater than 0

u16W

Crop width

u16H

Crop height

【Note】

None.

【Related Data Type and Interface】

None.

40.3.5. ISP_WB_STATISTICS_CFG_S

【Description】

Configure WB statistics.

【Syntax】

 typedef struct _ISP_WB_STATISTICS_CFG_S {
  ISP_AWB_SWITCH_E enAWBSwitch;
  CVI_U16 u16ZoneRow;
  CVI_U16 u16ZoneCol;
  CVI_U16 u16ZoneBin;
  CVI_U16 au16HistBinThresh[4];
  CVI_U16 u16WhiteLevel;
  CVI_U16 u16BlackLevel;
  CVI_U16 u16CbMax;
  CVI_U16 u16CbMin;
  CVI_U16 u16CrMax;
  CVI_U16 u16CrMin;
  ISP_AWB_CROP_S stCrop;
} ISP_WB_STATISTICS_CFG_S;

【Member】

Member

Description

enAWBSwitch

ISP_AWB_AFTER_DG = 0

ISP_AWB_AFTER_Expander,

ISP_AWB_AFTER_DRC,

ISP_AWB_SWITCH_BUTT

Set AWB block location

u16ZoneRow

AWB statistics window rows

u16ZoneCol

AWB statistics window columns

u16ZoneBin

HiSilicon compatible parameter, currently not used

au16HistBinThresh

HiSilicon compatible parameter, currently not used

u16WhiteLevel

Threshold setting of AWB highlight exclusion

u16BlackLevel

Threshold setting of AWB dark spot exclusion

u16CbMax

The maximum value of R/G under different ISO

u16CbMin

The maximum value of R/G under different ISO

u16CrMax

The maximum value of R/G under different ISO

u16CrMin

The maximum value of R/G under different ISO

【Note】

None.

【Related Data Type and Interface】

None.

40.3.6. ISP_AWB_CROP_S

【Description】

Set AWB statistics input image reduction.

【Syntax】

 typedef struct _ISP_ AWB_CROP_S {
  CVI_BOOL bEnable;
  CVI_U16 u16X;
  CVI_U16 u16Y;
  CVI_U16 u16W;
  CVI_U16 u16H;
} ISP_ AWB_CROP_S;

【Member】

Member

Description

bEnable

Enable Cro;

0 is not enabled, the whole picture will be set as the clipping setting;

1 is enabled

u16X

Start position of CropX, the value should be greater than 0

u16Y

Start position of CropY, the value should be greater than 0

u16W

Crop width

Value range: [16 * u16ZoneCol, image width]

u16H

Crop height

Value range: [0, image width - 16 * u16ZoneCol]

【Note】

None.

【Related Data Type and Interface】

None.

40.3.7. ISP_WB_STATISTICS_S

【Description】

Define AWB statistics.

【Syntax】

 typedef struct _ISP_WB_STATISTICS_S {
  CVI_U16 u16GlobalR;
  CVI_U16 u16GlobalG;
  CVI_U16 u16GlobalB;
  CVI_U16 u16CountAll;
  CVI_U16 au16ZoneAvgR[AWB_ZONE_NUM];
  CVI_U16 au16ZoneAvgG[AWB_ZONE_NUM];
  CVI_U16 au16ZoneAvgB[AWB_ZONE_NUM];
  CVI_U16 au16ZoneCountAll[AWB_ZONE_NUM];
  ISP_AWB_GRID_INFO_S stGridInfo;
} ISP_WB_STATISTICS_S;

Macro Definition
#define AWB_ZONE_ORIG_ROW (32)
#define AWB_ZONE_ORIG_COLUMN (64)
#define AWB_ZONE_NUM (AWB_ZONE_ORIG_ROW * AWB_ZONE_ORIG_COLUMN)

【Member】

Member

Description

u16GlobalR

The average value of global R component in Bayer domain.

Value range: [0, 0x3ff]

Data type: CVI_BOOL

u16GlobalG

The average value of global G component in Bayer domain

Value range: [0, 0x3ff]

Data type: CVI_BOOL

u16GlobalB

The average value of global B component in Bayer domain

Value range: [0, 0x3ff]

Data type: CVI_BOOL

u16CountAll

The number of pixels in the global statistical region

Value range: [0, 0x3ff]

Data type: CVI_BOOL

au16ZoneAvgR

The average value of R component in Bayer domain

Value range: [0, 0x3ff]

Data type: CVI_BOOL

au16ZoneAvgG

The average value of G component in Bayer domain

Value range: [0, 0x3ff]

Data type: CVI_BOOL

au16ZoneAvgB

The average value of B component in Bayer domain

Value range: [0, 0x3ff]

Data type: CVI_BOOL

au16ZoneCountAll

The number of pixels between Bayer domains

Value range: [0, 0xfff]

Data type: CVI_BOOL

ISP_AWB_GRID_INFO_S

AWB statistics coordinate information

【Note】

None,

【Related Data Type and Interface】

None.

40.3.8. ISP_AWB_GRID_INFO_S

【Description】

AWB Statistics Coordinate Information

【Syntax】

 typedef struct _ISP_AWB_GRID_INFO_S {
  CVI_U16 au16GridYPos[AWB_ZONE_ORIG_ROW + 1];
  CVI_U16 au16GridXPos[AWB_ZONE_ORIG_COLUMN + 1];
  CVI_U8 u8Status;
} ISP_AWB_GRID_INFO_S;

Macro Definition
#define AWB_ZONE_ORIG_ROW (32)
#define AWB_ZONE_ORIG_COLUMN (32)

【Member】

Member

Description

au16GridYPos

Not used yet

au16GridXPos

Not used yet

u8Status

Not used yet

【Note】

None.

【Related Data Type and Interface】

None.

40.3.9. ISP_FOCUS_STATISTICS_CFG_S

【Description】

AF statistics configuration

【Syntax】

 typedef struct _ISP_FOCUS_STATISTICS_CFG_S {
  ISP_AF_CFG_S stConfig;
  ISP_AF_H_PARAM_S stHParam_FIR0;
  ISP_AF_H_PARAM_S stHParam_FIR1;
  ISP_AF_V_PARAM_S stVParam_FIR;
} ISP_FOCUS_STATISTICS_CFG_S;

【Member】

Member

Description

stConfig

AF global configuration parameter

stHParam_FIR0

Horizontal filter first set of FIR parameter settings

stHParam_FIR1

Horizontal filter second set of FIR parameter settings

stVParam_FIR

FIR parameter setting of vertical filter

【Note】

None.

【Related Data Type and Interface】

None.

40.3.10. ISP_AF_CFG_S

【Description】

Define AF statistics parameter configuration

【Syntax】

 typedef struct _ISP_AF_CFG_S {
    CVI_BOOL bEnable;
    CVI_U16 u16Hwnd; /*RW; Range:[0x2, 0x11]*/
    CVI_U16 u16Vwnd; /*RW; Range:[0x2, 0xF]*/
    CVI_U8 u8HFltShift; /*RW; Range:[0x0, 0xF]*/
    CVI_S8 s8HVFltLpCoeff[FIR_H_GAIN_NUM]; /*RW; Range:[0x0, 0x1F]*/
    ISP_AF_RAW_CFG_S stRawCfg;
    ISP_AF_PRE_FILTER_CFG_S stPreFltCfg;
    ISP_AF_CROP_S stCrop;
    CVI_U8 H0FltCoring; /*RW; Range:[0x0, 0xFF]*/
    CVI_U8 H1FltCoring; /*RW; Range:[0x0, 0xFF]*/
    CVI_U8 V0FltCoring; /*RW; Range:[0x0, 0xFF]*/
    CVI_U16 u16HighLumaTh; /*RW; Range:[0x0, 0xFF]*/
    CVI_U8 u8ThLow;
    CVI_U8 u8ThHigh;
    CVI_U8 u8GainLow; /*RW; Range:[0x0, 0xFE]*/
    CVI_U8 u8GainHigh; /*RW; Range:[0x0, 0xFE]*/
    CVI_U8 u8SlopLow; /*RW; Range:[0x0, 0xF]*/
    CVI_U8 u8SlopHigh; /*RW; Range:[0x0, 0xF]*/
} ISP_AF_CFG_S;

【Member】

Member

Description

bEnable

AF is enabled, 0 is not enabled, 1 is enabled

u16Hwnd

The maximum number of AF horizontal windows can be set to 17

u16Vwnd

The maximum number of AF vertical windows can be set to 15

u8HFltShift

AF low pass filter statistics shift register values

Value range : [0, 15]

s8HVFltLpCoeff[FIR_H_GAIN_NUM]

AF low pass filter coefficient is used to control the frequency response of FIR filter

Value range : [-32, 31]

stRawCfg

AF Bayer domain related configuration

stPreFltCfg

AF prefilter processing enable setting

stCrop

Clipping configuration of AF input image

u16HighLumaTh

AF highlight statistics threshold setting

Value range : [0, 4095]

【Note】

None.

【Related Data Type and Interface】

None.

40.3.11. ISP_AF_RAW_CFG_S

【Description】

AF Bayer Domain Image Preprocessing Configuration

【Syntax】

typedef struct _ISP_AF_RAW_CFG_S {
    CVI_U8 PreGammaEn;
    CVI_U8 PreGammaTable[AF_GAMMA_NUM];
} ISP_AF_RAW_CFG_S;

【Member】

Member

Description

PreGammaEn

AF module Gamma enabled, 0 not enabled, 1 enabled

PreGammaTable[AF_GAMMA_NUM]

AF module gamma table settings

【Note】

None.

【Related Data Type and Interface】

None.

40.3.12. ISP_AF_PRE_FILTER_CFG_S

【Description】

AF Bayer Domain Image Filtering Preprocessing Configuration

【Syntax】

typedef struct _ISP_AF_PRE_FILTER_CFG_S {
    CVI_BOOL PreFltEn;
} ISP_AF_PRE_FILTER_CFG_S;

【Member】

Member

Description

PreFltEn

AF module filter preprocessing enabled, 0 not enabled, 1 enabled

【Note】

None.

【Related Data Type and Interface】

None.

40.3.13. ISP_AF_CROP_S

【Description】

AF Statistics Input Image Clipping Settings

【Syntax】

 typedef struct _ISP_ AF _CROP_S {
  CVI_BOOL bEnable;
  CVI_U16 u16X;
  CVI_U16 u16Y;
  CVI_U16 u16W;
  CVI_U16 u16H;
} ISP_AF_CROP_S;

【Member】

Member

Description

bEnable

Crop enabled, 0 enabled, whole picture set as crop setting, 1 enabled

u16X

CropX start position,

Value range:[]

u16Y

CropY start position,

Value range:[]

u16W

Crop width

Value range: [16 * u16ZoneCol, image width - 16]

u16H

Crop height

Value range: [16 * u16ZoneRow, image height - 4]

【Note】

None.

【Related Data Type and Interface】

None.

40.3.14. ISP_AF_H_PARAM_S

【Description】

Define AF horizontal filter parameter settings

【Syntax】

 typedef struct _ISP_AF_H_PARAM_S {
  CVI_S8 s8HFltHpCoeff[FIR_H_GAIN_NUM];
} ISP_AF_H_PARAM_S;

【Member】

Member

Description

s8HFltHpCoeff[FIR_H_GAIN_NUM]

AF horizontal filter factor, used to control the frequency response of FIR filters value range : [-32, 31]

【Note】

None.

【Related Data Type and Interface】

None.

40.3.15. ISP_AF_V_PARAM_S

【Description】

Define AF horizontal filter parameter settings

【Syntax】

 typedef struct _ISP_AF_V_PARAM_S {
  CVI_S8 s8VFltHpCoeff[FIR_V_GAIN_NUM];
} ISP_AF_V_PARAM_S;

【Member】

Member

Description

s8VFltHpCoeff[FIR_V_GAIN_NUM]

AF vertical filter factor, used to control the frequency response of FIR filters value range : [-32, 31]

【Note】

None.

【Related Data Type and Interface】

None.

40.3.16. ISP_STATISTICS_CFG_S

【Description】

ISP Statistics Message Configuration

【Syntax】

 typedef struct _ISP_STATISTICS_CFG_S {
  ISP_STATISTICS_CTRL_U unKey;
  ISP_AE_STATISTICS_CFG_S stAECfg;
  ISP_WB_STATISTICS_CFG_S stWBCfg;
  ISP_FOCUS_STATISTICS_CFG_S stFocusCfg;
} ISP_STATISTICS_CFG_S;

【Member】

Member

Description

unKey

Statistical Enabling

stAECfg

AE Statistics Configuration

stWBCfg

WB Statistics Configuration

stFocusCfg

AF Statistics Configuration

【Note】

None.

【Related Data Type and Interface】

None.

40.3.17. ISP_FOCUS_ZONE_S

【Description】

Define the statistical results calculated by AF

【Syntax】

 typedef struct _ISP_FOCUS_ZONE_S {
  CVI_U16 u16HlCnt;
  CVI_U64 u64h0;
  CVI_U64 u64h1;
  CVI_U32 u32v0;
} ISP_FOCUS_ZONE_S;

【Member】

Member

Description

u16HlCnt

The number of points exceeding the highlight threshold is counted within the AF zones, and the entire picture will be set as the crop setting, 1 being enabled

u64h0

Statistical results of the first group of FIR filters in the horizontal direction within the AF partition interval

u64h1

Statistical results of the second group of FIR filters in the horizontal direction within the AF partition interval

u32v0

Results of Statistical Vertical FIR Filters Between AF Partitions

【Note】

None.

【Related Data Type and Interface】

None.

40.3.18. ISP_FE_FOCUS_STATISTICS_S

【Description】

Define statistical information provided by AF FE

【Syntax】

typedef struct _ISP_FE_FOCUS_STATISTICS_S {
  ISP_FOCUS_ZONE_S stZoneMetrics[AF_ZONE_ROW][AF_ZONE_COLUMN];
} ISP_FE_FOCUS_STATISTICS_S;

【Member】

Member

Description

stZoneMetrics

Blocking Statistics for ISP AF

【Note】

None.

【Related Data Type and Interface】

None.

40.3.19. ISP_AF_STATISTICS_S

【Description】

Define all statistics provided by AF

【Syntax】

 typedef struct _ISP_AF_STATISTICS_S {
  ISP_FE_FOCUS_STATISTICS_S stFEAFStat;
} ISP_AF_STATISTICS_S;

【Member】

Member

Description

stFEAFStat

Statistics of AF in Bayer Domain

【Note】

None.

【Related Data Type and Interface】

None.