hi_awb_comm.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_awb_comm.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2012/12/19
  8. Description :
  9. History :
  10. 1.Date : 2012/12/19
  11. Author :
  12. Modification: Created file
  13. ******************************************************************************/
  14. #ifndef __HI_AWB_COMM_H__
  15. #define __HI_AWB_COMM_H__
  16. #include "hi_type.h"
  17. #ifdef __cplusplus
  18. #if __cplusplus
  19. extern "C" {
  20. #endif
  21. #endif /* End of #ifdef __cplusplus */
  22. #define HI_AWB_LIB_NAME "hisi_awb_lib"
  23. typedef struct hiAWB_DBG_ATTR_S
  24. {
  25. HI_U16 u16WhiteLevel;
  26. HI_U16 u16BlackLevel;
  27. HI_U16 u16CrMax;
  28. HI_U16 u16CrMin;
  29. HI_U16 u16CbMax;
  30. HI_U16 u16CbMin;
  31. HI_U16 u16CrHigh;
  32. HI_U16 u16CrLow;
  33. HI_U16 u16CbHigh;
  34. HI_U16 u16CbLow;
  35. HI_U16 u16RawWhiteLevel;
  36. HI_U16 u16RawBlackLevel;
  37. HI_U16 u16RawCrMax;
  38. HI_U16 u16RawCrMin;
  39. HI_U16 u16RawCbMax;
  40. HI_U16 u16RawCbMin;
  41. HI_U16 u16RawCrHigh;
  42. HI_U16 u16RawCrLow;
  43. HI_U16 u16RawCbHigh;
  44. HI_U16 u16RawCbLow;
  45. HI_U16 u16WDRMode;
  46. HI_U16 u16Enable;
  47. HI_U16 u16ManualEnable;
  48. HI_U16 u16Zone;
  49. HI_U16 u16HighTemp;
  50. HI_U16 u16LowTemp;
  51. HI_U16 u16RefTemp;
  52. HI_U16 u16RgainBase;
  53. HI_U16 u16GgainBase;
  54. HI_U16 u16BgainBase;
  55. HI_S32 s32p1;
  56. HI_S32 s32p2;
  57. HI_S32 s32q;
  58. HI_S32 s32a;
  59. HI_S32 s32c;
  60. HI_U16 u16ManSatEnable;
  61. HI_U16 u16SatTarget;
  62. } AWB_DBG_ATTR_S;
  63. typedef struct hiAWB_ZONE_DBG_S
  64. {
  65. HI_U16 u16Sum;
  66. HI_U16 u16Rg;
  67. HI_U16 u16Bg;
  68. HI_U16 u16CountAll;
  69. HI_U16 u16CountMin;
  70. HI_U16 u16CountMax;
  71. HI_U16 u16RawRAvg;
  72. HI_U16 u16RawGAvg;
  73. HI_U16 u16RawBAvg;
  74. HI_U16 u16TK;
  75. HI_U16 u16Weight;
  76. HI_S16 s16Shift;
  77. } AWB_ZONE_DBG_S;
  78. typedef struct hiAWB_DBG_STATUS_S
  79. {
  80. HI_U32 u32FrmNumBgn;
  81. HI_U32 u32GlobalSum;
  82. HI_U16 u16GlobalRgSta;
  83. HI_U16 u16GlobalBgSta;
  84. HI_U16 u16GlobalCountAll;
  85. HI_U16 u16GlobalCountMin;
  86. HI_U16 u16GlobalCountMax;
  87. HI_U16 u16GlobalRAvg;
  88. HI_U16 u16GlobalGAvg;
  89. HI_U16 u16GlobalBAvg;
  90. HI_U16 u16TK;
  91. HI_U16 u16Rgain;
  92. HI_U16 u16Ggain;
  93. HI_U16 u16Bgain;
  94. HI_U16 au16CCM[CCM_MATRIX_SIZE];
  95. HI_U32 au32HistInfo[256];
  96. AWB_ZONE_DBG_S astZoneDebug[AWB_ZONE_NUM];
  97. HI_U32 u32FrmNumEnd;
  98. } AWB_DBG_STATUS_S;
  99. /************************** sensor's interface to awb *********************/
  100. typedef struct hiAWB_CCM_TAB_S
  101. {
  102. HI_U16 u16ColorTemp; /*RW; Range:[2000,10000]; Format:16.0; the current color temperature */
  103. HI_U16 au16CCM[CCM_MATRIX_SIZE]; /*RW; Range: [0x0, 0xFFFF]; Format:8.8; CCM matrixes for different color temperature*/
  104. } AWB_CCM_TAB_S;
  105. typedef struct hiAWB_CCM_S
  106. {
  107. HI_U16 u16CCMTabNum; /*RW; Range: [0x3, 0x7]; Format:16.0; The number of CCM matrixes*/
  108. AWB_CCM_TAB_S astCCMTab[CCM_MATRIX_NUM];
  109. } AWB_CCM_S;
  110. typedef struct hiAWB_AGC_TABLE_S
  111. {
  112. HI_BOOL bValid;
  113. HI_U8 au8Saturation[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;adjust saturation, different iso with different saturation */
  114. } AWB_AGC_TABLE_S;
  115. typedef struct hiAWB_SENSOR_DEFAULT_S
  116. {
  117. HI_U16 u16WbRefTemp; /* RW;reference color temperature for WB */
  118. HI_U16 au16GainOffset[ISP_BAYER_CHN_NUM]; /*RW; gain offset for white balance */
  119. HI_S32 as32WbPara[AWB_CURVE_PARA_NUM]; /*RW; parameter for wb curve,p1,p2,q1,a1,b1,c1 */
  120. HI_U16 u16GoldenRgain; /* Rgain for the golden sample */
  121. HI_U16 u16GoldenBgain; /* Bgain for the golden sample */
  122. HI_U16 u16SampleRgain; /* Rgain for the current sample */
  123. HI_U16 u16SampleBgain; /* Bgain for the current sample */
  124. AWB_AGC_TABLE_S stAgcTbl;
  125. AWB_CCM_S stCcm;
  126. HI_U16 u16InitRgain; /*Init WB gain*/
  127. HI_U16 u16InitGgain;
  128. HI_U16 u16InitBgain;
  129. HI_U8 u8AWBRunInterval; /*RW;AWB Run Interval*/
  130. } AWB_SENSOR_DEFAULT_S;
  131. typedef struct hiAWB_SPEC_SENSOR_DEFAULT_S
  132. {
  133. ISP_SPECAWB_ATTR_S stSpecAwbAttrs;
  134. ISP_SPECAWB_CAA_CONTROl_S stCaaControl;
  135. } AWB_SPEC_SENSOR_DEFAULT_S;
  136. typedef struct hiAWB_SENSOR_EXP_FUNC_S
  137. {
  138. HI_S32(*pfn_cmos_get_awb_default)(VI_PIPE ViPipe, AWB_SENSOR_DEFAULT_S *pstAwbSnsDft);
  139. HI_S32(*pfn_cmos_get_awb_spec_default)(VI_PIPE ViPipe, AWB_SPEC_SENSOR_DEFAULT_S *pstAwbSpecSnsDft);
  140. } AWB_SENSOR_EXP_FUNC_S;
  141. typedef struct hiAWB_SENSOR_REGISTER_S
  142. {
  143. AWB_SENSOR_EXP_FUNC_S stSnsExp;
  144. } AWB_SENSOR_REGISTER_S;
  145. #ifdef __cplusplus
  146. #if __cplusplus
  147. }
  148. #endif
  149. #endif /* End of #ifdef __cplusplus */
  150. #endif