summaryrefslogtreecommitdiff
path: root/tvapi/libtv/vpp/CPQdb.h (plain)
blob: f9c3ceff1626726239c61c191976573b286c8f9d
1/*
2 * CPQdb.h
3 *
4 * Created on: 2011-12-13
5 * Author: casey
6 */
7
8#ifndef CPQDB_H_
9#define CPQDB_H_
10
11#define PQ_NO_ANDROID 0
12
13
14#if (PQ_NO_ANDROID == 1)
15#include "sqlite3.h"
16#else
17#include "../../sqlite/dist/sqlite3.h"
18#endif
19#include "tvutils/CFile.h"
20#include "../tvin/CTvin.h"
21#include "CVpp.h"
22#include "tvutils/CSqlite.h"
23
24typedef enum tvpq_data_type_e {
25 TVPQ_DATA_BRIGHTNESS,
26 TVPQ_DATA_CONTRAST,
27 TVPQ_DATA_SATURATION,
28 TVPQ_DATA_HUE,
29 TVPQ_DATA_SHARPNESS,
30 TVPQ_DATA_VOLUME,
31
32 TVPQ_DATA_MAX,
33} tvpq_data_type_t;
34
35typedef struct tvpq_data_s {
36 int TotalNode;
37 int NodeValue;
38 int IndexValue;
39 int RegValue;
40 double step;
41} tvpq_data_t;
42
43typedef struct tvpq_sharpness_reg_s {
44 int TotalNode;
45 am_reg_t Value;
46 int NodeValue;
47 int IndexValue;
48 double step;
49} tvpq_sharpness_reg_t;
50
51typedef struct tvpq_sharpness_regs_s {
52 int length;
53 tvpq_sharpness_reg_t reg_data[50];
54} tvpq_sharpness_regs_t;
55
56typedef struct tvpq_nonlinear_s {
57 int osd0;
58 int osd25;
59 int osd50;
60 int osd75;
61 int osd100;
62} tvpq_nonlinear_t;
63
64
65class CPqData: public CSqlite
66{
67public:
68 CPqData();
69 ~CPqData();
70 int PQ_GetColorDemoParams(vpp_color_demomode_t demomode, void *params);
71 int PQ_GetBaseColorParams(vpp_color_basemode_t basemode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, am_regs_t *regs);
72 int PQ_GetCM2Params(vpp_color_management2_t basemode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, am_regs_t *regs);
73 int PQ_GetNR2Params(vpp_noise_reduction2_mode_t basemode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, am_regs_t *regs);
74 int PQ_GetXVYCCParams(vpp_xvycc_mode_t xvycc_mode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, am_regs_t *regs, am_regs_t *regs_1);
75 int PQ_GetMCDIParams(vpp_mcdi_mode_t mcdi_mode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, am_regs_t *regs);
76 int PQ_ColorTemperatureRGBogo2Params(void *params, tcon_rgb_ogo_t rgb_ogo);
77 int PQ_ColorTemperatureParams2RGBogo(tcon_rgb_ogo_t *rgb_ogo, void *params);
78 int PQ_GetColorTemperatureParams(vpp_color_temperature_mode_t Tempmode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, tvin_trans_fmt_t trans_fmt,
79 tcon_rgb_ogo_t *params);
80 int PQ_SetColorTemperatureParams(vpp_color_temperature_mode_t Tempmode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, tvin_trans_fmt_t trans_fmt,
81 tcon_rgb_ogo_t params);
82 int PQ_ResetAllColorTemperatureParams(void);
83 int PQ_GetBacklightParams(tvin_port_t source_port, int level, int *params);
84 int PQ_SetBacklightParams(tvin_port_t source_port, int level, int params);
85 int PQ_SetNoLineAllBrightnessParams(tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
86 int PQ_GetNoLineAllBrightnessParams(tv_source_input_type_t source_type, int *osd0, int *osd25, int *osd50, int *osd75, int *osd100);
87 int PQ_GetBrightnessParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int *params);
88 int PQ_SetBrightnessParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int params);
89 int PQ_SetNoLineAllContrastParams(tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
90 int PQ_GetNoLineAllContrastParams(tv_source_input_type_t source_type, int *osd0, int *osd25, int *osd50, int *osd75, int *osd100);
91 int PQ_GetContrastParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int *params);
92 int PQ_SetContrastParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int params);
93 int PQ_SetNoLineAllSaturationParams(tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
94 int PQ_GetNoLineAllSaturationParams(tv_source_input_type_t source_type, int *osd0, int *osd25, int *osd50, int *osd75, int *osd100);
95 int PQ_GetSaturationParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int *params);
96 int PQ_SetSaturationParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int params);
97 int PQ_SetNoLineAllHueParams(tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
98 int PQ_GetNoLineAllHueParams(tv_source_input_type_t source_type, int *osd0, int *osd25, int *osd50, int *osd75, int *osd100);
99 int PQ_GetHueParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int *params);
100 int PQ_SetHueParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int params);
101 int PQ_SetNoLineAllSharpnessParams(tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
102 int PQ_GetNoLineAllSharpnessParams(tv_source_input_type_t source_type, int *osd0, int *osd25, int *osd50, int *osd75, int *osd100);
103 int PQ_GetSharpnessParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, am_regs_t *regs);
104 int PQ_SetSharpnessParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, am_regs_t regs);
105 int PQ_SetNoLineAllVolumeParams(tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
106 int PQ_GetNoLineAllVolumeParams(tv_source_input_type_t source_type, int *osd0, int *osd25, int *osd50, int *osd75, int *osd100);
107 int PQ_GetVolumeParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int *length, int *params);
108 int PQ_SetVolumeParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int level, int params);
109 int PQ_ResetAllNoLineParams(void);
110 int PQ_GetNoiseReductionParams(vpp_noise_reduction_mode_t nr_mode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int *params);
111 int PQ_SetNoiseReductionParams(vpp_noise_reduction_mode_t nr_mode, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int *params);
112 int PQ_GetDNLPParams(tvin_port_t source_port, tvin_sig_fmt_t fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, ve_dnlp_t *params, ve_dnlp_table_t *newParams, int *dnlpFlag);
113 int PQ_GetBlackExtParams(tv_source_input_type_t source_type, tvin_sig_fmt_t fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, ve_bext_t *params);
114 int PQ_GetOverscanParams(tv_source_input_type_t source_type, tvin_sig_fmt_t fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, vpp_display_mode_t dmode, tvin_cutwin_t *cutwin_t);
115 int PQ_SetOverscanParams(tv_source_input_type_t source_type, tvin_sig_fmt_t fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, tvin_cutwin_t cutwin_t);
116 int PQ_ResetAllOverscanParams(void);
117 int PQ_GetPQModeParams(tv_source_input_type_t source_type, vpp_picture_mode_t pq_mode, vpp_pq_para_t *params);
118 int PQ_SetPQModeParams(tv_source_input_type_t source_type, vpp_picture_mode_t pq_mode, vpp_pq_para_t *params);
119 int PQ_ResetAllPQModeParams(void);
120 int PQ_GetGammaTableR(int panel_id, tvin_port_t source_port, tvin_sig_fmt_t fmt, tcon_gamma_table_t *gamma_r);
121 int PQ_GetGammaTableG(int panel_id, tvin_port_t source_port, tvin_sig_fmt_t fmt, tcon_gamma_table_t *gamma_g);
122 int PQ_GetGammaTableB(int panel_id, tvin_port_t source_port, tvin_sig_fmt_t fmt, tcon_gamma_table_t *gamma_b);
123 int PQ_GetGammaSpecialTable(int gammaValue, const char *f_name, tcon_gamma_table_t *gamma_r);
124 int PQ_GetVGAAjustPara(tvin_sig_fmt_t vga_fmt, tvafe_vga_parm_t *adjparam);
125 int PQ_SetVGAAjustPara(tvin_sig_fmt_t vga_fmt, tvafe_vga_parm_t adjparam);
126 int PQ_GetPhaseArray(am_phase_t *am_phase);
127 int PQ_GetPLLParams(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, am_regs_t *regs);
128 int PQ_GetCVD2Params(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, am_regs_t *regs);
129
130 int openDB();
131 int closeDB();
132 int getRegValues(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, am_regs_t *regs);
133 int getRegValuesByValue(const char *name, const char *f_name, const char *f2_name, const int val, const int val2, am_regs_t *regs);
134 int getRegValuesByValue_long(const char *name, const char *f_name, const char *f2_name, const int val, const int val2, am_regs_t *regs, am_regs_t *regs_1);
135 int LoadAllPQData(tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int flag);
136 void initialTable(int type);
137 void transferFixTable();
138
139private:
140 int CaculateLevelParam(tvpq_data_t *pq_data, int nodes, int level);
141 am_regs_t CaculateLevelRegsParam(tvpq_sharpness_regs_t *pq_regs, int level);
142 int GetNonlinearMapping(tvpq_data_type_t data_type, tvin_port_t source_port, int level, int *params);
143 int GetNonlinearMappingByOSDFac(tvpq_data_type_t data_type, tv_source_input_type_t source_type, int *params);
144 int SetNonlinearMapping(tvpq_data_type_t data_type, tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
145 int LoadPQData(tvpq_data_type_t data_type, tvin_port_t source_port, tvin_sig_fmt_t sig_fmt, is_3d_type_t is2dOr3d, tvin_trans_fmt_t trans_fmt, int flag);
146 int PQ_GetGammaTable(int panel_id, tvin_port_t source_port, tvin_sig_fmt_t fmt, const char *f_name, tcon_gamma_table_t *val);
147 int SetNonlinearMappingByName(const char *name, tvpq_data_type_t data_type, tv_source_input_type_t source_type, int osd0, int osd25, int osd50, int osd75, int osd100);
148 int PQ_SetPQModeParamsByName(const char *name, tv_source_input_type_t source_type, vpp_picture_mode_t pq_mode, vpp_pq_para_t *params);
149
150 tvpq_data_t pq_bri_data[15];
151 tvpq_data_t pq_con_data[15];
152 tvpq_data_t pq_sat_data[15];
153 tvpq_data_t pq_hue_data[15];
154 tvpq_sharpness_regs_t pq_sharpness_reg_data[10];
155 int bri_nodes;
156 int con_nodes;
157 int hue_nodes;
158 int sat_nodes;
159 int sha_nodes;
160};
161#endif
162