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 90 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665
  1. /**
  2. * Copyright 2019-2020 Huawei Technologies Co., Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #if !defined(ENABLE_DVPP_INTERFACE)
  17. #if defined(_MSC_VER)
  18. #error message("if you want to use dvpp funtions ,please use the macro definition (ENABLE_DVPP_INTERFACE).")
  19. #else
  20. #error "if you want to use dvpp funtions ,please use the macro definition (ENABLE_DVPP_INTERFACE)."
  21. #endif
  22. #endif
  23. #ifndef INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
  24. #define INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_
  25. #include <stdint.h>
  26. #include <stddef.h>
  27. #include "acl/acl.h"
  28. #include "acl/acl_base.h"
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. typedef struct acldvppPicDesc acldvppPicDesc;
  33. typedef struct acldvppBatchPicDesc acldvppBatchPicDesc;
  34. typedef struct acldvppRoiConfig acldvppRoiConfig;
  35. typedef struct acldvppResizeConfig acldvppResizeConfig;
  36. typedef struct acldvppBorderConfig acldvppBorderConfig;
  37. typedef struct acldvppLutMap acldvppLutMap;
  38. typedef struct acldvppChannelDesc acldvppChannelDesc;
  39. typedef struct acldvppJpegeConfig acldvppJpegeConfig;
  40. typedef struct aclvdecChannelDesc aclvdecChannelDesc;
  41. typedef struct acldvppStreamDesc acldvppStreamDesc;
  42. typedef struct aclvdecFrameConfig aclvdecFrameConfig;
  43. typedef struct aclvencChannelDesc aclvencChannelDesc;
  44. typedef struct aclvencFrameConfig aclvencFrameConfig;
  45. typedef struct acldvppHist acldvppHist;
  46. typedef void (*aclvdecCallback)(acldvppStreamDesc *input, acldvppPicDesc *output, void *userData);
  47. typedef void (*aclvencCallback)(acldvppPicDesc *input, acldvppStreamDesc *output, void *userdata);
  48. // Supported Pixel Format
  49. enum acldvppPixelFormat {
  50. PIXEL_FORMAT_YUV_400 = 0, // 0
  51. PIXEL_FORMAT_YUV_SEMIPLANAR_420 = 1, // 1
  52. PIXEL_FORMAT_YVU_SEMIPLANAR_420 = 2, // 2
  53. PIXEL_FORMAT_YUV_SEMIPLANAR_422 = 3, // 3
  54. PIXEL_FORMAT_YVU_SEMIPLANAR_422 = 4, // 4
  55. PIXEL_FORMAT_YUV_SEMIPLANAR_444 = 5, // 5
  56. PIXEL_FORMAT_YVU_SEMIPLANAR_444 = 6, // 6
  57. PIXEL_FORMAT_YUYV_PACKED_422 = 7, // 7
  58. PIXEL_FORMAT_UYVY_PACKED_422 = 8, // 8
  59. PIXEL_FORMAT_YVYU_PACKED_422 = 9, // 9
  60. PIXEL_FORMAT_VYUY_PACKED_422 = 10, // 10
  61. PIXEL_FORMAT_YUV_PACKED_444 = 11, // 11
  62. PIXEL_FORMAT_RGB_888 = 12, // 12
  63. PIXEL_FORMAT_BGR_888 = 13, // 13
  64. PIXEL_FORMAT_ARGB_8888 = 14, // 14
  65. PIXEL_FORMAT_ABGR_8888 = 15, // 15
  66. PIXEL_FORMAT_RGBA_8888 = 16, // 16
  67. PIXEL_FORMAT_BGRA_8888 = 17, // 17
  68. PIXEL_FORMAT_YUV_SEMI_PLANNER_420_10BIT = 18, // 18
  69. PIXEL_FORMAT_YVU_SEMI_PLANNER_420_10BIT = 19, // 19
  70. PIXEL_FORMAT_YVU_PLANAR_420 = 20, // 20
  71. PIXEL_FORMAT_YVU_PLANAR_422,
  72. PIXEL_FORMAT_YVU_PLANAR_444,
  73. PIXEL_FORMAT_RGB_444 = 23,
  74. PIXEL_FORMAT_BGR_444,
  75. PIXEL_FORMAT_ARGB_4444,
  76. PIXEL_FORMAT_ABGR_4444,
  77. PIXEL_FORMAT_RGBA_4444,
  78. PIXEL_FORMAT_BGRA_4444,
  79. PIXEL_FORMAT_RGB_555,
  80. PIXEL_FORMAT_BGR_555,
  81. PIXEL_FORMAT_RGB_565,
  82. PIXEL_FORMAT_BGR_565,
  83. PIXEL_FORMAT_ARGB_1555,
  84. PIXEL_FORMAT_ABGR_1555,
  85. PIXEL_FORMAT_RGBA_1555,
  86. PIXEL_FORMAT_BGRA_1555,
  87. PIXEL_FORMAT_ARGB_8565,
  88. PIXEL_FORMAT_ABGR_8565,
  89. PIXEL_FORMAT_RGBA_8565,
  90. PIXEL_FORMAT_BGRA_8565,
  91. PIXEL_FORMAT_RGB_BAYER_8BPP = 50,
  92. PIXEL_FORMAT_RGB_BAYER_10BPP,
  93. PIXEL_FORMAT_RGB_BAYER_12BPP,
  94. PIXEL_FORMAT_RGB_BAYER_14BPP,
  95. PIXEL_FORMAT_RGB_BAYER_16BPP,
  96. PIXEL_FORMAT_BGR_888_PLANAR = 70,
  97. PIXEL_FORMAT_HSV_888_PACKAGE,
  98. PIXEL_FORMAT_HSV_888_PLANAR,
  99. PIXEL_FORMAT_LAB_888_PACKAGE,
  100. PIXEL_FORMAT_LAB_888_PLANAR,
  101. PIXEL_FORMAT_S8C1,
  102. PIXEL_FORMAT_S8C2_PACKAGE,
  103. PIXEL_FORMAT_S8C2_PLANAR,
  104. PIXEL_FORMAT_S16C1,
  105. PIXEL_FORMAT_U8C1,
  106. PIXEL_FORMAT_U16C1,
  107. PIXEL_FORMAT_S32C1,
  108. PIXEL_FORMAT_U32C1,
  109. PIXEL_FORMAT_U64C1,
  110. PIXEL_FORMAT_S64C1,
  111. PIXEL_FORMAT_YUV_SEMIPLANAR_440 = 1000,
  112. PIXEL_FORMAT_YVU_SEMIPLANAR_440,
  113. PIXEL_FORMAT_FLOAT32,
  114. PIXEL_FORMAT_BUTT,
  115. PIXEL_FORMAT_UNKNOWN = 10000
  116. };
  117. // Stream Format
  118. enum acldvppStreamFormat {
  119. H265_MAIN_LEVEL = 0,
  120. H264_BASELINE_LEVEL,
  121. H264_MAIN_LEVEL,
  122. H264_HIGH_LEVEL
  123. };
  124. // Supported Channel Mode
  125. enum acldvppChannelMode {
  126. DVPP_CHNMODE_VPC = 1,
  127. DVPP_CHNMODE_JPEGD = 2,
  128. DVPP_CHNMODE_JPEGE = 4
  129. };
  130. // Supported Border Type
  131. enum acldvppBorderType {
  132. BORDER_CONSTANT = 0,
  133. BORDER_REPLICATE,
  134. BORDER_REFLECT,
  135. BORDER_REFLECT_101
  136. };
  137. // Venc parameter type
  138. enum aclvencChannelDescParamType {
  139. ACL_VENC_THREAD_ID_UINT64 = 0,
  140. ACL_VENC_CALLBACK_PTR,
  141. ACL_VENC_PIXEL_FORMAT_UINT32,
  142. ACL_VENC_ENCODE_TYPE_UINT32,
  143. ACL_VENC_PIC_WIDTH_UINT32,
  144. ACL_VENC_PIC_HEIGHT_UINT32,
  145. ACL_VENC_KEY_FRAME_INTERVAL_UINT32,
  146. ACL_VENC_BUF_ADDR_PTR,
  147. ACL_VENC_BUF_SIZE_UINT32,
  148. ACL_VENC_RC_MODE_UINT32,
  149. ACL_VENC_SRC_RATE_UINT32,
  150. ACL_VENC_MAX_BITRATE_UINT32,
  151. ACL_VENC_MAX_IP_PROP_UINT32
  152. };
  153. // Jpeg picture format
  154. enum acldvppJpegFormat {
  155. ACL_JPEG_CSS_444 = 0,
  156. ACL_JPEG_CSS_422,
  157. ACL_JPEG_CSS_420,
  158. ACL_JPEG_CSS_GRAY,
  159. ACL_JPEG_CSS_440,
  160. ACL_JPEG_CSS_411,
  161. ACL_JPEG_CSS_UNKNOWN = 1000
  162. };
  163. /**
  164. * @ingroup AscendCL
  165. * @brief alloc device memory for dvpp.
  166. *
  167. * @par Function
  168. * @li It's mainly used for allocating memory to device media data processing.
  169. * The requested memory meets the data processing requirements.
  170. * After calling this interface to request memory,
  171. * you must release the memory using the acldvppFree interface.
  172. * @li When calling the acldvppMalloc interface to apply for memory,
  173. * the size entered by the user is aligned upwards to 32 integer multiples,
  174. * and an additional 32 bytes are applied.
  175. *
  176. * @par Restriction
  177. * If the user uses the acldvppMalloc interface to apply for a large block of
  178. * memory and divide and manage the memory by himself,
  179. * when applying for memory, the user needs to align up to 32 integer
  180. * times + 32 bytes (ALIGN_UP [len] +32 words) according to
  181. * the actual data size of each picture Section) to manage memory.
  182. *
  183. * @param devPtr [OUT] memory pointer.
  184. * @param size [IN] memory size.
  185. *
  186. * @retval ACL_SUCCESS The function is successfully executed.
  187. * @retval OtherValues Failure
  188. *
  189. * @see acldvppFree
  190. */
  191. ACL_FUNC_VISIBILITY aclError acldvppMalloc(void **devPtr, size_t size);
  192. /**
  193. * @ingroup AscendCL
  194. * @brief free device memory for dvpp.
  195. *
  196. * @par Function
  197. * Free the memory requested through the acldvppMalloc interface
  198. * @param devPtr [IN] memory pointer to free.
  199. *
  200. * @retval ACL_SUCCESS The function is successfully executed.
  201. * @retval OtherValues Failure
  202. *
  203. * @see acldvppMalloc
  204. */
  205. ACL_FUNC_VISIBILITY aclError acldvppFree(void *devPtr);
  206. /**
  207. * @ingroup AscendCL
  208. * @brief create DvppChannelDesc.
  209. *
  210. * @par Function
  211. * Create a channel for image data processing.
  212. * The same channel can be reused
  213. * and is no longer available after destruction
  214. *
  215. * @retval null for failed.
  216. * @retval OtherValues success.
  217. */
  218. ACL_FUNC_VISIBILITY acldvppChannelDesc *acldvppCreateChannelDesc();
  219. /**
  220. * @ingroup AscendCL
  221. * @brief destroy dvppChannelDesc.
  222. *
  223. * @par Function
  224. * Can only destroy channels created by the acldvppCreateChannel interface
  225. * @param channelDesc [IN] the channel description.
  226. *
  227. * @retval ACL_SUCCESS The function is successfully executed.
  228. * @retval OtherValues Failure
  229. *
  230. * @see acldvppCreateChannelDesc | acldvppDestroyChannel
  231. */
  232. ACL_FUNC_VISIBILITY aclError acldvppDestroyChannelDesc(acldvppChannelDesc *channelDesc);
  233. /**
  234. * @ingroup AscendCL
  235. * @brief Get dvpp channel Id.
  236. *
  237. * @par Restriction
  238. * Interface calling sequence:
  239. * acldvppCreateChannelDesc --> acldvppCreateChannel -->
  240. * acldvppGetChannelDescChannelId
  241. *
  242. * @param channelDesc [IN] the channel description.
  243. *
  244. * @retval channel id.
  245. *
  246. * @see acldvppCreateChannelDesc | acldvppCreateChannel
  247. */
  248. ACL_FUNC_VISIBILITY uint64_t acldvppGetChannelDescChannelId(const acldvppChannelDesc *channelDesc);
  249. /**
  250. * @ingroup AscendCL
  251. * @brief Create dvpp picture description.
  252. *
  253. * @retval null for failed.
  254. * @retval OtherValues success.
  255. */
  256. ACL_FUNC_VISIBILITY acldvppPicDesc *acldvppCreatePicDesc();
  257. /**
  258. * @ingroup AscendCL
  259. * @brief Destroy dvpp picture description.
  260. *
  261. * @par Function
  262. * Can only destroy picture description information created
  263. * through acldvppCreatePicDesc interface.
  264. * @param picDesc [IN] dvpp picture description.
  265. *
  266. * @retval ACL_SUCCESS The function is successfully executed.
  267. * @retval OtherValues Failure
  268. *
  269. * @see acldvppCreatePicDesc
  270. */
  271. ACL_FUNC_VISIBILITY aclError acldvppDestroyPicDesc(acldvppPicDesc *picDesc);
  272. /**
  273. * @ingroup AscendCL
  274. * @brief Set dvpp picture description's data.
  275. *
  276. * @param picDesc [OUT] dvpp picture description.
  277. * @param dataDev [IN] dvpp picture dataDev.Must be the memory
  278. * requested using the acldvppMalloc interface.
  279. *
  280. * @retval ACL_SUCCESS The function is successfully executed.
  281. * @retval OtherValues Failure
  282. *
  283. * @see acldvppMalloc
  284. */
  285. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescData(acldvppPicDesc *picDesc, void *dataDev);
  286. /**
  287. * @ingroup AscendCL
  288. * @brief Set dvpp picture description's size.
  289. *
  290. * @param picDesc [OUT] dvpp picture description.
  291. * @param size dvpp [IN] picture size.
  292. *
  293. * @retval ACL_SUCCESS The function is successfully executed.
  294. * @retval OtherValues Failure
  295. */
  296. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescSize(acldvppPicDesc *picDesc, uint32_t size);
  297. /**
  298. * @ingroup AscendCL
  299. * @brief Set dvpp picture description's format.
  300. *
  301. * @param picDesc [OUT] dvpp picture description.
  302. * @param format [IN] dvpp picture format.
  303. *
  304. * @retval ACL_SUCCESS The function is successfully executed.
  305. * @retval OtherValues Failure
  306. */
  307. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescFormat(acldvppPicDesc *picDesc, acldvppPixelFormat format);
  308. /**
  309. * @ingroup AscendCL
  310. * @brief Set dvpp picture description's width.
  311. *
  312. * @param picDesc [OUT] dvpp picture description.
  313. * @param width [IN] dvpp picture width.
  314. *
  315. * @retval ACL_SUCCESS The function is successfully executed.
  316. * @retval OtherValues Failure
  317. */
  318. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescWidth(acldvppPicDesc *picDesc, uint32_t width);
  319. /**
  320. * @ingroup AscendCL
  321. * @brief Set dvpp picture description's height.
  322. *
  323. * @param picDesc [OUT] dvpp picture description.
  324. * @param height [IN] dvpp picture height.
  325. *
  326. * @retval ACL_SUCCESS The function is successfully executed.
  327. * @retval OtherValues Failure
  328. */
  329. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescHeight(acldvppPicDesc *picDesc, uint32_t height);
  330. /**
  331. * @ingroup AscendCL
  332. * @brief Set dvpp picture description's widthStride.
  333. *
  334. * @par Restriction
  335. * Width alignment requirements:
  336. * @li The minimum stride is 32 and the maximum is 4096 * 4
  337. * (that is, an image in argb format with a width of 4096);
  338. * @li For 8K scaling, widthStride is required to be aligned to 2;
  339. * @li For non 8K scaling, the calculation formula for widthStride
  340. * is different for different image formats:
  341. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  342. * @li yuv422packed: input image width * 2 and then align to 16
  343. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  344. * @li xrgb8888: input image width * 4, align to 16
  345. * @li HFBC:input image width
  346. *
  347. * @param picDesc [OUT] dvpp picture description.
  348. * @param widthStride [IN] dvpp picture widthStride.
  349. *
  350. * @retval ACL_SUCCESS The function is successfully executed.
  351. * @retval OtherValues Failure
  352. */
  353. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescWidthStride(acldvppPicDesc *picDesc, uint32_t widthStride);
  354. /**
  355. * @ingroup AscendCL
  356. * @brief Set dvpp picture description's heightStride.
  357. *
  358. * @par Restriction
  359. * Height alignment requirements:
  360. * @li The height of the input image is aligned to 2.
  361. * High stride minimum 6 and maximum 4096.
  362. *
  363. * @param picDesc [OUT] dvpp picture description.
  364. * @param heightStride [IN] dvpp picture heightStride.
  365. *
  366. * @retval ACL_SUCCESS The function is successfully executed.
  367. * @retval OtherValues Failure
  368. */
  369. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescHeightStride(acldvppPicDesc *picDesc, uint32_t heightStride);
  370. /**
  371. * @ingroup AscendCL
  372. * @brief Set dvpp picture description's retcode.
  373. *
  374. * @param picDesc [OUT] dvpp picture description.
  375. * @param retCode [IN] dvpp picture retcode.
  376. *
  377. * @retval ACL_SUCCESS The function is successfully executed.
  378. * @retval OtherValues Failure
  379. */
  380. ACL_FUNC_VISIBILITY aclError acldvppSetPicDescRetCode(acldvppPicDesc *picDesc, uint32_t retCode);
  381. /**
  382. * @ingroup AscendCL
  383. * @brief Get picture data.
  384. *
  385. * @param picDesc [IN] dvpp picture description.
  386. *
  387. * @retval picture data addr.
  388. * @retval default nullptr.
  389. */
  390. ACL_FUNC_VISIBILITY void *acldvppGetPicDescData(const acldvppPicDesc *picDesc);
  391. /**
  392. * @ingroup AscendCL
  393. * @brief Get picture data size.
  394. *
  395. * @param picDesc [IN] dvpp picture description.
  396. *
  397. * @retval picture data size.
  398. * @retval default 0.
  399. */
  400. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescSize(const acldvppPicDesc *picDesc);
  401. /**
  402. * @ingroup AscendCL
  403. * @brief Get dvpp picture desc's format.
  404. *
  405. * @param picDesc [IN] dvpp picture description.
  406. *
  407. * @retval format
  408. * @retval default PIXEL_FORMAT_YUV_400.
  409. */
  410. ACL_FUNC_VISIBILITY acldvppPixelFormat acldvppGetPicDescFormat(const acldvppPicDesc *picDesc);
  411. /**
  412. * @ingroup AscendCL
  413. * @brief Get dvpp picture desc's width.
  414. *
  415. * @param picDesc [IN] dvpp picture description.
  416. *
  417. * @retval width.
  418. * @retval default 0.
  419. */
  420. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescWidth(const acldvppPicDesc *picDesc);
  421. /**
  422. * @ingroup AscendCL
  423. * @brief Get dvpp picture desc's height.
  424. *
  425. * @param picDesc [IN] dvpp picture description.
  426. *
  427. * @retval height.
  428. * @retval default 0.
  429. */
  430. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescHeight(const acldvppPicDesc *picDesc);
  431. /**
  432. * @ingroup AscendCL
  433. * @brief Get dvpp picture desc's widthStride.
  434. *
  435. * @par Restriction
  436. * Width alignment requirements:
  437. * @li The minimum stride is 32 and the maximum is 4096 * 4
  438. * (that is, an image in argb format with a width of 4096);
  439. * @li For 8K scaling, widthStride is required to be aligned to 2;
  440. * @li For non 8K scaling, the calculation formula for widthStride
  441. * is different for different image formats:
  442. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  443. * @li yuv422packed: input image width * 2 and then align to 16
  444. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  445. * @li xrgb8888: input image width * 4, align to 16
  446. * @li HFBC:input image width
  447. *
  448. * @param picDesc [IN] dvpp picture description.
  449. *
  450. * @retval stride width.
  451. * @retval default 0.
  452. */
  453. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescWidthStride(const acldvppPicDesc *picDesc);
  454. /**
  455. * @ingroup AscendCL
  456. * @brief Get dvpp picture desc's heightStride.
  457. *
  458. * @par Restriction
  459. * Height alignment requirements:
  460. * @li The height of the input image is aligned to 2.
  461. * High stride minimum 6 and maximum 4096.
  462. *
  463. * @param picDesc [IN] dvpp picture description.
  464. *
  465. * @retval stride height.
  466. * @retval default 0.
  467. */
  468. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescHeightStride(const acldvppPicDesc *picDesc);
  469. /**
  470. * @ingroup AscendCL
  471. * @brief Get dvpp picture desc's retcode.
  472. *
  473. * @param picDesc [IN] dvpp picture description.
  474. *
  475. * @retval ret code.
  476. * @retval default 0.
  477. */
  478. ACL_FUNC_VISIBILITY uint32_t acldvppGetPicDescRetCode(const acldvppPicDesc *picDesc);
  479. /**
  480. * @ingroup AscendCL
  481. * @brief Create dvpp roi config.
  482. *
  483. * @param left [IN] the left offset, must be even
  484. * @param right [IN] the right offset, must be odd
  485. * @param top [IN] the top offset, must be even
  486. * @param bottom [IN] the bottom offset, must be odd
  487. *
  488. * @retval null for failed.
  489. * @retval other success
  490. */
  491. ACL_FUNC_VISIBILITY acldvppRoiConfig *acldvppCreateRoiConfig(uint32_t left,
  492. uint32_t right,
  493. uint32_t top,
  494. uint32_t bottom);
  495. /**
  496. * @ingroup AscendCL
  497. * @brief Destroy dvpp roi config.
  498. *
  499. * @par Function
  500. * Destroys data created through the acldvppCreateRoiConfig interface
  501. * @param roiConfig [IN] dvpp roi config.
  502. *
  503. * @retval ACL_SUCCESS The function is successfully executed.
  504. * @retval OtherValues Failure
  505. *
  506. * @see acldvppCreateRoiConfig
  507. */
  508. ACL_FUNC_VISIBILITY aclError acldvppDestroyRoiConfig(acldvppRoiConfig *roiConfig);
  509. /**
  510. * @ingroup AscendCL
  511. * @brief Set left of RoiConfig.
  512. *
  513. * @param config [OUT] RoiConfig
  514. * @param left [IN] left offset
  515. *
  516. * @retval ACL_SUCCESS The function is successfully executed.
  517. * @retval OtherValues Failure
  518. */
  519. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigLeft(acldvppRoiConfig *config, uint32_t left);
  520. /**
  521. * @ingroup AscendCL
  522. * @brief Set right of RoiConfig.
  523. *
  524. * @param config [OUT] RoiConfig
  525. * @param right [IN] right offset
  526. *
  527. * @retval ACL_SUCCESS The function is successfully executed.
  528. * @retval OtherValues Failure
  529. */
  530. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigRight(acldvppRoiConfig *config, uint32_t right);
  531. /**
  532. * @ingroup AscendCL
  533. * @brief Set top of RoiConfig.
  534. *
  535. * @param config [OUT] RoiConfig
  536. * @param top [IN] top offset
  537. *
  538. * @retval ACL_SUCCESS The function is successfully executed.
  539. * @retval OtherValues Failure
  540. */
  541. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigTop(acldvppRoiConfig *config, uint32_t top);
  542. /**
  543. * @ingroup AscendCL
  544. * @brief Set bottom of RoiConfig.
  545. *
  546. * @param config [OUT] RoiConfig
  547. * @param bottom [IN] bottom offset
  548. *
  549. * @retval ACL_SUCCESS The function is successfully executed.
  550. * @retval OtherValues Failure
  551. */
  552. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfigBottom(acldvppRoiConfig *config, uint32_t bottom);
  553. /**
  554. * @ingroup AscendCL
  555. * @brief Set RoiConfig.
  556. *
  557. * @param config [OUT] RoiConfig
  558. * @param left [IN] left offset
  559. * @param right [IN] right offset
  560. * @param top [IN] top offset
  561. * @param bottom [IN] bottom offset
  562. *
  563. * @retval ACL_SUCCESS The function is successfully executed.
  564. * @retval OtherValues Failure
  565. */
  566. ACL_FUNC_VISIBILITY aclError acldvppSetRoiConfig(acldvppRoiConfig *config,
  567. uint32_t left,
  568. uint32_t right,
  569. uint32_t top,
  570. uint32_t bottom);
  571. /**
  572. * @ingroup AscendCL
  573. * @brief Create dvpp resize config.
  574. * The specified scaling algorithm is not supported.
  575. * The default scaling algorithm is "nearest neighbor interpolation".
  576. *
  577. * @retval null for failed.
  578. * @retval other success.
  579. */
  580. ACL_FUNC_VISIBILITY acldvppResizeConfig *acldvppCreateResizeConfig();
  581. /**
  582. * @ingroup AscendCL
  583. * @brief Destroy dvpp resize config.
  584. *
  585. * @par Function
  586. * Destroys the scaling configuration data created by
  587. * the acldvppCreateResizeConfig interface
  588. *
  589. * @param resizeConfig [IN] resize config.
  590. *
  591. * @retval ACL_SUCCESS The function is successfully executed.
  592. * @retval OtherValues Failure
  593. *
  594. * @see acldvppCreateResizeConfig
  595. */
  596. ACL_FUNC_VISIBILITY aclError acldvppDestroyResizeConfig(acldvppResizeConfig *resizeConfig);
  597. /**
  598. * @ingroup AscendCL
  599. * @brief Create jpege config.
  600. *
  601. * @retval null for failed.
  602. * @retval other success.
  603. */
  604. ACL_FUNC_VISIBILITY acldvppJpegeConfig *acldvppCreateJpegeConfig();
  605. /**
  606. * @ingroup AscendCL
  607. * @brief Destroy jpege config.
  608. *
  609. * @par Function
  610. * Destroys the encoding configuration data created by
  611. * the acldvppCreateJpegeConfig interface
  612. * @param jpegeConfig [IN] config pointer to destroy.
  613. *
  614. * @retval ACL_SUCCESS The function is successfully executed.
  615. * @retval OtherValues Failure
  616. *
  617. * @see acldvppCreateJpegeConfig
  618. */
  619. ACL_FUNC_VISIBILITY aclError acldvppDestroyJpegeConfig(acldvppJpegeConfig *jpegeConfig);
  620. /**
  621. * @ingroup AscendCL
  622. * @brief Set jpege config's level.
  623. *
  624. * @param jpegeConfig [OUT] Call the acldvppCreateJpegeConfig
  625. * interface to create acldvppJpegeConfig data
  626. * @param level [IN] Encoding quality range [0, 100],
  627. * where level 0 encoding quality is similar to level 100,
  628. * and the smaller the value in [1, 100],
  629. * the worse the quality of the output picture.
  630. *
  631. * @retval ACL_SUCCESS The function is successfully executed.
  632. * @retval OtherValues Failure
  633. */
  634. ACL_FUNC_VISIBILITY aclError acldvppSetJpegeConfigLevel(acldvppJpegeConfig *jpegeConfig, uint32_t level);
  635. /**
  636. * @ingroup AscendCL
  637. * @brief Get jpege config's level.
  638. *
  639. * @param jpegeConfig [IN] jpege config.
  640. *
  641. * @retval compression level.
  642. * @retval default 0.
  643. */
  644. ACL_FUNC_VISIBILITY uint32_t acldvppGetJpegeConfigLevel(const acldvppJpegeConfig *jpegeConfig);
  645. /**
  646. * @ingroup AscendCL
  647. * @brief create vdecChannelDesc.Channel description information
  648. * when creating a video data processing channel.
  649. *
  650. * @retval null for failed.
  651. * @retval other success
  652. */
  653. ACL_FUNC_VISIBILITY aclvdecChannelDesc *aclvdecCreateChannelDesc();
  654. /**
  655. * @ingroup AscendCL
  656. * @brief destroy vdecChannelDesc.
  657. *
  658. * @par Function
  659. * Can only destroy aclvdecChannelDesc type created
  660. * through aclvdecCreateChannelDesc interface
  661. * @param channelDesc [IN] channel description.
  662. *
  663. * @retval ACL_SUCCESS The function is successfully executed.
  664. * @retval OtherValues Failure
  665. * @see aclvdecCreateChannelDesc
  666. */
  667. ACL_FUNC_VISIBILITY aclError aclvdecDestroyChannelDesc(aclvdecChannelDesc *channelDesc);
  668. /**
  669. * @ingroup AscendCL
  670. * @brief Set vdec channel description's channel id.
  671. *
  672. * @param channelDesc [OUT] vdec channel description.
  673. * @param channelId [IN] decoding channel id: 0~15.
  674. *
  675. * @retval ACL_SUCCESS The function is successfully executed.
  676. * @retval OtherValues Failure
  677. */
  678. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescChannelId(aclvdecChannelDesc *channelDesc, uint32_t channelId);
  679. /**
  680. * @ingroup AscendCL
  681. * @brief Set vdec channel description's thread id.
  682. *
  683. * @param channelDesc [OUT] vdec channel description.
  684. * @param threadId [IN] thread id.
  685. *
  686. * @retval ACL_SUCCESS The function is successfully executed.
  687. * @retval OtherValues Failure
  688. */
  689. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescThreadId(aclvdecChannelDesc *channelDesc, uint64_t threadId);
  690. /**
  691. * @ingroup AscendCL
  692. * @brief Set vdec channel description's callback function.
  693. *
  694. * @param channelDesc [OUT] vdec channel description.
  695. * @param callback [IN] function callback.Function prototype:
  696. * void (* aclvdecCallback)
  697. * (acldvppStreamDesc * input, acldvppPicDesc * output, void* userdata)
  698. *
  699. * @retval ACL_SUCCESS The function is successfully executed.
  700. * @retval OtherValues Failure
  701. *
  702. * @see aclvdecCallback
  703. */
  704. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescCallback(aclvdecChannelDesc *channelDesc, aclvdecCallback callback);
  705. /**
  706. * @ingroup AscendCL
  707. * @brief Set vdec channel description's video encoding type.
  708. *
  709. * @param channelDesc [OUT] vdec channel description.
  710. * @param enType [IN] video encoding type.
  711. *
  712. * @retval ACL_SUCCESS The function is successfully executed.
  713. * @retval OtherValues Failure
  714. */
  715. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescEnType(aclvdecChannelDesc *channelDesc, acldvppStreamFormat enType);
  716. /**
  717. * @ingroup AscendCL
  718. * @brief Set vdec channel description's out picture format.
  719. *
  720. * @param channelDesc [OUT] vdec channel description.
  721. * @param outPicFormat [IN] out picture format (acldvppPixelFormat).
  722. *
  723. * @retval ACL_SUCCESS The function is successfully executed.
  724. * @retval OtherValues Failure
  725. */
  726. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicFormat(aclvdecChannelDesc *channelDesc,
  727. acldvppPixelFormat outPicFormat);
  728. /**
  729. * @ingroup AscendCL
  730. * @brief Set vdec channel description's out picture width.
  731. *
  732. * @param channelDesc [OUT] vdec channel description.
  733. * @param outPicWidth [IN] out picture width.
  734. *
  735. * @retval ACL_SUCCESS The function is successfully executed.
  736. * @retval OtherValues Failure
  737. */
  738. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicWidth(aclvdecChannelDesc *channelDesc, uint32_t outPicWidth);
  739. /**
  740. * @ingroup AscendCL
  741. * @brief Set vdec channel description's out picture height.
  742. *
  743. * @param channelDesc [OUT] vdec channel description.
  744. * @param outPicHeight [IN] out picture height.
  745. *
  746. * @retval ACL_SUCCESS The function is successfully executed.
  747. * @retval OtherValues Failure
  748. */
  749. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutPicHeight(aclvdecChannelDesc *channelDesc, uint32_t outPicHeight);
  750. /**
  751. * @ingroup AscendCL
  752. * @brief Set vdec channel description's reference frame num.
  753. *
  754. * @param channelDesc [OUT] vdec channel description.
  755. * @param refFrameNum [IN] reference frame num.
  756. *
  757. * @retval ACL_SUCCESS The function is successfully executed.
  758. * @retval OtherValues Failure
  759. */
  760. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescRefFrameNum(aclvdecChannelDesc *channelDesc, uint32_t refFrameNum);
  761. /**
  762. * @ingroup AscendCL
  763. * @brief Set vdec channel description's bit depth.
  764. *
  765. * @param channelDesc [OUT] vdec channel description.
  766. * @param bitDepth [IN] bit depth.
  767. *
  768. * @retval ACL_SUCCESS The function is successfully executed.
  769. * @retval OtherValues Failure
  770. */
  771. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescBitDepth(aclvdecChannelDesc *channelDesc, uint32_t bitDepth);
  772. /**
  773. * @ingroup AscendCL
  774. * @brief Get vdec channel description's channel id.
  775. *
  776. * @param channelDesc [IN] vdec channel description.
  777. *
  778. * @retval decoding channel id: 0~15.
  779. * @retval default 0.
  780. */
  781. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescChannelId(const aclvdecChannelDesc *channelDesc);
  782. /**
  783. * @ingroup AscendCL
  784. * @brief Get vdec channel description's thread id.
  785. *
  786. * @param channelDesc [IN] vdec channel description.
  787. *
  788. * @retval thread id.
  789. * @retval default 0.
  790. */
  791. ACL_FUNC_VISIBILITY uint64_t aclvdecGetChannelDescThreadId(const aclvdecChannelDesc *channelDesc);
  792. /**
  793. * @ingroup AscendCL
  794. * @brief Get vdec channel description's callback function.
  795. *
  796. * @param channelDesc [IN] vdec channel description.
  797. *
  798. * @retval function callback.Function prototype:
  799. * void (* aclvdecCallback)
  800. * (acldvppStreamDesc * input, acldvppPicDesc * output, void* userdata)
  801. * @retval default null.
  802. *
  803. * @see aclvdecCallback
  804. */
  805. ACL_FUNC_VISIBILITY aclvdecCallback aclvdecGetChannelDescCallback(const aclvdecChannelDesc *channelDesc);
  806. /**
  807. * @ingroup AscendCL
  808. * @brief Get vdec channel description's video encoding type.
  809. *
  810. * @param channelDesc [IN] vdec channel description.
  811. *
  812. * @retval video encoding type.
  813. * @retval default H265_MAIN_LEVEL.
  814. */
  815. ACL_FUNC_VISIBILITY acldvppStreamFormat aclvdecGetChannelDescEnType(const aclvdecChannelDesc *channelDesc);
  816. /**
  817. * @ingroup AscendCL
  818. * @brief Get vdec channel description's out picture format.
  819. *
  820. * @param channelDesc [IN] vdec channel description.
  821. *
  822. * @retval out picture format.
  823. * @retval default DVPP_OUTPUT_YUV420SP_UV.
  824. */
  825. ACL_FUNC_VISIBILITY acldvppPixelFormat aclvdecGetChannelDescOutPicFormat(const aclvdecChannelDesc *channelDesc);
  826. /**
  827. * @ingroup AscendCL
  828. * @brief Get vdec channel description's out picture width.
  829. *
  830. * @param channelDesc [IN] vdec channel description.
  831. *
  832. * @retval out picture width.
  833. * @retval default 0.
  834. */
  835. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutPicWidth(const aclvdecChannelDesc *channelDesc);
  836. /**
  837. * @ingroup AscendCL
  838. * @brief Get vdec channel description's out picture height.
  839. *
  840. * @param channelDesc [IN] vdec channel description.
  841. *
  842. * @retval out picture height (for vdec malloc memory).
  843. * @retval default 0.
  844. */
  845. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutPicHeight(const aclvdecChannelDesc *channelDesc);
  846. /**
  847. * @ingroup AscendCL
  848. * @brief Get vdec channel description's bit depth.
  849. *
  850. * @param channelDesc [IN] vdec channel description.
  851. *
  852. * @retval bit depth.
  853. * @retval default 0.
  854. */
  855. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescBitDepth(const aclvdecChannelDesc *channelDesc);
  856. /**
  857. * @ingroup AscendCL
  858. * @brief Get vdec channel description's reference frame num.
  859. *
  860. * @param channelDesc [IN] vdec channel description.
  861. *
  862. * @retval reference frame num.
  863. * @retval default 0.
  864. */
  865. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescRefFrameNum(const aclvdecChannelDesc *channelDesc);
  866. /**
  867. * @ingroup AscendCL
  868. * @brief create vencChannelDesc.
  869. *
  870. * @retval null for failed, other success
  871. */
  872. ACL_FUNC_VISIBILITY aclvencChannelDesc *aclvencCreateChannelDesc();
  873. /**
  874. * @ingroup AscendCL
  875. * @brief destroy vencChannelDesc.
  876. *
  877. * @param channelDesc [IN] channel desc.
  878. *
  879. * @retval ACL_SUCCESS:success, other:failed
  880. */
  881. ACL_FUNC_VISIBILITY aclError aclvencDestroyChannelDesc(aclvencChannelDesc *channelDesc);
  882. /**
  883. * @ingroup AscendCL
  884. * @brief Set decoding thread id for venc channel desc.
  885. *
  886. * @param channelDesc [OUT] venc channel desc
  887. * @param threadId [IN] thread id
  888. *
  889. * @retval ACL_SUCCESS for success, other for failure
  890. */
  891. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescThreadId(aclvencChannelDesc *channelDesc, uint64_t threadId);
  892. /**
  893. * @ingroup AscendCL
  894. * @brief Set func callback for venc channel desc.
  895. *
  896. * @param channelDesc [OUT] venc channel desc
  897. * @param callback [IN] func callback
  898. *
  899. * @retval ACL_SUCCESS for success, other for failure
  900. */
  901. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescCallback(aclvencChannelDesc *channelDesc, aclvencCallback callback);
  902. /**
  903. * @ingroup AscendCL
  904. * @brief Set video encoding type for venc channel desc.
  905. *
  906. * @param channelDesc [OUT] venc channel desc
  907. * @param enType [IN] video encoding type
  908. *
  909. * @retval ACL_SUCCESS for success, other for failure
  910. */
  911. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescEnType(aclvencChannelDesc *channelDesc, acldvppStreamFormat enType);
  912. /**
  913. * @ingroup AscendCL
  914. * @brief Set pic format for venc channel desc.
  915. *
  916. * @param channelDesc [OUT] venc channel desc
  917. * @param picFormat [IN] pic format
  918. *
  919. * @retval ACL_SUCCESS for success, other for failure
  920. */
  921. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicFormat(aclvencChannelDesc *channelDesc,
  922. acldvppPixelFormat picFormat);
  923. /**
  924. * @ingroup AscendCL
  925. * @brief Set out pic width for venc channel desc.
  926. *
  927. * @param channelDesc [OUT] venc channel desc
  928. * @param picWidth [IN] pic width
  929. *
  930. * @retval ACL_SUCCESS for success, other for failure
  931. */
  932. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicWidth(aclvencChannelDesc *channelDesc, uint32_t picWidth);
  933. /**
  934. * @ingroup AscendCL
  935. * @brief Set pic height for venc channel desc.
  936. *
  937. * @param channelDesc [OUT] venc channel desc
  938. * @param picHeight [IN] pic height
  939. *
  940. * @retval ACL_SUCCESS for success, other for failure
  941. */
  942. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescPicHeight(aclvencChannelDesc *channelDesc, uint32_t picHeight);
  943. /**
  944. * @ingroup AscendCL
  945. * @brief Set key frame interval for venc channel desc.
  946. *
  947. * @param channelDesc [OUT] venc channel desc
  948. * @param keyFrameInterval [IN] Interval of key frame
  949. *
  950. * @retval ACL_SUCCESS for success, other for failure
  951. */
  952. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescKeyFrameInterval(aclvencChannelDesc *channelDesc,
  953. uint32_t keyFrameInterval);
  954. /**
  955. * @ingroup AscendCL
  956. * @brief Set output buffer address for venc channel desc.
  957. *
  958. * @param channelDesc [OUT] venc channel desc
  959. * @param bufAddr [IN] output buffer address
  960. *
  961. * @retval ACL_SUCCESS for success, other for failure
  962. */
  963. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescBufAddr(aclvencChannelDesc *channelDesc, void *bufAddr);
  964. /**
  965. * @ingroup AscendCL
  966. * @brief Set output buffer size for venc channel desc.
  967. *
  968. * @param channelDesc [OUT] venc channel desc
  969. * @param bufSize [IN] output buffer size
  970. *
  971. * @retval ACL_SUCCESS for success, other for failure
  972. */
  973. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescBufSize(aclvencChannelDesc *channelDesc, uint32_t bufSize);
  974. /**
  975. * @ingroup AscendCL
  976. * @brief Set rc model for venc channel desc.
  977. *
  978. * @param channelDesc [OUT] venc channel desc
  979. * @param rcMode [IN] venc rc mode(VBR=1, CBR=2)
  980. *
  981. * @retval ACL_SUCCESS for success, other for failure
  982. */
  983. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescRcMode(aclvencChannelDesc *channelDesc, uint32_t rcMode);
  984. /**
  985. * @ingroup AscendCL
  986. * @brief Set source rate for venc channel desc.
  987. *
  988. * @param channelDesc [OUT] venc channel desc
  989. * @param srcRate [IN] source rate
  990. *
  991. * @retval ACL_SUCCESS for success, other for failure
  992. */
  993. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescSrcRate(aclvencChannelDesc *channelDesc, uint32_t srcRate);
  994. /**
  995. * @ingroup AscendCL
  996. * @brief Set max bit rate for venc channel desc.
  997. *
  998. * @param channelDesc [OUT] venc channel desc
  999. * @param maxBitRate [IN] max bit rate
  1000. *
  1001. * @retval ACL_SUCCESS for success, other for failure
  1002. */
  1003. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescMaxBitRate(aclvencChannelDesc *channelDesc, uint32_t maxBitRate);
  1004. /**
  1005. * @ingroup AscendCL
  1006. * @brief Set venc parameter for venc channel desc.
  1007. *
  1008. * @param channelDesc [OUT] venc channel desc
  1009. * @param paramType [IN] parameter type
  1010. * @param length [IN] parameter length
  1011. * @param param [IN] pointer to parameter value
  1012. *
  1013. * @retval ACL_SUCCESS for success, other for failure
  1014. */
  1015. ACL_FUNC_VISIBILITY aclError aclvencSetChannelDescParam(aclvencChannelDesc *channelDesc,
  1016. aclvencChannelDescParamType paramType, size_t length, const void *param);
  1017. /**
  1018. * @ingroup AscendCL
  1019. * @brief Get output buffer address for venc channel desc.
  1020. *
  1021. * @param channelDesc[IN] venc channel desc
  1022. *
  1023. * @retval output buffer address
  1024. */
  1025. ACL_FUNC_VISIBILITY void *aclvencGetChannelDescBufAddr(const aclvencChannelDesc *channelDesc);
  1026. /**
  1027. * @ingroup AscendCL
  1028. * @brief Get output buffer size for venc channel desc.
  1029. *
  1030. * @param channelDesc [IN] venc channel desc
  1031. *
  1032. * @retval output buffer size
  1033. */
  1034. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescBufSize(const aclvencChannelDesc *channelDesc);
  1035. /**
  1036. * @ingroup AscendCL
  1037. * @brief Get decoding channel id for venc channel desc.
  1038. *
  1039. * @param channelDesc [IN] venc channel desc
  1040. *
  1041. * @retval decoding channel id: 0~15, default 0
  1042. */
  1043. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescChannelId(const aclvencChannelDesc *channelDesc);
  1044. /**
  1045. * @ingroup AscendCL
  1046. * @brief Get decoding thread id for venc channel desc.
  1047. *
  1048. * @param channelDesc [IN] venc channel desc
  1049. *
  1050. * @retval thread id, default 0
  1051. */
  1052. ACL_FUNC_VISIBILITY uint64_t aclvencGetChannelDescThreadId(const aclvencChannelDesc *channelDesc);
  1053. /**
  1054. * @ingroup AscendCL
  1055. * @brief Get func callback for venc channel desc.
  1056. *
  1057. * @param channelDesc [IN] venc channel desc
  1058. *
  1059. * @retval func callback, default null
  1060. */
  1061. ACL_FUNC_VISIBILITY aclvencCallback aclvencGetChannelDescCallback(const aclvencChannelDesc *channelDesc);
  1062. /**
  1063. * @ingroup AscendCL
  1064. * @brief Get video encoding type for venc channel desc.
  1065. *
  1066. * @param channelDesc [IN] venc channel desc
  1067. *
  1068. * @retval video encoding type, default H265_MAIN_LEVEL
  1069. */
  1070. ACL_FUNC_VISIBILITY acldvppStreamFormat aclvencGetChannelDescEnType(const aclvencChannelDesc *channelDesc);
  1071. /**
  1072. * @ingroup AscendCL
  1073. * @brief Get pic format for venc channel desc.
  1074. *
  1075. * @param channelDesc [IN] venc channel desc
  1076. *
  1077. * @retval pic format
  1078. */
  1079. ACL_FUNC_VISIBILITY acldvppPixelFormat aclvencGetChannelDescPicFormat(const aclvencChannelDesc *channelDesc);
  1080. /**
  1081. * @ingroup AscendCL
  1082. * @brief Get pic width for venc channel desc.
  1083. *
  1084. * @param channelDesc [IN] venc channel desc
  1085. *
  1086. * @retval pic width, default 0
  1087. */
  1088. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescPicWidth(const aclvencChannelDesc *channelDesc);
  1089. /**
  1090. * @ingroup AscendCL
  1091. * @brief Get pic height for venc channel desc.
  1092. *
  1093. * @param channelDesc [IN] venc channel desc
  1094. *
  1095. * @retval pic height, default 0
  1096. */
  1097. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescPicHeight(const aclvencChannelDesc *channelDesc);
  1098. /**
  1099. * @ingroup AscendCL
  1100. * @brief Get interval of key frame for venc channel desc.
  1101. *
  1102. * @param channelDesc [IN] venc channel desc
  1103. *
  1104. * @retval interval of key frame, default 0
  1105. */
  1106. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescKeyFrameInterval(const aclvencChannelDesc *channelDesc);
  1107. /**
  1108. * @ingroup AscendCL
  1109. *
  1110. * @brief Get rc mode for venc channel desc.
  1111. *
  1112. * @param channelDesc [IN] venc channel desc
  1113. *
  1114. * @retval rc mode, default 0
  1115. */
  1116. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescRcMode(const aclvencChannelDesc *channelDesc);
  1117. /**
  1118. * @ingroup AscendCL
  1119. *
  1120. * @brief Get source rate for venc channel desc.
  1121. *
  1122. * @param channelDesc [IN] venc channel desc
  1123. *
  1124. * @retval source rate, default 0
  1125. */
  1126. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescSrcRate(const aclvencChannelDesc *channelDesc);
  1127. /**
  1128. * @ingroup AscendCL
  1129. *
  1130. * @brief Get max bit rate for venc channel desc.
  1131. *
  1132. * @param channelDesc [IN] venc channel desc
  1133. *
  1134. * @retval max bit rate, default 0
  1135. */
  1136. ACL_FUNC_VISIBILITY uint32_t aclvencGetChannelDescMaxBitRate(const aclvencChannelDesc *channelDesc);
  1137. /**
  1138. * @ingroup AscendCL
  1139. *
  1140. * @brief Get venc parameter for venc channel desc.
  1141. *
  1142. * @param channelDesc [IN] venc channel desc
  1143. * @param paramType [IN] parameter type
  1144. * @param length [IN] parameter length
  1145. * @param paramRetSize [OUT] pointer to parameter real length
  1146. * @param param [OUT] pointer to parameter value
  1147. *
  1148. * @retval ACL_SUCCESS for success, other for failure
  1149. */
  1150. ACL_FUNC_VISIBILITY aclError aclvencGetChannelDescParam(const aclvencChannelDesc *channelDesc,
  1151. aclvencChannelDescParamType paramType, size_t length, size_t *paramRetSize, void *param);
  1152. /**
  1153. * @ingroup AscendCL
  1154. * @brief get forced restart of I-frame interval from config
  1155. *
  1156. * @param config [IN] venc frame config
  1157. *
  1158. * @retval 0: Not forced; 1: Forced restart of I-frame -1: error
  1159. */
  1160. ACL_FUNC_VISIBILITY uint8_t aclvencGetFrameConfigForceIFrame(const aclvencFrameConfig *config);
  1161. /**
  1162. * @ingroup AscendCL
  1163. * @brief get forced restart of I-frame interval from config
  1164. *
  1165. * @param config [IN] venc frame config
  1166. *
  1167. * @retval Whether it is the end frame: 0: no; 1: end frame
  1168. */
  1169. ACL_FUNC_VISIBILITY uint8_t aclvencGetFrameConfigEos(const aclvencFrameConfig *config);
  1170. /**
  1171. * @ingroup AscendCL
  1172. * @brief set single frame encoding configuration parameters
  1173. *
  1174. * @param config [OUT] venc frame config
  1175. * @param forceFrame [IN] forced restart of I-frame interval: 0: Not forced; 1: Forced restart of I-frame
  1176. *
  1177. * @retval ACL_SUCCESS for ok, others for fail
  1178. */
  1179. ACL_FUNC_VISIBILITY aclError aclvencSetFrameConfigForceIFrame(aclvencFrameConfig *config, uint8_t forceIFrame);
  1180. /**
  1181. * @ingroup AscendCL
  1182. * @brief set single frame encoding configuration parameters
  1183. *
  1184. * @param config [OUT] venc frame config
  1185. * @param eos [IN] Whether it is the end frame: 0: no; 1: end frame
  1186. *
  1187. * @retval ACL_SUCCESS for ok, others for fail
  1188. */
  1189. ACL_FUNC_VISIBILITY aclError aclvencSetFrameConfigEos(aclvencFrameConfig *config, uint8_t eos);
  1190. /**
  1191. * @ingroup AscendCL
  1192. * @brief dvpp venc destroy frame config
  1193. *
  1194. * @param config [IN] venc frame config
  1195. *
  1196. * @retval ACL_SUCCESS for ok, others for fail
  1197. */
  1198. ACL_FUNC_VISIBILITY aclError aclvencDestroyFrameConfig(aclvencFrameConfig *config);
  1199. /**
  1200. * @ingroup AscendCL
  1201. * @brief Create dvpp venc frame config.
  1202. *
  1203. * @retval null for failed, other aclvencFrameConfig ptr
  1204. */
  1205. ACL_FUNC_VISIBILITY aclvencFrameConfig *aclvencCreateFrameConfig();
  1206. /**
  1207. * @ingroup AscendCL
  1208. * @brief Create dvpp venc channel.
  1209. *
  1210. * @param channelDesc [IN|OUT] venc channel desc
  1211. *
  1212. * @retval ACL_SUCCESS for ok, others for fail
  1213. */
  1214. ACL_FUNC_VISIBILITY aclError aclvencCreateChannel(aclvencChannelDesc *channelDesc);
  1215. /**
  1216. * @ingroup AscendCL
  1217. * @brief Destroy dvpp venc channel.
  1218. *
  1219. * @param channelDesc [IN] venc channel desc
  1220. *
  1221. * @retval ACL_SUCCESS for ok, others for fail
  1222. */
  1223. ACL_FUNC_VISIBILITY aclError aclvencDestroyChannel(aclvencChannelDesc *channelDesc);
  1224. /**
  1225. * @ingroup AscendCL
  1226. * @brief dvpp venc launch send frame task.
  1227. *
  1228. * @param channelDesc [IN] venc channel desc
  1229. * @param input [IN] input picture desc
  1230. * @param reserve [IN] reserve parameter
  1231. * @param config [IN] dvpp frame config
  1232. * @param userdata [IN] user callback function
  1233. *
  1234. * @retval ACL_SUCCESS for ok, others for fail
  1235. */
  1236. ACL_FUNC_VISIBILITY aclError aclvencSendFrame(aclvencChannelDesc *channelDesc, acldvppPicDesc *input, void *reserve,
  1237. aclvencFrameConfig *config, void *userdata);
  1238. /**
  1239. * @ingroup AscendCL
  1240. * @brief Create dvpp stream description.
  1241. *
  1242. * @retval null for failed.
  1243. * @retval other success.
  1244. */
  1245. ACL_FUNC_VISIBILITY acldvppStreamDesc *acldvppCreateStreamDesc();
  1246. /**
  1247. * @ingroup AscendCL
  1248. * @brief Destroy dvpp stream description.
  1249. *
  1250. * @par Function
  1251. * Can only destroy acldvppStreamDesc type created through
  1252. * acldvppCreateStreamDesc interface.
  1253. *
  1254. * @param streamDesc [IN] dvpp stream description.
  1255. *
  1256. * @retval ACL_SUCCESS The function is successfully executed.
  1257. * @retval OtherValues Failure
  1258. *
  1259. * @see acldvppCreateStreamDesc
  1260. */
  1261. ACL_FUNC_VISIBILITY aclError acldvppDestroyStreamDesc(acldvppStreamDesc *streamDesc);
  1262. /**
  1263. * @ingroup AscendCL
  1264. * @brief Set stream description's data addr.
  1265. *
  1266. * @param streamDesc [OUT] dvpp stream description.
  1267. * @param dataDev [IN] data addr.
  1268. *
  1269. * @retval ACL_SUCCESS The function is successfully executed.
  1270. * @retval OtherValues Failure
  1271. */
  1272. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescData(acldvppStreamDesc *streamDesc, void *dataDev);
  1273. /**
  1274. * @ingroup AscendCL
  1275. * @brief Set stream description's data size.
  1276. *
  1277. * @param streamDesc [OUT] dvpp stream description.
  1278. * @param size [IN] data size.
  1279. *
  1280. * @retval ACL_SUCCESS The function is successfully executed.
  1281. * @retval OtherValues Failure
  1282. */
  1283. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescSize(acldvppStreamDesc *streamDesc, uint32_t size);
  1284. /**
  1285. * @ingroup AscendCL
  1286. * @brief Set stream description's format.
  1287. *
  1288. * @param streamDesc [OUT] dvpp stream description.
  1289. * @param format [IN] stream format.
  1290. *
  1291. * @retval ACL_SUCCESS The function is successfully executed.
  1292. * @retval OtherValues Failure
  1293. */
  1294. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescFormat(acldvppStreamDesc *streamDesc, acldvppStreamFormat format);
  1295. /**
  1296. * @ingroup AscendCL
  1297. * @brief Set stream description's timestamp.
  1298. *
  1299. * @param streamDesc [OUT] dvpp stream description.
  1300. * @param timestamp [IN] current timestamp.
  1301. *
  1302. * @retval ACL_SUCCESS The function is successfully executed.
  1303. * @retval OtherValues Failure
  1304. */
  1305. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescTimestamp(acldvppStreamDesc *streamDesc, uint64_t timestamp);
  1306. /**
  1307. * @ingroup AscendCL
  1308. * @brief Set stream description's ret code.
  1309. *
  1310. * @param streamDesc [OUT] dvpp stream description.
  1311. * @param retCode [IN] result code.
  1312. *
  1313. * @retval ACL_SUCCESS The function is successfully executed.
  1314. * @retval OtherValues Failure
  1315. */
  1316. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescRetCode(acldvppStreamDesc *streamDesc, uint32_t retCode);
  1317. /**
  1318. * @ingroup AscendCL
  1319. * @brief Set stream description's eos.
  1320. *
  1321. * @param streamDesc [OUT] dvpp stream description.
  1322. * @param eos [IN] end flag of sequence.
  1323. *
  1324. * @retval ACL_SUCCESS The function is successfully executed.
  1325. * @retval OtherValues Failure
  1326. */
  1327. ACL_FUNC_VISIBILITY aclError acldvppSetStreamDescEos(acldvppStreamDesc *streamDesc, uint8_t eos);
  1328. /**
  1329. * @ingroup AscendCL
  1330. * @brief Get stream description's data addr.
  1331. *
  1332. * @param streamDesc [IN] dvpp stream description.
  1333. *
  1334. * @retval data addr.
  1335. * @retval deault nullptr.
  1336. */
  1337. ACL_FUNC_VISIBILITY void *acldvppGetStreamDescData(const acldvppStreamDesc *streamDesc);
  1338. /**
  1339. * @ingroup AscendCL
  1340. * @brief Get stream description's data size.
  1341. *
  1342. * @param streamDesc [IN] dvpp stream description.
  1343. *
  1344. * @retval data size.
  1345. * @retval default 0.
  1346. */
  1347. ACL_FUNC_VISIBILITY uint32_t acldvppGetStreamDescSize(const acldvppStreamDesc *streamDesc);
  1348. /**
  1349. * @ingroup AscendCL
  1350. * @brief Get stream description's format.
  1351. *
  1352. * @param streamDesc [IN] dvpp stream description.
  1353. *
  1354. * @retval stream format.
  1355. * @retval default ACL_DVPP_STREAM_H264.
  1356. */
  1357. ACL_FUNC_VISIBILITY acldvppStreamFormat acldvppGetStreamDescFormat(const acldvppStreamDesc *streamDesc);
  1358. /**
  1359. * @ingroup AscendCL
  1360. * @brief Get stream description's timestamp.
  1361. *
  1362. * @param streamDesc [IN] dvpp stream description.
  1363. *
  1364. * @retval current timestamp.
  1365. * @retval default 0.
  1366. */
  1367. ACL_FUNC_VISIBILITY uint64_t acldvppGetStreamDescTimestamp(const acldvppStreamDesc *streamDesc);
  1368. /**
  1369. * @ingroup AscendCL
  1370. * @brief Get stream description's retCode.
  1371. *
  1372. * @param streamDesc [IN] dvpp stream description.
  1373. *
  1374. * @retval result code.
  1375. * @retval default 0.
  1376. */
  1377. ACL_FUNC_VISIBILITY uint32_t acldvppGetStreamDescRetCode(const acldvppStreamDesc *streamDesc);
  1378. /**
  1379. * @ingroup AscendCL
  1380. * @brief Get stream description's eos.
  1381. *
  1382. * @param streamDesc [IN] dvpp stream description.
  1383. *
  1384. * @retval end flag of sequence.
  1385. * @retval default 0(false).
  1386. */
  1387. ACL_FUNC_VISIBILITY uint8_t acldvppGetStreamDescEos(const acldvppStreamDesc *streamDesc);
  1388. /**
  1389. * @ingroup AscendCL
  1390. * @brief Create vdec frame config.
  1391. *
  1392. * @retval null for failed.
  1393. * @retval other success.
  1394. */
  1395. ACL_FUNC_VISIBILITY aclvdecFrameConfig *aclvdecCreateFrameConfig();
  1396. /**
  1397. * @ingroup AscendCL
  1398. * @brief Destroy vdec frame config.
  1399. *
  1400. * @par Function
  1401. * Can only destroy aclvdecFrameConfig type created through
  1402. * aclvdecCreateFrameConfig interface
  1403. *
  1404. * @param vdecFrameConfig [IN] vdec frame config.
  1405. *
  1406. * @retval ACL_SUCCESS The function is successfully executed.
  1407. * @retval OtherValues Failure
  1408. *
  1409. * @see aclvdecCreateFrameConfig
  1410. */
  1411. ACL_FUNC_VISIBILITY aclError aclvdecDestroyFrameConfig(aclvdecFrameConfig *vdecFrameConfig);
  1412. /**
  1413. * @ingroup AscendCL
  1414. * @brief Get image width and height of jpeg.
  1415. *
  1416. * @param data [IN] image data in host memory
  1417. * @param size [IN] the size of image data
  1418. * @param width [OUT] the width of image from image header
  1419. * @param height [OUT] the height of image from image header
  1420. * @param components [OUT] the components of image from image header
  1421. *
  1422. * @retval ACL_SUCCESS The function is successfully executed.
  1423. * @retval OtherValues Failure
  1424. */
  1425. ACL_FUNC_VISIBILITY aclError acldvppJpegGetImageInfo(const void *data,
  1426. uint32_t size,
  1427. uint32_t *width,
  1428. uint32_t *height,
  1429. int32_t *components);
  1430. /**
  1431. * @ingroup AscendCL
  1432. * @brief Get image width and height of jpeg.
  1433. *
  1434. * @param data [IN] image data in host memory
  1435. * @param size [IN] the size of image data
  1436. * @param width [OUT] the width of image from image header
  1437. * @param height [OUT] the height of image from image header
  1438. * @param components [OUT] the components of image from image header
  1439. * @param format [OUT] the format of image from image header
  1440. *
  1441. * @retval ACL_SUCCESS The function is successfully executed.
  1442. * @retval OtherValues Failure
  1443. */
  1444. ACL_FUNC_VISIBILITY aclError acldvppJpegGetImageInfoV2(const void *data,
  1445. uint32_t size,
  1446. uint32_t *width,
  1447. uint32_t *height,
  1448. int32_t *components,
  1449. acldvppJpegFormat *format);
  1450. /**
  1451. * @ingroup AscendCL
  1452. * @brief Predict encode size of jpeg image.
  1453. *
  1454. * @param inputDesc [IN] dvpp image desc
  1455. * @param config [IN] jpeg encode config
  1456. * @param size [OUT] the size predicted of image
  1457. *
  1458. * @retval ACL_SUCCESS The function is successfully executed.
  1459. * @retval OtherValues Failure
  1460. */
  1461. ACL_FUNC_VISIBILITY aclError acldvppJpegPredictEncSize(const acldvppPicDesc *inputDesc,
  1462. const acldvppJpegeConfig *config,
  1463. uint32_t *size);
  1464. /**
  1465. * @ingroup AscendCL
  1466. * @brief Predict decode size of jpeg image.
  1467. *
  1468. * @param data [IN] origin image data in host memory
  1469. * @param dataSize [IN] the size of origin image data
  1470. * @param outputPixelFormat [IN] the pixel format jpeg decode
  1471. * @param decSize [OUT] the size predicted for decode image
  1472. *
  1473. * @retval ACL_SUCCESS The function is successfully executed.
  1474. * @retval OtherValues Failure
  1475. */
  1476. ACL_FUNC_VISIBILITY aclError acldvppJpegPredictDecSize(const void *data,
  1477. uint32_t dataSize,
  1478. acldvppPixelFormat outputPixelFormat,
  1479. uint32_t *decSize);
  1480. /**
  1481. * @ingroup AscendCL
  1482. * @brief Get image width and height of png.
  1483. *
  1484. * @param data [IN] image data in host memory
  1485. * @param size [IN] the size of image data
  1486. * @param width [OUT] the width of image from image header
  1487. * @param height [OUT] the height of image from image header
  1488. * @param components [OUT] the components of image from image header
  1489. *
  1490. * @retval ACL_SUCCESS The function is successfully executed.
  1491. * @retval OtherValues Failure
  1492. */
  1493. ACL_FUNC_VISIBILITY aclError acldvppPngGetImageInfo(const void *data,
  1494. uint32_t dataSize,
  1495. uint32_t *width,
  1496. uint32_t *height,
  1497. int32_t *components);
  1498. /**
  1499. * @ingroup AscendCL
  1500. * @brief Predict decode size of png image.
  1501. *
  1502. * @param data [IN] origin image data in host memory
  1503. * @param dataSize [IN] the size of origin image data
  1504. * @param outputPixelFormat [IN] the pixel format jpeg decode
  1505. * @param decSize [OUT] the size predicted for decode image
  1506. *
  1507. * @retval ACL_SUCCESS The function is successfully executed.
  1508. * @retval OtherValues Failure
  1509. */
  1510. ACL_FUNC_VISIBILITY aclError acldvppPngPredictDecSize(const void *data,
  1511. uint32_t dataSize,
  1512. acldvppPixelFormat outputPixelFormat,
  1513. uint32_t *decSize);
  1514. /**
  1515. * @ingroup AscendCL
  1516. * @brief Create dvpp channel, the same channel can be reused
  1517. * and is no longer available after destruction.
  1518. *
  1519. * @param channelDesc [IN|OUT] the channel destruction
  1520. *
  1521. * @retval ACL_SUCCESS The function is successfully executed.
  1522. * @retval OtherValues Failure
  1523. *
  1524. * @see acldvppCreateChannelDesc
  1525. */
  1526. ACL_FUNC_VISIBILITY aclError acldvppCreateChannel(acldvppChannelDesc *channelDesc);
  1527. /**
  1528. * @ingroup AscendCL
  1529. * @brief Destroy dvpp channel.
  1530. *
  1531. * @par Restriction
  1532. * Can only destroy channel created through the acldvppCreateChannel interface
  1533. *
  1534. * @param channelDesc [IN] the channel destruction
  1535. *
  1536. * @retval ACL_SUCCESS The function is successfully executed.
  1537. * @retval OtherValues Failure
  1538. *
  1539. * @see acldvppCreateChannel
  1540. */
  1541. ACL_FUNC_VISIBILITY aclError acldvppDestroyChannel(acldvppChannelDesc *channelDesc);
  1542. /**
  1543. * @ingroup AscendCL
  1544. * @brief dvpp vpc resize.
  1545. *
  1546. * @par Restriction
  1547. * Width alignment requirements:
  1548. * @li The minimum stride is 32 and the maximum is 4096 * 4
  1549. * (that is, an image in argb format with a width of 4096);
  1550. * @li For 8K scaling, widthStride is required to be aligned to 2;
  1551. * @li For non 8K scaling, the calculation formula for widthStride
  1552. * is different for different image formats:
  1553. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  1554. * @li yuv422packed: input image width * 2 and then align to 16
  1555. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  1556. * @li xrgb8888: input image width * 4, align to 16
  1557. * @li HFBC:input image width
  1558. * Height alignment requirements:
  1559. * @li The height of the input image is aligned to 2.
  1560. * High stride minimum 6 and maximum 4096.
  1561. *
  1562. * @param channelDesc [IN] the channel destruction
  1563. * @param inputDesc [IN] resize input picture destruction
  1564. * @param outputDesc [IN|OUT] resize output picture destruction
  1565. * @param resizeConfig [IN] resize config
  1566. * @param stream [IN] resize task stream
  1567. *
  1568. * @retval ACL_SUCCESS The function is successfully executed.
  1569. * @retval OtherValues Failure
  1570. *
  1571. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1572. * | acldvppCreateResizeConfig
  1573. */
  1574. ACL_FUNC_VISIBILITY aclError acldvppVpcResizeAsync(acldvppChannelDesc *channelDesc,
  1575. acldvppPicDesc *inputDesc,
  1576. acldvppPicDesc *outputDesc,
  1577. acldvppResizeConfig *resizeConfig,
  1578. aclrtStream stream);
  1579. /**
  1580. * @ingroup AscendCL
  1581. * @brief dvpp vpc crop.
  1582. *
  1583. * @par Function
  1584. * crop the input picture according to the specified area,
  1585. * and then store the picture in the output memory as the output picture
  1586. *
  1587. * @par Restriction
  1588. * Width alignment requirements:
  1589. * @li The minimum stride is 32 and the maximum is 4096 * 4
  1590. * (that is, an image in argb format with a width of 4096);
  1591. * @li For 8K scaling, widthStride is required to be aligned to 2;
  1592. * @li For non 8K scaling, the calculation formula for widthStride
  1593. * is different for different image formats:
  1594. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  1595. * @li yuv422packed: input image width * 2 and then align to 16
  1596. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  1597. * @li xrgb8888: input image width * 4, align to 16
  1598. * @li HFBC:input image width
  1599. * Height alignment requirements:
  1600. * @li The height of the input image is aligned to 2.
  1601. * High stride minimum 6 and maximum 4096.
  1602. *
  1603. * @param channelDesc [IN] the channel destruction
  1604. * @param inputDesc [IN] crop input picture destruction
  1605. * @param outputDesc [IN|OUT] crop output picture destruction
  1606. * @param cropArea [IN] crop area config
  1607. * @param stream [IN] crop task stream
  1608. *
  1609. * @retval ACL_SUCCESS The function is successfully executed.
  1610. * @retval OtherValues Failure
  1611. */
  1612. ACL_FUNC_VISIBILITY aclError acldvppVpcCropAsync(acldvppChannelDesc *channelDesc,
  1613. acldvppPicDesc *inputDesc,
  1614. acldvppPicDesc *outputDesc,
  1615. acldvppRoiConfig *cropArea,
  1616. aclrtStream stream);
  1617. /**
  1618. * @ingroup AscendCL
  1619. * @brief dvpp vpc crop and resize config.
  1620. *
  1621. * @par Function
  1622. * crop the input picture with resize config according to the specified area,
  1623. * and then store the picture in the output memory as the output picture
  1624. *
  1625. * @par Restriction
  1626. * Width alignment requirements:
  1627. * @li The minimum stride is 32 and the maximum is 4096 * 4
  1628. * (that is, an image in argb format with a width of 4096);
  1629. * @li For 8K scaling, widthStride is required to be aligned to 2;
  1630. * @li For non 8K scaling, the calculation formula for widthStride
  1631. * is different for different image formats:
  1632. * @li yuv400sp, yuv420sp, yuv422sp, yuv444sp: input image width aligned to 16
  1633. * @li yuv422packed: input image width * 2 and then align to 16
  1634. * @li yuv444packed, rgb888: input image width alignment * 3, alignment to 16
  1635. * @li xrgb8888: input image width * 4, align to 16
  1636. * @li HFBC:input image width
  1637. * Height alignment requirements:
  1638. * @li The height of the input image is aligned to 2.
  1639. * High stride minimum 6 and maximum 4096.
  1640. *
  1641. * @param channelDesc [IN] the channel destruction
  1642. * @param inputDesc [IN] crop input picture destruction
  1643. * @param outputDesc [IN|OUT] crop output picture destruction
  1644. * @param cropArea [IN] crop area config
  1645. * @param resizeConfig [IN] resize config
  1646. * @param stream [IN] crop and resize config task stream
  1647. *
  1648. * @retval ACL_SUCCESS The function is successfully executed.
  1649. * @retval OtherValues Failure
  1650. */
  1651. ACL_FUNC_VISIBILITY aclError acldvppVpcCropResizeAsync(acldvppChannelDesc *channelDesc,
  1652. acldvppPicDesc *inputDesc,
  1653. acldvppPicDesc *outputDesc,
  1654. acldvppRoiConfig *cropArea,
  1655. acldvppResizeConfig *resizeConfig,
  1656. aclrtStream stream);
  1657. /**
  1658. * @ingroup AscendCL
  1659. * @brief dvpp vpc batch crop.
  1660. *
  1661. * @par Function
  1662. * crop the input batch picture according to the specified area
  1663. * as the output batch pictures
  1664. *
  1665. * @param channelDesc [IN] the channel destruction
  1666. * @param srcBatchPicDescs [IN] crop input batch picture destruction
  1667. * @param roiNums [IN] roi config numbers
  1668. * @param size [IN] roiNum size
  1669. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  1670. * @param cropAreas [IN] crop area configs
  1671. * @param stream [IN] crop batch task stream
  1672. *
  1673. * @retval ACL_SUCCESS The function is successfully executed.
  1674. * @retval OtherValues Failure
  1675. *
  1676. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig
  1677. */
  1678. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropAsync(acldvppChannelDesc *channelDesc,
  1679. acldvppBatchPicDesc *srcBatchPicDescs,
  1680. uint32_t *roiNums,
  1681. uint32_t size,
  1682. acldvppBatchPicDesc *dstBatchPicDescs,
  1683. acldvppRoiConfig *cropAreas[],
  1684. aclrtStream stream);
  1685. /**
  1686. * @ingroup AscendCL
  1687. * @brief dvpp vpc batch crop and resize config.
  1688. *
  1689. * @par Function
  1690. * crop the input batch picture with resize config according to the specified area
  1691. * as the output batch pictures
  1692. *
  1693. * @param channelDesc [IN] the channel destruction
  1694. * @param srcBatchPicDescs [IN] crop input batch picture destruction
  1695. * @param roiNums [IN] roi config numbers
  1696. * @param size [IN] roiNum size
  1697. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  1698. * @param cropAreas [IN] crop area configs
  1699. * @param resizeConfig [IN] resize config
  1700. * @param stream [IN] crop batch and resize config task stream
  1701. *
  1702. * @retval ACL_SUCCESS The function is successfully executed.
  1703. * @retval OtherValues Failure
  1704. *
  1705. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig | acldvppCreateDvppConfig
  1706. */
  1707. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropResizeAsync(acldvppChannelDesc *channelDesc,
  1708. acldvppBatchPicDesc *srcBatchPicDescs,
  1709. uint32_t *roiNums,
  1710. uint32_t size,
  1711. acldvppBatchPicDesc *dstBatchPicDescs,
  1712. acldvppRoiConfig *cropAreas[],
  1713. acldvppResizeConfig *resizeConfig,
  1714. aclrtStream stream);
  1715. /**
  1716. * @ingroup AscendCL
  1717. * @brief dvpp vpc crop and paste.
  1718. *
  1719. * @par Function
  1720. * crop the input picture according to the specified area,
  1721. * and paste the picture to the specified position of the target picture
  1722. * as the output picture
  1723. *
  1724. * @param channelDesc [IN] thechannel destruction
  1725. * @param inputDesc [IN] crop and paste input picture destruction
  1726. * @param outputDesc [IN|OUT] crop and paste output picture destruction
  1727. * @param cropArea [IN] crop area config
  1728. * @param pasteArea [IN] paste area config
  1729. * @param stream [IN] crop and paste task stream
  1730. *
  1731. * @retval ACL_SUCCESS The function is successfully executed.
  1732. * @retval OtherValues Failure
  1733. *
  1734. * @see acldvppCreateChannel | acldvppCreatePicDesc | acldvppCreateRoiConfig
  1735. */
  1736. ACL_FUNC_VISIBILITY aclError acldvppVpcCropAndPasteAsync(acldvppChannelDesc *channelDesc,
  1737. acldvppPicDesc *inputDesc,
  1738. acldvppPicDesc *outputDesc,
  1739. acldvppRoiConfig *cropArea,
  1740. acldvppRoiConfig *pasteArea,
  1741. aclrtStream stream);
  1742. /**
  1743. * @ingroup AscendCL
  1744. * @brief dvpp vpc crop, resize config and paste.
  1745. *
  1746. * @par Function
  1747. * crop the input picture with resize config according to the specified area,
  1748. * and paste the picture to the specified position of the target picture
  1749. * as the output picture
  1750. *
  1751. * @param channelDesc [IN] thechannel destruction
  1752. * @param inputDesc [IN] crop and paste input picture destruction
  1753. * @param outputDesc [IN|OUT] crop and paste output picture destruction
  1754. * @param cropArea [IN] crop area config
  1755. * @param pasteArea [IN] paste area config
  1756. * @param resizeConfig [IN] resize config
  1757. * @param stream [IN] crop, paste and resize task stream
  1758. *
  1759. * @retval ACL_SUCCESS The function is successfully executed.
  1760. * @retval OtherValues Failure
  1761. *
  1762. * @see acldvppCreateChannel | acldvppCreatePicDesc | acldvppCreateRoiConfig | acldvppCreateResizeConfig
  1763. */
  1764. ACL_FUNC_VISIBILITY aclError acldvppVpcCropResizePasteAsync(acldvppChannelDesc *channelDesc,
  1765. acldvppPicDesc *inputDesc,
  1766. acldvppPicDesc *outputDesc,
  1767. acldvppRoiConfig *cropArea,
  1768. acldvppRoiConfig *pasteArea,
  1769. acldvppResizeConfig *resizeConfig,
  1770. aclrtStream stream);
  1771. /**
  1772. * @ingroup AscendCL
  1773. * @brief dvpp vpc batch crop and paste.
  1774. *
  1775. * @par Function
  1776. * crop the input batch picture according to the specified area,
  1777. * and paste the pictures to the specified position of the target pictures
  1778. * as the output batch pictures
  1779. *
  1780. * @param channelDesc [IN] the channel destruction
  1781. * @param srcBatchPicDescs [IN] crop input batch picture destruction
  1782. * @param roiNums [IN] roi config numbers
  1783. * @param size [IN] roiNum size
  1784. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  1785. * @param cropAreas [IN] crop area configs
  1786. * @param pasteAreas [IN] paste area configs
  1787. * @param stream [IN] crop batch task stream
  1788. *
  1789. * @retval ACL_SUCCESS The function is successfully executed.
  1790. * @retval OtherValues Failure
  1791. *
  1792. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig
  1793. */
  1794. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropAndPasteAsync(acldvppChannelDesc *channelDesc,
  1795. acldvppBatchPicDesc *srcBatchPicDescs,
  1796. uint32_t *roiNums,
  1797. uint32_t size,
  1798. acldvppBatchPicDesc *dstBatchPicDescs,
  1799. acldvppRoiConfig *cropAreas[],
  1800. acldvppRoiConfig *pasteAreas[],
  1801. aclrtStream stream);
  1802. /**
  1803. * @ingroup AscendCL
  1804. * @brief dvpp vpc batch crop, resize config and paste.
  1805. *
  1806. * @par Function
  1807. * crop the input batch picture with resize config according to the specified area,
  1808. * and paste the pictures to the specified position of the target pictures
  1809. * as the output batch pictures
  1810. *
  1811. * @param channelDesc [IN] the channel destruction
  1812. * @param srcBatchPicDescs [IN] crop input batch picture destruction
  1813. * @param roiNums [IN] roi config numbers
  1814. * @param size [IN] roiNum size
  1815. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  1816. * @param cropAreas [IN] crop area configs
  1817. * @param pasteAreas [IN] paste area configs
  1818. * @param resizeConfig [IN] resize config
  1819. * @param stream [IN] crop batch and resize config task stream
  1820. *
  1821. * @retval ACL_SUCCESS The function is successfully executed.
  1822. * @retval OtherValues Failure
  1823. *
  1824. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig | acldvppCreateResizeConfig
  1825. */
  1826. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropResizePasteAsync(acldvppChannelDesc *channelDesc,
  1827. acldvppBatchPicDesc *srcBatchPicDescs,
  1828. uint32_t *roiNums,
  1829. uint32_t size,
  1830. acldvppBatchPicDesc *dstBatchPicDescs,
  1831. acldvppRoiConfig *cropAreas[],
  1832. acldvppRoiConfig *pasteAreas[],
  1833. acldvppResizeConfig *resizeConfig,
  1834. aclrtStream stream);
  1835. /**
  1836. * @ingroup AscendCL
  1837. * @brief dvpp vpc jpeg decode.
  1838. *
  1839. * @par Function
  1840. * For different source picture formats, after decoding,
  1841. * output pictures in the following format:
  1842. * @li jpeg(444) -> YUV444SP:V is front U is back,
  1843. * YUV420 SP V is front U is back, YUV420SP U is front V is back;
  1844. * @li jpeg(422) -> YUV422SP:V is in front U is behind,
  1845. * YUV420SP V is in front U is behind, YUV420SP U is in front V is behind;
  1846. * @li jpeg(420) -> YUV420SP:
  1847. * V is front U is back, YUV420SP U is front V is back;
  1848. * @li jpeg(400) -> YUV420SP:UV data is filled with 0 x 80.
  1849. *
  1850. * @param channelDesc [IN] the channel destruction
  1851. * @param data [IN] decode input picture destruction's data
  1852. * @param size [IN] decode input picture destruction's size
  1853. * @param outputDesc [IN|OUT] decode output picture destruction
  1854. * @param stream [IN] decode task stream
  1855. *
  1856. * @retval ACL_SUCCESS The function is successfully executed.
  1857. * @retval OtherValues Failure
  1858. *
  1859. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1860. */
  1861. ACL_FUNC_VISIBILITY aclError acldvppJpegDecodeAsync(acldvppChannelDesc *channelDesc,
  1862. const void *data,
  1863. uint32_t size,
  1864. acldvppPicDesc *outputDesc,
  1865. aclrtStream stream);
  1866. /**
  1867. * @ingroup AscendCL
  1868. * @brief dvpp vpc jpeg encode.
  1869. *
  1870. * @param channelDesc [IN] the channel destruction
  1871. * @param inputDesc [IN] encode input picture destruction
  1872. * @param data [OUT] encode output picture destruction's data
  1873. * @param size [IN|OUT] encode output picture destruction's size
  1874. * @param config [IN] jpeg encode config
  1875. * @param stream [IN] encode task stream
  1876. *
  1877. * @retval ACL_SUCCESS The function is successfully executed.
  1878. * @retval OtherValues Failure
  1879. *
  1880. * @see acldvppCreateChannel | acldvppCreateJpegeConfig
  1881. */
  1882. ACL_FUNC_VISIBILITY aclError acldvppJpegEncodeAsync(acldvppChannelDesc *channelDesc,
  1883. acldvppPicDesc *inputDesc,
  1884. const void *data,
  1885. uint32_t *size,
  1886. acldvppJpegeConfig *config,
  1887. aclrtStream stream);
  1888. /**
  1889. * @ingroup AscendCL
  1890. * @brief dvpp vpc png decode.
  1891. *
  1892. * @param channelDesc [IN] the channel destruction
  1893. * @param data [IN] decode input picture destruction's data
  1894. * @param size [IN] decode input picture destruction's size
  1895. * @param outputDesc [IN|OUT] decode output picture destruction
  1896. * @param stream [IN] decode task stream
  1897. *
  1898. * @retval ACL_SUCCESS The function is successfully executed.
  1899. * @retval OtherValues Failure
  1900. *
  1901. * @see acldvppCreateChannel | acldvppCreatePicDesc
  1902. */
  1903. ACL_FUNC_VISIBILITY aclError acldvppPngDecodeAsync(acldvppChannelDesc *channelDesc,
  1904. const void *data,
  1905. uint32_t size,
  1906. acldvppPicDesc *outputDesc,
  1907. aclrtStream stream);
  1908. /**
  1909. * @ingroup AscendCL
  1910. * @brief Create vdec channel.
  1911. *
  1912. * @par Function
  1913. * Create a channel for video data processing,
  1914. * the same channel can be reused,
  1915. * and is no longer available after destruction
  1916. *
  1917. * @param channelDesc [IN|OUT] the channel destruction
  1918. *
  1919. * @retval ACL_SUCCESS The function is successfully executed.
  1920. * @retval OtherValues Failure
  1921. *
  1922. * @see aclvdecCreateChannelDesc
  1923. */
  1924. ACL_FUNC_VISIBILITY aclError aclvdecCreateChannel(aclvdecChannelDesc *channelDesc);
  1925. /**
  1926. * @ingroup AscendCL
  1927. * @brief Destroy vdec channel.
  1928. *
  1929. * @par Function
  1930. * Can only destroy channels created by the aclvdecCreateChannel interface
  1931. *
  1932. * @param channelDesc [IN] the channel destruction
  1933. *
  1934. * @retval ACL_SUCCESS The function is successfully executed.
  1935. * @retval OtherValues Failure
  1936. *
  1937. * @see aclvdecCreateChannel
  1938. */
  1939. ACL_FUNC_VISIBILITY aclError aclvdecDestroyChannel(aclvdecChannelDesc *channelDesc);
  1940. /**
  1941. * @ingroup AscendCL
  1942. * @brief dvpp vdec send frame.
  1943. *
  1944. * @par Function
  1945. * Pass the input memory to be decoded
  1946. * and the decoded output memory to the decoder for decoding
  1947. *
  1948. * @param channelDesc [IN] vdec channel destruction
  1949. * @param input [IN] input stream destruction
  1950. * @param output [IN|OUT] output picture destruction
  1951. * @param config [IN] vdec frame config
  1952. * @param userData [IN] user data for callback function
  1953. *
  1954. * @retval ACL_SUCCESS The function is successfully executed.
  1955. * @retval OtherValues Failure
  1956. *
  1957. * @see aclvdecCreateChannel | acldvppCreateStreamDesc | acldvppCreatePicDesc
  1958. */
  1959. ACL_FUNC_VISIBILITY aclError aclvdecSendFrame(aclvdecChannelDesc *channelDesc,
  1960. acldvppStreamDesc *input,
  1961. acldvppPicDesc *output,
  1962. aclvdecFrameConfig *config,
  1963. void *userData);
  1964. /**
  1965. * @ingroup AscendCL
  1966. * @brief dvpp vdec send skipped frame.
  1967. *
  1968. * @par Function
  1969. * Pass video frame to decoder
  1970. *
  1971. * @param channelDesc [IN] vdec channel destruction
  1972. * @param input [IN] input stream destruction
  1973. * @param config [IN] vdec frame config
  1974. * @param userData [IN] user data for callback function
  1975. *
  1976. * @retval ACL_SUCCESS The function is successfully executed.
  1977. * @retval OtherValues Failure
  1978. *
  1979. * @see aclvdecCreateChannel | acldvppCreateStreamDesc | acldvppCreatePicDesc | aclvdecSendFrame
  1980. */
  1981. ACL_FUNC_VISIBILITY aclError aclvdecSendSkippedFrame(aclvdecChannelDesc *channelDesc,
  1982. acldvppStreamDesc *input,
  1983. aclvdecFrameConfig *config,
  1984. void *userData);
  1985. /**
  1986. * @ingroup AscendCL
  1987. * @brief dvpp vpc convert color.
  1988. *
  1989. * @par Restriction
  1990. * @li outputDesc:Width height stride, No changes are allowed. Just configure 0
  1991. * @par Function
  1992. * Convert color gamut
  1993. *
  1994. * @param channelDesc [IN] the channel destruction
  1995. * @param inputDesc [IN] convert color input picture destruction
  1996. * @param outputDesc [IN|OUT] convert color output picture destruction
  1997. * @param stream [IN] convert color task stream
  1998. *
  1999. * @retval ACL_SUCCESS The function is successfully executed.
  2000. * @retval OtherValues Failure
  2001. *
  2002. * @see acldvppCreateChannel | acldvppCreatePicDesc
  2003. */
  2004. ACL_FUNC_VISIBILITY aclError acldvppVpcConvertColorAsync(acldvppChannelDesc *channelDesc,
  2005. acldvppPicDesc *inputDesc,
  2006. acldvppPicDesc *outputDesc,
  2007. aclrtStream stream);
  2008. /**
  2009. * @ingroup AscendCL
  2010. * @brief dvpp vpc pyramid down.
  2011. *
  2012. * @par Restriction
  2013. * @li outputDesc:format only supported YUV400
  2014. * @par Function
  2015. * Image pyramid down
  2016. *
  2017. * @param channelDesc [IN] the channel destruction
  2018. * @param inputDesc [IN] pyr down input picture destruction
  2019. * @param outputDesc [IN|OUT] pyr down output picture destruction
  2020. * @param reserve [IN] reserved param , must be nullptr
  2021. * @param stream [IN] pyr down task stream
  2022. *
  2023. * @retval ACL_SUCCESS The function is successfully executed.
  2024. * @retval OtherValues Failure
  2025. *
  2026. * @see acldvppCreateChannel | acldvppCreatePicDesc
  2027. */
  2028. ACL_FUNC_VISIBILITY aclError acldvppVpcPyrDownAsync(acldvppChannelDesc *channelDesc,
  2029. acldvppPicDesc *inputDesc,
  2030. acldvppPicDesc *outputDesc,
  2031. void *reserve,
  2032. aclrtStream stream);
  2033. /**
  2034. * @ingroup AscendCL
  2035. * @brief Set dvpp channel mode.
  2036. *
  2037. * @param channelDesc [OUT] the channel destruction
  2038. * @param mode [IN] channel mode
  2039. *
  2040. * @retval ACL_SUCCESS The function is successfully executed.
  2041. * @retval OtherValues Failure
  2042. */
  2043. ACL_FUNC_VISIBILITY aclError acldvppSetChannelDescMode(acldvppChannelDesc *channelDesc,
  2044. uint32_t mode);
  2045. /**
  2046. * @ingroup AscendCL
  2047. * @brief Set resize config interpolation.
  2048. *
  2049. * @param resizeConfig [OUT] the resize config
  2050. * @param interpolation [IN] interpolation
  2051. *
  2052. * @retval ACL_SUCCESS The function is successfully executed.
  2053. * @retval OtherValues Failure
  2054. */
  2055. ACL_FUNC_VISIBILITY aclError acldvppSetResizeConfigInterpolation(acldvppResizeConfig *resizeConfig,
  2056. uint32_t interpolation);
  2057. /**
  2058. * @ingroup AscendCL
  2059. * @brief Get resize config interpolation.
  2060. *
  2061. * @param resizeConfig [IN] the resize config
  2062. *
  2063. * @retval Interpolation of resize config.
  2064. */
  2065. ACL_FUNC_VISIBILITY uint32_t acldvppGetResizeConfigInterpolation(const acldvppResizeConfig *resizeConfig);
  2066. /**
  2067. * @ingroup AscendCL
  2068. * @brief Set vdec channel out mode.
  2069. *
  2070. * @param channelDesc [OUT] the channel destruction
  2071. * @param outMode [IN] channel out mode
  2072. *
  2073. * @retval ACL_SUCCESS The function is successfully executed.
  2074. * @retval OtherValues Failure
  2075. */
  2076. ACL_FUNC_VISIBILITY aclError aclvdecSetChannelDescOutMode(aclvdecChannelDesc *channelDesc,
  2077. uint32_t outMode);
  2078. /**
  2079. * @ingroup AscendCL
  2080. * @brief Get vdec channel out mode.
  2081. *
  2082. * @param channelDesc [IN] the channel destruction
  2083. *
  2084. * @retval Out mode of channel destruction
  2085. * @retval default 0
  2086. */
  2087. ACL_FUNC_VISIBILITY uint32_t aclvdecGetChannelDescOutMode(const aclvdecChannelDesc *channelDesc);
  2088. /**
  2089. * @ingroup AscendCL
  2090. * @brief Create dvpp batch picture description.
  2091. *
  2092. * @param batchSize [IN] batch size
  2093. *
  2094. * @retval null for failed.
  2095. * @retval OtherValues success.
  2096. */
  2097. ACL_FUNC_VISIBILITY acldvppBatchPicDesc *acldvppCreateBatchPicDesc(uint32_t batchSize);
  2098. /**
  2099. * @ingroup AscendCL
  2100. * @brief Get dvpp picture description.
  2101. *
  2102. * @param batchPicDesc [IN] dvpp batch picture description.
  2103. * @param index [IN] index of batch
  2104. *
  2105. * @retval null for failed.
  2106. * @retval OtherValues Failure
  2107. *
  2108. * @see acldvppCreateBatchPicDesc
  2109. */
  2110. ACL_FUNC_VISIBILITY acldvppPicDesc *acldvppGetPicDesc(acldvppBatchPicDesc *batchPicDesc, uint32_t index);
  2111. /**
  2112. * @ingroup AscendCL
  2113. * @brief Destroy dvpp batch picture description.
  2114. *
  2115. * @par Function
  2116. * Can only destroy batch picture description information created
  2117. * through acldvppCreateBatchPicDesc interface.
  2118. *
  2119. * @param batchPicDesc [IN] dvpp batch picture description.
  2120. *
  2121. * @retval ACL_SUCCESS The function is successfully executed.
  2122. * @retval OtherValues Failure
  2123. *
  2124. * @see acldvppCreateBatchPicDesc
  2125. */
  2126. ACL_FUNC_VISIBILITY aclError acldvppDestroyBatchPicDesc(acldvppBatchPicDesc *batchPicDesc);
  2127. /**
  2128. * @ingroup AscendCL
  2129. * @brief Create dvpp lut map.
  2130. *
  2131. * @retval null for failed.
  2132. * @retval OtherValues success.
  2133. */
  2134. ACL_FUNC_VISIBILITY acldvppLutMap *acldvppCreateLutMap();
  2135. /**
  2136. * @ingroup AscendCL
  2137. * @brief Destroy lut map.
  2138. *
  2139. * @param lutMap [IN] lut map
  2140. *
  2141. * @retval ACL_SUCCESS for success, other for failure
  2142. */
  2143. ACL_FUNC_VISIBILITY aclError acldvppDestroyLutMap(acldvppLutMap *lutMap);
  2144. /**
  2145. * @ingroup AscendCL
  2146. * @brief Get lut map dims.
  2147. *
  2148. * @param lutMap [IN] lut map
  2149. *
  2150. * @retval 0 for failed.
  2151. * @retval OtherValues success.
  2152. */
  2153. ACL_FUNC_VISIBILITY uint32_t acldvppGetLutMapDims(const acldvppLutMap *lutMap);
  2154. /**
  2155. * @ingroup AscendCL
  2156. * @brief Get lut map data.
  2157. *
  2158. * @param lutMap [IN] lut map
  2159. * @param dim [IN] input dim of map
  2160. * @param data [OUT] the dim of lut map's data
  2161. * @param len [OUT] the dim of lut map's length
  2162. *
  2163. * @retval ACL_SUCCESS The function is successfully executed.
  2164. * @retval OtherValues Failure
  2165. */
  2166. ACL_FUNC_VISIBILITY aclError acldvppGetLutMapData(const acldvppLutMap *lutMap,
  2167. uint32_t dim,
  2168. uint8_t **data,
  2169. uint32_t *len);
  2170. /**
  2171. * @ingroup AscendCL
  2172. * @brief Vpc equalize hist.
  2173. *
  2174. * @param channelDesc [IN] channel desc
  2175. * @param inputDesc [IN] input desc
  2176. * @param outputDesc [IN|OUT] output desc
  2177. * @param lutMap [IN] lut map param
  2178. * @param stream [IN] runtime stream
  2179. *
  2180. * @retval ACL_SUCCESS The function is successfully executed.
  2181. * @retval OtherValues Failure
  2182. *
  2183. * @see acldvppCreateChannel|acldvppCreatePicDesc|acldvppCreateLutMap
  2184. */
  2185. ACL_FUNC_VISIBILITY aclError acldvppVpcEqualizeHistAsync(const acldvppChannelDesc *channelDesc,
  2186. const acldvppPicDesc *inputDesc,
  2187. acldvppPicDesc *outputDesc,
  2188. const acldvppLutMap *lutMap,
  2189. aclrtStream stream);
  2190. /**
  2191. * @ingroup AscendCL
  2192. * @brief Create dvpp border config.
  2193. *
  2194. * @retval null for failed.
  2195. * @retval OtherValues success.
  2196. */
  2197. ACL_FUNC_VISIBILITY acldvppBorderConfig *acldvppCreateBorderConfig();
  2198. /**
  2199. * @ingroup AscendCL
  2200. * @brief Set value of border config.
  2201. *
  2202. * @param borderConfig [OUT] border config
  2203. * @param index [IN] index of value array
  2204. * @param value [IN] value
  2205. *
  2206. * @retval ACL_SUCCESS for success, other for failure
  2207. */
  2208. ACL_FUNC_VISIBILITY aclError acldvppSetBorderConfigValue(acldvppBorderConfig *borderConfig,
  2209. uint32_t index,
  2210. double value);
  2211. /**
  2212. * @ingroup AscendCL
  2213. * @brief Set border type of border config.
  2214. *
  2215. * @param borderConfig [OUT] border config
  2216. * @param borderType [IN] border type
  2217. *
  2218. * @retval ACL_SUCCESS for success, other for failure
  2219. */
  2220. ACL_FUNC_VISIBILITY aclError acldvppSetBorderConfigBorderType(acldvppBorderConfig *borderConfig,
  2221. acldvppBorderType borderType);
  2222. /**
  2223. * @ingroup AscendCL
  2224. * @brief Set top of border config.
  2225. *
  2226. * @param borderConfig [OUT] border config
  2227. * @param top [IN] top of border
  2228. *
  2229. * @retval ACL_SUCCESS for success, other for failure
  2230. */
  2231. ACL_FUNC_VISIBILITY aclError acldvppSetBorderConfigTop(acldvppBorderConfig *borderConfig, uint32_t top);
  2232. /**
  2233. * @ingroup AscendCL
  2234. * @brief Set bottom of border config.
  2235. *
  2236. * @param borderConfig [OUT] border config
  2237. * @param bottom [IN] bottom of border
  2238. *
  2239. * @retval ACL_SUCCESS for success, other for failure
  2240. */
  2241. ACL_FUNC_VISIBILITY aclError acldvppSetBorderConfigBottom(acldvppBorderConfig *borderConfig, uint32_t bottom);
  2242. /**
  2243. * @ingroup AscendCL
  2244. * @brief Set left of border config.
  2245. *
  2246. * @param borderConfig [OUT] border config
  2247. * @param left [IN] left of border
  2248. *
  2249. * @retval ACL_SUCCESS for success, other for failure
  2250. */
  2251. ACL_FUNC_VISIBILITY aclError acldvppSetBorderConfigLeft(acldvppBorderConfig *borderConfig, uint32_t left);
  2252. /**
  2253. * @ingroup AscendCL
  2254. * @brief Set right of border config.
  2255. *
  2256. * @param borderConfig [OUT] border config
  2257. * @param right [IN] right of border
  2258. *
  2259. * @retval ACL_SUCCESS for success, other for failure
  2260. */
  2261. ACL_FUNC_VISIBILITY aclError acldvppSetBorderConfigRight(acldvppBorderConfig *borderConfig, uint32_t right);
  2262. /**
  2263. * @ingroup AscendCL
  2264. * @brief Get value of border config.
  2265. *
  2266. * @param borderConfig [IN] border config
  2267. * @param index[IN] index of value array
  2268. *
  2269. * @retval invalid value is < 0, normal Value is >= 0
  2270. */
  2271. ACL_FUNC_VISIBILITY double acldvppGetBorderConfigValue(const acldvppBorderConfig *borderConfig, uint32_t index);
  2272. /**
  2273. * @ingroup AscendCL
  2274. * @brief Get border type of border config.
  2275. *
  2276. * @param borderConfig [IN] border config
  2277. * @retval border type of border config
  2278. */
  2279. ACL_FUNC_VISIBILITY acldvppBorderType acldvppGetBorderConfigBorderType(const acldvppBorderConfig *borderConfig);
  2280. /**
  2281. * @ingroup AscendCL
  2282. * @brief Get right of border config.
  2283. *
  2284. * @param borderConfig [IN] border config
  2285. *
  2286. * @retval default 0, top value of border config
  2287. */
  2288. ACL_FUNC_VISIBILITY uint32_t acldvppGetBorderConfigTop(const acldvppBorderConfig *borderConfig);
  2289. /**
  2290. * @ingroup AscendCL
  2291. * @brief Get Bottom of border config.
  2292. *
  2293. * @param borderConfig [IN] border config
  2294. *
  2295. * @retval default 0, top value of border config
  2296. */
  2297. ACL_FUNC_VISIBILITY uint32_t acldvppGetBorderConfigBottom(const acldvppBorderConfig *borderConfig);
  2298. /**
  2299. * @ingroup AscendCL
  2300. * @brief Get left of border config.
  2301. *
  2302. * @param borderConfig [IN] border config
  2303. *
  2304. * @retval default 0, top value of border config
  2305. */
  2306. ACL_FUNC_VISIBILITY uint32_t acldvppGetBorderConfigLeft(const acldvppBorderConfig *borderConfig);
  2307. /**
  2308. * @ingroup AscendCL
  2309. * @brief Get right of border config.
  2310. *
  2311. * @param borderConfig [IN] border config
  2312. *
  2313. * @retval default 0, right value of border config
  2314. */
  2315. ACL_FUNC_VISIBILITY uint32_t acldvppGetBorderConfigRight(const acldvppBorderConfig *borderConfig);
  2316. /**
  2317. * @ingroup AscendCL
  2318. * @brief Destroy border config.
  2319. *
  2320. * @param borderConfig [IN] border config
  2321. *
  2322. * @retval ACL_SUCCESS for success, other for failure
  2323. */
  2324. ACL_FUNC_VISIBILITY aclError acldvppDestroyBorderConfig(acldvppBorderConfig *borderConfig);
  2325. /**
  2326. * @ingroup AscendCL
  2327. * @brief Vpc make border.
  2328. *
  2329. * @param channelDesc [IN] channel desc
  2330. * @param inputDesc [IN] input desc
  2331. * @param outputDesc [IN|OUT] output desc
  2332. * @param borderConfig [IN] border config param
  2333. * @param stream [IN] runtime stream
  2334. *
  2335. * @retval ACL_SUCCESS The function is successfully executed.
  2336. * @retval OtherValues Failure
  2337. *
  2338. * @see acldvppCreateChannel|acldvppCreatePicDesc|acldvppCreateBorderConfig
  2339. */
  2340. ACL_FUNC_VISIBILITY aclError acldvppVpcMakeBorderAsync(const acldvppChannelDesc *channelDesc,
  2341. const acldvppPicDesc *inputDesc,
  2342. acldvppPicDesc *outputDesc,
  2343. const acldvppBorderConfig *borderConfig,
  2344. aclrtStream stream);
  2345. /**
  2346. * @ingroup AscendCL
  2347. * @brief Dvpp vpc calc hist.
  2348. *
  2349. * @param channelDesc [IN] the channel destruction
  2350. * @param srcPicDesc [IN] pyr down input picture destruction
  2351. * @param hist [IN|OUT] pyr down output picture destruction
  2352. * @param reserve [IN] reserved param, must be nullptr
  2353. * @param stream [IN] task stream
  2354. *
  2355. * @retval ACL_SUCCESS The function is successfully executed.
  2356. * @retval OtherValues Failure
  2357. *
  2358. * @see acldvppCreateChannel | acldvppCreatePicDesc | acldvppCreateHist
  2359. */
  2360. ACL_FUNC_VISIBILITY aclError acldvppVpcCalcHistAsync(acldvppChannelDesc *channelDesc,
  2361. acldvppPicDesc *srcPicDesc,
  2362. acldvppHist *hist,
  2363. void *reserve,
  2364. aclrtStream stream);
  2365. /**
  2366. * @ingroup AscendCL
  2367. * @brief Create vpc hist description.
  2368. *
  2369. * @retval null for failed.
  2370. * @retval OtherValues success.
  2371. */
  2372. ACL_FUNC_VISIBILITY acldvppHist* acldvppCreateHist();
  2373. /**
  2374. * @ingroup AscendCL
  2375. * @brief Destroy vpc hist description.
  2376. *
  2377. * @par Function
  2378. * Can only destroy hist description information created
  2379. * through acldvppCreateHist interface.
  2380. *
  2381. * @param hist [IN] vpc hist description.
  2382. *
  2383. * @retval ACL_SUCCESS The function is successfully executed.
  2384. * @retval OtherValues Failure
  2385. *
  2386. * @see acldvppCreateHist
  2387. */
  2388. ACL_FUNC_VISIBILITY aclError acldvppDestroyHist(acldvppHist *hist);
  2389. /**
  2390. * @ingroup AscendCL
  2391. * @brief Get dims of vpc hist description.
  2392. *
  2393. * @param hist [IN] vpc hist description.
  2394. *
  2395. * @retval dims of vpc hist description.
  2396. *
  2397. * @see acldvppCreateHist | acldvppVpcCalcHistAsync
  2398. */
  2399. ACL_FUNC_VISIBILITY uint32_t acldvppGetHistDims(acldvppHist *hist);
  2400. /**
  2401. * @ingroup AscendCL
  2402. * @brief Get data from vpc hist description by dim.
  2403. *
  2404. * @param hist [IN] vpc hist description.
  2405. * @param dim [IN] which dim to get data.
  2406. * @param data [OUT] address of output hist data.
  2407. * @param len [OUT] len of output hist data.
  2408. *
  2409. * @retval ACL_SUCCESS The function is successfully executed.
  2410. * @retval OtherValues Failure
  2411. *
  2412. * @see acldvppCreateHist | acldvppVpcCalcHistAsync
  2413. */
  2414. ACL_FUNC_VISIBILITY aclError acldvppGetHistData(acldvppHist *hist, uint32_t dim, uint32_t **data, uint16_t *len);
  2415. /**
  2416. * @ingroup AscendCL
  2417. * @brief Get dvpp calc hist process return code.
  2418. *
  2419. * @param hist [IN] vpc hist description.
  2420. *
  2421. * @retval Dvpp calc hist process return code.
  2422. *
  2423. * @see acldvppCreateHist | acldvppVpcCalcHistAsync
  2424. */
  2425. ACL_FUNC_VISIBILITY uint32_t acldvppGetHistRetCode(acldvppHist* hist);
  2426. /**
  2427. * @ingroup AscendCL
  2428. * @brief Set vpc hist description to 0.
  2429. *
  2430. * @par Function
  2431. * Can only clear hist description information created
  2432. * through acldvppCreateHist interface.
  2433. *
  2434. * @param hist [IN] vpc hist description.
  2435. *
  2436. * @retval ACL_SUCCESS The function is successfully executed.
  2437. * @retval OtherValues Failure
  2438. *
  2439. * @see acldvppCreateHist
  2440. */
  2441. ACL_FUNC_VISIBILITY aclError acldvppClearHist(acldvppHist *hist);
  2442. /**
  2443. * @ingroup AscendCL
  2444. * @brief dvpp vpc batch crop, resize config and make border.
  2445. *
  2446. * @par Function
  2447. * crop the input batch picture with resize config and border configs according to the specified area
  2448. * as the output batch pictures
  2449. *
  2450. * @param channelDesc [IN] the channel destruction
  2451. * @param srcBatchPicDescs [IN] crop input batch picture destruction
  2452. * @param roiNums [IN] roi config numbers
  2453. * @param size [IN] roiNum size
  2454. * @param dstBatchPicDescs [IN|OUT] crop output batch picture destruction
  2455. * @param cropAreas [IN] crop area configs
  2456. * @param borderCfgs [IN] border configs
  2457. * @param resizeConfig [IN] resize config
  2458. * @param stream [IN] crop batch, resize config and make border task stream
  2459. *
  2460. * @retval ACL_SUCCESS The function is successfully executed.
  2461. * @retval OtherValues Failure
  2462. *
  2463. * @see acldvppCreateChannel | acldvppCreateBatchPicDesc | acldvppCreateRoiConfig | acldvppCreateResizeConfig
  2464. */
  2465. ACL_FUNC_VISIBILITY aclError acldvppVpcBatchCropResizeMakeBorderAsync(acldvppChannelDesc *channelDesc,
  2466. acldvppBatchPicDesc *srcBatchPicDescs,
  2467. uint32_t *roiNums,
  2468. uint32_t size,
  2469. acldvppBatchPicDesc *dstBatchPicDescs,
  2470. acldvppRoiConfig *cropAreas[],
  2471. acldvppBorderConfig *borderCfgs[],
  2472. acldvppResizeConfig *resizeConfig,
  2473. aclrtStream stream);
  2474. #ifdef __cplusplus
  2475. }
  2476. #endif
  2477. #endif // INC_EXTERNAL_ACL_OPS_ACL_DVPP_H_

图引擎模块(GE)是MindSpore的一个子模块,其代码由C++实现,位于前端模块ME和底层硬件之间,起到承接作用。图引擎模块以ME下发的图作为输入,然后进行一系列的深度图优化操作,最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点,做了特定的优化工作,以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时,GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成,详细的架构图如下所示