1 /*
2  *rk_aiq_types_alsc_algo_int.h
3  *
4  *  Copyright (c) 2019 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 _RK_AIQ_TYPE_ADPCC_ALGO_INT_H_
21 #define _RK_AIQ_TYPE_ADPCC_ALGO_INT_H_
22 
23 #include "adpcc/rk_aiq_types_adpcc_algo.h"
24 #include "adpcc/rk_aiq_types_adpcc_ext.h"
25 #include "base/xcam_common.h"
26 
27 typedef enum AdpccResult_e {
28     ADPCC_RET_SUCCESS               = 0,   // this has to be 0, if clauses rely on it
29     ADPCC_RET_FAILURE               = 1,   // process failure
30     ADPCC_RET_INVALID_PARM      = 2,   // invalid parameter
31     ADPCC_RET_WRONG_CONFIG      = 3,   // feature not supported
32     ADPCC_RET_BUSY              = 4,   // there's already something going on...
33     ADPCC_RET_CANCELED          = 5,   // operation canceled
34     ADPCC_RET_OUTOFMEM          = 6,   // out of memory
35     ADPCC_RET_OUTOFRANGE            = 7,   // parameter/value out of range
36     ADPCC_RET_NULL_POINTER      = 8,   // the/one/all parameter(s) is a(are) NULL pointer(s)
37     ADPCC_RET_DIVISION_BY_ZERO  = 9,   // a divisor equals ZERO
38     ADPCC_RET_NO_INPUTIMAGE     = 10   // no input image
39 } AdpccResult_t;
40 
41 typedef enum AdpccState_e {
42     ADPCC_STATE_INVALID           = 0,                   /**< initialization value */
43     ADPCC_STATE_INITIALIZED       = 1,                   /**< instance is created, but not initialized */
44     ADPCC_STATE_STOPPED           = 2,                   /**< instance is confiured (ready to start) or stopped */
45     ADPCC_STATE_RUNNING           = 3,                   /**< instance is running (processes frames) */
46     ADPCC_STATE_LOCKED            = 4,                   /**< instance is locked (for taking snapshots) */
47     ADPCC_STATE_MAX                                      /**< max */
48 } AdpccState_t;
49 
50 typedef struct Adpcc_fast_mode_params_s {
51     int fast_mode_en;
52     int ISO[CALIBDB_DPCC_MAX_ISO_LEVEL];
53     int fast_mode_single_en;
54     int fast_mode_single_level[CALIBDB_DPCC_MAX_ISO_LEVEL];
55     int fast_mode_double_en;
56     int fast_mode_double_level[CALIBDB_DPCC_MAX_ISO_LEVEL];
57     int fast_mode_triple_en;
58     int fast_mode_triple_level[CALIBDB_DPCC_MAX_ISO_LEVEL];
59 } Adpcc_fast_mode_params_t;
60 
61 typedef struct Adpcc_sensor_dpcc_s {
62     bool en;
63     int max_level;
64     int level;
65 } Adpcc_sensor_dpcc_t;
66 
67 typedef struct Adpcc_html_param_s {
68     Adpcc_basic_params_t stBasic;
69     Adpcc_bpt_params_t  stBpt;
70     Adpcc_pdaf_params_t stPdaf;
71 } Adpcc_html_param_t;
72 
73 typedef struct AdpccProcResult_s {
74     Adpcc_basic_cfg_params_t stBasic;
75     Adpcc_bpt_params_t stBpt;
76     Adpcc_pdaf_params_t stPdaf;
77 } AdpccProcResult_t;
78 
79 typedef struct AdpccConfig_s {
80     AdpccOPMode_t eMode;
81     AdpccState_t eState;
82 } AdpccConfig_t;
83 
84 typedef struct AdpccExpInfo_s {
85     int hdr_mode;
86     float arPreResTime[3];
87     float arPreResAGain[3];
88     float arPreResDGain[3];
89     int   arPreResIso[3];
90 
91     float arProcResTime[3];
92     float arProcResAGain[3];
93     float arProcResDGain[3];
94     int   arProcResIso[3];
95 } AdpccExpInfo_t;
96 
97 typedef struct Sensor_dpcc_res_s {
98     int enable;
99     int cur_single_dpcc;
100     int cur_multiple_dpcc;
101     int total_dpcc;
102 } Sensor_dpcc_res_t;
103 
104 typedef struct Adpcc_pre_ae_res_s {
105     float arProcResTime[3];
106     float arProcResAGain[3];
107     float arProcResDGain[3];
108     int   arProcResIso[3];
109 } Adpcc_pre_ae_res_t;
110 
111 #endif
112