1 /*
2  *rk_aiq_types_alsc_algo_prvt.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_TYPES_ABAYERNR_ALGO_PRVT_V2_H_
21 #define _RK_AIQ_TYPES_ABAYERNR_ALGO_PRVT_V2_H_
22 
23 #include "arawnr2/rk_aiq_types_abayernr_algo_int_v2.h"
24 #include "RkAiqCalibDbTypes.h"
25 #include "xcam_log.h"
26 #include "xcam_common.h"
27 
28 //RKAIQ_BEGIN_DECLARE
29 
30 // fix define
31 #define FIXVSTINV       10      // VST fix
32 #define FIXSQRTBIT      30      // SQRT fix bits
33 #define FIXSQRTDIV      1       // SQRT fix
34 #define FIXNLMCALC      10      // NLM calc fix
35 #define FIXGAINBIT      8       // NLM calc fix
36 #define FIXBILSTRG      8       // BIL flt strength calc fix
37 #define FIXNLMSQRT      6       // NLM SQRT fix, FIXNLMSQRT*2 nee less FIXNLMCALC
38 #define FIXGAUSBIT      8       // gauss weight fix bits;
39 #define FIXTNRWGT       10
40 #define FIXTNRDIF       10
41 #define FIXTNRSFT       10
42 #define FIXTNRSTG       8
43 #define FIXTNREXP       20      //20        // TNR EXP fix bits
44 #define FIXTNREXPMOD    14      //20        // TNR EXP fix bits
45 #define FIXTNRSQRT      30
46 #define FIXGAINOUT      8
47 
48 #define FIXEXPBIT      20       // EXP fix bits
49 #define FIXEXP2BIT     10       // EXP fix bits
50 #define FIXEXPDIV      1        // EXP fix
51 
52 #define FIXMERGEWG      10      // HDR merge weight
53 #define FIXTMOWG        12      // HDR TMO weight
54 
55 #define FIXDIFMAX       ((long long)1<<(14))     // DIFF USE 12bits
56 #define DIVSUBBIT       1                        // div sub bits
57 
58 #define FIXCURVE        8           // noise curve interp
59 #define FIXDIVBIT       20          // DIV MAX BITS
60 #define FIXDAOBIT       49          // DAO MAX BITS
61 #define FIXSHTBIT       2           // div result shift bits.
62 #define FIXMINBIT       8           // div min bits.
63 
64 #define LUTMAX_FIX      30.0
65 #define LUTMAXM1_FIX    300.0 //29.0
66 #define LUTPRECISION_FIX (1<<FIXNLMCALC)
67 #define EXPPRECISION_FIX (1<<(FIXNLMCALC+5))
68 #define EXP2RECISION_FIX (1<<(FIXNLMCALC+5))
69 
70 //anr context
71 typedef struct Abayernr_Context_V2_s {
72     Abayernr_ExpInfo_t stExpInfo;
73     Abayernr_State_t eState;
74     Abayernr_OPMode_t eMode;
75 
76     Abayernr_Auto_Attr_V2_t stAuto;
77     Abayernr_Manual_Attr_V2_t stManual;
78 
79     struct list_head* list_bayernr_v2;
80 
81     float fRawnr_SF_Strength;
82     float fRawnr_TF_Strength;
83 
84     bool isIQParaUpdate;
85     bool isGrayMode;
86     Abayernr_ParamMode_t eParamMode;
87     int prepare_type;
88 
89     CalibDbV2_BayerNrV2_t bayernr_v2;
90 
91     int isReCalculate;
92 } Abayernr_Context_V2_t;
93 
94 
95 
96 
97 
98 
99 //RKAIQ_END_DECLARE
100 
101 #endif
102 
103 
104