xref: /OK3568_Linux_fs/external/mpp/mpp/vproc/inc/iep2_api.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2020 Rockchip Electronics 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 
17 #ifndef __IEP2_API_H__
18 #define __IEP2_API_H__
19 
20 #include <stdint.h>
21 #include <stdbool.h>
22 
23 #include "iep_common.h"
24 
25 enum IEP2_FIELD_ORDER {
26     IEP2_FIELD_ORDER_TFF,
27     IEP2_FIELD_ORDER_BFF,
28     IEP2_FIELD_ORDER_UND
29 };
30 
31 enum IEP2_FF_MODE {
32     IEP2_FF_MODE_FRAME,
33     IEP2_FF_MODE_FIELD
34 };
35 
36 enum IEP2_FMT {
37     IEP2_FMT_YUV422 = 2,
38     IEP2_FMT_YUV420
39 };
40 
41 enum IEP2_YUV_SWAP {
42     IEP2_YUV_SWAP_SP_UV,
43     IEP2_YUV_SWAP_SP_VU,
44     IEP2_YUV_SWAP_P0,
45     IEP2_YUV_SWAP_P
46 };
47 
48 enum IEP2_DIL_MODE {
49     IEP2_DIL_MODE_DISABLE,
50     IEP2_DIL_MODE_I5O2,
51     IEP2_DIL_MODE_I5O1T,
52     IEP2_DIL_MODE_I5O1B,
53     IEP2_DIL_MODE_I2O2,
54     IEP2_DIL_MODE_I1O1T,
55     IEP2_DIL_MODE_I1O1B,
56     IEP2_DIL_MODE_PD,
57     IEP2_DIL_MODE_BYPASS,
58     IEP2_DIL_MODE_DECT
59 };
60 
61 enum IEP2_OUT_MODE {
62     IEP2_OUT_MODE_LINE,
63     IEP2_OUT_MODE_TILE
64 };
65 
66 enum IEP2_PARAM_TYPE {
67     IEP2_PARAM_TYPE_COM,
68     IEP2_PARAM_TYPE_MODE,
69     IEP2_PARAM_TYPE_MD,
70     IEP2_PARAM_TYPE_DECT,
71     IEP2_PARAM_TYPE_OSD,
72     IEP2_PARAM_TYPE_ME,
73     IEP2_PARAM_TYPE_EEDI,
74     IEP2_PARAM_TYPE_BLE,
75     IEP2_PARAM_TYPE_COMB,
76     IEP2_PARAM_TYPE_ROI
77 };
78 
79 // Pulldown compose flag
80 enum PD_COMP_FLAG {
81     PD_COMP_FLAG_CC,
82     PD_COMP_FLAG_CN,
83     PD_COMP_FLAG_NC,
84     PD_COMP_FLAG_NON
85 };
86 
87 enum PD_TYPES {
88     PD_TYPES_3_2_3_2,
89     PD_TYPES_2_3_2_3,
90     PD_TYPES_2_3_3_2,
91     PD_TYPES_3_2_2_3,
92     PD_TYPES_UNKNOWN
93 };
94 
95 union iep2_api_content {
96     struct {
97         enum IEP2_FMT sfmt;
98         enum IEP2_YUV_SWAP sswap;
99         enum IEP2_FMT dfmt;
100         enum IEP2_YUV_SWAP dswap;
101         int width;
102         int height;
103         int hor_stride;
104     } com;
105 
106     struct {
107         enum IEP2_DIL_MODE dil_mode;
108         enum IEP2_OUT_MODE out_mode;
109         enum IEP2_FIELD_ORDER dil_order;
110         enum IEP2_FF_MODE ff_mode;
111     } mode;
112 
113     struct {
114         uint32_t md_theta;
115         uint32_t md_r;
116         uint32_t md_lambda;
117     } md;
118 
119     struct {
120         uint32_t roi_en;
121     } roi;
122 };
123 
124 struct iep2_api_params {
125     enum IEP2_PARAM_TYPE ptype;
126     union iep2_api_content param;
127 };
128 
129 struct iep2_api_info {
130     enum IEP2_FIELD_ORDER dil_order;
131     bool frm_mode;
132     enum PD_TYPES pd_types;
133     enum PD_COMP_FLAG pd_flag;
134     RK_U32 dil_order_confidence_ratio;
135 };
136 
137 struct mv_list {
138     int mv[8];
139     int vld[8];
140     int idx;
141 };
142 
143 #ifdef __cplusplus
144 extern "C" {
145 #endif
146 
147 iep_com_ctx* rockchip_iep2_api_alloc_ctx(void);
148 void rockchip_iep2_api_release_ctx(iep_com_ctx *com_ctx);
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 #endif
155