1 /* 2 * rk_aiq_algo_adehaze_hw.h 3 * 4 * Copyright (c) 2019 Rockchip Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 */ 19 20 #ifndef _RK_AIQ_ALGO_ADEHAZE_HW_H_ 21 #define _RK_AIQ_ALGO_ADEHAZE_HW_H_ 22 23 #define DHAZ_V10_CONV_T_NUM 6 24 #define DHAZ_V11_SIGMA_IDX_NUM 15 25 #define DHAZ_V11_SIGMA_LUT_NUM 17 26 #define DHAZ_V11_ENHANCE_CRUVE_NUM 17 27 #define DHAZ_V11_HIST_WR_NUM 64 28 #define DHAZ_V12_SIGMA_IDX_NUM DHAZ_V11_SIGMA_IDX_NUM 29 #define DHAZ_V12_SIGMA_LUT_NUM DHAZ_V11_SIGMA_LUT_NUM 30 #define DHAZ_V12_ENHANCE_CRUVE_NUM DHAZ_V11_ENHANCE_CRUVE_NUM 31 #define DHAZ_V12_HIST_WR_NUM DHAZ_V11_HIST_WR_NUM 32 #define DHAZ_V12_ENH_LUMA_NUM 17 33 34 typedef struct AdehazeV10ProcResult_s { 35 int enhance_en; 36 int hist_chn; 37 int hpara_en; 38 int hist_en; 39 int dc_en; 40 int big_en; 41 int nobig_en; 42 int yblk_th; 43 int yhist_th; 44 int dc_max_th; 45 int dc_min_th; 46 int wt_max; 47 int bright_max; 48 int bright_min; 49 int tmax_base; 50 int dark_th; 51 int air_max; 52 int air_min; 53 int tmax_max; 54 int tmax_off; 55 int hist_th_off; 56 int hist_gratio; 57 int hist_min; 58 int hist_k; 59 int enhance_value; 60 int hist_scale; 61 int iir_wt_sigma; 62 int iir_sigma; 63 int stab_fnum; 64 int iir_tmax_sigma; 65 int iir_air_sigma; 66 int cfg_wt; 67 int cfg_air; 68 int cfg_alpha; 69 int cfg_gratio; 70 int cfg_tmax; 71 int dc_weitcur; 72 int dc_thed; 73 int sw_dhaz_dc_bf_h3; 74 int sw_dhaz_dc_bf_h2; 75 int sw_dhaz_dc_bf_h1; 76 int sw_dhaz_dc_bf_h0; 77 int sw_dhaz_dc_bf_h5; 78 int sw_dhaz_dc_bf_h4; 79 int air_weitcur; 80 int air_thed; 81 int air_bf_h2; 82 int air_bf_h1; 83 int air_bf_h0; 84 int gaus_h2; 85 int gaus_h1; 86 int gaus_h0; 87 int conv_t0[DHAZ_V10_CONV_T_NUM]; 88 int conv_t1[DHAZ_V10_CONV_T_NUM]; 89 int conv_t2[DHAZ_V10_CONV_T_NUM]; 90 } AdehazeV10ProcResult_t; 91 92 typedef struct AdehazeV11ProcResult_s { 93 int enhance_en; 94 int air_lc_en; 95 int hpara_en; 96 int hist_en; 97 int dc_en; 98 int yblk_th; 99 int yhist_th; 100 int dc_max_th; 101 int dc_min_th; 102 int wt_max; 103 int bright_max; 104 int bright_min; 105 int tmax_base; 106 int dark_th; 107 int air_max; 108 int air_min; 109 int tmax_max; 110 int tmax_off; 111 int hist_k; 112 int hist_th_off; 113 int hist_min; 114 int hist_gratio; 115 int hist_scale; 116 int enhance_value; 117 int enhance_chroma; 118 int iir_wt_sigma; 119 int iir_sigma; 120 int stab_fnum; 121 int iir_tmax_sigma; 122 int iir_air_sigma; 123 int iir_pre_wet; 124 int cfg_wt; 125 int cfg_air; 126 int cfg_alpha; 127 int cfg_gratio; 128 int cfg_tmax; 129 int range_sima; 130 int space_sigma_pre; 131 int space_sigma_cur; 132 int dc_weitcur; 133 int bf_weight; 134 int enh_curve[DHAZ_V11_ENHANCE_CRUVE_NUM]; 135 int gaus_h2; 136 int gaus_h1; 137 int gaus_h0; 138 } AdehazeV11ProcResult_t; 139 140 typedef struct AdehazeV11duoProcResult_s { 141 int round_en; 142 int soft_wr_en; 143 int enhance_en; 144 int air_lc_en; 145 int hpara_en; 146 int hist_en; 147 int dc_en; 148 int yblk_th; 149 int yhist_th; 150 int dc_max_th; 151 int dc_min_th; 152 int wt_max; 153 int bright_max; 154 int bright_min; 155 int tmax_base; 156 int dark_th; 157 int air_max; 158 int air_min; 159 int tmax_max; 160 int tmax_off; 161 int hist_k; 162 int hist_th_off; 163 int hist_min; 164 int hist_gratio; 165 int hist_scale; 166 int enhance_value; 167 int enhance_chroma; 168 int iir_wt_sigma; 169 int iir_sigma; 170 int stab_fnum; 171 int iir_tmax_sigma; 172 int iir_air_sigma; 173 int iir_pre_wet; 174 int cfg_wt; 175 int cfg_air; 176 int cfg_alpha; 177 int cfg_gratio; 178 int cfg_tmax; 179 int range_sima; 180 int space_sigma_pre; 181 int space_sigma_cur; 182 int dc_weitcur; 183 int bf_weight; 184 int enh_curve[DHAZ_V11_ENHANCE_CRUVE_NUM]; 185 int gaus_h2; 186 int gaus_h1; 187 int gaus_h0; 188 int sigma_idx[DHAZ_V11_SIGMA_IDX_NUM]; 189 int sigma_lut[DHAZ_V11_SIGMA_LUT_NUM]; 190 int adp_wt_wr; // calc in kernel 191 int adp_air_wr; // calc in kernel 192 int adp_tmax_wr; // calc in kernel 193 int adp_gratio_wr; // calc in kernel 194 int hist_wr[DHAZ_V11_HIST_WR_NUM]; // calc in kernel 195 } AdehazeV11duoProcResult_t; 196 197 typedef struct AdehazeV12ProcResult_s { 198 unsigned char enh_luma_en; 199 unsigned char color_deviate_en; 200 unsigned char round_en; 201 unsigned char soft_wr_en; 202 unsigned char enhance_en; 203 unsigned char air_lc_en; 204 unsigned char hpara_en; 205 unsigned char hist_en; 206 unsigned char dc_en; 207 unsigned char yblk_th; 208 unsigned char yhist_th; 209 unsigned char dc_max_th; 210 unsigned char dc_min_th; 211 unsigned char tmax_base; 212 unsigned char dark_th; 213 unsigned char air_max; 214 unsigned char air_min; 215 unsigned char gaus_h2; 216 unsigned char gaus_h1; 217 unsigned char gaus_h0; 218 unsigned char hist_gratio; 219 unsigned short hist_scale; 220 unsigned char bright_max; 221 unsigned char bright_min; 222 unsigned short wt_max; 223 unsigned short tmax_max; 224 unsigned short tmax_off; 225 unsigned char hist_k; 226 unsigned char hist_th_off; 227 unsigned short hist_min; 228 unsigned short enhance_value; 229 unsigned short enhance_chroma; 230 unsigned short iir_wt_sigma; 231 unsigned char iir_sigma; 232 unsigned char stab_fnum; 233 unsigned short iir_tmax_sigma; 234 unsigned char iir_air_sigma; 235 unsigned char iir_pre_wet; 236 unsigned short cfg_wt; 237 unsigned char cfg_air; 238 unsigned char cfg_alpha; 239 unsigned short cfg_gratio; 240 unsigned short cfg_tmax; 241 unsigned short range_sima; 242 unsigned char space_sigma_pre; 243 unsigned char space_sigma_cur; 244 unsigned short dc_weitcur; 245 unsigned short bf_weight; 246 unsigned short enh_curve[DHAZ_V12_ENHANCE_CRUVE_NUM]; 247 unsigned short sigma_lut[DHAZ_V12_SIGMA_LUT_NUM]; 248 unsigned char sigma_idx[DHAZ_V12_SIGMA_IDX_NUM]; 249 unsigned short hist_wr[DHAZ_V12_HIST_WR_NUM]; 250 unsigned short enh_luma[DHAZ_V12_ENH_LUMA_NUM]; 251 } AdehazeV12ProcResult_t; 252 253 typedef struct RkAiqAdehazeProcResult_s { 254 bool enable; 255 #if RKAIQ_HAVE_DEHAZE_V10 256 AdehazeV10ProcResult_t ProcResV10; 257 #endif 258 #if RKAIQ_HAVE_DEHAZE_V11 259 AdehazeV11ProcResult_t ProcResV11; 260 #endif 261 #if RKAIQ_HAVE_DEHAZE_V11_DUO 262 AdehazeV11duoProcResult_t ProcResV11duo; 263 #endif 264 #if RKAIQ_HAVE_DEHAZE_V12 265 AdehazeV12ProcResult_t ProcResV12; 266 #endif 267 } RkAiqAdehazeProcResult_t; 268 269 #endif //_RK_AIQ_ALGO_ADEHAZE_HW_H_ 270