1 /* 2 * Copyright (c) 2021 Rockchip Corporation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 #ifndef __AF_UAPI_HEAD_H__ 19 #define __AF_UAPI_HEAD_H__ 20 21 22 #include "rk_aiq_user_api_common.h" 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 typedef struct rk_tool_customAf_res_s { 29 // M4_NUMBER_DESC("af enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 30 unsigned char af_en; 31 // M4_NUMBER_DESC("af selection", "u8", M4_RANGE(0, 3), "0", M4_DIGIT(0)) 32 unsigned char rawaf_sel; 33 // M4_NUMBER_DESC("gamma enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 34 unsigned char gamma_en; 35 // M4_NUMBER_DESC("gause enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0), M4_HIDE(1)) 36 unsigned char gaus_en; 37 // M4_NUMBER_DESC("v1 fir selection", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 38 unsigned char v1_fir_sel; 39 // M4_NUMBER_DESC("hiir enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 40 unsigned char hiir_en; 41 // M4_NUMBER_DESC("viir enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 42 unsigned char viir_en; 43 // M4_NUMBER_DESC("v1 fv mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 44 unsigned char v1_fv_outmode; 45 // M4_NUMBER_DESC("v2 fv mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 46 unsigned char v2_fv_outmode; 47 // M4_NUMBER_DESC("h1 fv mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 48 unsigned char h1_fv_outmode; 49 // M4_NUMBER_DESC("h2 fv mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 50 unsigned char h2_fv_outmode; 51 // M4_NUMBER_DESC("ldg enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 52 unsigned char ldg_en; 53 // M4_NUMBER_DESC("accu 8bit mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0), M4_HIDE(1)) 54 unsigned char accu_8bit_mode; 55 // M4_NUMBER_DESC("ae mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0)) 56 unsigned char ae_mode; 57 // M4_NUMBER_DESC("y mode", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0), M4_HIDE(1)) 58 unsigned char y_mode; 59 // M4_ARRAY_DESC("line enable", "u8", M4_SIZE(1,5), M4_RANGE(0,1), "0", M4_DIGIT(0), M4_DYNAMIC(0), M4_HIDE(1)) 60 unsigned char line_en[5]; 61 // M4_ARRAY_DESC("line number", "u8", M4_SIZE(1,5), M4_RANGE(0,15), "0", M4_DIGIT(0), M4_DYNAMIC(0), M4_HIDE(1)) 62 unsigned char line_num[5]; 63 64 // M4_NUMBER_DESC("window num", "u8", M4_RANGE(1, 2), "0", M4_DIGIT(0)) 65 unsigned char window_num; 66 // M4_NUMBER_DESC("wina h offs", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 67 unsigned short wina_h_offs; 68 // M4_NUMBER_DESC("wina v offs", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 69 unsigned short wina_v_offs; 70 // M4_NUMBER_DESC("wina h size", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 71 unsigned short wina_h_size; 72 // M4_NUMBER_DESC("wina v size", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 73 unsigned short wina_v_size; 74 // M4_NUMBER_DESC("winb h offs", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 75 unsigned short winb_h_offs; 76 // M4_NUMBER_DESC("winb v offs", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 77 unsigned short winb_v_offs; 78 // M4_NUMBER_DESC("winb h size", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 79 unsigned short winb_h_size; 80 // M4_NUMBER_DESC("winb v size", "u16", M4_RANGE(0, 8192), "0", M4_DIGIT(0)) 81 unsigned short winb_v_size; 82 83 // M4_ARRAY_MARK_DESC("Gamma Curve", "u16", M4_SIZE(1,17), M4_RANGE(0, 1023), "[0,45,108,179,245,344,409,459,500,567,622,676,759,833,896,962,1023]", M4_DIGIT(0), M4_DYNAMIC(0), "curve_table") 84 unsigned short gamma_y[17]; 85 86 // M4_NUMBER_DESC("afmThres", "u16", M4_RANGE(0, 65535), "4", M4_DIGIT(0)) 87 unsigned short thres; 88 // M4_NUMBER_DESC("wina fv shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0), M4_HIDE(1)) 89 unsigned char shift_sum_a; 90 // M4_NUMBER_DESC("winb fv shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0)) 91 unsigned char shift_sum_b; 92 // M4_NUMBER_DESC("wina luma shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0), M4_HIDE(1)) 93 unsigned char shift_y_a; 94 // M4_NUMBER_DESC("winb luma shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0)) 95 unsigned char shift_y_b; 96 97 // M4_ARRAY_DESC("vertical first iir filter", "s16", M4_SIZE(1,9), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 98 short v1_iir_coe[9]; 99 // M4_ARRAY_DESC("vertical first fir filter", "s16", M4_SIZE(1,3), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 100 short v1_fir_coe[3]; 101 // M4_ARRAY_DESC("vertical second iir filter", "s16", M4_SIZE(1,3), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 102 short v2_iir_coe[3]; 103 // M4_ARRAY_DESC("vertical second fir filter", "s16", M4_SIZE(1,3), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 104 short v2_fir_coe[3]; 105 106 // M4_ARRAY_DESC("horizontal first iir1 filter", "s16", M4_SIZE(1,6), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 107 short h1_iir1_coe[6]; 108 // M4_ARRAY_DESC("horizontal first iir2 filter", "s16", M4_SIZE(1,6), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 109 short h2_iir1_coe[6]; 110 // M4_ARRAY_DESC("horizontal second iir1 filter", "s16", M4_SIZE(1,6), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 111 short h1_iir2_coe[6]; 112 // M4_ARRAY_DESC("horizontal second iir2 filter", "s16", M4_SIZE(1,6), M4_RANGE(-2047,2047), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 113 short h2_iir2_coe[6]; 114 115 // M4_ARRAY_DESC("horizontal thresh", "u8", M4_SIZE(1,2), M4_RANGE(0,255), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 116 unsigned char h_ldg_lumth[2]; 117 // M4_ARRAY_DESC("horizontal gain", "u8", M4_SIZE(1,2), M4_RANGE(0, 255), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 118 unsigned char h_ldg_gain[2]; 119 // M4_ARRAY_DESC("horizontal slope", "u16", M4_SIZE(1,2), M4_RANGE(0, 8191), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 120 unsigned short h_ldg_gslp[2]; 121 // M4_ARRAY_DESC("vertical thresh", "u8", M4_SIZE(1,2), M4_RANGE(0,255), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 122 unsigned char v_ldg_lumth[2]; 123 // M4_ARRAY_DESC("vertical gain", "u8", M4_SIZE(1,2), M4_RANGE(0, 255), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 124 unsigned char v_ldg_gain[2]; 125 // M4_ARRAY_DESC("vertical slope", "u16", M4_SIZE(1,2), M4_RANGE(0, 8191), "0", M4_DIGIT(0), M4_DYNAMIC(0)) 126 unsigned short v_ldg_gslp[2]; 127 128 // M4_NUMBER_DESC("vertical fv thresh", "u16", M4_RANGE(0, 4095), "0", M4_DIGIT(0)) 129 unsigned short v_fv_thresh; 130 // M4_NUMBER_DESC("horizontal fv thresh", "u16", M4_RANGE(0, 4095), "0", M4_DIGIT(0)) 131 unsigned short h_fv_thresh; 132 133 // M4_NUMBER_DESC("wina v1 shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0)) 134 unsigned char v1_fv_shift; 135 // M4_NUMBER_DESC("wina v2 shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0)) 136 unsigned char v2_fv_shift; 137 // M4_NUMBER_DESC("wina h1 shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0)) 138 unsigned char h1_fv_shift; 139 // M4_NUMBER_DESC("wina h2 shift", "u8", M4_RANGE(0, 7), "0", M4_DIGIT(0)) 140 unsigned char h2_fv_shift; 141 142 // M4_NUMBER_DESC("highlight thresh", "u16", M4_RANGE(0, 4095), "0", M4_DIGIT(0)) 143 unsigned short highlit_thresh; 144 } rk_tool_customAf_res_t; 145 146 #ifdef __cplusplus 147 } 148 #endif 149 150 151 #endif /*__AF_UAPI_HEAD_H__*/ 152