通用开发官方很大按需hiive api reference_第1页
通用开发官方很大按需hiive api reference_第2页
通用开发官方很大按需hiive api reference_第3页
通用开发官方很大按需hiive api reference_第4页
通用开发官方很大按需hiive api reference_第5页
已阅读5页,还剩249页未读, 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、HiIVEAPI ReferenceIssue18Date2018-05-10Copyright © HiSilicon Technologies Co.,. 2017-2018.or by any means without priorNo part of this document may be reproduced or transmitted in any formwritten consent of HiSilicon Technologies Co.,.Trademarks and Permissions, and other HiSilicon icons are tr

2、ademarks of HiSilicon Technologies Co.,.All other trademarks and trade names mentioned in this document are the property of their respective holders.NoticeThe purchased products, services and features are stipulated by the contractbetween HiSilicon andthe customer. All or part of the products, servi

3、ces and features described in this document may not bewithin the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,information, and recommendations in this document are provided "AS IS" without warr or representations of any kind, either express

4、or implied.es, guaranteesThe information in this document is subject to change without notice. Every effort has beenin thepreparation of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this document do not constitute a warranty of any kind, e

5、xpress or implied.HiSilicon Technologies Co.,.Address:Industrial Basean, LonggangBShenzhen 518129People'sWebsite:supportHiIVEAPI ReferenceAbout This Document About This DocumentPurposeThis document provides reference information including the media processing platform (MPP)programinterfaces (MPI

6、s), header files, error codes, and proc information for theprogrammers that develop products or solutions using the intelligent HiSilicon media processors.engine (IVE) ofUnless otherwise specified, the contents of the Hi3521A also apply to Hi3520D V300.Unless otherwise specified, the contents of Hi3

7、518E V200 also apply to Hi3518E V201 and Hi3516C V200.Unless otherwise specified, the contents of Hi3516C V300 also apply to Hi3516E V100.Unless otherwise specified, the descriptions of the Hi3556 V100 also apply to Hi3559 V100, and those of the Hi3516A V200 also applies to Hi3519 V101.Unless otherw

8、ise specified, the contents of the Hi3559A V100 also apply to Hi3559C V100 and Hi3519A V100. Related VersionsThe following table lists the product versions related to this document.HiSilicon Proprietary andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)iProduct NameVersionHi3516AV2

9、00Hi3536V100Hi3521AV100Hi3531AV100Hi3520DV300Hi3518EV200Hi3518EV201Hi3516CV200Hi3519V100Hi3519V101HiIVEAPI ReferenceAbout This DocumentIntended AudienceThis document is intended for:Technical support engineersSoftware development engineers Symbol ConventionsThe symbols that may be found in this docu

10、ment are defined as follows.HiSilicon Proprietary andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)iiSymbolDescriptionAlerts you to a high risk hazard that could, if not avoided, result in serious injury or death.Alerts you to a medium or low risk hazard that could, if not avoided

11、, result in moderate or minor injury.Alerts you to a potentially hazardous situation that could, if not avoided, result in equipment damage, data loss, performance deterioration, or unipated results.Provides a tip that may help you solve a problem or save time.Provides additional information to emph

12、asize or supplement important points in the main text.Product NameVersionHi3516CV300Hi3516EV100Hi3559V100Hi3556V100Hi3559AV100ESHi3536CV100Hi3559AV100Hi3531DV100Hi3521DV100Hi3559CV100Hi3519AV100HiIVEAPI ReferenceAbout This DocumentChange HistoryChanges between document issues are cumulative. Therefo

13、re, the latest document issuecontains all changesin previous issues.Issue 18 (2018-05-10)This issue is the eighteenth official release, which incorporates the following changes:In chapter 3, the description in the Member field of IVE_MODULE_PARAMS_S is modified.Issue 17 (2018-02-10)This issue is the

14、 seventeenth official release, which incorporates the following changes:In chapter 3, the descriptions in the Syntax and Member fields of IVE_MODULE_PARAMS_S are modified.Issue 16 (2017-11-15)This issue is the sixteenth official release, which incorporates the following changes: The description of t

15、he Hi3559A V100 is added.Issue 15 (2017-08-30)This issue is the fifteenth official release, which incorporates the following changes: The description of the Hi3516A V100 is deleted.Issue 14 (2017-06-30)This issue is the fourteenth official release, which incorporates the following changes:In chapter

16、 2, the descriptions in the Description and Syntax fields of HI_MPI_IVE_Map are modified.In section 5.2, the Debugging Information and Parameter Description fields are modified.Issue 13 (2017-05-27)This issue is the thirteenth official release, which incorporates the following changes:Chapter 3 Data

17、 StructuresThe name of the u32Stride member of IVE_IMAGE_S is changed to au32Stride.Issue 12 (2017-04-10)This issue is the twelfth official release, which incorporates the following changes: The description related to the Hi3536C V100 is added.HiSilicon Proprietary andCopyright © HiSilicon Tech

18、nologies Co.,Issue 18 (2018-05-10)iiiHiIVEAPI ReferenceAbout This DocumentIssue 11 (2017-03-28)This issue is the eleventh official release, which incorporates the following changes: The description related to the Hi3559A V100ES is added.Issue 10 (2017-02-15)This issue is the tenth official release,

19、which incorporates the following changes:Chapter 3 Data StructuresThe description in the Member field of IVE_SAD_CTRL_S is modified.Issue 09 (2016-11-25)This issue is the ninth official release, which incorporates the following changes:Chapter 2 API ReferenceThe description in the Note field of HI_M

20、PI_IVE_Predict is modified.Issue 08 (2016-08-30)This issue is the eighth official release, which incorporates the following changes:The contents related to Hi3559 V100 aded.Issue 07 (2016-07-10)This issue is the seventh official release, which incorporates the following changes:The contents related

21、to Hi3516C V300 aChapter 2 API Referenceded.The description in the Note field of HI_MPI_IVE_Add is modified.Chapter 3 Data StructuresHI_MPI_IVE_Resize2 and IVE_RESIZE2_CTRL_S aded.Issue 06 (2016-05-10)This issue is the sixth official release, which incorporates the following changes:The contents rel

22、ated to Hi3519 V101 a Chapter 1 Introduction to the IVE Section 1.2.1 is modified.Chapter 2 API Referenceded.HI_MPI_IVE_GetResult is modified.Chapter 3 Data StructuresIVE_MODULE_PARAMS_S is added.Issue 05 (2015-12-15)This issue is the fifth official release, which incorporates the following changes:

23、HiSilicon Proprietary andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)ivHiIVEAPI ReferenceAbout This DocumentChapter 3 Data StructuresThe description in the Member field of IVE_CCBLOB_S is modified.Issue 04 (2015-09-20)This issue is the fourth official release, which incorporates

24、 the following changes:Chapter 6 FAQThis chapter is added.The contents related to the Hi3519 V100 aded.Issue 03 (2015-07-29)This issue is the third official release, which incorporates the following changes:The contents related to the Hi3521A, Hi3520D V300, Hi3531A, Hi3518E V200, Hi3518EV201, and Hi

25、3516C V200 aded.Issue 02 (2015-01-19)This issue is the second official release, which incorporates the following changes:Chapter 2 API ReferenceThe description in the Example field of HI_MPI_IVE_Query is modified.Issue 01 (2014-12-20)This issue is the first official release, which incorporates the f

26、ollowing changes:The contents related to the Hi3516D aChapter 3 Data Structuresded.IVE_DST_DATA_S and IVE_MEM_INFO_S aded.Issue 00B03 (2014-09-25)This issue is the third draft release, which incorporates the following changes:Chapter 1 Introduction to the IVEIn section 1.2.1, the description of bIns

27、ts modified.Issue 00B02 (2014-09-14)This issue is the second draft release, which incorporates the following changes:Chapter 5 Proc Debugging InformationIn section 5.2, debugging information and IVE parameters are modified.Issue 00B01 (2014-08-12)This issue is the first draft release.HiSilicon Propr

28、ietary andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)vHiIVEAPI ReferenceContentsContents1 Introduction to the IVE11.1 Overview11.2 Functions11.2.1 Important Concepts11.2.2 Instruction142 API Reference153 Data Structures1474 Error Codes2365 Proc Debugging Information2385.1 Overv

29、iew2385.2 Proc Information2386 FAQs2426.1 Differences Between the IVE Clib on the PC and IVE SDK on thfor Algorithm Development2426.2 Differences Between the IVE and OpenCV for Algorithm Development2436.3 Establishment of the ANN/SVM Lookup Table2436.4 Cache Memory244HiSilicon Proprietary andCopyrig

30、ht © HiSilicon Technologies Co.,Issue 18 (2018-05-10)viHiIVEAPI ReferenceFiguresFiguresFigure 1-1 Stride schematic diagram2Figure 1-2 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_U8C1, IVE_IMAGE_TYPE_S8C1, IVE_IMAGE_TYPE_S16C1, IVE_IMAGE_TYPE_U16C1, IVE_IMAGE_TYPE_S32C1, IVE_IMAGE_TYPE_U32C1, IVE_IM

31、AGE_TYPE_S64C1, or IVE_IMAGE_TYPE_U64C1 type7Figure 1-3 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_YUV420SP type8Figure 1-4 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_YUV422SP type8Figure 1-5 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_YUV420P type.9Figure 1-6 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_YUV422P t

32、ype.9Figure 1-7 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_S8C2_PACKAGE type10Figure 1-8 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_S8C2_PLANAR type10Figure 1-9 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_U8C3_PACKAGE type11Figure 1-10 IVE_IMAGE_S image of the IVE_IMAGE_TYPE_U8C3_PLANAR type12Figure 1-11 Memo

33、ry for storing IVE_DATA_S data13Figure 1-12 Memory for storing IVE_MEM_INFO_S data13Figure 1-13 Integrogram combined output (IVE_IMAGE_TYPE_U64C1)13Figure 1-14 Histogram output format13Figure 2-1 Fast copy mode19Figure 2-2 Indirect copy mode20Figure 2-3 Filter formula22Figure 2-4 Sobel formula28Figu

34、re 2-5 MagAndAng formula32Figure 2-6 Dilate formula35Figure 2-7 Erode formula38Figure 2-8 Eight Thresh threshold modes41Figure 2-9 Four Thresh_S16 threshold modes52Figure 2-10 Two Thresh_U16 threshold modes54Figure 2-11 Four conversion modes from 16-bit data to 8-bit data57HiSilicon Proprietary andC

35、opyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)viiHiIVEAPI ReferenceFiguresFigure 2-12 Memory allocation of GMMs for gray-scale images75Figure 2-13 Memory allocation of GMMs for RGB images75Figure 2-14 Memory allocation of GMM2s for gray-scale images79Figure 2-15 Memory allocation o

36、f GMM2s for RGB images79Figure 2-16 LBP formula84Figure 2-17 NormGrad formula87Figure 2-18 LK optical flow calculation of a 3-layer pyramid90Figure 2-19 LK optical flow calculation of a 3-layer pyramid94Figure 2-20 Bits of a pixel of the foreground status flag image111Figure 2-21 Input sample vector

37、 of ANN_MLP120Figure 2-22 Output prediction result of ANN_MLP120Figure 2-23 Input sample vector array of ANN_MLP123Figure 2-24 Output prediction result of ANN_MLP123Figure 2-25 Input sample vector of SVM129Figure 2-26 Prediction result of SVM129Figure 2-27 Input sample vector array of SVM132Figure 2

38、-28 Prediction result of SVM132Figure 2-29 Output eigenvector array of the. 138Figure 2-30m. 140Figure 2-31 Prediction results ofsamples142HiSilicon Proprietary andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)viiiHiIVEAPI Reference1 Introduction to the IVE 1 Introduction to the I

39、VE1.1 OverviewThe IVE is a hardware acceleration module in the intelligent analysis system of the HiSilicon media processor. Intelligent analysis solutions can be developed based on the IVE to accelerate intelligent analysis and reduce the CPU usage. Current IVE operators allow you todevelop intelli

40、gent analysis solutions fordiagnosis and boundary security.1.2 Functions1.2.1 Important ConceptsHandleWhen you call operators to create tasks, the system allocates a handle to each task to identify tasks.bInstant (instant returned result flag) bInsts a flag indicating whether to return results in ti

41、me. If you want to obtaincompletion information about a task, you must set bInstant to HI_TRUE when creatingthis task. If you do not care about completion information, you avised to setbInstant to HI_FALSE. This task can form a task link with subsequent tasks and thesetasks can be executed together.

42、 In this way, the number of interrupts is reduced and the performance is improved.QueryBased on the handle returned by the system, you can query whether the task corresponding to an operator is complete by calling HI_MPI_IVE_Query.Flushing cacheThe IVE hardware can obtain data only for the DDR. If t

43、he CPU has accessed a cacheable space when you call an IVE task, you need to flush data from the cache to the DDR by calling HI_MPI_SYS_MmzFlushCache. This ensures that the input data and output data of the IVE are not interfered by the CPU cache. Fors aboutHI_MPI_SYS_MmzFlushCache, see the HiMPP Vx

44、.y Media Processing Software Development Guide.Stride: a metric consistent with the width of an image or two-dimensional (2D) data, as shown in Figure 1-1. HiSilicon Proprietary andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)1HiIVEAPI Reference1 Introduction to the IVE The strid

45、e of the IVE_IMAGE_S image data indicates the number of units for measuring an image row by pixel. The pixel bit width can be 8 bits or 16 bits. Stride of the IVE_DATA_S 2D data indicates the number of bytes of a two- dimensional data row, that is, the value when n is 8 in Figure 1-1.IVE_DATA_S can

46、be considered as an image of which a pixel is expressed by 8 bits. The stride can be expressed as the number of units for measuring an image or 2D data row by pixel.Figure 1-1 Stride schematic diagramWi.n bitUnits to befilled for alignmentStriden = 8, 16, 32, or 64AlignmentThe memory address or memo

47、ry stride must be a multiple of the alignment coefficient to ensure that hardware can rapidly access the memory start address or access data across rows. Alignment of the start address for the data memoryThe inputs and outputs of current IVE operators must be 1-byte-aligned, 2-byte- aligned, or 16-b

48、yte-aligned. For Stride alignments, see the API of each operator.The stride of teralized 2D image, 2D single-component data, or 1D array datamust be 16-pixel-aligned.It is recommended that the start address be 256-byte-aligned and the stride be aligned based on the odd multiple of 256 pixels to impr

49、ove the memory access rate when Hi3519 V101/Hi3559 V100/Hi3559A V100ES/Hi3559A V100 uses the DDR4. For Hi3559AV100ES/Hi3559A V100, the required MMZ address must be in a 4 GB space when the 64-bit OS is used. Otherwise, exceptions occur.Types of input and output data (for Generalized 2D image datas,

50、see chapter 3 "Data Structures") Fors about the image types of IVE_IMAGE_S, IVE_SRC_IMAGE_S, andIVE_DST_IMAGE_S, see the data structure IVE_IMAGE_TYPE_E. Forsabout the memory allocation for IVE_IMAGE_S, IVE_SRC_IMAGE_S, and IVE_DST_IMAGE_S, see Figure 1-2 to Figure 1-10.HiSilicon Proprieta

51、ry andCopyright © HiSilicon Technologies Co.,Issue 18 (2018-05-10)2n bitdthHiIVEAPI Reference1 Introduction to the IVEThe width and height of the input and output generalized 2D images for all operators must be even numbers. 2D single-component dataIVE_DATA_S indicates 2D data in byte and is ma

52、inly used by direct memory access (DMA). Its memory allocation is shown in Figure 1-11. IVE_IMAGE_S can be converted into one or more IVE_DATA_S data segments. 1D dataIVE_MEM_INFO_S, IVE_SRC_MEM_INFO_S, and IVE_DST_MEM_INFO_Sindicate 1D data such as Hist statistics, Gaussian mixture m(GMM) data, and

53、LKOpticalFlo corner point input. The memory allocation is shown in Figure 1-2.Types of generalized 2D images The descriptions in Table 1-1 apply to the preceding products except the Hi3559A V100ES/Hi3559A V100.Table 1-1 Types of generalized 2D images (1)HiSilicon Proprietary andCopyright © HiSi

54、licon Technologies Co.,Issue 18 (2018-05-10)3TypeDescriptionMemory AddressStrideIVE_IMAGE_TYPE_U8C18-bit unsigned single- channel image, see Figure 1-2.Only u32PhyAddr0 and pu8VirAddr0 of IVE_IMAGE_S are used.Only u16Stride0is used.IVE_IMAGE_TYPE_S8C18-bit signed single- channel image, see Figure 1-

55、2.Only u32PhyAddr0 and pu8VirAddr0 of IVE_IMAGE_S are used.Only u16Stride0is used.IVE_IMAGE_TYPE_YUV4 20SPYCbCr420 semi-planar image, see Figure 1-3.Only u32PhyAddr0/pu8VirAd dr0 (luminance Y) and u32PhyAddr1/pu8VirAd dr1 (chrominance and UV are alternately arranged) of IVE_IMAGE_S are used.Inconsecutive luminance and chrominance memories are supported but not recommended.Only u16Stride0 (luminance stride

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论