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

acl_dvpp.h 90 kB

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

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