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

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

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