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