xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/sharp_head_v1.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * sharp_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_SHARP_HEADER_V1_H__
21 #define __CALIBDBV2_SHARP_HEADER_V1_H__
22 
23 #include "rk_aiq_comm.h"
24 
25 RKAIQ_BEGIN_DECLARE
26 
27 ///////////////////////////sharp//////////////////////////////////////
28 
29 typedef struct CalibDbV2_SharpV1_Luma_s {
30     // M4_ARRAY_DESC("luma_point", "f32", M4_SIZE(1,8), M4_RANGE(0,255), "[0,16,32,64,96,160,224,256]", M4_DIGIT(1), M4_DYNAMIC(0))
31     float luma_point[8];
32     // M4_ARRAY_DESC("luma_sigma", "f32", M4_SIZE(1,8), M4_RANGE(0,255), "[8, 10, 10, 12, 14, 12, 12, 10]", M4_DIGIT(1), M4_DYNAMIC(0))
33     float luma_sigma[8];
34     // M4_ARRAY_DESC("mf_clip_pos", "f32", M4_SIZE(1,8), M4_RANGE(0,255), "[8, 16, 20, 32.0000 46, 46, 46, 40,]", M4_DIGIT(1), M4_DYNAMIC(0))
35     float mf_clip_pos[8];
36     // M4_ARRAY_DESC("mf_clip_neg", "f32", M4_SIZE(1,8), M4_RANGE(0,255), "[-0.5, -0.6, -0.6 -0.8, -0.8,-0.8,-0.8, -0.5]", M4_DIGIT(2), M4_DYNAMIC(0))
37     float mf_clip_neg[8];
38     // M4_ARRAY_DESC("hf_clip", "f32", M4_SIZE(1,8), M4_RANGE(0,255), "[10, 20, 30, 56, 56, 56, 56, 30]", M4_DIGIT(1), M4_DYNAMIC(0))
39     float hf_clip[8];
40 } CalibDbV2_SharpV1_Luma_t;
41 
42 typedef struct CalibDbV2_SharpV1_T_ISO_s {
43     // M4_NUMBER_MARK_DESC("iso", "f32", M4_RANGE(50, 204800), "50", M4_DIGIT(1), "index2")
44     float iso;
45     // M4_NUMBER_DESC("hratio", "f32", M4_RANGE(1.0, 2.0), "2.0", M4_DIGIT(2))
46     float hratio;
47     // M4_NUMBER_DESC("lratio", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
48     float lratio;
49     // M4_NUMBER_DESC("mf_sharp_ratio", "f32", M4_RANGE(0.0, 8.0), "3.0", M4_DIGIT(2))
50     float mf_sharp_ratio;
51     // M4_NUMBER_DESC("hf_sharp_ratio", "f32", M4_RANGE(0.0, 8.0), "5.0", M4_DIGIT(2))
52     float hf_sharp_ratio;
53 
54     // M4_NUMBER_DESC("pbf_gain", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(2))
55     float pbf_gain;
56     // M4_NUMBER_DESC("pbf_ratio", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
57     float pbf_ratio;
58     // M4_NUMBER_DESC("pbf_add", "f32", M4_RANGE(0.0, 255.0), "0.0", M4_DIGIT(2))
59     float pbf_add;
60 
61     // M4_NUMBER_DESC("mbf_gain", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(2))
62     float mbf_gain;
63     // M4_NUMBER_DESC("mbf_add", "f32", M4_RANGE(0.0, 255.0), "0.0", M4_DIGIT(2))
64     float mbf_add;
65 
66     // M4_NUMBER_DESC("hbf_gain", "f32", M4_RANGE(0.0, 2.0), "0.5", M4_DIGIT(2))
67     float hbf_gain;
68     // M4_NUMBER_DESC("hbf_ratio", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
69     float hbf_ratio;
70     // M4_NUMBER_DESC("hbf_add", "f32", M4_RANGE(0.0, 255.0), "0.0", M4_DIGIT(2))
71     float hbf_add;
72 
73     // M4_NUMBER_DESC("local_sharp_strength", "f32", M4_RANGE(0.0, 255.0), "0.5", M4_DIGIT(2))
74     float local_sharp_strength;
75 
76     // M4_NUMBER_DESC("pbf_coeff_percent", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
77     float pbf_coeff_percent;
78     // M4_NUMBER_DESC("rf_m_coeff_percent", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
79     float rf_m_coeff_percent;
80     // M4_NUMBER_DESC("rf_h_coeff_percent", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
81     float rf_h_coeff_percent;
82     // M4_NUMBER_DESC("hbf_coeff_percent", "f32", M4_RANGE(0.0, 1.0), "0.5", M4_DIGIT(2))
83     float hbf_coeff_percent;
84 
85     // M4_ARRAY_TABLE_DESC("luma_para", "array_table_ui", "none")
86     CalibDbV2_SharpV1_Luma_t luma_para;
87 } CalibDbV2_SharpV1_T_ISO_t;
88 
89 typedef struct CalibDbV2_SharpV1_T_Set_s {
90     // M4_STRING_MARK_DESC("SNR_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "LSNR",M4_DYNAMIC(0), "index1")
91     char *SNR_Mode;
92     // M4_STRING_DESC("Sensor_Mode", M4_SIZE(1,1), M4_RANGE(0, 64), "lcg", M4_DYNAMIC(0))
93     char *Sensor_Mode;
94     // M4_STRUCT_LIST_DESC("Tuning_ISO", M4_SIZE_DYNAMIC, "double_index_list")
95     CalibDbV2_SharpV1_T_ISO_t *Tuning_ISO;
96     int Tuning_ISO_len;
97 } CalibDbV2_SharpV1_T_Set_t;
98 
99 typedef struct CalibDbV2_SharpV1_Kernel_s {
100     // M4_ARRAY_DESC("gauss_luma_coeff", "f32", M4_SIZE(3,3), M4_RANGE(0,1), "[0.0625,0.125,0.0625,0.125,0.25,0.125,0.0625,0.125,0.0625]", M4_DIGIT(6), M4_DYNAMIC(0))
101     float gauss_luma_coeff[9];
102     // M4_ARRAY_DESC("pbf_coeff_l", "f32", M4_SIZE(3,3), M4_RANGE(0,1), "[0.15625,0.25,0.15625,0.25,0.375,0.25,0.15625,0.25,0.15625]",M4_DIGIT(6), M4_DYNAMIC(0))
103     float pbf_coeff_l[9];
104     // M4_ARRAY_DESC("pbf_coeff_h", "f32", M4_SIZE(3,3), M4_RANGE(0,1), "[0.15625,0.25,0.15625,0.25,0.375,0.25,0.15625,0.25,0.15625]",M4_DIGIT(6), M4_DYNAMIC(0))
105     float pbf_coeff_h[9];
106     // M4_ARRAY_DESC("rf_m_coeff_l", "f32", M4_SIZE(5,5), M4_RANGE(0,1), "[0.023438,0.03125,0.039063,0.03125,0.023438,0.03125,0.046875,0.054688,0.046875,0.03125,0.039063,0.054688,0.09375,0.054688,0.039063,0.03125,0.046875,0.054688,0.046875,0.03125,0.023438,0.03125,0.039063,0.03125,0.023438]",M4_DIGIT(6), M4_DYNAMIC(0))
107     float rf_m_coeff_l[25];
108     // M4_ARRAY_DESC("rf_m_coeff_h", "f32", M4_SIZE(5,5), M4_RANGE(0,1), "[0.023438,0.03125,0.039063,0.03125,0.023438,0.03125,0.046875,0.054688,0.046875,0.03125,0.039063,0.054688,0.09375,0.054688,0.039063,0.03125,0.046875,0.054688,0.046875,0.03125,0.023438,0.03125,0.039063,0.03125,0.023438]",M4_DIGIT(6), M4_DYNAMIC(0))
109     float rf_m_coeff_h[25];
110     // M4_ARRAY_DESC("rf_m_coeff_h", "f32", M4_SIZE(17,13), M4_RANGE(0,1), "0.004",M4_DIGIT(6), M4_DYNAMIC(0),M4_HIDE(1))
111     float mbf_coeff[221];
112     // M4_ARRAY_DESC("rf_h_coeff_l", "f32", M4_SIZE(5,5), M4_RANGE(0,1), "[0,0.015625,0.023438,0.015625,0,0.015625,0.0625,0.101563,0.0625,0.015625,0.023438,0.101563,0.125,0.101563,0.023438,0.015625,0.0625,0.101563,0.0625,0.015625,0,0.015625,0.023438,0.015625,0]",M4_DIGIT(6), M4_DYNAMIC(0))
113     float rf_h_coeff_l[25];
114     // M4_ARRAY_DESC("rf_h_coeff_h", "f32", M4_SIZE(5,5), M4_RANGE(0,1), "[0,0.015625,0.023438,0.015625,0,0.015625,0.0625,0.101563,0.0625,0.015625,0.023438,0.101563,0.125,0.101563,0.023438,0.015625,0.0625,0.101563,0.0625,0.015625,0,0.015625,0.023438,0.015625,0]",M4_DIGIT(6), M4_DYNAMIC(0))
115     float rf_h_coeff_h[25];
116     // M4_ARRAY_DESC("hbf_coeff_l", "f32", M4_SIZE(3,3), M4_RANGE(0,1), "[0.15625,0.25,0.15625,0.25,0.375,0.25,0.15625,0.25,0.15625]",M4_DIGIT(6), M4_DYNAMIC(0))
117     float hbf_coeff_l[9];
118     // M4_ARRAY_DESC("hbf_coeff_h", "f32", M4_SIZE(3,3), M4_RANGE(0,1), "[0.15625,0.25,0.15625,0.25,0.375,0.25,0.15625,0.25,0.15625]",M4_DIGIT(6), M4_DYNAMIC(0))
119     float hbf_coeff_h[9];
120 } CalibDbV2_SharpV1_Kernel_t;
121 
122 
123 typedef struct CalibDbV2_SharpV1_Tuning_s {
124     // M4_BOOL_DESC("enable", "1")
125     bool enable;
126     // M4_STRUCT_DESC("kernel_coeff", "normal_ui_style")
127     CalibDbV2_SharpV1_Kernel_t kernel_coeff;
128     // M4_STRUCT_LIST_DESC("Setting", M4_SIZE_DYNAMIC, "double_index_list")
129     CalibDbV2_SharpV1_T_Set_t *Setting;
130     int Setting_len;
131 
132 } CalibDbV2_SharpV1_Tuning_t;
133 
134 typedef struct CalibDbV2_SharpV1_s {
135     // M4_STRING_DESC("Version", M4_SIZE(1,1), M4_RANGE(0, 64), "V1", M4_DYNAMIC(0))
136     char *Version;
137     // M4_STRUCT_DESC("TuningPara", "normal_ui_style")
138     CalibDbV2_SharpV1_Tuning_t TuningPara;
139 } CalibDbV2_SharpV1_t;
140 
141 RKAIQ_END_DECLARE
142 
143 #endif
144 
145