You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

acl_dvpp.h 57 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675
  1. /**
  2. * @file acl_dvpp.h
  3. *
  4. * Copyright (C) Huawei Technologies Co., Ltd. 2019-2020. All Rights Reserved.
  5. *
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. */
  10. #if !defined(ENABLE_DVPP_INTERFACE)
  11. #if defined(_MSC_VER)
  12. #error message("if you want to use dvpp funtions ,please use the macro definition (ENABLE_DVPP_INTERFACE).")
  13. #else
  14. #error "if you want to use dvpp funtions ,please use the macro definition (ENABLE_DVPP_INTERFACE)."
  15. #endif
  16. #endif
  17. #ifndef INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
  18. #define INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
  19. #include <stdint.h>
  20. #include <stddef.h>
  21. #include "../acl.h"
  22. #include "../acl_base.h"
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. typedef struct acldvppPicDesc acldvppPicDesc;
  27. typedef struct acldvppBatchPicDesc acldvppBatchPicDesc;
  28. typedef struct acldvppRoiConfig acldvppRoiConfig;
  29. typedef struct acldvppResizeConfig acldvppResizeConfig;
  30. typedef struct acldvppChannelDesc acldvppChannelDesc;
  31. typedef struct acldvppJpegeConfig acldvppJpegeConfig;
  32. typedef struct aclvdecChannelDesc aclvdecChannelDesc;
  33. typedef struct acldvppStreamDesc acldvppStreamDesc;
  34. typedef struct aclvdecFrameConfig aclvdecFrameConfig;
  35. typedef struct aclvencChannelDesc aclvencChannelDesc;
  36. typedef struct aclvencFrameConfig aclvencFrameConfig;
  37. typedef void (*aclvdecCallback)(acldvppStreamDesc *input, acldvppPicDesc *output, void *userData);
  38. typedef void (*aclvencCallback)(acldvppPicDesc *input, acldvppStreamDesc *output, void *userdata);
  39. // Supported Pixel Format
  40. enum acldvppPixelFormat {
  41. PIXEL_FORMAT_YUV_400 = 0, // 0
  42. PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 1, // 1
  43. PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 2, // 2
  44. PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 3, // 3
  45. PIXEL_FORMAT_YVU_SEMIPLANAR_422 = 4, // 4
  46. PIXEL_FORMAT_YUV_SEMIPLANAR_444 = 5, // 5
  47. PIXEL_FORMAT_YVU_SEMIPLANAR_444 = 6, // 6
  48. PIXEL_FORMAT_YUYV_PACKED_422 = 7, // 7
  49. PIXEL_FORMAT_UYVY_PACKED_422 = 8, // 8
  50. PIXEL_FORMAT_YVYU_PACKED_422 = 9, // 9
  51. PIXEL_FORMAT_VYUY_PACKED_422 = 10, // 10
  52. PIXEL_FORMAT_YUV_PACKED_444 = 11, // 11
  53. PIXEL_FORMAT_RGB_888 = 12, // 12
  54. PIXEL_FORMAT_BGR_888 = 13, // 13
  55. PIXEL_FORMAT_ARGB_8888 = 14, // 14
  56. PIXEL_FORMAT_ABGR_8888 = 15, // 15
  57. PIXEL_FORMAT_RGBA_8888 = 16, // 16
  58. PIXEL_FORMAT_BGRA_8888 = 17, // 17
  59. PIXEL_FORMAT_YUV_SEMI_PLANNER_420_10BIT = 18, // 18
  60. PIXEL_FORMAT_YVU_SEMI_PLANNER_420_10BIT = 19, // 19
  61. PIXEL_FORMAT_YVU_PLANAR_420 = 20, // 20
  62. PIXEL_FORMAT_YVU_PLANAR_422,
  63. PIXEL_FORMAT_YVU_PLANAR_444,
  64. PIXEL_FORMAT_RGB_444 = 23,
  65. PIXEL_FORMAT_BGR_444,
  66. PIXEL_FORMAT_ARGB_4444,
  67. PIXEL_FORMAT_ABGR_4444,
  68. PIXEL_FORMAT_RGBA_4444,
  69. PIXEL_FORMAT_BGRA_4444,
  70. PIXEL_FORMAT_RGB_555,
  71. PIXEL_FORMAT_BGR_555,
  72. PIXEL_FORMAT_RGB_565,
  73. PIXEL_FORMAT_BGR_565,
  74. PIXEL_FORMAT_ARGB_1555,
  75. PIXEL_FORMAT_ABGR_1555,
  76. PIXEL_FORMAT_RGBA_1555,
  77. PIXEL_FORMAT_BGRA_1555,
  78. PIXEL_FORMAT_ARGB_8565,
  79. PIXEL_FORMAT_ABGR_8565,
  80. PIXEL_FORMAT_RGBA_8565,
  81. PIXEL_FORMAT_BGRA_8565,
  82. PIXEL_FORMAT_RGB_BAYER_8BPP = 50,
  83. PIXEL_FORMAT_RGB_BAYER_10BPP,
  84. PIXEL_FORMAT_RGB_BAYER_12BPP,
  85. PIXEL_FORMAT_RGB_BAYER_14BPP,
  86. PIXEL_FORMAT_RGB_BAYER_16BPP,
  87. PIXEL_FORMAT_BGR_888_PLANAR = 70,
  88. PIXEL_FORMAT_HSV_888_PACKAGE,
  89. PIXEL_FORMAT_HSV_888_PLANAR,
  90. PIXEL_FORMAT_LAB_888_PACKAGE,
  91. PIXEL_FORMAT_LAB_888_PLANAR,
  92. PIXEL_FORMAT_S8C1,
  93. PIXEL_FORMAT_S8C2_PACKAGE,
  94. PIXEL_FORMAT_S8C2_PLANAR,
  95. PIXEL_FORMAT_S16C1,
  96. PIXEL_FORMAT_U8C1,
  97. PIXEL_FORMAT_U16C1,
  98. PIXEL_FORMAT_S32C1,
  99. PIXEL_FORMAT_U32C1,
  100. PIXEL_FORMAT_U64C1,
  101. PIXEL_FORMAT_S64C1,
  102. PIXEL_FORMAT_YUV_SEMIPLANAR_440 = 1000,
  103. PIXEL_FORMAT_YVU_SEMIPLANAR_440,
  104. PIXEL_FORMAT_FLOAT32,
  105. PIXEL_FORMAT_BUTT,
  106. PIXEL_FORMAT_UNKNOWN = 10000
  107. };
  108. // Stream Format
  109. enum acldvppStreamFormat {
  110. H265_MAIN_LEVEL = 0,
  111. H264_BASELINE_LEVEL,
  112. H264_MAIN_LEVEL,
  113. H264_HIGH_LEVEL
  114. };
  115. // Supported Channel Mode
  116. enum acldvppChannelMode {
  117. DVPP_CHNMODE_VPC = 1,
  118. DVPP_CHNMODE_JPEGD = 2,
  119. DVPP_CHNMODE_JPEGE = 4
  120. };
  121. /**
  122. * @ingroup AscendCL
  123. * @brief alloc device memory for dvpp.
  124. *
  125. * @par Function
  126. * @li It's mainly used for allocating memory to device media data processing.
  127. * The requested memory meets the data processing requirements.
  128. * After calling this interface to request memory,
  129. * you must release the memory using the acldvppFree interface.
  130. * @li When calling the acldvppMalloc interface to apply for memory,
  131. * the size entered by the user is aligned upwards to 32 integer multiples,
  132. * and an additional 32 bytes are applied.
  133. *
  134. * @par Restriction
  135. * If the user uses the acldvppMalloc interface to apply for a large block of
  136. * memory and divide and manage the memory by himself,
  137. * when applying for memory, the user needs to align up to 32 integer
  138. * times + 32 bytes (ALIGN_UP [len] +32 words) according to
  139. * the actual data size of each picture Section) to manage memory.
  140. * @param devPtr [IN] memory pointer.
  141. * @param size [IN] memory size.
  142. * @retval ACL_ERROR_NONE The function is successfully executed.
  143. * @retval OtherValues Failure
  144. *
  145. * @see acldvppFree
  146. */
  147. ACL_FUNC_VISIBILITY aclError acldvppMalloc(void **devPtr, size_t size);
  148. /**
  149. * @ingroup AscendCL
  150. * @brief free device memory for dvpp.
  151. *
  152. * @par Function
  153. * Free the memory requested through the acldvppMalloc interface
  154. * @param devPtr [IN] memory pointer to free.
  155. * @retval ACL_ERROR_NONE The function is successfully executed.
  156. * @retval OtherValues Failure
  157. *
  158. * @see acldvppMalloc
  159. */
  160. ACL_FUNC_VISIBILITY aclError acldvppFree(void *devPtr);
  161. /**
  162. * @ingroup AscendCL
  163. * @brief create DvppChannelDesc.
  164. *
  165. * @par Function
  166. * Create a channel for image data processing.
  167. * The same channel can be reused
  168. * and is no longer available after destruction
  169. * @retval null for failed.
  170. * @retval OtherValues success.
  171. */
  172. ACL_FUNC_VISIBILITY acldvppChannelDesc *acldvppCreateChannelDesc();
  173. /**
  174. * @ingroup AscendCL
  175. * @brief destroy dvppChannelDesc.
  176. *
  177. * @par Function
  178. * Can only destroy channels created by the acldvppCreateChannel interface
  179. * @param channelDesc [IN] the channel description.
  180. * @retval ACL_ERROR_NONE The function is successfully executed.
  181. * @retval OtherValues Failure
  182. *
  183. * @see acldvppCreateChannelDesc | acldvppDestroyChannel
  184. */
  185. ACL_FUNC_VISIBILITY aclError acldvppDestroyChannelDesc(acldvppChannelDesc *channelDesc);
  186. /**
  187. * @ingroup AscendCL
  188. * @brief Get dvpp channel Id.
  189. *
  190. * @par Restriction
  191. * Interface calling sequence:
  192. * acldvppCreateChannelDesc --> acldvppCreateChannel -->
  193. * acldvppGetChannelDescChannelId
  194. * @param channelDesc [IN] the channel description.
  195. * @retval channel id.
  196. *
  197. * @see acldvppCreateChannelDesc | acldvppCreateChannel
  198. */
  199. ACL_FUNC_VISIBILITY uint64_t acldvppGetChannelDescChannelId(const acldvppChannelDesc *channelDesc);
  200. /**
  201. * @ingroup AscendCL
  202. * @brief Create dvpp picture description.
  203. *
  204. * @retval null for failed.
  205. * @retval OtherValues success.
  206. */
  207. ACL_FUNC_VISIBILITY acldvppPicDesc *acldvppCreatePicDesc();
  208. /**
  209. * @ingroup AscendCL
  210. * @brief Destroy dvpp picture description.
  211. *
  212. * @par Function
  213. * Can only destroy picture description information created
  214. * through acldvppCreatePicDesc interface.
  215. * @param picDesc [IN] dvpp picture description.
  216. * @retval ACL_ERROR_NONE The function is successfully executed.
  217. * @retval OtherValues Failure
  218. *
  219. * @see acldvppCreatePicDesc
  220. */
  221. ACL_FUNC_VISIBILITY aclError acldvppDestroyPicDesc(acldvppPicDesc *picDesc);
  222. /**
  223. * @ingroup AscendCL
  224. * @brief Set dvpp picture description's data.
  225. *
  226. * @param picDesc [IN] dvpp picture description.
  227. * @param dataDev [IN] dvpp picture dataDev.Must be the memory
  228. * requested using the acldvppMalloc interface.
  229. * @retval ACL_ERROR_NONE The function is successfully executed.
  230. * @retval OtherValues Failure
  231. *
  232. * @see acldvppMalloc
  233. */
  234. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescData(acldvppPicDesc *picDesc, void *dataDev);
  235. /**
  236. * @ingroup AscendCL
  237. * @brief Set dvpp picture description's size.
  238. *
  239. * @param picDesc [IN] dvpp picture description.
  240. * @param size dvpp [IN] picture size.
  241. * @retval ACL_ERROR_NONE The function is successfully executed.
  242. * @retval OtherValues Failure
  243. */
  244. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescSize(acldvppPicDesc *picDesc, uint32_t size);
  245. /**
  246. * @ingroup AscendCL
  247. * @brief Set dvpp picture description's format.
  248. *
  249. * @param picDesc [IN] dvpp picture description.
  250. * @param format [IN] dvpp picture format.
  251. * @retval ACL_ERROR_NONE The function is successfully executed.
  252. * @retval OtherValues Failure
  253. */
  254. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescFormat(acldvppPicDesc *picDesc, acldvppPixelFormat format);
  255. /**
  256. * @ingroup AscendCL
  257. * @brief Set dvpp picture description's width.
  258. *
  259. * @param picDesc [IN] dvpp picture description.
  260. * @param width [IN] dvpp picture width.
  261. * @retval ACL_ERROR_NONE The function is successfully executed.
  262. * @retval OtherValues Failure
  263. */
  264. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescWidth(acldvppPicDesc *picDesc, uint32_t width);
  265. /**
  266. * @ingroup AscendCL
  267. * @brief Set dvpp picture description's height.
  268. *
  269. * @param picDesc [IN] dvpp picture description.
  270. * @param height [IN] dvpp picture height.
  271. * @retval ACL_ERROR_NONE The function is successfully executed.
  272. * @retval OtherValues Failure
  273. */
  274. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescHeight(acldvppPicDesc *picDesc, uint32_t height);
  275. /**
  276. * @ingroup AscendCL
  277. * @brief Set dvpp picture description's widthStride.
  278. *
  279. * @par Restriction
  280. * Width alignment requirements:
  281. * @li The minimum stride is 32 and the maximum is 4096 * 4
  282. * (that is, an image in argb format with a width of 4096);
  283. * @li For 8K scaling, widthStride is required to be aligned to 2;
  284. * @li For non 8K scaling, the calculation formula for widthStride
  285. * is different for different image formats:
  286. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  287. * @li yuv422packed: input image width * 2 and then align to 16
  288. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  289. * @li xrgb8888: input image width * 4, align to 16
  290. * @li HFBC:input image width
  291. * @param picDesc [IN] dvpp picture description.
  292. * @param widthStride [IN] dvpp picture widthStride.
  293. * @retval ACL_ERROR_NONE The function is successfully executed.
  294. * @retval OtherValues Failure
  295. */
  296. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescWidthStride(acldvppPicDesc *picDesc, uint32_t widthStride);
  297. /**
  298. * @ingroup AscendCL
  299. * @brief Set dvpp picture description's heightStride.
  300. *
  301. * @par Restriction
  302. * Height alignment requirements:
  303. * @li The height of the input image is aligned to 2.
  304. * High stride minimum 6 and maximum 4096.
  305. * @param picDesc [IN] dvpp picture description.
  306. * @param heightStride [IN] dvpp picture heightStride.
  307. * @retval ACL_ERROR_NONE The function is successfully executed.
  308. * @retval OtherValues Failure
  309. */
  310. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescHeightStride(acldvppPicDesc *picDesc, uint32_t heightStride);
  311. /**
  312. * @ingroup AscendCL
  313. * @brief Set dvpp picture description's retcode.
  314. *
  315. * @param picDesc [IN] dvpp picture description.
  316. * @param retCode [IN] dvpp picture retcode.
  317. * @retval ACL_ERROR_NONE The function is successfully executed.
  318. * @retval OtherValues Failure
  319. */
  320. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescRetCode(acldvppPicDesc *picDesc, uint32_t retCode);
  321. /**
  322. * @ingroup AscendCL
  323. * @brief Get picture data.
  324. *
  325. * @param picDesc [IN] dvpp picture description.
  326. * @retval picture data addr.
  327. * @retval default nullptr.
  328. */
  329. ACL_FUNC_VISIBILITY void *acldvppGetPicDescData(const acldvppPicDesc *picDesc);
  330. /**
  331. * @ingroup AscendCL
  332. * @brief Get picture data size.
  333. *
  334. * @param picDesc [IN] dvpp picture description.
  335. * @retval picture data size.
  336. * @retval default 0.
  337. */
  338. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescSize(const acldvppPicDesc *picDesc);
  339. /**
  340. * @ingroup AscendCL
  341. * @brief Get dvpp picture desc's format.
  342. *
  343. * @param picDesc [IN] dvpp picture description.
  344. * @retval format
  345. * @retval default PIXEL_FORMAT_YUV_400.
  346. */
  347. ACL_FUNC_VISIBILITY acldvppPixelFormat acldvppGetPicDescFormat(const acldvppPicDesc *picDesc);
  348. /**
  349. * @ingroup AscendCL
  350. * @brief Get dvpp picture desc's width.
  351. *
  352. * @param picDesc [IN] dvpp picture description.
  353. * @retval width.
  354. * @retval default 0.
  355. */
  356. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescWidth(const acldvppPicDesc *picDesc);
  357. /**
  358. * @ingroup AscendCL
  359. * @brief Get dvpp picture desc's height.
  360. *
  361. * @param picDesc [IN] dvpp picture description.
  362. * @retval height.
  363. * @retval default 0.
  364. */
  365. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescHeight(const acldvppPicDesc *picDesc);
  366. /**
  367. * @ingroup AscendCL
  368. * @brief Get dvpp picture desc's widthStride.
  369. *
  370. * @par Restriction
  371. * Width alignment requirements:
  372. * @li The minimum stride is 32 and the maximum is 4096 * 4
  373. * (that is, an image in argb format with a width of 4096);
  374. * @li For 8K scaling, widthStride is required to be aligned to 2;
  375. * @li For non 8K scaling, the calculation formula for widthStride
  376. * is different for different image formats:
  377. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  378. * @li yuv422packed: input image width * 2 and then align to 16
  379. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  380. * @li xrgb8888: input image width * 4, align to 16
  381. * @li HFBC:input image width
  382. * @param picDesc [IN] dvpp picture description.
  383. * @retval stride width.
  384. * @retval default 0.
  385. */
  386. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescWidthStride(const acldvppPicDesc *picDesc);
  387. /**
  388. * @ingroup AscendCL
  389. * @brief Get dvpp picture desc's heightStride.
  390. *
  391. * @par Restriction
  392. * Height alignment requirements:
  393. * @li The height of the input image is aligned to 2.
  394. * High stride minimum 6 and maximum 4096.
  395. * @param picDesc [IN] dvpp picture description.
  396. * @retval stride height.
  397. * @retval default 0.
  398. */
  399. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescHeightStride(const acldvppPicDesc *picDesc);
  400. /**
  401. * @ingroup AscendCL
  402. * @brief Get dvpp picture desc's retcode.
  403. *
  404. * @param picDesc [IN] dvpp picture description.
  405. * @retval ret code.
  406. * @retval default 0.
  407. */
  408. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescRetCode(const acldvppPicDesc *picDesc);
  409. /**
  410. * @ingroup AscendCL
  411. * @brief Create dvpp roi config.
  412. *
  413. * @param left [IN] the left offset, must be even
  414. * @param right [IN] the right offset, must be odd
  415. * @param top [IN] the top offset, must be even
  416. * @param bottom [IN] the bottom offset, must be odd
  417. * @retval null for failed.
  418. * @retval other success
  419. */
  420. ACL_FUNC_VISIBILITY acldvppRoiConfig *acldvppCreateRoiConfig(uint32_t left,
  421. uint32_t right,
  422. uint32_t top,
  423. uint32_t bottom);
  424. /**
  425. * @ingroup AscendCL
  426. * @brief Destroy dvpp roi config.
  427. *
  428. * @par Function
  429. * Destroys data created through the acldvppCreateRoiConfig interface
  430. * @param roiConfig [IN] dvpp roi config.
  431. * @retval ACL_ERROR_NONE The function is successfully executed.
  432. * @retval OtherValues Failure
  433. *
  434. * @see acldvppCreateRoiConfig
  435. */
  436. ACL_FUNC_VISIBILITY aclError acldvppDestroyRoiConfig(acldvppRoiConfig *roiConfig);
  437. /**
  438. * @ingroup AscendCL
  439. * @brief Set left of RoiConfig.
  440. *
  441. * @param config [IN] RoiConfig
  442. * @param left [IN] left offset
  443. * @retval ACL_ERROR_NONE The function is successfully executed.
  444. * @retval OtherValues Failure
  445. */
  446. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigLeft(acldvppRoiConfig *config, uint32_t left);
  447. /**
  448. * @ingroup AscendCL
  449. * @brief Set right of RoiConfig.
  450. *
  451. * @param config [IN] RoiConfig
  452. * @param right [IN] right offset
  453. * @retval ACL_ERROR_NONE The function is successfully executed.
  454. * @retval OtherValues Failure
  455. */
  456. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigRight(acldvppRoiConfig *config, uint32_t right);
  457. /**
  458. * @ingroup AscendCL
  459. * @brief Set top of RoiConfig.
  460. *
  461. * @param config [IN] RoiConfig
  462. * @param top [IN] top offset
  463. * @retval ACL_ERROR_NONE The function is successfully executed.
  464. * @retval OtherValues Failure
  465. */
  466. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigTop(acldvppRoiConfig *config, uint32_t top);
  467. /**
  468. * @ingroup AscendCL
  469. * @brief Set bottom of RoiConfig.
  470. *
  471. * @param config [IN] RoiConfig
  472. * @param bottom [IN] bottom offset
  473. * @retval ACL_ERROR_NONE The function is successfully executed.
  474. * @retval OtherValues Failure
  475. */
  476. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigBottom(acldvppRoiConfig *config, uint32_t bottom);
  477. /**
  478. * @ingroup AscendCL
  479. * @brief Set RoiConfig.
  480. *
  481. * @param config [IN|OUT] RoiConfig
  482. * @param left [IN] left offset
  483. * @param right [IN] right offset
  484. * @param top [IN] top offset
  485. * @param bottom [IN] bottom offset
  486. * @retval ACL_ERROR_NONE The function is successfully executed.
  487. * @retval OtherValues Failure
  488. */
  489. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfig(acldvppRoiConfig *config,
  490. uint32_t left,
  491. uint32_t right,
  492. uint32_t top,
  493. uint32_t bottom);
  494. /**
  495. * @ingroup AscendCL
  496. * @brief Create dvpp resize config.
  497. * The specified scaling algorithm is not supported.
  498. * The default scaling algorithm is "nearest neighbor interpolation".
  499. *
  500. * @retval null for failed.
  501. * @retval other success.
  502. */
  503. ACL_FUNC_VISIBILITY acldvppResizeConfig *acldvppCreateResizeConfig();
  504. /**
  505. * @ingroup AscendCL
  506. * @brief Destroy dvpp resize config.
  507. *
  508. * @par Function
  509. * Destroys the scaling configuration data created by
  510. * the acldvppCreateResizeConfig interface
  511. * @param resizeConfig [IN] resize config.
  512. * @retval ACL_ERROR_NONE The function is successfully executed.
  513. * @retval OtherValues Failure
  514. *
  515. * @see acldvppCreateResizeConfig
  516. */
  517. ACL_FUNC_VISIBILITY aclError acldvppDestroyResizeConfig(acldvppResizeConfig *resizeConfig);
  518. /**
  519. * @ingroup AscendCL
  520. * @brief Create jpege config.
  521. *
  522. * @retval null for failed.
  523. * @retval other success.
  524. */
  525. ACL_FUNC_VISIBILITY acldvppJpegeConfig *acldvppCreateJpegeConfig();
  526. /**
  527. * @ingroup AscendCL
  528. * @brief Destroy jpege config.
  529. *
  530. * @par Function
  531. * Destroys the encoding configuration data created by
  532. * the acldvppCreateJpegeConfig interface
  533. * @param jpegeConfig config pointer to destroy.
  534. * @retval ACL_ERROR_NONE The function is successfully executed.
  535. * @retval OtherValues Failure
  536. *
  537. * @see acldvppCreateJpegeConfig
  538. */
  539. ACL_FUNC_VISIBILITY aclError acldvppDestroyJpegeConfig(acldvppJpegeConfig *jpegeConfig);
  540. /**
  541. * @ingroup AscendCL
  542. * @brief Set jpege config's level.
  543. *
  544. * @param jpegeConfig [IN|OUT] Call the acldvppCreateJpegeConfig
  545. * interface to create acldvppJpegeConfig data
  546. * @param level [IN] Encoding quality range [0, 100],
  547. * where level 0 encoding quality is similar to level 100,
  548. * and the smaller the value in [1, 100],
  549. * the worse the quality of the output picture.
  550. * @retval ACL_ERROR_NONE The function is successfully executed.
  551. * @retval OtherValues Failure
  552. */
  553. ACL_FUNC_VISIBILITY aclError acldvppSetJpegeConfigLevel(acldvppJpegeConfig *jpegeConfig, uint32_t level);
  554. /**
  555. * @ingroup AscendCL
  556. * @brief Get jpege config's level.
  557. *
  558. * @param jpegeConfig [IN] jpege config.
  559. * @retval compression level.
  560. * @retval default 0.
  561. */
  562. ACL_FUNC_VISIBILITY uint32_t acldvppGetJpegeConfigLevel(const acldvppJpegeConfig *jpegeConfig);
  563. /**
  564. * @ingroup AscendCL
  565. * @brief create vdecChannelDesc.Channel description information
  566. * when creating a video data processing channel.
  567. *
  568. * @retval null for failed.
  569. * @retval other success
  570. */
  571. ACL_FUNC_VISIBILITY aclvdecChannelDesc *aclvdecCreateChannelDesc();
  572. /**
  573. * @ingroup AscendCL
  574. * @brief destroy vdecChannelDesc.
  575. *
  576. * @par Function
  577. * Can only destroy aclvdecChannelDesc type created
  578. * through aclvdecCreateChannelDesc interface
  579. * @param channelDesc [IN] channel description.
  580. * @retval ACL_ERROR_NONE The function is successfully executed.
  581. * @retval OtherValues Failure
  582. * @see aclvdecCreateChannelDesc
  583. */
  584. ACL_FUNC_VISIBILITY aclError aclvdecDestroyChannelDesc(aclvdecChannelDesc *channelDesc);
  585. /**
  586. * @ingroup AscendCL
  587. * @brief Set vdec channel description's channel id.
  588. *
  589. * @param channelDesc [IN] vdec channel description.
  590. * @param channelId [IN] decoding channel id: 0~15.
  591. * @retval ACL_ERROR_NONE The function is successfully executed.
  592. * @retval OtherValues Failure
  593. */
  594. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescChannelId(aclvdecChannelDesc *channelDesc, uint32_t channelId);
  595. /**
  596. * @ingroup AscendCL
  597. * @brief Set vdec channel description's thread id.
  598. *
  599. * @param channelDesc [IN] vdec channel description.
  600. * @param threadId [IN] thread id.
  601. * @retval ACL_ERROR_NONE The function is successfully executed.
  602. * @retval OtherValues Failure
  603. */
  604. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescThreadId(aclvdecChannelDesc *channelDesc, uint64_t threadId);
  605. /**
  606. * @ingroup AscendCL
  607. * @brief Set vdec channel description's callback function.
  608. *
  609. * @param channelDesc [IN] vdec channel description.
  610. * @param callback [IN] function callback.Function prototype:
  611. * void (* aclvdecCallback)
  612. * (acldvppStreamDesc * input, acldvppPicDesc * output, void* userdata)
  613. * @retval ACL_ERROR_NONE The function is successfully executed.
  614. * @retval OtherValues Failure
  615. *
  616. * @see aclvdecCallback
  617. */
  618. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescCallback(aclvdecChannelDesc *channelDesc, aclvdecCallback callback);
  619. /**
  620. * @ingroup AscendCL
  621. * @brief Set vdec channel description's video encoding type.
  622. *
  623. * @param channelDesc [IN] vdec channel description.
  624. * @param enType [IN] video encoding type.
  625. * @retval ACL_ERROR_NONE The function is successfully executed.
  626. * @retval OtherValues Failure
  627. */
  628. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescEnType(aclvdecChannelDesc *channelDesc, acldvppStreamFormat enType);
  629. /**
  630. * @ingroup AscendCL
  631. * @brief Set vdec channel description's out picture format.
  632. *
  633. * @param channelDesc [IN] vdec channel description.
  634. * @param outPicFormat [IN] out picture format (acldvppPixelFormat).
  635. * @retval ACL_ERROR_NONE The function is successfully executed.
  636. * @retval OtherValues Failure
  637. */
  638. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicFormat(aclvdecChannelDesc *channelDesc,
  639. acldvppPixelFormat outPicFormat);
  640. /**
  641. * @ingroup AscendCL
  642. * @brief Set vdec channel description's out picture width.
  643. *
  644. * @param channelDesc [IN] vdec channel description.
  645. * @param outPicWidth [IN] out picture width.
  646. * @retval ACL_ERROR_NONE The function is successfully executed.
  647. * @retval OtherValues Failure
  648. */
  649. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicWidth(aclvdecChannelDesc *channelDesc, uint32_t outPicWidth);
  650. /**
  651. * @ingroup AscendCL
  652. * @brief Set vdec channel description's out picture height.
  653. *
  654. * @param channelDesc [IN] vdec channel description.
  655. * @param outPicHeight [IN] out picture height.
  656. * @retval ACL_ERROR_NONE The function is successfully executed.
  657. * @retval OtherValues Failure
  658. */
  659. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicHeight(aclvdecChannelDesc *channelDesc, uint32_t outPicHeight);
  660. /**
  661. * @ingroup AscendCL
  662. * @brief Set vdec channel description's reference frame num.
  663. *
  664. * @param channelDesc [IN] vdec channel description.
  665. * @param refFrameNum [IN] reference frame num.
  666. * @retval ACL_ERROR_NONE The function is successfully executed.
  667. * @retval OtherValues Failure
  668. */
  669. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescRefFrameNum(aclvdecChannelDesc *channelDesc, uint32_t refFrameNum);
  670. /**
  671. * @ingroup AscendCL
  672. * @brief Get vdec channel description's channel id.
  673. *
  674. * @param channelDesc [IN] vdec channel description.
  675. * @retval decoding channel id: 0~15.
  676. * @retval default 0.
  677. */
  678. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescChannelId(const aclvdecChannelDesc *channelDesc);
  679. /**
  680. * @ingroup AscendCL
  681. * @brief Get vdec channel description's thread id.
  682. *
  683. * @param channelDesc [IN] vdec channel description.
  684. * @retval thread id.
  685. * @retval default 0.
  686. */
  687. ACL_FUNC_VISIBILITY uint64_t aclvdecGetChannelDescThreadId(const aclvdecChannelDesc *channelDesc);
  688. /**
  689. * @ingroup AscendCL
  690. * @brief Get vdec channel description's callback function.
  691. *
  692. * @param channelDesc [IN] vdec channel description.
  693. * @retval function callback.Function prototype:
  694. * void (* aclvdecCallback)
  695. * (acldvppStreamDesc * input, acldvppPicDesc * output, void* userdata)
  696. * @retval default null.
  697. *
  698. * @see aclvdecCallback
  699. */
  700. ACL_FUNC_VISIBILITY aclvdecCallback aclvdecGetChannelDescCallback(const aclvdecChannelDesc *channelDesc);
  701. /**
  702. * @ingroup AscendCL
  703. * @brief Get vdec channel description's video encoding type.
  704. *
  705. * @param channelDesc [IN] vdec channel description.
  706. * @retval video encoding type.
  707. * @retval default H265_MAIN_LEVEL.
  708. */
  709. ACL_FUNC_VISIBILITY acldvppStreamFormat aclvdecGetChannelDescEnType(const aclvdecChannelDesc *channelDesc);
  710. /**
  711. * @ingroup AscendCL
  712. * @brief Get vdec channel description's out picture format.
  713. *
  714. * @param channelDesc [IN] vdec channel description.
  715. * @retval out picture format.
  716. * @retval default DVPP_OUTPUT_YUV420SP_UV.
  717. */
  718. ACL_FUNC_VISIBILITY acldvppPixelFormat aclvdecGetChannelDescOutPicFormat(const aclvdecChannelDesc *channelDesc);
  719. /**
  720. * @ingroup AscendCL
  721. * @brief Get vdec channel description's out picture width.
  722. *
  723. * @param channelDesc [IN] vdec channel description.
  724. * @retval out picture width.
  725. * @retval default 0.
  726. */
  727. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutPicWidth(const aclvdecChannelDesc *channelDesc);
  728. /**
  729. * @ingroup AscendCL
  730. * @brief Get vdec channel description's out picture height.
  731. *
  732. * @param channelDesc [IN] vdec channel description.
  733. * @retval out picture height (for vdec malloc memory).
  734. * @retval default 0.
  735. */
  736. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutPicHeight(const aclvdecChannelDesc *channelDesc);
  737. /**
  738. * @ingroup AscendCL
  739. * @brief Get vdec channel description's reference frame num.
  740. *
  741. * @param channelDesc [IN] vdec channel description.
  742. * @retval reference frame num.
  743. * @retval default 0.
  744. */
  745. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescRefFrameNum(const aclvdecChannelDesc *channelDesc);
  746. /**
  747. * @ingroup AscendCL
  748. * @brief create vencChannelDesc.
  749. * @return null for failed, other success
  750. */
  751. ACL_FUNC_VISIBILITY aclvencChannelDesc *aclvencCreateChannelDesc();
  752. /**
  753. * @ingroup AscendCL
  754. * @brief destroy vencChannelDesc.
  755. * @param channelDesc channel desc.
  756. * @return ACL_ERROR_NONE:success, other:failed
  757. */
  758. ACL_FUNC_VISIBILITY aclError aclvencDestroyChannelDesc(aclvencChannelDesc *channelDesc);
  759. /**
  760. * @ingroup AscendCL
  761. * @brief Set decoding thread id for venc channel desc.
  762. * @param channelDesc[IN/OUT] venc channel desc
  763. * @param threadId[IN] thread id
  764. * @return ACL_ERROR_NONE for success, other for failure
  765. */
  766. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescThreadId(aclvencChannelDesc *channelDesc, uint64_t threadId);
  767. /**
  768. * @ingroup AscendCL
  769. * @brief Set func callback for venc channel desc.
  770. * @param channelDesc[IN/OUT] venc channel desc
  771. * @param callback[IN] func callback
  772. * @return ACL_ERROR_NONE for success, other for failure
  773. */
  774. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescCallback(aclvencChannelDesc *channelDesc, aclvencCallback callback);
  775. /**
  776. * @ingroup AscendCL
  777. * @brief Set video encoding type for venc channel desc.
  778. * @param channelDesc[IN/OUT] venc channel desc
  779. * @param enType[IN] video encoding type
  780. * @return ACL_ERROR_NONE for success, other for failure
  781. */
  782. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescEnType(aclvencChannelDesc *channelDesc, acldvppStreamFormat enType);
  783. /**
  784. * @ingroup AscendCL
  785. * @brief Set pic format for venc channel desc.
  786. * @param channelDesc[IN/OUT] venc channel desc
  787. * @param picFormat[IN] pic format
  788. * @return ACL_ERROR_NONE for success, other for failure
  789. */
  790. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicFormat(aclvencChannelDesc *channelDesc,
  791. acldvppPixelFormat picFormat);
  792. /**
  793. * @ingroup AscendCL
  794. * @brief Set out pic width for venc channel desc.
  795. * @param channelDesc[IN/OUT] venc channel desc
  796. * @param picWidth[IN] pic width
  797. * @return ACL_ERROR_NONE for success, other for failure
  798. */
  799. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicWidth(aclvencChannelDesc *channelDesc, uint32_t picWidth);
  800. /**
  801. * @ingroup AscendCL
  802. * @brief Set pic height for venc channel desc.
  803. * @param channelDesc[IN/OUT] venc channel desc
  804. * @param picHeight[IN] pic height
  805. * @return ACL_ERROR_NONE for success, other for failure
  806. */
  807. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicHeight(aclvencChannelDesc *channelDesc, uint32_t picHeight);
  808. /**
  809. * @ingroup AscendCL
  810. * @brief Set eference frame num for venc channel desc.
  811. * @param channelDesc[IN/OUT] venc channel desc
  812. * @param keyFrameInterval[IN] Interval of key frame
  813. * @return ACL_ERROR_NONE for success, other for failure
  814. */
  815. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescKeyFrameInterval(aclvencChannelDesc *channelDesc,
  816. uint32_t keyFrameInterval);
  817. /**
  818. * @ingroup AscendCL
  819. * @brief Get decoding channel id for venc channel desc.
  820. * @param channelDesc[IN] venc channel desc
  821. * @return decoding channel id: 0~15, default 0
  822. */
  823. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescChannelId(const aclvencChannelDesc *channelDesc);
  824. /**
  825. * @ingroup AscendCL
  826. * @brief Get decoding thread id for venc channel desc.
  827. * @param channelDesc[IN] venc channel desc
  828. * @return thread id, default 0
  829. */
  830. ACL_FUNC_VISIBILITY uint64_t aclvencGetChannelDescThreadId(const aclvencChannelDesc *channelDesc);
  831. /**
  832. * @ingroup AscendCL
  833. * @brief Get func callback for venc channel desc.
  834. * @param channelDesc[IN] venc channel desc
  835. * @return func callback, default null
  836. */
  837. ACL_FUNC_VISIBILITY aclvencCallback aclvencGetChannelDescCallback(const aclvencChannelDesc *channelDesc);
  838. /**
  839. * @ingroup AscendCL
  840. * @brief Get video encoding type for venc channel desc.
  841. * @param channelDesc[IN] venc channel desc
  842. * @return video encoding type, default H265_MAIN_LEVEL
  843. */
  844. ACL_FUNC_VISIBILITY acldvppStreamFormat aclvencGetChannelDescEnType(const aclvencChannelDesc *channelDesc);
  845. /**
  846. * @ingroup AscendCL
  847. * @brief Get pic format for venc channel desc.
  848. * @param channelDesc[IN] venc channel desc
  849. * @return pic format
  850. */
  851. ACL_FUNC_VISIBILITY acldvppPixelFormat aclvencGetChannelDescPicFormat(const aclvencChannelDesc *channelDesc);
  852. /**
  853. * @ingroup AscendCL
  854. * @brief Get pic width for venc channel desc.
  855. * @param channelDesc[IN] venc channel desc
  856. * @return pic width, default 0
  857. */
  858. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescPicWidth(const aclvencChannelDesc *channelDesc);
  859. /**
  860. * @ingroup AscendCL
  861. * @brief Get pic height for venc channel desc.
  862. * @param channelDesc[IN] venc channel desc
  863. * @return pic height, default 0
  864. */
  865. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescPicHeight(const aclvencChannelDesc *channelDesc);
  866. /**
  867. * @ingroup AscendCL
  868. * @brief Get interval of key frame for venc channel desc.
  869. * @param channelDesc[IN] venc channel desc
  870. * @return interval of key frame, default 0
  871. */
  872. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescKeyFrameInterval(const aclvencChannelDesc *channelDesc);
  873. /**
  874. * @ingroup AscendCL
  875. * @brief get forced restart of I-frame interval from config
  876. * @param config[IN] venc frame config
  877. * @return 0: Not forced; 1: Forced restart of I-frame -1: error
  878. */
  879. ACL_FUNC_VISIBILITY uint8_t aclvencGetFrameConfigForceIFrame(const aclvencFrameConfig *config);
  880. /**
  881. * @ingroup AscendCL
  882. * @brief get forced restart of I-frame interval from config
  883. * @param config[IN] venc frame config
  884. * @return Whether it is the end frame: 0: no; 1: end frame
  885. */
  886. ACL_FUNC_VISIBILITY uint8_t aclvencGetFrameConfigEos(const aclvencFrameConfig *config);
  887. /**
  888. * @ingroup AscendCL
  889. * @brief set single frame encoding configuration parameters
  890. * @param config[IN/OUT] venc frame config
  891. * @param forceFrame[IN] forced restart of I-frame interval: 0: Not forced; 1: Forced restart of I-frame
  892. * @return ACL_ERROR_NONE for ok, others for fail
  893. */
  894. ACL_FUNC_VISIBILITY aclError aclvencSetFrameConfigForceIFrame(aclvencFrameConfig *config, uint8_t forceIFrame);
  895. /**
  896. * @ingroup AscendCL
  897. * @brief set single frame encoding configuration parameters
  898. * @param config[IN/OUT] venc frame config
  899. * @param eos[IN] Whether it is the end frame: 0: no; 1: end frame
  900. * @return ACL_ERROR_NONE for ok, others for fail
  901. */
  902. ACL_FUNC_VISIBILITY aclError aclvencSetFrameConfigEos(aclvencFrameConfig *config, uint8_t eos);
  903. /**
  904. * @ingroup AscendCL
  905. * @brief dvpp venc destroy frame config
  906. * @param config[IN/OUT] venc frame config
  907. * @return ACL_ERROR_NONE for ok, others for fail
  908. */
  909. ACL_FUNC_VISIBILITY aclError aclvencDestroyFrameConfig(aclvencFrameConfig *config);
  910. /**
  911. * @ingroup AscendCL
  912. * @brief Create dvpp venc frame config.
  913. * @return null for failed, other aclvencFrameConfig ptr
  914. */
  915. ACL_FUNC_VISIBILITY aclvencFrameConfig *aclvencCreateFrameConfig();
  916. /**
  917. * @ingroup AscendCL
  918. * @brief Create dvpp venc channel.
  919. * @param channelDesc[IN/OUT] venc channel desc
  920. * @return ACL_ERROR_NONE for ok, others for fail
  921. */
  922. ACL_FUNC_VISIBILITY aclError aclvencCreateChannel(aclvencChannelDesc *channelDesc);
  923. /**
  924. * @ingroup AscendCL
  925. * @brief Destroy dvpp venc channel.
  926. * @param channelDesc[IN/OUT] venc channel desc
  927. * @return ACL_ERROR_NONE for ok, others for fail
  928. */
  929. ACL_FUNC_VISIBILITY aclError aclvencDestroyChannel(aclvencChannelDesc *channelDesc);
  930. /**
  931. * @ingroup AscendCL
  932. * @brief dvpp venc launch send frame task.
  933. * @param channelDesc[IN/OUT] venc channel desc
  934. * @param input[IN/OUT] input picture desc
  935. * @param reserve[IN/OUT] reserve parameter
  936. * @param config[IN/OUT] dvpp frame config
  937. * @param userdata[IN/OUT] user callback function
  938. * @return ACL_ERROR_NONE for ok, others for fail
  939. */
  940. ACL_FUNC_VISIBILITY aclError aclvencSendFrame(aclvencChannelDesc *channelDesc, acldvppPicDesc *input, void *reserve,
  941. aclvencFrameConfig *config, void *userdata);
  942. /**
  943. * @ingroup AscendCL
  944. * @brief Create dvpp stream description.
  945. *
  946. * @retval null for failed.
  947. * @retval other success.
  948. */
  949. ACL_FUNC_VISIBILITY acldvppStreamDesc *acldvppCreateStreamDesc();
  950. /**
  951. * @ingroup AscendCL
  952. * @brief Destroy dvpp stream description.
  953. *
  954. * @par Function
  955. * Can only destroy acldvppStreamDesc type created through
  956. * acldvppCreateStreamDesc interface.
  957. * @param streamDesc [IN] dvpp stream description.
  958. * @retval ACL_ERROR_NONE The function is successfully executed.
  959. * @retval OtherValues Failure
  960. *
  961. * @see acldvppCreateStreamDesc
  962. */
  963. ACL_FUNC_VISIBILITY aclError acldvppDestroyStreamDesc(acldvppStreamDesc *streamDesc);
  964. /**
  965. * @ingroup AscendCL
  966. * @brief Set stream description's data addr.
  967. *
  968. * @param streamDesc [IN] dvpp stream description.
  969. * @param dataDev [IN] data addr.
  970. * @retval ACL_ERROR_NONE The function is successfully executed.
  971. * @retval OtherValues Failure
  972. */
  973. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescData(acldvppStreamDesc *streamDesc, void *dataDev);
  974. /**
  975. * @ingroup AscendCL
  976. * @brief Set stream description's data size.
  977. *
  978. * @param streamDesc [IN] dvpp stream description.
  979. * @param size [IN] data size.
  980. * @retval ACL_ERROR_NONE The function is successfully executed.
  981. * @retval OtherValues Failure
  982. */
  983. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescSize(acldvppStreamDesc *streamDesc, uint32_t size);
  984. /**
  985. * @ingroup AscendCL
  986. * @brief Set stream description's format.
  987. *
  988. * @param streamDesc [IN] dvpp stream description.
  989. * @param format [IN] stream format.
  990. * @retval ACL_ERROR_NONE The function is successfully executed.
  991. * @retval OtherValues Failure
  992. */
  993. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescFormat(acldvppStreamDesc *streamDesc, acldvppStreamFormat format);
  994. /**
  995. * @ingroup AscendCL
  996. * @brief Set stream description's timestamp.
  997. *
  998. * @param streamDesc [IN] dvpp stream description.
  999. * @param timestamp [IN] current timestamp.
  1000. * @retval ACL_ERROR_NONE The function is successfully executed.
  1001. * @retval OtherValues Failure
  1002. */
  1003. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescTimestamp(acldvppStreamDesc *streamDesc, uint64_t timestamp);
  1004. /**
  1005. * @ingroup AscendCL
  1006. * @brief Set stream description's ret code.
  1007. *
  1008. * @param streamDesc [IN] dvpp stream description.
  1009. * @param retCode [IN] result code.
  1010. * @retval ACL_ERROR_NONE The function is successfully executed.
  1011. * @retval OtherValues Failure
  1012. */
  1013. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescRetCode(acldvppStreamDesc *streamDesc, uint32_t retCode);
  1014. /**
  1015. * @ingroup AscendCL
  1016. * @brief Set stream description's eos.
  1017. *
  1018. * @param streamDesc [IN] dvpp stream description.
  1019. * @param eos [IN] end flag of sequence.
  1020. * @retval ACL_ERROR_NONE The function is successfully executed.
  1021. * @retval OtherValues Failure
  1022. */
  1023. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescEos(acldvppStreamDesc *streamDesc, uint8_t eos);
  1024. /**
  1025. * @ingroup AscendCL
  1026. * @brief Get stream description's data addr.
  1027. *
  1028. * @param streamDesc [IN] dvpp stream description.
  1029. * @retval data addr.
  1030. * @retval deault nullptr.
  1031. */
  1032. ACL_FUNC_VISIBILITY void *acldvppGetStreamDescData(const acldvppStreamDesc *streamDesc);
  1033. /**
  1034. * @ingroup AscendCL
  1035. * @brief Get stream description's data size.
  1036. *
  1037. * @param streamDesc [IN] dvpp stream description.
  1038. * @retval data size.
  1039. * @retval default 0.
  1040. */
  1041. ACL_FUNC_VISIBILITY uint32_t acldvppGetStreamDescSize(const acldvppStreamDesc *streamDesc);
  1042. /**
  1043. * @ingroup AscendCL
  1044. * @brief Get stream description's format.
  1045. *
  1046. * @param streamDesc [IN] dvpp stream description.
  1047. * @retval stream format.
  1048. * @retval default ACL_DVPP_STREAM_H264.
  1049. */
  1050. ACL_FUNC_VISIBILITY acldvppStreamFormat acldvppGetStreamDescFormat(const acldvppStreamDesc *streamDesc);
  1051. /**
  1052. * @ingroup AscendCL
  1053. * @brief Get stream description's timestamp.
  1054. *
  1055. * @param streamDesc [IN] dvpp stream description.
  1056. * @retval current timestamp.
  1057. * @retval default 0.
  1058. */
  1059. ACL_FUNC_VISIBILITY uint64_t acldvppGetStreamDescTimestamp(const acldvppStreamDesc *streamDesc);
  1060. /**
  1061. * @ingroup AscendCL
  1062. * @brief Get stream description's retCode.
  1063. *
  1064. * @param streamDesc [IN] dvpp stream description.
  1065. * @retval result code.
  1066. * @retval default 0.
  1067. */
  1068. ACL_FUNC_VISIBILITY uint32_t acldvppGetStreamDescRetCode(const acldvppStreamDesc *streamDesc);
  1069. /**
  1070. * @ingroup AscendCL
  1071. * @brief Get stream description's eos.
  1072. *
  1073. * @param streamDesc [IN] dvpp stream description.
  1074. * @retval end flag of sequence.
  1075. * @retval default 0(false).
  1076. */
  1077. ACL_FUNC_VISIBILITY uint8_t acldvppGetStreamDescEos(const acldvppStreamDesc *streamDesc);
  1078. /**
  1079. * @ingroup AscendCL
  1080. * @brief Create vdec frame config.
  1081. *
  1082. * @retval null for failed.
  1083. * @retval other success.
  1084. */
  1085. ACL_FUNC_VISIBILITY aclvdecFrameConfig *aclvdecCreateFrameConfig();
  1086. /**
  1087. * @ingroup AscendCL
  1088. * @brief Destroy vdec frame config.
  1089. *
  1090. * @par Function
  1091. * Can only destroy aclvdecFrameConfig type created through
  1092. * aclvdecCreateFrameConfig interface
  1093. * @param vdecFrameConfig [IN] vdec frame config.
  1094. * @retval ACL_ERROR_NONE The function is successfully executed.
  1095. * @retval OtherValues Failure
  1096. *
  1097. * @see aclvdecCreateFrameConfig
  1098. */
  1099. ACL_FUNC_VISIBILITY aclError aclvdecDestroyFrameConfig(aclvdecFrameConfig *vdecFrameConfig);
  1100. /**
  1101. * @ingroup AscendCL
  1102. * @brief Get image width and height of jpeg.
  1103. *
  1104. * @param data [IN] image data in host memory
  1105. * @param size [IN] the size of image data
  1106. * @param width [OUT] the width of image from image header
  1107. * @param height [OUT] the height of image from image header
  1108. * @param components [OUT] the components of image from image header
  1109. * @retval ACL_ERROR_NONE The function is successfully executed.
  1110. * @retval OtherValues Failure
  1111. */
  1112. ACL_FUNC_VISIBILITY aclError acldvppJpegGetImageInfo(const void *data,
  1113. uint32_t size,
  1114. uint32_t *width,
  1115. uint32_t *height,
  1116. int32_t *components);
  1117. /**
  1118. * @ingroup AscendCL
  1119. * @brief Predict encode size of jpeg image.
  1120. *
  1121. * @param inputDesc [IN] dvpp image desc
  1122. * @param config [IN] jpeg encode config
  1123. * @param size [OUT] the size predicted of image
  1124. * @retval ACL_ERROR_NONE The function is successfully executed.
  1125. * @retval OtherValues Failure
  1126. */
  1127. ACL_FUNC_VISIBILITY aclError acldvppJpegPredictEncSize(const acldvppPicDesc *inputDesc,
  1128. const acldvppJpegeConfig *config,
  1129. uint32_t *size);
  1130. /**
  1131. * @ingroup AscendCL
  1132. * @brief Predict decode size of jpeg image.
  1133. *
  1134. * @param data [IN] origin image data in host memory
  1135. * @param dataSize [IN] the size of origin image data
  1136. * @param outputPixelFormat [IN] the pixel format jpeg decode
  1137. * @param decSize [OUT] the size predicted for decode image
  1138. * @retval ACL_ERROR_NONE The function is successfully executed.
  1139. * @retval OtherValues Failure
  1140. */
  1141. ACL_FUNC_VISIBILITY aclError acldvppJpegPredictDecSize(const void *data,
  1142. uint32_t dataSize,
  1143. acldvppPixelFormat outputPixelFormat,
  1144. uint32_t *decSize);
  1145. /**
  1146. * @ingroup AscendCL
  1147. * @brief Create dvpp channel, the same channel can be reused
  1148. * and is no longer available after destruction.
  1149. *
  1150. * @param channelDesc [IN|OUT] the channel destruction
  1151. * @retval ACL_ERROR_NONE The function is successfully executed.
  1152. * @retval OtherValues Failure
  1153. *
  1154. * @see acldvppCreateChannelDesc
  1155. */
  1156. ACL_FUNC_VISIBILITY aclError acldvppCreateChannel(acldvppChannelDesc *channelDesc);
  1157. /**
  1158. * @ingroup AscendCL
  1159. * @brief Destroy dvpp channel.
  1160. *
  1161. * @par Restriction
  1162. * Can only destroy channel created through the acldvppCreateChannel interface
  1163. * @param channelDesc [IN] the channel destruction
  1164. * @retval ACL_ERROR_NONE The function is successfully executed.
  1165. * @retval OtherValues Failure
  1166. *
  1167. * @see acldvppCreateChannel
  1168. */
  1169. ACL_FUNC_VISIBILITY aclError acldvppDestroyChannel(acldvppChannelDesc *channelDesc);
  1170. /**
  1171. * @ingroup AscendCL
  1172. * @brief dvpp vpc resize.
  1173. *
  1174. * @par Restriction
  1175. * Width alignment requirements:
  1176. * @li The minimum stride is 32 and the maximum is 4096 * 4
  1177. * (that is, an image in argb format with a width of 4096);
  1178. * @li For 8K scaling, widthStride is required to be aligned to 2;
  1179. * @li For non 8K scaling, the calculation formula for widthStride
  1180. * is different for different image formats:
  1181. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  1182. * @li yuv422packed: input image width * 2 and then align to 16
  1183. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  1184. * @li xrgb8888: input image width * 4, align to 16
  1185. * @li HFBC:input image width
  1186. * Height alignment requirements:
  1187. * @li The height of the input image is aligned to 2.
  1188. * High stride minimum 6 and maximum 4096.
  1189. * @param channelDesc [IN] the channel destruction
  1190. * @param inputDesc [IN] resize input picture destruction
  1191. * @param outputDesc [IN|OUT] resize output picture destruction
  1192. * @param resizeConfig [IN] resize config
  1193. * @param stream [IN] resize task stream
  1194. * @retval ACL_ERROR_NONE The function is successfully executed.
  1195. * @retval OtherValues Failure
  1196. *
  1197. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1198. * | acldvppCreateResizeConfig
  1199. */
  1200. ACL_FUNC_VISIBILITY aclError acldvppVpcResizeAsync(acldvppChannelDesc *channelDesc,
  1201. acldvppPicDesc *inputDesc,
  1202. acldvppPicDesc *outputDesc,
  1203. acldvppResizeConfig *resizeConfig,
  1204. aclrtStream stream);
  1205. /**
  1206. * @ingroup AscendCL
  1207. * @brief dvpp vpc crop.
  1208. *
  1209. * @par Function
  1210. * crop the input picture according to the specified area,
  1211. * and then store the picture in the output memory as the output picture
  1212. *
  1213. * @par Restriction
  1214. * Width alignment requirements:
  1215. * @li The minimum stride is 32 and the maximum is 4096 * 4
  1216. * (that is, an image in argb format with a width of 4096);
  1217. * @li For 8K scaling, widthStride is required to be aligned to 2;
  1218. * @li For non 8K scaling, the calculation formula for widthStride
  1219. * is different for different image formats:
  1220. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  1221. * @li yuv422packed: input image width * 2 and then align to 16
  1222. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  1223. * @li xrgb8888: input image width * 4, align to 16
  1224. * @li HFBC:input image width
  1225. * Height alignment requirements:
  1226. * @li The height of the input image is aligned to 2.
  1227. * High stride minimum 6 and maximum 4096.
  1228. * @param channelDesc [IN] the channel destruction
  1229. * @param inputDesc [IN] crop input picture destruction
  1230. * @param outputDesc [IN|OUT] crop output picture destruction
  1231. * @param cropArea [IN] crop area config
  1232. * @param stream [IN] crop task stream
  1233. * @retval ACL_ERROR_NONE The function is successfully executed.
  1234. * @retval OtherValues Failure
  1235. */
  1236. ACL_FUNC_VISIBILITY aclError acldvppVpcCropAsync(acldvppChannelDesc *channelDesc,
  1237. acldvppPicDesc *inputDesc,
  1238. acldvppPicDesc *outputDesc,
  1239. acldvppRoiConfig *cropArea,
  1240. aclrtStream stream);
  1241. /**
  1242. * @ingroup AscendCL
  1243. * @brief dvpp vpc batch crop.
  1244. *
  1245. * @par Function
  1246. * crop the input batch picture according to the specified area
  1247. * as the output batch pictures
  1248. * @param channelDesc [IN] the channel destruction
  1249. * @param srcBatchPicDescs [IN|OUT] crop input batch picture destruction
  1250. * @param roiNums [IN] roi config numbers
  1251. * @param size [IN] roiNum size
  1252. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  1253. * @param cropAreas [IN] crop area configs
  1254. * @param stream [IN] crop batch task stream
  1255. * @retval ACL_ERROR_NONE The function is successfully executed.
  1256. * @retval OtherValues Failure
  1257. *
  1258. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig
  1259. */
  1260. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropAsync(acldvppChannelDesc *channelDesc,
  1261. acldvppBatchPicDesc *srcBatchPicDescs,
  1262. uint32_t *roiNums,
  1263. uint32_t size,
  1264. acldvppBatchPicDesc *dstBatchPicDescs,
  1265. acldvppRoiConfig *cropAreas[],
  1266. aclrtStream stream);
  1267. /**
  1268. * @ingroup AscendCL
  1269. * @brief dvpp vpc crop and paste.
  1270. *
  1271. * @par Function
  1272. * crop the input picture according to the specified area,
  1273. * and paste the picture to the specified position of the target picture
  1274. * as the output picture
  1275. * @param channelDesc [IN] thechannel destruction
  1276. * @param inputDesc [IN] crop and paste input picture destruction
  1277. * @param outputDesc [IN|OUT] crop and paste output picture destruction
  1278. * @param cropArea [IN] crop area config
  1279. * @param pasteArea [IN] paste area config
  1280. * @param stream [IN] crop and paste task stream
  1281. * @retval ACL_ERROR_NONE The function is successfully executed.
  1282. * @retval OtherValues Failure
  1283. *
  1284. * @see acldvppCreateChannel | acldvppCreatePicDesc | acldvppCreateRoiConfig
  1285. */
  1286. ACL_FUNC_VISIBILITY aclError acldvppVpcCropAndPasteAsync(acldvppChannelDesc *channelDesc,
  1287. acldvppPicDesc *inputDesc,
  1288. acldvppPicDesc *outputDesc,
  1289. acldvppRoiConfig *cropArea,
  1290. acldvppRoiConfig *pasteArea,
  1291. aclrtStream stream);
  1292. /**
  1293. * @ingroup AscendCL
  1294. * @brief dvpp vpc batch crop and paste.
  1295. *
  1296. * @par Function
  1297. * crop the input batch picture according to the specified area,
  1298. * and paste the pictures to the specified position of the target pictures
  1299. * as the output batch pictures
  1300. * @param channelDesc [IN] the channel destruction
  1301. * @param srcBatchPicDescs [IN|OUT] crop input batch picture destruction
  1302. * @param roiNums [IN] roi config numbers
  1303. * @param size [IN] roiNum size
  1304. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  1305. * @param cropAreas [IN] crop area configs
  1306. * @param pasteAreas [IN] paste area configs
  1307. * @param stream [IN] crop batch task stream
  1308. * @retval ACL_ERROR_NONE The function is successfully executed.
  1309. * @retval OtherValues Failure
  1310. *
  1311. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig
  1312. */
  1313. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropAndPasteAsync(acldvppChannelDesc *channelDesc,
  1314. acldvppBatchPicDesc *srcBatchPicDescs,
  1315. uint32_t *roiNums,
  1316. uint32_t size,
  1317. acldvppBatchPicDesc *dstBatchPicDescs,
  1318. acldvppRoiConfig *cropAreas[],
  1319. acldvppRoiConfig *pasteAreas[],
  1320. aclrtStream stream);
  1321. /**
  1322. * @ingroup AscendCL
  1323. * @brief dvpp vpc jpeg decode.
  1324. *
  1325. * @par Function
  1326. * For different source picture formats, after decoding,
  1327. * output pictures in the following format:
  1328. * @li jpeg(444) -> YUV444SP:V is front U is back,
  1329. * YUV420 SP V is front U is back, YUV420SP U is front V is back;
  1330. * @li jpeg(422) -> YUV422SP:V is in front U is behind,
  1331. * YUV420SP V is in front U is behind, YUV420SP U is in front V is behind;
  1332. * @li jpeg(420) -> YUV420SP:
  1333. * V is front U is back, YUV420SP U is front V is back;
  1334. * @li jpeg(400) -> YUV420SP:UV data is filled with 0 x 80.
  1335. * @param channelDesc [IN] the channel destruction
  1336. * @param data [IN] decode input picture destruction's data
  1337. * @param size [IN] decode input picture destruction's size
  1338. * @param outputDesc [IN|OUT] decode output picture destruction
  1339. * @param stream [IN] decode task stream
  1340. * @retval ACL_ERROR_NONE The function is successfully executed.
  1341. * @retval OtherValues Failure
  1342. *
  1343. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1344. */
  1345. ACL_FUNC_VISIBILITY aclError acldvppJpegDecodeAsync(acldvppChannelDesc *channelDesc,
  1346. const void *data,
  1347. uint32_t size,
  1348. acldvppPicDesc *outputDesc,
  1349. aclrtStream stream);
  1350. /**
  1351. * @ingroup AscendCL
  1352. * @brief dvpp vpc jpeg encode.
  1353. *
  1354. * @param channelDesc [IN] the channel destruction
  1355. * @param inputDesc [IN] encode input picture destruction
  1356. * @param data [IN] encode output picture destruction's data
  1357. * @param size [IN] encode output picture destruction's size
  1358. * @param config [IN] jpeg encode config
  1359. * @param stream [IN] encode task stream
  1360. * @retval ACL_ERROR_NONE The function is successfully executed.
  1361. * @retval OtherValues Failure
  1362. *
  1363. * @see acldvppCreateChannel | acldvppCreateJpegeConfig
  1364. */
  1365. ACL_FUNC_VISIBILITY aclError acldvppJpegEncodeAsync(acldvppChannelDesc *channelDesc,
  1366. acldvppPicDesc *inputDesc,
  1367. const void *data,
  1368. uint32_t *size,
  1369. acldvppJpegeConfig *config,
  1370. aclrtStream stream);
  1371. /**
  1372. * @ingroup AscendCL
  1373. * @brief Create vdec channel.
  1374. *
  1375. * @par Function
  1376. * Create a channel for video data processing,
  1377. * the same channel can be reused,
  1378. * and is no longer available after destruction
  1379. * @param channelDesc [IN] the channel destruction
  1380. * @retval ACL_ERROR_NONE The function is successfully executed.
  1381. * @retval OtherValues Failure
  1382. *
  1383. * @see aclvdecCreateChannelDesc
  1384. */
  1385. ACL_FUNC_VISIBILITY aclError aclvdecCreateChannel(aclvdecChannelDesc *channelDesc);
  1386. /**
  1387. * @ingroup AscendCL
  1388. * @brief Destroy vdec channel.
  1389. *
  1390. * @par Function
  1391. * Can only destroy channels created by the aclvdecCreateChannel interface
  1392. * @param channelDesc [IN] the channel destruction
  1393. * @retval ACL_ERROR_NONE The function is successfully executed.
  1394. * @retval OtherValues Failure
  1395. *
  1396. * @see aclvdecCreateChannel
  1397. */
  1398. ACL_FUNC_VISIBILITY aclError aclvdecDestroyChannel(aclvdecChannelDesc *channelDesc);
  1399. /**
  1400. * @ingroup AscendCL
  1401. * @brief dvpp vdec send frame.
  1402. *
  1403. * @par Function
  1404. * Pass the input memory to be decoded
  1405. * and the decoded output memory to the decoder for decoding
  1406. * @param channelDesc [IN] vdec channel destruction
  1407. * @param input [IN] input stream destruction
  1408. * @param output [IN] output picture destruction
  1409. * @param config [IN] vdec frame config
  1410. * @param userData [IN] user data for callback function
  1411. * @retval ACL_ERROR_NONE The function is successfully executed.
  1412. * @retval OtherValues Failure
  1413. *
  1414. * @see aclvdecCreateChannel | acldvppCreateStreamDesc | acldvppCreatePicDesc
  1415. */
  1416. ACL_FUNC_VISIBILITY aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc,
  1417. acldvppStreamDesc *input,
  1418. acldvppPicDesc *output,
  1419. aclvdecFrameConfig *config,
  1420. void* userData);
  1421. /**
  1422. * @ingroup AscendCL
  1423. * @brief dvpp vpc convert color.
  1424. *
  1425. * @par Restriction
  1426. * @li outputDesc:Width height stride, No changes are allowed. Just configure 0
  1427. * @par Function
  1428. * Convert color gamut
  1429. * @param channelDesc [IN|OUT] the channel destruction
  1430. * @param inputDesc [IN|OUT] convert color input picture destruction
  1431. * @param outputDesc [IN|OUT] convert color output picture destruction
  1432. * @param stream [IN] convert color task stream
  1433. * @retval ACL_ERROR_NONE The function is successfully executed.
  1434. * @retval OtherValues Failure
  1435. *
  1436. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1437. */
  1438. ACL_FUNC_VISIBILITY aclError acldvppVpcConvertColorAsync(acldvppChannelDesc *channelDesc,
  1439. acldvppPicDesc *inputDesc,
  1440. acldvppPicDesc *outputDesc,
  1441. aclrtStream stream);
  1442. /**
  1443. * @ingroup AscendCL
  1444. * @brief dvpp vpc pyramid down.
  1445. *
  1446. * @par Restriction
  1447. * @li outputDesc:format only supported YUV400
  1448. * @par Function
  1449. * Image pyramid down
  1450. * @param channelDesc [IN|OUT] the channel destruction
  1451. * @param inputDesc [IN|OUT] pyr down input picture destruction
  1452. * @param outputDesc [IN|OUT] pyr down output picture destruction
  1453. * @param reserve [IN|OUT] reserved param , must be nullptr
  1454. * @param stream [IN] pyr down task stream
  1455. * @retval ACL_ERROR_NONE The function is successfully executed.
  1456. * @retval OtherValues Failure
  1457. *
  1458. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1459. */
  1460. ACL_FUNC_VISIBILITY aclError acldvppVpcPyrDownAsync(acldvppChannelDesc *channelDesc,
  1461. acldvppPicDesc *inputDesc,
  1462. acldvppPicDesc *outputDesc,
  1463. void *reserve,
  1464. aclrtStream stream);
  1465. /**
  1466. * @ingroup AscendCL
  1467. * @brief Set dvpp channel mode.
  1468. *
  1469. * @param channelDesc [IN|OUT] the channel destruction
  1470. * @param mode [IN] channel mode
  1471. * @retval ACL_ERROR_NONE The function is successfully executed.
  1472. * @retval OtherValues Failure
  1473. */
  1474. ACL_FUNC_VISIBILITY aclError acldvppSetChannelDescMode(acldvppChannelDesc *channelDesc,
  1475. uint32_t mode);
  1476. /**
  1477. * @ingroup AscendCL
  1478. * @brief Set resize config interpolation.
  1479. *
  1480. * @param resizeConfig [IN|OUT] the resize config
  1481. * @param interpolation [IN] interpolation
  1482. * @retval ACL_ERROR_NONE The function is successfully executed.
  1483. * @retval OtherValues Failure
  1484. */
  1485. ACL_FUNC_VISIBILITY aclError acldvppSetResizeConfigInterpolation(acldvppResizeConfig *resizeConfig,
  1486. uint32_t interpolation);
  1487. /**
  1488. * @ingroup AscendCL
  1489. * @brief Get resize config interpolation.
  1490. * @param resizeConfig [IN] the resize config
  1491. * @retval Interpolation of resize config.
  1492. */
  1493. ACL_FUNC_VISIBILITY uint32_t acldvppGetResizeConfigInterpolation(const acldvppResizeConfig *resizeConfig);
  1494. /**
  1495. * @ingroup AscendCL
  1496. * @brief Set vdec channel out mode.
  1497. *
  1498. * @param channelDesc [IN|OUT] the channel destruction
  1499. * @param outMode [IN] channel out mode
  1500. * @retval ACL_ERROR_NONE The function is successfully executed.
  1501. * @retval OtherValues Failure
  1502. */
  1503. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutMode(aclvdecChannelDesc *channelDesc,
  1504. uint32_t outMode);
  1505. /**
  1506. * @ingroup AscendCL
  1507. * @brief Create dvpp batch picture description.
  1508. *
  1509. * @param batchSize [IN] batch size
  1510. * @retval null for failed.
  1511. * @retval OtherValues success.
  1512. */
  1513. ACL_FUNC_VISIBILITY acldvppBatchPicDesc *acldvppCreateBatchPicDesc(uint32_t batchSize);
  1514. /**
  1515. * @ingroup AscendCL
  1516. * @brief Get dvpp picture description.
  1517. *
  1518. * @param batchPicDesc [IN] dvpp batch picture description.
  1519. * @param index [IN] index of batch
  1520. * @retval null for failed.
  1521. * @retval OtherValues Failure
  1522. *
  1523. * @see acldvppCreateBatchPicDesc
  1524. */
  1525. ACL_FUNC_VISIBILITY acldvppPicDesc *acldvppGetPicDesc(acldvppBatchPicDesc *batchPicDesc, uint32_t index);
  1526. /**
  1527. * @ingroup AscendCL
  1528. * @brief Destroy dvpp batch picture description.
  1529. *
  1530. * @par Function
  1531. * Can only destroy batch picture description information created
  1532. * through acldvppCreateBatchPicDesc interface.
  1533. * @param batchPicDesc [IN] dvpp batch picture description.
  1534. * @retval ACL_ERROR_NONE The function is successfully executed.
  1535. * @retval OtherValues Failure
  1536. *
  1537. * @see acldvppCreateBatchPicDesc
  1538. */
  1539. ACL_FUNC_VISIBILITY aclError acldvppDestroyBatchPicDesc(acldvppBatchPicDesc *batchPicDesc);
  1540. #ifdef __cplusplus
  1541. }
  1542. #endif
  1543. #endif // INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_

MegEngine 安装包中集成了使用 GPU 运行代码所需的 CUDA 环境,不用区分 CPU 和 GPU 版。 如果想要运行 GPU 程序,请确保机器本身配有 GPU 硬件设备并安装好驱动。 如果你想体验在云端 GPU 算力平台进行深度学习开发的感觉,欢迎访问 MegStudio 平台