hc
2024-08-12 233ab1bd4c5697f5cdec94e60206e8c6ac609b4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
 
#include "rk_aiq_algo_adebayer.h"
 
#ifndef MIN
#define MIN(a,b)             ((a) <= (b) ? (a):(b))
#endif
#ifndef MAX
#define MAX(a,b)             ((a) >= (b) ? (a):(b))
#endif
 
static int
calibDbParamConvertion
(
    const CamCalibDbContext_t *pCalib,
    AdebayerConfig_t *config, int iso
)
{
    const CalibDb_RKDM_t *calib_dm =
        (CalibDb_RKDM_t*)(CALIBDB_GET_MODULE_PTR((void*)pCalib, dm));
 
    for (int i = 0; i < 5; i++)
    {
        config->filter1_coe[i] = calib_dm->debayer_filter1[i];
        config->filter2_coe[i] = calib_dm->debayer_filter2[i];
    }
    config->gain_offset = calib_dm->debayer_gain_offset;
 
    int sharp_strength_tmp[9];
 
    for (int i = 0; i < 9; i ++)
    {
        float iso_index             = calib_dm->ISO[i];
        int gain                    = (int)(log((float)iso_index / 50) / log((float)2));
        sharp_strength_tmp[gain]    = calib_dm->sharp_strength[i];
    }
    config->offset = calib_dm->debayer_offset;
 
    int hfOffset_tmp[9];
    for (int i = 0; i < 9; i ++)
    {
        float iso_index             = calib_dm->ISO[i];
        int gain                    = (int)(log((float)iso_index / 50) / log((float)2));
        hfOffset_tmp[gain]  = calib_dm->debayer_hf_offset[i];
    }
    config->clip_en = calib_dm->debayer_clip_en;
    config->filter_g_en = calib_dm->debayer_filter_g_en;
    config->filter_c_en = calib_dm->debayer_filter_c_en;
    config->thed0 = calib_dm->debayer_thed0;
    config->thed1 = calib_dm->debayer_thed1;
    config->dist_scale = calib_dm->debayer_dist_scale;
 
    unsigned char false_color_remove_strength_table[10][2] = {
        {0, 19},
        {1, 18},
        {2, 17},
        {3, 16},
        {4, 15},
        {5, 14},
        {6, 13},
        {7, 12},
        {8, 11},
        {9, 10}
    };
 
    int index = calib_dm->debayer_cnr_strength;
    config->order_min = false_color_remove_strength_table[index][0];
    config->order_max = false_color_remove_strength_table[index][1];
    config->shift_num = calib_dm->debayer_shift_num;
    //select sharp params
    int iso_low, iso_high;
    int gain_high, gain_low;
    float ratio;
    int iso_div             = 50;
    int max_iso_step        = 9;
    for (int i = max_iso_step - 1; i >= 0; i--)
    {
        if (iso < iso_div * (2 << i))
        {
            iso_low = iso_div * (2 << (i)) / 2;
            iso_high = iso_div * (2 << i);
        }
    }
    ratio = (float)(iso - iso_low) / (iso_high - iso_low);
    if (iso_low == iso)
    {
        iso_high = iso;
        ratio = 0;
    }
    if (iso_high == iso )
    {
        iso_low = iso;
        ratio = 1;
    }
    gain_high       = (int)(log((float)iso_high / 50) / log((float)2));
    gain_low        = (int)(log((float)iso_low / 50) / log((float)2));
 
    gain_low        = MIN(MAX(gain_low, 0), 8);
    gain_high       = MIN(MAX(gain_high, 0), 8);
 
    config->max_ratio = ((ratio) * (sharp_strength_tmp[gain_high] - sharp_strength_tmp[gain_low]) + sharp_strength_tmp[gain_low]);
    config->hf_offset  = ((ratio) * (hfOffset_tmp[gain_high] - hfOffset_tmp[gain_low]) + hfOffset_tmp[gain_low]);
 
    return 0;
 
}
 
static int
AdebayerFullParamsInit
(
    AdebayerContext_t *pAdebayerCtx
)
{
    if (pAdebayerCtx->pCalibDb) {
        const CalibDb_RKDM_t *calib_dm =
            (CalibDb_RKDM_t*)(CALIBDB_GET_MODULE_PTR(pAdebayerCtx->pCalibDb, dm));
 
        pAdebayerCtx->full_param.enable = calib_dm->debayer_en;
        for (int i = 0; i < 9; i++) {
            pAdebayerCtx->full_param.iso[i] = calib_dm->ISO[i];
            pAdebayerCtx->full_param.hf_offset[i] = calib_dm->debayer_hf_offset[i];
            pAdebayerCtx->full_param.sharp_strength[i] = calib_dm->sharp_strength[i];
        }
        for (int i = 0; i < 5; i++) {
            pAdebayerCtx->full_param.filter1[i] = calib_dm->debayer_filter1[i];
            pAdebayerCtx->full_param.filter2[i] = calib_dm->debayer_filter2[i];
        }
        pAdebayerCtx->full_param.clip_en = calib_dm->debayer_clip_en;
        pAdebayerCtx->full_param.filter_g_en = calib_dm->debayer_filter_g_en;
        pAdebayerCtx->full_param.filter_c_en = calib_dm->debayer_filter_c_en;
        pAdebayerCtx->full_param.thed0 = calib_dm->debayer_thed0;
        pAdebayerCtx->full_param.thed1 = calib_dm->debayer_thed1;
        pAdebayerCtx->full_param.dist_scale = calib_dm->debayer_dist_scale;
        pAdebayerCtx->full_param.gain_offset = calib_dm->debayer_gain_offset;
        pAdebayerCtx->full_param.offset = calib_dm->debayer_offset;
        pAdebayerCtx->full_param.shift_num = calib_dm->debayer_shift_num;
        pAdebayerCtx->full_param.cnr_strength = calib_dm->debayer_cnr_strength;
    } else if (pAdebayerCtx->pCalibDbV2) {
        CalibDbV2_Debayer_t* debayer =
            (CalibDbV2_Debayer_t*)(CALIBDBV2_GET_MODULE_PTR(pAdebayerCtx->pCalibDbV2, debayer));
        pAdebayerCtx->full_param.enable = debayer->param.debayer_en;
        for (int i = 0; i < 9; i++) {
            pAdebayerCtx->full_param.iso[i] = debayer->param.array.ISO[i];
            pAdebayerCtx->full_param.hf_offset[i] = debayer->param.array.debayer_hf_offset[i];
            pAdebayerCtx->full_param.sharp_strength[i] = debayer->param.array.sharp_strength[i];
        }
        for (int i = 0; i < 5; i++) {
            pAdebayerCtx->full_param.filter1[i] = debayer->param.debayer_filter1[i];
            pAdebayerCtx->full_param.filter2[i] = debayer->param.debayer_filter2[i];
        }
        pAdebayerCtx->full_param.clip_en = debayer->param.debayer_clip_en;
        pAdebayerCtx->full_param.filter_g_en = debayer->param.debayer_filter_g_en;
        pAdebayerCtx->full_param.filter_c_en = debayer->param.debayer_filter_c_en;
        pAdebayerCtx->full_param.thed0 = debayer->param.debayer_thed0;
        pAdebayerCtx->full_param.thed1 = debayer->param.debayer_thed1;
        pAdebayerCtx->full_param.dist_scale = debayer->param.debayer_dist_scale;
        pAdebayerCtx->full_param.gain_offset = debayer->param.debayer_gain_offset;
        pAdebayerCtx->full_param.offset = debayer->param.debayer_offset;
        pAdebayerCtx->full_param.shift_num = debayer->param.debayer_shift_num;
        pAdebayerCtx->full_param.cnr_strength = debayer->param.debayer_cnr_strength;
        pAdebayerCtx->full_param.updated = false;
    } else {
        LOGE_ADEBAYER("%s(%d): calibDb are all null!\n", __FUNCTION__, __LINE__);
    }
 
    return 0;
}
 
XCamReturn
AdebayerTranslateParamsAtManualMode(AdebayerContext_t *pAdebayerCtx)
{
    if(!pAdebayerCtx) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    for (int i = 0; i < 5; i++)
    {
        pAdebayerCtx->config.filter1_coe[i] = pAdebayerCtx->manualAttrib.filter1[i];
        pAdebayerCtx->config.filter2_coe[i] = pAdebayerCtx->manualAttrib.filter2[i];
    }
    pAdebayerCtx->config.gain_offset    = pAdebayerCtx->manualAttrib.gain_offset;
    pAdebayerCtx->config.offset         = pAdebayerCtx->manualAttrib.offset;
    pAdebayerCtx->config.clip_en        = pAdebayerCtx->manualAttrib.clip_en;
    pAdebayerCtx->config.filter_g_en    = pAdebayerCtx->manualAttrib.filter_g_en;
    pAdebayerCtx->config.filter_c_en    = pAdebayerCtx->manualAttrib.filter_c_en;
    pAdebayerCtx->config.thed0          = pAdebayerCtx->manualAttrib.thed0;
    pAdebayerCtx->config.thed1          = pAdebayerCtx->manualAttrib.thed1;
    pAdebayerCtx->config.dist_scale     = pAdebayerCtx->manualAttrib.dist_scale;
    pAdebayerCtx->config.shift_num      = pAdebayerCtx->manualAttrib.shift_num;
    pAdebayerCtx->config.max_ratio      = pAdebayerCtx->manualAttrib.sharp_strength;
    pAdebayerCtx->config.hf_offset      = pAdebayerCtx->manualAttrib.hf_offset;
 
    return XCAM_RETURN_NO_ERROR;
}
 
XCamReturn
AdebayerTranslateParamsAtAutoMode(AdebayerContext_t *pAdebayerCtx, int8_t ISO)
{
    if(!pAdebayerCtx) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    for (int i = 0; i < 5; i++)
    {
        pAdebayerCtx->config.filter1_coe[i] = pAdebayerCtx->full_param.filter1[i];
        pAdebayerCtx->config.filter2_coe[i] = pAdebayerCtx->full_param.filter2[i];
    }
    pAdebayerCtx->config.gain_offset = pAdebayerCtx->full_param.gain_offset;
 
    int sharp_strength_tmp[9];
 
    for (int i = 0; i < 9; i ++)
    {
        float iso_index = pAdebayerCtx->full_param.iso[i];
        int gain = (int)(log((float)iso_index / 50) / log((float)2));
        sharp_strength_tmp[gain] = pAdebayerCtx->full_param.sharp_strength[i];
    }
    pAdebayerCtx->config.offset = pAdebayerCtx->full_param.offset;
 
    int hfOffset_tmp[9];
    for (int i = 0; i < 9; i ++)
    {
        float iso_index = pAdebayerCtx->full_param.iso[i];
        int gain = (int)(log((float)iso_index / 50) / log((float)2));
        hfOffset_tmp[gain]  = pAdebayerCtx->full_param.hf_offset[i];
    }
    pAdebayerCtx->config.clip_en = pAdebayerCtx->full_param.clip_en;
    pAdebayerCtx->config.filter_g_en = pAdebayerCtx->full_param.filter_g_en;
    pAdebayerCtx->config.filter_c_en = pAdebayerCtx->full_param.filter_c_en;
    pAdebayerCtx->config.thed0 = pAdebayerCtx->full_param.thed0;
    pAdebayerCtx->config.thed1 = pAdebayerCtx->full_param.thed1;
    pAdebayerCtx->config.dist_scale = pAdebayerCtx->full_param.dist_scale;
    pAdebayerCtx->config.shift_num = pAdebayerCtx->full_param.shift_num;
 
    //select sharp params
    int iso_low = ISO, iso_high = ISO;
    int gain_high, gain_low;
    float ratio = 0.0f;
    int iso_div             = 50;
    int max_iso_step        = 9;
    for (int i = max_iso_step - 1; i >= 0; i--)
    {
        if (ISO < iso_div * (2 << i))
        {
            iso_low = iso_div * (2 << (i)) / 2;
            iso_high = iso_div * (2 << i);
        }
    }
    ratio = (float)(ISO - iso_low) / (iso_high - iso_low);
    if (iso_low == ISO)
    {
        iso_high = ISO;
        ratio = 0;
    }
    if (iso_high == ISO )
    {
        iso_low = ISO;
        ratio = 1;
    }
    gain_high = (int)(log((float)iso_high / 50) / log((float)2));
    gain_low = (int)(log((float)iso_low / 50) / log((float)2));
 
    gain_low = MIN(MAX(gain_low, 0), 8);
    gain_high = MIN(MAX(gain_high, 0), 8);
 
    pAdebayerCtx->config.max_ratio = ((ratio) * (sharp_strength_tmp[gain_high] - sharp_strength_tmp[gain_low]) + sharp_strength_tmp[gain_low]);
    pAdebayerCtx->config.hf_offset = ((ratio) * (hfOffset_tmp[gain_high] - hfOffset_tmp[gain_low]) + hfOffset_tmp[gain_low]);
 
    return XCAM_RETURN_NO_ERROR;
}
 
XCamReturn
AdebayerTranslateParams(AdebayerContext_t *pAdebayerCtx, int8_t ISO)
{
    if(!pAdebayerCtx) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    XCamReturn ret = XCAM_RETURN_NO_ERROR;
 
    pAdebayerCtx->config.enable = pAdebayerCtx->full_param.enable;
 
    unsigned char false_color_remove_strength_table[10][2] = {
        {0, 19},
        {1, 18},
        {2, 17},
        {3, 16},
        {4, 15},
        {5, 14},
        {6, 13},
        {7, 12},
        {8, 11},
        {9, 10}
    };
 
    int index = 0;
    if (pAdebayerCtx->mode == RK_AIQ_DEBAYER_MODE_AUTO) {
        index = pAdebayerCtx->full_param.cnr_strength;
        ret = AdebayerTranslateParamsAtAutoMode(pAdebayerCtx, ISO);
    } else if  (pAdebayerCtx->mode == RK_AIQ_DEBAYER_MODE_MANUAL) {
        index = pAdebayerCtx->manualAttrib.cnr_strength;
        ret = AdebayerTranslateParamsAtManualMode(pAdebayerCtx);
    } else {
        LOGE_ADEBAYER("Invalid mode: %d\n", pAdebayerCtx->mode);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    if (ret != XCAM_RETURN_NO_ERROR)
        LOGE_ADEBAYER("Failed to translate debayer Params in %s mode\n",
                      pAdebayerCtx->mode == RK_AIQ_DEBAYER_MODE_AUTO ? "auto" : "manual");
 
    pAdebayerCtx->config.order_min = false_color_remove_strength_table[index][0];
    pAdebayerCtx->config.order_max = false_color_remove_strength_table[index][1];
 
    LOGI_ADEBAYER("debayer %s mode: config filter1: %d, %d, %d, %d, %d, filter2: %d, %d, %d, %d, %d\n",
                  pAdebayerCtx->mode == RK_AIQ_DEBAYER_MODE_AUTO ? "auto" : "manual",
                  pAdebayerCtx->config.filter1_coe[0], pAdebayerCtx->config.filter1_coe[1],
                  pAdebayerCtx->config.filter1_coe[2], pAdebayerCtx->config.filter1_coe[3],
                  pAdebayerCtx->config.filter1_coe[4], pAdebayerCtx->config.filter2_coe[0],
                  pAdebayerCtx->config.filter2_coe[1], pAdebayerCtx->config.filter2_coe[2],
                  pAdebayerCtx->config.filter2_coe[3], pAdebayerCtx->config.filter2_coe[4]);
 
    LOGI_ADEBAYER("debayer config gain_offset: %d, offset: %d, clip_en: %d, filter_g_en: %d, filter_c_en: %d, " \
                  "thed0: %d, thed1: %d, dist_scale: %d, shift_num: %d, max_ratio: %d, hf_offset: %d, order_max: %d, order_min: %d\n",
                  pAdebayerCtx->config.gain_offset, pAdebayerCtx->config.offset, pAdebayerCtx->config.clip_en,
                  pAdebayerCtx->config.filter_g_en, pAdebayerCtx->config.filter_c_en,
                  pAdebayerCtx->config.thed0, pAdebayerCtx->config.thed1, pAdebayerCtx->config.dist_scale,
                  pAdebayerCtx->config.shift_num, pAdebayerCtx->config.max_ratio, pAdebayerCtx->config.hf_offset,
                  pAdebayerCtx->config.order_max, pAdebayerCtx->config.order_min);
 
    return ret;
}
 
//debayer inint
XCamReturn
AdebayerInit
(
    AdebayerContext_t *pAdebayerCtx,
    CamCalibDbContext_t *pCalibDb,
    CamCalibDbV2Context_t *pCalibDbV2
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
    memset(&pAdebayerCtx->config, 0, sizeof(pAdebayerCtx->config));
    memset(&pAdebayerCtx->manualAttrib, 0, sizeof(pAdebayerCtx->manualAttrib));
    pAdebayerCtx->pCalibDb = pCalibDb;
    pAdebayerCtx->pCalibDbV2 = pCalibDbV2;
    AdebayerFullParamsInit(pAdebayerCtx);
    pAdebayerCtx->state = ADEBAYER_STATE_INITIALIZED;
    pAdebayerCtx->mode = RK_AIQ_DEBAYER_MODE_AUTO;
 
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
//debayer release
XCamReturn
AdebayerRelease
(
    AdebayerContext_t *pAdebayerCtx
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
    AdebayerStop(pAdebayerCtx);
 
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
//debayer config
XCamReturn
AdebayerConfig
(
    AdebayerContext_t *pAdebayerCtx,
    AdebayerConfig_t* pAdebayerConfig
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
 
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    if(pAdebayerConfig == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
    //TO DO
 
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
XCamReturn
AdebayerStart
(
    AdebayerContext_t *pAdebayerCtx
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
 
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    pAdebayerCtx->state = ADEBAYER_STATE_RUNNING;
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
XCamReturn
AdebayerStop
(
    AdebayerContext_t *pAdebayerCtx
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
 
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
    pAdebayerCtx->state = ADEBAYER_STATE_STOPPED;
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
//debayer reconfig
XCamReturn
AdebayerReConfig
(
    AdebayerContext_t* pAdebayerCtx,
    AdebayerConfig_t*  pAdebayerConfig
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
    //need todo what?
 
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
//debayer preprocess
XCamReturn AdebayerPreProcess(AdebayerContext_t *pAdebayerCtx)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
    //need todo what?
 
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}
 
//debayer process
XCamReturn
AdebayerProcess
(
    AdebayerContext_t *pAdebayerCtx,
    int ISO
)
{
    LOGV_ADEBAYER("%s(%d): enter! ISO=%d\n", __FUNCTION__, __LINE__, ISO);
 
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    AdebayerTranslateParams(pAdebayerCtx, ISO);
 
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
 
}
 
//debayer get result
XCamReturn
AdebayerGetProcResult
(
    AdebayerContext_t*    pAdebayerCtx,
    AdebayerProcResult_t* pAdebayerResult
)
{
    LOGV_ADEBAYER("%s(%d): enter!\n", __FUNCTION__, __LINE__);
 
    if(pAdebayerCtx == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    if(pAdebayerResult == NULL) {
        LOGE_ADEBAYER("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
        return XCAM_RETURN_ERROR_PARAM;
    }
 
    pAdebayerResult->config = pAdebayerCtx->config;
    pAdebayerCtx->config.updatecfg = false;
    LOGV_ADEBAYER("%s(%d): exit!\n", __FUNCTION__, __LINE__);
    return XCAM_RETURN_NO_ERROR;
}