The Openvx™ Specification
Total Page:16
File Type:pdf, Size:1020Kb
The OpenVX™ Specification Version 1.2 Document Revision: dba1aa3 Generated on Wed Oct 11 2017 20:00:10 Khronos Vision Working Group Editor: Stephen Ramm Copyright ©2016-2017 The Khronos Group Inc. i Copyright ©2016-2017 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specifica- tion for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be re-formatted AS LONG AS the contents of the specifi- cation are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group web-site should be included whenever possible with specification distributions. Khronos Group makes no, and expressly disclaims any, representations or warranties, express or implied, re- garding this specification, including, without limitation, any implied warranties of merchantability or fitness for a particular purpose or non-infringement of any intellectual property. Khronos Group makes no, and expressly dis- claims any, warranties, express or implied, regarding the correctness, accuracy, completeness, timeliness, and reliability of the specification. Under no circumstances will the Khronos Group, or any of its Promoters, Contributors or Members or their respective partners, officers, directors, employees, agents or representatives be liable for any damages, whether direct, indirect, special or consequential damages for lost revenues, lost profits, or otherwise, arising from or in connection with these materials. Khronos, DevU, StreamInput, glTF, WebGL, WebCL, COLLADA, OpenKODE, OpenVG, OpenVX, OpenSL ES and OpenMAX are trademarks of the Khronos Group Inc. ASTC is a trademark of ARM Holdings PLC, OpenCL is a trademark of Apple Inc. and OpenGL is a registered trademark and the OpenGL ES and OpenGL SC logos are trademarks of Silicon Graphics International used under license by Khronos. All other product names, trademarks, and/or company names are used solely for identification and belong to their respective owners. Contents 1 Introduction 2 1.1 Abstract................................................ 2 1.2 Purpose................................................ 2 1.3 Scope of Specification......................................... 2 1.4 Normative References......................................... 2 1.5 Version/Change History........................................ 3 1.6 Deprecation.............................................. 3 1.7 Requirements Language ....................................... 3 1.8 Typographical Conventions...................................... 3 1.8.1 Naming Conventions..................................... 3 1.8.2 Vendor Naming Conventions................................. 4 1.9 Glossary and Acronyms........................................ 4 1.10 Acknowledgements.......................................... 5 2 Design Overview 7 2.1 Software Landscape.......................................... 7 2.2 Design Objectives........................................... 7 2.2.1 Hardware Optimizations ................................... 8 2.2.2 Hardware Limitations..................................... 8 2.3 Assumptions.............................................. 8 2.3.1 Portability........................................... 8 2.3.2 Opaqueness ......................................... 8 2.4 Object-Oriented Behaviors ...................................... 8 2.5 OpenVX Framework Objects ..................................... 8 2.6 OpenVX Data Objects......................................... 9 2.7 Error Objects ............................................. 10 2.8 Graphs Concepts........................................... 10 2.8.1 Linking Nodes......................................... 10 2.8.2 Virtual Data Objects ..................................... 10 2.8.3 Node Parameters....................................... 11 2.8.4 Graph Parameters ...................................... 11 2.8.5 Execution Model ....................................... 12 Asynchronous Mode ..................................... 12 2.8.6 Graph Formalisms ...................................... 12 Contained & Overlapping Data Objects............................ 13 2.8.7 Node Execution Independence................................ 14 2.8.8 Verification .......................................... 16 2.9 Callbacks ............................................... 16 2.10 User Kernels.............................................. 16 2.10.1 Parameter Validation..................................... 17 The Meta Format Object ................................... 17 2.10.2 User Kernels Naming Conventions.............................. 17 2.11 Immediate Mode Functions...................................... 18 2.12 Targets................................................. 18 2.13 Base Vision Functions......................................... 18 2.13.1 Inputs............................................. 18 2.13.2 Outputs............................................ 21 ii CONTENTS iii 2.13.3 Parameter ordering convention................................ 23 2.14 Lifecycles ............................................... 23 2.14.1 OpenVX Context Lifecycle .................................. 23 2.14.2 Graph Lifecycle........................................ 23 2.14.3 Data Object Lifecycle..................................... 24 OpenVX Image Lifecycle................................... 24 2.15 Host Memory Data Object Access Patterns.............................. 25 2.15.1 Matrix Access Example.................................... 25 2.15.2 Image Access Example.................................... 26 2.15.3 Array Access Example .................................... 27 2.16 Concurrent Data Object Access.................................... 27 2.17 Valid Image Region.......................................... 27 2.18 Extending OpenVX .......................................... 29 2.18.1 Extending Attributes ..................................... 29 2.18.2 Vendor Custom Kernels.................................... 29 2.18.3 Vendor Custom Extensions.................................. 29 2.18.4 Hinting ............................................ 30 2.18.5 Directives........................................... 30 3 Module Documentation 31 3.1 Vision Functions............................................ 31 3.1.1 Detailed Description ..................................... 31 3.2 Absolute Difference.......................................... 35 3.2.1 Detailed Description ..................................... 35 3.2.2 Function Documentation ................................... 35 vxAbsDiffNode(vx_graph graph, vx_image in1, vx_image in2, vx_image out) . 35 vxuAbsDiff(vx_context context, vx_image in1, vx_image in2, vx_image out)......... 35 3.3 Accumulate .............................................. 37 3.3.1 Detailed Description ..................................... 37 3.3.2 Function Documentation ................................... 37 vxAccumulateImageNode(vx_graph graph, vx_image input, vx_image accum) . 37 vxuAccumulateImage(vx_context context, vx_image input, vx_image accum) . 37 3.4 Accumulate Squared ......................................... 39 3.4.1 Detailed Description ..................................... 39 3.4.2 Function Documentation ................................... 39 vxAccumulateSquareImageNode(vx_graph graph, vx_image input, vx_scalar shift, vx_ - image accum) ................................... 39 vxuAccumulateSquareImage(vx_context context, vx_image input, vx_scalar shift, vx_image accum)....................................... 39 3.5 Data Object Copy........................................... 41 3.5.1 Detailed Description ..................................... 41 3.5.2 Function Documentation ................................... 41 vxCopyNode(vx_graph graph, vx_reference input, vx_reference output)........... 41 vxuCopy(vx_context context, vx_reference input, vx_reference output)........... 41 3.6 Accumulate Weighted......................................... 43 3.6.1 Detailed Description ..................................... 43 3.6.2 Function Documentation ................................... 43 vxAccumulateWeightedImageNode(vx_graph graph, vx_image input, vx_scalar alpha, vx - _image accum)................................... 43 vxuAccumulateWeightedImage(vx_context context, vx_image input, vx_scalar alpha, vx_ - image accum) ................................... 43 3.7 Control Flow.............................................. 45 3.7.1 Detailed Description ....................................