hi_ive.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. /******************************************************************************
  2. Copyright (C), 2001-2014, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_ive.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software (IVE) group
  7. Created : 2014/08/05
  8. Description :
  9. 1.Date : 2013/07/01~2014/08/05
  10. Modification: Created file
  11. ******************************************************************************/
  12. #ifndef _HI_IVE_H_
  13. #define _HI_IVE_H_
  14. #ifdef __cplusplus
  15. #if __cplusplus
  16. extern "C"{
  17. #endif
  18. #endif
  19. #include "hi_comm_ive.h"
  20. //if sdk environment,include hi_common.h,else typedef HI_S32 IVE_HANDLE
  21. #include "hi_common.h"
  22. #define IVE_HIST_NUM 256
  23. #define IVE_MAP_NUM 256
  24. #define IVE_MAX_REGION_NUM 254
  25. #define IVE_ST_MAX_CORNER_NUM 500
  26. /*
  27. *DMA mode ,created by Chen Quanfu 2013-07-19
  28. */
  29. typedef enum hiIVE_DMA_MODE_E
  30. {
  31. IVE_DMA_MODE_DIRECT_COPY = 0x0,
  32. IVE_DMA_MODE_INTERVAL_COPY = 0x1,
  33. IVE_DMA_MODE_SET_3BYTE = 0x2,
  34. IVE_DMA_MODE_SET_8BYTE = 0x3,
  35. IVE_DMA_MODE_BUTT
  36. }IVE_DMA_MODE_E;
  37. /*
  38. *DMA control parameter ,created by Chen Quanfu 2013-07-19
  39. */
  40. typedef struct hiIVE_DMA_CTRL_S
  41. {
  42. IVE_DMA_MODE_E enMode;
  43. HI_U64 u64Val; /*Used in memset mode*/
  44. HI_U8 u8HorSegSize; /*Used in interval-copy mode, every row was segmented by u8HorSegSize bytes, restricted in values of 2,3,4,8,16*/
  45. HI_U8 u8ElemSize; /*Used in interval-copy mode, the valid bytes copied in front of every segment in a valid row, which 0<u8ElemSize<u8HorSegSize*/
  46. HI_U8 u8VerSegRows; /*Used in interval-copy mode, copy one row in every u8VerSegRows*/
  47. }IVE_DMA_CTRL_S;
  48. /*
  49. *Filter control parameters
  50. *You need to set these parameters when using the filter operator.
  51. *Modify template filter from 3x3 to 5x5 by Chen Quanfu 2013-07-11
  52. */
  53. typedef struct hiIVE_FILTER_CTRL_S
  54. {
  55. HI_S8 as8Mask[25]; /*Template parameter filter coefficient*/
  56. HI_U8 u8Norm; /*Normalization parameter, by right shift*/
  57. }IVE_FILTER_CTRL_S;
  58. /*
  59. * CSC working mode.
  60. * Modified by Tan Bing, 2013-7-22.
  61. */
  62. typedef enum hiIVE_CSC_MODE_E
  63. {
  64. IVE_CSC_MODE_VIDEO_BT601_YUV2RGB = 0x0, /*CSC: YUV2RGB, video transfer mode, RGB value range [16, 235]*/
  65. IVE_CSC_MODE_VIDEO_BT709_YUV2RGB = 0x1, /*CSC: YUV2RGB, video transfer mode, RGB value range [16, 235]*/
  66. IVE_CSC_MODE_PIC_BT601_YUV2RGB = 0x2, /*CSC: YUV2RGB, picture transfer mode, RGB value range [0, 255]*/
  67. IVE_CSC_MODE_PIC_BT709_YUV2RGB = 0x3, /*CSC: YUV2RGB, picture transfer mode, RGB value range [0, 255]*/
  68. IVE_CSC_MODE_PIC_BT601_YUV2HSV = 0x4, /*CSC: YUV2HSV, picture transfer mode, HSV value range [0, 255]*/
  69. IVE_CSC_MODE_PIC_BT709_YUV2HSV = 0x5, /*CSC: YUV2HSV, picture transfer mode, HSV value range [0, 255]*/
  70. IVE_CSC_MODE_PIC_BT601_YUV2LAB = 0x6, /*CSC: YUV2LAB, picture transfer mode, Lab value range [0, 255]*/
  71. IVE_CSC_MODE_PIC_BT709_YUV2LAB = 0x7, /*CSC: YUV2LAB, picture transfer mode, Lab value range [0, 255]*/
  72. IVE_CSC_MODE_VIDEO_BT601_RGB2YUV = 0x8, /*CSC: RGB2YUV, video transfer mode, YUV value range [0, 255]*/
  73. IVE_CSC_MODE_VIDEO_BT709_RGB2YUV = 0x9, /*CSC: RGB2YUV, video transfer mode, YUV value range [0, 255]*/
  74. IVE_CSC_MODE_PIC_BT601_RGB2YUV = 0xa, /*CSC: RGB2YUV, picture transfer mode, Y:[16, 235],U\V:[16, 240]*/
  75. IVE_CSC_MODE_PIC_BT709_RGB2YUV = 0xb, /*CSC: RGB2YUV, picture transfer mode, Y:[16, 235],U\V:[16, 240]*/
  76. IVE_CSC_MODE_BUTT
  77. }IVE_CSC_MODE_E;
  78. /*
  79. *CSC control parameters
  80. *You need to set these parameters when using the CSC operator.
  81. *Removed the CSC output format, replaced by setting the output image type.
  82. *Modified by tanbing 2013-7-22.
  83. */
  84. typedef struct hiIVE_CSC_CTRL_S
  85. {
  86. IVE_CSC_MODE_E enMode; /*Working mode*/
  87. }IVE_CSC_CTRL_S;
  88. /*
  89. *Filter+CSC control parameters
  90. *You need to set these parameters when using the filter+CSC operator.
  91. *The control information about both the filter and CSC needs to be configured.
  92. *Modify template filter from 3x3 to 5x5 by Tan Bing 2013-07-11
  93. */
  94. typedef struct hiIVE_FILTER_AND_CSC_CTRL_S
  95. {
  96. IVE_CSC_MODE_E enMode; /*CSC working mode*/
  97. HI_S8 as8Mask[25]; /*Template parameter filter coefficient*/
  98. HI_U8 u8Norm; /*Normalization parameter, by right shift*/
  99. }IVE_FILTER_AND_CSC_CTRL_S;
  100. /*
  101. *SOBEL output ctrl
  102. */
  103. typedef enum hiIVE_SOBEL_OUT_CTRL_E
  104. {
  105. IVE_SOBEL_OUT_CTRL_BOTH = 0x0, /*Output horizontal and vertical*/
  106. IVE_SOBEL_OUT_CTRL_HOR = 0x1, /*Output horizontal*/
  107. IVE_SOBEL_OUT_CTRL_VER = 0x2, /*Output vertical*/
  108. IVE_SOBEL_OUT_CTRL_BUTT
  109. }IVE_SOBEL_OUT_CTRL_E;
  110. /*
  111. *SOBEL control parameter
  112. *Add IVE_SOBEL_OUT_CTRL_E by Chen Quanfu 2013-07-11
  113. */
  114. typedef struct hiIVE_SOBEL_CTRL_S
  115. {
  116. IVE_SOBEL_OUT_CTRL_E enOutCtrl; /*Output format*/
  117. HI_S8 as8Mask[25]; /*Template parameter*/
  118. }IVE_SOBEL_CTRL_S;
  119. /*
  120. *Type of the magnitude and angle output results
  121. *Modified by Chen Quanfu 2013-07-23
  122. */
  123. typedef enum hiIVE_MAG_AND_ANG_OUT_CTRL_E
  124. {
  125. IVE_MAG_AND_ANG_OUT_CTRL_MAG = 0x0, /*Only the magnitude is output.*/
  126. IVE_MAG_AND_ANG_OUT_CTRL_MAG_AND_ANG = 0x1, /*The magnitude and angle are output.*/
  127. IVE_MAG_AND_ANG_OUT_CTRL_BUTT
  128. }IVE_MAG_AND_ANG_OUT_CTRL_E;
  129. /*
  130. *Magnitude and angle control parameter
  131. */
  132. typedef struct hiIVE_MAG_AND_ANG_CTRL_S
  133. {
  134. IVE_MAG_AND_ANG_OUT_CTRL_E enOutCtrl;
  135. HI_U16 u16Thr;
  136. HI_S8 as8Mask[25]; /*Template parameter.*/
  137. }IVE_MAG_AND_ANG_CTRL_S;
  138. /*
  139. *Dilate control parameters
  140. */
  141. typedef struct hiIVE_DILATE_CTRL_S
  142. {
  143. HI_U8 au8Mask[25]; /*The template parameter value must be 0 or 255.*/
  144. }IVE_DILATE_CTRL_S;
  145. /*
  146. *Erode control parameter
  147. */
  148. typedef struct hiIVE_ERODE_CTRL_S
  149. {
  150. HI_U8 au8Mask[25]; /*The template parameter value must be 0 or 255.*/
  151. }IVE_ERODE_CTRL_S;
  152. /*
  153. * Type of the Thresh mode.
  154. * Modified by Tan Bing, 2013-7-22
  155. */
  156. typedef enum hiIVE_THRESH_MODE_E
  157. {
  158. IVE_THRESH_MODE_BINARY = 0x0, /*srcVal <= lowThr, dstVal = minVal; srcVal > lowThr, dstVal = maxVal.*/
  159. IVE_THRESH_MODE_TRUNC = 0x1, /*srcVal <= lowThr, dstVal = srcVal; srcVal > lowThr, dstVal = maxVal.*/
  160. IVE_THRESH_MODE_TO_MINVAL = 0x2, /*srcVal <= lowThr, dstVal = minVal; srcVal > lowThr, dstVal = srcVal.*/
  161. IVE_THRESH_MODE_MIN_MID_MAX = 0x3, /*srcVal <= lowThr, dstVal = minVal; lowThr < srcVal <= highThr, dstVal = midVal; srcVal > highThr, dstVal = maxVal.*/
  162. IVE_THRESH_MODE_ORI_MID_MAX = 0x4, /*srcVal <= lowThr, dstVal = srcVal; lowThr < srcVal <= highThr, dstVal = midVal; srcVal > highThr, dstVal = maxVal.*/
  163. IVE_THRESH_MODE_MIN_MID_ORI = 0x5, /*srcVal <= lowThr, dstVal = minVal; lowThr < srcVal <= highThr, dstVal = midVal; srcVal > highThr, dstVal = srcVal.*/
  164. IVE_THRESH_MODE_MIN_ORI_MAX = 0x6, /*srcVal <= lowThr, dstVal = minVal; lowThr < srcVal <= highThr, dstVal = srcVal; srcVal > highThr, dstVal = maxVal.*/
  165. IVE_THRESH_MODE_ORI_MID_ORI = 0x7, /*srcVal <= lowThr, dstVal = srcVal; lowThr < srcVal <= highThr, dstVal = midVal; srcVal > highThr, dstVal = srcVal.*/
  166. IVE_THRESH_MODE_BUTT
  167. }IVE_THRESH_MODE_E;
  168. /*
  169. * Thresh control parameters.
  170. * Modified by Tan Bing, 2013-7-22
  171. */
  172. typedef struct hiIVE_THRESH_CTRL_S
  173. {
  174. IVE_THRESH_MODE_E enMode;
  175. HI_U8 u8LowThr; /*user-defined threshold, 0<=u8LowThr<=255 */
  176. HI_U8 u8HighThr; /*user-defined threshold, if enMode<IVE_THRESH_MODE_MIN_MID_MAX, u8HighThr is not used, else 0<=u8LowThr<=u8HighThr<=255;*/
  177. HI_U8 u8MinVal; /*Minimum value when tri-level thresholding*/
  178. HI_U8 u8MidVal; /*Middle value when tri-level thresholding, if enMode<2, u32MidVal is not used; */
  179. HI_U8 u8MaxVal; /*Maxmum value when tri-level thresholding*/
  180. }IVE_THRESH_CTRL_S;
  181. /*
  182. *Type of the Sub output results
  183. */
  184. typedef enum hiIVE_SUB_MODE_E
  185. {
  186. IVE_SUB_MODE_ABS = 0x0, /*Absolute value of the difference*/
  187. IVE_SUB_MODE_SHIFT = 0x1, /*The output result is obtained by shifting the result one digit right to reserve the signed bit.*/
  188. IVE_SUB_MODE_BUTT
  189. }IVE_SUB_MODE_E;
  190. /*
  191. *Sub control parameters
  192. */
  193. typedef struct hiIVE_SUB_CTRL_S
  194. {
  195. IVE_SUB_MODE_E enMode;
  196. }IVE_SUB_CTRL_S;
  197. /*
  198. *Type of the Integ output results, created by Tan Bing, 2013-03-18
  199. * Modify by Chen Quanfu 2013-07-15
  200. * Spec: add IVE_INTEG_OUT_CTRL_SQSUM output format
  201. */
  202. typedef enum hiIVE_INTEG_OUT_CTRL_E
  203. {
  204. IVE_INTEG_OUT_CTRL_COMBINE = 0x0,
  205. IVE_INTEG_OUT_CTRL_SUM = 0x1,
  206. IVE_INTEG_OUT_CTRL_SQSUM = 0x2,
  207. IVE_INTEG_OUT_CTRL_BUTT
  208. }IVE_INTEG_OUT_CTRL_E;
  209. /*
  210. * Integ control parameters,Create by Chen Quanfu 2013-07-15
  211. */
  212. typedef struct hiIVE_INTEG_CTRL_S
  213. {
  214. IVE_INTEG_OUT_CTRL_E enOutCtrl;
  215. }IVE_INTEG_CTRL_S;
  216. /*
  217. *Type of the Thresh_S16 mode
  218. */
  219. typedef enum hiIVE_THRESH_S16_MODE_E
  220. {
  221. IVE_THRESH_S16_MODE_S16_TO_S8_MIN_MID_MAX = 0x0,
  222. IVE_THRESH_S16_MODE_S16_TO_S8_MIN_ORI_MAX = 0x1,
  223. IVE_THRESH_S16_MODE_S16_TO_U8_MIN_MID_MAX = 0x2,
  224. IVE_THRESH_S16_MODE_S16_TO_U8_MIN_ORI_MAX = 0x3,
  225. IVE_THRESH_S16_MODE_BUTT
  226. }IVE_THRESH_S16_MODE_E;
  227. /*
  228. *Thresh_S16 control parameters
  229. */
  230. typedef struct hiIVE_THRESH_S16_CTRL_S
  231. {
  232. IVE_THRESH_S16_MODE_E enMode;
  233. HI_S16 s16LowThr; /*User-defined threshold*/
  234. HI_S16 s16HighThr; /*User-defined threshold*/
  235. IVE_8BIT_U un8MinVal; /*Minimum value when tri-level thresholding*/
  236. IVE_8BIT_U un8MidVal; /*Middle value when tri-level thresholding*/
  237. IVE_8BIT_U un8MaxVal; /*Maxmum value when tri-level thresholding*/
  238. }IVE_THRESH_S16_CTRL_S;
  239. /*
  240. *Type of the Thresh_U16 mode
  241. */
  242. typedef enum hiIVE_THRESH_U16_MODE_E
  243. {
  244. IVE_THRESH_U16_MODE_U16_TO_U8_MIN_MID_MAX = 0x0,
  245. IVE_THRESH_U16_MODE_U16_TO_U8_MIN_ORI_MAX = 0x1,
  246. IVE_THRESH_U16_MODE_BUTT
  247. }IVE_THRESH_U16_MODE_E;
  248. /*
  249. *Thresh_U16 control parameters
  250. */
  251. typedef struct hiIVE_THRESH_U16_CTRL_S
  252. {
  253. IVE_THRESH_U16_MODE_E enMode;
  254. HI_U16 u16LowThr;
  255. HI_U16 u16HighThr;
  256. HI_U8 u8MinVal;
  257. HI_U8 u8MidVal;
  258. HI_U8 u8MaxVal;
  259. }IVE_THRESH_U16_CTRL_S;
  260. /*
  261. *Mode of 16BitTo8Bit
  262. */
  263. typedef enum hiIVE_16BIT_TO_8BIT_MODE_E
  264. {
  265. IVE_16BIT_TO_8BIT_MODE_S16_TO_S8 = 0x0,
  266. IVE_16BIT_TO_8BIT_MODE_S16_TO_U8_ABS = 0x1,
  267. IVE_16BIT_TO_8BIT_MODE_S16_TO_U8_BIAS = 0x2,
  268. IVE_16BIT_TO_8BIT_MODE_U16_TO_U8 = 0x3,
  269. IVE_16BIT_TO_8BIT_MODE_BUTT
  270. }IVE_16BIT_TO_8BIT_MODE_E;
  271. /*
  272. *16BitTo8Bit control parameters
  273. */
  274. typedef struct hiIVE_16BIT_TO_8BIT_CTRL_S
  275. {
  276. IVE_16BIT_TO_8BIT_MODE_E enMode;
  277. HI_U16 u16Denominator;
  278. HI_U8 u8Numerator;
  279. HI_S8 s8Bias;
  280. }IVE_16BIT_TO_8BIT_CTRL_S;
  281. /*
  282. *Type of the OrdStaFilter
  283. */
  284. typedef enum hiIVE_ORD_STAT_FILTER_MODE_E
  285. {
  286. IVE_ORD_STAT_FILTER_MODE_MEDIAN = 0x0,
  287. IVE_ORD_STAT_FILTER_MODE_MAX = 0x1,
  288. IVE_ORD_STAT_FILTER_MODE_MIN = 0x2,
  289. IVE_ORD_STAT_FILTER_MODE_BUTT
  290. }IVE_ORD_STAT_FILTER_MODE_E;
  291. /*
  292. *OrdStaFilter control parameters
  293. */
  294. typedef struct hiIVE_ORD_STAT_FILTER_CTRL_S
  295. {
  296. IVE_ORD_STAT_FILTER_MODE_E enMode;
  297. }IVE_ORD_STAT_FILTER_CTRL_S;
  298. /*
  299. *Type of the Map
  300. */
  301. typedef enum hiIVE_MAP_MODE_E
  302. {
  303. IVE_MAP_MODE_U8 = 0x0,
  304. IVE_MAP_MODE_S16 = 0x1,
  305. IVE_MAP_MODE_U16 = 0x2,
  306. IVE_MAP_MODE_BUTT
  307. }IVE_MAP_MODE_E;
  308. /*
  309. * Map control struct
  310. */
  311. typedef struct hiIVE_MAP_CTRL_S
  312. {
  313. IVE_MAP_MODE_E enMode;
  314. }IVE_MAP_CTRL_S;
  315. /*
  316. * Map unsigned 8 bit LUT memory struct
  317. */
  318. typedef struct hiIVE_MAP_U8BIT_LUT_MEM_S
  319. {
  320. HI_U8 au8Map[IVE_MAP_NUM];
  321. }IVE_MAP_U8BIT_LUT_MEM_S;
  322. /*
  323. * Map unsigned 16 bit LUT memory struct
  324. */
  325. typedef struct hiIVE_MAP_U16BIT_LUT_MEM_S
  326. {
  327. HI_U16 au16Map[IVE_MAP_NUM];
  328. }IVE_MAP_U16BIT_LUT_MEM_S;
  329. /*
  330. * Map signed 16 bit LUT memory struct
  331. */
  332. typedef struct hiIVE_MAP_S16BIT_LUT_MEM_S
  333. {
  334. HI_S16 as16Map[IVE_MAP_NUM];
  335. }IVE_MAP_S16BIT_LUT_MEM_S;
  336. /*
  337. * Equalizehist control member struct
  338. */
  339. typedef struct hiIVE_EQUALIZE_HIST_CTRL_MEM_S
  340. {
  341. HI_U32 au32Hist[IVE_HIST_NUM];
  342. HI_U8 au8Map[IVE_MAP_NUM];
  343. }IVE_EQUALIZE_HIST_CTRL_MEM_S;
  344. /*
  345. *Equalizehist control parameters,created by Chen Quanfu 2013-07-17
  346. */
  347. typedef struct hiIVE_EQUALIZE_HIST_CTRL_S
  348. {
  349. IVE_MEM_INFO_S stMem;
  350. }IVE_EQUALIZE_HIST_CTRL_S;
  351. /*
  352. *Add control parameters,created by Chen Quanfu 2013-07-17
  353. */
  354. typedef struct hiIVE_ADD_CTRL_S
  355. {
  356. HI_U0Q16 u0q16X; /*x of "xA+yB"*/
  357. HI_U0Q16 u0q16Y; /*y of "xA+yB"*/
  358. }IVE_ADD_CTRL_S;
  359. /*
  360. *NCC dst memory struct
  361. */
  362. typedef struct hiIVE_NCC_DST_MEM_S
  363. {
  364. HI_U64 u64Numerator;
  365. HI_U64 u64QuadSum1;
  366. HI_U64 u64QuadSum2;
  367. HI_U8 u8Reserved[8];
  368. }IVE_NCC_DST_MEM_S;
  369. /*
  370. *Region struct
  371. */
  372. typedef struct hiIVE_REGION_S
  373. {
  374. HI_U32 u32Area; /*Represented by the pixel number*/
  375. HI_U16 u16Left; /*Circumscribed rectangle left border*/
  376. HI_U16 u16Right; /*Circumscribed rectangle right border*/
  377. HI_U16 u16Top; /*Circumscribed rectangle top border*/
  378. HI_U16 u16Bottom; /*Circumscribed rectangle bottom border*/
  379. }IVE_REGION_S;
  380. /*
  381. *CCBLOB struct
  382. */
  383. typedef struct hiIVE_CCBLOB_S
  384. {
  385. HI_U16 u16CurAreaThr; /*Threshold of the result regions' area*/
  386. HI_S8 s8LabelStatus; /*-1: Labeled failed ; 0: Labeled successfully*/
  387. HI_U8 u8RegionNum; /*Number of valid region, non-continuous stored*/
  388. IVE_REGION_S astRegion[IVE_MAX_REGION_NUM]; /*Valid regions with 'u32Area>0' and 'label = ArrayIndex+1'*/
  389. }IVE_CCBLOB_S;
  390. /*
  391. *Type of the CCL
  392. */
  393. typedef enum hiIVE_CCL_MODE_E
  394. {
  395. IVE_CCL_MODE_4C = 0x0,/*4-connected*/
  396. IVE_CCL_MODE_8C = 0x1,/*8-connected*/
  397. IVE_CCL_MODE_BUTT
  398. }IVE_CCL_MODE_E;
  399. /*
  400. *CCL control struct
  401. */
  402. typedef struct hiIVE_CCL_CTRL_S
  403. {
  404. IVE_CCL_MODE_E enMode; /*Mode*/
  405. HI_U16 u16InitAreaThr; /*Init threshold of region area*/
  406. HI_U16 u16Step; /*Increase area step for once*/
  407. }IVE_CCL_CTRL_S;
  408. /*
  409. *GMM control struct
  410. */
  411. typedef struct hiIVE_GMM_CTRL_S
  412. {
  413. HI_U22Q10 u22q10NoiseVar; /*Initial noise Variance*/
  414. HI_U22Q10 u22q10MaxVar; /*Max Variance*/
  415. HI_U22Q10 u22q10MinVar; /*Min Variance*/
  416. HI_U0Q16 u0q16LearnRate; /*Learning rate*/
  417. HI_U0Q16 u0q16BgRatio; /*Background ratio*/
  418. HI_U8Q8 u8q8VarThr; /*Variance Threshold*/
  419. HI_U0Q16 u0q16InitWeight; /*Initial Weight*/
  420. HI_U8 u8ModelNum; /*Model number: 3 or 5*/
  421. }IVE_GMM_CTRL_S;
  422. /*
  423. *Type of the GMM2 sensitivity factor mode
  424. */
  425. typedef enum hiIVE_GMM2_SNS_FACTOR_MODE_E
  426. {
  427. IVE_GMM2_SNS_FACTOR_MODE_GLB = 0x0, /*Global sensitivity factor mode*/
  428. IVE_GMM2_SNS_FACTOR_MODE_PIX = 0x1, /*Pixel sensitivity factor mode*/
  429. IVE_GMM2_SNS_FACTOR_MODE_BUTT
  430. }IVE_GMM2_SNS_FACTOR_MODE_E;
  431. /*
  432. *Type of the GMM2 life update factor mode
  433. */
  434. typedef enum hiIVE_GMM2_LIFE_UPDATE_FACTOR_MODE_E
  435. {
  436. IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_GLB = 0x0, /*Global life update factor mode*/
  437. IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_PIX = 0x1, /*Pixel life update factor mode*/
  438. IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_BUTT
  439. }IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_E ;
  440. /*
  441. *GMM2 control struct
  442. */
  443. typedef struct hiIVE_GMM2_CTRL_S
  444. {
  445. IVE_GMM2_SNS_FACTOR_MODE_E enSnsFactorMode; /*Sensitivity factor mode*/
  446. IVE_GMM2_LIFE_UPDATE_FACTOR_MODE_E enLifeUpdateFactorMode; /*Life update factor mode*/
  447. HI_U16 u16GlbLifeUpdateFactor; /*Global life update factor (default: 4)*/
  448. HI_U16 u16LifeThr; /*Life threshold (default: 5000)*/
  449. HI_U16 u16FreqInitVal; /*Initial frequency (default: 20000)*/
  450. HI_U16 u16FreqReduFactor; /*Frequency reduction factor (default: 0xFF00)*/
  451. HI_U16 u16FreqAddFactor; /*Frequency adding factor (default: 0xEF)*/
  452. HI_U16 u16FreqThr; /*Frequency threshold (default: 12000)*/
  453. HI_U16 u16VarRate; /*Variation update rate (default: 1)*/
  454. HI_U9Q7 u9q7MaxVar; /*Max variation (default: (16 * 16)<<7)*/
  455. HI_U9Q7 u9q7MinVar; /*Min variation (default: ( 8 * 8)<<7)*/
  456. HI_U8 u8GlbSnsFactor; /*Global sensitivity factor (default: 8)*/
  457. HI_U8 u8ModelNum; /*Model number (range: 1~5, default: 3)*/
  458. }IVE_GMM2_CTRL_S;
  459. /*
  460. *CannyHysEdge control struct
  461. */
  462. typedef struct hiIVE_CANNY_HYS_EDGE_CTRL_S
  463. {
  464. IVE_MEM_INFO_S stMem;
  465. HI_U16 u16LowThr;
  466. HI_U16 u16HighThr;
  467. HI_S8 as8Mask[25];
  468. } IVE_CANNY_HYS_EDGE_CTRL_S;
  469. /*
  470. *Canny stack size struct
  471. */
  472. typedef struct hiIVE_CANNY_STACK_SIZE_S
  473. {
  474. HI_U32 u32StackSize; /*Stack size for output*/
  475. HI_U8 u8Reserved[12]; /*For 16 byte align*/
  476. }IVE_CANNY_STACK_SIZE_S;
  477. /*
  478. *LBP compare mode
  479. */
  480. typedef enum hiIVE_LBP_CMP_MODE_E
  481. {
  482. IVE_LBP_CMP_MODE_NORMAL = 0x0, /* P(x)-P(center)>= un8BitThr.s8Val, s(x)=1; else s(x)=0; */
  483. IVE_LBP_CMP_MODE_ABS = 0x1, /* Abs(P(x)-P(center))>=un8BitThr.u8Val, s(x)=1; else s(x)=0; */
  484. IVE_LBP_CMP_MODE_BUTT
  485. }IVE_LBP_CMP_MODE_E;
  486. /*
  487. *LBP control struct
  488. */
  489. typedef struct hiIVE_LBP_CTRL_S
  490. {
  491. IVE_LBP_CMP_MODE_E enMode;
  492. IVE_8BIT_U un8BitThr;
  493. }IVE_LBP_CTRL_S;
  494. /*
  495. *Type of the GradientFilter output format
  496. */
  497. typedef enum hiIVE_NORM_GRAD_OUT_CTRL_E
  498. {
  499. IVE_NORM_GRAD_OUT_CTRL_HOR_AND_VER = 0x0,
  500. IVE_NORM_GRAD_OUT_CTRL_HOR = 0x1,
  501. IVE_NORM_GRAD_OUT_CTRL_VER = 0x2,
  502. IVE_NORM_GRAD_OUT_CTRL_COMBINE = 0x3,
  503. IVE_NORM_GRAD_OUT_CTRL_BUTT
  504. }IVE_NORM_GRAD_OUT_CTRL_E;
  505. /*
  506. *GradientFilter control parameters
  507. */
  508. typedef struct hiIVE_NORM_GRAD_CTRL_S
  509. {
  510. IVE_NORM_GRAD_OUT_CTRL_E enOutCtrl;
  511. HI_S8 as8Mask[25];
  512. HI_U8 u8Norm;
  513. }IVE_NORM_GRAD_CTRL_S;
  514. /*
  515. * LKOpticalFlowPyr output mode
  516. */
  517. typedef enum hiIVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_E
  518. {
  519. IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_NONE = 0, /*Output none*/
  520. IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_STATUS = 1, /*Output status*/
  521. IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_BOTH = 2, /*Output status and err*/
  522. IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_BUTT
  523. }IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_E;
  524. /*
  525. * LKOpticalFlowPyr control parameters
  526. */
  527. typedef struct hiIVE_LK_OPTICAL_FLOW_PYR_CTRL_S
  528. {
  529. IVE_LK_OPTICAL_FLOW_PYR_OUT_MODE_E enOutMode;
  530. HI_BOOL bUseInitFlow; /*where to use initial flow*/
  531. HI_U16 u16PtsNum; /*Number of the feature points,<=500*/
  532. HI_U8 u8MaxLevel; /*0<=u8MaxLevel<=3*/
  533. HI_U0Q8 u0q8MinEigThr; /*Minimum eigenvalue threshold*/
  534. HI_U8 u8IterCnt; /*Maximum iteration times, <=20*/
  535. HI_U0Q8 u0q8Eps; /*Used for exit criteria: dx^2 + dy^2 < u0q8Eps */
  536. }IVE_LK_OPTICAL_FLOW_PYR_CTRL_S;
  537. /*
  538. * Shi-Tomasi maximum eigenvalue
  539. */
  540. typedef struct hiIVE_ST_MAX_EIG_S
  541. {
  542. HI_U16 u16MaxEig; /*Shi-Tomasi second step output MaxEig*/
  543. HI_U8 u8Reserved[14]; /*For 16 byte align*/
  544. }IVE_ST_MAX_EIG_S;
  545. /*
  546. *ShiTomasi control parameters
  547. */
  548. typedef struct hiIVE_ST_CANDI_CORNER_CTRL_S
  549. {
  550. IVE_MEM_INFO_S stMem;
  551. HI_U0Q8 u0q8QualityLevel;
  552. }IVE_ST_CANDI_CORNER_CTRL_S;
  553. typedef struct hiIVE_ST_CORNER_INFO_S
  554. {
  555. HI_U16 u16CornerNum;
  556. IVE_POINT_U16_S astCorner[IVE_ST_MAX_CORNER_NUM];
  557. }IVE_ST_CORNER_INFO_S;
  558. typedef struct hiIVE_ST_CORNER_CTRL_S
  559. {
  560. HI_U16 u16MaxCornerNum;
  561. HI_U16 u16MinDist;
  562. }IVE_ST_CORNER_CTRL_S;
  563. /*
  564. * GradFg mode enum
  565. */
  566. typedef enum hiIVE_GRAD_FG_MODE_E
  567. {
  568. IVE_GRAD_FG_MODE_USE_CUR_GRAD = 0x0,
  569. IVE_GRAD_FG_MODE_FIND_MIN_GRAD = 0x1,
  570. IVE_GRAD_FG_MODE_BUTT
  571. }IVE_GRAD_FG_MODE_E;
  572. /*
  573. * GradFg ctrl struct
  574. */
  575. typedef struct hiIVE_GRAD_FG_CTRL_S
  576. {
  577. IVE_GRAD_FG_MODE_E enMode; /*Calculation mode*/
  578. HI_U16 u16EdwFactor; /*Edge width adjustment factor (range: 500 to 2000; default: 1000)*/
  579. HI_U8 u8CrlCoefThr; /*Gradient vector correlation coefficient threshold (ranges: 50 to 100; default: 80)*/
  580. HI_U8 u8MagCrlThr; /*Gradient amplitude threshold (range: 0 to 20; default: 4)*/
  581. HI_U8 u8MinMagDiff; /*Gradient magnitude difference threshold (range: 2 to 8; default: 2)*/
  582. HI_U8 u8NoiseVal; /*Gradient amplitude noise threshold (range: 1 to 8; default: 1)*/
  583. HI_U8 u8EdwDark; /*Black pixels enable flag (range: 0 (no), 1 (yes); default: 1)*/
  584. }IVE_GRAD_FG_CTRL_S;
  585. typedef struct hiIVE_CANDI_BG_PIX_S
  586. {
  587. HI_U8Q4F4 u8q4f4Mean; /*Candidate background grays value */
  588. HI_U16 u16StartTime; /*Candidate Background start time */
  589. HI_U16 u16SumAccessTime; /*Candidate Background cumulative access time */
  590. HI_U16 u16ShortKeepTime; /*Candidate background short hold time*/
  591. HI_U8 u8ChgCond; /*Time condition for candidate background into the changing state*/
  592. HI_U8 u8PotenBgLife; /*Potential background cumulative access time */
  593. }IVE_CANDI_BG_PIX_S;
  594. typedef struct hiIVE_WORK_BG_PIX_S
  595. {
  596. HI_U8Q4F4 u8q4f4Mean; /*0# background grays value */
  597. HI_U16 u16AccTime; /*Background cumulative access time */
  598. HI_U8 u8PreGray; /*Gray value of last pixel */
  599. HI_U5Q3 u5q3DiffThr; /*Differential threshold */
  600. HI_U8 u8AccFlag; /*Background access flag */
  601. HI_U8 u8BgGray[3]; /*1# ~ 3# background grays value */
  602. }IVE_WORK_BG_PIX_S;
  603. typedef struct hiIVE_BG_LIFE_S
  604. {
  605. HI_U8 u8WorkBgLife[3]; /*1# ~ 3# background vitality */
  606. HI_U8 u8CandiBgLife; /*Candidate background vitality */
  607. }IVE_BG_LIFE_S;
  608. typedef struct hiIVE_BG_MODEL_PIX_S
  609. {
  610. IVE_WORK_BG_PIX_S stWorkBgPixel; /*Working background */
  611. IVE_CANDI_BG_PIX_S stCandiPixel; /*Candidate background */
  612. IVE_BG_LIFE_S stBgLife; /*Background vitality */
  613. }IVE_BG_MODEL_PIX_S;
  614. typedef struct hiIVE_FG_STAT_DATA_S
  615. {
  616. HI_U32 u32PixNum;
  617. HI_U32 u32SumLum;
  618. HI_U8 u8Reserved[8];
  619. }IVE_FG_STAT_DATA_S;
  620. typedef struct hiIVE_BG_STAT_DATA_S
  621. {
  622. HI_U32 u32PixNum;
  623. HI_U32 u32SumLum;
  624. HI_U8 u8Reserved[8];
  625. }IVE_BG_STAT_DATA_S;
  626. typedef struct hiIVE_MATCH_BG_MODEL_CTRL_S
  627. {
  628. HI_U32 u32CurFrmNum; /*Current frame timestamp, in frame units */
  629. HI_U32 u32PreFrmNum; /*Previous frame timestamp, in frame units */
  630. HI_U16 u16TimeThr; /*Potential background replacement time threshold (range: 2 to 100 frames; default: 20) */
  631. HI_U8 u8DiffThrCrlCoef; /*Correlation coefficients between differential threshold and gray value (range: 0 to 5; default: 0) */
  632. HI_U8 u8DiffMaxThr; /*Maximum of background differential threshold (range: 3 to 15; default: 6) */
  633. HI_U8 u8DiffMinThr; /*Minimum of background differential threshold (range: 3 to 15; default: 4) */
  634. HI_U8 u8DiffThrInc; /*Dynamic Background differential threshold increment (range: 0 to 6; default: 0) */
  635. HI_U8 u8FastLearnRate; /*Quick background learning rate (range: 0 to 4; default: 2) */
  636. HI_U8 u8DetChgRegion; /*Whether to detect change region (range: 0 (no), 1 (yes); default: 0) */
  637. }IVE_MATCH_BG_MODEL_CTRL_S;
  638. typedef struct hiIVE_UPDATE_BG_MODEL_CTRL_S
  639. {
  640. HI_U32 u32CurFrmNum; /*Current frame timestamp, in frame units */
  641. HI_U32 u32PreChkTime; /*The last time when background status is checked */
  642. HI_U32 u32FrmChkPeriod; /*Background status checking period (range: 0 to 2000 frames; default: 50) */
  643. HI_U32 u32InitMinTime; /*Background initialization shortest time (range: 20 to 6000 frames; default: 100)*/
  644. HI_U32 u32StyBgMinBlendTime; /*Steady background integration shortest time (range: 20 to 6000 frames; default: 200)*/
  645. HI_U32 u32StyBgMaxBlendTime; /*Steady background integration longest time (range: 20 to 40000 frames; default: 1500)*/
  646. HI_U32 u32DynBgMinBlendTime; /*Dynamic background integration shortest time (range: 0 to 6000 frames; default: 0)*/
  647. HI_U32 u32StaticDetMinTime; /*Still detection shortest time (range: 20 to 6000 frames; default: 80)*/
  648. HI_U16 u16FgMaxFadeTime; /*Foreground disappearing longest time (range: 1 to 255 seconds; default: 15)*/
  649. HI_U16 u16BgMaxFadeTime; /*Background disappearing longest time (range: 1 to 255 seconds ; default: 60)*/
  650. HI_U8 u8StyBgAccTimeRateThr; /*Steady background access time ratio threshold (range: 10 to 100; default: 80)*/
  651. HI_U8 u8ChgBgAccTimeRateThr; /*Change background access time ratio threshold (range: 10 to 100; default: 60)*/
  652. HI_U8 u8DynBgAccTimeThr; /*Dynamic background access time ratio threshold (range: 0 to 50; default: 0)*/
  653. HI_U8 u8DynBgDepth; /*Dynamic background depth (range: 0 to 3; default: 3)*/
  654. HI_U8 u8BgEffStaRateThr; /*Background state time ratio threshold when initializing (range: 90 to 100; default: 90)*/
  655. HI_U8 u8AcceBgLearn; /*Whether to accelerate background learning (range: 0 (no), 1 (yes); default: 0)*/
  656. HI_U8 u8DetChgRegion; /*Whether to detect change region (range: 0 (no), 1 (yes); default: 0)*/
  657. } IVE_UPDATE_BG_MODEL_CTRL_S;
  658. typedef enum hiIVE_ANN_MLP_ACTIV_FUNC_E
  659. {
  660. IVE_ANN_MLP_ACTIV_FUNC_IDENTITY = 0x0,
  661. IVE_ANN_MLP_ACTIV_FUNC_SIGMOID_SYM = 0x1,
  662. IVE_ANN_MLP_ACTIV_FUNC_GAUSSIAN = 0x2,
  663. IVE_ANN_MLP_ACTIV_FUNC_BUTT
  664. }IVE_ANN_MLP_ACTIV_FUNC_E;
  665. typedef enum hiIVE_ANN_MLP_ACCURATE_E
  666. {
  667. IVE_ANN_MLP_ACCURATE_SRC16_WGT16 = 0x0, /*input decimals' accurate 16 bit, weight 16bit*/
  668. IVE_ANN_MLP_ACCURATE_SRC14_WGT20 = 0x1, /*input decimals' accurate 14 bit, weight 20bit*/
  669. IVE_ANN_MLP_ACCURATE_BUTT
  670. }IVE_ANN_MLP_ACCURATE_E;
  671. typedef struct hiIVE_ANN_MLP_MODEL_S
  672. {
  673. IVE_ANN_MLP_ACTIV_FUNC_E enActivFunc;
  674. IVE_ANN_MLP_ACCURATE_E enAccurate;
  675. IVE_MEM_INFO_S stWeight;
  676. HI_U32 u32TotalWeightSize;
  677. HI_U16 au16LayerCount[8]; /*8 layers, including input and output layer*/
  678. HI_U16 u16MaxCount; /*MaxCount<=1024*/
  679. HI_U8 u8LayerNum; /*2<layerNum<=8*/
  680. HI_U8 u8Reserved;
  681. }IVE_ANN_MLP_MODEL_S;
  682. typedef enum hiIVE_SVM_TYPE_E
  683. {
  684. IVE_SVM_TYPE_C_SVC = 0x0,
  685. IVE_SVM_TYPE_NU_SVC = 0x1,
  686. IVE_SVM_TYPE_BUTT
  687. }IVE_SVM_TYPE_E;
  688. typedef enum hiIVE_SVM_KERNEL_TYPE_E
  689. {
  690. IVE_SVM_KERNEL_TYPE_LINEAR = 0x0,
  691. IVE_SVM_KERNEL_TYPE_POLY = 0x1,
  692. IVE_SVM_KERNEL_TYPE_RBF = 0x2,
  693. IVE_SVM_KERNEL_TYPE_SIGMOID = 0x3,
  694. IVE_SVM_KERNEL_TYPE_BUTT
  695. }IVE_SVM_KERNEL_TYPE_E;
  696. typedef struct hiIVE_SVM_MODEL_S
  697. {
  698. IVE_SVM_TYPE_E enType;
  699. IVE_SVM_KERNEL_TYPE_E enKernelType;
  700. IVE_MEM_INFO_S stSv; /*SV memory*/
  701. IVE_MEM_INFO_S stDf; /*Decision functions memory*/
  702. HI_U32 u32TotalDfSize; /*All decision functions coef size in byte*/
  703. HI_U16 u16FeatureDim;
  704. HI_U16 u16SvTotal;
  705. HI_U8 u8ClassCount;
  706. }IVE_SVM_MODEL_S;
  707. /*
  708. * Sad mode
  709. */
  710. typedef enum hiIVE_SAD_MODE_E
  711. {
  712. IVE_SAD_MODE_MB_4X4 = 0x0, /*4x4*/
  713. IVE_SAD_MODE_MB_8X8 = 0x1, /*8x8*/
  714. IVE_SAD_MODE_MB_16X16 = 0x2, /*16x16*/
  715. IVE_SAD_MODE_BUTT
  716. }IVE_SAD_MODE_E;
  717. /*
  718. *Sad output ctrl
  719. */
  720. typedef enum hiIVE_SAD_OUT_CTRL_E
  721. {
  722. IVE_SAD_OUT_CTRL_16BIT_BOTH = 0x0, /*Output 16 bit sad and thresh*/
  723. IVE_SAD_OUT_CTRL_8BIT_BOTH = 0x1, /*Output 8 bit sad and thresh*/
  724. IVE_SAD_OUT_CTRL_16BIT_SAD = 0x2, /*Output 16 bit sad*/
  725. IVE_SAD_OUT_CTRL_8BIT_SAD = 0x3, /*Output 8 bit sad*/
  726. IVE_SAD_OUT_CTRL_THRESH = 0x4, /*Output thresh,16 bits sad */
  727. IVE_SAD_OUT_CTRL_BUTT
  728. }IVE_SAD_OUT_CTRL_E;
  729. /*
  730. * Sad ctrl param
  731. */
  732. typedef struct hiIVE_SAD_CTRL_S
  733. {
  734. IVE_SAD_MODE_E enMode;
  735. IVE_SAD_OUT_CTRL_E enOutCtrl;
  736. HI_U16 u16Thr; /*srcVal <= u16Thr, dstVal = minVal; srcVal > u16Thr, dstVal = maxVal.*/
  737. HI_U8 u8MinVal; /*Min value*/
  738. HI_U8 u8MaxVal; /*Max value*/
  739. }IVE_SAD_CTRL_S;
  740. /*
  741. * Resize zoom mode
  742. */
  743. typedef enum hiIVE_RESIZE_MODE_E
  744. {
  745. IVE_RESIZE_MODE_LINEAR = 0x0, /*Bilinear interpolation*/
  746. IVE_RESIZE_MODE_AREA = 0x1, /*Area-based (or super) interpolation*/
  747. IVE_RESIZE_MODE_BUTT
  748. }IVE_RESIZE_MODE_E;
  749. /*
  750. * Resize ctrl param
  751. */
  752. typedef struct hiIVE_RESIZE_CTRL_S
  753. {
  754. IVE_RESIZE_MODE_E enMode;
  755. IVE_MEM_INFO_S stMem;
  756. HI_U16 u16Num;
  757. }IVE_RESIZE_CTRL_S;
  758. /*
  759. * CNN active function mode
  760. */
  761. typedef enum hiIVE_CNN_ACTIV_FUNC_E
  762. {
  763. IVE_CNN_ACTIV_FUNC_NONE = 0x0, /*Do not taking a activation, equivalent f(x)=x*/
  764. IVE_CNN_ACTIV_FUNC_RELU = 0x1, /*f(x)=max(0, x)*/
  765. IVE_CNN_ACTIV_FUNC_SIGMOID = 0x2, /*f(x)=1/(1+exp(-x)), not support*/
  766. IVE_CNN_ACTIV_FUNC_BUTT
  767. }IVE_CNN_ACTIV_FUNC_E;
  768. /*
  769. * CNN pooling mode
  770. */
  771. typedef enum hiIVE_CNN_POOLING_E
  772. {
  773. IVE_CNN_POOLING_NONE =0x0, /*Do not taking a pooling action*/
  774. IVE_CNN_POOLING_MAX =0x1, /*Using max value of every pooling area*/
  775. IVE_CNN_POOLING_AVG =0x2, /*Using average value of every pooling area*/
  776. IVE_CNN_POOLING_BUTT
  777. }IVE_CNN_POOLING_E;
  778. /*
  779. * CNN Conv-ReLU-Pooling layer control parameters
  780. */
  781. typedef struct hiIVE_CNN_CONV_POOLING_S
  782. {
  783. IVE_CNN_ACTIV_FUNC_E enActivFunc; /*Type of activation function*/
  784. IVE_CNN_POOLING_E enPooling; /*Mode of pooling method*/
  785. HI_U8 u8FeatureMapNum; /*Number of feature maps*/
  786. HI_U8 u8KernelSize; /*Kernel size, only support 3 currently*/
  787. HI_U8 u8ConvStep; /*Convolution step, only support 1 currently*/
  788. HI_U8 u8PoolSize; /*Pooling size, only support 2 currently*/
  789. HI_U8 u8PoolStep; /*Pooling step, only support 2 currently*/
  790. HI_U8 u8Reserved[3];
  791. }IVE_CNN_CONV_POOLING_S;
  792. /*
  793. * CNN fully connected layer control parameters
  794. */
  795. typedef struct hiIVE_CNN_FULL_CONNECT_S
  796. {
  797. HI_U16 au16LayerCnt[8]; /*Neuron number of every fully connected layers*/
  798. HI_U16 u16MaxCnt; /*Max neuron number in all fully connected layers*/
  799. HI_U8 u8LayerNum; /*Number of fully connected layer*/
  800. HI_U8 u8Reserved;
  801. }IVE_CNN_FULL_CONNECT_S;
  802. /*
  803. * CNN model info
  804. */
  805. typedef struct hiIVE_CNN_MODEL_S
  806. {
  807. IVE_CNN_CONV_POOLING_S astConvPool[8]; /*Conv-ReLU-Pooling layers info*/
  808. IVE_CNN_FULL_CONNECT_S stFullConnect; /*Fully connected layers info*/
  809. IVE_MEM_INFO_S stConvKernelBias; /*Conv-ReLU-Pooling layers' kernels and bias*/
  810. HI_U32 u32ConvKernelBiasSize; /*Size of Conv-ReLU-Pooling layer' kernels and bias*/
  811. IVE_MEM_INFO_S stFCLWgtBias; /*Fully Connection Layers' weights and bias*/
  812. HI_U32 u32FCLWgtBiasSize; /*Size of fully connection layers weights and bias*/
  813. HI_U32 u32TotalMemSize; /*Total memory size of all kernels, weights, bias*/
  814. IVE_IMAGE_TYPE_E enType; /*Image type used for the CNN model*/
  815. HI_U32 u32Width; /*Image width used for the model*/
  816. HI_U32 u32Height; /*Image height used for the model*/
  817. HI_U16 u16ClassCount; /*Number of classes*/
  818. HI_U8 u8ConvPoolLayerNum; /*Number of Conv-ReLU-Pooling layers*/
  819. HI_U8 u8Reserved;
  820. }IVE_CNN_MODEL_S;
  821. /*
  822. * CNN ctrl param
  823. */
  824. typedef struct hiIVE_CNN_CTRL_S
  825. {
  826. IVE_MEM_INFO_S stMem; /*Assist memory*/
  827. HI_U32 u32Num; /*Input image number*/
  828. }IVE_CNN_CTRL_S;
  829. /*
  830. * CNN result struct
  831. */
  832. typedef struct hiIVE_CNN_RESULT_S
  833. {
  834. HI_S32 s32ClassIdx; /*The most possible index of the classification*/
  835. HI_S32 s32Confidence; /*The confidence of the classification*/
  836. }IVE_CNN_RESULT_S;
  837. #ifdef __cplusplus
  838. #if __cplusplus
  839. }
  840. #endif
  841. #endif
  842. #endif/*_HI_IVE_H_*/