blob: bb516dbce35d527385699c392306fbb4ddafa859
1 | #ifndef _TVOUT_CM_H |
2 | #define _TVOUT_CM_H |
3 | |
4 | #define REGS_MAX_NUMBER 900 |
5 | |
6 | // *************************************************************************** |
7 | // *** enum definitions ********************************************* |
8 | // *************************************************************************** |
9 | |
10 | typedef enum cm_region_idx_e { |
11 | CM_REGION_IDX_0 = 0, |
12 | CM_REGION_IDX_1, |
13 | CM_REGION_IDX_2, |
14 | CM_REGION_IDX_3, |
15 | CM_REGION_IDX_4, |
16 | CM_REGION_IDX_5, |
17 | CM_REGION_IDX_6, |
18 | CM_REGION_IDX_7, |
19 | } cm_region_idx_t; |
20 | |
21 | typedef enum cm_sat_shape_e { |
22 | CM_SAT_SHAPE_RIGHT_BIGGEST = 0, |
23 | CM_SAT_SHAPE_LEFT_BIGGEST, |
24 | } cm_sat_shape_t; |
25 | |
26 | typedef enum cm_hue_shape_e { |
27 | CM_HUE_SHAPE_LEFT_MORE = 0, |
28 | CM_HUE_SHAPE_RIGHT_MORE, |
29 | } cm_hue_shape_t; |
30 | |
31 | typedef enum cm_demo_pos_e { |
32 | CM_DEMO_POS_TOP = 0, |
33 | CM_DEMO_POS_BOTTOM, |
34 | CM_DEMO_POS_LEFT, |
35 | CM_DEMO_POS_RIGHT, |
36 | } cm_demo_pos_t; |
37 | |
38 | typedef enum cm_sat_sel_e { |
39 | CM_SAT_SEL_U2_V2 = 0, |
40 | CM_SAT_SEL_UV_MAX, |
41 | } cm_sat_sel_t; |
42 | |
43 | typedef enum cm_csc_e { |
44 | CM_CSC_601 = 0, |
45 | CM_CSC_709, |
46 | CM_CSC_FULL_601, |
47 | CM_CSC_FULL_709, |
48 | } cm_csc_t; |
49 | |
50 | // *************************************************************************** |
51 | // *** struct definitions ********************************************* |
52 | // *************************************************************************** |
53 | |
54 | typedef struct cm_region_s { |
55 | enum cm_region_idx_e region_idx; |
56 | // sym |
57 | unsigned char sym_en; |
58 | // sat - top |
59 | unsigned char sat_en; |
60 | unsigned char sat_central_en; |
61 | enum cm_sat_shape_e sat_shape; |
62 | unsigned char sat_gain; |
63 | unsigned char sat_inc; |
64 | // sat - lum |
65 | unsigned char sat_lum_h_slope; |
66 | unsigned char sat_lum_l_slope; |
67 | unsigned char sat_lum_h; |
68 | unsigned char sat_lum_l; |
69 | // sat - sat |
70 | unsigned char sat_sat_h_slope; |
71 | unsigned char sat_sat_l_slope; |
72 | unsigned char sat_sat_h; |
73 | unsigned char sat_sat_l; |
74 | // hue - top |
75 | unsigned char hue_en; |
76 | unsigned char hue_central_en; |
77 | enum cm_hue_shape_e hue_shape; |
78 | unsigned char hue_gain; |
79 | unsigned char hue_clockwise; |
80 | unsigned char hue_shf_ran; |
81 | unsigned short hue_shf_sta; |
82 | // hue - lum |
83 | unsigned char hue_lum_h_slope; |
84 | unsigned char hue_lum_l_slope; |
85 | unsigned char hue_lum_h; |
86 | unsigned char hue_lum_l; |
87 | // hue - sat |
88 | unsigned char hue_sat_h_slope; |
89 | unsigned char hue_sat_l_slope; |
90 | unsigned char hue_sat_h; |
91 | unsigned char hue_sat_l; |
92 | } cm_region_t; |
93 | |
94 | typedef struct cm_top_s { |
95 | unsigned char chroma_en; |
96 | enum cm_sat_sel_e sat_sel; |
97 | unsigned char uv_adj_en; |
98 | unsigned char rgb_to_hue_en; |
99 | enum cm_csc_e csc_sel; |
100 | } cm_top_t; |
101 | |
102 | typedef struct cm_cbar_s { |
103 | unsigned char en; |
104 | unsigned char wid; |
105 | unsigned char cr; |
106 | unsigned char cb; |
107 | unsigned char y; |
108 | } cm_cbar_t; |
109 | typedef struct cm_demo_s { |
110 | unsigned char en; |
111 | enum cm_demo_pos_e pos; |
112 | unsigned char hlight_adj; |
113 | unsigned short wid; |
114 | struct cm_cbar_s cbar; |
115 | } cm_demo_t; |
116 | |
117 | typedef struct cm_regmap_s { |
118 | unsigned long reg[50]; |
119 | } cm_regmap_t; |
120 | |
121 | typedef enum reg_bus_type_e { |
122 | REG_TYPE_PHY = 0, |
123 | REG_TYPE_CBUS, |
124 | REG_TYPE_APB, |
125 | REG_TYPE_AXI, |
126 | REG_TYPE_AHB, |
127 | REG_TYPE_MPEG, |
128 | REG_TYPE_INDEX_VPPCHROMA, |
129 | REG_TYPE_INDEX_GAMMA, |
130 | VALUE_TYPE_CONTRAST_BRIGHTNESS, |
131 | REG_TYPE_INDEX_VPP_COEF, |
132 | REG_TYPE_MAX, |
133 | } reg_bus_type_t; |
134 | |
135 | /* Register table structure */ |
136 | typedef struct am_reg_s { |
137 | unsigned int type; //32-bits; 0: CBUS; 1: APB BUS... |
138 | unsigned int addr; //32-bits; Register address |
139 | unsigned int mask; //32-bits; Valid bits |
140 | unsigned int val; //32-bits; Register Value |
141 | } am_reg_t; |
142 | |
143 | #ifdef AMVIDEO_REG_TABLE_DYNAMIC |
144 | typedef struct am_regs_s { |
145 | unsigned int length; // Length of total am_reg |
146 | struct am_reg_s *am_reg; |
147 | } am_regs_t; |
148 | #else |
149 | typedef struct am_regs_s { |
150 | unsigned int length; // Length of total am_reg |
151 | struct am_reg_s am_reg[REGS_MAX_NUMBER]; |
152 | } am_regs_t; |
153 | #endif |
154 | |
155 | #endif // _TVOUT_CM_H |
156 |