xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/cnr_uapi_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_UAPI_HEADER_H__
21 #define __CALIBDBV2_CNRV30_UAPI_HEADER_H__
22 
23 #include "rk_aiq_comm.h"
24 // clang-format off
25 
26 RKAIQ_BEGIN_DECLARE
27 
28 
29 typedef struct RK_CNR_Params_V30_Select_s
30 {
31     // M4_BOOL_DESC("enable", "1")
32     bool enable;
33 
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     // M4_NUMBER_DESC("thumb_sigma", "f32", M4_RANGE(0.0, 1.0), "0.0039", M4_DIGIT(4))
49     float thumb_sigma;
50     // M4_NUMBER_DESC("thumb_bf_ratio", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
51     float thumb_bf_ratio;
52 
53     // M4_NUMBER_DESC("chroma_filter_strength", "f32", M4_RANGE(0.0, 1.0), "0.0078", M4_DIGIT(4))
54     float chroma_filter_strength;
55     // M4_NUMBER_DESC("chroma_filter_wgt_clip", "f32", M4_RANGE(0.0, 16.0), "1.0", M4_DIGIT(2))
56     float chroma_filter_wgt_clip;
57     // M4_NUMBER_DESC("anti_chroma_ghost", "f32", M4_RANGE(0.0, 1.0), "0.0313", M4_DIGIT(4))
58     float anti_chroma_ghost;
59     // M4_NUMBER_DESC("chroma_filter_uv_gain", "f32", M4_RANGE(0.0, 1.0), "0.333", M4_DIGIT(3))
60     float chroma_filter_uv_gain;
61     // M4_NUMBER_DESC("wgt_slope", "f32", M4_RANGE(0.0, 8.0), "1.0", M4_DIGIT(2))
62     float wgt_slope;
63 
64     // M4_NUMBER_DESC("gaus_ratio", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
65     float gaus_ratio;
66 
67     // M4_NUMBER_DESC("bf_sigmaR", "f32", M4_RANGE(0.0, 1.0), "0.0314", M4_DIGIT(4))
68     float bf_sigmaR;
69     // M4_NUMBER_DESC("bf_uvgain", "f32", M4_RANGE(0.0, 8.0), "3.0", M4_DIGIT(2))
70     float bf_uvgain;
71     // M4_NUMBER_DESC("bf_ratio", "f32", M4_RANGE(0.0, 1.0), "0.0625", M4_DIGIT(4))
72     float bf_ratio;
73     // M4_NUMBER_DESC("hbf_wgt_clip", "f32", M4_RANGE(0.0, 1.0), "0.0078", M4_DIGIT(4))
74     float hbf_wgt_clip;
75     // M4_BOOL_DESC("bf_wgt0_sel", "0")
76     bool bf_wgt0_sel;
77     // M4_NUMBER_DESC("global_alpha", "f32", M4_RANGE(0.0, 1.0), "1.0", M4_DIGIT(2))
78     float global_alpha;
79 
80     // M4_NUMBER_DESC("saturation_adj_offset", "f32", M4_RANGE(0.0, 511.0), "0", M4_DIGIT(4))
81     float saturation_adj_offset;
82     // M4_NUMBER_DESC("saturation_adj_ratio", "f32", M4_RANGE(0.0, 32.0), "0.0", M4_DIGIT(2))
83     float saturation_adj_ratio;
84 
85     // M4_NUMBER_DESC("global_gain", "f32", M4_RANGE(0.0, 64.0), "1.0", M4_DIGIT(2))
86     float global_gain;
87     // M4_NUMBER_DESC("global_gain_alpha", "f32", M4_RANGE(0.0, 1.0), "0.0", M4_DIGIT(2))
88     float global_gain_alpha;
89     // M4_NUMBER_DESC("local_gain_scale", "f32", M4_RANGE(0.0625, 1.0), "1.0", M4_DIGIT(2))
90     float local_gain_scale;
91     // M4_NUMBER_DESC("global_gain_thumb", "f32", M4_RANGE(0.0, 4.0), "1.0", M4_DIGIT(2))
92     float global_gain_thumb;
93     // M4_NUMBER_DESC("global_gain_alpha_thumb", "f32", M4_RANGE(8.0, 8.0), "8.0", M4_DIGIT(0))
94     float global_gain_alpha_thumb;
95 
96     // 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))
97     float gain_adj_strength_ratio[13];
98 
99     // 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))
100     float thumb_filter_wgt_coeff[4];
101     // 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))
102     float gaus_coeff[6];
103 
104 } RK_CNR_Params_V30_Select_t;
105 
106 typedef struct AcnrV30_ExpInfo_s {
107     // M4_NUMBER_DESC("hdr_mode", "u8", M4_RANGE(0, 2), "0", M4_DIGIT(0))
108     int hdr_mode;
109 
110     // M4_NUMBER_DESC("snr_mode", "s8", M4_RANGE(0, 2), "0", M4_DIGIT(0))
111     int   snr_mode;
112 
113     // M4_ARRAY_DESC("time", "f32", M4_SIZE(1,3), M4_RANGE(0, 1024), "0.01", M4_DIGIT(6))
114     float arTime[3];
115     // M4_ARRAY_DESC("again", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3))
116     float arAGain[3];
117     // M4_ARRAY_DESC("dgain", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3))
118     float arDGain[3];
119     // M4_ARRAY_DESC("isp_dgain", "f32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(3))
120     float isp_dgain[3];
121     // M4_NUMBER_DESC("blc_ob_predgain", "f32", M4_RANGE(0, 204800), "1", M4_DIGIT(3))
122     float blc_ob_predgain;
123     // M4_ARRAY_DESC("iso", "u32", M4_SIZE(1,3), M4_RANGE(0, 204800), "1", M4_DIGIT(0))
124     int   arIso[3];
125 
126     // M4_NUMBER_DESC("isoLevelLow", "u8", M4_RANGE(0, 12), "0", M4_DIGIT(0))
127     int isoLevelLow;
128     // M4_NUMBER_DESC("isoLevelHig", "u8", M4_RANGE(0, 12), "0", M4_DIGIT(0))
129     int isoLevelHig;
130 
131     // M4_NUMBER_DESC("rawWidth", "s32", M4_RANGE(0, 65535), "0", M4_DIGIT(0))
132     int rawWidth;
133     // M4_NUMBER_DESC("rawHeight", "s32", M4_RANGE(0, 65535), "0", M4_DIGIT(0))
134     int rawHeight;
135 } AcnrV30_ExpInfo_t;
136 
137 typedef struct rk_aiq_cnr_info_v30_s {
138     // M4_ARRAY_TABLE_DESC("sync", "array_table_ui", "none", "1")
139     rk_aiq_uapi_sync_t sync;
140     // M4_NUMBER_DESC("iso", "u32", M4_RANGE(0, 204800), "50", M4_DIGIT(0), "0", "0")
141     int iso;
142     // M4_ARRAY_TABLE_DESC("expo_info", "normal_ui_style", "none", "0", "0")
143     AcnrV30_ExpInfo_t expo_info;
144 } rk_aiq_cnr_info_v30_t;
145 
146 
147 
148 
149 RKAIQ_END_DECLARE
150 // clang-format on
151 
152 #endif
153