The Openvx™ Specification
Total Page:16
File Type:pdf, Size:1020Kb
The OpenVX™ Specification Version 1.0.1 Document Revision: r31169 Generated on Wed May 13 2015 08:41:43 Khronos Vision Working Group Editor: Susheel Gautam Editor: Erik Rainey Copyright ©2014 The Khronos Group Inc. i Copyright ©2014 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 Requirements Language ....................................... 3 1.7 Typographical Conventions...................................... 3 1.7.1 Naming Conventions..................................... 3 1.8 Glossary and Acronyms........................................ 4 1.9 Acknowledgements.......................................... 4 2 Design Overview 6 2.1 Software Landscape.......................................... 6 2.2 Design Objectives........................................... 6 2.2.1 Hardware Optimizations ................................... 7 2.2.2 Hardware Limitations..................................... 7 2.3 Assumptions.............................................. 7 2.3.1 Portability........................................... 7 2.3.2 Opaqueness ......................................... 7 2.4 Object-Oriented Behaviors ...................................... 7 2.5 OpenVX Framework Objects ..................................... 7 2.6 OpenVX Data Objects......................................... 8 2.7 Error Objects ............................................. 9 2.8 Graphs Concepts........................................... 9 2.8.1 Linking Nodes......................................... 9 2.8.2 Virtual Data Objects ..................................... 9 2.8.3 Node Parameters....................................... 10 2.8.4 Graph Parameters ...................................... 10 2.8.5 Execution Model ....................................... 10 Asynchronous Mode ..................................... 10 2.8.6 Graph Formalisms ...................................... 10 2.8.7 Node Execution Independence................................ 11 2.8.8 Verification .......................................... 13 2.9 Callbacks ............................................... 13 2.10 User Kernels.............................................. 13 2.10.1 Parameter Validation..................................... 14 The Meta Format Object ................................... 14 Delta Rectangles....................................... 15 2.10.2 User Kernels Naming Conventions.............................. 15 2.11 Immediate Mode Functions...................................... 15 2.12 Base Vision Functions......................................... 15 2.12.1 Inputs............................................. 16 2.12.2 Outputs............................................ 18 2.13 Lifecycles ............................................... 19 2.13.1 OpenVX Context Lifecycle .................................. 19 2.13.2 Graph Lifecycle........................................ 20 ii CONTENTS iii 2.13.3 Data Object Lifecycle..................................... 20 OpenVX Image Lifecycle................................... 21 2.14 Host Memory Data Object Access Patterns.............................. 21 2.14.1 Matrix Access Example.................................... 21 2.14.2 Image Access Example.................................... 22 2.14.3 Array Access Example .................................... 23 2.15 Extending OpenVX .......................................... 23 2.15.1 Extending Attributes ..................................... 23 2.15.2 Vendor Custom Kernels.................................... 23 2.15.3 Vendor Custom Extensions.................................. 24 2.15.4 Hinting ............................................ 24 2.15.5 Directives........................................... 24 2.16 Known Extensions to OpenVX .................................... 24 2.16.1 User Kernel Tiling....................................... 24 3 Module Documentation 25 3.1 Vision Functions............................................ 25 3.1.1 Detailed Description ..................................... 25 3.2 Absolute Difference.......................................... 28 3.2.1 Detailed Description ..................................... 28 3.2.2 Function Documentation ................................... 28 vxAbsDiffNode ........................................ 28 vxuAbsDiff .......................................... 28 3.3 Accumulate .............................................. 29 3.3.1 Detailed Description ..................................... 29 3.3.2 Function Documentation ................................... 29 vxAccumulateImageNode................................... 29 vxuAccumulateImage..................................... 29 3.4 Accumulate Squared ......................................... 30 3.4.1 Detailed Description ..................................... 30 3.4.2 Function Documentation ................................... 30 vxAccumulateSquareImageNode............................... 30 vxuAccumulateSquareImage................................. 30 3.5 Accumulate Weighted......................................... 32 3.5.1 Detailed Description ..................................... 32 3.5.2 Function Documentation ................................... 32 vxAccumulateWeightedImageNode ............................. 32 vxuAccumulateWeightedImage................................ 32 3.6 Arithmetic Addition .......................................... 34 3.6.1 Detailed Description ..................................... 34 3.6.2 Function Documentation ................................... 34 vxAddNode.......................................... 34 vxuAdd ............................................ 34 3.7 Arithmetic Subtraction......................................... 36 3.7.1 Detailed Description ..................................... 36 3.7.2 Function Documentation ................................... 36 vxSubtractNode........................................ 36 vxuSubtract.......................................... 36 3.8 Bitwise AND.............................................. 38 3.8.1 Detailed Description ..................................... 38 3.8.2 Function Documentation ................................... 38 vxAndNode.......................................... 38 vxuAnd ............................................ 38 3.9 Bitwise EXCLUSIVE OR ....................................... 40 3.9.1 Detailed Description ..................................... 40 3.9.2 Function Documentation ..................................