1 /* 2 * bayertnr_uapi_head_v23.h 3 * 4 * Copyright (c) 2021 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 __CALIBDBV2_BAYER_TNR_UAPI_HEADER_V23_H__ 21 #define __CALIBDBV2_BAYER_TNR_UAPI_HEADER_V23_H__ 22 23 #include "rk_aiq_comm.h" 24 // clang-format off 25 26 RKAIQ_BEGIN_DECLARE 27 28 ////////////////////////bayernr V23////////////////////////////////////// 29 #if 1 30 31 typedef struct RK_Bayertnr_Params_V23_Select_s 32 { 33 // M4_BOOL_DESC("enable", "1") 34 bool enable; 35 36 //calib 37 // M4_ARRAY_DESC("lumapoint", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "[512, 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336]", M4_DIGIT(0), M4_DYNAMIC(0)) 38 int lumapoint[16]; 39 // M4_ARRAY_DESC("sigma", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "32", M4_DIGIT(0), M4_DYNAMIC(0)) 40 int sigma[16]; 41 // M4_ARRAY_DESC("lumapoint2", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "[512, 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336]", M4_DIGIT(0), M4_DYNAMIC(0)) 42 int lumapoint2[16]; 43 // M4_ARRAY_DESC("lo_sigma", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "32", M4_DIGIT(0), M4_DYNAMIC(0)) 44 int lo_sigma[16]; 45 // M4_ARRAY_DESC("hi_sigma", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "256", M4_DIGIT(0), M4_DYNAMIC(0)) 46 int hi_sigma[16]; 47 48 //tuning 49 // M4_NUMBER_DESC("thumbds_w", "u8", M4_RANGE(4, 8), "8", M4_DIGIT(0)) 50 uint8_t thumbds_w; 51 // M4_NUMBER_DESC("thumbds_h", "u8", M4_RANGE(4, 8), "4", M4_DIGIT(0)) 52 uint8_t thumbds_h; 53 54 // M4_BOOL_DESC("lo_enable", "1") 55 bool lo_enable; 56 // M4_BOOL_DESC("hi_enable", "1") 57 bool hi_enable; 58 // M4_BOOL_DESC("lo_med_en", "1") 59 bool lo_med_en; 60 // M4_BOOL_DESC("lo_gsbay_en", "1") 61 bool lo_gsbay_en; 62 // M4_BOOL_DESC("lo_gslum_en", "1") 63 bool lo_gslum_en; 64 // M4_BOOL_DESC("hi_med_en", "1") 65 bool hi_med_en; 66 // M4_BOOL_DESC("hi_gslum_en", "1") 67 bool hi_gslum_en; 68 69 // M4_BOOL_DESC("trans_en", "1") 70 bool trans_en; 71 72 // M4_BOOL_DESC("wgt_use_mode", "1") 73 bool wgt_use_mode; 74 // M4_BOOL_DESC("wgt_mge_mode", "1") 75 bool wgt_mge_mode; 76 // M4_BOOL_DESC("hi_guass", "0") 77 bool hi_guass; 78 // M4_BOOL_DESC("kl_guass", "0") 79 bool kl_guass; 80 81 // M4_BOOL_DESC("global_pk_en", "0") 82 bool global_pk_en; 83 // M4_NUMBER_DESC("global_pksq", "s32", M4_RANGE(0, 268435455), "1024", M4_DIGIT(0)) 84 int global_pksq; 85 86 // M4_NUMBER_DESC("lo_filter_strength", "f32", M4_RANGE(0, 16.0), "1.0", M4_DIGIT(2)) 87 float lo_filter_strength; 88 // M4_NUMBER_DESC("hi_filter_strength", "f32", M4_RANGE(0, 16.0), "1.0", M4_DIGIT(2)) 89 float hi_filter_strength; 90 // M4_NUMBER_DESC("soft_threshold_ratio", "f32", M4_RANGE(0, 1.0), "0.0", M4_DIGIT(2)) 91 float soft_threshold_ratio; 92 93 // M4_NUMBER_DESC("lo_clipwgt", "f32", M4_RANGE(0, 1.0), "0.03215", M4_DIGIT(5)) 94 float lo_clipwgt; 95 // M4_NUMBER_DESC("hi_wgt_comp", "f32", M4_RANGE(0, 1.0), "0.16", M4_DIGIT(2)) 96 float hi_wgt_comp; 97 // M4_NUMBER_DESC("hidif_th", "s32", M4_RANGE(0, 65535), "32767", M4_DIGIT(0)) 98 int hidif_th; 99 100 // M4_NUMBER_DESC("lo_filter_rat0", "f32", M4_RANGE(0, 16), "0", M4_DIGIT(2)) 101 float lo_filter_rat0; 102 // M4_NUMBER_DESC("lo_filter_thed0", "u16", M4_RANGE(0, 4095), "1024", M4_DIGIT(0)) 103 uint16_t lo_filter_thed0; 104 105 // M4_NUMBER_DESC("hi_filter_abs_ctrl", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 106 uint8_t hi_filter_abs_ctrl; 107 // M4_NUMBER_DESC("hi_filter_filt_bay", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 108 uint8_t hi_filter_filt_bay; 109 // M4_NUMBER_DESC("hi_filter_filt_avg", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 110 uint8_t hi_filter_filt_avg; 111 // M4_NUMBER_DESC("hi_filter_filt_mode", "u8", M4_RANGE(0, 4), "4", M4_DIGIT(0)) 112 uint8_t hi_filter_filt_mode; 113 114 115 // M4_NUMBER_DESC("hi_filter_rat0", "f32", M4_RANGE(0, 16.0), "0", M4_DIGIT(2)) 116 float hi_filter_rat0; 117 // M4_NUMBER_DESC("hi_filter_thed0", "u16", M4_RANGE(0, 4095), "1024", M4_DIGIT(0)) 118 uint16_t hi_filter_thed0; 119 // M4_NUMBER_DESC("hi_filter_rat1", "f32", M4_RANGE(0, 16), "0", M4_DIGIT(2)) 120 float hi_filter_rat1; 121 // M4_NUMBER_DESC("hi_filter_thed1", "u16", M4_RANGE(0, 4095), "1024", M4_DIGIT(0)) 122 uint16_t hi_filter_thed1; 123 124 125 // M4_NUMBER_DESC("guass_guide_coeff0", "u8", M4_RANGE(0, 63), "16", M4_DIGIT(0)) 126 uint8_t guass_guide_coeff0; 127 // M4_NUMBER_DESC("guass_guide_coeff1", "u8", M4_RANGE(0, 63), "8", M4_DIGIT(0)) 128 uint8_t guass_guide_coeff1; 129 // M4_NUMBER_DESC("guass_guide_coeff2", "u8", M4_RANGE(0, 63), "16", M4_DIGIT(0)) 130 uint8_t guass_guide_coeff2; 131 // M4_NUMBER_DESC("guass_guide_coeff3", "u8", M4_RANGE(0, 63), "8", M4_DIGIT(0)) 132 uint8_t guass_guide_coeff3; 133 134 } RK_Bayertnr_Params_V23_Select_t; 135 136 typedef struct RK_Bayertnr_Param_V23L_Select_s { 137 // M4_BOOL_DESC("enable", "1") 138 bool enable; 139 140 // calib 141 // M4_ARRAY_DESC("lumapoint", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "[512, 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336]", M4_DIGIT(0), M4_DYNAMIC(0)) 142 int lumapoint[16]; 143 // M4_ARRAY_DESC("sigma", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "32", M4_DIGIT(0),M4_DYNAMIC(0)) 144 int sigma[16]; 145 // M4_ARRAY_DESC("lumapoint2", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "[512, 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336]", M4_DIGIT(0), M4_DYNAMIC(0)) 146 int lumapoint2[16]; 147 // M4_ARRAY_DESC("lo_sigma", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "32", M4_DIGIT(0), M4_DYNAMIC(0)) 148 int lo_sigma[16]; 149 // M4_ARRAY_DESC("hi_sigma", "s32", M4_SIZE(1,16), M4_RANGE(0,65535), "256", M4_DIGIT(0), M4_DYNAMIC(0)) 150 int hi_sigma[16]; 151 152 // tuning 153 // M4_NUMBER_DESC("thumbds_w", "u8", M4_RANGE(4, 8), "8", M4_DIGIT(0)) 154 uint8_t thumbds_w; 155 // M4_NUMBER_DESC("thumbds_h", "u8", M4_RANGE(4, 8), "4", M4_DIGIT(0)) 156 uint8_t thumbds_h; 157 158 // M4_BOOL_DESC("lo_enable", "1") 159 bool lo_enable; 160 // M4_BOOL_DESC("hi_enable", "1") 161 bool hi_enable; 162 #if 0 163 // M4_BOOL_DESC("lo_med_en", "1") 164 bool lo_med_en; 165 #endif 166 // M4_BOOL_DESC("lo_gsbay_en", "1") 167 bool lo_gsbay_en; 168 // M4_BOOL_DESC("lo_gslum_en", "1") 169 bool lo_gslum_en; 170 #if 0 171 // M4_BOOL_DESC("hi_med_en", "1") 172 bool hi_med_en; 173 #endif 174 // M4_BOOL_DESC("hi_gslum_en", "1") 175 bool hi_gslum_en; 176 177 // M4_BOOL_DESC("trans_en", "1") 178 bool trans_en; 179 180 // M4_BOOL_DESC("wgt_use_mode", "1") 181 bool wgt_use_mode; 182 // M4_BOOL_DESC("wgt_mge_mode", "1") 183 bool wgt_mge_mode; 184 #if 0 185 // M4_BOOL_DESC("hi_guass", "0") 186 bool hi_guass; 187 // M4_BOOL_DESC("kl_guass", "0") 188 bool kl_guass; 189 #endif 190 191 // M4_BOOL_DESC("global_pk_en", "0") 192 bool global_pk_en; 193 // M4_NUMBER_DESC("global_pksq", "s32", M4_RANGE(0, 268435455), "1024", M4_DIGIT(0)) 194 int global_pksq; 195 196 // M4_NUMBER_DESC("lo_filter_strength", "f32", M4_RANGE(0, 16.0), "1.0", M4_DIGIT(2)) 197 float lo_filter_strength; 198 // M4_NUMBER_DESC("hi_filter_strength", "f32", M4_RANGE(0, 16.0), "1.0", M4_DIGIT(2)) 199 float hi_filter_strength; 200 // M4_NUMBER_DESC("soft_threshold_ratio", "f32", M4_RANGE(0, 1.0), "0.0", M4_DIGIT(2)) 201 float soft_threshold_ratio; 202 203 // M4_NUMBER_DESC("lo_clipwgt", "f32", M4_RANGE(0, 1.0), "0.03215", M4_DIGIT(5)) 204 float lo_clipwgt; 205 // M4_NUMBER_DESC("hi_wgt_comp", "f32", M4_RANGE(0, 1.0), "0.16", M4_DIGIT(2)) 206 float hi_wgt_comp; 207 // M4_NUMBER_DESC("hidif_th", "s32", M4_RANGE(0, 65535), "32767", M4_DIGIT(0)) 208 int hidif_th; 209 210 // M4_NUMBER_DESC("lo_filter_rat0", "f32", M4_RANGE(0, 16), "0", M4_DIGIT(2)) 211 float lo_filter_rat0; 212 // M4_NUMBER_DESC("lo_filter_thed0", "u16", M4_RANGE(0, 4095), "1024", M4_DIGIT(0)) 213 uint16_t lo_filter_thed0; 214 215 // M4_NUMBER_DESC("hi_filter_abs_ctrl", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 216 uint8_t hi_filter_abs_ctrl; 217 #if 0 218 // M4_NUMBER_DESC("hi_filter_filt_bay", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 219 uint8_t hi_filter_filt_bay; 220 // M4_NUMBER_DESC("hi_filter_filt_avg", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 221 uint8_t hi_filter_filt_avg; 222 // M4_NUMBER_DESC("hi_filter_filt_mode", "u8", M4_RANGE(0, 4), "4", M4_DIGIT(0)) 223 uint8_t hi_filter_filt_mode; 224 #endif 225 226 // isp32 lite new param 227 #if 1 228 // M4_BOOL_DESC("wgtmm_opt_en", "0") 229 bool wgtmm_opt_en; 230 // M4_BOOL_DESC("wgtmm_sel_en", "0") 231 bool wgtmm_sel_en; 232 // M4_NUMBER_DESC("wgtmin", "f32", M4_RANGE(0, 1), "0", M4_DIGIT(3)) 233 float wgtmin; 234 #endif 235 236 // M4_NUMBER_DESC("hi_filter_rat0", "f32", M4_RANGE(0, 16.0), "0", M4_DIGIT(2)) 237 float hi_filter_rat0; 238 // M4_NUMBER_DESC("hi_filter_thed0", "u16", M4_RANGE(0, 4095), "1024", M4_DIGIT(0)) 239 uint16_t hi_filter_thed0; 240 // M4_NUMBER_DESC("hi_filter_rat1", "f32", M4_RANGE(0, 16), "0", M4_DIGIT(2)) 241 float hi_filter_rat1; 242 // M4_NUMBER_DESC("hi_filter_thed1", "u16", M4_RANGE(0, 4095), "1024", M4_DIGIT(0)) 243 uint16_t hi_filter_thed1; 244 245 // M4_NUMBER_DESC("guass_guide_coeff0", "u8", M4_RANGE(0, 63), "16", M4_DIGIT(0)) 246 uint8_t guass_guide_coeff0; 247 // M4_NUMBER_DESC("guass_guide_coeff1", "u8", M4_RANGE(0, 63), "8", M4_DIGIT(0)) 248 uint8_t guass_guide_coeff1; 249 // M4_NUMBER_DESC("guass_guide_coeff2", "u8", M4_RANGE(0, 63), "4", M4_DIGIT(0)) 250 uint8_t guass_guide_coeff2; 251 #if 0 252 // M4_NUMBER_DESC("guass_guide_coeff3", "u8", M4_RANGE(0, 63), "0", M4_DIGIT(0)) 253 uint8_t guass_guide_coeff3; 254 #endif 255 256 } RK_Bayertnr_Param_V23L_Select_t; 257 258 typedef struct Abayertnr_ExpInfo_V23_s { 259 // M4_NUMBER_DESC("hdr_mode", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 260 int hdr_mode; 261 262 // M4_NUMBER_DESC("snr_mode", "s8", M4_RANGE(0, 2), "0", M4_DIGIT(0)) 263 int snr_mode; 264 265 // M4_ARRAY_DESC("time", "f32", M4_SIZE(1,3), M4_RANGE(0, 1024), "0.01", M4_DIGIT(6)) 266 float arTime[3]; 267 // M4_ARRAY_DESC("again", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3)) 268 float arAGain[3]; 269 // M4_ARRAY_DESC("dgain", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3)) 270 float arDGain[3]; 271 // M4_ARRAY_DESC("isp_dgain", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3)) 272 float isp_dgain[3]; 273 // M4_NUMBER_DESC("blc_ob_predgain", "f32", M4_RANGE(0, 204800), "1", M4_DIGIT(3)) 274 float blc_ob_predgain; 275 // M4_ARRAY_DESC("iso", "u32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(0)) 276 int arIso[3]; 277 278 // M4_NUMBER_DESC("isoLevelLow", "u8", M4_RANGE(0, 12), "0", M4_DIGIT(0)) 279 int isoLevelLow; 280 // M4_NUMBER_DESC("isoLevelHig", "u8", M4_RANGE(0, 12), "0", M4_DIGIT(0)) 281 int isoLevelHig; 282 283 } Abayertnr_ExpInfo_V23_t; 284 285 typedef struct rk_aiq_bayertnr_info_v23_s { 286 // M4_ARRAY_TABLE_DESC("sync", "array_table_ui", "none", "1") 287 rk_aiq_uapi_sync_t sync; 288 // M4_NUMBER_DESC("iso", "u32", M4_RANGE(0, 204800), "50", M4_DIGIT(0), "0", "0") 289 int iso; 290 // M4_ARRAY_TABLE_DESC("expo_info", "normal_ui_style", "none", "0", "0") 291 Abayertnr_ExpInfo_V23_t expo_info; 292 } rk_aiq_bayertnr_info_v23_t; 293 294 295 #endif 296 297 298 RKAIQ_END_DECLARE 299 // clang-format on 300 301 #endif 302