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

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

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