/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved. * Description: pq iapi api define * Author: Hisilicon * Create: 2019/11/15 */ #ifndef __UAPI_PQ_H__ #define __UAPI_PQ_H__ #include "td_type.h" #include "uapi_disp.h" #include "uapi_color.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* __cplusplus */ /* *******************************Struct Definition******************************* */ /* **************************** Macro Definition ***************************** */ #define PQ_DCI_CURVE_POINT_NUM 33 #define PQ_STOGRAM_NUM 256 #define PQ_DCI_FINAL_WEIGHT_NUM 33 #define PQ_BIN_VERSION_MAX 40 #define PQ_GAMMA_NUM 1024 #define PQ_COLOR_H_NUM 65 #define PQ_COLOR_S_NUM 16 #define PQ_COLOR_Y_NUM 9 #define PQ_HDR_TMLUT_NUM 256 #define PQ_3D_LUT_ROW_NUM 3 #define PQ_3D_LUT_POINT_NUM_9 (9 * 9 * 9) #define PQ_3D_LUT_POINT_NUM_17 (17 * 17 * 17) #define PQ_BIN_VERSION_MAX 40 /* * Image Mode Set Different Parameters Under Different Mode * CNcomment: 图像模式选择;在不同的模式下配置不同的参数 */ typedef enum { UAPI_PQ_IMAGE_MODE_NATURAL = 0, /* Natural mode */ /* CNcomment: 自然模式 */ UAPI_PQ_IMAGE_MODE_PERSON = 1, /* Person mode */ /* CNcomment: 人物模式 */ UAPI_PQ_IMAGE_MODE_FILM = 2, /* Film mode */ /* CNcomment: 电影模式 */ UAPI_PQ_IMAGE_MODE_UD = 3, /* User Defined mode */ /* CNcomment: 用户自定义模式 */ UAPI_PQ_IMAGE_MODE_NORMAL = 4, /* Normal mode */ /* CNcomment: 正常模式 */ UAPI_PQ_IMAGE_MODE_VIDEOPHONE = 5, /* Video Phone mode */ /* CNcomment: 可视电话模式 */ UAPI_PQ_IMAGE_MODE_GALLERY = 6, /* Gallery mode */ /* CNcomment: 图库模式 */ UAPI_PQ_IMAGE_MODE_MAX, } uapi_pq_image_mode; /* * Demo Display Mode * CNcomment: 卖场显示模式 */ typedef enum { UAPI_PQ_DEMO_MODE_CLOSE = 0, /* Disable */ /* CNcomment : Demo 不使能 */ UAPI_PQ_DEMO_MODE_FIXED_R, /* Fixed Enable Right */ /* CNcomment: 固定右侧使能 */ UAPI_PQ_DEMO_MODE_FIXED_L, /* Fixed Enable Left */ /* CNcomment: 固定左侧使能 */ UAPI_PQ_DEMO_MODE_SCROLL_R, /* Enable Right; and Roll from Left to right */ /* CNcomment: 右侧使能;从左向右移动 */ UAPI_PQ_DEMO_MODE_SCROLL_L, /* Enable Left; and Roll from Left to right */ /* CNcomment: 左侧使能;从左向右移动 */ UAPI_PQ_DEMO_MODE_MAX } uapi_pq_demo_mode; /* * Algorithm Moudle * CNcomment: 算法模块 */ typedef enum { UAPI_PQ_MODULE_ALL = 0, /* All Algorithm */ /* CNcomment: 全部算法 */ UAPI_PQ_MODULE_DEI, /* DeInterlace MODULE */ /* CNcomment: 基于运动补偿的去隔行算模块 */ UAPI_PQ_MODULE_FMD, /* Film mode Detect MODULE */ /* CNcomment: 电影源检测 模块 */ UAPI_PQ_MODULE_TNR, /* Time Noise Reduction */ /* CNcomment: 时域降噪模块 */ UAPI_PQ_MODULE_SNR, /* Space Noise Reduction */ /* CNcomment: 空域降噪模块 */ UAPI_PQ_MODULE_DB, /* Block Noise Reduction */ /* CNcomment: 块噪声降噪模块 */ UAPI_PQ_MODULE_DM, /* Mosquito Noise Reduction */ /* CNcomment:蚊虫噪声降噪模块 */ UAPI_PQ_MODULE_DS, /* Shoot Noise Reduction */ /* CNcomment: 伪边缘消除模块 */ UAPI_PQ_MODULE_DC, /* Decontour Reduction */ /* CNcomment: 等高线消除模块 */ UAPI_PQ_MODULE_HSHARPNESS, /* hsharpen MODULE */ /* CNcomment: hsharpen 模块 */ UAPI_PQ_MODULE_SHARPNESS, /* Sharpen MODULE */ /* CNcomment: 锐化模块 */ UAPI_PQ_MODULE_CCCL, /* cccl MODULE */ /* CNcomment: cccl 模块 */ UAPI_PQ_MODULE_COLOR_CORING, /* Color Coring Noise Reduction */ /* CNcomment: 颜色噪声消除 */ UAPI_PQ_MODULE_BLUE_STRETCH, /* BS MODULE */ /* CNcomment: BS 模块 */ UAPI_PQ_MODULE_GAMMA, /* Gamma MODULE */ /* CNcomment: Gamma 模块 */ UAPI_PQ_MODULE_DCI, /* Dynamic Contrast Improvement */ /* CNcomment: 自动对比度调节 */ UAPI_PQ_MODULE_COLOR, /* Automatic Color Management */ /* CNcomment: 智能颜色调节 */ UAPI_PQ_MODULE_IQTM, /* IQTM MODULE */ /* CNcomment: IQTM 模块 */ UAPI_PQ_MODULE_SR, /* Super Resolution */ /* CNcomment: 超分模块 */ UAPI_PQ_MODULE_WCG, /* WCG Resolution */ /* CNcomment: WCG模块 */ UAPI_PQ_MODULE_HDR, /* HDR MODULE */ /* CNcomment: HDR 模块 */ UAPI_PQ_MODULE_SDR2HDR, /* SDR Trans To HDR */ /* CNcomment: SDR 转HDR 模块 */ UAPI_PQ_MODULE_3DLUT, /* 3D Lut MODULE> */ /* CNcomment: 3D lut 模块 */ UAPI_PQ_MODULE_COLOR_TEMP, /* Color Temprateur */ /* CNcomment: 色温 */ UAPI_PQ_MODULE_CTI, /* chroma transition improve */ /* CTI: 色度转换改善 */ UAPI_PQ_MODULE_MAX } uapi_pq_module; typedef struct { td_u32 red; /* Red; Range:0~1023 */ /* CNcomment: 红色;范围:0~1023 */ td_u32 green; /* Green; Range:0~1023 */ /* CNcomment: 绿色;范围:0~1023 */ td_u32 blue; /* Blue; Range:0~1023 */ /* CNcomment: 蓝色;范围:0~1023 */ td_u32 cyan; /* Cyan; Range:0~1023 */ /* CNcomment: 青色;范围:0~1023 */ td_u32 magenta; /* Magenta; Range:0~1023 */ /* CNcomment: 品红;范围:0~1023 */ td_u32 yellow; /* Yellow; Range:0~1023 */ /* CNcomment: 黄色;范围:0~1023 */ } uapi_pq_six_base_color; typedef struct { td_u32 red_gain; /* Red Gain; Range:0~1023 */ /* CNcomment: 红色增益,范围:0~1023 */ td_u32 green_gain; /* Green Gain; Range:0~1023 */ /* CNcomment: 绿色增益,范围:0~1023 */ td_u32 blue_gain; /* Blue Gain; Range:0~1023 */ /* CNcomment: 蓝色增益,范围:0~1023 */ td_u32 red_offset; /* Red Offset; Range:0~1023 */ /* CNcomment: 红色偏移,范围:0~1023 */ td_u32 green_offset; /* Green Offset; Range:0~1023 */ /* CNcomment: 绿色偏移,范围:0~1023 */ td_u32 blue_offset; /* Blue Offset; Range:0~1023 */ /* CNcomment: 蓝色偏移,范围:0~1023 */ } uapi_pq_color_temp; /* * Portrait Colors Parameter * CNcomment: 人像模式参数 */ typedef enum { UAPI_PQ_FLESHTONE_GAIN_OFF = 0, /* Portrait Model Strength Off */ /* CNcomment: 人像模式关闭 */ UAPI_PQ_FLESHTONE_GAIN_LOW, /* Portrait Model Strength Low */ /* CNcomment: 人像模式强度低 */ UAPI_PQ_FLESHTONE_GAIN_MID, /* Portrait Model Strength Middle */ /* CNcomment: 人像模式强度中 */ UAPI_PQ_FLESHTONE_GAIN_HIGH, /* Portrait Model Strength High */ /* CNcomment: 人像模式强度高 */ UAPI_PQ_FLESHTONE_GAIN_MAX } uapi_pq_fleshtone_gain; /* * Color Optimization Model * CNcomment: 颜色空间模式 */ typedef enum { UAPI_PQ_COLOR_SPACE_RECOMMEND = 0, /* Optimization Model */ /* CNcomment: 最优模式 */ UAPI_PQ_COLOR_SPACE_BLUE, /* Blue Model */ /* CNcomment: 蓝色增强模式 */ UAPI_PQ_COLOR_SPACE_GREEN, /* Green Model */ /* CNcomment: 绿色增强模式 */ UAPI_PQ_COLOR_SPACE_BG, /* Cyan Model */ /* CNcomment: 蓝绿增强模式 */ UAPI_PQ_COLOR_SPACE_ORIGINAL, /* Original Model */ /* CNcomment: 原始颜色模式 */ UAPI_PQ_COLOR_SPACE_MAX } uapi_pq_color_space_mode; /* * Intelligent Colors Form * CNcomment: 颜色增强类型 */ typedef enum { UAPI_PQ_COLOR_ENHANCE_FLESHTONE = 0, /* Portrait Model */ /* CNcomment: 人像模式 */ UAPI_PQ_COLOR_ENHANCE_SIX_BASE, /* Custom Model */ /* CNcomment: 自定义颜色 */ UAPI_PQ_COLOR_ENHANCE_SPEC_MODE, /* Special Color Model */ /* CNcomment: 颜色增强模式 */ UAPI_PQ_COLOR_ENHANCE_MAX } uapi_pq_color_enhance_mode; /* * Intelligent Colors Parameter * CNcomment: 颜色参数 */ typedef struct { uapi_pq_color_enhance_mode mode; /* Color Model */ /* CNcomment: 增强类型 */ union { uapi_pq_fleshtone_gain fleshtone_gain; /* Portrait Model Parameter */ /* CNcomment: 人像模式参数 */ uapi_pq_six_base_color six_base_color; /* Custom Model Parameter */ /* CNcomment: 自定义颜色参数 */ uapi_pq_color_space_mode color_space_mode; /* Special Color Model Parameter */ /* CNcomment: 颜色增强参数 */ } color_gain; } uapi_pq_color_enhance; typedef enum { UAPI_PQ_IMAGE_ALL = 0, /* graph and video */ /* CNcomment: 图形和视频 */ UAPI_PQ_IMAGE_GRAPH_ALL = 0x08, /* graph */ /* CNcomment: 图形 */ UAPI_PQ_IMAGE_VIDEO_ALL = 0x10, /* video */ /* CNcomment: 视频 */ UAPI_PQ_IMAGE_MAX } uapi_pq_image_type; /* ******************************TV USED******************************* */ typedef enum { UAPI_PQ_COLOR_YHS_Y = 0, /* Luma */ /* CNcomment: Y 亮度 */ UAPI_PQ_COLOR_YHS_H, /* Hue */ /* CNcomment: H 色调 */ UAPI_PQ_COLOR_YHS_S, /* Sat */ /* CNcomment: S 饱和度 */ UAPI_PQ_COLOR_YHS_MAX } uapi_pq_color_yhs; /* * Color Section * CNcomment: 颜色分段类型 */ typedef enum { UAPI_PQ_COLOR_SECTION_R = 0, /* color red */ /* CNcomment: 红色 */ UAPI_PQ_COLOR_SECTION_G, /* color green */ /* CNcomment: 绿色 */ UAPI_PQ_COLOR_SECTION_B, /* color blue */ /* CNcomment: 蓝色 */ UAPI_PQ_COLOR_SECTION_CYAN, /* color cyan */ /* CNcomment: 青色 */ UAPI_PQ_COLOR_SECTION_PURPLE, /* color purple */ /* CNcomment: 紫色 */ UAPI_PQ_COLOR_SECTION_YELLOW, /* color yellow */ /* CNcomment: 黄色 */ UAPI_PQ_COLOR_SECTION_FLESH, /* color flesh */ /* CNcomment: 肤色 */ UAPI_PQ_COLOR_SECTION_HAIR, /* color flesh1 */ /* CNcomment: 头发 */ UAPI_PQ_COLOR_SECTION_OLIVINE, /* color olivine */ /* CNcomment: 黄绿色 */ UAPI_PQ_COLOR_SECTION_MAX } uapi_pq_section_color; typedef struct { uapi_pq_color_yhs yhs; /* Color Component */ /* CNcomment: 颜色分量 */ uapi_pq_section_color color_type; /* Color Type */ /* CNcomment: 颜色类型 */ td_s32 gain; /* Color Gain, Range:0~1023 */ /* CNcomment: 颜色增益,范围0~1023 */ } uapi_pq_section_color_gain; /* * Image Demo Param Set * CNcomment: 图像卖场显示模式设置 */ typedef struct { uapi_pq_demo_mode mode; /* Demo Mode */ /* CNcomment: 图像卖场显示模式 */ td_u32 x_position; /* Demo Position, Range:0~1023 */ /* CNcomment: 图像卖场显示模式位置,范围0~1023 */ } uapi_pq_demo_param; /* * Pq Table Module * CNcomment: 有曲线的算法模块 */ typedef enum { UAPI_PQ_TABLE_MODULE_COLOR = 0, /* Automatic Color Management */ /* CNcomment: 智能颜色调节 */ UAPI_PQ_TABLE_MODULE_GAMMA, /* Gamma MODULE */ /* CNcomment: Gamma 模块 */ UAPI_PQ_TABLE_MODULE_DCI, /* Dynamic Contrast Improvement */ /* CNcomment: 自动对比度调节 */ UAPI_PQ_TABLE_MODULE_HDR, /* HDR MODULE */ /* CNcomment: HDR 模块 */ UAPI_PQ_TABLE_MODULE_3DLUT, UAPI_PQ_TABLE_MODULE_MAX } uapi_pq_table_module; typedef enum { UAPI_PQ_ST_LAYER_VIDEO = 0, /* video histgram */ /* CNcomment: 视频直方图 */ UAPI_PQ_ST_LAYER_VIDEO_OSD, /* video+osd histgram */ /* CNcomment: 视频叠加图形直方图 */ UAPI_PQ_ST_LAYER_MAX } uapi_pq_st_layer; typedef enum { UAPI_PQ_ST_DIMENSION_LUMA = 0, /* Luma Distribution */ /* CNcomment: LUMA 分布信息 */ UAPI_PQ_ST_DIMENSION_HUE, /* Hue Distribution */ /* CNcomment: HUE 分布信息 */ UAPI_PQ_ST_DIMENSION_SATURATION, /* Sat Distribution */ /* CNcomment: SATURATION 分布信息 */ UAPI_PQ_ST_DIMENSION_MAXRGB, /* MAXRGB Distribution */ /* CNcomment: MAXRGB 分布信息 */ UAPI_PQ_ST_DIMENSION_MAX } uapi_pq_st_dimension; /* * HistGram HDR Type Select * CNcomment: 直方图HDR类型选择 */ typedef enum { UAPI_PQ_ST_TYPE_SDR, /* SDR HistGram */ /* CNcomment: SDR直方图 */ UAPI_PQ_ST_TYPE_HDR, /* HDRistGram */ /* CNcomment: HDR 直方图 */ UAPI_PQ_ST_MAX } uapi_pq_st_type; /* * istgram information * CNcomment: 直方图参数 */ typedef struct { td_bool normalize; /* Is Normalize */ /* CNcomment: 判定是否归一化 */ uapi_pq_st_layer layer; /* Histgram Laye */ /* CNcomment: 直方图所在层 */ uapi_pq_st_type type; /* Histgram Type */ /* CNcomment: 直方图HDR类型 */ uapi_pq_st_dimension dimension; /* Histgram Dimension */ /* CNcomment: 直方图维度 */ } uapi_pq_stogram_param; typedef struct { td_bool full_range; /* Full Range */ /* CNcomment: 色域范围 */ td_s32 histogram[PQ_STOGRAM_NUM]; /* Histgram Data */ /* CNcomment: 直方图数据 */ td_u32 hist_len; /* Histgram Length, Range:0~256 */ /* CNcomment:直方图长度, 范围: 0~256 */ } uapi_pq_stogram; typedef enum { UAPI_PQ_WHITE_BALANCE_COOL, /* cool */ /* CNcomment: 冷色调 */ UAPI_PQ_WHITE_BALANCE_STANDARD, /* standard */ /* CNcomment: 标准色调 */ UAPI_PQ_WHITE_BALANCE_WARM, /* warm */ /* CNcomment: 暖色调 */ UAPI_PQ_WHITE_BALANCE_MAX } uapi_pq_white_balance_type; /* * auto white balance param * CNcomment: 自动白平衡参数 */ typedef struct { uapi_pq_color_temp color_temp[UAPI_PQ_WHITE_BALANCE_MAX]; /* white balance param */ /* CNcomment: 白平衡参数 */ } uapi_pq_white_balance_param; /* * High Level Sharpen gain * CNcomment: 高级清晰度增益 */ typedef struct { td_u32 lti_gain; /* Lti gain, Range:0~1023 */ /* CNcomment: LTI增益 ,设置范围为0~1023 */ td_u32 h_peak_ratio; /* HPeaking Ratio, Range:0~1023 */ /* CNcomment: 水平Peaking增益 ,设置范围为0~1023 */ td_u32 v_peak_ratio; /* VPeaking Ratio, Range:0~1023 */ /* CNcomment: 垂直Peaking增益 ,设置范围为0~1023 */ td_u32 d_peak_ratio; /* DPeak Ratio, Range:0~1023 */ /* CNcomment: 对角Peaking增益 ,设置范围为0~1023 */ } uapi_pq_sharp_gain; /* * Color gain * CNcomment: 颜色增益 */ typedef struct { td_u32 lum_gain; /* lum gain, Range:0~1023 */ /* CNcomment: 亮度增益 ,设置范围0~1023 */ td_u32 hue_gain; /* hue gain, Range:0~1023 */ /* CNcomment: 色度增益 ,设置范围0~1023 */ td_u32 sat_gain; /* saturation gain, Range:0~1023 */ /* CNcomment: 饱和度增益 ,设置范围0~1023 */ td_u32 reserved; /* Reserve */ /* CNcomment: 保留参数 */ } uapi_pq_acm_gain; /* * dci gain * CNcomment: 对比度增益 */ typedef struct { td_u32 low_gain; /* low gain, Range:0~1023 */ /* CNcomment: 低亮曲线增益 ,设置范围0~1023 */ td_u32 middle_gain; /* middle gain, Range:0~1023 */ /* CNcomment: 中亮曲线增益 ,设置范围0~1023 */ td_u32 high_gain; /* high gain, Range:0~1023 */ /* CNcomment: 高亮曲线增益 ,设置范围0~1023 */ td_u32 reserved; /* Reserve */ /* CNcomment: 保留参数 */ } uapi_pq_dci_gain; /* * nr strength type * CNcomment: 降噪强度类型 */ typedef enum { UAPI_PQ_NRSTR_Y = 0, /* nr strength Y */ /* CNcomment: 亮度降噪强度 */ UAPI_PQ_NRSTR_C, /* nr strength C */ /* CNcomment: 色度降噪强度 */ UAPI_PQ_NRSTR_MAX } uapi_pq_nr_str; /* * nr strength info * CNcomment: 降噪强度信息 */ typedef struct { uapi_pq_nr_str nr_str; /* nr strength type */ /* CNcomment: 降噪类型 */ td_u32 gain; /* nr gain, Range:0~1023 */ /* CNcomment: 降噪强度, 设置范围0~1023 */ } uapi_pq_nr_str_gain; typedef struct { td_s32 final_weight_lut[PQ_DCI_FINAL_WEIGHT_NUM]; /* dci manul curve < */ /* CNcomment: dci 的手动权重曲线 */ td_s32 reserved; /* Reserve */ /* CNcomment: 保留参数 */ } uapi_pq_dci_final_weight; /* * PQ bin version * CNcomment: PQ bin版本信息 */ typedef struct { td_char pq_bin_ver[PQ_BIN_VERSION_MAX]; /* PQ BIN version, 40 bytes */ /* CNcomment: PQ BIN版本 */ } uapi_pq_bin_version; /* * Y Ever Frame Lumia Static * CNcomment: Y每帧亮度统计 */ typedef struct { td_u32 lum_max; /* Lumia Max */ /* CNcomment: 亮度最大值 */ td_u32 lum_min; /* Lumia Min */ /* CNcomment: 亮度最小值 */ td_u32 lum_averge; /* Lumia Average */ /* CNcomment: 亮度平均值 */ } uapi_pq_lum_statistics; /* * White Balane * CNcomment: 白平衡类型 */ typedef enum { UAPI_PQ_GAMMA_COLOR_TYPE_R = 0, /* Gamma Red */ /* CNcomment: 红色 */ UAPI_PQ_GAMMA_COLOR_TYPE_G, /* Gamma Green */ /* CNcomment: 绿色 */ UAPI_PQ_GAMMA_COLOR_TYPE_B, /* Gamma Blue */ /* CNcomment: 蓝色 */ UAPI_PQ_GAMMA_COLOR_TYPE_W, /* Gamma White */ /* CNcomment: 白色 */ UAPI_PQ_GAMMA_COLOR_TYPE_ALL, /* Gamma All */ /* CNcomment: 红色/绿色/蓝色/白色 */ UAPI_PQ_GAMMA_COLOR_TYPE_MAX, } uapi_pq_gamma_color_type; typedef struct { td_u32 gamma_point_num; /* Gamma Num */ /* CNcomment: Gamma点数 */ uapi_pq_gamma_color_type gamma_color_type; /* Gamma Type */ /* CNcomment: Gamma类型 */ td_u32 gamma_position; /* Gamma Position */ /* CNcomment: Gamma位置 */ td_s32 offset; /* Gamma Offset, Range:0~1023 */ /* CNcomment: Gamma 偏移值, 设置范围0~1023 */ } uapi_pq_gamma_white_balance; typedef enum { UAPI_PQ_SOURCE_MEDIA = 0, /* The media source from usb or sdcard */ /* CNcomment: 本地媒体播放,包括USB/Sdcard等本地存储设备中的内容,区分于网络播放 */ UAPI_PQ_SOURCE_NETWORK, /* The media source from network */ /* CNcomment: 网络媒体 */ UAPI_PQ_SOURCE_MAX } uapi_pq_source; /* * dci lut type * CNcomment: DCI lut表的类型 */ typedef enum { UAPI_PQ_DCI_LUT_TYPE_CF, /* dci lut which pass cf */ /* CNcomment: 经过CF模块的DCI数据 */ UAPI_PQ_DCI_LUT_TYPE_CFHEBS, /* dci lut which pass cf he bs */ /* CNcomment: 经过CF HE BS 模块的DCI数据 */ UAPI_PQ_DCI_LUT_TYPE_MAX } uapi_pq_dci_lut_type; /* * dci lut data * CNcomment: DCI数据lut表数据 */ typedef struct { td_s32 adj_lut[PQ_DCI_CURVE_POINT_NUM]; } uapi_pq_dci_lut_data; /* * VDP lumia statics * CNcomment: VP的亮度分区统计 */ typedef struct { /* 水平方向分区个数 */ td_u32 led_num_h; /* 垂直方向分区个数 */ td_u32 led_num_v; } uapi_pq_lum_hist_num; /* * histogram info * CNcomment: 直方图信息 */ typedef struct { uapi_pq_lum_hist_num hist_num; /* Histgram Num */ /* CNcomment: 直方图数量 */ td_u32 *lum_hist; /* Histgram Data */ /* CNcomment: 直方图数据 */ td_u32 hist_len; /* Histgram Length */ /* CNcomment: 直方图长度 */ } uapi_pq_lum_hist; /* * gamma table * CNcomment: gamma 表数据 */ typedef struct { td_u32 red[PQ_GAMMA_NUM]; /* Red data */ /* CNcomment: 红色分量数据 */ td_u32 green[PQ_GAMMA_NUM]; /* Green data */ /* CNcomment: 绿色分量数据 */ td_u32 blue[PQ_GAMMA_NUM]; /* Blue data */ /* CNcomment: 蓝色分量数据 */ td_u32 white[PQ_GAMMA_NUM]; /* White data */ /* CNcomment: 白色分量数据 */ } uapi_pq_gamma_table; /* * color table * CNcomment: ACM 表数据 */ typedef struct { td_s16 yhs_by_h[UAPI_PQ_COLOR_YHS_MAX][PQ_COLOR_H_NUM]; /* YHSbyH table */ /* CNcomment: ACM 主表,依次为YbyH[65], HbyH[65], SbyH[65] */ td_s16 yhs_by_hs_gain[UAPI_PQ_COLOR_YHS_MAX][PQ_COLOR_H_NUM][PQ_COLOR_S_NUM]; /* S gain table */ /* CNcomment: ACM S gain 附表, YbyH[65][13], HbyH[65][13],SbyH[65][13] */ td_s16 yhs_by_hy_gain[UAPI_PQ_COLOR_YHS_MAX][PQ_COLOR_H_NUM][PQ_COLOR_Y_NUM]; /* Y gain table */ /* CNcomment: ACM Y gain 附表, YbyH[65][9], HbyH[65][9], SbyH[65][9] */ } uapi_pq_color_table; /* * color specs * CNcomment: ACM 点数 */ typedef struct { td_u32 h_point_num; /* h_point_num */ /* CNcomment: HUE点数 */ td_u32 s_point_num; /* h_point_num */ /* CNcomment: SAT点数 */ td_u32 y_point_num; /* h_point_num */ /* CNcomment: LUM点数 */ } uapi_pq_color_specs; /* * gamma specs * CNcomment: gamma 点数 */ typedef struct { td_u32 point_num; } uapi_pq_gamma_specs; /* * PQ specs * CNcomment: 不同芯片算法模块的规格 */ typedef struct { union { uapi_pq_color_specs color_specs; uapi_pq_gamma_specs gamma_specs; } pq_specs; td_u32 bit_depth; } uapi_pq_specs; /* * lumia cure * CNcomment: 亮度映射曲线 */ typedef struct { td_u32 tm_lut_y[PQ_HDR_TMLUT_NUM]; /* CNcomment: 亮度映射曲线, 单位为0.0001 cd/m2 */ } uapi_pq_hdr_tm_lut_y; /* * dolby mode * CNcomment: 杜比模式信息 */ typedef enum { UAPI_PQ_DOLBY_MODE_ENHANCE = 0, /* dolby enhance mode */ /* CNcomment: 杜比增强模式 */ UAPI_PQ_DOLBY_MODE_STANDARD, /* dolby standard mode */ /* CNcomment: 杜比标准模式 */ UAPI_PQ_DOLBY_MODE_MAX /* Invalid value */ /* CNcomment: 非法边界值 */ } uapi_pq_dolby_mode; typedef enum { UAPI_PQ_TCON_MODULE_OD = 0, /* od MODULE */ /* CNcomment: od 模块 */ UAPI_PQ_TCON_MODULE_RGBW, /* rgbw MODULE */ /* CNcomment: rgbw 模块 */ UAPI_PQ_TCON_MODULE_LINEOD, /* lineod MODULE */ /* CNcomment: lineod 模块 */ UAPI_PQ_TCON_MODULE_DEMURA, /* demura MODULE */ /* CNcomment: demura 模块 */ UAPI_PQ_TCON_MODULE_VAC, /* vac MODULE */ /* CNcomment: vac 模块 */ UAPI_PQ_TCON_MODULE_MAX } uapi_pq_tcon_module; typedef enum { UAPI_PQ_MPLUS_MODE_LOW_POWER = 0, UAPI_PQ_MPLUS_MODE_HIGH_LUMINANCE_I, UAPI_PQ_MPLUS_MODE_HIGH_LUMINANCE_II, UAPI_PQ_MPLUS_MODE_HDR, UAPI_PQ_MPLUS_MODE_MAX } uapi_pq_mplus_mode; /* ==== Structure Definition end ==== */ /* * RGBW gain * CNcomment: RGBW模块RGB Gain */ typedef struct { td_u32 rgbw_gain_r; /* Red Gain, Range:0~1023 */ /* CNcomment: 红色增益 , 设置范围0~1023 */ td_u32 rgbw_gain_g; /* Green Gain, Range:0~1023 */ /* CNcomment: 绿色增益, 设置范围0~1023 */ td_u32 rgbw_gain_b; /* Blue Gain, Range:0~1023 */ /* CNcomment: 蓝色增益 , 设置范围0~1023 */ td_u32 rgbw_gain_w; /* White Gain, Range:0~1023 */ /* CNcomment: 白色增益 , 设置范围0~1023 */ } uapi_pq_rgbw_gain; /* * TCON bin version * CNcomment: tcon bin 版本号 */ typedef struct { td_char tcon_bin_ver[PQ_BIN_VERSION_MAX]; /* TCON BIN version, 40 bytes */ } uapi_pq_tcon_bin_version; /* 3dlut table protocol definition */ /* CNcomment: 3dlut表协议定义 */ typedef enum { UAPI_PQ_3D_LUT_TYPE_POINT_NUM_9 = 0, UAPI_PQ_3D_LUT_TYPE_POINT_NUM_17, UAPI_PQ_3D_LUT_TYPE_MAX, } uapi_pq_3d_lut_type; typedef struct { td_u16 lut_3d[PQ_3D_LUT_ROW_NUM][PQ_3D_LUT_POINT_NUM_9]; } uapi_pq_3d_lut_point_num_9; typedef struct { td_u16 lut_3d[PQ_3D_LUT_ROW_NUM][PQ_3D_LUT_POINT_NUM_17]; }uapi_pq_3d_lut_point_num_17; /* * section color range info * CNcomment: 颜色区间信息 */ typedef struct { td_s32 color_start; /* color range start */ /* CNcomment: 颜色区间的起始 */ td_s32 color_end; /* color range end */ /* CNcomment: 颜色区间的结束 */ } uapi_pq_section_color_range; /* * hue saturation brightness * CNcomment: 色度 饱和度 亮度 */ typedef enum { UAPI_PQ_HSV_SAT = 0, /* saturation */ /* CNcomment: 饱和度 */ UAPI_PQ_HSV_HUE, /* hue */ /* CNcomment: 色度 */ UAPI_PQ_HSV_BRI, /* brightness */ /* CNcomment: 亮度 */ UAPI_PQ_HSV_MAX } uapi_pq_hsv; /* * sat section color gain info * CNcomment: 饱和度分段增益信息 */ typedef struct { td_u32 index; /* section color range index */ /* CNcomment: 色调增益区间索引 */ uapi_pq_hsv hsv_type; /* hue saturation brightness */ /* CNcomment: 色度 饱和度 亮度 */ td_s32 gain; /* hue gain */ /* CNcomment: 色调增益 */ } uapi_pq_color_section; /* * hdr param:RGBW point, oetf * CNcomment: 手动设置hdr参数信息 */ typedef struct { td_u16 cie_x; /* *