1 /* 2 * agamma_head.h 3 * 4 * Copyright (c) 2021 Rockchip Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 */ 19 20 #ifndef __CALIBDBV2_AGAMMA_HEAD_H__ 21 #define __CALIBDBV2_AGAMMA_HEAD_H__ 22 23 #include "rk_aiq_comm.h" 24 25 RKAIQ_BEGIN_DECLARE 26 27 #define CALIBDB_AGAMMA_KNOTS_NUM_V10 45 28 #define CALIBDB_AGAMMA_KNOTS_NUM_V11 49 29 30 typedef enum GammaType_e { 31 GAMMATYPE_LOG = 0, 32 GAMMATYPE_EQU = 1, 33 } GammaType_t; 34 35 // gamma v10 36 typedef struct CalibDbGammaV10_s { 37 // M4_BOOL_DESC("Gamma_en", "1") 38 bool Gamma_en; 39 // M4_ENUM_DESC("Gamma_out_segnum", "GammaType_t", "GAMMATYPE_LOG") 40 GammaType_t Gamma_out_segnum; 41 // M4_NUMBER_DESC("Gamma_out_offset", "u16", M4_RANGE(0,4095), "0", M4_DIGIT(0)) 42 uint16_t Gamma_out_offset; 43 // M4_ARRAY_MARK_DESC("Gamma_curve", "u16", M4_SIZE(1,45), M4_RANGE(0, 4095), "[0, 6, 11, 17, 22, 28, 33, 39, 44, 55, 66, 77, 88, 109, 130, 150, 170, 210, 248, 286, 323, 393, 460, 525, 586, 702, 809, 909, 1002, 1172, 1325, 1462, 1588, 1811, 2004, 2174, 2327, 2590, 2813, 3006, 3177, 3467, 3708, 3915, 4095]", M4_DIGIT(0), M4_DYNAMIC(0), "curve_table") 44 uint16_t Gamma_curve[CALIBDB_AGAMMA_KNOTS_NUM_V10]; 45 } CalibDbGammaV10_t; 46 47 typedef struct CalibDbV2_gamma_v10_s { 48 // M4_STRUCT_DESC("GammaTuningPara", "curve_ui_type_A") 49 CalibDbGammaV10_t GammaTuningPara; 50 } CalibDbV2_gamma_v10_t; 51 52 // gamma v11 53 typedef struct CalibDbGammaV11_s { 54 // M4_BOOL_DESC("Gamma_en", "1") 55 bool Gamma_en; 56 // M4_NUMBER_DESC("Gamma_out_offset", "u16", M4_RANGE(0,4095), "0", M4_DIGIT(0)) 57 uint16_t Gamma_out_offset; 58 // M4_ARRAY_MARK_DESC("Gamma_curve", "u16", M4_SIZE(1,49), M4_RANGE(0, 4095), "[0, 93, 128, 154, 175, 194, 211, 226, 240, 266, 289, 310, 329, 365, 396, 425, 451, 499, 543, 582, 618, 684, 744, 798, 848, 938, 1019, 1093, 1161, 1285, 1396, 1498, 1592, 1761, 1914, 2052, 2181, 2414, 2622, 2813, 2989, 3153, 3308, 3454, 3593, 3727, 3854, 3977, 4095]", M4_DIGIT(0), M4_DYNAMIC(0), "curve_table") 59 uint16_t Gamma_curve[CALIBDB_AGAMMA_KNOTS_NUM_V11]; 60 } CalibDbGammaV11_t; 61 62 typedef struct CalibDbV2_gamma_v11_s { 63 // M4_STRUCT_DESC("GammaTuningPara", "curve_ui_type_A") 64 CalibDbGammaV11_t GammaTuningPara; 65 } CalibDbV2_gamma_v11_t; 66 67 RKAIQ_END_DECLARE 68 69 #endif 70