hi_ae_comm.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_ae_comm.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2012/12/18
  8. Description :
  9. History :
  10. 1.Date : 2012/12/18
  11. Author :
  12. Modification: Created file
  13. ******************************************************************************/
  14. #ifndef __HI_AE_COMM_H__
  15. #define __HI_AE_COMM_H__
  16. #include "hi_type.h"
  17. #include "hi_comm_isp.h"
  18. #ifdef __cplusplus
  19. #if __cplusplus
  20. extern "C" {
  21. #endif
  22. #endif /* End of #ifdef __cplusplus */
  23. #define HI_AE_LIB_NAME "hisi_ae_lib"
  24. /************************** ae ctrl cmd **************************************/
  25. typedef enum hiAE_CTRL_CMD_E
  26. {
  27. AE_DEBUG_ATTR_SET,
  28. AE_DEBUG_ATTR_GET,
  29. AE_CTRL_BUTT,
  30. } AE_CTRL_CMD_E;
  31. typedef struct hiAE_DBG_ATTR_S
  32. {
  33. HI_U32 u32MaxIntTime;
  34. HI_U32 u32MinIntTime;
  35. HI_U32 u32MaxAgain;
  36. HI_U32 u32MinAgain;
  37. HI_U32 u32MaxDgain;
  38. HI_U32 u32MinDgain;
  39. HI_U32 u32MaxIspDgain;
  40. HI_U32 u32MinIspDgain;
  41. HI_U32 u32MaxSysGain;
  42. HI_U32 u32MinSysGain;
  43. HI_U32 u32Compensation;
  44. HI_U32 u32EVBias;
  45. HI_BOOL bManualExposureEn;
  46. HI_BOOL bManualTimeEn;
  47. HI_BOOL bManualAgainEn;
  48. HI_BOOL bManualDgainEn;
  49. HI_BOOL bManualIspDgainEn;
  50. HI_U32 u32ManualExposureLines;
  51. HI_U32 u32ManualAgain;
  52. HI_U32 u32ManualDgain;
  53. HI_U32 u32ManualIspDgain;
  54. HI_U32 au32AeWeights[AE_ZONE_ROW *AE_ZONE_COLUMN];
  55. } AE_DBG_ATTR_S;
  56. typedef struct hiAE_DBG_STATUS_S
  57. {
  58. HI_U32 u32FrmNumBgn;
  59. HI_U32 u32FullLines;
  60. HI_U32 u32IntTime;
  61. HI_U32 u32ShortIntTime;
  62. HI_U32 u32MedIntTime;
  63. HI_U32 u32LongIntTime;
  64. HI_U32 u32Again;
  65. HI_U32 u32Dgain;
  66. HI_U32 u32IspDgain;
  67. HI_U32 u32IrisFNOLin;
  68. HI_U64 u64Exposure;
  69. HI_U32 u32Increment;
  70. HI_S32 s32HistError;
  71. HI_S32 s32HistOriAverage;
  72. HI_S32 s32LumaOffset;
  73. HI_U32 u32Iso;
  74. HI_U32 u32ExpRatio;
  75. HI_U32 u32OverExpRatio;
  76. HI_U32 u32OverExpRatioFilter;
  77. } AE_DBG_STATUS_S;
  78. /************************** sensor's interface to ae *********************/
  79. /* eg: 0.35db, enAccuType=AE_ACCURACY_DB, f32Accuracy=0.35
  80. * and the multiply of 0.35db is power(10, (0.35/20))
  81. * eg: 1/16, 2/16, 3/16 multiplies, enAccuType=AE_ACCURACY_LINEAR, f32Accuracy=0.0625
  82. * eg: 1,2,4,8,16 multiplies, enAccuType=AE_ACCURACY_DB, f32Accuracy=6
  83. */
  84. typedef enum hiAE_ACCURACY_E
  85. {
  86. AE_ACCURACY_DB = 0,
  87. AE_ACCURACY_LINEAR,
  88. AE_ACCURACY_TABLE,
  89. AE_ACCURACY_BUTT,
  90. } AE_ACCURACY_E;
  91. typedef struct hiAE_ACCURACY_S
  92. {
  93. AE_ACCURACY_E enAccuType;
  94. float f32Accuracy;
  95. float f32Offset;
  96. } AE_ACCURACY_S;
  97. typedef struct hiAE_SENSOR_DEFAULT_S
  98. {
  99. HI_U8 au8HistThresh[HIST_THRESH_NUM];
  100. HI_U8 u8AeCompensation;
  101. HI_U32 u32LinesPer500ms;
  102. HI_U32 u32FlickerFreq;
  103. HI_FLOAT f32Fps;
  104. HI_U32 u32HmaxTimes; /* unit is ns */
  105. HI_U32 u32InitExposure;
  106. HI_U32 u32InitAESpeed;
  107. HI_U32 u32InitAETolerance;
  108. HI_U32 u32FullLinesStd;
  109. HI_U32 u32FullLinesMax;
  110. HI_U32 u32FullLines;
  111. HI_U32 u32MaxIntTime; /* RW;unit is line */
  112. HI_U32 u32MinIntTime;
  113. HI_U32 u32MaxIntTimeTarget;
  114. HI_U32 u32MinIntTimeTarget;
  115. AE_ACCURACY_S stIntTimeAccu;
  116. HI_U32 u32MaxAgain;
  117. HI_U32 u32MinAgain;
  118. HI_U32 u32MaxAgainTarget;
  119. HI_U32 u32MinAgainTarget;
  120. AE_ACCURACY_S stAgainAccu;
  121. HI_U32 u32MaxDgain;
  122. HI_U32 u32MinDgain;
  123. HI_U32 u32MaxDgainTarget;
  124. HI_U32 u32MinDgainTarget;
  125. AE_ACCURACY_S stDgainAccu;
  126. HI_U32 u32MaxISPDgainTarget;
  127. HI_U32 u32MinISPDgainTarget;
  128. HI_U32 u32ISPDgainShift;
  129. HI_U32 u32MaxIntTimeStep;
  130. HI_U32 u32LFMaxShortTime;
  131. HI_U32 u32LFMinExposure;
  132. ISP_AE_ROUTE_S stAERouteAttr;
  133. HI_BOOL bAERouteExValid;
  134. ISP_AE_ROUTE_EX_S stAERouteAttrEx;
  135. HI_U16 u16ManRatioEnable;
  136. HI_U32 au32Ratio[EXP_RATIO_NUM];
  137. ISP_IRIS_TYPE_E enIrisType;
  138. ISP_PIRIS_ATTR_S stPirisAttr;
  139. ISP_IRIS_F_NO_E enMaxIrisFNO; /*RW; Range:[0, 10]; Format:4.0; Max F number of Piris's aperture, it's related to the specific iris */
  140. ISP_IRIS_F_NO_E enMinIrisFNO; /*RW; Range:[0, 10]; Format:4.0; Min F number of Piris's aperture, it's related to the specific iris */
  141. ISP_AE_STRATEGY_E enAeExpMode;
  142. HI_U16 u16ISOCalCoef;
  143. HI_U8 u8AERunInterval;
  144. } AE_SENSOR_DEFAULT_S;
  145. typedef struct hiAE_FSWDR_ATTR_S
  146. {
  147. ISP_FSWDR_MODE_E enFSWDRMode;
  148. } AE_FSWDR_ATTR_S;
  149. typedef struct hiAE_SENSOR_EXP_FUNC_S
  150. {
  151. HI_S32(*pfn_cmos_get_ae_default)(VI_PIPE ViPipe, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
  152. /* the function of sensor set fps */
  153. HI_VOID(*pfn_cmos_fps_set)(VI_PIPE ViPipe, HI_FLOAT f32Fps, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
  154. HI_VOID(*pfn_cmos_slow_framerate_set)(VI_PIPE ViPipe, HI_U32 u32FullLines, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
  155. /* while isp notify ae to update sensor regs, ae call these funcs. */
  156. HI_VOID(*pfn_cmos_inttime_update)(VI_PIPE ViPipe, HI_U32 u32IntTime);
  157. HI_VOID(*pfn_cmos_gains_update)(VI_PIPE ViPipe, HI_U32 u32Again, HI_U32 u32Dgain);
  158. HI_VOID (*pfn_cmos_again_calc_table)(VI_PIPE ViPipe, HI_U32 *pu32AgainLin, HI_U32 *pu32AgainDb);
  159. HI_VOID (*pfn_cmos_dgain_calc_table)(VI_PIPE ViPipe, HI_U32 *pu32DgainLin, HI_U32 *pu32DgainDb);
  160. HI_VOID (*pfn_cmos_get_inttime_max)(VI_PIPE ViPipe, HI_U16 u16ManRatioEnable, HI_U32 *au32Ratio, HI_U32 *au32IntTimeMax, HI_U32 *au32IntTimeMin, HI_U32 *pu32LFMaxIntTime);
  161. /* long frame mode set */
  162. HI_VOID(*pfn_cmos_ae_fswdr_attr_set)(VI_PIPE ViPipe, AE_FSWDR_ATTR_S *pstAeFSWDRAttr);
  163. } AE_SENSOR_EXP_FUNC_S;
  164. typedef struct hiAE_SENSOR_REGISTER_S
  165. {
  166. AE_SENSOR_EXP_FUNC_S stSnsExp;
  167. } AE_SENSOR_REGISTER_S;
  168. #ifdef __cplusplus
  169. #if __cplusplus
  170. }
  171. #endif
  172. #endif /* End of #ifdef __cplusplus */
  173. #endif