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

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

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