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_ABAYER2DNR_ALGO_PRVT_V2_H_
21 #define _RK_AIQ_TYPES_ABAYER2DNR_ALGO_PRVT_V2_H_
22 
23 #include "abayer2dnr2/rk_aiq_types_abayer2dnr_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 Abayer2dnr_Context_V2_s {
72     Abayer2dnr_ExpInfo_V2_t stExpInfo;
73     Abayer2dnr_State_V2_t eState;
74     Abayer2dnr_OPMode_V2_t eMode;
75 
76     Abayer2dnr_Auto_Attr_V2_t stAuto;
77     Abayer2dnr_Manual_Attr_V2_t stManual;
78 
79     rk_aiq_bayer2dnr_strength_v2_t stStrength;
80 
81     bool isIQParaUpdate;
82     bool isGrayMode;
83     Abayer2dnr_ParamMode_V2_t eParamMode;
84     int prepare_type;
85 
86     CalibDbV2_Bayer2dnrV2_t bayernr_v2;
87 
88     int isReCalculate;
89 } Abayer2dnr_Context_V2_t;
90 
91 
92 
93 
94 
95 
96 //RKAIQ_END_DECLARE
97 
98 #endif
99 
100 
101