xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/ynr_uapi_head_v22.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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_UAPI_HEADER_H__
21 #define __CALIBDBV2_YNRV22_UAPI_HEADER_H__
22 
23 #include "rk_aiq_comm.h"
24 // clang-format off
25 
26 RKAIQ_BEGIN_DECLARE
27 
28 ///////////////////////////ynr v1//////////////////////////////////////
29 
30 #define YNR_V22_ISO_CURVE_POINT_BIT          4
31 #define YNR_V22_ISO_CURVE_POINT_NUM          ((1 << YNR_V22_ISO_CURVE_POINT_BIT)+1)
32 
33 
34 typedef struct RK_YNR_Params_V22_Select_s
35 {
36     // M4_BOOL_DESC("enable", "1")
37     bool enable;
38 
39     // M4_BOOL_DESC("ynr_bft3x3_bypass", "0")
40     bool ynr_bft3x3_bypass;
41     // M4_BOOL_DESC("ynr_lbft5x5_bypass", "0")
42     bool ynr_lbft5x5_bypass;
43     // M4_BOOL_DESC("ynr_lgft3x3_bypass", "0")
44     bool ynr_lgft3x3_bypass;
45     // M4_BOOL_DESC("ynr_flt1x1_bypass", "0")
46     bool ynr_flt1x1_bypass;
47     // M4_BOOL_DESC("ynr_nlm11x11_bypass", "0")
48     bool ynr_nlm11x11_bypass;
49 
50     // M4_BOOL_DESC("ynr_thumb_mix_cur_en", "0")
51     bool ynr_thumb_mix_cur_en;
52 
53 
54     // M4_ARRAY_DESC("lumaPoint", "u16", M4_SIZE(1,17), M4_RANGE(0, 1024), "[0,64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024]", M4_DIGIT(0), M4_DYNAMIC(0))
55     uint16_t lumaPoint[YNR_V22_ISO_CURVE_POINT_NUM];
56     // M4_ARRAY_DESC("sigma", "f32", M4_SIZE(1,17), M4_RANGE(0, 4095), "32", M4_DIGIT(3), M4_DYNAMIC(0))
57     float sigma[YNR_V22_ISO_CURVE_POINT_NUM];
58 
59     // 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))
60     uint16_t lo_lumaPoint[6];
61     // 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))
62     float lo_ratio[6];
63     // 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))
64     uint16_t hi_lumaPoint[6];
65     // 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))
66     float hi_ratio[6];
67 
68     // M4_NUMBER_DESC("lci", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(3))
69     float lci;
70     // M4_NUMBER_DESC("hci", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(3))
71     float hci;
72 
73 
74     //local gain control
75     // M4_NUMBER_DESC("ynr_global_gain_alpha", "f32", M4_RANGE(0, 1.0), "0", M4_DIGIT(2))
76     float ynr_global_gain_alpha;
77     // M4_NUMBER_DESC("ynr_global_gain", "f32", M4_RANGE(0, 64.0), "1.0", M4_DIGIT(2))
78     float ynr_global_gain;
79     // M4_NUMBER_DESC("ynr_adjust_thresh", "f32", M4_RANGE(0, 1.0), "1.0", M4_DIGIT(2))
80     float ynr_adjust_thresh;
81     // M4_NUMBER_DESC("ynr_adjust_scale", "f32", M4_RANGE(0, 16.0), "1.0", M4_DIGIT(2))
82     float ynr_adjust_scale;
83 
84 
85     // M4_ARRAY_DESC("rnr_strength", "f32", M4_SIZE(1,17), M4_RANGE(0,16), "1.0", M4_DIGIT(3), M4_DYNAMIC(0))
86     float rnr_strength[17];
87 
88 
89     // M4_NUMBER_DESC("low_bf1", "f32", M4_RANGE(0.1, 32), "0.5", M4_DIGIT(2))
90     float low_bf1;
91     // M4_NUMBER_DESC("low_bf2", "f32", M4_RANGE(0.1, 32), "0.5", M4_DIGIT(2))
92     float low_bf2;
93 
94     // M4_NUMBER_DESC("low_thred_adj", "f32", M4_RANGE(0.0, 31.0), "0.25", M4_DIGIT(2))
95     float low_thred_adj;
96     // M4_NUMBER_DESC("low_peak_supress", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
97     float low_peak_supress;
98     // M4_NUMBER_DESC("low_edge_adj_thresh", "f32", M4_RANGE(0.0, 1023.0), "7", M4_DIGIT(2))
99     float low_edge_adj_thresh;
100     // M4_NUMBER_DESC("low_lbf_weight_thresh", "f32", M4_RANGE(0.0, 1.0), "0.25", M4_DIGIT(2))
101     float low_lbf_weight_thresh;
102     // M4_NUMBER_DESC("low_center_weight", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
103     float low_center_weight;
104     // M4_NUMBER_DESC("low_dist_adj", "f32", M4_RANGE(0.0, 127.0), "8.0", M4_DIGIT(2))
105     float low_dist_adj;
106     // M4_NUMBER_DESC("low_weight", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
107     float low_weight;
108     // M4_NUMBER_DESC("low_filt1_strength", "f32", M4_RANGE(0.0, 1.0), "0.7", M4_DIGIT(2))
109     float low_filt1_strength;
110     // M4_NUMBER_DESC("low_filt2_strength", "f32", M4_RANGE(0.0, 1.0), "0.85", M4_DIGIT(2))
111     float low_filt2_strength;
112     // M4_NUMBER_DESC("low_bi_weight", "f32", M4_RANGE(0.0, 1.0), "0.2", M4_DIGIT(2))
113     float low_bi_weight;
114 
115 
116     // high frequency
117     // M4_NUMBER_DESC("hi_bf_scale", "f32", M4_RANGE(0.0, 16.0), "1", M4_DIGIT(2))
118     float hi_bf_scale;
119     // M4_NUMBER_DESC("hi_gain_alpha", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
120     float hi_gain_alpha;
121     // M4_NUMBER_DESC("hi_center_weight", "f32", M4_RANGE(0.0, 128.0), "1.0", M4_DIGIT(2))
122     float hi_center_weight;
123     // M4_NUMBER_DESC("hi_weight_offset", "f32", M4_RANGE(0.0, 1.0), "0.05", M4_DIGIT(2))
124     float hi_weight_offset;
125     // M4_NUMBER_DESC("hi_min_sigma", "f32", M4_RANGE(0.0, 1.0), "0.0068", M4_DIGIT(4))
126     float hi_min_sigma;
127     // M4_NUMBER_DESC("hi_nr_weight", "f32", M4_RANGE(0.0, 1.0), "0.78", M4_DIGIT(2))
128     float hi_nr_weight;
129 
130     // M4_NUMBER_DESC("hi_filter_coeff1_1", "u8", M4_RANGE(0, 15), "7", M4_DIGIT(0))
131     uint8_t hi_filter_coeff1_1;
132     // M4_NUMBER_DESC("hi_filter_coeff1_2", "u8", M4_RANGE(0, 15), "6", M4_DIGIT(0))
133     uint8_t hi_filter_coeff1_2;
134     // M4_NUMBER_DESC("hi_filter_coeff1_3", "u8", M4_RANGE(0, 15), "3", M4_DIGIT(0))
135     uint8_t hi_filter_coeff1_3;
136     // M4_NUMBER_DESC("hi_filter_coeff2_1", "u8", M4_RANGE(0, 15), "6", M4_DIGIT(0))
137     uint8_t hi_filter_coeff2_1;
138     // M4_NUMBER_DESC("hi_filter_coeff2_2", "u8", M4_RANGE(0, 15), "5", M4_DIGIT(0))
139     uint8_t hi_filter_coeff2_2;
140     // M4_NUMBER_DESC("hi_filter_coeff2_3", "u8", M4_RANGE(0, 15), "3", M4_DIGIT(0))
141     uint8_t hi_filter_coeff2_3;
142 
143 } RK_YNR_Params_V22_Select_t;
144 
145 
146 typedef struct Aynr_ExpInfo_V22_s {
147     // M4_NUMBER_DESC("hdr_mode", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0))
148     int hdr_mode;
149     // M4_NUMBER_DESC("snr_mode", "s8", M4_RANGE(0, 2), "0", M4_DIGIT(0))
150     int   snr_mode;
151 
152     // M4_ARRAY_DESC("time", "f32", M4_SIZE(1,3), M4_RANGE(0, 1024), "0.01", M4_DIGIT(6))
153     float arTime[3];
154     // M4_ARRAY_DESC("again", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3))
155     float arAGain[3];
156     // M4_ARRAY_DESC("dgain", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3))
157     float arDGain[3];
158     // M4_ARRAY_DESC("isp_dgain", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3))
159     float isp_dgain[3];
160     // M4_NUMBER_DESC("blc_ob_predgain", "f32", M4_RANGE(0, 204800), "1", M4_DIGIT(3))
161     float blc_ob_predgain;
162     // M4_ARRAY_DESC("iso", "u32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(0))
163     int   arIso[3];
164 
165     // M4_NUMBER_DESC("isoLevelLow", "u8", M4_RANGE(0, 12), "0", M4_DIGIT(0))
166     int isoLevelLow;
167     // M4_NUMBER_DESC("isoLevelHig", "u8", M4_RANGE(0, 12), "0", M4_DIGIT(0))
168     int isoLevelHig;
169 
170     // M4_NUMBER_DESC("rawWidth", "s32", M4_RANGE(0, 65535), "0", M4_DIGIT(0))
171     int rawWidth;
172     // M4_NUMBER_DESC("rawHeight", "s32", M4_RANGE(0, 65535), "0", M4_DIGIT(0))
173     int rawHeight;
174 
175 } Aynr_ExpInfo_V22_t;
176 
177 
178 typedef struct rk_aiq_ynr_info_v22_s {
179     // M4_ARRAY_TABLE_DESC("sync", "array_table_ui", "none", "1")
180     rk_aiq_uapi_sync_t sync;
181     // M4_NUMBER_DESC("iso", "u32", M4_RANGE(0, 204800), "50", M4_DIGIT(0), "0", "0")
182     int iso;
183     // M4_ARRAY_TABLE_DESC("expo_info", "normal_ui_style", "none", "0", "0")
184     Aynr_ExpInfo_V22_t expo_info;
185 } rk_aiq_ynr_info_v22_t;
186 
187 
188 
189 RKAIQ_END_DECLARE
190 // clang-format on
191 
192 #endif
193