xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/algos/awb/rk_aiq_types_awb_stat_v32.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2 * rk_aiq_types_awb_stat_v32.h
3 
4 * for rockchip v2.0.0
5 *
6 *  Copyright (c) 2019 Rockchip Corporation
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 *      http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 */
21 /* for rockchip v2.0.0*/
22 
23 #ifndef __RK_AIQ_TYPE_AWB_STAT_V32_H__
24 #define __RK_AIQ_TYPE_AWB_STAT_V32_H__
25 
26 #include "rk_aiq_types_awb_stat_v201.h"
27 #define RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32    4
28 #if RKAIQ_HAVE_AWB_V32
29 #define AWB_MULTI_WINDOW_EN
30 #define AWB_EXCWP_RANGE_STAT_EN
31 #define AWB_WPNUM2_EN
32 #endif
33 #define RK_AIQ_WP_INCLUDE_BIS 6
34 
35 typedef struct rk_aiq_awb_exc_range_v32_s {
36     rk_aiq_awb_exc_range_domain_t domain;//1 uv domain,2 xy domain;
37     bool excludeEnable[RK_AIQ_AWB_XY_TYPE_MAX_V201];// 0 disable,1 eanble;
38     bool measureEnable;//1 calculate sum r g b value in the range,0 not meausre
39     int xu[2];//left right
40     int yv[2];//top bottom
41     unsigned int weightInculde;
42 } rk_aiq_awb_exc_range_v32_t;
43 
44 typedef struct rk_aiq_awb_blc_s {
45     bool enable;
46     int blc[4];//r gr gb b;
47 } rk_aiq_awb_blc_t;
48 
49 typedef struct rk_aiq_awb_stat_cfg_v32_s {
50     bool awbEnable;
51     bool lscBypEnable;
52     bool inputBitIs12Bit;
53     bool write2ddrEnable;
54     int  write2ddrSelc;
55     bool inputShiftEnable;//right shift to 12 bit
56     rk_aiq_awb_blc_t blc;
57     bool uvDetectionEnable[RK_AIQ_AWB_XY_TYPE_MAX_V201];
58     bool xyDetectionEnable[RK_AIQ_AWB_XY_TYPE_MAX_V201];
59     bool threeDyuvEnable[RK_AIQ_AWB_XY_TYPE_MAX_V201];
60     unsigned short threeDyuvIllu[RK_AIQ_AWB_YUV_LS_PARA_NUM];
61     bool wpDiffWeiEnable[RK_AIQ_AWB_XY_TYPE_MAX_V201];
62     bool blkWeightEnable[RK_AIQ_AWB_XY_TYPE_MAX_V201];//the different weight in WP sum
63     bool blkStatisticsEnable;
64     rk_aiq_down_scale_mode_t dsMode;
65     rk_aiq_awb_blk_stat_mode_v201_t blkMeasureMode;
66     bool blk_rtdw_measure_en;//right and down measure eanble
67     bool multiwindow_en;
68     uint8_t frameChoose;
69     unsigned short windowSet[4];//hOffset,vOffser,hSiz,vSize;
70     unsigned char lightNum;
71     unsigned short maxR;
72     unsigned short minR;
73     unsigned short maxG;
74     unsigned short minG;
75     unsigned short maxB;
76     unsigned short minB;
77     unsigned short maxY;
78     unsigned short minY;
79     uint16_t pre_wbgain_inv_r;//3i+f8;
80     uint16_t pre_wbgain_inv_g;
81     uint16_t pre_wbgain_inv_b;
82     int overexposure_value; //if overexposure_value ==0 ,will auto calc;
83     short          icrgb2RYuv_matrix[12];//3*3 matrix 9bit fracitional +0bit integer+1s
84     //  3*1 off    4bit fractional +8bit integer+1s
85     rk_aiq_awb_rt3dyuv_range_para_t     ic3Dyuv2Range_param[RK_AIQ_AWB_YUV_LS_PARA_NUM];
86     rk_aiq_awb_uv_range_para_t            uvRange_param[RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32];//A CWF D50 D65 D75 HZ TL84
87     rk_aiq_rgb2xy_para_t      rgb2xy_param;
88     rk_aiq_awb_xy_range_para_t    xyRange_param[RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32];
89     //several window in pixel domain
90     unsigned short multiwindow[RK_AIQ_AWB_MULTIWINDOW_NUM_V201][4];// 4  windows in pixel domain ,hOffset,vOffser,hSize,vSize;
91     //several winow in uv or xy domain
92     rk_aiq_awb_exc_range_v32_t excludeWpRange[RK_AIQ_AWB_EXCLUDE_WP_RANGE_NUM];
93     //with differernt luma ,the different weight in WP sum
94     unsigned char wpDiffwei_y[RK_AIQ_AWBWP_WEIGHT_CURVE_DOT_NUM];//8bit
95     unsigned char wpDiffwei_w[RK_AIQ_AWBWP_WEIGHT_CURVE_DOT_NUM];//8bit fix point ,and wpDiffwei_w[4]=wpDiffwei_w[5]=255;
96     rk_aiq_awb_xy_type_v201_t xyRangeTypeForWpHist; //for xyRangeT
97     unsigned char blkWeight[RK_AIQ_AWB_GRID_NUM_TOTAL];
98     rk_aiq_awb_xy_type_v201_t xyRangeTypeForBlkStatistics; //used when blkMeasureMode>BLK_MEASURE_MODE_ALL
99     rk_aiq_awb_blk_stat_realwp_ill_e illIdxForBlkStatistics; //blkMeasureMode used when blkMeasureMode>BLK_MEASURE_MODE_ALL
100     bool blkStatisticsWithLumaWeightEn;
101     int  groupIllIndxCurrent;//for time share
102     int  IllIndxSetCurrent[RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32];//for time share
103     char timeSign[64];
104 } rk_aiq_awb_stat_cfg_v32_t;
105 
106 typedef struct rk_aiq_awb_stat_cfg_effect_v32_s {
107     rk_aiq_awb_blk_stat_mode_v201_t blkMeasureMode;
108     unsigned char lightNum;
109     int  groupIllIndxCurrent;//for time share
110     int  IllIndxSetCurrent[RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32];//for time share
111     char timeSign[64];
112 } rk_aiq_awb_stat_cfg_effect_v32_t;
113 
114 typedef struct rk_aiq_awb_stat_res_v32_s {
115     //method1
116     rk_aiq_awb_stat_wp_res_light_v201_t light[RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32];
117     int WpNo2[RK_AIQ_AWB_MAX_WHITEREGIONS_NUM_V32];
118     //method2
119     rk_aiq_awb_stat_blk_res_v201_t   blockResult[RK_AIQ_AWB_GRID_NUM_TOTAL];
120     //window in xy or uv domain
121     rk_aiq_awb_stat_wp_res_v201_t excWpRangeResult[RK_AIQ_AWB_STAT_WP_RANGE_NUM_V201];
122     //wpno histogram
123     unsigned int WpNoHist[RK_AIQ_AWB_WP_HIST_BIN_NUM];
124     rk_aiq_awb_stat_cfg_effect_v32_t  awb_cfg_effect_v32;
125     int dbginfo_fd;
126     rk_aiq_awb_stat_blk_res_v201_t sumBlkRGB;
127 } rk_aiq_awb_stat_res_v32_t;
128 
129 #endif
130