xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/cnr_head_v30.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * uvnr_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_CNRV30_HEADER_H__
21 #define __CALIBDBV2_CNRV30_HEADER_H__
22 
23 #include "rk_aiq_comm.h"
24 // clang-format off
25 
26 RKAIQ_BEGIN_DECLARE
27 
28 ///////////////////////////uvnr//////////////////////////////////////
29 typedef struct CalibDbV2_CNRV30_T_ISO_s {
30     // M4_NUMBER_MARK_DESC("iso", "f32", M4_RANGE(50, 204800), "50", M4_DIGIT(1), "index2")
31     float iso;
32 
33     ///////////new/////////////
34 #if defined(ISP_HW_V32)
35     // M4_NUMBER_DESC("down_scale_x", "u8", M4_RANGE(2, 8), "4", M4_DIGIT(0))
36 #else
37     // M4_NUMBER_DESC("down_scale_x", "u8", M4_RANGE(4, 8), "4", M4_DIGIT(0))
38 #endif
39     uint8_t down_scale_x;
40 
41 #if defined(ISP_HW_V32)
42     // M4_NUMBER_DESC("down_scale_y", "u8", M4_RANGE(2, 6), "4", M4_DIGIT(0))
43 #else
44 	// M4_NUMBER_DESC("down_scale_y", "u8", M4_RANGE(4, 4), "4", M4_DIGIT(0))
45 #endif
46     uint8_t down_scale_y;
47 
48 
49     // M4_NUMBER_DESC("thumb_sigma", "f32", M4_RANGE(0.0, 1.0), "0.0039", M4_DIGIT(4))
50     float thumb_sigma;
51     // M4_NUMBER_DESC("thumb_bf_ratio", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
52     float thumb_bf_ratio;
53 
54     // M4_NUMBER_DESC("chroma_filter_strength", "f32", M4_RANGE(0.0, 1.0), "0.0078", M4_DIGIT(4))
55     float chroma_filter_strength;
56     // M4_NUMBER_DESC("chroma_filter_wgt_clip", "f32", M4_RANGE(0.0, 16.0), "1.0", M4_DIGIT(2))
57     float chroma_filter_wgt_clip;
58     // M4_NUMBER_DESC("anti_chroma_ghost", "f32", M4_RANGE(0.0, 1.0), "0.0313", M4_DIGIT(4))
59     float anti_chroma_ghost;
60     // M4_NUMBER_DESC("chroma_filter_uv_gain", "f32", M4_RANGE(0.0, 1.0), "0.333", M4_DIGIT(3))
61     float chroma_filter_uv_gain;
62     // M4_NUMBER_DESC("wgt_slope", "f32", M4_RANGE(0.0, 8.0), "1.0", M4_DIGIT(2))
63     float wgt_slope;
64 
65     // M4_NUMBER_DESC("gaus_ratio", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
66     float gaus_ratio;
67 
68     // M4_NUMBER_DESC("bf_sigmaR", "f32", M4_RANGE(0.0, 1.0), "0.0314", M4_DIGIT(4))
69     float bf_sigmaR;
70     // M4_NUMBER_DESC("bf_uvgain", "f32", M4_RANGE(0.0, 8.0), "3.0", M4_DIGIT(2))
71     float bf_uvgain;
72     // M4_NUMBER_DESC("bf_ratio", "f32", M4_RANGE(0.0, 1.0), "0.0625", M4_DIGIT(4))
73     float bf_ratio;
74     // M4_NUMBER_DESC("hbf_wgt_clip", "f32", M4_RANGE(0.0, 1.0), "0.0078", M4_DIGIT(4))
75     float hbf_wgt_clip;
76     // M4_BOOL_DESC("bf_wgt0_sel", "0")
77     bool bf_wgt0_sel;
78     // M4_NUMBER_DESC("global_alpha", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
79     float global_alpha;
80 
81     // M4_NUMBER_DESC("saturation_adj_offset", "f32", M4_RANGE(0.0, 511.0), "0", M4_DIGIT(4))
82     float saturation_adj_offset;
83     // M4_NUMBER_DESC("saturation_adj_ratio", "f32", M4_RANGE(0.0, 32.0), "0.0", M4_DIGIT(2))
84     float saturation_adj_ratio;
85 
86     // M4_NUMBER_DESC("global_gain", "f32", M4_RANGE(0.0, 64.0), "1.0", M4_DIGIT(2))
87     float global_gain;
88     // M4_NUMBER_DESC("global_gain_alpha", "f32", M4_RANGE(0.0, 1.0), "0.0", M4_DIGIT(2))
89     float global_gain_alpha;
90     // M4_NUMBER_DESC("local_gain_scale", "f32", M4_RANGE(0.0625, 1.0), "1.0", M4_DIGIT(2))
91     float local_gain_scale;
92     // M4_NUMBER_DESC("global_gain_thumb", "f32", M4_RANGE(0.0, 4.0), "1.0", M4_DIGIT(2))
93     float global_gain_thumb;
94     // M4_NUMBER_DESC("global_gain_alpha_thumb", "f32", M4_RANGE(8.0, 8.0), "8.0", M4_DIGIT(0))
95     float global_gain_alpha_thumb;
96 
97     // M4_ARRAY_DESC("gain_adj_strength_ratio", "f32", M4_SIZE(1,13), M4_RANGE(0.0,4.0), "1.0", M4_DIGIT(2), M4_DYNAMIC(0))
98     float gain_adj_strength_ratio[13];
99 
100     // M4_ARRAY_DESC("thumb_filter_wgt_coeff", "f32", M4_SIZE(1,4), M4_RANGE(0.0,1.0), "1.0,1.0,1.0,1.0", M4_DIGIT(2), M4_DYNAMIC(0))
101     float thumb_filter_wgt_coeff[4];
102     // M4_ARRAY_DESC("gaus_coeff", "f32", M4_SIZE(1,6), M4_RANGE(0,127), "36,24,16,6,4,1", M4_DIGIT(0), M4_DYNAMIC(0))
103     float gaus_coeff[6];
104 
105 } CalibDbV2_CNRV30_T_ISO_t;
106 
107 typedef struct CalibDbV2_CNRV30_T_Set_s {
108     // M4_STRING_MARK_DESC("SNR_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "LSNR",M4_DYNAMIC(0), "index1")
109     char *SNR_Mode;
110     // M4_STRING_DESC("Sensor_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "lcg", M4_DYNAMIC(0))
111     char *Sensor_Mode;
112     // M4_STRUCT_LIST_DESC("Tuning_ISO", M4_SIZE_DYNAMIC, "double_index_list")
113     CalibDbV2_CNRV30_T_ISO_t *Tuning_ISO;
114     int Tuning_ISO_len;
115 
116 } CalibDbV2_CNRV30_T_Set_t;
117 
118 
119 typedef struct CalibDbV2_CNRV30_Tuning_s {
120     // M4_BOOL_DESC("enable", "1")
121     bool enable;
122     // M4_STRUCT_LIST_DESC("Setting", M4_SIZE_DYNAMIC, "double_index_list")
123     CalibDbV2_CNRV30_T_Set_t *Setting;
124     int Setting_len;
125 } CalibDbV2_CNRV30_Tuning_t;
126 
127 
128 typedef struct CalibDbV2_CNRV30_s {
129     // M4_STRING_DESC("Version", M4_SIZE(1,1), M4_RANGE(0, 64), "V1", M4_DYNAMIC(0))
130     char *Version;
131     // M4_STRUCT_DESC("TuningPara", "normal_ui_style")
132     CalibDbV2_CNRV30_Tuning_t TuningPara;
133 } CalibDbV2_CNRV30_t;
134 
135 RKAIQ_END_DECLARE
136 // clang-format on
137 
138 #endif
139