mpi_ive.h 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  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 : 2011/05/16
  8. Description :
  9. 1.Date : 2011/05/16
  10. Modification: Created file
  11. 2.Date : 2013/07/01~2014/08/08
  12. Modification: Add MPI function
  13. ******************************************************************************/
  14. #ifndef _HI_MPI_IVE_H_
  15. #define _HI_MPI_IVE_H_
  16. #ifdef __cplusplus
  17. #if __cplusplus
  18. extern "C"{
  19. #endif
  20. #endif /* End of #ifdef __cplusplus */
  21. #include "hi_ive.h"
  22. /*****************************************************************************
  23. * Prototype : HI_MPI_IVE_DMA
  24. * Description : Direct memory access (DMA):
  25. * 1.Direct memory copy;
  26. * 2. Copy with interval bytes;
  27. * 3. Memset using 3 bytes;
  28. * 4. Memset using 8 bytes;
  29. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task.
  30. * IVE_DATA_S *pstSrc Input source data.The input data is treated as U8C1 data.
  31. * IVE_DATA_S *pstDst Output result data.
  32. * IVE_DMA_CTRL_S *pstDmaCtrl DMA control parameter.
  33. * HI_BOOL bInstant Flag indicating whether to generate an interrupt.
  34. * If the output result blocks the next operation,
  35. * set bInstant to HI_TRUE.
  36. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  37. * Spec : The size of the input data ranges from 32x1 pixels to 1920x1080 pixels.
  38. * The stride must be 16-byte-aligned.
  39. * History:
  40. *
  41. * 1. Date : 2011-05-16
  42. * Author :
  43. * Modification : Created function
  44. * 2. Data : 2013-07-19
  45. * Author :
  46. * Modification : Modify parameters
  47. *
  48. *****************************************************************************/
  49. HI_S32 HI_MPI_IVE_DMA(IVE_HANDLE *pIveHandle, IVE_DATA_S *pstSrc,
  50. IVE_DST_DATA_S *pstDst, IVE_DMA_CTRL_S *pstDmaCtrl,HI_BOOL bInstant);
  51. /*****************************************************************************
  52. * Prototype : HI_MPI_IVE_Filter
  53. * Description : 5x5 template filter.
  54. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  55. * IVE_SRC_IMAGE_S *pstSrc Input source data.
  56. * The U8C1,SP420 and SP422 input formats are supported.
  57. * IVE_DST_IMAGE_S *pstDst Output result, of same type with the input.
  58. * IVE_FILTER_CTRL_S *pstFltCtrl Control parameters of filter
  59. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  60. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  61. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  62. * The physical addresses of the input data and output data must be 16-byte-aligned.
  63. * The stride must be 16-pixel-aligned.
  64. * History:
  65. *
  66. * 1. Date : 2011-05-16
  67. * Author :
  68. * Modification : Created function
  69. * 2. Date : 2013-07-23
  70. * Author :
  71. * Modification : Modified function parameters
  72. *
  73. *****************************************************************************/
  74. HI_S32 HI_MPI_IVE_Filter(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  75. IVE_DST_IMAGE_S *pstDst, IVE_FILTER_CTRL_S *pstFltCtrl,HI_BOOL bInstant);
  76. /*****************************************************************************
  77. * Prototype : HI_MPI_IVE_CSC
  78. * Description : YUV2RGB\YUV2HSV\YUV2LAB\RGB2YUV color space conversion are supported.
  79. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  80. * IVE_SRC_IMAGE_S *pstSrc Input source data:
  81. * 1. SP420\SP422 type for YUV2RGB\YUV2HSV\YUV2LAB;
  82. * 2. U8C3_PACKAGE\U8C3_PLANAR type for RGB2YUV;
  83. * IVE_DST_IMAGE_S *pstDst Output result:
  84. * 1. U8C3_PACKAGE\U8C3_PLANAR typed for YUV2RGB\YUV2HSV\YUV2LAB;
  85. * 2. SP420\SP422 type for RGB2YUV;
  86. * IVE_CSC_CTRL_S *pstCscCtrl Control parameters for CSC
  87. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  88. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  89. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  90. * The physical addresses of the input data and output data must be 16-byte-aligned.
  91. * The stride must be 16-pixel-aligned.
  92. * History:
  93. *
  94. * 1. Date : 2011-05-16
  95. * Author :
  96. * Modification : Created function
  97. * 2. Date : 2013-08-09
  98. * Author :
  99. * Modification : Modified function
  100. *
  101. *****************************************************************************/
  102. HI_S32 HI_MPI_IVE_CSC(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  103. IVE_DST_IMAGE_S *pstDst, IVE_CSC_CTRL_S *pstCscCtrl, HI_BOOL bInstant);
  104. /*****************************************************************************
  105. * Prototype : HI_MPI_IVE_FILTER_AND_CSC
  106. * Description : Only support YUV2RGB color space conversion.
  107. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task.
  108. * IVE_SRC_IMAGE_S *pstSrc Input source data.Only SP420\SP422 type are supported.
  109. * IVE_DST_IMAGE_S *pstDst Output result.Only U8C3_PACKAGE\U8C3_PLANAR are supported.
  110. * IVE_FILTER_AND_CSC_CTRL_S *pstFltCscCtrl Control parameters.
  111. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  112. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  113. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  114. * The physical addresses of the input data and output data must be 16-byte-aligned.
  115. * The stride must be 16-pixel-aligned.
  116. * History:
  117. *
  118. * 1. Date : 2011-05-16
  119. * Author :
  120. * Modification : Created function
  121. * 2. Date : 2013-08-09
  122. * Author :
  123. * Modification : Modified function
  124. *
  125. *****************************************************************************/
  126. HI_S32 HI_MPI_IVE_FilterAndCSC(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  127. IVE_DST_IMAGE_S *pstDst, IVE_FILTER_AND_CSC_CTRL_S *pstFltCscCtrl, HI_BOOL bInstant);
  128. /*****************************************************************************
  129. * Prototype : HI_MPI_IVE_Sobel
  130. * Description : SOBEL is used to extract the gradient information.
  131. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  132. * IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U8C1 input image is supported.
  133. * IVE_DST_IMAGE_S *pstDstH The (horizontal) result of input image filtered by the input mask;
  134. * IVE_DST_IMAGE_S *pstDstV The (vertical) result of input image filtered by the transposed mask;
  135. * IVE_SOBEL_CTRL_S *pstSobelCtrl Control parameters
  136. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  137. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  138. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  139. * The physical addresses of the input data and output data must be 16-byte-aligned.
  140. * The stride must be 16-pixel-aligned.
  141. * History:
  142. *
  143. * 1. Date : 2011-05-16
  144. * Author :
  145. * Modification : Created function
  146. * 2. Date : 2013-07-23
  147. * Author :
  148. * Modification : Modified function parameters
  149. *
  150. *
  151. *****************************************************************************/
  152. HI_S32 HI_MPI_IVE_Sobel(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  153. IVE_DST_IMAGE_S *pstDstH, IVE_DST_IMAGE_S *pstDstV,
  154. IVE_SOBEL_CTRL_S *pstSobelCtrl, HI_BOOL bInstant);
  155. /*****************************************************************************
  156. * Prototype : HI_MPI_IVE_MagAndAng
  157. * Description : MagAndAng is used to extract the edge information.
  158. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  159. * IVE_SRC_INFO_S *pstSrc Input source data. Only the U8C1 input format is supported.
  160. * IVE_MEM_INFO_S *pstDstMag Output magnitude.
  161. * IVE_MEM_INFO_S *pstDstAng Output angle.
  162. * If the output mode is set to magnitude only,
  163. * this item can be set to null.
  164. * IVE_MAG_AND_ANG_CTRL_S *pstMagAndAngCtrl Control parameters
  165. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  166. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  167. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  168. * The physical addresses of the input data and output data must be 16-byte-aligned.
  169. * The stride must be 16-pixel-aligned.
  170. * History:
  171. *
  172. * 1. Date : 2011-05-16
  173. * Author :
  174. * Modification : Created function
  175. * 2. Date : 2013-07-17
  176. * Author :
  177. * Modification : Modified function and control parameter name
  178. * 3. Date : 2013-07-23
  179. * Author :
  180. * Modification : Modified function parameters
  181. *
  182. *****************************************************************************/
  183. HI_S32 HI_MPI_IVE_MagAndAng(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  184. IVE_DST_IMAGE_S *pstDstMag, IVE_DST_IMAGE_S *pstDstAng,
  185. IVE_MAG_AND_ANG_CTRL_S *pstMagAndAngCtrl, HI_BOOL bInstant);
  186. /*****************************************************************************
  187. * Prototype : HI_MPI_IVE_Dilate
  188. * Description : 5x5 template dilate. Only the U8C1 binary image input is supported.Or else the result is not expected.
  189. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  190. * IVE_SRC_IMAGE_S *pstSrc Input binary image, which consists of 0 or 255;
  191. * IVE_DST_IMAGE_S *pstDst Output result.
  192. * IVE_DILATE_CTRL_S *pstDilateCtrl Control parameters.
  193. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  194. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  195. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  196. * The physical addresses of the input data and output data must be 16-byte-aligned.
  197. * The stride must be 16-pixel-aligned.
  198. * The input value, output value, and mask value must be 0 or 255.
  199. * History:
  200. *
  201. * 1. Date : 2011-05-16
  202. * Author :
  203. * Modification : Created function
  204. * 2. Date : 2013-07-23
  205. * Author :
  206. * Modification : Modified parameters
  207. *
  208. *****************************************************************************/
  209. HI_S32 HI_MPI_IVE_Dilate(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  210. IVE_DST_IMAGE_S *pstDst, IVE_DILATE_CTRL_S *pstDilateCtrl,HI_BOOL bInstant);
  211. /*****************************************************************************
  212. * Prototype : HI_MPI_IVE_Erode
  213. * Parameters : 5x5 template erode. Only the U8C1 binary image input is supported.Or else the result is not correct.
  214. * Input : IVE_HANDLE *pIveHandle Returned handle ID of a task
  215. * IVE_SRC_IMAGE_S *pstSrc Input binary image, which consists of 0 or 255;
  216. * IVE_DST_IMAGE_S *pstDst Output result.
  217. * IVE_ERODE_CTRL_S *pstErodeCtrl Control parameters
  218. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  219. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  220. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  221. * The physical addresses of the input data and output data must be 16-byte-aligned.
  222. * The stride must be 16-pixel-aligned.
  223. * The input value, output value, and mask value must be 0 or 255.
  224. * History:
  225. *
  226. * 1. Date : 2011-05-16
  227. * Author :
  228. * Modification : Created function
  229. * 2. Date : 2013-07-23
  230. * Author :
  231. * Modification : Modified parameters
  232. *
  233. *****************************************************************************/
  234. HI_S32 HI_MPI_IVE_Erode(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  235. IVE_DST_IMAGE_S *pstDst, IVE_ERODE_CTRL_S *pstErodeCtrl,HI_BOOL bInstant);
  236. /*****************************************************************************
  237. * Prototype : HI_MPI_IVE_Thresh
  238. * Description : Thresh operation to the input image.
  239. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  240. * IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U8C1 input format is supported.
  241. * IVE_DST_IMAGE_S *pstDst Output result
  242. * IVE_THRESH_CTRL_S *pstThrCtrl Control parameters
  243. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  244. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  245. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  246. * The stride must be 16-pixel-aligned.
  247. * History:
  248. *
  249. * 1. Date : 2011-05-16
  250. * Author :
  251. * Modification : Created function
  252. * 2. Date : 2013-07-23
  253. * Author :
  254. * Modification : Modification
  255. *
  256. *****************************************************************************/
  257. HI_S32 HI_MPI_IVE_Thresh(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  258. IVE_DST_IMAGE_S *pstDst, IVE_THRESH_CTRL_S *pstThrCtrl, HI_BOOL bInstant);
  259. /*****************************************************************************
  260. * Prototype : HI_MPI_IVE_And
  261. * Description : Binary images' And operation.
  262. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  263. * IVE_SRC_IMAGE_S *pstSrc1 The input source1. Only U8C1 input format is supported.
  264. * IVE_SRC_IMAGE_S *pstSrc2 The input source2.Only U8C1 input format is supported.
  265. * IVE_DST_IMAGE_S *pstDst Output result of " src1 & src2 ".
  266. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  267. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  268. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  269. * The stride must be 16-pixel-aligned.
  270. * The types, widths, heights of two input sources must be the same.
  271. * History:
  272. *
  273. * 1. Date : 2011-05-16
  274. * Author :
  275. * Modification : Created function
  276. *
  277. *****************************************************************************/
  278. HI_S32 HI_MPI_IVE_And(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  279. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst, HI_BOOL bInstant);
  280. /*****************************************************************************
  281. * Prototype : HI_MPI_IVE_Sub
  282. * Description : Two gray images' Sub operation.
  283. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  284. * IVE_SRC_IMAGE_S *pstSrc1 Minuend of the input source.Only the U8C1 input format is supported.
  285. * IVE_SRC_IMAGE_S *pstSrc2 Subtrahend of the input source.Only the U8C1 input format is supported.
  286. * IVE_DST_IMAGE_S *pstDst Output result of src1 minus src2
  287. * IVE_SUB_CTRL_S *pstSubCtrl Control parameter
  288. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  289. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  290. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  291. * The stride must be 16-pixel-aligned.
  292. * The types, widths, heights of two input sources must be the same.
  293. * History:
  294. *
  295. * 1. Date : 2011-05-16
  296. * Author :
  297. * Modification : Created function
  298. * 2. Date : 2013-08-09
  299. * Author :
  300. * Modification : Modified function parameter
  301. *
  302. *****************************************************************************/
  303. HI_S32 HI_MPI_IVE_Sub(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  304. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst, IVE_SUB_CTRL_S *pstSubCtrl, HI_BOOL bInstant);
  305. /*****************************************************************************
  306. * Prototype : HI_MPI_IVE_Or
  307. * Description : Two binary images' Or operation.
  308. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  309. * IVE_SRC_IMAGE_S *pstSrc1 Input source1. Only the U8C1 input format is supported.
  310. * IVE_SRC_IMAGE_S *pstSrc2 Input source2. Only the U8C1 input format is supported.
  311. * IVE_DST_IMAGE_S *pstDst Output result src1 or src2
  312. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  313. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  314. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  315. * The stride must be 16-pixel-aligned.
  316. * The types, widths, heights of two input sources must be the same.
  317. * History:
  318. *
  319. * 1. Date : 2011-05-16
  320. * Author :
  321. * Modification : Created function
  322. * 2. Date : 2013-08-09
  323. * Author :
  324. * Modification : Modified function parameter
  325. *
  326. *****************************************************************************/
  327. HI_S32 HI_MPI_IVE_Or(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  328. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst, HI_BOOL bInstant);
  329. /*****************************************************************************
  330. * Prototype : HI_MPI_IVE_INTEG
  331. * Description : Calculate the input gray image's integral image.
  332. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  333. * IVE_SRC_IMAGE_S *pstSrc Input source data.Only the U8C1 input format is supported.
  334. * IVE_DST_IMAGE_S *pstDst Output result.Can be U32C1 or U64C1, relied on the control parameter.
  335. * IVE_INTEG_CTRL_S *pstIntegCtrl Integ Control
  336. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  337. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  338. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  339. * The physical addresses of the input data and output data must be 16-byte-aligned.
  340. * The stride must be 16-pixel-aligned.
  341. * The pixel can be 32bit or 64 bit relied on the control parameter.
  342. * History:
  343. *
  344. * 1. Date : 2011-05-16
  345. * Author :
  346. * Modification : Created function
  347. * 2. Date : 2013-03-18
  348. * Author :
  349. * Modification : Modified function
  350. * 3. Date : 2013-07-15
  351. * Author :
  352. * Modification : Modified function
  353. * Spec : Modify IVE_INTEG_OUT_FMT_E to IVE_INTEG_CTRL_S
  354. * 4. Date : 2013-07-23
  355. * Author :
  356. * Modification : Modified parameters
  357. *
  358. *****************************************************************************/
  359. HI_S32 HI_MPI_IVE_Integ(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  360. IVE_DST_IMAGE_S *pstDst, IVE_INTEG_CTRL_S *pstIntegCtrl, HI_BOOL bInstant);
  361. /*****************************************************************************
  362. * Prototype : HI_MPI_IVE_Hist
  363. * Description : Calculate the input gray image's histogram.
  364. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  365. * IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U8C1 input format is supported.
  366. * IVE_DST_MEM_INFO_S *pstDst Output result.
  367. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  368. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  369. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  370. * The physical addresses of the input data and output data must be 16-byte-aligned.
  371. * The stride must be 16-pixel-aligned.
  372. * History:
  373. *
  374. * 1. Date : 2011-05-16
  375. * Author :
  376. * Modification : Created function
  377. *
  378. *****************************************************************************/
  379. HI_S32 HI_MPI_IVE_Hist(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  380. IVE_DST_MEM_INFO_S *pstDst, HI_BOOL bInstant);
  381. /*****************************************************************************
  382. * Prototype : HI_MPI_IVE_Thresh_S16
  383. * Description : S16 image's THRESH operation.
  384. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  385. * IVE_SRC_IMAGE_S *pstSrc Input source data.Only the S16 input format is supported.
  386. * IVE_DST_IMAGE_S *pstDst Output result.
  387. * IVE_THRESH_S16_CTRL_S *pstThrS16Ctrl Control parameters
  388. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  389. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  390. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  391. * The physical addresses of the input data must be 2-byte-aligned.
  392. * The stride must be 16-pixel-aligned.
  393. * History:
  394. *
  395. * 1. Date : 2013-05-16
  396. * Author :
  397. * Modification : Created function
  398. *
  399. *****************************************************************************/
  400. HI_S32 HI_MPI_IVE_Thresh_S16(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  401. IVE_DST_IMAGE_S *pstDst, IVE_THRESH_S16_CTRL_S *pstThrS16Ctrl, HI_BOOL bInstant);
  402. /*****************************************************************************
  403. * Prototype : HI_MPI_IVE_Thresh_U16
  404. * Description : U16 image's THRESH operation.
  405. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  406. * IVE_SRC_IMAGE_S *pstSrc Input source data. Only the U16 input format is supported.
  407. * IVE_DST_IMAGE_S *pstDst Output result
  408. * IVE_THRESH_U16_CTRL_S *pstThrU16Ctrl Control parameters
  409. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  410. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  411. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  412. * The physical addresses of the input data must be 2-byte-aligned.
  413. * The stride must be 16-pixel-aligned.
  414. * History:
  415. *
  416. * 1. Date : 2013-05-16
  417. * Author :
  418. * Modification : Created function
  419. * 2. Date : 2013-08-07
  420. * Author :
  421. * Modification : Implement function
  422. *
  423. *****************************************************************************/
  424. HI_S32 HI_MPI_IVE_Thresh_U16(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  425. IVE_DST_IMAGE_S *pstDst, IVE_THRESH_U16_CTRL_S *pstThrU16Ctrl, HI_BOOL bInstant);
  426. /*****************************************************************************
  427. * Prototype : HI_MPI_IVE_16BitTo8Bit
  428. * Description : Scale the input 16bit data to the output 8bit data.
  429. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  430. * IVE_SRC_IMAGE_S *pstSrc Input source data.Only U16C1\S16C1 input is supported.
  431. * IVE_DST_IMAGE_S *pstDst Output result
  432. * IVE_16BITTO8BIT_CTRL_S *pst16BitTo8BitCtrl control parameter
  433. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  434. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  435. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  436. * The physical addresses of the input data must be 2-byte-aligned.
  437. * The stride must be 16-pixel-aligned.
  438. * History:
  439. *
  440. * 1. Date : 2013-08-12
  441. * Author :
  442. * Modification : Created function
  443. *
  444. *****************************************************************************/
  445. HI_S32 HI_MPI_IVE_16BitTo8Bit(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  446. IVE_DST_IMAGE_S *pstDst, IVE_16BIT_TO_8BIT_CTRL_S *pst16BitTo8BitCtrl, HI_BOOL bInstant);
  447. /*****************************************************************************
  448. * Prototype : HI_MPI_IVE_OrdStatFilter
  449. * Description : Order Statistic Filter. It can be used as median\max\min value filter.
  450. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  451. * IVE_SRC_IMAGE_S *pstSrc Input source data. Only U8C1 input is supported
  452. * IVE_DST_IMAGE_S *pstDst Output result
  453. * IVE_ORD_STAT_FILTER_CTRL_S *pstOrdStatFltCtrl Control parameter
  454. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  455. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  456. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  457. * The physical addresses of the input data and output data must be 16-byte-aligned.
  458. * The stride must be 16-pixel-aligned.
  459. * History:
  460. *
  461. * 1. Date : 2013-08-12
  462. * Author :
  463. * Modification : Created function
  464. *
  465. *****************************************************************************/
  466. HI_S32 HI_MPI_IVE_OrdStatFilter(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  467. IVE_DST_IMAGE_S *pstDst, IVE_ORD_STAT_FILTER_CTRL_S *pstOrdStatFltCtrl, HI_BOOL bInstant);
  468. /*****************************************************************************
  469. * Prototype : HI_MPI_IVE_Map
  470. * Description : Map a image to another through a lookup table.
  471. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  472. * IVE_SRC_IMAGE_S *pstSrc Input source. Only the U8C1 input format is supported.
  473. * IVE_SRC_MEM_INFO_S *pstMap Input lookup table. Must be an U8 array of size 256.
  474. * IVE_DST_IMAGE_S *pstDst Output result.
  475. * IVE_MAP_CTRL_S *pstMapCtrl Map control parameter.
  476. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  477. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  478. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  479. * The physical addresses of the input data and output data must be 16-byte-aligned.
  480. * The stride must be 16-pixel-aligned.
  481. * History:
  482. *
  483. * 1. Date : 2013-08-17
  484. * Author :
  485. * Modification : Created function
  486. * 2. Date : 2015-03-02
  487. * Author :
  488. * Modification : Add s16/u16 map
  489. *
  490. *****************************************************************************/
  491. HI_S32 HI_MPI_IVE_Map(IVE_HANDLE *pIveHandle,IVE_SRC_IMAGE_S *pstSrc,
  492. IVE_SRC_MEM_INFO_S *pstMap, IVE_DST_IMAGE_S *pstDst,IVE_MAP_CTRL_S *pstMapCtrl,HI_BOOL bInstant);
  493. /*****************************************************************************
  494. * Prototype : HI_MPI_IVE_EqualizeHist
  495. * Description : Enhance the input image's contrast through histogram equalization.
  496. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  497. * IVE_SRC_IMAGE_S *pstSrc Input source.Only U8C1 input format is supported.
  498. * IVE_DST_IMAGE_S *pstDst Output result.
  499. * IVE_EQUALIZEHIST_CTRL_S *pstEqualizeHistCtrl EqualizeHist control parameter.
  500. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  501. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  502. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  503. * The physical addresses of map data must be 16-byte-aligned.
  504. * The stride must be 16-pixel-aligned.
  505. * History:
  506. *
  507. * 1. Date : 2013-07-17
  508. * Author :
  509. * Modification : Created function
  510. *
  511. *****************************************************************************/
  512. HI_S32 HI_MPI_IVE_EqualizeHist(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  513. IVE_DST_IMAGE_S *pstDst, IVE_EQUALIZE_HIST_CTRL_S *pstEqualizeHistCtrl, HI_BOOL bInstant);
  514. /*****************************************************************************
  515. * Prototype : HI_MPI_IVE_Add
  516. * Description : Two gray images' Add operation.
  517. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  518. * IVE_SRC_IMAGE_S *pstSrc1 Augend of the input source.Only the U8C1 input format is supported.
  519. * IVE_SRC_IMAGE_S *pstSrc2 Addend of the input source.Only the U8C1 input format is supported.
  520. * IVE_DST_IMAGE_S *pstDst Output result of src1 plus src2
  521. * IVE_ADD_CTRL_S *pstAddCtrl Control parameter
  522. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  523. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  524. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  525. * The stride must be 16-pixel-aligned.
  526. * The types, widths, heights of two input sources must be the same.
  527. * History:
  528. *
  529. * 1. Date : 2013-07-17
  530. * Author :
  531. * Modification : Created function
  532. *
  533. *****************************************************************************/
  534. HI_S32 HI_MPI_IVE_Add(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  535. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst, IVE_ADD_CTRL_S *pstAddCtrl, HI_BOOL bInstant);
  536. /*****************************************************************************
  537. * Prototype : HI_MPI_IVE_Xor
  538. * Description : Two binary images' Xor operation.
  539. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  540. * IVE_SRC_IMAGE_S *pstSrc1 The input source1.Only the U8C1 input format is supported.
  541. * IVE_SRC_IMAGE_S *pstSrc2 The input source2.
  542. * IVE_DST_IMAGE_S *pstDst Output result
  543. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  544. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  545. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  546. * The stride must be 16-pixel-aligned.
  547. * The types, widths, heights of two input sources must be the same.
  548. * History:
  549. *
  550. * 1. Date : 2013-07-17
  551. * Author :
  552. * Modification : Created function
  553. *
  554. *****************************************************************************/
  555. HI_S32 HI_MPI_IVE_Xor(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  556. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstDst, HI_BOOL bInstant);
  557. /*****************************************************************************
  558. * Prototype : HI_MPI_IVE_NCC
  559. * Description : Calculate two gray images' NCC (Normalized Cross Correlation).
  560. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  561. * IVE_SRC_IMAGE_S *pstSrc1 Input source1. Only the U8C1 input format is supported.
  562. * IVE_SRC_IMAGE_S *pstSrc2 Input source2. Must be of the same type, size of source1.
  563. * IVE_DST_MEM_INFO_S *pstDst Output result
  564. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  565. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  566. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  567. * The physical addresses of output data must be 16-byte-aligned.
  568. * The stride must be 16-pixel-aligned.
  569. * History:
  570. *
  571. * 1. Date : 2013-08-16
  572. * Author :
  573. * Modification : Created function
  574. *
  575. *****************************************************************************/
  576. HI_S32 HI_MPI_IVE_NCC(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  577. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_MEM_INFO_S *pstDst, HI_BOOL bInstant);
  578. /*****************************************************************************
  579. * Prototype : HI_MPI_IVE_CCL
  580. * Description : Connected Component Labeling. Only 8-Connected method is supported.
  581. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  582. * IVE_IMAGE_S *pstSrcDst Input source
  583. * IVE_MEM_INFO_S *pstBlob Output result of detected region;
  584. * IVE_CCL_CTRL_S *pstCclCtrl CCL control parameter
  585. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  586. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  587. * Spec : The size of the input data ranges from 64x64 pixels to 720x640 pixels.
  588. * The physical addresses of the input data and output data must be 16-byte-aligned.
  589. * The stride must be 16-pixel-aligned.
  590. * History:
  591. *
  592. * 1. Date : 2013-08-1
  593. * Author :
  594. * Modification : Created function
  595. *****************************************************************************/
  596. HI_S32 HI_MPI_IVE_CCL(IVE_HANDLE *pIveHandle, IVE_IMAGE_S *pstSrcDst,
  597. IVE_DST_MEM_INFO_S *pstBlob, IVE_CCL_CTRL_S *pstCclCtrl, HI_BOOL bInstant);
  598. /*****************************************************************************
  599. * Prototype : HI_MPI_IVE_GMM
  600. * Description : Separate foreground and background using GMM(Gaussian Mixture Model) method;
  601. * Gray or RGB GMM are supported.
  602. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  603. * IVE_SRC_IMAGE_S *pstSrc Input source. Only support U8C1 or U8C3_PACKAGE input.
  604. * IVE_DST_IMAGE_S *pstFg Output foreground (Binary) image.
  605. * IVE_DST_IMAGE_S *pstBg Output background image. Of the sampe type of pstSrc.
  606. * IVE_MEM_INFO_S *pstModel Model data.
  607. * IVE_GMM_CTRL_S *pstGmmCtrl Control parameter.
  608. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  609. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  610. * Spec : The size of the input data ranges from 64x64 pixels to 720x576 pixels.
  611. * The physical addresses of the input data and output data must be 16-byte-aligned.
  612. * The stride must be 16-pixel-aligned.
  613. * History:
  614. *
  615. * 1. Date : 2013-08-07
  616. * Author :
  617. * Modification : Created function
  618. *****************************************************************************/
  619. HI_S32 HI_MPI_IVE_GMM(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstFg,
  620. IVE_DST_IMAGE_S *pstBg, IVE_MEM_INFO_S *pstModel, IVE_GMM_CTRL_S *pstGmmCtrl, HI_BOOL bInstant);
  621. /*****************************************************************************
  622. * Prototype : HI_MPI_IVE_GMM2
  623. * Description : Separate foreground and background using GMM(Gaussian Mixture Model) method;
  624. * Gray or RGB GMM are supported.
  625. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  626. * IVE_SRC_IMAGE_S *pstSrc Only U8C1 or U8C3_PACKAGE input are supported.
  627. * IVE_SRC_IMAGE_S *pstFactor U16C1 input, low-8bits is sensitivity factor, and high-8bits is life update factor.
  628. * IVE_DST_IMAGE_S *pstFg Output foreground (Binary) image.
  629. * IVE_DST_IMAGE_S *pstBg Output background image. With same type of pstSrc.
  630. * IVE_DST_IMAGE_S *pstMatchModelInfo Output U8C1 match model info image. Low-1bit is match flag,and high-7bits is max freq index.
  631. * IVE_MEM_INFO_S *pstModel Model data.
  632. * IVE_GMM2_CTRL_S *pstGmm2Ctrl Control parameter.
  633. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  634. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  635. * Spec : The size of the input data ranges from 64x64 pixels to 1280x720 pixels.
  636. * The physical addresses of the input data and output data must be 16-byte-aligned.
  637. * The stride must be 16-pixel-aligned.
  638. * History:
  639. *
  640. * 1. Date : 2015-04-16
  641. * Author :
  642. * Modification : Created function
  643. *****************************************************************************/
  644. HI_S32 HI_MPI_IVE_GMM2(IVE_HANDLE *pIveHandle,IVE_SRC_IMAGE_S *pstSrc,IVE_SRC_IMAGE_S *pstFactor,
  645. IVE_DST_IMAGE_S *pstFg,IVE_DST_IMAGE_S *pstBg,IVE_DST_IMAGE_S *pstMatchModelInfo,
  646. IVE_MEM_INFO_S *pstModel,IVE_GMM2_CTRL_S *pstGmm2Ctrl,HI_BOOL bInstant);
  647. /*****************************************************************************
  648. * Prototype : HI_MPI_IVE_CannyHysEdge
  649. * Description : The first part of canny Edge detection. Including step: gradient calculation,
  650. * magnitude and angle calculation, hysteresis threshold, NMS(Non-Maximum Suppression)
  651. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  652. * IVE_SRC_IMAGE_S *pstSrc Input source. Only the U8C1 input format is supported
  653. * IVE_DST_IMAGE_S *pstEdge Output result.
  654. * IVE_DST_MEM_INFO_S *pstStack OutPut stack for CannyEdge
  655. * IVE_CANNY_HYS_EDGE_CTRL_S *pstCannyHysEdgeCtrl Control parameter.
  656. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  657. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  658. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  659. * The physical addresses of the input data and output data must be 16-byte-aligned. .
  660. * The stride must be 16-pixel-aligned.
  661. * History:
  662. *
  663. * 1. Date : 2013-08-12
  664. * Author :
  665. * Modification : Created function
  666. *
  667. *****************************************************************************/
  668. HI_S32 HI_MPI_IVE_CannyHysEdge(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstEdge,
  669. IVE_DST_MEM_INFO_S *pstStack, IVE_CANNY_HYS_EDGE_CTRL_S *pstCannyHysEdgeCtrl, HI_BOOL bInstant);
  670. /*****************************************************************************
  671. * Prototype : HI_MPI_IVE_CannyEdge
  672. * Description : The second part of canny Edge detection: trace strong edge by weak edge.
  673. * Parameters : IVE_IMAGE_S *pstEdge Input and Output source. Only the U8C1 format is supported
  674. * IVE_MEM_INFO_S *pstStack stack for CannyEdge
  675. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  676. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  677. * The physical addresses of the input data and output data must be 16-byte-aligned.
  678. * The stride must be 16-pixel-aligned.
  679. * History:
  680. *
  681. * 1. Date : 2013-08-12
  682. * Author :
  683. * Modification : Created function
  684. *
  685. *****************************************************************************/
  686. HI_S32 HI_MPI_IVE_CannyEdge(IVE_IMAGE_S *pstEdge, IVE_MEM_INFO_S *pstStack);
  687. /*****************************************************************************
  688. * Prototype : HI_MPI_IVE_LBP
  689. * Description : LBP calculation using the original method and a extensional method.
  690. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  691. * IVE_SRC_IMAGE_S *pstSrc Input source.Only the U8C1 inpu format is supported.
  692. * IVE_DST_IMAGE_S *pstDst Output result
  693. * IVE_LBP_CTRL_S *pstLbpCtrl Control parameter
  694. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  695. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  696. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  697. * The physical addresses of the input data and output data must be 16-byte-aligned.
  698. * The stride must be 16-pixel-aligned.
  699. * History:
  700. *
  701. * 1. Date : 2013-09-22
  702. * Author :
  703. * Modification : Created function
  704. *
  705. *****************************************************************************/
  706. HI_S32 HI_MPI_IVE_LBP(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  707. IVE_DST_IMAGE_S *pstDst, IVE_LBP_CTRL_S *pstLbpCtrl, HI_BOOL bInstant);
  708. /*****************************************************************************
  709. * Prototype : HI_MPI_IVE_NormGrad
  710. * Description : Gradient calculation and the output is normalized to S8.
  711. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  712. * IVE_SRC_IMAGE_S *pstSrc Input source data
  713. * IVE_DST_IMAGE_S *pstDstH The (horizontal) result of input image filtered by the input mask;
  714. * IVE_DST_IMAGE_S *pstDstV The (vertical) result of input image filtered by the transposed mask;
  715. * IVE_DST_IMAGE_S *pstDstHV Output the horizontal and vertical component in single image in package format.
  716. * IVE_NORM_GRAD_CTRL_S *pstNormGradCtrl Control parameter
  717. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  718. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  719. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1024 pixels.
  720. * The physical addresses of the input data and output data must be 16-byte-aligned.
  721. * The stride must be 16-pixel-aligned.
  722. * History:
  723. *
  724. * 1. Date : 2013-08-12
  725. * Author :
  726. * Modification : Created function
  727. *
  728. *****************************************************************************/
  729. HI_S32 HI_MPI_IVE_NormGrad(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc,
  730. IVE_DST_IMAGE_S *pstDstH, IVE_DST_IMAGE_S *pstDstV, IVE_DST_IMAGE_S *pstDstHV,
  731. IVE_NORM_GRAD_CTRL_S *pstNormGradCtrl, HI_BOOL bInstant);
  732. /*****************************************************************************
  733. * Prototype : HI_MPI_IVE_LKOpticalFlowPyr
  734. * Description : Calculate LK Optical Flow using multi-layer of the pyramid-images.
  735. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  736. * IVE_SRC_IMAGE_S astSrcPrevPyr Prev-frame's pyramid. Must be U8C1 images.
  737. * IVE_SRC_IMAGE_S astSrcNextPyr Next-frame's pyramid. Same size and type with astSrcPrePyr.
  738. * IVE_SRC_MEM_INFO_S *pstPrevPts Intresting points on astSrcPrePyr[0].
  739. * IVE_MEM_INFO_S *pstNextPts Output points. When bUseInitFlow is true, must have the same
  740. * size of pstPrevPts as input.
  741. * IVE_LK_OPTICAL_FLOW_PYR_CTRL_S *pstLkOptiFlowCtrl Control parameters.
  742. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  743. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  744. * Spec : The size of the input data ranges from 64x64 pixels to 1280x720 pixels.
  745. * The physical addresses of the input data and output data must be 16-byte-aligned.
  746. * The stride must be 16-pixel-aligned.
  747. * History:
  748. *
  749. * 1. Date : 2015-03-20
  750. * Author :
  751. * Modification : Created function
  752. ****************************************************************************/
  753. HI_S32 HI_MPI_IVE_LKOpticalFlowPyr(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S astSrcPrevPyr[], IVE_SRC_IMAGE_S astSrcNextPyr[],
  754. IVE_SRC_MEM_INFO_S *pstPrevPts, IVE_MEM_INFO_S *pstNextPts, IVE_DST_MEM_INFO_S *pstStatus, IVE_DST_MEM_INFO_S *pstErr,
  755. IVE_LK_OPTICAL_FLOW_PYR_CTRL_S *pstLkOptiFlowPyrCtrl, HI_BOOL bInstant);
  756. /*****************************************************************************
  757. * Prototype : HI_MPI_IVE_STCandiCorner
  758. * Description : The first part of corners detection using Shi-Tomasi-like method: calculate candidate corners.
  759. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  760. * IVE_SRC_IMAGE_S *pstSrc Input source data
  761. * IVE_DST_IMAGE_S *pstCandiCorner Output result of eig
  762. * IVE_ST_CANDI_CORNER_CTRL_S *pstStCandiCornerCtrl Control parameter
  763. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  764. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  765. * Spec : The size of the input data ranges from 64x64 pixels to 720x576 pixels.
  766. * The physical addresses of the input data and output data must be 16-byte-aligned.
  767. * The stride must be 16-pixel-aligned.
  768. * History:
  769. *
  770. * 1. Date : 2013-09-16
  771. * Author :
  772. * Modification : Created function
  773. *
  774. *****************************************************************************/
  775. HI_S32 HI_MPI_IVE_STCandiCorner(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc, IVE_DST_IMAGE_S *pstCandiCorner,
  776. IVE_ST_CANDI_CORNER_CTRL_S *pstStCandiCornerCtrl, HI_BOOL bInstant);
  777. /*****************************************************************************
  778. * Prototype : HI_MPI_IVE_STCorner
  779. * Description : The second part of corners detection using Shi-Tomasi-like method: select corners by certain rules.
  780. * IVE_SRC_IMAGE_S *pstCandiCorner Input source data
  781. * IVE_DST_MEM_INFO_S *pstCorner Output result of Corner
  782. * IVE_ST_CORNER_CTRL_S *pstStCornerCtrl Control parameter
  783. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  784. * Spec : The size of the input data ranges from 64x64 pixels to 720x576 pixels.
  785. * The physical addresses of the input data and output data must be 16-byte-aligned.
  786. * The stride must be 16-pixel-aligned.
  787. * History:
  788. *
  789. * 1. Date : 2013-09-16
  790. * Author :
  791. * Modification : Created function
  792. *
  793. *****************************************************************************/
  794. HI_S32 HI_MPI_IVE_STCorner(IVE_SRC_IMAGE_S * pstCandiCorner, IVE_DST_MEM_INFO_S *pstCorner,
  795. IVE_ST_CORNER_CTRL_S *pstStCornerCtrl);
  796. /*****************************************************************************
  797. * Prototype : HI_MPI_IVE_GradFg
  798. * Description :
  799. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  800. * IVE_SRC_IMAGE_S *pstBgDiffFg Background subtraction foreground image
  801. * IVE_SRC_IMAGE_S *pstCurGrad Current gradient image, both horizontally and vertically
  802. * graded in accordance with [xyxyxy ...] format
  803. * IVE_SRC_IMAGE_S *pstBgGrad Background gradient image
  804. * IVE_DST_IMAGE_S *pstGradFg Gradient foreground image
  805. * IVE_GRAD_FG_CTRL_S *pstGradFgCtrl Gradient calculation parameters
  806. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  807. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  808. * Spec :
  809. * History:
  810. *
  811. * 1. Date : 2013-10-29
  812. * Author :
  813. * Modification : Created function
  814. *
  815. *****************************************************************************/
  816. HI_S32 HI_MPI_IVE_GradFg(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstBgDiffFg, IVE_SRC_IMAGE_S *pstCurGrad,
  817. IVE_SRC_IMAGE_S *pstBgGrad, IVE_DST_IMAGE_S *pstGradFg, IVE_GRAD_FG_CTRL_S *pstGradFgCtrl, HI_BOOL bInstant);
  818. /*****************************************************************************
  819. * Prototype : HI_MPI_IVE_MatchBgModel
  820. * Description :
  821. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  822. * IVE_SRC_IMAGE_S *pstCurImg Current grayscale image
  823. * IVE_DATA_S *pstBgModel Background model data
  824. * IVE_IMAGE_S *pstFgFlag Foreground status image
  825. * IVE_DST_IMAGE_S *pstBgDiffFg Foreground image obtained by background matching,
  826. * the background pixel value is 0, the foreground pixel
  827. * value is the gray difference value
  828. * IVE_DST_IMAGE_S *pstFrmDiffFg Foreground image obtained by interframe difference,
  829. * the background pixel value is 0, the foreground pixel
  830. * value is the gray difference value
  831. * IVE_DST_MEM_INFO_S *pstStatData result status data
  832. * IVE_MATCH_BG_MODEL_CTRL_S *pstMatchBgModelCtrl Background matching parameters
  833. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  834. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  835. * Spec :
  836. * History:
  837. *
  838. * 1. Date : 2013-10-29
  839. * Author :
  840. * Modification : Created function
  841. *
  842. *****************************************************************************/
  843. HI_S32 HI_MPI_IVE_MatchBgModel(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstCurImg, IVE_DATA_S *pstBgModel,
  844. IVE_IMAGE_S *pstFgFlag, IVE_DST_IMAGE_S *pstBgDiffFg, IVE_DST_IMAGE_S *pstFrmDiffFg, IVE_DST_MEM_INFO_S *pstStatData,
  845. IVE_MATCH_BG_MODEL_CTRL_S *pstMatchBgModelCtrl, HI_BOOL bInstant);
  846. /*****************************************************************************
  847. * Prototype : HI_MPI_IVE_UpdateBgModel
  848. * Description :
  849. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  850. * IVE_DATA_S *pstBgModel Background model data
  851. * IVE_IMAGE_S *pstFgFlag Foreground status image
  852. * IVE_DST_IMAGE_S *pstBgImg Background grayscale image
  853. * IVE_DST_IMAGE_S *pstChgStaImg Change state life image, for still detection
  854. * IVE_DST_IMAGE_S *pstChgStaFg Change state grayscale image, for still detection
  855. * IVE_DST_IMAGE_S *pstChgStaLife Change state foreground image, for still detection
  856. * IVE_DST_MEM_INFO_S *pstStatData result status data
  857. * IVE_UPDATE_BG_MODEL_CTRL_S *pstUpdateBgModelCtrl Background update parameters
  858. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  859. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  860. * Spec :
  861. * History:
  862. *
  863. * 1. Date : 2013-10-29
  864. * Author :
  865. * Modification : Created function
  866. *
  867. *****************************************************************************/
  868. HI_S32 HI_MPI_IVE_UpdateBgModel(IVE_HANDLE *pIveHandle, IVE_DATA_S *pstBgModel, IVE_IMAGE_S *pstFgFlag,
  869. IVE_DST_IMAGE_S *pstBgImg, IVE_DST_IMAGE_S *pstChgStaImg, IVE_DST_IMAGE_S *pstChgStaFg, IVE_DST_IMAGE_S *pstChgStaLife,
  870. IVE_DST_MEM_INFO_S *pstStatData, IVE_UPDATE_BG_MODEL_CTRL_S *pstUpdateBgModelCtrl, HI_BOOL bInstant);
  871. /*****************************************************************************
  872. * Prototype : HI_MPI_IVE_ANN_MLP_LoadModel
  873. * Description : Load ANN_MLP model data from ".bin" file.
  874. * Parameters : HI_CHAR *pchFileName ANN_MLP model file name, must be ".bin" file.
  875. * IVE_ANN_MLP_MODEL_S *pstAnnMlpModel ANN_MLP model data.
  876. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  877. * Spec :
  878. * History:
  879. *
  880. * 1. Date : 2014-05-13
  881. * Author :
  882. * Modification : Created function
  883. *
  884. *****************************************************************************/
  885. HI_S32 HI_MPI_IVE_ANN_MLP_LoadModel(const HI_CHAR *pchFileName, IVE_ANN_MLP_MODEL_S *pstAnnMlpModel);
  886. /*****************************************************************************
  887. * Prototype : HI_MPI_IVE_ANN_MLP_UnloadModel
  888. * Description : Unload ANN_MLP model data.
  889. * Parameters : IVE_ANN_MLP_MODEL_S *pstAnnMlpModel ANN_MLP model data.
  890. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  891. * Spec :
  892. * History:
  893. *
  894. * 1. Date : 2014-05-13
  895. * Author :
  896. * Modification : Created function
  897. *
  898. *****************************************************************************/
  899. HI_VOID HI_MPI_IVE_ANN_MLP_UnloadModel(IVE_ANN_MLP_MODEL_S *pstAnnMlpModel);
  900. /*****************************************************************************
  901. * Prototype : HI_MPI_IVE_ANN_MLP_Predict
  902. * Description :
  903. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  904. * IVE_SRC_DATA_S *pstSrc Input samples
  905. * IVE_SRC_MEM_INFO_S *pstActivFuncTable Look-up talbe for active function
  906. * IVE_ANN_MLP_MODEL_S *pstAnnMlpModel ANN_MLP model
  907. * IVE_DST_DATA_S *pstDst Output layers of every intput sample
  908. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  909. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  910. * Spec :
  911. * History:
  912. *
  913. * 1. Date : 2013-11-28
  914. * Author :
  915. * Modification : Created function
  916. * 2. Date : 2015-05-21
  917. * Author :
  918. * Modification : support 1024d feature vector and array of vectors input
  919. *
  920. *****************************************************************************/
  921. HI_S32 HI_MPI_IVE_ANN_MLP_Predict(IVE_HANDLE *pIveHandle, IVE_SRC_DATA_S *pstSrc,
  922. IVE_LOOK_UP_TABLE_S *pstActivFuncTab, IVE_ANN_MLP_MODEL_S *pstAnnMlpModel,
  923. IVE_DST_DATA_S *pstDst, HI_BOOL bInstant);
  924. /*****************************************************************************
  925. * Prototype : HI_MPI_IVE_SVM_LoadModel
  926. * Description : Load SVM model data from ".bin" file.
  927. * Parameters : HI_CHAR *pchFileName SVM model file name, must be ".bin" file.
  928. * IVE_SVM_MODEL_S *pstSvmModel SVM model data.
  929. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  930. * Spec :
  931. * History:
  932. *
  933. * 1. Date : 2014-05-13
  934. * Author :
  935. * Modification : Created function
  936. *
  937. *****************************************************************************/
  938. HI_S32 HI_MPI_IVE_SVM_LoadModel(const HI_CHAR *pchFileName, IVE_SVM_MODEL_S *pstSvmModel);
  939. /*****************************************************************************
  940. * Prototype : HI_MPI_IVE_SVM_UnloadModel
  941. * Description : Unload SVM model data.
  942. * Parameters : IVE_SVM_MODEL_S *pstSvmModel SVM model data.
  943. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  944. * Spec :
  945. * History:
  946. *
  947. * 1. Date : 2014-05-13
  948. * Author :
  949. * Modification : Created function
  950. *
  951. *****************************************************************************/
  952. HI_VOID HI_MPI_IVE_SVM_UnloadModel(IVE_SVM_MODEL_S *pstSvmModel);
  953. /*****************************************************************************
  954. * Prototype : HI_MPI_IVE_SVM_Predict
  955. * Description :
  956. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  957. * IVE_SRC_DATA_S *pstSrc Input sample
  958. * IVE_SRC_MEM_INFO_S *pstKernelTable Look-up talbe for active function
  959. * IVE_SVM_MODEL_S *pstSvmModel SVM model
  960. * IVE_SRC_DATA_S *pstDstVote Output Votes' array of each class
  961. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  962. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  963. * Spec :
  964. * History:
  965. *
  966. * 1. Date : 2013-11-28
  967. * Author :
  968. * Modification : Created function
  969. * 2. Date : 2015-04-21
  970. * Author :
  971. * Modification : support 1024d feature vector and array of vectors input
  972. *
  973. *****************************************************************************/
  974. HI_S32 HI_MPI_IVE_SVM_Predict(IVE_HANDLE *pIveHandle, IVE_SRC_DATA_S *pstSrc,
  975. IVE_LOOK_UP_TABLE_S *pstKernelTab, IVE_SVM_MODEL_S *pstSvmModel,
  976. IVE_DST_DATA_S *pstDstVote, HI_BOOL bInstant);
  977. /*****************************************************************************
  978. * Prototype : HI_MPI_IVE_SAD
  979. * Description : Sum of absolute differences.
  980. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  981. * IVE_SRC_IMAGE_S *pstSrc1 The input source1.Only the U8C1 input format is supported.
  982. * IVE_SRC_IMAGE_S *pstSrc2 The input source2.Only the U8C1 input format is supported.
  983. * IVE_DST_IMAGE_S *pstSad Output result of sad value.Only the U8C1/U16C1 format is supported.
  984. * IVE_DST_IMAGE_S *pstThr Output result of thresh.Only the U8C1 format is supported.
  985. * IVE_SAD_CTRL_S *pstSadCtrl Control parameter
  986. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  987. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  988. * Spec : The size of the input data ranges from 64x64 pixels to 1920x1080 pixels.
  989. * The stride must be 16-pixel-aligned.
  990. * The types, widths, heights of two input sources must be the same.
  991. * History:
  992. *
  993. * 1. Date : 2014-08-28
  994. * Author :
  995. * Modification : Created function
  996. *
  997. *****************************************************************************/
  998. HI_S32 HI_MPI_IVE_SAD(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S *pstSrc1,
  999. IVE_SRC_IMAGE_S *pstSrc2, IVE_DST_IMAGE_S *pstSad,IVE_DST_IMAGE_S *pstThr,
  1000. IVE_SAD_CTRL_S *pstSadCtrl, HI_BOOL bInstant);
  1001. /*****************************************************************************
  1002. * Prototype : HI_MPI_IVE_Resize
  1003. * Description : Resize.
  1004. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  1005. * IVE_SRC_IMAGE_S astSrc[] The input source.Only the U8C1/U8C3_PLANAR input format is supported.
  1006. * IVE_DST_IMAGE_S astDst[] Output result.Only the U8C1/U8C3_PLANAR format is supported.
  1007. * IVE_RESIZE_CTRL_S *pstResizeCtrl Control parameter
  1008. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  1009. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  1010. * Spec : The size of the input data ranges from 32x16 pixels to 1920x1080 pixels.
  1011. * The stride must be 16-pixel-aligned.
  1012. * History:
  1013. *
  1014. * 1. Date : 2015-03-26
  1015. * Author :
  1016. * Modification : Created function
  1017. *
  1018. *****************************************************************************/
  1019. HI_S32 HI_MPI_IVE_Resize(IVE_HANDLE *pIveHandle,IVE_SRC_IMAGE_S astSrc[],
  1020. IVE_DST_IMAGE_S astDst[],IVE_RESIZE_CTRL_S *pstResizeCtrl,HI_BOOL bInstant);
  1021. /*****************************************************************************
  1022. * Prototype : HI_MPI_IVE_CNN_LoadModel
  1023. * Description : Load CNN model data from ".bin" file.
  1024. * Parameters : HI_CHAR *pchFileName CNN model file name, must be ".bin" file.
  1025. * IVE_CNN_MODEL_S *pstCnnModel CNN model data.
  1026. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  1027. * Spec :
  1028. * History:
  1029. *
  1030. * 1. Date : 2015-04-19
  1031. * Author :
  1032. * Modification : Created function
  1033. *
  1034. *****************************************************************************/
  1035. HI_S32 HI_MPI_IVE_CNN_LoadModel(const HI_CHAR *pchFileName, IVE_CNN_MODEL_S *pstCnnModel);
  1036. /*****************************************************************************
  1037. * Prototype : HI_MPI_IVE_CNN_UnloadModel
  1038. * Description : Unload CNN model data and release memory.
  1039. * Parameters : IVE_CNN_MODEL_S *pstCnnModel) CNN model data.
  1040. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  1041. * Spec :
  1042. * History:
  1043. *
  1044. * 1. Date : 2015-4-19
  1045. * Author :
  1046. * Modification : Created function
  1047. *
  1048. *****************************************************************************/
  1049. HI_VOID HI_MPI_IVE_CNN_UnloadModel(IVE_CNN_MODEL_S *pstCnnModel);
  1050. /*****************************************************************************
  1051. * Prototype : HI_MPI_IVE_CNN_Predict
  1052. * Description : Perform CNN prediction on input sample(s), and output responses for corresponding sample(s)
  1053. * Parameters : IVE_HANDLE *pIveHandle Returned handle ID of a task
  1054. * IVE_SRC_IMAGE_S astSrc[] Input images array. Only the U8C1 and U8C3_PLANAR input are supported
  1055. * IVE_CNN_MODEL_S *pstCnnModel CNN model data
  1056. * IVE_CNN_CTRL_S *pstCnnCtrl CNN control parameter
  1057. * IVE_DST_DATA_S *pstDst Output vectors of CNN_Predict
  1058. * HI_BOOL bInstant For details, see HI_MPI_IVE_DMA.
  1059. * Return Value : HI_SUCCESS: Success; Error codes: Failure.
  1060. * Spec : The stride must be 16-pixel-aligned.
  1061. * The types, widths, heights and strides of input images must be the same.
  1062. * History:
  1063. *
  1064. * 1. Date : 2015-4-19
  1065. * Author :
  1066. * Modification : Created function
  1067. *
  1068. *****************************************************************************/
  1069. HI_S32 HI_MPI_IVE_CNN_Predict(IVE_HANDLE *pIveHandle, IVE_SRC_IMAGE_S astSrc[],
  1070. IVE_CNN_MODEL_S *pstCnnModel, IVE_DST_DATA_S *pstDst,
  1071. IVE_CNN_CTRL_S *pstCnnCtrl, HI_BOOL bInstant);
  1072. /*****************************************************************************
  1073. * Prototype : HI_MPI_IVE_CNN_GetResult
  1074. * Description : Calculate classification and confidence with CNN output by softmax regression.
  1075. * Parameters : IVE_SRC_DATA_S *pstSrc The result of CNN_Predict output.
  1076. * IVE_DST_MEM_INFO_S *pstDst The prediction about classification label index and confidence.
  1077. * IVE_CNN_MODEL_S *pstpstCnnModel CNN model data
  1078. * IVE_CNN_CTRL_S *pstCnnCtrl CNN control parameter
  1079. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  1080. * Spec :
  1081. * History:
  1082. *
  1083. * 1. Date : 2015-4-19
  1084. * Author :
  1085. * Modification : Created function
  1086. *
  1087. *****************************************************************************/
  1088. HI_S32 HI_MPI_IVE_CNN_GetResult(IVE_SRC_DATA_S *pstSrc, IVE_DST_MEM_INFO_S *pstDst,
  1089. IVE_CNN_MODEL_S *pstCnnModel, IVE_CNN_CTRL_S *pstCnnCtrl);
  1090. /*****************************************************************************
  1091. * Prototype : HI_MPI_IVE_Query
  1092. * Description : This API is used to query the status of a called function by using the returned IveHandle of the function.
  1093. In block mode, the system waits until the function that is being queried is called.
  1094. In non-block mode, the current status is queried and no action is taken.
  1095. * Parameters : IVE_HANDLE IveHandle IveHandle of a called function. It is entered by users.
  1096. * HI_BOOL *pbFinish Returned status
  1097. * HI_BOOL bBlock Flag indicating the block mode or non-block mode
  1098. * HI_BOOL *pbFinish
  1099. * Return Value : HI_SUCCESS: Success;Error codes: Failure.
  1100. * Spec :
  1101. * History:
  1102. *
  1103. * 1. Date : 2011-05-16
  1104. * Author :
  1105. * Modification : Created function
  1106. *
  1107. *****************************************************************************/
  1108. HI_S32 HI_MPI_IVE_Query(IVE_HANDLE IveHandle, HI_BOOL *pbFinish, HI_BOOL bBlock);
  1109. #ifdef __cplusplus
  1110. #if __cplusplus
  1111. }
  1112. #endif
  1113. #endif
  1114. #endif/*__MPI_IVE_H__*/