Files
2026-08-24 10:03:24 +08:00

196 lines
6.0 KiB
C++

/*
* Copyright (c) 2014 Amlogic, Inc. All rights reserved.
*
* This source code is subject to the terms and conditions defined in the
* file 'LICENSE' which is part of this source code package.
*
* Description: header file
*/
#ifndef _SYNCDATABASE_H_
#define _SYNCDATABASE_H_
#define CGF_PQ_DATABASE_VERSION "pq.database.version"
//ID
#define SSM_PICTURE_ID (310) //VPP_DATA_POS_PICTURE_MODE_PARAM_START
#define SSM_COLORTEMP_ID (311) //VPP_DATA_POS_COLOR_TEMP_PARAM_START
#define SSM_CMS_ID (312) //VPP_DATA_POS_COLORCUSTOMIZE_CM_START
#define SSM_PQ_MODE_ID (314) //VPP_DATA_POS_PQ_MODE_START
#define SSM_WB_GAMMA_ID (315) //VPP_DATA_POS_WB_GAMMA_PARAM_START
//old ssmdata info
#define MAX_SSM_PQ_SRC_INDEX (18) //(PQ_SRC_MAX)
#define MAX_SSM_PQ_TIMMING_INDEX (6) //(PQ_FMT_MAX)
#define MAX_SSM_PICTUREMODE_INDEX (14) //(VPP_PICTURE_MODE_MAX)
#define MAX_SSM_COLORTEMP_INDEX (6) //(VPP_COLOR_TEMPERATURE_MODE_MAX)
#define MAX_SSM_WB_GAMMA_POINT (21)
#define MAX_SSM_PICTUREMODE_SIZE ((1 * 4) + 4) // PictureMode struct + Flag
#define MAX_SSM_PICTUREMODE_PARAM_SIZE ((30 * 4) + 4) // PictureMode Param struct + Flag
#define MAX_SSM_COLORTEMP_PARAM_SIZE ((10 * 4) + 4) // ColorTemp Param + Flag
#define MAX_SSM_WB_GAMMA_PARAM_SIZE ((((MAX_SSM_WB_GAMMA_POINT * 3) + 1) * 4) + 4) // WB Gamma Param + Flag
#define MAX_SSM_LVDS_SSC_PARAM_SIZE (20)
#define MAX_SSM_COLORCUSTOMIZE_CM_PARAM_SIZE (120)
#define MAX_SSM_COLORCUSTOMIZE_3DLUT_PARAM_SIZE (80)
//old cridata info
#define CRI_RGBOGO_OFFSET (0)
#define CRI_RGBOGO_LEN ((10 * 4) + 4) //(sizeof(tcon_rgb_ogo_t) + sizeof(int))
#define CRI_RGBOGO_INDEX_MAX (8)
#define CRI_WB_GAMMA_OFFSET (CRI_RGBOGO_OFFSET + (CRI_RGBOGO_LEN * CRI_RGBOGO_INDEX_MAX))
#define CRI_WB_GAMMA_LEN ((63 * 4) + 4) //(sizeof(WB_GAMMA_TABLE_DATA) + sizeof(int))
#define CRI_WB_GAMMA_INDEX_MAX (8)
#define CRI_GAMMA_OFFSET (CRI_WB_GAMMA_OFFSET + (CRI_WB_GAMMA_LEN * CRI_WB_GAMMA_INDEX_MAX * WB_GAMMA_MODE_MAX))
#define CRI_GAMMA_LEN ((257 * 2) + 4) //(sizeof(tcon_gamma_table_s) + sizeof(int))
#define CRI_GAMMA_INDEX_MAX (8)
//3.1
#define CRI_DATA_WB_GAMMA_OFFSET_3_1 (CRI_RGBOGO_OFFSET + (CRI_RGBOGO_LEN * CRI_RGBOGO_INDEX_MAX))
#define CRI_DATE_WB_GAMMA_LEN_3_1 ((63 * 4) + 2) //sizeof(WB_GAMMA_TABLE_DATA) + 2
#define CRI_DATA_GAMMA_OFFSET_3_1 (CRI_DATA_WB_GAMMA_OFFSET_3_1 + (CRI_DATE_WB_GAMMA_LEN_3_1 * CRI_DATE_WB_GAMMA_INDEX_MAX * WB_GAMMA_MODE_MAX))
#define CRI_DATE_GAMMA_LEN_3_1 (((257 * 3) * 2) + 2) //sizeof(GAMMA_TABLE) + 2
typedef struct _SSM_PictureModeInfo {
int PictureMode;
int Flag;
} SSM_PictureModeInfo;
typedef struct _SSM_PICTURE_STRUCT {
//PM5 XML has config
int Brightness;
int Contrast;
int Saturation;
int Hue;
int Sharpness;
int Backlight;
int Nr;
int DynamicContrast;
int ColorGamut;
int ColorTemperature;
int LocalContrast;
int BlackStretch;
int BlueStretch;
int MpegNr;
int ChromaCoring;
int SuperResolution;
int GammaMidLuminance;
int CmLevel;
int DynamicBacklight;
int EyeProtection;
int SmoothPlus;
int HdrTmo;
int DolbyMode;
int DolbyDarkDetail;
//PM5 XML not has config
int Deblock;
int Demosquito;
} SSM_PICTURE_STRUCT;
typedef struct _SSM_3_1_PICTURE_STRUCT {
//PM5 XML has config
int Brightness;
int Contrast;
int Saturation;
int Hue;
int Sharpness;
int Backlight;
int Nr;
int DynamicContrast;
int ColorGamut;
int ColorTemperature;
int LocalContrast;
int BlackStretch;
int BlueStretch;
int MpegNr;
int ChromaCoring;
int SuperResolution;
int GammaMidLuminance;
int CmLevel;
int DynamicBacklight;
int EyeProtection;
int SmoothPlus;
int HdrTmo;
int DolbyMode;
int DolbyDarkDetail;
} SSM_3_1_PICTURE_STRUCT;
typedef struct _SSM_COLORTEMP_STRUCT {
unsigned int en;
int r_pre_offset;
int g_pre_offset;
int b_pre_offset;
unsigned int r_gain;
unsigned int g_gain;
unsigned int b_gain;
int r_post_offset;
int g_post_offset;
int b_post_offset;
} SSM_COLORTEMP_STRUCT;
typedef struct _SSM_WB_GAMMA_TABLE_DATA {
int R_OFFSET[MAX_SSM_WB_GAMMA_POINT];
int G_OFFSET[MAX_SSM_WB_GAMMA_POINT];
int B_OFFSET[MAX_SSM_WB_GAMMA_POINT];
} SSM_WB_GAMMA_TABLE_DATA;
typedef struct _SSM_WB_GAMMA_TABLE {
int ENABLE;
SSM_WB_GAMMA_TABLE_DATA WB_GAMMA_DATA;
} SSM_WB_GAMMA_TABLE;
typedef struct _SSM_CMS_COLOR_PARAM {
int Saturation;
int Hue;
int Luma;
} SSM_CMS_COLOR_PARAM;
typedef struct _SSM_TABLE_CMS {
int CmsEnable;
SSM_CMS_COLOR_PARAM CmsColor[9];
} SSM_TABLE_CMS;
class SyncDataBase {
public:
SyncDataBase();
~SyncDataBase();
static SyncDataBase *GetInstance();
bool SyncDataBaseInit(void);
bool SyncCriDataInit(void);
private:
int SyncDataBasePictureMode(void);
int SyncDataBasePictureModeData(void);
int SyncDataBaseColorTempData(void);
int SyncDataBaseWbGammaData(void);
int SyncDataBaseCmsData(void);
int SyncDataBaseBySourcePicture(void);
int SyncDataBaseGlobalPicture(void);
int SyncDataBaseLcdLvdsSsc(void);
int SyncDataBasePictureModeData_3_1(void);
int SyncDataBaseCmsData_3_1(void);
int SyncCriDataColorTempData(void);
int SyncCriDataMultipointGammaData(void);
int SyncCriDataGammaData(void);
int SyncCriDataMultipointGammaData_3_1(void);
int SyncCriDataGammaData_3_1(void);
bool CheckIndexSupport(int source, int timming);
static SyncDataBase *mInstance;
};
#endif