xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/algos/agic/rk_aiq_algo_agic_v2.cpp (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (c) 2019-2022 Rockchip Eletronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include "algos/agic/rk_aiq_types_algo_agic_prvt.h"
17 
18 #define INTERPOLATION(ratio, hi, lo)    (((ratio) * ((hi) - (lo)) + (lo) * (1 << 4) + (1 << 3)) >> 4)
19 #define INTERPOLATION_F(ratioF, hi, lo) ((ratioF) * ((hi) - (lo)) + (lo))
20 
GicV2CalibToAttr(CalibDbV2_Gic_V21_t * calib,rkaiq_gic_v2_api_attr_t * attr)21 void GicV2CalibToAttr(CalibDbV2_Gic_V21_t* calib, rkaiq_gic_v2_api_attr_t* attr) {
22     CalibDbV2_Gic_V21_t* db = calib;
23     Gic_setting_v21_t* settings = &db->GicTuningPara.GicData;
24     XCAM_ASSERT(RKAIQ_GIC_MAX_ISO_CNT >= settings->ISO_len);
25     attr->gic_en  = db->GicTuningPara.enable;
26     attr->iso_cnt = settings->ISO_len;
27 
28     for (int i = 0; i < settings->ISO_len; i++) {
29         attr->auto_params[i].iso                = settings->ISO[i];
30         attr->auto_params[i].bypass             = 0;
31         attr->auto_params[i].gr_ratio           = db->GicTuningPara.gr_ration;
32         attr->auto_params[i].min_busy_thre      = settings->min_busy_thre[i];
33         attr->auto_params[i].min_grad_thr1      = settings->min_grad_thr1[i];
34         attr->auto_params[i].min_grad_thr2      = settings->min_grad_thr2[i];
35         attr->auto_params[i].k_grad1            = settings->k_grad1[i];
36         attr->auto_params[i].k_grad2            = settings->k_grad2[i];
37         attr->auto_params[i].gb_thre            = settings->gb_thre[i];
38         attr->auto_params[i].maxCorV            = settings->maxCorV[i];
39         attr->auto_params[i].maxCorVboth        = settings->maxCorVboth[i];
40         attr->auto_params[i].dark_thre          = settings->dark_thre[i];
41         attr->auto_params[i].dark_threHi        = settings->dark_threHi[i];
42         attr->auto_params[i].k_grad1_dark       = settings->k_grad1_dark[i];
43         attr->auto_params[i].k_grad2_dark       = settings->k_grad2_dark[i];
44         attr->auto_params[i].min_grad_thr_dark1 = settings->min_grad_thr_dark1[i];
45         attr->auto_params[i].min_grad_thr_dark2 = settings->min_grad_thr_dark2[i];
46         attr->auto_params[i].NoiseScale         = settings->NoiseScale[i];
47         attr->auto_params[i].NoiseBase          = settings->NoiseBase[i];
48         attr->auto_params[i].noiseCurve_0       = settings->noiseCurve_0[i];
49         attr->auto_params[i].noiseCurve_1       = settings->noiseCurve_1[i];
50         attr->auto_params[i].globalStrength     = settings->globalStrength[i];
51         attr->auto_params[i].diff_clip          = settings->diff_clip[i];
52     }
53 }
54 
55 #if 0
56 void GicV2SelectParam(rkaiq_gic_v2_param_selected_t* selected, int ratio, int index,
57                       const rkaiq_gic_v2_param_selected_t* auto_params, int iso_cnt) {
58     float ratioF                            = ratio / 16.0f;
59     const rkaiq_gic_v2_param_selected_t* lo = &auto_params[index];
60     const rkaiq_gic_v2_param_selected_t* hi = &auto_params[index + 1];
61 
62     selected->iso           = lo->iso;
63     selected->bypass        = lo->bypass;
64     selected->gr_ratio      = lo->gr_ratio;
65     selected->min_busy_thre = INTERPOLATION(ratio, hi->min_busy_thre, lo->min_busy_thre);
66     selected->min_grad_thr1 = INTERPOLATION(ratio, hi->min_grad_thr1, lo->min_grad_thr1);
67     selected->min_grad_thr2 = INTERPOLATION(ratio, hi->min_grad_thr2, lo->min_grad_thr2);
68     selected->k_grad1       = INTERPOLATION(ratio, hi->k_grad1, lo->k_grad1);
69     selected->k_grad2       = INTERPOLATION(ratio, hi->k_grad2, lo->k_grad2);
70     selected->gb_thre       = INTERPOLATION(ratio, hi->gb_thre, lo->gb_thre);
71     selected->maxCorV       = INTERPOLATION(ratio, hi->maxCorV, lo->maxCorV);
72     selected->maxCorVboth   = INTERPOLATION(ratio, hi->maxCorVboth, lo->maxCorVboth);
73     selected->dark_thre     = INTERPOLATION(ratio, hi->dark_thre, lo->dark_thre);
74     selected->dark_threHi   = INTERPOLATION(ratio, hi->dark_threHi, lo->dark_threHi);
75     selected->k_grad1_dark  = INTERPOLATION(ratio, hi->k_grad1_dark, lo->k_grad1_dark);
76     selected->k_grad2_dark  = INTERPOLATION(ratio, hi->k_grad2_dark, lo->k_grad2_dark);
77     selected->min_grad_thr_dark1 =
78         INTERPOLATION(ratio, hi->min_grad_thr_dark1, lo->min_grad_thr_dark1);
79     selected->min_grad_thr_dark2 =
80         INTERPOLATION(ratio, hi->min_grad_thr_dark2, lo->min_grad_thr_dark2);
81     selected->NoiseScale     = INTERPOLATION(ratio, hi->NoiseScale, lo->NoiseScale);
82     selected->NoiseBase      = INTERPOLATION(ratio, hi->NoiseBase, lo->NoiseBase);
83     selected->globalStrength = INTERPOLATION_F(ratioF, hi->globalStrength, lo->globalStrength);
84     selected->diff_clip      = INTERPOLATION(ratio, hi->diff_clip, lo->diff_clip);
85 }
86 #else
GicV2SelectParam(AgicConfigV21_t * selected,int ratio,int index,const rkaiq_gic_v2_param_selected_t * auto_params,int iso_cnt)87 void GicV2SelectParam(AgicConfigV21_t* selected, int ratio, int index,
88                       const rkaiq_gic_v2_param_selected_t* auto_params, int iso_cnt) {
89     float ratioF                            = ratio / 16.0f;
90     const rkaiq_gic_v2_param_selected_t* lo = &auto_params[index];
91     const rkaiq_gic_v2_param_selected_t* hi = &auto_params[index + 1];
92 
93     selected->gr_ratio       = lo->gr_ratio;
94     selected->regminbusythre = INTERPOLATION(ratio, hi->min_busy_thre, lo->min_busy_thre);
95     selected->regmingradthr1 = INTERPOLATION(ratio, hi->min_grad_thr1, lo->min_grad_thr1);
96     selected->regmingradthr2 = INTERPOLATION(ratio, hi->min_grad_thr2, lo->min_grad_thr2);
97     selected->regkgrad1      = INTERPOLATION(ratio, hi->k_grad1, lo->k_grad1);
98     selected->regkgrad2      = INTERPOLATION(ratio, hi->k_grad2, lo->k_grad2);
99     selected->reggbthre      = INTERPOLATION(ratio, hi->gb_thre, lo->gb_thre);
100     selected->regmaxcorv     = INTERPOLATION(ratio, hi->maxCorV, lo->maxCorV);
101     selected->regmaxcorvboth = INTERPOLATION(ratio, hi->maxCorVboth, lo->maxCorVboth);
102     selected->regdarkthre    = INTERPOLATION(ratio, hi->dark_thre, lo->dark_thre);
103     selected->regdarktthrehi = INTERPOLATION(ratio, hi->dark_threHi, lo->dark_threHi);
104     selected->regkgrad1dark  = INTERPOLATION(ratio, hi->k_grad1_dark, lo->k_grad1_dark);
105     selected->regkgrad2dark  = INTERPOLATION(ratio, hi->k_grad2_dark, lo->k_grad2_dark);
106     selected->regmingradthrdark1 =
107         INTERPOLATION(ratio, hi->min_grad_thr_dark1, lo->min_grad_thr_dark1);
108     selected->regmingradthrdark2 =
109         INTERPOLATION(ratio, hi->min_grad_thr_dark2, lo->min_grad_thr_dark2);
110     selected->noise_scale    = INTERPOLATION(ratio, hi->NoiseScale, lo->NoiseScale);
111     selected->noise_base     = INTERPOLATION(ratio, hi->NoiseBase, lo->NoiseBase);
112     selected->diff_clip      = INTERPOLATION(ratio, hi->diff_clip, lo->diff_clip);
113     selected->noiseCurve_0   = INTERPOLATION_F(ratioF, hi->noiseCurve_0, lo->noiseCurve_0);
114     selected->noiseCurve_1   = INTERPOLATION_F(ratioF, hi->noiseCurve_1, lo->noiseCurve_1);
115     selected->globalStrength = INTERPOLATION_F(ratioF, hi->globalStrength, lo->globalStrength);
116 }
117 #endif
118 
GicV2SetManualParam(AgicConfigV21_t * selected,const rkaiq_gic_v2_param_selected_t * manual_param)119 void GicV2SetManualParam(AgicConfigV21_t* selected,
120                          const rkaiq_gic_v2_param_selected_t* manual_param) {
121     selected->gr_ratio           = manual_param->gr_ratio;
122     selected->regminbusythre     = manual_param->min_busy_thre;
123     selected->regmingradthr1     = manual_param->min_grad_thr1;
124     selected->regmingradthr2     = manual_param->min_grad_thr2;
125     selected->regkgrad1          = manual_param->k_grad1;
126     selected->regkgrad2          = manual_param->k_grad2;
127     selected->reggbthre          = manual_param->gb_thre;
128     selected->regmaxcorv         = manual_param->maxCorV;
129     selected->regmaxcorvboth     = manual_param->maxCorVboth;
130     selected->regdarkthre        = manual_param->dark_thre;
131     selected->regdarktthrehi     = manual_param->dark_threHi;
132     selected->regkgrad1dark      = manual_param->k_grad1_dark;
133     selected->regkgrad2dark      = manual_param->k_grad2_dark;
134     selected->regmingradthrdark1 = manual_param->min_grad_thr_dark1;
135     selected->regmingradthrdark2 = manual_param->min_grad_thr_dark2;
136     selected->noise_scale        = manual_param->NoiseScale;
137     selected->noise_base         = manual_param->NoiseBase;
138     selected->noiseCurve_0       = manual_param->noiseCurve_0;
139     selected->noiseCurve_1       = manual_param->noiseCurve_1;
140     selected->globalStrength     = manual_param->globalStrength;
141     selected->diff_clip          = manual_param->diff_clip;
142 }
143 
GicV2DumpReg(const rkaiq_gic_v2_hw_param_t * hw_param)144 void GicV2DumpReg(const rkaiq_gic_v2_hw_param_t* hw_param) {
145 #ifdef NDEBUG
146     (void)(hw_param);
147 #endif
148     LOGV_AGIC(
149         "GIC V2 reg values: \n"
150         " regmingradthrdark2 %d\n"
151         " regmingradthrdark1 %d\n"
152         " regminbusythre %d\n"
153         " regdarkthre %d\n"
154         " regmaxcorvboth %d\n"
155         " regdarktthrehi %d\n"
156         " regkgrad2dark %d\n"
157         " regkgrad1dark %d\n"
158         " regstrengthglobal_fix %d\n"
159         " regdarkthrestep %d\n"
160         " regkgrad2 %d\n"
161         " regkgrad1 %d\n"
162         " reggbthre %d\n"
163         " regmaxcorv %d\n"
164         " regmingradthr2 %d\n"
165         " regmingradthr1 %d\n"
166         " gr_ratio %d\n"
167         " noise_scale %d\n"
168         " noise_base %d\n"
169         " diff_clip %d\n",
170         hw_param->regmingradthrdark2, hw_param->regmingradthrdark1, hw_param->regminbusythre,
171         hw_param->regdarkthre, hw_param->regmaxcorvboth, hw_param->regdarktthrehi,
172         hw_param->regkgrad2dark, hw_param->regkgrad1dark, hw_param->regstrengthglobal_fix,
173         hw_param->regdarkthrestep, hw_param->regkgrad2, hw_param->regkgrad1, hw_param->reggbthre,
174         hw_param->regmaxcorv, hw_param->regmingradthr2, hw_param->regmingradthr1,
175         hw_param->gr_ratio, hw_param->noise_scale, hw_param->noise_base, hw_param->diff_clip);
176     for (int i = 0; i < 15; i++) LOGV_AGIC("sigma %d", hw_param->sigma_y[i]);
177 }
178 
AgicInit(AgicContext_t * pAgicCtx,CamCalibDbV2Context_t * calib)179 XCamReturn AgicInit(AgicContext_t* pAgicCtx, CamCalibDbV2Context_t* calib) {
180     LOG1_AGIC("enter!");
181 
182     memset(pAgicCtx, 0, sizeof(AgicContext_t));
183     pAgicCtx->state = AGIC_STATE_INITIALIZED;
184 
185     CalibDbV2_Gic_V21_t* calibv2_agic_calib_V21 =
186         (CalibDbV2_Gic_V21_t*)(CALIBDBV2_GET_MODULE_PTR(calib, agic_calib_v21));
187     GicV2CalibToAttr(calibv2_agic_calib_V21, &pAgicCtx->attr.v2);
188     pAgicCtx->attr.v2.op_mode = RKAIQ_GIC_API_OPMODE_AUTO;
189     pAgicCtx->calib_changed   = true;
190     pAgicCtx->state           = AGIC_STATE_RUNNING;
191 
192     LOG1_AGIC("exit!");
193     return XCAM_RETURN_NO_ERROR;
194 }
195 
AgicRelease(AgicContext_t * pAgicCtx)196 XCamReturn AgicRelease(AgicContext_t* pAgicCtx) {
197     LOG1_AGIC("enter!");
198 
199     AgicStop(pAgicCtx);
200 
201     LOG1_AGIC("exit!");
202     return XCAM_RETURN_NO_ERROR;
203 }
204 
AgicStop(AgicContext_t * pAgicCtx)205 XCamReturn AgicStop(AgicContext_t* pAgicCtx) {
206     LOG1_AGIC("enter!");
207 
208     pAgicCtx->state = AGIC_STATE_STOPPED;
209 
210     LOG1_AGIC("exit!");
211     return XCAM_RETURN_NO_ERROR;
212 }
213 
AgicPreProcess(AgicContext_t * pAgicCtx)214 XCamReturn AgicPreProcess(AgicContext_t* pAgicCtx) {
215     (void)(pAgicCtx);
216     return XCAM_RETURN_NO_ERROR;
217 }
218 
AgicGetProcResultV21(AgicContext_t * pAgicCtx,AgicProcResult_t * pAgicRes)219 void AgicGetProcResultV21(AgicContext_t* pAgicCtx, AgicProcResult_t* pAgicRes) {
220     LOG1_AGIC("enter!");
221 
222     pAgicRes->gic_en = pAgicCtx->ConfigData.ConfigV21.gic_en == 0 ? false : true;
223     pAgicRes->ProcResV21.regmingradthrdark2 =
224         pAgicCtx->ConfigData.ConfigV21.regmingradthrdark2;
225     pAgicRes->ProcResV21.regmingradthrdark1 =
226         pAgicCtx->ConfigData.ConfigV21.regmingradthrdark1;
227     pAgicRes->ProcResV21.regminbusythre = pAgicCtx->ConfigData.ConfigV21.regminbusythre;
228     pAgicRes->ProcResV21.regdarkthre    = pAgicCtx->ConfigData.ConfigV21.regdarkthre;
229     pAgicRes->ProcResV21.regmaxcorvboth = pAgicCtx->ConfigData.ConfigV21.regmaxcorvboth;
230     pAgicRes->ProcResV21.regdarktthrehi = pAgicCtx->ConfigData.ConfigV21.regdarktthrehi;
231     pAgicRes->ProcResV21.regkgrad2dark =
232         (int)(log(double(pAgicCtx->ConfigData.ConfigV21.regkgrad2dark)) / log((double)2) + 0.5f);
233     pAgicRes->ProcResV21.regkgrad1dark =
234         (int)(log(double(pAgicCtx->ConfigData.ConfigV21.regkgrad1dark)) / log((double)2) + 0.5f);
235 
236     pAgicRes->ProcResV21.regstrengthglobal_fix =
237         (int)(pAgicCtx->ConfigData.ConfigV21.globalStrength * (1 << 7));
238     if (pAgicRes->ProcResV21.regstrengthglobal_fix > (1 << 7) - 1)
239         pAgicRes->ProcResV21.regstrengthglobal_fix = 7 + 1;
240     else
241         pAgicRes->ProcResV21.regstrengthglobal_fix =
242             int(log(double((1 << 7) - pAgicRes->ProcResV21.regstrengthglobal_fix)) /
243                 log((double)2) +
244                 0.5f);
245 
246     pAgicRes->ProcResV21.regdarkthrestep =
247         int(log(double(pAgicCtx->ConfigData.ConfigV21.regdarktthrehi -
248                        pAgicCtx->ConfigData.ConfigV21.regdarkthre)) /
249             log((double)2) +
250             0.5f);
251     pAgicRes->ProcResV21.regkgrad2 =
252         (int)(log(double(pAgicCtx->ConfigData.ConfigV21.regkgrad2)) / log((double)2) + 0.5f);
253     pAgicRes->ProcResV21.regkgrad1 =
254         (int)(log(double(pAgicCtx->ConfigData.ConfigV21.regkgrad1)) / log((double)2) + 0.5f);
255     pAgicRes->ProcResV21.reggbthre =
256         int(log(double(pAgicCtx->ConfigData.ConfigV21.reggbthre)) / log((double)2) + 0.5f);
257     pAgicRes->ProcResV21.regmaxcorv     = pAgicCtx->ConfigData.ConfigV21.regmaxcorv;
258     pAgicRes->ProcResV21.regmingradthr1 = pAgicCtx->ConfigData.ConfigV21.regmingradthr1;
259     pAgicRes->ProcResV21.regmingradthr2 = pAgicCtx->ConfigData.ConfigV21.regmingradthr2;
260     pAgicRes->ProcResV21.gr_ratio       = pAgicCtx->ConfigData.ConfigV21.gr_ratio;
261     pAgicRes->ProcResV21.noise_scale =
262         (pAgicCtx->ConfigData.ConfigV21.noise_scale);
263     pAgicRes->ProcResV21.noise_base =
264         (int)(pAgicCtx->ConfigData.ConfigV21.noise_base);
265 
266     for (int i = 0; i < 15; i++) {
267         pAgicRes->ProcResV21.sigma_y[i] =
268             (int)(pAgicCtx->ConfigData.ConfigV21.sigma_y[i] * (1 << 7));
269     }
270 
271     pAgicRes->ProcResV21.diff_clip = pAgicCtx->ConfigData.ConfigV21.diff_clip;
272 
273     if (pAgicRes->ProcResV21.regkgrad2dark < pAgicRes->ProcResV21.regkgrad2)
274         GIC_SWAP(int, pAgicRes->ProcResV21.regkgrad2dark,
275                  pAgicRes->ProcResV21.regkgrad2);
276 
277     if (pAgicRes->ProcResV21.regmingradthrdark1 <
278             pAgicRes->ProcResV21.regmingradthr1)
279         GIC_SWAP(int, pAgicRes->ProcResV21.regmingradthrdark1,
280                  pAgicRes->ProcResV21.regmingradthr1);
281 
282     if (pAgicRes->ProcResV21.regmingradthrdark2 <
283             pAgicRes->ProcResV21.regmingradthr2)
284         GIC_SWAP(int, pAgicRes->ProcResV21.regmingradthrdark2,
285                  pAgicRes->ProcResV21.regmingradthr2);
286 
287     if (pAgicRes->ProcResV21.regdarktthrehi < pAgicRes->ProcResV21.regdarkthre)
288         GIC_SWAP(int, pAgicRes->ProcResV21.regdarktthrehi,
289                  pAgicRes->ProcResV21.regdarkthre);
290 
291     GicV2DumpReg(&pAgicRes->ProcResV21);
292 
293     LOG1_AGIC("exit!");
294 }
295 
AgicProcessV21(AgicContext_t * pAgicCtx,int ISO)296 void AgicProcessV21(AgicContext_t* pAgicCtx, int ISO) {
297     LOG1_AGIC("enter!");
298 
299     float ave1 = 0.0f, noiseSigma = 0.0f;
300     short ratio        = 0;
301     short LumaPoints[] = {0,    128,  256,  384,  512,  640,  768, 896,
302                           1024, 1536, 2048, 2560, 3072, 3584, 4096
303                          };
304     int index = 0, iso_hi = 0, iso_lo = 0;
305 
306     LOGD_AGIC("enter, ISO=%d", ISO);
307 
308     if (pAgicCtx == NULL) LOGE_AGIC("null pointer");
309 
310     if (ISO <= 50) {
311         index = 0;
312         ratio = 0;
313     } else if (ISO > 12800) {
314         index = pAgicCtx->attr.v2.iso_cnt - 2;
315         ratio = (1 << 4);
316     } else {
317         int i = 0;
318         for (i = 0; i < (int)(pAgicCtx->attr.v2.iso_cnt - 2); i++) {
319             iso_lo = (int)(pAgicCtx->attr.v2.auto_params[i].iso);
320             iso_hi = (int)(pAgicCtx->attr.v2.auto_params[i + 1].iso);
321             LOGD_AGIC("index=%d,  iso_lo=%d, iso_hi=%d", index, iso_lo, iso_hi);
322             if (ISO > iso_lo && ISO <= iso_hi) {
323                 break;
324             }
325         }
326         ratio = ((ISO - iso_lo) * (1 << 4)) / (iso_hi - iso_lo);
327         index = i;
328     }
329 
330     if (pAgicCtx->attr.v2.op_mode == RKAIQ_GIC_API_OPMODE_AUTO) {
331         GicV2SelectParam(&pAgicCtx->ConfigData.ConfigV21, ratio, index,
332                          pAgicCtx->attr.v2.auto_params, pAgicCtx->attr.v2.iso_cnt);
333     } else {
334         GicV2SetManualParam(&pAgicCtx->ConfigData.ConfigV21, &pAgicCtx->attr.v2.manual_param);
335     }
336     pAgicCtx->ConfigData.ConfigV21.gic_en = pAgicCtx->attr.v2.gic_en;
337 
338     for (int i = 0; i < 15; i++) {
339         ave1       = LumaPoints[i];
340         noiseSigma = pAgicCtx->ConfigData.ConfigV21.noiseCurve_0 * sqrt(ave1) +
341                      pAgicCtx->ConfigData.ConfigV21.noiseCurve_1;
342         if (noiseSigma < 0) {
343             noiseSigma = 0;
344         }
345         pAgicCtx->ConfigData.ConfigV21.sigma_y[i] = noiseSigma;
346     }
347 
348     short mulBit = 0;
349     int bitValue = pAgicCtx->raw_bits;
350     if (bitValue > 10) {
351         mulBit = 1 << (bitValue - 10);
352     } else {
353         mulBit = 1;
354     }
355     pAgicCtx->ConfigData.ConfigV21.regminbusythre *= mulBit;
356     pAgicCtx->ConfigData.ConfigV21.regmingradthr1 *= mulBit;
357     pAgicCtx->ConfigData.ConfigV21.regmingradthr2 *= mulBit;
358     pAgicCtx->ConfigData.ConfigV21.reggbthre *= mulBit;
359     pAgicCtx->ConfigData.ConfigV21.regmaxcorv *= mulBit;
360     pAgicCtx->ConfigData.ConfigV21.regmaxcorvboth *= mulBit;
361     pAgicCtx->ConfigData.ConfigV21.regdarkthre *= mulBit;
362     pAgicCtx->ConfigData.ConfigV21.regdarktthrehi *= mulBit;
363     pAgicCtx->ConfigData.ConfigV21.regmingradthrdark1 *= mulBit;
364     pAgicCtx->ConfigData.ConfigV21.regmingradthrdark2 *= mulBit;
365     pAgicCtx->ConfigData.ConfigV21.noise_base *= mulBit;
366 
367     LOG1_AGIC("exit!");
368 }
369 
AgicProcess(AgicContext_t * pAgicCtx,int ISO,int mode)370 XCamReturn AgicProcess(AgicContext_t* pAgicCtx, int ISO, int mode) {
371     (void)(mode);
372 
373     LOG1_AGIC("enter!");
374 
375     AgicProcessV21(pAgicCtx, ISO);
376 
377     LOG1_AGIC("exit!");
378     return XCAM_RETURN_NO_ERROR;
379 }
380 
AgicGetProcResult(AgicContext_t * pAgicCtx,AgicProcResult_t * pAgicRes)381 XCamReturn AgicGetProcResult(AgicContext_t* pAgicCtx, AgicProcResult_t* pAgicRes) {
382     LOG1_AGIC("enter!");
383 
384     if (pAgicCtx == NULL) {
385         LOGE_AGIC("null pointer");
386         return XCAM_RETURN_ERROR_PARAM;
387     }
388 
389     AgicGetProcResultV21(pAgicCtx, pAgicRes);
390 
391     LOG1_AGIC("exit!");
392     return XCAM_RETURN_NO_ERROR;
393 }
394 
395