1 /* 2 * ynr_head_v1.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_YNRV22_HEADER_H__ 21 #define __CALIBDBV2_YNRV22_HEADER_H__ 22 23 #include "rk_aiq_comm.h" 24 25 RKAIQ_BEGIN_DECLARE 26 27 ///////////////////////////ynr v1////////////////////////////////////// 28 29 typedef struct CalibDbV2_YnrV22_C_ISO_s { 30 // M4_NUMBER_MARK_DESC("iso", "f32", M4_RANGE(50, 204800), "50", M4_DIGIT(1), "index2") 31 float iso; 32 // M4_ARRAY_DESC("sigma_curve", "f32", M4_SIZE(1,5), M4_RANGE(-65535.0, 65535), "0.0", M4_DIGIT(20), M4_DYNAMIC(0)) 33 double sigma_curve[5]; 34 // M4_NUMBER_DESC("ynr_lci", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(3)) 35 float ynr_lci; 36 // M4_NUMBER_DESC("ynr_hci", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(3)) 37 float ynr_hci; 38 39 } CalibDbV2_YnrV22_C_ISO_t; 40 41 typedef struct CalibDbV2_YnrV22_C_Set_s { 42 // M4_STRING_MARK_DESC("SNR_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "LSNR",M4_DYNAMIC(0), "index1") 43 char *SNR_Mode; 44 // M4_STRING_DESC("Sensor_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "lcg", M4_DYNAMIC(0)) 45 char *Sensor_Mode; 46 // M4_STRUCT_LIST_DESC("Calib_ISO", M4_SIZE_DYNAMIC, "double_index_list") 47 CalibDbV2_YnrV22_C_ISO_t *Calib_ISO; 48 int Calib_ISO_len; 49 } CalibDbV2_YnrV22_C_Set_t; 50 51 typedef struct CalibDbV2_YnrV22_Calib_s { 52 // M4_STRUCT_LIST_DESC("Setting", M4_SIZE_DYNAMIC, "double_index_list") 53 CalibDbV2_YnrV22_C_Set_t *Setting; 54 int Setting_len; 55 } CalibDbV2_YnrV22_Calib_t; 56 57 typedef struct CalibDbV2_YnrV22_LumaParam_s { 58 // M4_ARRAY_DESC("lo_lumaPoint", "u16", M4_SIZE(1,6), M4_RANGE(0,256), "[0,32,64,128,192,256]", M4_DIGIT(0), M4_DYNAMIC(0)) 59 uint16_t lo_lumaPoint[6]; 60 // M4_ARRAY_DESC("lo_ratio", "f32", M4_SIZE(1,6), M4_RANGE(0,2.0), "[1.0,1.0,1.0,1.0,1.0,1.0]", M4_DIGIT(2), M4_DYNAMIC(0)) 61 float lo_ratio[6]; 62 // M4_ARRAY_DESC("hi_lumaPoint", "u16", M4_SIZE(1,6), M4_RANGE(0,256), "[0,32,64,128,192,256]", M4_DIGIT(0), M4_DYNAMIC(0)) 63 uint16_t hi_lumaPoint[6]; 64 // M4_ARRAY_DESC("hi_ratio", "f32", M4_SIZE(1,6), M4_RANGE(0,2.0), "[1.0,1.0,1.0,1.0,1.0,1.0]", M4_DIGIT(2), M4_DYNAMIC(0)) 65 float hi_ratio[6]; 66 } CalibDbV2_YnrV22_LumaParam_t; 67 68 69 typedef struct CalibDbV2_YnrV22_T_ISO_s { 70 // M4_NUMBER_MARK_DESC("iso", "f32", M4_RANGE(50, 204800), "50", M4_DIGIT(1), "index2") 71 float iso; 72 73 // M4_BOOL_DESC("ynr_bft3x3_bypass", "0") 74 bool ynr_bft3x3_bypass; 75 // M4_BOOL_DESC("ynr_lbft5x5_bypass", "0") 76 bool ynr_lbft5x5_bypass; 77 // M4_BOOL_DESC("ynr_lgft3x3_bypass", "0") 78 bool ynr_lgft3x3_bypass; 79 // M4_BOOL_DESC("ynr_flt1x1_bypass", "0") 80 bool ynr_flt1x1_bypass; 81 // M4_BOOL_DESC("ynr_nlm11x11_bypass", "0") 82 bool ynr_nlm11x11_bypass; 83 84 // M4_BOOL_DESC("ynr_thumb_mix_cur_en", "0") 85 bool ynr_thumb_mix_cur_en; 86 87 // M4_NUMBER_DESC("ynr_global_gain_alpha", "f32", M4_RANGE(0, 1.0), "0", M4_DIGIT(2)) 88 float ynr_global_gain_alpha; 89 // M4_NUMBER_DESC("ynr_global_gain", "f32", M4_RANGE(0, 64), "1", M4_DIGIT(2)) 90 float ynr_global_gain; 91 92 // M4_NUMBER_DESC("ynr_adjust_thresh", "f32", M4_RANGE(0, 1.0), "1", M4_DIGIT(2)) 93 float ynr_adjust_thresh; 94 // M4_NUMBER_DESC("ynr_adjust_scale", "f32", M4_RANGE(0, 16), "1", M4_DIGIT(2)) 95 float ynr_adjust_scale; 96 97 // M4_ARRAY_TABLE_DESC("lumaPara", "array_table_ui", "none") 98 CalibDbV2_YnrV22_LumaParam_t lumaPara; 99 100 // M4_NUMBER_DESC("low_bf1", "f32", M4_RANGE(0.1, 32), "0.5", M4_DIGIT(2)) 101 float low_bf1; 102 // M4_NUMBER_DESC("low_bf2", "f32", M4_RANGE(0.1, 32), "0.5", M4_DIGIT(2)) 103 float low_bf2; 104 105 // M4_NUMBER_DESC("low_thred_adj", "f32", M4_RANGE(0.0, 31.0), "0.25", M4_DIGIT(2)) 106 float low_thred_adj; 107 // M4_NUMBER_DESC("low_peak_supress", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2)) 108 float low_peak_supress; 109 // M4_NUMBER_DESC("low_edge_adj_thresh", "f32", M4_RANGE(0, 1023), "7", M4_DIGIT(2)) 110 float low_edge_adj_thresh; 111 // M4_NUMBER_DESC("low_lbf_weight_thresh", "f32", M4_RANGE(0.0, 1.0), "0.25", M4_DIGIT(2)) 112 float low_lbf_weight_thresh; 113 // M4_NUMBER_DESC("low_center_weight", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2)) 114 float low_center_weight; 115 // M4_NUMBER_DESC("low_dist_adj", "f32", M4_RANGE(0.0, 128.0), "8.0", M4_DIGIT(2)) 116 float low_dist_adj; 117 // M4_NUMBER_DESC("low_weight", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2)) 118 float low_weight; 119 // M4_NUMBER_DESC("low_filt1_strength", "f32", M4_RANGE(0.0, 1.0), "0.7", M4_DIGIT(2)) 120 float low_filt1_strength; 121 // M4_NUMBER_DESC("low_filt2_strength", "f32", M4_RANGE(0.0, 1.0), "0.85", M4_DIGIT(2)) 122 float low_filt2_strength; 123 // M4_NUMBER_DESC("low_bi_weight", "f32", M4_RANGE(0.0, 1.0), "0.2", M4_DIGIT(2)) 124 float low_bi_weight; 125 126 // M4_NUMBER_DESC("hi_bf_scale", "f32", M4_RANGE(0.0, 16.0), "1", M4_DIGIT(2)) 127 float hi_bf_scale; 128 // M4_NUMBER_DESC("hi_gain_alpha", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2)) 129 float hi_gain_alpha; 130 131 // M4_NUMBER_DESC("hi_center_weight", "f32", M4_RANGE(0.0, 128.0), "1.0", M4_DIGIT(2)) 132 float hi_center_weight; 133 // M4_NUMBER_DESC("hi_weight_offset", "f32", M4_RANGE(0.0, 1.0), "0.05", M4_DIGIT(2)) 134 float hi_weight_offset; 135 // M4_NUMBER_DESC("hi_min_sigma", "f32", M4_RANGE(0.0, 1.0), "0.0068", M4_DIGIT(4)) 136 float hi_min_sigma; 137 // M4_NUMBER_DESC("hi_nr_weight", "f32", M4_RANGE(0.0, 1.0), "0.78", M4_DIGIT(2)) 138 float hi_nr_weight; 139 140 // M4_NUMBER_DESC("hi_filter_coeff1_1", "u8", M4_RANGE(0, 15), "7", M4_DIGIT(0)) 141 uint8_t hi_filter_coeff1_1; 142 // M4_NUMBER_DESC("hi_filter_coeff1_2", "u8", M4_RANGE(0, 15), "6", M4_DIGIT(0)) 143 uint8_t hi_filter_coeff1_2; 144 // M4_NUMBER_DESC("hi_filter_coeff1_3", "u8", M4_RANGE(0, 15), "3", M4_DIGIT(0)) 145 uint8_t hi_filter_coeff1_3; 146 // M4_NUMBER_DESC("hi_filter_coeff2_1", "u8", M4_RANGE(0, 15), "6", M4_DIGIT(0)) 147 uint8_t hi_filter_coeff2_1; 148 // M4_NUMBER_DESC("hi_filter_coeff2_2", "u8", M4_RANGE(0, 15), "5", M4_DIGIT(0)) 149 uint8_t hi_filter_coeff2_2; 150 // M4_NUMBER_DESC("hi_filter_coeff2_3", "u8", M4_RANGE(0, 15), "3", M4_DIGIT(0)) 151 uint8_t hi_filter_coeff2_3; 152 153 // M4_ARRAY_DESC("rnr_strength", "f32", M4_SIZE(1,17), M4_RANGE(0,16), "1.0", M4_DIGIT(3), M4_DYNAMIC(0)) 154 float rnr_strength[17]; 155 156 } CalibDbV2_YnrV22_T_ISO_t; 157 158 159 typedef struct CalibDbV2_YnrV22_T_Set_s { 160 // M4_STRING_MARK_DESC("SNR_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "LSNR",M4_DYNAMIC(0), "index1") 161 char *SNR_Mode; 162 // M4_STRING_DESC("Sensor_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "lcg", M4_DYNAMIC(0)) 163 char *Sensor_Mode; 164 // M4_STRUCT_LIST_DESC("Tuning_ISO", M4_SIZE_DYNAMIC, "double_index_list") 165 CalibDbV2_YnrV22_T_ISO_t *Tuning_ISO; 166 int Tuning_ISO_len; 167 } CalibDbV2_YnrV22_T_Set_t; 168 169 typedef struct CalibDbV2_YnrV22_Tuning_s { 170 // M4_BOOL_DESC("enable", "1") 171 bool enable; 172 // M4_STRUCT_LIST_DESC("Setting", M4_SIZE_DYNAMIC, "double_index_list") 173 CalibDbV2_YnrV22_T_Set_t *Setting; 174 int Setting_len; 175 } CalibDbV2_YnrV22_Tuning_t; 176 177 178 typedef struct CalibDbV2_YnrV22_s { 179 // M4_STRING_DESC("Version", M4_SIZE(1,1), M4_RANGE(0, 64), "V2", M4_DYNAMIC(0)) 180 char *Version; 181 // M4_STRUCT_DESC("CalibPara", "normal_ui_style") 182 CalibDbV2_YnrV22_Calib_t CalibPara; 183 // M4_STRUCT_DESC("TuningPara", "normal_ui_style") 184 CalibDbV2_YnrV22_Tuning_t TuningPara; 185 } CalibDbV2_YnrV22_t; 186 187 RKAIQ_END_DECLARE 188 189 #endif 190