Add unified-tina and viplite runtime library in arm linux.

This commit is contained in:
Colin 2025-12-02 15:01:18 +00:00
parent 7b24f4d437
commit 1ad3aabcfe
126 changed files with 44090 additions and 0 deletions

11
unified-tina/Makefile Executable file
View File

@ -0,0 +1,11 @@
all:$(TARGET) install
install: $(TARGET)
-@mkdir -p $(INSTALL_PREFIX)/usr/lib
-@mkdir -p $(INSTALL_PREFIX)/usr/include
@cp -rf inc/* $(INSTALL_PREFIX)/usr/include
@cp lib/$(C_LIB_TYPE)/*.so* $(INSTALL_PREFIX)/usr/lib
clean:
rm -rf *.o *~

109
unified-tina/common.target Normal file
View File

@ -0,0 +1,109 @@
##############################################################################
#
# Copyright (c) 2005 - 2021 by Vivante Corp. All rights reserved.
#
# The material in this file is confidential and contains trade secrets
# of Vivante Corporation. This is proprietary information owned by
# Vivante Corporation. No part of this work may be disclosed,
# reproduced, copied, transmitted, or used in any way for any purpose,
# without the express written permission of Vivante Corporation.
#
##############################################################################
################################################################################
# Define a shortcut for the main target.
TARGET_OUTPUT = $(OBJ_DIR)/$(TARGET_NAME)
ifeq ($(TARGET_SONAME),)
TARGET_SONAME := $(TARGET_NAME)
endif
ifeq ($(OBJ_DIR),)
ifeq ($(DEBUG), 1)
OBJ_DIR ?= bin_d
else
OBJ_DIR ?= bin_r
endif
endif
################################################################################
# Specify targets.
all: $(TARGET_OUTPUT)
clean:
@rm -rf $(OBJ_DIR)/* $(OBJ_DIR)
@rm -rf $(CLEAN_EXTRA)
install: $(TARGET_OUTPUT)
ifneq ($(INSTALL_DIR),)
@mkdir -p $(INSTALL_DIR)
@-cp $(TARGET_OUTPUT) $(INSTALL_DIR)
endif
MAKEFILE_NAME = makefile.linux
ifeq ($(gcdSTATIC_LINK),1)
ifneq ($(USE_ARMCC), 1)
PFLAGS += -static
else
PFLAGS += -L--no_search_dynamic_libraries
endif
else
ifneq ($(QNX), 1)
LIBS += -lrt
endif
PFLAGS += -Wl,-rpath-link $(VIVANTE_SDK_LIB)
endif
ifeq ($(PROGRAM), 1)
$(TARGET_OUTPUT): $(OBJECTS)
ifeq ($(SRC_CXX),)
@echo " LINK \033[1m$(notdir $@)\033[0m"
@$(CC) $(PFLAGS) $(OBJECTS) -o $(TARGET_OUTPUT) $(LIBS)
else
@echo " LINK \033[1m$(notdir $@)\033[0m"
@$(CXX) $(PFLAGS) $(OBJECTS) -o $(TARGET_OUTPUT) $(LIBS)
endif
ifneq ($(USE_ARMCC), 1)
ifneq ($(DEBUG), 1)
@$(STRIP) $(TARGET_OUTPUT)
endif
endif
endif
ifeq ($(DYNAMIC), 1)
ifeq ($(USE_ARMCC), 1)
LDFLAGS += --shared -L--soname=,$(TARGET_NAME)
else
LDFLAGS += -Wall -shared -Wl,-soname,$(TARGET_NAME) -Wl,-z,defs
endif
$(TARGET_OUTPUT): $(OBJECTS)
@echo " LINK \033[1m$(notdir $@)\033[0m"
@$(CC) $(LDFLAGS) $(OBJECTS) -o $(TARGET_OUTPUT) $(LIBS)
endif
ifeq ($(STATIC), 1)
$(TARGET_OUTPUT): $(OBJECTS)
@echo " ARCHIVE \033[1m$(notdir $@)\033[0m"
@$(AR) -r -c $(TARGET_OUTPUT) $(OBJECTS)
$(RANLIB) $(TARGET_OUTPUT)
endif
$(OBJ_DIR)/%.o: %.c
@echo " COMPILE $(abspath $<)"
@mkdir -p $(OBJ_DIR)
@$(CC) -c $(CFLAGS) -o $@ $<
$(OBJ_DIR)/%.o: %.cpp
@echo " COMPILE $(abspath $<)"
@mkdir -p $(OBJ_DIR)
@$(CXX) -c $(CFLAGS) -o $@ $<
$(OBJ_DIR)/%.o: %.cc
@echo " COMPILE $(abspath $<)"
@mkdir -p $(OBJ_DIR)
@$(CXX) -c $(CFLAGS) -o $@ $<

View File

@ -0,0 +1 @@
#include "HAL/gc_hal.h"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,288 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_debug_zones_h_
#define __gc_hal_debug_zones_h_
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************\
************************ Debug Zone Pattern Summary ***************************
* A debug zone is an unsigned integer of 32 bit (Bit 31- Bit 0). *
* Bit 31 to 28 defines API, which is 0 for HAL API and has value of 1 - 14 *
* for Khronos API. Value 15 (0xF) is reserved for gcdZONE_NONE. *
* Bit 27 to 0 defines subzones of each API. Value 0xFFFFFFF is resevered for *
* gcdZONE_ALL. *
* *
\******************************************************************************/
/* Retrieve API bits 31 to 28 */
#define gcmZONE_GET_API(zone) ((zone) >> 28)
/* Retrieve Subzone bits 27 to 0 */
#define gcmZONE_GET_SUBZONES(zone) ((zone) << 4)
/******************************************************************************
******************************** HAL Zone ************************************
******************************************************************************/
#define gcdZONE_API_HAL ((gctUINT32)0 << 28)
/******************************************************************************
******************************** HAL Subzones ********************************
******************************************************************************/
/* Subzones Kernel and User have in common */
#define gcvZONE_OS (1 << 0)
#define gcvZONE_HARDWARE (1 << 1)
#define gcvZONE_HEAP (1 << 2)
#define gcvZONE_SIGNAL (1 << 3)
/* Subzones of HAL Kernel */
#define gcvZONE_KERNEL (1 << 4)
#define gcvZONE_VIDMEM (1 << 5)
#define gcvZONE_COMMAND (1 << 6)
#define gcvZONE_DRIVER (1 << 7)
#define gcvZONE_CMODEL (1 << 8)
#define gcvZONE_MMU (1 << 9)
#define gcvZONE_EVENT (1 << 10)
#define gcvZONE_DEVICE (1 << 11)
#define gcvZONE_DATABASE (1 << 12)
#define gcvZONE_INTERRUPT (1 << 13)
#define gcvZONE_POWER (1 << 14)
#define gcvZONE_ASYNC_COMMAND (1 << 15)
#define gcvZONE_ALLOCATOR (1 << 16)
/* Subzones of HAL User */
#define gcdZONE_HAL_API (1 << 4)
#define gcdZONE_BUFFER (1 << 5)
#define gcdZONE_VGBUFFER (1 << 6)
#define gcdZONE_SURFACE (1 << 7)
#define gcdZONE_INDEX (1 << 8)
#define gcdZONE_STREAM (1 << 9)
#define gcdZONE_TEXTURE (1 << 10)
#define gcdZONE_2D (1 << 11)
#define gcdZONE_3D (1 << 12)
#define gcdZONE_COMPILER (1 << 13)
#define gcdZONE_MEM (1 << 14)
#define gcdZONE_VERTEXARRAY (1 << 15)
#define gcdZONE_CL (1 << 16)
#define gcdZONE_VG (1 << 17)
#define gcdZONE_VX (1 << 18)
#define gcdZONE_UTILITY (1 << 19)
#define gcdZONE_RECT (1 << 20)
#define gcdZONE_BUFOBJ (1 << 21)
#define gcdZONE_PROFILER (1 << 22)
#define gcdZONE_SHADER (1 << 23)
/******************************************************************************
******************************** Khronos API Zones ***************************
******************************************************************************/
#define gcdZONE_API_EGL ((gctUINT32)1 << 28)
#define gcdZONE_API_ES11 ((gctUINT32)2 << 28)
#define gcdZONE_API_ES30 ((gctUINT32)3 << 28)
#define gcdZONE_API_GL40 ((gctUINT32)4 << 28)
#define gcdZONE_API_VG3D ((gctUINT32)5 << 28)
#define gcdZONE_API_CL ((gctUINT32)6 << 28)
#define gcdZONE_API_VX ((gctUINT32)7 << 28)
#define gcdZONE_API_VG ((gctUINT32)8 << 28)
/******************************************************************************
************************* Subzones of Khronos API Zones **********************
******************************************************************************/
/* Subzones of EGL API */
#define gcdZONE_EGL_API (gcdZONE_API_EGL | (1 << 0))
#define gcdZONE_EGL_SURFACE (gcdZONE_API_EGL | (1 << 1))
#define gcdZONE_EGL_CONTEXT (gcdZONE_API_EGL | (1 << 2))
#define gcdZONE_EGL_CONFIG (gcdZONE_API_EGL | (1 << 3))
#define gcdZONE_EGL_OS (gcdZONE_API_EGL | (1 << 4)) /* unused */
#define gcdZONE_EGL_IMAGE (gcdZONE_API_EGL | (1 << 5))
#define gcdZONE_EGL_SWAP (gcdZONE_API_EGL | (1 << 6))
#define gcdZONE_EGL_INIT (gcdZONE_API_EGL | (1 << 7))
#define gcdZONE_EGL_SYNC (gcdZONE_API_EGL | (1 << 8))
#define gcdZONE_EGL_COMPOSE (gcdZONE_API_EGL | (1 << 9)) /* unused */
#define gcdZONE_EGL_RENDER_THREAD (gcdZONE_API_EGL | (1 << 10)) /* unused */
/* Subzones of ES11 API */
#define gcdZONE_ES11_BUFFER (gcdZONE_API_ES11 | (1 << 0))
#define gcdZONE_ES11_CLEAR (gcdZONE_API_ES11 | (1 << 1))
#define gcdZONE_ES11_CLIP (gcdZONE_API_ES11 | (1 << 2))
#define gcdZONE_ES11_CONTEXT (gcdZONE_API_ES11 | (1 << 3))
#define gcdZONE_ES11_DRAW (gcdZONE_API_ES11 | (1 << 4))
#define gcdZONE_ES11_ENABLE (gcdZONE_API_ES11 | (1 << 5))
#define gcdZONE_ES11_EXTENTION (gcdZONE_API_ES11 | (1 << 6))
#define gcdZONE_ES11_FOG (gcdZONE_API_ES11 | (1 << 7))
#define gcdZONE_ES11_FRAGMENT (gcdZONE_API_ES11 | (1 << 8))
#define gcdZONE_ES11_LIGHT (gcdZONE_API_ES11 | (1 << 9))
#define gcdZONE_ES11_MATRIX (gcdZONE_API_ES11 | (1 << 10))
#define gcdZONE_ES11_PIXEL (gcdZONE_API_ES11 | (1 << 11))
#define gcdZONE_ES11_POLIGON (gcdZONE_API_ES11 | (1 << 12))
#define gcdZONE_ES11_LINE (gcdZONE_API_ES11 | (1 << 13)) /* unused */
#define gcdZONE_ES11_QUERY (gcdZONE_API_ES11 | (1 << 14))
#define gcdZONE_ES11_TEXTURE (gcdZONE_API_ES11 | (1 << 15))
#define gcdZONE_ES11_STATES (gcdZONE_API_ES11 | (1 << 16))
#define gcdZONE_ES11_STREAM (gcdZONE_API_ES11 | (1 << 17))
#define gcdZONE_ES11_VIEWPORT (gcdZONE_API_ES11 | (1 << 18))
#define gcdZONE_ES11_SHADER (gcdZONE_API_ES11 | (1 << 19))
#define gcdZONE_ES11_HASH (gcdZONE_API_ES11 | (1 << 20))
#define gcdZONE_ES11_TRACE (gcdZONE_API_ES11 | (1 << 21))
/* Subzones of ES30 API */
#define gcdZONE_ES30_TRACE (gcdZONE_API_ES30 | (1 << 0))
#define gcdZONE_ES30_BUFFER (gcdZONE_API_ES30 | (1 << 1))
#define gcdZONE_ES30_CLEAR (gcdZONE_API_ES30 | (1 << 2))
#define gcdZONE_ES30_CODEC (gcdZONE_API_ES30 | (1 << 3))
#define gcdZONE_ES30_CONTEXT (gcdZONE_API_ES30 | (1 << 4))
#define gcdZONE_ES30_DEPTH (gcdZONE_API_ES30 | (1 << 5))
#define gcdZONE_ES30_DEVICE (gcdZONE_API_ES30 | (1 << 6))
#define gcdZONE_ES30_DRAW (gcdZONE_API_ES30 | (1 << 7))
#define gcdZONE_ES30_FBO (gcdZONE_API_ES30 | (1 << 8))
#define gcdZONE_ES30_PIXEL (gcdZONE_API_ES30 | (1 << 9))
#define gcdZONE_ES30_SHADER (gcdZONE_API_ES30 | (1 << 10))
#define gcdZONE_ES30_STATE (gcdZONE_API_ES30 | (1 << 11))
#define gcdZONE_ES30_TEXTURE (gcdZONE_API_ES30 | (1 << 12))
#define gcdZONE_ES30_UTILS (gcdZONE_API_ES30 | (1 << 13))
#define gcdZONE_ES30_PROFILER (gcdZONE_API_ES30 | (1 << 14))
#define gcdZONE_ES30_CORE (gcdZONE_API_ES30 | (1 << 15))
/* Subzones of GL40 API */
#define gcdZONE_GL40_TRACE (gcdZONE_API_GL40 | (1 << 0))
#define gcdZONE_GL40_BUFFER (gcdZONE_API_GL40 | (1 << 1))
#define gcdZONE_GL40_CLEAR (gcdZONE_API_GL40 | (1 << 2)) /* unused */
#define gcdZONE_GL40_CODEC (gcdZONE_API_GL40 | (1 << 3))
#define gcdZONE_GL40_CONTEXT (gcdZONE_API_GL40 | (1 << 4))
#define gcdZONE_GL40_DEPTH (gcdZONE_API_GL40 | (1 << 5))
#define gcdZONE_GL40_DEVICE (gcdZONE_API_GL40 | (1 << 6))
#define gcdZONE_GL40_DRAW (gcdZONE_API_GL40 | (1 << 7))
#define gcdZONE_GL40_FBO (gcdZONE_API_GL40 | (1 << 8))
#define gcdZONE_GL40_PIXEL (gcdZONE_API_GL40 | (1 << 9))
#define gcdZONE_GL40_SHADER (gcdZONE_API_GL40 | (1 << 10))
#define gcdZONE_GL40_STATE (gcdZONE_API_GL40 | (1 << 11))
#define gcdZONE_GL40_TEXTURE (gcdZONE_API_GL40 | (1 << 12))
#define gcdZONE_GL40_UTILS (gcdZONE_API_GL40 | (1 << 13))
#define gcdZONE_GL40_PROFILER (gcdZONE_API_GL40 | (1 << 14))
#define gcdZONE_GL40_CORE (gcdZONE_API_GL40 | (1 << 15))
#define gcdZONE_GL40_FIXVERTEX (gcdZONE_API_GL40 | (1 << 16))
#define gcdZONE_GL40_FIXFRAG (gcdZONE_API_GL40 | (1 << 17))
#define gcdZONE_GL40_HASH (gcdZONE_API_GL40 | (1 << 18))
/* Subzones of VG3D API */
#define gcdZONE_VG3D_CONTEXT (gcdZONE_API_VG3D | (1 << 0))
#define gcdZONE_VG3D_DUMP (gcdZONE_API_VG3D | (1 << 1))
#define gcdZONE_VG3D_EGL (gcdZONE_API_VG3D | (1 << 2))
#define gcdZONE_VG3D_FONT (gcdZONE_API_VG3D | (1 << 3))
#define gcdZONE_VG3D_HARDWARE (gcdZONE_API_VG3D | (1 << 4))
#define gcdZONE_VG3D_IMAGE (gcdZONE_API_VG3D | (1 << 5))
#define gcdZONE_VG3D_MASK (gcdZONE_API_VG3D | (1 << 6))
#define gcdZONE_VG3D_MATRIX (gcdZONE_API_VG3D | (1 << 7))
#define gcdZONE_VG3D_OBJECT (gcdZONE_API_VG3D | (1 << 8))
#define gcdZONE_VG3D_PAINT (gcdZONE_API_VG3D | (1 << 9))
#define gcdZONE_VG3D_PATH (gcdZONE_API_VG3D | (1 << 10))
#define gcdZONE_VG3D_PROFILER (gcdZONE_API_VG3D | (1 << 11))
#define gcdZONE_VG3D_SCANLINE (gcdZONE_API_VG3D | (1 << 12))
#define gcdZONE_VG3D_SHADER (gcdZONE_API_VG3D | (1 << 13))
#define gcdZONE_VG3D_TESSELLATOR (gcdZONE_API_VG3D | (1 << 14))
#define gcdZONE_VG3D_VGU (gcdZONE_API_VG3D | (1 << 15))
/* Subzones of VG11 API */
#define gcdZONE_VG_ARC (gcdZONE_API_VG | (1 << 0))
#define gcdZONE_VG_CONTEXT (gcdZONE_API_VG | (1 << 1))
#define gcdZONE_VG_DEBUG (gcdZONE_API_VG | (1 << 2))
#define gcdZONE_VG_FILTER (gcdZONE_API_VG | (1 << 3))
#define gcdZONE_VG_FORMAT (gcdZONE_API_VG | (1 << 4))
#define gcdZONE_VG_IMAGE (gcdZONE_API_VG | (1 << 5))
#define gcdZONE_VG_MAIN (gcdZONE_API_VG | (1 << 6))
#define gcdZONE_VG_MASK (gcdZONE_API_VG | (1 << 7))
#define gcdZONE_VG_MATRIX (gcdZONE_API_VG | (1 << 8))
#define gcdZONE_VG_MEMORYMGR (gcdZONE_API_VG | (1 << 9))
#define gcdZONE_VG_OBJECT (gcdZONE_API_VG | (1 << 10))
#define gcdZONE_VG_PAINT (gcdZONE_API_VG | (1 << 11))
#define gcdZONE_VG_PATH (gcdZONE_API_VG | (1 << 12))
#define gcdZONE_VG_STATE (gcdZONE_API_VG | (1 << 13))
#define gcdZONE_VG_STROKE (gcdZONE_API_VG | (1 << 14))
#define gcdZONE_VG_TEXT (gcdZONE_API_VG | (1 << 15))
#define gcdZONE_VG_VGU (gcdZONE_API_VG | (1 << 16))
/* Subzones of CL API */
#define gcdZONE_CL_COMMAND (gcdZONE_API_CL | (1 << 0))
#define gcdZONE_CL_CONTEXT (gcdZONE_API_CL | (1 << 1))
#define gcdZONE_CL_DEVICE (gcdZONE_API_CL | (1 << 2))
#define gcdZONE_CL_ENQUEUE (gcdZONE_API_CL | (1 << 3))
#define gcdZONE_CL_EVENT (gcdZONE_API_CL | (1 << 4))
#define gcdZONE_CL_EXT (gcdZONE_API_CL | (1 << 5))
#define gcdZONE_CL_GL (gcdZONE_API_CL | (1 << 6))
#define gcdZONE_CL_KERNEL (gcdZONE_API_CL | (1 << 7))
#define gcdZONE_CL_MEM (gcdZONE_API_CL | (1 << 8))
#define gcdZONE_CL_PLATFORM (gcdZONE_API_CL | (1 << 9))
#define gcdZONE_CL_PROFILER (gcdZONE_API_CL | (1 << 10))
#define gcdZONE_CL_PROGRAM (gcdZONE_API_CL | (1 << 11))
#define gcdZONE_CL_SAMPLER (gcdZONE_API_CL | (1 << 12))
#define gcdZONE_CL_COMMAND_BUFFER (gcdZONE_API_CL | (1 << 13))
/* Subzones of VX API */
#define gcdZONE_VX_ARRAY (gcdZONE_API_VX | (1 << 0))
#define gcdZONE_VX_BINARY (gcdZONE_API_VX | (1 << 1))
#define gcdZONE_VX_CONTEXT (gcdZONE_API_VX | (1 << 2))
#define gcdZONE_VX_CONV (gcdZONE_API_VX | (1 << 3))
#define gcdZONE_VX_DELAY (gcdZONE_API_VX | (1 << 4))
#define gcdZONE_VX_DIST (gcdZONE_API_VX | (1 << 5))
#define gcdZONE_VX_GPULAYER (gcdZONE_API_VX | (1 << 6))
#define gcdZONE_VX_GRAPH (gcdZONE_API_VX | (1 << 7))
#define gcdZONE_VX_IMAGE (gcdZONE_API_VX | (1 << 8))
#define gcdZONE_VX_INTERFACE (gcdZONE_API_VX | (1 << 9))
#define gcdZONE_VX_KERNEL (gcdZONE_API_VX | (1 << 10))
#define gcdZONE_VX_LAYER (gcdZONE_API_VX | (1 << 11))
#define gcdZONE_VX_LUT (gcdZONE_API_VX | (1 << 12))
#define gcdZONE_VX_MATRIX (gcdZONE_API_VX | (1 << 13))
#define gcdZONE_VX_MEMORY (gcdZONE_API_VX | (1 << 14))
#define gcdZONE_VX_METAFMT (gcdZONE_API_VX | (1 << 15))
#define gcdZONE_VX_NODE (gcdZONE_API_VX | (1 << 16))
#define gcdZONE_VX_OBJARRAY (gcdZONE_API_VX | (1 << 17))
#define gcdZONE_VX_PARAM (gcdZONE_API_VX | (1 << 18))
#define gcdZONE_VX_PROGRAM (gcdZONE_API_VX | (1 << 19))
#define gcdZONE_VX_PYRAMID (gcdZONE_API_VX | (1 << 20))
#define gcdZONE_VX_REF (gcdZONE_API_VX | (1 << 21))
#define gcdZONE_VX_REMAP (gcdZONE_API_VX | (1 << 22))
#define gcdZONE_VX_SCALAR (gcdZONE_API_VX | (1 << 23))
#define gcdZONE_VX_TARGET (gcdZONE_API_VX | (1 << 24))
#define gcdZONE_VX_TENSOR (gcdZONE_API_VX | (1 << 25))
#define gcdZONE_VX_THRESHOLD (gcdZONE_API_VX | (1 << 26))
#define gcdZONE_VX_SPINST (gcdZONE_API_VX | (1 << 27))
#define gcdZONE_VX_SP (gcdZONE_API_VX | (1 << 28))
#define gcdZONE_VX_OTHERS (gcdZONE_API_VX | (1 << 29))
/******************************************************************************
******************************** Utility Zones *******************************
******************************************************************************/
/* Value for Disabling All Subzones */
#define gcdZONE_NONE 0xF0000000
/* Value for Enabling All Subzones */
#define gcdZONE_ALL 0x0FFFFFFF
/******************************************************************************
********************************** END ***************************************
******************************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* __gc_hal_debug_zones_h_ */

View File

@ -0,0 +1,16 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#include "shared/gc_hal_driver_shared.h"

View File

@ -0,0 +1,104 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_dump_h_
#define __gc_hal_dump_h_
/*
* gcdDUMP_KEY
*
* Set this to a string that appears in 'cat /proc/<pid>/cmdline'. E.g. 'camera'.
* HAL will create dumps for the processes matching this key.
*/
#ifndef gcdDUMP_KEY
#define gcdDUMP_KEY "process"
#endif
/*
* gcdDUMP_PATH
*
* The dump file location. Some processes cannot write to the sdcard.
* Try apps' data dir, e.g. /data/data/com.android.launcher
*/
#ifndef gcdDUMP_PATH
#if defined(ANDROID)
# define gcdDUMP_PATH "/mnt/sdcard/"
# else
# define gcdDUMP_PATH "./"
# endif
#endif
/*
* gcdDUMP_FILE_IN_KERNEL
*
* Default dump file for gcdDUMP_IN_KERNEL.
* The file will be writen globally in kernel side.
* Can be overwritten in runtime by debugfs:/gc/dump/dump_file
*
* 2 pseudo files:
* [dmesg]: means dump to kernel debug message.
* [ignored]: means dump ignored, nothing will be dumpped.
*/
#ifndef gcdDUMP_FILE_IN_KERNEL
#define gcdDUMP_FILE_IN_KERNEL "[dmesg]"
#endif
/*
* gcdDUMP_VERIFY_PER_DRAW
*
* Sub feature of gcdDUMP.
* When set to 1, verify RT and images(if used) for every single draw
* to ease simulation debug.
* Only valid for ES3 driver for now.
*/
#ifndef gcdDUMP_VERIFY_PER_DRAW
#define gcdDUMP_VERIFY_PER_DRAW 0
#endif
/* Standalone dump features below. */
/*
* gcdDUMP_FRAMERATE
* When set to a value other than zero, averaqe frame rate will be dumped.
* The value set is the starting frame that the average will be calculated.
* This is needed because sometimes first few frames are too slow to be included
* in the average. Frame count starts from 1.
*/
#ifndef gcdDUMP_FRAMERATE
#define gcdDUMP_FRAMERATE 0
#endif
/*
* gcdDUMP_FRAME_TGA
*
* When set to a value other than 0, a dump of the frame specified by the value,
* will be done into frame.tga. Frame count starts from 1.
*/
#ifndef gcdDUMP_FRAME_TGA
#define gcdDUMP_FRAME_TGA 0
#endif
/*
* gcdDUMP_AHB_ACCESS
*
* When set to 1, a dump of all AHB register access will be printed to kernel
* message.
*/
#ifndef gcdDUMP_AHB_ACCESS
#define gcdDUMP_AHB_ACCESS 0
#endif
#endif /* __gc_hal_dump_h_ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,883 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_raster_h_
#define __gc_hal_raster_h_
#include "gc_hal_enum.h"
#include "gc_hal_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
***************************** Object Declarations ****************************
******************************************************************************/
typedef struct _gcoBRUSH *gcoBRUSH;
typedef struct _gcoBRUSH_CACHE *gcoBRUSH_CACHE;
/******************************************************************************
******************************* gcoBRUSH Object ******************************
******************************************************************************/
/* Create a new solid color gcoBRUSH object. */
gceSTATUS
gcoBRUSH_ConstructSingleColor(IN gcoHAL Hal,
IN gctUINT32 ColorConvert,
IN gctUINT32 Color,
IN gctUINT64 Mask,
gcoBRUSH *Brush);
/* Create a new monochrome gcoBRUSH object. */
gceSTATUS
gcoBRUSH_ConstructMonochrome(IN gcoHAL Hal,
IN gctUINT32 OriginX,
IN gctUINT32 OriginY,
IN gctUINT32 ColorConvert,
IN gctUINT32 FgColor,
IN gctUINT32 BgColor,
IN gctUINT64 Bits,
IN gctUINT64 Mask,
gcoBRUSH *Brush);
/* Create a color gcoBRUSH object. */
gceSTATUS
gcoBRUSH_ConstructColor(IN gcoHAL Hal,
IN gctUINT32 OriginX,
IN gctUINT32 OriginY,
IN gctPOINTER Address,
IN gceSURF_FORMAT Format,
IN gctUINT64 Mask,
gcoBRUSH *Brush);
/* Destroy an gcoBRUSH object. */
gceSTATUS
gcoBRUSH_Destroy(IN gcoBRUSH Brush);
/******************************************************************************
******************************* gcoSURF Object *******************************
******************************************************************************/
/* Set cipping rectangle. */
gceSTATUS
gcoSURF_SetClipping(IN gcoSURF Surface);
/* Clear one or more rectangular areas. */
gceSTATUS
gcoSURF_Clear2D(IN gcoSURF DestSurface,
IN gctUINT32 RectCount,
IN gcsRECT_PTR DestRect,
IN gctUINT32 LoColor,
IN gctUINT32 HiColor);
/* Draw one or more Bresenham lines. */
gceSTATUS
gcoSURF_Line(IN gcoSURF Surface,
IN gctUINT32 LineCount,
IN gcsRECT_PTR Position,
IN gcoBRUSH Brush,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop);
/* Generic rectangular blit. */
gceSTATUS
gcoSURF_Blit(IN OPTIONAL gcoSURF SrcSurface,
IN gcoSURF DestSurface,
IN gctUINT32 RectCount,
IN OPTIONAL gcsRECT_PTR SrcRect,
IN gcsRECT_PTR DestRect,
IN OPTIONAL gcoBRUSH Brush,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN OPTIONAL gceSURF_TRANSPARENCY Transparency,
IN OPTIONAL gctUINT32 TransparencyColor,
IN OPTIONAL gctPOINTER Mask,
IN OPTIONAL gceSURF_MONOPACK MaskPack);
/* Monochrome blit. */
gceSTATUS
gcoSURF_MonoBlit(IN gcoSURF DestSurface,
IN gctPOINTER Source,
IN gceSURF_MONOPACK SourcePack,
IN gcsPOINT_PTR SourceSize,
IN gcsPOINT_PTR SourceOrigin,
IN gcsRECT_PTR DestRect,
IN OPTIONAL gcoBRUSH Brush,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gctBOOL ColorConvert,
IN gctUINT8 MonoTransparency,
IN gceSURF_TRANSPARENCY Transparency,
IN gctUINT32 FgColor,
IN gctUINT32 BgColor);
/* Filter blit. */
gceSTATUS
gcoSURF_FilterBlit(IN gcoSURF SrcSurface,
IN gcoSURF DestSurface,
IN gcsRECT_PTR SrcRect,
IN gcsRECT_PTR DestRect,
IN gcsRECT_PTR DestSubRect);
/* Enable alpha blending engine in the hardware and disengage the ROP engine. */
gceSTATUS
gcoSURF_EnableAlphaBlend(IN gcoSURF Surface,
IN gctUINT8 SrcGlobalAlphaValue,
IN gctUINT8 DstGlobalAlphaValue,
IN gceSURF_PIXEL_ALPHA_MODE SrcAlphaMode,
IN gceSURF_PIXEL_ALPHA_MODE DstAlphaMode,
IN gceSURF_GLOBAL_ALPHA_MODE SrcGlobalAlphaMode,
IN gceSURF_GLOBAL_ALPHA_MODE DstGlobalAlphaMode,
IN gceSURF_BLEND_FACTOR_MODE SrcFactorMode,
IN gceSURF_BLEND_FACTOR_MODE DstFactorMode,
IN gceSURF_PIXEL_COLOR_MODE SrcColorMode,
IN gceSURF_PIXEL_COLOR_MODE DstColorMode);
/* Disable alpha blending engine in the hardware and engage the ROP engine. */
gceSTATUS
gcoSURF_DisableAlphaBlend(IN gcoSURF Surface);
gceSTATUS
gcoSURF_SetDither(IN gcoSURF Surface, IN gctBOOL Dither);
gceSTATUS
gcoSURF_Set2DSource(gcoSURF Surface, gceSURF_ROTATION Rotation);
gceSTATUS
gcoSURF_Set2DTarget(gcoSURF Surface, gceSURF_ROTATION Rotation);
/******************************************************************************
********************************* gco2D Object *******************************
******************************************************************************/
/* Construct a new gco2D object. */
gceSTATUS
gco2D_Construct(IN gcoHAL Hal, OUT gco2D *Hardware);
/* Destroy an gco2D object. */
gceSTATUS
gco2D_Destroy(IN gco2D Hardware);
/* Sets the maximum number of brushes in the brush cache. */
gceSTATUS
gco2D_SetBrushLimit(IN gco2D Hardware, IN gctUINT MaxCount);
/* Flush the brush. */
gceSTATUS
gco2D_FlushBrush(IN gco2D Engine, IN gcoBRUSH Brush, IN gceSURF_FORMAT Format);
/* Program the specified solid color brush. */
gceSTATUS
gco2D_LoadSolidBrush(IN gco2D Engine,
IN gceSURF_FORMAT Format,
IN gctUINT32 ColorConvert,
IN gctUINT32 Color,
IN gctUINT64 Mask);
gceSTATUS
gco2D_LoadMonochromeBrush(IN gco2D Engine,
IN gctUINT32 OriginX,
IN gctUINT32 OriginY,
IN gctUINT32 ColorConvert,
IN gctUINT32 FgColor,
IN gctUINT32 BgColor,
IN gctUINT64 Bits,
IN gctUINT64 Mask);
gceSTATUS
gco2D_LoadColorBrush(IN gco2D Engine,
IN gctUINT32 OriginX,
IN gctUINT32 OriginY,
IN gctADDRESS Address,
IN gceSURF_FORMAT Format,
IN gctUINT64 Mask);
/* Configure monochrome source. */
gceSTATUS
gco2D_SetMonochromeSource(IN gco2D Engine,
IN gctBOOL ColorConvert,
IN gctUINT8 MonoTransparency,
IN gceSURF_MONOPACK DataPack,
IN gctBOOL CoordRelative,
IN gceSURF_TRANSPARENCY Transparency,
IN gctUINT32 FgColor,
IN gctUINT32 BgColor);
/* Configure color source. */
gceSTATUS
gco2D_SetColorSource(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctBOOL CoordRelative,
IN gceSURF_TRANSPARENCY Transparency,
IN gctUINT32 TransparencyColor);
/* Configure color source extension for full rotation. */
gceSTATUS
gco2D_SetColorSourceEx(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight,
IN gctBOOL CoordRelative,
IN gceSURF_TRANSPARENCY Transparency,
IN gctUINT32 TransparencyColor);
/* Same as gco2D_SetColorSourceEx, but with better 64bit SW-path support.
** Please do NOT export the API now.
*/
gceSTATUS
gco2D_SetColorSource64(IN gco2D Engine,
IN gctADDRESS Address,
IN gctPOINTER Logical,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight,
IN gctBOOL CoordRelative,
IN gceSURF_TRANSPARENCY Transparency,
IN gctUINT32 TransparencyColor);
/* Configure color source. */
gceSTATUS
gco2D_SetColorSourceAdvanced(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight,
IN gctBOOL CoordRelative);
gceSTATUS
gco2D_SetColorSourceN(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight,
IN gctUINT32 SurfaceNumber);
/* Configure masked color source. */
gceSTATUS
gco2D_SetMaskedSource(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gctBOOL CoordRelative,
IN gceSURF_MONOPACK MaskPack);
/* Configure masked color source extension for full rotation. */
gceSTATUS
gco2D_SetMaskedSourceEx(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gctBOOL CoordRelative,
IN gceSURF_MONOPACK MaskPack,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight);
/* Same as gco2D_SetMaskedSourceEx, but with better 64bit SW-path support.
** Please do NOT export the API now.
*/
gceSTATUS
gco2D_SetMaskedSource64(IN gco2D Engine,
IN gctADDRESS Address,
IN gctPOINTER Logical,
IN gctUINT32 Stride,
IN gceSURF_FORMAT Format,
IN gctBOOL CoordRelative,
IN gceSURF_MONOPACK MaskPack,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight);
/* Setup the source rectangle. */
gceSTATUS
gco2D_SetSource(IN gco2D Engine, IN gcsRECT_PTR SrcRect);
/* Set clipping rectangle. */
gceSTATUS
gco2D_SetClipping(IN gco2D Engine, IN gcsRECT_PTR Rect);
/* Configure destination. */
gceSTATUS
gco2D_SetTarget(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth);
/* Configure destination extension for full rotation. */
gceSTATUS
gco2D_SetTargetEx(IN gco2D Engine,
IN gctADDRESS Address,
IN gctUINT32 Stride,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight);
/*
* Same as gco2D_SetTargetEx, but with better 64bit SW-path support.
* Please do NOT export the API now.
*/
gceSTATUS
gco2D_SetTarget64(IN gco2D Engine,
IN gctADDRESS Address,
IN gctPOINTER Logical,
IN gctUINT32 Stride,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight);
/* Calculate and program the stretch factors. */
gceSTATUS
gco2D_CalcStretchFactor(IN gco2D Engine,
IN gctINT32 SrcSize,
IN gctINT32 DestSize,
OUT gctUINT32_PTR Factor);
gceSTATUS
gco2D_SetStretchFactors(IN gco2D Engine,
IN gctUINT32 HorFactor,
IN gctUINT32 VerFactor);
/* Calculate and program the stretch factors based on the rectangles. */
gceSTATUS
gco2D_SetStretchRectFactors(IN gco2D Engine,
IN gcsRECT_PTR SrcRect,
IN gcsRECT_PTR DestRect);
/* Create a new solid color gcoBRUSH object. */
gceSTATUS
gco2D_ConstructSingleColorBrush(IN gco2D Engine,
IN gctUINT32 ColorConvert,
IN gctUINT32 Color,
IN gctUINT64 Mask,
gcoBRUSH *Brush);
/* Create a new monochrome gcoBRUSH object. */
gceSTATUS
gco2D_ConstructMonochromeBrush(IN gco2D Engine,
IN gctUINT32 OriginX,
IN gctUINT32 OriginY,
IN gctUINT32 ColorConvert,
IN gctUINT32 FgColor,
IN gctUINT32 BgColor,
IN gctUINT64 Bits,
IN gctUINT64 Mask,
gcoBRUSH *Brush);
/* Create a color gcoBRUSH object. */
gceSTATUS
gco2D_ConstructColorBrush(IN gco2D Engine,
IN gctUINT32 OriginX,
IN gctUINT32 OriginY,
IN gctPOINTER Address,
IN gceSURF_FORMAT Format,
IN gctUINT64 Mask,
gcoBRUSH *Brush);
/* Clear one or more rectangular areas. */
gceSTATUS
gco2D_Clear(IN gco2D Engine,
IN gctUINT32 RectCount,
IN gcsRECT_PTR Rect,
IN gctUINT32 Color32,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
/* Draw one or more Bresenham lines. */
gceSTATUS
gco2D_Line(IN gco2D Engine,
IN gctUINT32 LineCount,
IN gcsRECT_PTR Position,
IN gcoBRUSH Brush,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
/* Draw one or more Bresenham lines based on the 32-bit color. */
gceSTATUS
gco2D_ColorLine(IN gco2D Engine,
IN gctUINT32 LineCount,
IN gcsRECT_PTR Position,
IN gctUINT32 Color32,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
/* Generic blit. */
gceSTATUS
gco2D_Blit(IN gco2D Engine,
IN gctUINT32 RectCount,
IN gcsRECT_PTR Rect,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
gceSTATUS
gco2D_Blend(IN gco2D Engine,
IN gctUINT32 SrcCount,
IN gctUINT32 RectCount,
IN gcsRECT_PTR Rect,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
/* Batch blit. */
gceSTATUS
gco2D_BatchBlit(IN gco2D Engine,
IN gctUINT32 RectCount,
IN gcsRECT_PTR SrcRect,
IN gcsRECT_PTR DestRect,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
/* Stretch blit. */
gceSTATUS
gco2D_StretchBlit(IN gco2D Engine,
IN gctUINT32 RectCount,
IN gcsRECT_PTR Rect,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop,
IN gceSURF_FORMAT DestFormat);
/* Monochrome blit. */
gceSTATUS
gco2D_MonoBlit(IN gco2D Engine,
IN gctPOINTER StreamBits,
IN gcsPOINT_PTR StreamSize,
IN gcsRECT_PTR StreamRect,
IN gceSURF_MONOPACK SrcStreamPack,
IN gceSURF_MONOPACK DestStreamPack,
IN gcsRECT_PTR DestRect,
IN gctUINT32 FgRop,
IN gctUINT32 BgRop,
IN gceSURF_FORMAT DestFormat);
gceSTATUS
gco2D_MonoBlitEx(IN gco2D Engine,
IN gctPOINTER StreamBits,
IN gctINT32 StreamStride,
IN gctINT32 StreamWidth,
IN gctINT32 StreamHeight,
IN gctINT32 StreamX,
IN gctINT32 StreamY,
IN gctUINT32 FgColor,
IN gctUINT32 BgColor,
IN gcsRECT_PTR SrcRect,
IN gcsRECT_PTR DstRect,
IN gctUINT8 FgRop,
IN gctUINT8 BgRop);
/* Set kernel size. */
gceSTATUS
gco2D_SetKernelSize(IN gco2D Engine,
IN gctUINT8 HorKernelSize,
IN gctUINT8 VerKernelSize);
/* Set filter type. */
gceSTATUS
gco2D_SetFilterType(IN gco2D Engine, IN gceFILTER_TYPE FilterType);
/* Set the filter kernel by user. */
gceSTATUS
gco2D_SetUserFilterKernel(IN gco2D Engine,
IN gceFILTER_PASS_TYPE PassType,
IN gctUINT16_PTR KernelArray);
/* Select the pass(es) to be done for user defined filter. */
gceSTATUS
gco2D_EnableUserFilterPasses(IN gco2D Engine, IN gctBOOL HorPass, IN gctBOOL VerPass);
/* Frees the temporary buffer allocated by filter blit operation. */
gceSTATUS
gco2D_FreeFilterBuffer(IN gco2D Engine);
/* Filter blit. */
gceSTATUS
gco2D_FilterBlit(IN gco2D Engine,
IN gctADDRESS SrcAddress,
IN gctUINT SrcStride,
IN gctADDRESS SrcUAddress,
IN gctUINT SrcUStride,
IN gctADDRESS SrcVAddress,
IN gctUINT SrcVStride,
IN gceSURF_FORMAT SrcFormat,
IN gceSURF_ROTATION SrcRotation,
IN gctUINT32 SrcSurfaceWidth,
IN gcsRECT_PTR SrcRect,
IN gctADDRESS DestAddress,
IN gctUINT DestStride,
IN gceSURF_FORMAT DestFormat,
IN gceSURF_ROTATION DestRotation,
IN gctUINT32 DestSurfaceWidth,
IN gcsRECT_PTR DestRect,
IN gcsRECT_PTR DestSubRect);
/* Filter blit extension for full rotation. */
gceSTATUS
gco2D_FilterBlitEx(IN gco2D Engine,
IN gctADDRESS SrcAddress,
IN gctUINT SrcStride,
IN gctADDRESS SrcUAddress,
IN gctUINT SrcUStride,
IN gctADDRESS SrcVAddress,
IN gctUINT SrcVStride,
IN gceSURF_FORMAT SrcFormat,
IN gceSURF_ROTATION SrcRotation,
IN gctUINT32 SrcSurfaceWidth,
IN gctUINT32 SrcSurfaceHeight,
IN gcsRECT_PTR SrcRect,
IN gctADDRESS DestAddress,
IN gctUINT DestStride,
IN gceSURF_FORMAT DestFormat,
IN gceSURF_ROTATION DestRotation,
IN gctUINT32 DestSurfaceWidth,
IN gctUINT32 DestSurfaceHeight,
IN gcsRECT_PTR DestRect,
IN gcsRECT_PTR DestSubRect);
gceSTATUS
gco2D_FilterBlitEx2(IN gco2D Engine,
IN gctADDRESS *SrcAddresses,
IN gctUINT32 SrcAddressNum,
IN gctUINT32_PTR SrcStrides,
IN gctUINT32 SrcStrideNum,
IN gceTILING SrcTiling,
IN gceSURF_FORMAT SrcFormat,
IN gceSURF_ROTATION SrcRotation,
IN gctUINT32 SrcSurfaceWidth,
IN gctUINT32 SrcSurfaceHeight,
IN gcsRECT_PTR SrcRect,
IN gctADDRESS *DestAddresses,
IN gctUINT32 DestAddressNum,
IN gctUINT32_PTR DestStrides,
IN gctUINT32 DestStrideNum,
IN gceTILING DestTiling,
IN gceSURF_FORMAT DestFormat,
IN gceSURF_ROTATION DestRotation,
IN gctUINT32 DestSurfaceWidth,
IN gctUINT32 DestSurfaceHeight,
IN gcsRECT_PTR DestRect,
IN gcsRECT_PTR DestSubRect);
/* Enable alpha blending engine in the hardware and disengage the ROP engine. */
gceSTATUS
gco2D_EnableAlphaBlend(IN gco2D Engine,
IN gctUINT8 SrcGlobalAlphaValue,
IN gctUINT8 DstGlobalAlphaValue,
IN gceSURF_PIXEL_ALPHA_MODE SrcAlphaMode,
IN gceSURF_PIXEL_ALPHA_MODE DstAlphaMode,
IN gceSURF_GLOBAL_ALPHA_MODE SrcGlobalAlphaMode,
IN gceSURF_GLOBAL_ALPHA_MODE DstGlobalAlphaMode,
IN gceSURF_BLEND_FACTOR_MODE SrcFactorMode,
IN gceSURF_BLEND_FACTOR_MODE DstFactorMode,
IN gceSURF_PIXEL_COLOR_MODE SrcColorMode,
IN gceSURF_PIXEL_COLOR_MODE DstColorMode);
/* Enable alpha blending engine in the hardware. */
gceSTATUS
gco2D_EnableAlphaBlendAdvanced(IN gco2D Engine,
IN gceSURF_PIXEL_ALPHA_MODE SrcAlphaMode,
IN gceSURF_PIXEL_ALPHA_MODE DstAlphaMode,
IN gceSURF_GLOBAL_ALPHA_MODE SrcGlobalAlphaMode,
IN gceSURF_GLOBAL_ALPHA_MODE DstGlobalAlphaMode,
IN gceSURF_BLEND_FACTOR_MODE SrcFactorMode,
IN gceSURF_BLEND_FACTOR_MODE DstFactorMode);
/* Enable alpha blending engine with Porter Duff rule. */
gceSTATUS
gco2D_SetPorterDuffBlending(IN gco2D Engine, IN gce2D_PORTER_DUFF_RULE Rule);
/* Disable alpha blending engine in the hardware and engage the ROP engine. */
gceSTATUS
gco2D_DisableAlphaBlend(IN gco2D Engine);
/* Retrieve the maximum number of 32-bit data chunks for a single DE command. */
gctUINT32
gco2D_GetMaximumDataCount(void);
/* Retrieve the maximum number of rectangles, that can be passed in a single DE command. */
gctUINT32
gco2D_GetMaximumRectCount(void);
/* Returns the pixel alignment of the surface. */
gceSTATUS
gco2D_GetPixelAlignment(gceSURF_FORMAT Format, gcsPOINT_PTR Alignment);
/* Retrieve monochrome stream pack size. */
gceSTATUS
gco2D_GetPackSize(IN gceSURF_MONOPACK StreamPack,
OUT gctUINT32 *PackWidth,
OUT gctUINT32 *PackHeight);
/* Flush the 2D pipeline. */
gceSTATUS
gco2D_Flush(IN gco2D Engine);
/* Load 256-entry color table for INDEX8 source surfaces. */
gceSTATUS
gco2D_LoadPalette(IN gco2D Engine,
IN gctUINT FirstIndex,
IN gctUINT IndexCount,
IN gctPOINTER ColorTable,
IN gctBOOL ColorConvert);
/* Enable/disable 2D BitBlt mirrorring. */
gceSTATUS
gco2D_SetBitBlitMirror(IN gco2D Engine,
IN gctBOOL HorizontalMirror,
IN gctBOOL VerticalMirror);
/*
* Set the transparency for source, destination and pattern.
* It also enable or disable the DFB color key mode.
*/
gceSTATUS
gco2D_SetTransparencyAdvancedEx(IN gco2D Engine,
IN gce2D_TRANSPARENCY SrcTransparency,
IN gce2D_TRANSPARENCY DstTransparency,
IN gce2D_TRANSPARENCY PatTransparency,
IN gctBOOL EnableDFBColorKeyMode);
/* Set the transparency for source, destination and pattern. */
gceSTATUS
gco2D_SetTransparencyAdvanced(IN gco2D Engine,
IN gce2D_TRANSPARENCY SrcTransparency,
IN gce2D_TRANSPARENCY DstTransparency,
IN gce2D_TRANSPARENCY PatTransparency);
/* Set the source color key. */
gceSTATUS
gco2D_SetSourceColorKeyAdvanced(IN gco2D Engine, IN gctUINT32 ColorKey);
/* Set the source color key range. */
gceSTATUS
gco2D_SetSourceColorKeyRangeAdvanced(IN gco2D Engine,
IN gctUINT32 ColorKeyLow,
IN gctUINT32 ColorKeyHigh);
/* Set the target color key. */
gceSTATUS
gco2D_SetTargetColorKeyAdvanced(IN gco2D Engine, IN gctUINT32 ColorKey);
/* Set the target color key range. */
gceSTATUS
gco2D_SetTargetColorKeyRangeAdvanced(IN gco2D Engine,
IN gctUINT32 ColorKeyLow,
IN gctUINT32 ColorKeyHigh);
/* Set the YUV color space mode. */
gceSTATUS
gco2D_SetYUVColorMode(IN gco2D Engine, IN gce2D_YUV_COLOR_MODE Mode);
/* Setup the source global color value in ARGB8 format. */
gceSTATUS
gco2D_SetSourceGlobalColorAdvanced(IN gco2D Engine, IN gctUINT32 Color32);
/* Setup the target global color value in ARGB8 format. */
gceSTATUS
gco2D_SetTargetGlobalColorAdvanced(IN gco2D Engine, IN gctUINT32 Color32);
/* Setup the source and target pixel multiply modes. */
gceSTATUS
gco2D_SetPixelMultiplyModeAdvanced(IN gco2D Engine,
IN gce2D_PIXEL_COLOR_MULTIPLY_MODE SrcPremultiplySrcAlpha,
IN gce2D_PIXEL_COLOR_MULTIPLY_MODE DstPremultiplyDstAlpha,
IN gce2D_GLOBAL_COLOR_MULTIPLY_MODE SrcPremultiplyGlobalMode,
IN gce2D_PIXEL_COLOR_MULTIPLY_MODE DstDemultiplyDstAlpha);
/* Set the GPU clock cycles after which the idle engine will keep auto-flushing. */
gceSTATUS
gco2D_SetAutoFlushCycles(IN gco2D Engine, IN gctUINT32 Cycles);
#if VIVANTE_PROFILER
/*
* Read the profile registers available in the 2D engine and sets them in the profile.
* The function will also reset the pixelsRendered counter every time.
*/
gceSTATUS
gco2D_ProfileEngine(IN gco2D Engine, OPTIONAL gcs2D_PROFILE_PTR Profile);
#endif
/* Enable or disable 2D dithering. */
gceSTATUS
gco2D_EnableDither(IN gco2D Engine, IN gctBOOL Enable);
gceSTATUS
gco2D_SetGenericSource(IN gco2D Engine,
IN gctADDRESS *Addresses,
IN gctUINT32 AddressNum,
IN gctUINT32_PTR Strides,
IN gctUINT32 StrideNum,
IN gceTILING Tiling,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight);
gceSTATUS
gco2D_SetGenericTarget(IN gco2D Engine,
IN gctADDRESS *Addresses,
IN gctUINT32 AddressNum,
IN gctUINT32_PTR Strides,
IN gctUINT32 StrideNum,
IN gceTILING Tiling,
IN gceSURF_FORMAT Format,
IN gceSURF_ROTATION Rotation,
IN gctUINT32 SurfaceWidth,
IN gctUINT32 SurfaceHeight);
gceSTATUS
gco2D_SetCurrentSourceIndex(IN gco2D Engine, IN gctUINT32 SrcIndex);
gceSTATUS
gco2D_MultiSourceBlit(IN gco2D Engine,
IN gctUINT32 SourceMask,
IN gcsRECT_PTR DestRect,
IN gctUINT32 RectCount);
gceSTATUS
gco2D_SetROP(IN gco2D Engine, IN gctUINT8 FgRop, IN gctUINT8 BgRop);
gceSTATUS
gco2D_SetGdiStretchMode(IN gco2D Engine, IN gctBOOL Enable);
gceSTATUS
gco2D_SetSourceTileStatus(IN gco2D Engine,
IN gce2D_TILE_STATUS_CONFIG TSControl,
IN gceSURF_FORMAT CompressedFormat,
IN gctUINT32 ClearValue,
IN gctADDRESS GpuAddress);
gceSTATUS
gco2D_SetTargetTileStatus(IN gco2D Engine,
IN gce2D_TILE_STATUS_CONFIG TileStatusConfig,
IN gceSURF_FORMAT CompressedFormat,
IN gctUINT32 ClearValue,
IN gctADDRESS GpuAddress);
gceSTATUS
gco2D_SetSourceCacheMode(IN gco2D Engine, IN gceCACHE_MODE CacheMode);
gceSTATUS
gco2D_SetTargetCacheMode(IN gco2D Engine, IN gceCACHE_MODE CacheMode);
gceSTATUS
gco2D_QueryU32(IN gco2D Engine, IN gce2D_QUERY Item, OUT gctUINT32_PTR Value);
gceSTATUS
gco2D_SetStateU32(IN gco2D Engine, IN gce2D_STATE State, IN gctUINT32 Value);
gceSTATUS
gco2D_SetStateArrayI32(IN gco2D Engine,
IN gce2D_STATE State,
IN gctINT32_PTR Array,
IN gctINT32 ArraySize);
gceSTATUS
gco2D_SetStateArrayU32(IN gco2D Engine,
IN gce2D_STATE State,
IN gctUINT32_PTR Array,
IN gctINT32 ArraySize);
gceSTATUS
gco2D_SetTargetRect(IN gco2D Engine, IN gcsRECT_PTR Rect);
gceSTATUS
gco2D_Set2DEngine(IN gco2D Engine);
gceSTATUS
gco2D_UnSet2DEngine(IN gco2D Engine);
gceSTATUS
gco2D_Get2DEngine(OUT gco2D *Engine);
gceSTATUS
gco2D_Commit(IN gco2D Engine, IN gctBOOL Stall);
gceSTATUS
gco2D_NatureRotateTranslation(IN gctBOOL IsSrcRot,
IN gce2D_NATURE_ROTATION NatureRotation,
IN gctINT32 SrcSurfaceWidth,
IN gctINT32 SrcSurfaceHeight,
IN gctINT32 DstSurfaceWidth,
IN gctINT32 DstSurfaceHeight,
IN OUT gcsRECT_PTR SrcRect,
IN OUT gcsRECT_PTR DstRect,
OUT gceSURF_ROTATION *SrcRotation,
OUT gceSURF_ROTATION *DstRotation);
/* Set source endian mode. */
gceSTATUS
gco2D_SetSourceEndianMode(IN gco2D Engine, IN gceENDIAN_MODE eEndianMode);
/* Set target endian mode. */
gceSTATUS
gco2D_SetTargetEndianMode(IN gco2D Engine, IN gceENDIAN_MODE eEndianMode);
gceSTATUS
gco2D_GetActiveCoreIndex(IN gco2D Engine, OUT gctUINT32 *ActiveCoreIndex);
gceSTATUS
gco2D_SetActiveCoreIndex(IN gco2D Engine, IN gctUINT32 ActiveCoreIndex);
gceSTATUS
gco2D_SetMeanValue(IN gco2D Engine,
IN gctINT32 R,
IN gctINT32 G,
IN gctINT32 B);
gceSTATUS
gco2D_SetStdRerciprocal(IN gco2D Engine,
IN gctINT32 R,
IN gctINT32 G,
IN gctINT32 B);
gceSTATUS
gco2D_SetInitError(IN gco2D Engine,
IN gctBOOL GDIStretch,
IN gctUINT currentSrcIndex,
IN OUT gcsRECT_PTR SplitSrcRectL,
IN OUT gcsRECT_PTR SplitSrcRectR,
IN OUT gcsRECT_PTR SplitDstRectL,
IN OUT gcsRECT_PTR SplitDstRectR);
gceSTATUS
gco2D_SetScaleFactor(IN gco2D Engine, IN gctUINT32 ScaleFactor);
gceSTATUS
gco2D_SetState(IN gco2D Engine, IN gcs2D_STATE_CONFIG Config);
#ifdef __cplusplus
}
#endif
#endif /* __gc_hal_raster_h_ */

View File

@ -0,0 +1,73 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_statistics_h_
#define __gc_hal_statistics_h_
#define VIV_STAT_ENABLE_STATISTICS 0
/* Toal number of frames for which the frame time is accounted. We have storage
* to keep frame times for last this many frames.
*/
#define VIV_STAT_FRAME_BUFFER_SIZE 30
/*
* Total number of frames sampled for a mode. This means
*
* # of frames for HZ Current : VIV_STAT_EARLY_Z_SAMPLE_FRAMES
* # of frames for HZ Switched : VIV_STAT_EARLY_Z_SAMPLE_FRAMES
* +
* --------------------------------------------------------
* : (2 * VIV_STAT_EARLY_Z_SAMPLE_FRAMES) frames needed
*
* IMPORTANT: This total must be smaller than VIV_STAT_FRAME_BUFFER_SIZE
*/
#define VIV_STAT_EARLY_Z_SAMPLE_FRAMES 7
#define VIV_STAT_EARLY_Z_LATENCY_FRAMES 2
/*
* Multiplication factor for previous Hz off mode.
* Make it more than 1.0 to advertise HZ on.
*/
#define VIV_STAT_EARLY_Z_FACTOR (1.05f)
/* HAL statistics information. */
typedef struct _gcsSTATISTICS_EARLYZ {
gctUINT switchBackCount;
gctUINT nextCheckPoint;
gctBOOL disabled;
} gcsSTATISTICS_EARLYZ;
/* HAL statistics information. */
typedef struct _gcsSTATISTICS {
gctUINT64 frameTime[VIV_STAT_FRAME_BUFFER_SIZE];
gctUINT64 previousFrameTime;
gctUINT frame;
gcsSTATISTICS_EARLYZ earlyZ;
} gcsSTATISTICS;
/* Add a frame based data into current statistics. */
void
gcfSTATISTICS_AddData(IN gceSTATISTICS Key, IN gctUINT Value);
/* Marks the frame end and triggers statistical calculations and decisions.*/
void
gcfSTATISTICS_MarkFrameEnd(void);
/* Sets whether the dynamic HZ is disabled or not .*/
void
gcfSTATISTICS_DisableDynamicEarlyZ(IN gctBOOL Disabled);
#endif /*__gc_hal_statistics_h_ */

View File

@ -0,0 +1,18 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#include "gc_hal_version.h"
#include "gc_hal_options.h"
#include "shared/gc_hal_types_shared.h"

View File

@ -0,0 +1,29 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_version_h_
#define __gc_hal_version_h_
#define gcvVERSION_MAJOR 6
#define gcvVERSION_MINOR 4
#define gcvVERSION_PATCH 15
#define gcvVERSION_BUILD 690884
#define gcvVERSION_STRING "6.4.15.3.690884"
#endif /* __gc_hal_version_h_ */

View File

@ -0,0 +1,45 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_base_shared_h_
#define __gc_hal_base_shared_h_
#ifdef __cplusplus
extern "C" {
#endif
#define gcdBINARY_TRACE_MESSAGE_SIZE 240
typedef struct _gcsBINARY_TRACE_MESSAGE *gcsBINARY_TRACE_MESSAGE_PTR;
typedef struct _gcsBINARY_TRACE_MESSAGE {
gctUINT32 signature;
gctUINT32 pid;
gctUINT32 tid;
gctUINT32 line;
gctUINT32 numArguments;
gctUINT8 payload;
} gcsBINARY_TRACE_MESSAGE;
/* gcsOBJECT object defintinon. */
typedef struct _gcsOBJECT {
/* Type of an object. */
gceOBJECT_TYPE type;
} gcsOBJECT;
#ifdef __cplusplus
}
#endif
#endif /* __gc_hal_base_shared_h_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,208 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
/*
* Interface specification between user and kernel level HAL layers.
*/
#ifndef __gc_hal_driver_vg_shared_h_
#define __gc_hal_driver_vg_shared_h_
#include "gc_hal_types.h"
#if defined(__QNXNTO__)
#include <sys/siginfo.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
****************************** I/O Control Codes *****************************
******************************************************************************/
#define gcvHAL_CLASS "galcore"
#define IOCTL_GCHAL_INTERFACE 30000
/******************************************************************************
******************** Command buffer information structure. *******************
******************************************************************************/
typedef struct _gcsCOMMAND_BUFFER_INFO *gcsCOMMAND_BUFFER_INFO_PTR;
typedef struct _gcsCOMMAND_BUFFER_INFO {
/* FE command buffer interrupt ID. */
gctINT32 feBufferInt;
/* TS overflow interrupt ID. */
gctINT32 tsOverflowInt;
/* Alignment and mask for the buffer address. */
gctUINT addressMask;
gctUINT32 addressAlignment;
/* Alignment for each command. */
gctUINT32 commandAlignment;
/* Number of bytes required by the STATE command. */
gctUINT32 stateCommandSize;
/* Number of bytes required by the RESTART command. */
gctUINT32 restartCommandSize;
/* Number of bytes required by the FETCH command. */
gctUINT32 fetchCommandSize;
/* Number of bytes required by the CALL command. */
gctUINT32 callCommandSize;
/* Number of bytes required by the RETURN command. */
gctUINT32 returnCommandSize;
/* Number of bytes required by the EVENT command. */
gctUINT32 eventCommandSize;
/* Number of bytes required by the END command. */
gctUINT32 endCommandSize;
/* Number of bytes reserved at the tail of a static command buffer. */
gctUINT32 staticTailSize;
/* Number of bytes reserved at the tail of a dynamic command buffer. */
gctUINT32 dynamicTailSize;
} gcsCOMMAND_BUFFER_INFO;
/******************************************************************************
******************************* Task Structures ******************************
******************************************************************************/
typedef struct _gcsTASK_HEADER *gcsTASK_HEADER_PTR;
typedef struct _gcsTASK_HEADER {
/* Task ID. */
IN gceTASK id;
} gcsTASK_HEADER;
typedef struct _gcsTASK_LINK *gcsTASK_LINK_PTR;
typedef struct _gcsTASK_LINK {
/* Task ID (gcvTASK_LINK). */
IN gceTASK id;
/* Pointer to the next task container. */
IN gctPOINTER cotainer;
/* Pointer to the next task from the next task container. */
IN gcsTASK_HEADER_PTR task;
} gcsTASK_LINK;
typedef struct _gcsTASK_CLUSTER *gcsTASK_CLUSTER_PTR;
typedef struct _gcsTASK_CLUSTER {
/* Task ID (gcvTASK_CLUSTER). */
IN gceTASK id;
/* Number of tasks in the cluster. */
IN gctUINT taskCount;
} gcsTASK_CLUSTER;
typedef struct _gcsTASK_INCREMENT *gcsTASK_INCREMENT_PTR;
typedef struct _gcsTASK_INCREMENT {
/* Task ID (gcvTASK_INCREMENT). */
IN gceTASK id;
/* Address of the variable to increment. */
IN gctUINT32 address;
} gcsTASK_INCREMENT;
typedef struct _gcsTASK_DECREMENT *gcsTASK_DECREMENT_PTR;
typedef struct _gcsTASK_DECREMENT {
/* Task ID (gcvTASK_DECREMENT). */
IN gceTASK id;
/* Address of the variable to decrement. */
IN gctUINT32 address;
} gcsTASK_DECREMENT;
typedef struct _gcsTASK_SIGNAL *gcsTASK_SIGNAL_PTR;
typedef struct _gcsTASK_SIGNAL {
/* Task ID (gcvTASK_SIGNAL). */
IN gceTASK id;
/* Process owning the signal. */
IN gctHANDLE process;
/* Signal handle to signal. */
IN gctSIGNAL signal;
#if defined(__QNXNTO__)
IN struct sigevent event;
IN gctINT32 rcvid;
#endif
} gcsTASK_SIGNAL;
typedef struct _gcsTASK_LOCKDOWN *gcsTASK_LOCKDOWN_PTR;
typedef struct _gcsTASK_LOCKDOWN {
/* Task ID (gcvTASK_LOCKDOWN). */
IN gceTASK id;
/* Address of the user space counter. */
IN gctUINT32 userCounter;
/* Address of the kernel space counter. */
IN gctUINT32 kernelCounter;
/* Process owning the signal. */
IN gctHANDLE process;
/* Signal handle to signal. */
IN gctSIGNAL signal;
} gcsTASK_LOCKDOWN;
typedef struct _gcsTASK_UNLOCK_VIDEO_MEMORY *gcsTASK_UNLOCK_VIDEO_MEMORY_PTR;
typedef struct _gcsTASK_UNLOCK_VIDEO_MEMORY {
/* Task ID (gcvTASK_UNLOCK_VIDEO_MEMORY). */
IN gceTASK id;
/* Allocated video memory. */
IN gctUINT64 node;
} gcsTASK_UNLOCK_VIDEO_MEMORY;
typedef struct _gcsTASK_FREE_VIDEO_MEMORY *gcsTASK_FREE_VIDEO_MEMORY_PTR;
typedef struct _gcsTASK_FREE_VIDEO_MEMORY {
/* Task ID (gcvTASK_FREE_VIDEO_MEMORY). */
IN gceTASK id;
/* Allocated video memory. */
IN gctUINT64 node;
} gcsTASK_FREE_VIDEO_MEMORY;
typedef struct _gcsTASK_FREE_CONTIGUOUS_MEMORY *gcsTASK_FREE_CONTIGUOUS_MEMORY_PTR;
typedef struct _gcsTASK_FREE_CONTIGUOUS_MEMORY {
/* Task ID (gcvTASK_FREE_CONTIGUOUS_MEMORY). */
IN gceTASK id;
/* Number of bytes allocated. */
IN gctSIZE_T bytes;
/* Physical address of allocation. */
IN gctPHYS_ADDR physical;
/* Logical address of allocation. */
IN gctPOINTER logical;
} gcsTASK_FREE_CONTIGUOUS_MEMORY;
#ifdef __cplusplus
}
#endif
#endif /* __gc_hal_driver_shared_h_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,346 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_profiler_shared_h_
#define __gc_hal_profiler_shared_h_
#ifdef __cplusplus
extern "C" {
#endif
#define ANDROID_PROFILER_COUNTERS 1
#define FPGA_INFO 0
#define RECORD_COUNTER_ADDRESS 0
/* HW profile information. */
typedef struct _gcsPROFILER_COUNTERS_PART1 {
gctUINT32 gpuTotalRead64BytesPerFrame;
gctUINT32 gpuTotalWrite64BytesPerFrame;
/* FE */
gctUINT32 fe_draw_count;
gctUINT32 fe_out_vertex_count;
gctUINT32 fe_cache_miss_count;
gctUINT32 fe_cache_lk_count;
gctUINT32 fe_stall_count;
gctUINT32 fe_starve_count;
gctUINT32 fe_process_count;
/* PE */
gctUINT32 pe0_pixel_count_killed_by_color_pipe;
gctUINT32 pe0_pixel_count_killed_by_depth_pipe;
gctUINT32 pe0_pixel_count_drawn_by_color_pipe;
gctUINT32 pe0_pixel_count_drawn_by_depth_pipe;
gctUINT32 pe1_pixel_count_killed_by_color_pipe;
gctUINT32 pe1_pixel_count_killed_by_depth_pipe;
gctUINT32 pe1_pixel_count_drawn_by_color_pipe;
gctUINT32 pe1_pixel_count_drawn_by_depth_pipe;
/* SH */
gctUINT32 shader_cycle_count;
gctUINT32 vs_shader_cycle_count;
gctUINT32 ps_shader_cycle_count;
gctUINT32 ps_inst_counter;
gctUINT32 ps_rendered_pixel_counter;
gctUINT32 vs_inst_counter;
gctUINT32 vs_rendered_vertice_counter;
gctUINT32 vs_branch_inst_counter;
gctUINT32 vs_texld_inst_counter;
gctUINT32 ps_branch_inst_counter;
gctUINT32 ps_texld_inst_counter;
gctUINT32 vs_non_idle_starve_count;
gctUINT32 vs_starve_count;
gctUINT32 vs_stall_count;
gctUINT32 vs_process_count;
gctUINT32 ps_non_idle_starve_count;
gctUINT32 ps_starve_count;
gctUINT32 ps_stall_count;
gctUINT32 ps_process_count;
/* PA */
gctUINT32 pa_input_vtx_counter;
gctUINT32 pa_input_prim_counter;
gctUINT32 pa_output_prim_counter;
gctUINT32 pa_depth_clipped_counter;
gctUINT32 pa_trivial_rejected_counter;
gctUINT32 pa_culled_prim_counter;
gctUINT32 pa_droped_prim_counter;
gctUINT32 pa_frustum_clipped_prim_counter;
gctUINT32 pa_frustum_clipdroped_prim_counter;
gctUINT32 pa_non_idle_starve_count;
gctUINT32 pa_starve_count;
gctUINT32 pa_stall_count;
gctUINT32 pa_process_count;
/* SE */
gctUINT32 se_culled_triangle_count;
gctUINT32 se_culled_lines_count;
gctUINT32 se_clipped_triangle_count;
gctUINT32 se_clipped_line_count;
gctUINT32 se_starve_count;
gctUINT32 se_stall_count;
gctUINT32 se_receive_triangle_count;
gctUINT32 se_send_triangle_count;
gctUINT32 se_receive_lines_count;
gctUINT32 se_send_lines_count;
gctUINT32 se_process_count;
gctUINT32 se_trivial_rejected_line_count;
gctUINT32 se_non_idle_starve_count;
/* RA */
gctUINT32 ra_input_prim_count;
gctUINT32 ra_total_quad_count;
gctUINT32 ra_valid_quad_count_after_early_z;
gctUINT32 ra_valid_pixel_count_to_render;
gctUINT32 ra_output_valid_quad_count;
gctUINT32 ra_output_valid_pixel_count;
gctUINT32 ra_pipe_cache_miss_counter;
gctUINT32 ra_pipe_hz_cache_miss_counter;
gctUINT32 ra_prefetch_cache_miss_counter;
gctUINT32 ra_prefetch_hz_cache_miss_counter;
gctUINT32 ra_eez_culled_counter;
gctUINT32 ra_non_idle_starve_count;
gctUINT32 ra_starve_count;
gctUINT32 ra_stall_count;
gctUINT32 ra_process_count;
/* TX */
gctUINT32 tx_total_bilinear_requests;
gctUINT32 tx_total_trilinear_requests;
gctUINT32 tx_total_discarded_texture_requests;
gctUINT32 tx_total_texture_requests;
gctUINT32 tx_mc0_miss_count;
gctUINT32 tx_mc0_request_byte_count;
gctUINT32 tx_mc1_miss_count;
gctUINT32 tx_mc1_request_byte_count;
gctUINT32 tx_non_idle_starve_count;
gctUINT32 tx_starve_count;
gctUINT32 tx_stall_count;
gctUINT32 tx_process_count;
} gcsPROFILER_COUNTERS_PART1;
typedef struct _gcsPROFILER_COUNTERS_PART2 {
/* MCC */
gctUINT32 mcc_total_read_req_8B_from_colorpipe;
gctUINT32 mcc_total_read_req_8B_sentout_from_colorpipe;
gctUINT32 mcc_total_write_req_8B_from_colorpipe;
gctUINT32 mcc_total_read_req_sentout_from_colorpipe;
gctUINT32 mcc_total_write_req_from_colorpipe;
gctUINT32 mcc_total_read_req_8B_from_depthpipe;
gctUINT32 mcc_total_read_req_8B_sentout_from_depthpipe;
gctUINT32 mcc_total_write_req_8B_from_depthpipe;
gctUINT32 mcc_total_read_req_sentout_from_depthpipe;
gctUINT32 mcc_total_write_req_from_depthpipe;
gctUINT32 mcc_total_read_req_8B_from_others;
gctUINT32 mcc_total_write_req_8B_from_others;
gctUINT32 mcc_total_read_req_from_others;
gctUINT32 mcc_total_write_req_from_others;
gctUINT32 mcc_axi_total_latency;
gctUINT32 mcc_axi_sample_count;
gctUINT32 mcc_axi_max_latency;
gctUINT32 mcc_axi_min_latency;
gctUINT32 mc_fe_read_bandwidth;
gctUINT32 mc_mmu_read_bandwidth;
gctUINT32 mc_blt_read_bandwidth;
gctUINT32 mc_sh0_read_bandwidth;
gctUINT32 mc_sh1_read_bandwidth;
gctUINT32 mc_pe_write_bandwidth;
gctUINT32 mc_blt_write_bandwidth;
gctUINT32 mc_sh0_write_bandwidth;
gctUINT32 mc_sh1_write_bandwidth;
/* MCZ */
gctUINT32 mcz_total_read_req_8B_from_colorpipe;
gctUINT32 mcz_total_read_req_8B_sentout_from_colorpipe;
gctUINT32 mcz_total_write_req_8B_from_colorpipe;
gctUINT32 mcz_total_read_req_sentout_from_colorpipe;
gctUINT32 mcz_total_write_req_from_colorpipe;
gctUINT32 mcz_total_read_req_8B_from_depthpipe;
gctUINT32 mcz_total_read_req_8B_sentout_from_depthpipe;
gctUINT32 mcz_total_write_req_8B_from_depthpipe;
gctUINT32 mcz_total_read_req_sentout_from_depthpipe;
gctUINT32 mcz_total_write_req_from_depthpipe;
gctUINT32 mcz_total_read_req_8B_from_others;
gctUINT32 mcz_total_write_req_8B_from_others;
gctUINT32 mcz_total_read_req_from_others;
gctUINT32 mcz_total_write_req_from_others;
gctUINT32 mcz_axi_total_latency;
gctUINT32 mcz_axi_sample_count;
gctUINT32 mcz_axi_max_latency;
gctUINT32 mcz_axi_min_latency;
/* HI */
gctUINT32 hi0_total_read_8B_count;
gctUINT32 hi0_total_write_8B_count;
gctUINT32 hi0_total_read_request_count;
gctUINT32 hi0_total_write_request_count;
gctUINT32 hi0_axi_cycles_read_request_stalled;
gctUINT32 hi0_axi_cycles_write_request_stalled;
gctUINT32 hi0_axi_cycles_write_data_stalled;
gctUINT32 hi1_total_read_8B_count;
gctUINT32 hi1_total_write_8B_count;
gctUINT32 hi1_total_read_request_count;
gctUINT32 hi1_total_write_request_count;
gctUINT32 hi1_axi_cycles_read_request_stalled;
gctUINT32 hi1_axi_cycles_write_request_stalled;
gctUINT32 hi1_axi_cycles_write_data_stalled;
gctUINT32 hi_total_cycle_count;
gctUINT32 hi_total_idle_cycle_count;
gctUINT32 hi_total_read_8B_count;
gctUINT32 hi_total_write_8B_count;
gctUINT32 hi_total_readOCB_16B_count;
gctUINT32 hi_total_writeOCB_16B_count;
/* L2 */
gctUINT32 l2_total_axi0_read_request_count;
gctUINT32 l2_total_axi1_read_request_count;
gctUINT32 l2_total_axi0_write_request_count;
gctUINT32 l2_total_axi1_write_request_count;
gctUINT32 l2_total_read_transactions_request_by_axi0;
gctUINT32 l2_total_read_transactions_request_by_axi1;
gctUINT32 l2_total_write_transactions_request_by_axi0;
gctUINT32 l2_total_write_transactions_request_by_axi1;
gctUINT32 l2_axi0_minmax_latency;
gctUINT32 l2_axi0_min_latency;
gctUINT32 l2_axi0_max_latency;
gctUINT32 l2_axi0_total_latency;
gctUINT32 l2_axi0_total_request_count;
gctUINT32 l2_axi1_minmax_latency;
gctUINT32 l2_axi1_min_latency;
gctUINT32 l2_axi1_max_latency;
gctUINT32 l2_axi1_total_latency;
gctUINT32 l2_axi1_total_request_count;
} gcsPROFILER_COUNTERS_PART2;
typedef struct _gcsPROFILER_COUNTERS {
gcsPROFILER_COUNTERS_PART1 counters_part1;
gcsPROFILER_COUNTERS_PART2 counters_part2;
} gcsPROFILER_COUNTERS;
typedef enum _gceVIP_PROBE_COUNTER {
gcvVIP_PROBE_COUNTER_NEURAL_NET,
gcvVIP_PROBE_COUNTER_TENSOR_PROCESSOR,
gcvVIP_PROBE_COUNTER_COUNT
} gceVIP_PROBE_COUNTER;
/* Mask definations for overflow indicator of TP */
typedef enum _gceTPCOUNTER_OVERFLOW {
gcvTPCOUNTER_LAYER_ID_OVERFLOW = (1 << 0),
gcvTPCOUNTER_TOTAL_BUSY_CYCLE_OVERFLOW = (1 << 1),
gcvTPCOUNTER_TOTAL_READ_BW_DDR_OVERFLOW = (1 << 2),
gcvTPCOUNTER_TOTAL_WRITE_BW_DDR_OVERFLOW = (1 << 3),
gcvTPCOUNTER_TOTAL_READ_BW_SRAM_OVERFLOW = (1 << 4),
gcvTPCOUNTER_TOTAL_WRITE_BW_SRAM_OVERFLOW = (1 << 5),
gcvTPCOUNTER_TOTAL_READ_BW_OCB_OVERFLOW = (1 << 6),
gcvTPCOUNTER_TOTAL_WRITE_BW_OCB_OVERFLOW = (1 << 7),
gcvTPCOUNTER_FC_PIX_CNT_OVERFLOW = (1 << 8),
gcvTPCOUNTER_FC_ZERO_SKIP_OVERFLOW = (1 << 9),
gcvTPCOUNTER_FC_COEF_CNT_OVERFLOW = (1 << 10),
gcvTPCOUNTER_FC_COEF_ZERO_CNT_OVERFLOW = (1 << 11),
gcvTPCOUNTER_TOTAL_IDLE_CYCLE_CORE0_OVERFLOW = (1 << 0),
gcvTPCOUNTER_TOTAL_IDLE_CYCLE_CORE1_OVERFLOW = (1 << 1),
gcvTPCOUNTER_TOTAL_IDLE_CYCLE_CORE2_OVERFLOW = (1 << 2),
gcvTPCOUNTER_TOTAL_IDLE_CYCLE_CORE3_OVERFLOW = (1 << 3),
} _gceTPCOUNTER_OVERFLOW;
/* Mask definations for overflow indicator of NN */
typedef enum _gceNNCOUNTER_OVERFLOW {
gcvNNCOUNTER_TOTAL_BUSY_CYCLE_OVERFLOW = (1 << 0),
gcvNNCOUNTER_TOTAL_READ_CYCLE_DDR_OVERFLOW = (1 << 2),
gcvNNCOUNTER_TOTAL_READ_BW_DDR_OVERFLOW = (1 << 3),
gcvNNCOUNTER_TOTAL_WRITE_CYCLE_DDR_OVERFLOW = (1 << 4),
gcvNNCOUNTER_TOTAL_WRITE_BW_DDR_OVERFLOW = (1 << 5),
gcvNNCOUNTER_TOTAL_READ_SYCLE_SRAM_OVERFLOW = (1 << 6),
gcvNNCOUNTER_TOTAL_WRITE_CYCLE_SRAM_OVERFLOW = (1 << 7),
gcvNNCOUNTER_TOTAL_MAC_CYCLE_OVERFLOW = (1 << 8),
gcvNNCOUNTER_TOTAL_MAC_COUNT_OVERFLOW = (1 << 9),
gcvNNCOUNTER_ZERO_COEF_SKIP_COUNT_OVERFLOW = (1 << 10),
gcvNNCOUNTER_NON_ZERO_COEF_COUNT_OVERFLOW = (1 << 11),
} _gceNNCOUNTER_OVERFLOW;
#define MODULE_NN_RESERVED_COUNTER_NUM 0x9
typedef struct _gcsPROFILER_VIP_PROBE_COUNTERS {
/* NN */
gctUINT32 nn_layer_id;
gctUINT32 nn_layer_id_overflow;
gctUINT32 nn_instr_info;
gctUINT32 nn_total_busy_cycle;
gctUINT32 nn_total_busy_cycle_overflow;
gctUINT32 nn_total_read_cycle_ddr;
gctUINT32 nn_total_read_cycle_ddr_overflow;
gctUINT32 nn_total_read_valid_bandwidth_ddr;
gctUINT32 nn_total_read_valid_bandwidth_ddr_overflow;
gctUINT32 nn_total_write_cycle_ddr;
gctUINT32 nn_total_write_cycle_ddr_overflow;
gctUINT32 nn_total_write_valid_bandwidth_ddr;
gctUINT32 nn_total_write_valid_bandwidth_ddr_overflow;
gctUINT32 nn_total_read_cycle_sram;
gctUINT32 nn_total_read_cycle_sram_overflow;
gctUINT32 nn_total_write_cycle_sram;
gctUINT32 nn_total_write_cycle_sram_overflow;
gctUINT32 nn_total_mac_cycle;
gctUINT32 nn_total_mac_cycle_overflow;
gctUINT32 nn_total_mac_count;
gctUINT32 nn_total_mac_count_overflow;
gctUINT32 nn_zero_coef_skip_count;
gctUINT32 nn_zero_coef_skip_count_overflow;
gctUINT32 nn_non_zero_coef_count;
gctUINT32 nn_non_zero_coef_count_overflow;
gctUINT32 nn_reserved_counter[4 * MODULE_NN_RESERVED_COUNTER_NUM];
gctUINT32 nn_total_idle_cycle_core_overflow[4];
gctUINT32 nn_total_idle_cycle_core[32];
/* TP */
gctUINT32 tp_layer_id;
gctUINT32 tp_layer_id_overflow;
gctUINT32 tp_total_busy_cycle;
gctUINT32 tp_total_busy_cycle_overflow;
gctUINT32 tp_total_read_bandwidth_cache;
gctUINT32 tp_total_read_bandwidth_cache_overflow;
gctUINT32 tp_total_write_bandwidth_cache;
gctUINT32 tp_total_write_bandwidth_cache_overflow;
gctUINT32 tp_total_read_bandwidth_sram;
gctUINT32 tp_total_read_bandwidth_sram_overflow;
gctUINT32 tp_total_write_bandwidth_sram;
gctUINT32 tp_total_write_bandwidth_sram_overflow;
gctUINT32 tp_total_read_bandwidth_ocb;
gctUINT32 tp_total_read_bandwidth_ocb_overflow;
gctUINT32 tp_total_write_bandwidth_ocb;
gctUINT32 tp_total_write_bandwidth_ocb_overflow;
gctUINT32 tp_fc_pix_count;
gctUINT32 tp_fc_zero_skip_count;
gctUINT32 tp_fc_pix_count_overflow;
gctUINT32 tp_fc_zero_skip_count_overflow;
gctUINT32 tp_fc_coef_count;
gctUINT32 tp_fc_coef_zero_count;
gctUINT32 tp_fc_coef_count_overflow;
gctUINT32 tp_fc_coef_zero_count_overflow;
gctUINT32 tp_total_idle_cycle_core[16];
gctUINT32 tp_total_idle_cycle_core_overflows[16];
} gcsPROFILER_VIP_PROBE_COUNTERS;
#ifdef __cplusplus
}
#endif
#endif /* __gc_hal_profiler_shared_h_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,180 @@
/****************************************************************************
*
* Copyright (c) 2005 - 2023 by Vivante Corp. All rights reserved.
*
* The material in this file is confidential and contains trade secrets
* of Vivante Corporation. This is proprietary information owned by
* Vivante Corporation. No part of this work may be disclosed,
* reproduced, copied, transmitted, or used in any way for any purpose,
* without the express written permission of Vivante Corporation.
*
*****************************************************************************/
#ifndef __gc_hal_shared_vg_h_
#define __gc_hal_shared_vg_h_
#if defined(__QNXNTO__)
# include <sys/siginfo.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Command buffer header. */
typedef struct _gcsCMDBUFFER *gcsCMDBUFFER_PTR;
typedef struct _gcsCMDBUFFER {
/* Pointer to the completion signal. */
gcsCOMPLETION_SIGNAL_PTR completion;
/*
* The user sets this to the node of the container buffer whitin which
* this particular command buffer resides. The kernel sets this to the
* node of the internally allocated buffer.
*/
gcuVIDMEM_NODE_PTR node;
/* Command buffer hardware address. */
gctUINT32 address;
/* The offset of the buffer from the beginning of the header. */
gctUINT32 bufferOffset;
/*
* Size of the area allocated for the data portion of this particular
* command buffer (headers and tail reserves are excluded).
*/
gctUINT32 size;
/*
* Offset into the buffer [0..size]; reflects exactly how much data has
* been put into the command buffer.
*/
gctUINT offset;
/*
* The number of command units in the buffer for the hardware to
* execute.
*/
gctUINT32 dataCount;
/*
* MANAGED BY : user HAL (gcoBUFFER object).
* USED BY : user HAL (gcoBUFFER object).
* Points to the immediate next allocated command buffer.
*/
gcsCMDBUFFER_PTR nextAllocated;
/*
* MANAGED BY : user layers (HAL and drivers).
* USED BY : kernel HAL (gcoBUFFER object).
* Points to the next subbuffer if any. A family of subbuffers are chained
* together and are meant to be executed inseparably as a unit. Meaning
* that context switching cannot occur while a chain of subbuffers is being
* executed.
*/
gcsCMDBUFFER_PTR nextSubBuffer;
} gcsCMDBUFFER;
/* Command queue element. */
typedef struct _gcsVGCMDQUEUE {
/* Pointer to the command buffer header. */
gcsCMDBUFFER_PTR commandBuffer;
/* Dynamic vs. static command buffer state. */
gctBOOL dynamic;
} gcsVGCMDQUEUE;
/* Context map entry. */
typedef struct _gcsVGCONTEXT_MAP {
/* State index. */
gctUINT32 index;
/* New state value. */
gctUINT32 data;
/* Points to the next entry in the mod list. */
gcsVGCONTEXT_MAP_PTR next;
} gcsVGCONTEXT_MAP;
/* gcsVGCONTEXT structure that holds the current context. */
typedef struct _gcsVGCONTEXT {
/* Context ID. */
gctUINT64 id;
/* State caching ebable flag. */
gctBOOL stateCachingEnabled;
/* Current pipe. */
gctUINT32 currentPipe;
/* State map/mod buffer. */
gctUINT32 mapFirst;
gctUINT32 mapLast;
gcsVGCONTEXT_MAP_PTR mapContainer;
gcsVGCONTEXT_MAP_PTR mapPrev;
gcsVGCONTEXT_MAP_PTR mapCurr;
gcsVGCONTEXT_MAP_PTR firstPrevMap;
gcsVGCONTEXT_MAP_PTR firstCurrMap;
/* Main context buffer. */
gcsCMDBUFFER_PTR header;
gctUINT32_PTR buffer;
/* Completion signal. */
gctHANDLE process;
gctSIGNAL signal;
#if defined(__QNXNTO__)
gctSIGNAL userSignal;
struct sigevent event;
gctINT32 rcvid;
#endif
} gcsVGCONTEXT;
/* User space task header. */
typedef struct _gcsTASK *gcsTASK_PTR;
typedef struct _gcsTASK {
/* Pointer to the next task for the same interrupt in user space. */
gcsTASK_PTR next;
/* Size of the task data that immediately follows the structure. */
gctUINT size;
/* Task data starts here. */
/* ... */
} gcsTASK;
/* User space task master table entry. */
typedef struct _gcsTASK_MASTER_ENTRY *gcsTASK_MASTER_ENTRY_PTR;
typedef struct _gcsTASK_MASTER_ENTRY {
/* Pointers to the head and to the tail of the task chain. */
gcsTASK_PTR head;
gcsTASK_PTR tail;
} gcsTASK_MASTER_ENTRY;
/* User space task master table entry. */
typedef struct _gcsTASK_MASTER_TABLE {
/* Table with one entry per block. */
gcsTASK_MASTER_ENTRY table[gcvBLOCK_COUNT];
/* The total number of tasks sckeduled. */
gctUINT count;
/* The total size of event data in bytes. */
gctUINT size;
#if defined(__QNXNTO__)
struct sigevent event;
gctINT32 rcvid;
#endif
} gcsTASK_MASTER_TABLE;
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __gc_hal_shared_h_ */

View File

@ -0,0 +1,194 @@
#ifndef _VIV_NN_COMPATIBILITY_H_
#define _VIV_NN_COMPATIBILITY_H_
#include <VX/vx.h>
#include <VX/vx_khr_nn.h>
/* keep the backward compatibility with spec 1.1 for standard nn kernels */
#define VX_KERNEL_NN_SOFTMAX_LAYER VX_KERNEL_SOFTMAX_LAYER
#define VX_KERNEL_NN_NORMALIZATION_LAYER VX_KERNEL_NORMALIZATION_LAYER
#define VX_KERNEL_NN_POOLING_LAYER VX_KERNEL_POOLING_LAYER
#define VX_KERNEL_NN_FULLY_CONNECTED_LAYER VX_KERNEL_FULLY_CONNECTED_LAYER
#define VX_KERNEL_NN_ACTIVATION_LAYER VX_KERNEL_ACTIVATION_LAYER
#define VX_KERNEL_NN_ROIPOOL VX_KERNEL_ROI_POOLING_LAYER
#define VX_KERNEL_NN_CONVOLUTION_LAYER VX_KERNEL_CONVOLUTION_LAYER
#define VX_KERNEL_NN_DECONVOLUTION_LAYER VX_KERNEL_DECONVOLUTION_LAYER
/* keep the backward compatibility with spec 1.1 for vx_tensor_attribute_e */
#define VX_TENSOR_NUM_OF_DIMS VX_TENSOR_NUMBER_OF_DIMS
#define VX_TENSOR_FIXED_POINT_POS VX_TENSOR_FIXED_POINT_POSITION
/* keep the backward compatibility with spec 1.1 from vx_convolutional_network_rounding_type_e to vx_nn_rounding_type_e */
typedef enum vx_nn_rounding_type_e vx_convolutional_network_rounding_type_e;
#define VX_CONVOLUTIONAL_NETWORK_DS_SIZE_ROUNDING_FLOOR VX_NN_DS_SIZE_ROUNDING_FLOOR
#define VX_CONVOLUTIONAL_NETWORK_DS_SIZE_ROUNDING_CEILING VX_NN_DS_SIZE_ROUNDING_CEILING
/* keep the backward compatibility with spec 1.1 from vx_convolutional_network_pooling_type_e to vx_nn_pooling_type_e */
typedef enum vx_nn_pooling_type_e vx_convolutional_network_pooling_type_e;
#define VX_CONVOLUTIONAL_NETWORK_POOLING_MAX VX_NN_POOLING_MAX
#define VX_CONVOLUTIONAL_NETWORK_POOLING_AVG VX_NN_POOLING_AVG
#define VX_CONVOLUTIONAL_NETWORK_POOLING_L2 VX_NN_POOLING_L2
#define VX_CONVOLUTIONAL_NETWORK_POOLING_AVG_ANDROID VX_NN_POOLING_AVG_ANDROID
/* keep the backward compatibility with spec 1.1 from vx_convolutional_network_norm_type_e to vx_nn_norm_type_e */
typedef enum vx_nn_norm_type_e vx_convolutional_network_norm_type_e;
#define VX_CONVOLUTIONAL_NETWORK_NORM_SAME_MAP VX_NN_NORMALIZATION_SAME_MAP
#define VX_CONVOLUTIONAL_NETWORK_NORM_ACROSS_MAPS VX_NN_NORMALIZATION_ACROSS_MAPS
/* keep the backward compatibility with spec 1.1 from vx_convolutional_network_layer_type_e to vx_nn_layer_type_e */
typedef enum vx_nn_layer_type_e vx_convolutional_network_layer_type_e;
#define VX_CONVOLUTIONAL_NETWORK_CONVOLUTION_LAYER VX_NN_CONVOLUTION_LAYER
#define VX_CONVOLUTIONAL_NETWORK_FULLYCONNECTED_LAYER VX_NN_FULLYCONNECTED_LAYER
/* keep the backward compatibility with spec 1.1 from vx_convolutional_network_activation_func_e to vx_nn_activation_function_e */
typedef enum vx_nn_activation_function_e vx_convolutional_network_activation_func_e;
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_LOGISTIC VX_NN_ACTIVATION_LOGISTIC
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_HYPERBOLIC_TAN VX_NN_ACTIVATION_HYPERBOLIC_TAN
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_RELU VX_NN_ACTIVATION_RELU
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_BRELU VX_NN_ACTIVATION_BRELU
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_SOFTRELU VX_NN_ACTIVATION_SOFTRELU
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_ABS VX_NN_ACTIVATION_ABS
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_SQUARE VX_NN_ACTIVATION_SQUARE
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_SQRT VX_NN_ACTIVATION_SQRT
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_LINEAR VX_NN_ACTIVATION_LINEAR
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_LEAKYRELU VX_NN_ACTIVATION_LEAKYRELU
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_RELU6 VX_NN_ACTIVATION_RELU6
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_RELU1 VX_NN_ACTIVATION_RELU1
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_RSQRT VX_NN_ACTIVATION_RSQRT
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_LEAKYRELU_MAX_POOLING VX_NN_ACTIVATION_LEAKYRELU_MAX_POOLING
#define VX_CONVOLUTIONAL_NETWORK_ACTIVATION_NONE VX_NN_ACTIVATION_NONE
#ifdef __cplusplus
extern "C" {
#endif
/* keep the backward compatibility with spec 1.1 for vxCreateTensor */
VX_API_ENTRY vx_tensor VX_API_CALL
vxCreateTensor_11(
vx_context context,
vx_uint32 num_of_dims,
vx_uint32 *sizes,
vx_enum data_format,
vx_int8 fixed_point_pos
);
#if !VX_VA40_EXT_SUPPORT
#define vxCreateTensor vxCreateTensor_11
#endif
/* keep the backward compatibility with spec 1.1 for vxCreateVirtualTensor */
VX_API_ENTRY vx_tensor VX_API_CALL
vxCreateVirtualTensor_11(
vx_graph graph,
vx_uint32 num_of_dims,
vx_uint32 *sizes,
vx_enum data_format,
vx_int8 fixed_point_pos
);
#if !VX_VA40_EXT_SUPPORT
#define vxCreateVirtualTensor vxCreateVirtualTensor_11
#endif
/* keep the backward compatibility with spec 1.1 for vxCreateTensorFromView */
VX_API_ENTRY vx_tensor VX_API_CALL
vxCreateTensorFromView_11(
vx_tensor tensor,
vx_tensor_view view
);
#define vxCreateTensorFromView vxCreateTensorFromView_11
/* keep the backward compatibility with spec 1.1 for vxCopyTensorPatch */
VX_API_ENTRY vx_status VX_API_CALL
vxCopyTensorPatch_11(
vx_tensor tensor,
vx_tensor_view view,
vx_tensor_addressing user_addr,
void *user_ptr,
vx_enum usage,
vx_enum user_mem_type
);
#define vxCopyTensorPatch vxCopyTensorPatch_11
/* keep the backward compatibility with spec 1.1 for vxCreateImageObjectArrayFromTensor */
VX_API_ENTRY vx_object_array VX_API_CALL
vxCreateImageObjectArrayFromTensor_11(
vx_tensor tensor,
vx_rectangle_t rect,
vx_uint32 array_size,
vx_uint32 stride,
vx_df_image image_format
);
#define vxCreateImageObjectArrayFromTensor vxCreateImageObjectArrayFromTensor_11
/* keep the backward compatibility with spec 1.1 for vxFullyConnectedLayer */
VX_API_ENTRY vx_node VX_API_CALL
vxFullyConnectedLayer_11(
vx_graph graph,
vx_tensor inputs,
vx_tensor weights,
vx_tensor biases,
vx_uint32 pad,
vx_uint8 accumulator_bits,
vx_enum overflow_policy,
vx_enum rounding_policy,
vx_enum down_scale_size_rounding,
vx_tensor outputs
);
#define vxFullyConnectedLayer vxFullyConnectedLayer_11
/* keep the backward compatibility with spec 1.1 for vxActivationLayer */
VX_API_ENTRY vx_node VX_API_CALL
vxActivationLayer_11(
vx_graph graph,
vx_tensor inputs,
vx_enum func,
vx_int32 a,
vx_int32 b,
vx_tensor outputs
);
#define vxActivationLayer vxActivationLayer_11
/* keep the backward compatibility with spec 1.1 for vxPoolingLayer */
VX_API_ENTRY vx_node VX_API_CALL
vxPoolingLayer_11(
vx_graph graph,
vx_tensor inputs,
vx_enum pool_type,
vx_uint32 pool_size_x,
vx_uint32 pool_size_y,
vx_uint32 pool_pad_x,
vx_uint32 pool_pad_y,
vx_enum rounding,
vx_tensor outputs
);
#define vxPoolingLayer vxPoolingLayer_11
/* keep the backward compatibility with spec 1.1 for vxNormalizationLayer */
VX_API_ENTRY vx_node VX_API_CALL
vxNormalizationLayer_11(
vx_graph graph,
vx_tensor inputs,
vx_enum type,
vx_uint32 norm_size,
vx_float32 alpha,
vx_float32 beta,
vx_tensor outputs
);
#define vxNormalizationLayer vxNormalizationLayer_11
/* keep the backward compatibility with spec 1.1 for vxTensorTransposeNode */
VX_API_ENTRY vx_node VX_API_CALL
vxTensorTransposeNode_11(
vx_graph graph,
vx_tensor inputs,
vx_tensor outputs,
vx_uint32 dim1,
vx_uint32 dim2
);
#define vxTensorTransposeNode vxTensorTransposeNode_11
#ifdef __cplusplus
}
#endif
#endif

97
unified-tina/inc/VX/vx.h Normal file
View File

@ -0,0 +1,97 @@
/*
* Copyright (c) 2012-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* NOTE: Some safety-critical environments may enforce software development
* guidelines (for example MISRA C:2012) to facilitate code quality,
* safety, security, portability and reliability. In order to meet
* such guidelines, developers may modify OpenVX standard header files
* without deviating from the OpenVX specification.
*/
#ifndef _OPENVX_H_
#define _OPENVX_H_
/*!
* \file
* \brief The top level OpenVX Header.
*/
/*! \brief Defines the length of the implementation name string, including the trailing zero.
* \ingroup group_context
*/
#define VX_MAX_IMPLEMENTATION_NAME (64)
/*! \brief Defines the length of a kernel name string to be added to OpenVX, including the trailing zero.
* \ingroup group_kernel
*/
#define VX_MAX_KERNEL_NAME (256)
/*! \brief Defines the length of a message buffer to copy from the log, including the trailing zero.
* \ingroup group_basic_features
*/
#define VX_MAX_LOG_MESSAGE_LEN (1024)
/*! \brief Defines the length of the reference name string, including the trailing zero.
* \ingroup group_reference
* \see vxSetReferenceName
*/
#define VX_MAX_REFERENCE_NAME (64)
#include <VX/vx_vendors.h>
#include <VX/vx_types.h>
#include <VX/vx_kernels.h>
#include <VX/vx_api.h>
#include <VX/vx_nodes.h>
/*! \brief Defines the major version number macro.
* \ingroup group_basic_features
*/
#define VX_VERSION_MAJOR(x) ((x & 0xFFU) << 8)
/*! \brief Defines the minor version number macro.
* \ingroup group_basic_features
*/
#define VX_VERSION_MINOR(x) ((x & 0xFFU) << 0)
/*! \brief Defines the predefined version number for 1.0.
* \ingroup group_basic_features
*/
#define VX_VERSION_1_0 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(0))
/*! \brief Defines the predefined version number for 1.1.
* \ingroup group_basic_features
*/
#define VX_VERSION_1_1 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(1))
/*! \brief Defines the predefined version number for 1.2.
* \ingroup group_basic_features
*/
#define VX_VERSION_1_2 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(2))
/*! \brief Defines the predefined version number for 1.3.
* \ingroup group_basic_features
*/
#define VX_VERSION_1_3 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(3))
/*! \brief Defines the OpenVX Version Number.
* \ingroup group_basic_features
*/
#ifndef VX_VERSION
#define VX_VERSION (VX_VERSION_1_3)
#endif
#endif

3480
unified-tina/inc/VX/vx_api.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,253 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef VX_1_0_1_NAMING_COMPATIBILITY
#define VX_1_0_1_NAMING_COMPATIBILITY
#define VX_TYPE_SCALAR_MAX (VX_TYPE_BOOL + 1)
#define vx_border_mode_e vx_border_e
#define vx_border_mode_policy_e vx_border_policy_e
#define _vx_border_mode_t _vx_border_t
#define vx_border_mode_t vx_border_t
#define VX_ENUM_BORDER_MODE VX_ENUM_BORDER
#define VX_BORDER_MODE_POLICY VX_BORDER_POLICY
#define VX_BORDER_MODE_UNDEFINED VX_BORDER_UNDEFINED
#define VX_BORDER_MODE_CONSTANT VX_BORDER_CONSTANT
#define VX_BORDER_MODE_REPLICATE VX_BORDER_REPLICATE
#define VX_BORDER_MODE_UNSUPPORTED_POLICY_DEFAULT_TO_UNDEFINED VX_BORDER_POLICY_DEFAULT_TO_UNDEFINED
#define VX_BORDER_MODE_UNSUPPORTED_POLICY_RETURN_ERROR VX_BORDER_POLICY_RETURN_ERROR
#define VX_REF_ATTRIBUTE_COUNT VX_REFERENCE_COUNT
#define VX_REF_ATTRIBUTE_TYPE VX_REFERENCE_TYPE
#define VX_REF_ATTRIBUTE_NAME VX_REFERENCE_NAME
#define VX_CONTEXT_ATTRIBUTE_VENDOR_ID VX_CONTEXT_VENDOR_ID
#define VX_CONTEXT_ATTRIBUTE_VERSION VX_CONTEXT_VERSION
#define VX_CONTEXT_ATTRIBUTE_UNIQUE_KERNELS VX_CONTEXT_UNIQUE_KERNELS
#define VX_CONTEXT_ATTRIBUTE_MODULES VX_CONTEXT_MODULES
#define VX_CONTEXT_ATTRIBUTE_REFERENCES VX_CONTEXT_REFERENCES
#define VX_CONTEXT_ATTRIBUTE_IMPLEMENTATION VX_CONTEXT_IMPLEMENTATION
#define VX_CONTEXT_ATTRIBUTE_EXTENSIONS_SIZE VX_CONTEXT_EXTENSIONS_SIZE
#define VX_CONTEXT_ATTRIBUTE_EXTENSIONS VX_CONTEXT_EXTENSIONS
#define VX_CONTEXT_ATTRIBUTE_CONVOLUTION_MAXIMUM_DIMENSION VX_CONTEXT_CONVOLUTION_MAX_DIMENSION
#define VX_CONTEXT_ATTRIBUTE_OPTICAL_FLOW_WINDOW_MAXIMUM_DIMENSION VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION
#define VX_CONTEXT_ATTRIBUTE_IMMEDIATE_BORDER_MODE VX_CONTEXT_IMMEDIATE_BORDER
#define VX_CONTEXT_ATTRIBUTE_UNIQUE_KERNEL_TABLE VX_CONTEXT_UNIQUE_KERNEL_TABLE
#define VX_KERNEL_ATTRIBUTE_PARAMETERS VX_KERNEL_PARAMETERS
#define VX_KERNEL_ATTRIBUTE_NAME VX_KERNEL_NAME
#define VX_KERNEL_ATTRIBUTE_ENUM VX_KERNEL_ENUM
#define VX_KERNEL_ATTRIBUTE_LOCAL_DATA_SIZE VX_KERNEL_LOCAL_DATA_SIZE
#define VX_KERNEL_ATTRIBUTE_LOCAL_DATA_PTR (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x4)
#define VX_NODE_ATTRIBUTE_STATUS VX_NODE_STATUS
#define VX_NODE_ATTRIBUTE_PERFORMANCE VX_NODE_PERFORMANCE
#define VX_NODE_ATTRIBUTE_BORDER_MODE VX_NODE_BORDER
#define VX_NODE_ATTRIBUTE_LOCAL_DATA_SIZE VX_NODE_LOCAL_DATA_SIZE
#define VX_NODE_ATTRIBUTE_LOCAL_DATA_PTR VX_NODE_LOCAL_DATA_PTR
#define VX_PARAMETER_ATTRIBUTE_INDEX VX_PARAMETER_INDEX
#define VX_PARAMETER_ATTRIBUTE_DIRECTION VX_PARAMETER_DIRECTION
#define VX_PARAMETER_ATTRIBUTE_TYPE VX_PARAMETER_TYPE
#define VX_PARAMETER_ATTRIBUTE_STATE VX_PARAMETER_STATE
#define VX_PARAMETER_ATTRIBUTE_REF VX_PARAMETER_REF
#define VX_IMAGE_ATTRIBUTE_WIDTH VX_IMAGE_WIDTH
#define VX_IMAGE_ATTRIBUTE_HEIGHT VX_IMAGE_HEIGHT
#define VX_IMAGE_ATTRIBUTE_FORMAT VX_IMAGE_FORMAT
#define VX_IMAGE_ATTRIBUTE_PLANES VX_IMAGE_PLANES
#define VX_IMAGE_ATTRIBUTE_SPACE VX_IMAGE_SPACE
#define VX_IMAGE_ATTRIBUTE_RANGE VX_IMAGE_RANGE
#define VX_IMAGE_ATTRIBUTE_SIZE VX_IMAGE_SIZE
#define VX_SCALAR_ATTRIBUTE_TYPE VX_SCALAR_TYPE
#define VX_GRAPH_ATTRIBUTE_NUMNODES VX_GRAPH_NUMNODES
#define VX_GRAPH_ATTRIBUTE_STATUS (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_GRAPH) + 0x1)
#define VX_GRAPH_ATTRIBUTE_PERFORMANCE VX_GRAPH_PERFORMANCE
#define VX_GRAPH_ATTRIBUTE_NUMPARAMETERS VX_GRAPH_NUMPARAMETERS
#define VX_LUT_ATTRIBUTE_TYPE VX_LUT_TYPE
#define VX_LUT_ATTRIBUTE_COUNT VX_LUT_COUNT
#define VX_LUT_ATTRIBUTE_SIZE VX_LUT_SIZE
#define VX_DISTRIBUTION_ATTRIBUTE_DIMENSIONS VX_DISTRIBUTION_DIMENSIONS
#define VX_DISTRIBUTION_ATTRIBUTE_OFFSET VX_DISTRIBUTION_OFFSET
#define VX_DISTRIBUTION_ATTRIBUTE_RANGE VX_DISTRIBUTION_RANGE
#define VX_DISTRIBUTION_ATTRIBUTE_BINS VX_DISTRIBUTION_BINS
#define VX_DISTRIBUTION_ATTRIBUTE_WINDOW VX_DISTRIBUTION_WINDOW
#define VX_DISTRIBUTION_ATTRIBUTE_SIZE VX_DISTRIBUTION_SIZE
#define VX_THRESHOLD_ATTRIBUTE_TYPE VX_THRESHOLD_TYPE
#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_VALUE VX_THRESHOLD_THRESHOLD_VALUE
#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_LOWER VX_THRESHOLD_THRESHOLD_LOWER
#define VX_THRESHOLD_ATTRIBUTE_THRESHOLD_UPPER VX_THRESHOLD_THRESHOLD_UPPER
#define VX_THRESHOLD_ATTRIBUTE_TRUE_VALUE VX_THRESHOLD_TRUE_VALUE
#define VX_THRESHOLD_ATTRIBUTE_FALSE_VALUE VX_THRESHOLD_FALSE_VALUE
#define VX_THRESHOLD_ATTRIBUTE_DATA_TYPE VX_THRESHOLD_DATA_TYPE
#define VX_MATRIX_ATTRIBUTE_TYPE VX_MATRIX_TYPE
#define VX_MATRIX_ATTRIBUTE_ROWS VX_MATRIX_ROWS
#define VX_MATRIX_ATTRIBUTE_COLUMNS VX_MATRIX_COLUMNS
#define VX_MATRIX_ATTRIBUTE_SIZE VX_MATRIX_SIZE
#define VX_CONVOLUTION_ATTRIBUTE_ROWS VX_CONVOLUTION_ROWS
#define VX_CONVOLUTION_ATTRIBUTE_COLUMNS VX_CONVOLUTION_COLUMNS
#define VX_CONVOLUTION_ATTRIBUTE_SCALE VX_CONVOLUTION_SCALE
#define VX_CONVOLUTION_ATTRIBUTE_SIZE VX_CONVOLUTION_SIZE
#define VX_PYRAMID_ATTRIBUTE_LEVELS VX_PYRAMID_LEVELS
#define VX_PYRAMID_ATTRIBUTE_SCALE VX_PYRAMID_SCALE
#define VX_PYRAMID_ATTRIBUTE_WIDTH VX_PYRAMID_WIDTH
#define VX_PYRAMID_ATTRIBUTE_HEIGHT VX_PYRAMID_HEIGHT
#define VX_PYRAMID_ATTRIBUTE_FORMAT VX_PYRAMID_FORMAT
#define VX_REMAP_ATTRIBUTE_SOURCE_WIDTH VX_REMAP_SOURCE_WIDTH
#define VX_REMAP_ATTRIBUTE_SOURCE_HEIGHT VX_REMAP_SOURCE_HEIGHT
#define VX_REMAP_ATTRIBUTE_DESTINATION_WIDTH VX_REMAP_DESTINATION_WIDTH
#define VX_REMAP_ATTRIBUTE_DESTINATION_HEIGHT VX_REMAP_DESTINATION_HEIGHT
#define VX_ARRAY_ATTRIBUTE_ITEMTYPE VX_ARRAY_ITEMTYPE
#define VX_ARRAY_ATTRIBUTE_NUMITEMS VX_ARRAY_NUMITEMS
#define VX_ARRAY_ATTRIBUTE_CAPACITY VX_ARRAY_CAPACITY
#define VX_ARRAY_ATTRIBUTE_ITEMSIZE VX_ARRAY_ITEMSIZE
#define VX_DELAY_ATTRIBUTE_TYPE VX_DELAY_TYPE
#define VX_DELAY_ATTRIBUTE_SLOTS VX_DELAY_SLOTS
#define VX_INTERPOLATION_TYPE_AREA VX_INTERPOLATION_AREA
#define VX_INTERPOLATION_TYPE_BILINEAR VX_INTERPOLATION_BILINEAR
#define VX_INTERPOLATION_TYPE_NEAREST_NEIGHBOR VX_INTERPOLATION_NEAREST_NEIGHBOR
#define VX_IMAGE_SIZE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMAGE) + 0x6)
#define VX_META_FORMAT_ATTRIBUTE_DELTA_RECTANGLE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_META_FORMAT) + 0x0)
#define VX_HINT_SERIALIZE (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_HINT) + 0x0)
#define vx_import_type_e vx_memory_type_e
#define VX_ENUM_IMPORT_MEM VX_ENUM_MEMORY_TYPE
#define VX_IMPORT_TYPE_NONE VX_MEMORY_TYPE_NONE
#define VX_IMPORT_TYPE_HOST VX_MEMORY_TYPE_HOST
#define VX_TYPE_OBJECT_MAX (VX_TYPE_WEIGHTS_BIASES_PARAMETER_BASE + 1) /*TODO: check it for OpenVX 1.2*/
#define VX_TYPE_STRUCT_MAX VX_TYPE_KHRONOS_STRUCT_MAX
#define VX_KERNEL_INVALID (VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x0)
#define VX_KERNEL_ACCUMULATE (VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x16)
#define VX_KERNEL_ACCUMULATE_WEIGHTED (VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x17)
#define VX_KERNEL_ACCUMULATE_SQUARE (VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x18)
#define VX_THRESHOLD_THRESHOLD_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x1)
#define VX_THRESHOLD_THRESHOLD_LOWER (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x2)
#define VX_THRESHOLD_THRESHOLD_UPPER (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x3)
#define VX_THRESHOLD_TRUE_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x4)
#define VX_THRESHOLD_FALSE_VALUE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x5)
#define VX_THRESHOLD_DATA_TYPE (VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_THRESHOLD) + 0x6)
#define VX_BIDIRECTIONAL (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_DIRECTION) + 0x2)
typedef vx_status(VX_CALLBACK *vx_kernel_input_validate_f)(vx_node node, vx_uint32 index);
typedef vx_status(VX_CALLBACK *vx_kernel_output_validate_f)(vx_node node, vx_uint32 index, vx_meta_format meta);
typedef struct _vx_delta_rectangle_t {
vx_int32 delta_start_x; /*!< \brief The change in the start x. */
vx_int32 delta_start_y; /*!< \brief The change in the start y. */
vx_int32 delta_end_x; /*!< \brief The change in the end x. */
vx_int32 delta_end_y; /*!< \brief The change in the end y. */
} vx_delta_rectangle_t;
#ifdef __cplusplus
extern "C" {
#endif
VX_API_ENTRY vx_kernel VX_API_CALL vxAddKernel(vx_context context,
const vx_char name[VX_MAX_KERNEL_NAME],
vx_enum enumeration,
vx_kernel_f func_ptr,
vx_uint32 numParams,
vx_kernel_input_validate_f input,
vx_kernel_output_validate_f output,
vx_kernel_initialize_f init,
vx_kernel_deinitialize_f deinit);
VX_API_ENTRY vx_size VX_API_CALL vxComputeImagePatchSize(vx_image image,
const vx_rectangle_t *rect,
vx_uint32 plane_index);
VX_API_ENTRY vx_status VX_API_CALL vxAccessImagePatch(vx_image image,
const vx_rectangle_t *rect,
vx_uint32 plane_index,
vx_imagepatch_addressing_t *addr,
void **ptr,
vx_enum usage);
VX_API_ENTRY vx_status VX_API_CALL vxCommitImagePatch(vx_image image,
const vx_rectangle_t *rect,
vx_uint32 plane_index,
const vx_imagepatch_addressing_t *addr,
const void *ptr);
VX_API_ENTRY vx_status VX_API_CALL vxAccessArrayRange(vx_array arr, vx_size start, vx_size end, vx_size *stride, void **ptr, vx_enum usage);
VX_API_ENTRY vx_status VX_API_CALL vxCommitArrayRange(vx_array arr, vx_size start, vx_size end, const void *ptr);
VX_API_ENTRY vx_status VX_API_CALL vxAccessDistribution(vx_distribution distribution, void **ptr, vx_enum usage);
VX_API_ENTRY vx_status VX_API_CALL vxCommitDistribution(vx_distribution distribution, const void * ptr);
VX_API_ENTRY vx_status VX_API_CALL vxAccessLUT(vx_lut lut, void **ptr, vx_enum usage);
VX_API_ENTRY vx_status VX_API_CALL vxCommitLUT(vx_lut lut, const void *ptr);
VX_API_ENTRY vx_status VX_API_CALL vxReadMatrix(vx_matrix mat, void *array);
VX_API_ENTRY vx_status VX_API_CALL vxWriteMatrix(vx_matrix mat, const void *array);
VX_API_ENTRY vx_status VX_API_CALL vxReadConvolutionCoefficients(vx_convolution conv, vx_int16 *array);
VX_API_ENTRY vx_status VX_API_CALL vxWriteConvolutionCoefficients(vx_convolution conv, const vx_int16 *array);
VX_API_ENTRY vx_status VX_API_CALL vxReadScalarValue(vx_scalar ref, void *ptr);
VX_API_ENTRY vx_status VX_API_CALL vxWriteScalarValue(vx_scalar ref, const void *ptr);
VX_API_ENTRY vx_status VX_API_CALL vxSetRemapPoint(vx_remap table, vx_uint32 dst_x, vx_uint32 dst_y, vx_float32 src_x,vx_float32 src_y);
VX_API_ENTRY vx_status VX_API_CALL vxGetRemapPoint(vx_remap table, vx_uint32 dst_x, vx_uint32 dst_y, vx_float32 *src_x, vx_float32 *src_y);
VX_API_ENTRY vx_threshold VX_API_CALL vxCreateThreshold(vx_context c, vx_enum thresh_type, vx_enum data_type);
VX_API_ENTRY vx_node VX_API_CALL vxAccumulateImageNode(vx_graph graph, vx_image input, vx_image accum);
VX_API_ENTRY vx_node VX_API_CALL vxAccumulateWeightedImageNode(vx_graph graph, vx_image input, vx_scalar alpha, vx_image accum);
VX_API_ENTRY vx_node VX_API_CALL vxAccumulateSquareImageNode(vx_graph graph, vx_image input, vx_scalar shift, vx_image accum);
VX_API_ENTRY vx_status VX_API_CALL vxuAccumulateImage(vx_context context, vx_image input, vx_image accum);
VX_API_ENTRY vx_status VX_API_CALL vxuAccumulateWeightedImage(vx_context context, vx_image input, vx_scalar alpha, vx_image accum);
VX_API_ENTRY vx_status VX_API_CALL vxuAccumulateSquareImage(vx_context context, vx_image input, vx_scalar shift, vx_image accum);
#ifdef __cplusplus
}
#endif
#endif /* VX_1_0_1_NAMING_COMPATIBILITY */

View File

@ -0,0 +1,168 @@
#ifndef _VX_EXT_PROGRAM_H_
#define _VX_EXT_PROGRAM_H_
#include <VX/vx.h>
/***********************************************************************************/
#define VX_512BITS_DISABLE 0
#define VX_512BITS_ADD 0x1
#define VX_512BITS_SUBTRACT 0x2
#define VX_512BITS_ACCUMULATOR 0x3
#define VX_512BITS_TYPE_FLOAT32 0x0
#define VX_512BITS_TYPE_FLOAT16 0x1
#define VX_512BITS_TYPE_SIGNED32 0x2
#define VX_512BITS_TYPE_SIGNED16 0x3
#define VX_512BITS_TYPE_SIGNED8 0x4
#define VX_512BITS_TYPE_UNSIGNED32 0x5
#define VX_512BITS_TYPE_UNSIGNED16 0x6
#define VX_512BITS_TYPE_UNSIGNED8 0x7
#define VX_512BITS_SELECT_SRC0 0
#define VX_512BITS_SELECT_SRC1 1
#define VX_512BITS_SELECT_CONSTANTS 2
typedef union _vx_512bits_bin_t
{
vx_uint8 bin8[16];
vx_uint16 bin16[8];
vx_uint32 bin32[4];
}
vx_512bits_bin_t;
typedef union _vx_512bits_config_t
{
struct
{
vx_uint32 flag0 :2;
vx_uint32 flag1 :2;
vx_uint32 flag2 :2;
vx_uint32 flag3 :2;
vx_uint32 flag4 :2;
vx_uint32 flag5 :2;
vx_uint32 flag6 :2;
vx_uint32 flag7 :2;
vx_uint32 flag8 :2;
vx_uint32 flag9 :2;
vx_uint32 flag10:2;
vx_uint32 flag11:2;
vx_uint32 flag12:2;
vx_uint32 flag13:2;
vx_uint32 flag14:2;
vx_uint32 flag15:2;
}
bin2;
struct
{
vx_uint32 flag0 :4;
vx_uint32 flag1 :4;
vx_uint32 flag2 :4;
vx_uint32 flag3 :4;
vx_uint32 flag4 :4;
vx_uint32 flag5 :4;
vx_uint32 flag6 :4;
vx_uint32 flag7 :4;
}
bin4;
}
vx_512bits_config_t;
typedef struct _vx_512bits_miscconfig_t
{
vx_uint32 post_shift :5; /*[0:4]*/
vx_uint32 resolve1 :3; /*[5:7]*/
vx_uint32 constant_type :3; /*[8:10]*/
vx_uint32 resolve2 :1; /*[11:11]*/
vx_uint32 accu_type :3; /*[12:14]*/
vx_uint32 resolve3 :17;/*[15:31]*/
}
vx_512bits_miscconfig_t;
typedef struct _vx_512bits_t
{
vx_512bits_config_t termConfig;
vx_512bits_config_t aSelect;
vx_512bits_config_t aBin[2];
vx_512bits_config_t bSelect;
vx_512bits_config_t bBin[2];
vx_512bits_miscconfig_t miscConfig;
vx_512bits_bin_t bins[2];
}
vx_512bits_t;
/***********************************************************************************/
typedef enum vx_ext_program_type_e
{
VX_TYPE_PROGRAM = 0x900
}
vx_ext_program_type_e;
typedef enum vx_program_attribute_e
{
VX_PROGRAM_ATTRIBUTE_BUILD_LOG = VX_ATTRIBUTE_BASE(VX_ID_VIVANTE, VX_TYPE_PROGRAM) + 0x0,
}
vx_program_attribute_e;
typedef enum vx_ext_node_attribute_e
{
VX_NODE_ATTRIBUTE_KERNEL_EXECUTION_PARAMETERS = VX_ATTRIBUTE_BASE(VX_ID_VIVANTE, VX_TYPE_NODE) + 0x0,
}
vx_ext_node_attribute_e;
#define VX_MAX_WORK_ITEM_DIMENSIONS 3
typedef struct _vx_kernel_execution_parameters {
vx_uint32 workDim;
vx_size globalWorkOffset[VX_MAX_WORK_ITEM_DIMENSIONS];
vx_size globalWorkScale[VX_MAX_WORK_ITEM_DIMENSIONS];
vx_size localWorkSize[VX_MAX_WORK_ITEM_DIMENSIONS];
vx_size globalWorkSize[VX_MAX_WORK_ITEM_DIMENSIONS];
} vx_kernel_execution_parameters_t;
typedef struct _vx_program * vx_program;
#define VX_BUILD_SUCCESS 0
#define VX_BUILD_NONE -1
#define VX_BUILD_ERROR -2
#define VX_BUILD_IN_PROGRESS -3
#if defined(__cplusplus)
extern "C" {
#endif
VX_API_ENTRY vx_program VX_API_CALL vxCreateProgramWithSource(
vx_context context, vx_uint32 count, const vx_char * strings[], vx_size lengths[]);
VX_API_ENTRY vx_program VX_API_CALL vxCreateProgramWithBinary(
vx_context context, const vx_uint8 * binary, vx_size size);
VX_API_ENTRY vx_status VX_API_CALL vxReleaseProgram(vx_program *program);
VX_API_ENTRY vx_status VX_API_CALL vxBuildProgram(vx_program program, const vx_char * options);
VX_API_ENTRY vx_status VX_API_CALL vxQueryProgram(vx_program program, vx_enum attribute, void *ptr, vx_size size);
VX_API_ENTRY vx_kernel VX_API_CALL vxAddKernelInProgram(
vx_program program, vx_char name[VX_MAX_KERNEL_NAME], vx_enum enumeration, vx_uint32 num_params, vx_kernel_validate_f validate,
vx_kernel_initialize_f initialize, vx_kernel_deinitialize_f deinitialize);
VX_API_ENTRY vx_status VX_API_CALL vxSetNodeUniform(vx_node node, const vx_char * name, vx_size count, void * value);
VX_API_ENTRY vx_status VX_API_CALL vxSetChildGraphOfNode(vx_node node, vx_graph graph);
VX_API_ENTRY vx_graph VX_API_CALL vxGetChildGraphOfNode(vx_node node);
VX_API_ENTRY vx_status VX_API_CALL vxSetArrayAttribute(vx_array array, vx_enum attribute, void *ptr, vx_size size);
VX_API_ENTRY vx_status VX_API_CALL vxSelectKernelSubname(vx_node node, const vx_char * subname);
#if defined(__cplusplus)
}
#endif
#endif /* __GC_VX_PROGRAM_H__ */

View File

@ -0,0 +1,135 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_EXT_TARGET_H_
#define _VX_EXT_TARGET_H_
#include <VX/vx.h>
/*! \file
* \brief The OpenVX Target API Definition
*/
/*! \brief The extension name.
* \ingroup group_target
*/
#define OPENVX_EXT_TARGET "vx_ext_target"
/*! \brief Defines the maximum number of characters in a target string.
* \ingroup group_target
*/
#define VX_MAX_TARGET_NAME (64)
enum vx_ext_target_context_attribute_e {
/*! \brief Used to query the context for the number of active targets. Use a <tt>\ref vx_uint32</tt> parameter. */
VX_CONTEXT_TARGETS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONTEXT) + 0xE,
};
/*! \brief An abstract handle to a target.
* \ingroup group_target
*/
typedef struct _vx_target *vx_target;
/*! \brief The target attributes list
* \ingroup group_target
*/
enum vx_target_attribute_e {
/*! \brief Returns the index of the given target. Use a <tt>\ref vx_uint32</tt> parameter.*/
VX_TARGET_ATTRIBUTE_INDEX = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TARGET) + 0x0,
/*! \brief Returns the name of the given target in the format "vendor.vendor_string".
* Use a <tt>\ref vx_char</tt>[<tt>\ref VX_MAX_TARGET_NAME</tt>] array
*/
VX_TARGET_ATTRIBUTE_NAME = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TARGET) + 0x1,
/*! \brief Returns the number of kernels that the target is capable of processing.
* This is then used to allocate a table which is then filled when <tt>\ref vxQueryTarget</tt>
* is called with <tt>\ref VX_TARGET_ATTRIBUTE_KERNELTABLE</tt>.
* Use a <tt>\ref vx_uint32</tt> parameter.
*/
VX_TARGET_ATTRIBUTE_NUMKERNELS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TARGET) + 0x2,
/*! \brief Returns the table of all the kernels that a given target can execute.
* Use a <tt>vx_kernel_info_t</tt> array.
* \pre You must call <tt>\ref vxQueryTarget</tt> with <tt>\ref VX_TARGET_ATTRIBUTE_NUMKERNELS</tt>
* to compute the necessary size of the array.
*/
VX_TARGET_ATTRIBUTE_KERNELTABLE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TARGET) + 0x3,
};
#if defined(__cplusplus)
extern "C" {
#endif
/*! \brief Used to retrieve a target reference by the index of the target.
* \param [in] context The reference to the overall context.
* \param [in] index The index of the target to get a reference to.
* \return <tt>\ref vx_target</tt>
* \retval 0 Invalid index.
* \retval * A target reference.
* \note Use <tt>\ref vxQueryContext</tt> with <tt>\ref VX_CONTEXT_NUMTARGETS</tt> to retrieve the upper limit of targets.
* \ingroup group_target
*/
VX_API_ENTRY vx_target VX_API_CALL vxGetTargetByIndex(vx_context context, vx_uint32 index);
/*! \brief Used to get a reference to named target when the name is known beforehand.
* \param [in] context The reference to the overall context.
* \param [in] name The target string name.
* \return <tt>\ref vx_target</tt>
* \retval 0 Invalid index.
* \retval * A target reference.
* \ingroup group_target
*/
VX_API_ENTRY vx_target VX_API_CALL vxGetTargetByName(vx_context context, const vx_char *name);
/*! \brief Releases a reference to a target object.
* The object may not be garbage collected until its total reference count is zero.
* \param [in] target The pointer to the target to release.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors.
* \retval VX_ERROR_INVALID_REFERENCE If target is not a <tt>\ref vx_target</tt>.
* \note After returning from this function the reference will be zeroed.
* \ingroup group_target
*/
VX_API_ENTRY vx_status VX_API_CALL vxReleaseTarget(vx_target *target);
/*! \brief Used to query the target about it's properties.
* \param [in] target The reference to the target.
* \param [in] attribute The <tt>\ref vx_target_attribute_e</tt> value to query for.
* \param [out] ptr The location at which the resulting value will be stored.
* \param [in] size The size of the container to which ptr points.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \pre <tt>\ref vxGetTargetByName</tt> or <tt>\ref vxGetTargetByIndex</tt>
* \ingroup group_target
*/
VX_API_ENTRY vx_status VX_API_CALL vxQueryTarget(vx_target target, vx_enum attribute, void *ptr, vx_size size);
/*! \brief Used to assign target affinity to a node.
* \note This assignment overrides implementation chosen behavior.
* \param [in] node The node reference to assign affinity to.
* \param [in] target The reference to the target to execute the Node on.
* \pre <tt>\ref vxGetTargetByName</tt> or <tt>\ref vxGetTargetByIndex</tt>
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \ingroup group_target
* \pre <tt>vxCreateGenericNode</tt> or some other node creation function.
* \retval VX_ERROR_INVALID_REFERENCE Either node or target was not a valid reference.
* \retval VX_ERROR_NOT_SUPPORTED The node can not be executed on that target.
*/
VX_API_ENTRY vx_status VX_API_CALL vxAssignNodeAffinity(vx_node node, vx_target target);
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -0,0 +1,293 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_HELPER_H_
#define _VX_HELPER_H_
#include <VX/vx.h>
/*! \file
* \brief The OpenVX Helper Library Interface.
*
* \defgroup group_helper OpenVX Helper
* \brief The helper is an non-standardized set of convenience constructs for OpenVX.
* \details These functions use only the OpenVX API in order to implement their
* functionality. As such structures, objects, defines, typedefs and functions
* defined herein are not part of the OpenVX standard, and are
* included as EXAMPLE code only.
*/
/*! \brief A definition for TAU, or 2*PI.
* \ingroup group_helper
*/
#define VX_TAU 6.28318530717958647692
/*! \brief Maximum number of supported entries.
* \ingroup group_helper
*/
#ifndef VX_MAX_LOG_NUM_ENTRIES
#define VX_MAX_LOG_NUM_ENTRIES (1024)
#endif
#ifndef dimof
/*! \brief A helper macro to determine the number of elements in an array.
* \ingroup group_helper
*/
#define dimof(x) (sizeof(x)/sizeof(x[0]))
#endif
/*! \brief Contains everything needed to abstractly describe a parameter to a kernel. This is used to
* declare kernel parameters at compile time.
* \ingroup group_helper
*/
typedef struct _vx_param_description_t {
vx_enum direction; /*!< \brief From \ref vx_direction_e */
vx_enum data_type; /*!< \brief From \ref vx_type_e */
vx_enum state; /*!< \brief From \ref vx_parameter_state_e */
} vx_param_description_t;
/*! \brief Contains everything needed to abstractly describe a kernel.
* This is used to declare kernels at compile time.
* \ingroup group_helper
*/
typedef struct _vx_kernel_description_t {
/*! \brief The vx_kernel_e enum */
vx_enum enumeration;
/*! \brief The name that kernel will be used with \ref vxGetKernelByName. */
vx_char name[VX_MAX_KERNEL_NAME];
/*! \brief The pointer to the function to execute the kernel */
vx_kernel_f function;
/*! \brief The pointer to the array of parameter descriptors */
vx_param_description_t *parameters;
/*! \brief The number of paraemeters in the array. */
vx_uint32 numParams;
/*! \brief The parameters validator */
vx_kernel_validate_f validate;
/*! \brief The input validator (deprecated in openvx 1.1) */
void* input_validate;
/*! \brief The output validator (deprecated in openvx 1.1) */
void* output_validate;
/*! \brief The initialization function */
vx_kernel_initialize_f initialize;
/*! \brief The deinitialization function */
vx_kernel_deinitialize_f deinitialize;
} vx_kernel_description_t;
/*! \brief A log entry contains the graph reference, a status and a message.
* \ingroup group_helper
*/
typedef struct _vx_log_entry_t {
/*! \brief The status code */
vx_status status;
/*! \brief The reference to which the message and status pertains. */
vx_reference reference;
/*! \brief This indicates if the log entry is valid/active or not. */
vx_enum active;
/*! \brief The message given to the log from OpenVX. This may be an empty string. */
char message[VX_MAX_LOG_MESSAGE_LEN];
} vx_log_entry_t;
/*! \brief The log of a graph
* \ingroup group_helper
*/
typedef struct _vx_log_t {
vx_int32 first; /*!< Inclusive */
vx_int32 last; /*!< Exclusive */
vx_uint32 count; /*!< == VX_MAX_LOG_NUM_ENTRIES */
/*! \brief The set of all log entries. */
vx_log_entry_t entries[VX_MAX_LOG_NUM_ENTRIES];
} vx_log_t;
#define FGETS(str, fh) \
{ \
char* success = fgets(str, sizeof(str), fh); \
if (!success) \
{ \
printf("fgets failed\n"); \
} \
}
#ifdef __cplusplus
extern "C" {
#endif
uint32_t math_gcd(uint32_t a, uint32_t b);
/*! \brief Returns the previous entry of the log. When called consecutively it
* will return the entire log. The log will be cleared by reading it.
* \param [in] ref The reference to filter the log entries against.
* If the context is given, the next entry will be returned.
* \param [out] message A predefined location to store a copy of the log's
* message value.
* This must point to at least <tt>\ref VX_MAX_LOG_MESSAGE_LEN</tt> bytes of characters.
* \return Returns the status of the log entry from <tt>\ref vx_status_e</tt>.
* \ingroup group_helper
* \note The API returns errors oldest to newest order.
* When VX_SUCCESS is returned, the log reading is complete.
*/
vx_status vxGetLogEntry(vx_reference ref, char message[VX_MAX_LOG_MESSAGE_LEN]);
/*! \brief This enables the helper library logging feature to take over the error
* log callback and keep a database of previous log entries.
* \ingroup group_helper
*/
void vxRegisterHelperAsLogReader(vx_context context);
/*!
* \brief A method to construct a node via arbitrary parameters and an enum.
* \param [in] graph The handle to desired graph to add the node to.
* \param [in] kernelenum The \ref vx_kernel_e enum value used to create a node.
* \param [in] params The array of parameter information.
* \param [in] num The number of elements in params.
* \return vx_node
* \retval 0 Indicates a failure.
* \ingroup group_helper
*/
vx_node vxCreateNodeByStructure(vx_graph graph,
vx_enum kernelenum,
vx_reference params[],
vx_uint32 num);
/*! \brief A method to clear out the log for a particular reference, such as a graph.
* \param [in] ref The reference to remove from the log.
* \ingroup group_helper
*/
void vxClearLog(vx_reference ref);
/*! \brief This is used to connect one node parameter to another node parameter
* when the original handles to the data objects are already lost.
* The context determines if a buffer is necessary or can be optimized out.
* \param [in] a The first parameter
* \param [in] b The second parameter
* \note a or b must be an output parameter and other other an input.
* \return Returns a status code.
* \ingroup group_helper
*/
vx_status vxLinkParametersByReference(vx_parameter a, vx_parameter b);
/*! \brief This is used to connect one parameter to another parameter by
* explicity indexing when the handles to the data objects are lost.
* \param [in] node_a The source node to link from.
* \param [in] index_a The index of the \ref vx_parameter to link from.
* \param [in] node_b The sink node to link to.
* \param [in] index_b The index of the \ref vx_parameter to link to.
* \return Returns a status code.
* \ingroup group_helper
*/
vx_status vxLinkParametersByIndex(vx_node node_a, vx_uint32 index_a, vx_node node_b, vx_uint32 index_b);
/*! \brief This helper is used to easily set the affine matrix to a rotation and scale.
* \param [in] matrix The handle to the matrix.
* \param [in] angle The rotation angle in degrees.
* \param [in] scale The scaling value. Values less than one are enlarging.
* \param [in] center_x The center pixel in the x direction.
* \param [in] center_y The center pixel in the y direction.
* \return Returns a \ref vx_status_e enumeration.
* \ingroup group_helper
*/
vx_status vxSetAffineRotationMatrix(vx_matrix matrix,
vx_float32 angle,
vx_float32 scale,
vx_float32 center_x,
vx_float32 center_y);
/*! \brief [Helper] This function changes the points of a rectangle by some
* delta value per coordinate.
* \param [in] rect The rectangle to modify.
* \param [in] dsx The start x delta.
* \param [in] dsy The start y delta.
* \param [in] dex The end x delta.
* \param [in] dey The end y delta.
* \return vx_status
* \retval VX_SUCCESS Modified rectangle.
* \retval VX_ERROR_INVALID_REFERENCE Not a valid rectangle.
* \ingroup group_helper
*/
vx_status vxAlterRectangle(vx_rectangle_t *rect,
vx_int32 dsx,
vx_int32 dsy,
vx_int32 dex,
vx_int32 dey);
/*! \brief Adds a parameter to a graph by indicating the source node, and the
* index of the parameter on the node.
* \param [in] g The graph handle.
* \param [in] n The node handle.
* \param [in] index The index of the parameter on the node.
* \return Returns a \ref vx_status_e enumeration.
* \ingroup group_helper
*/
vx_status vxAddParameterToGraphByIndex(vx_graph g, vx_node n, vx_uint32 index);
#if defined(EXPERIMENTAL_USE_TARGET)
/*! \brief Finds all targets which report that they implement a particular kernel by name.
* \param [in] context The overall context.
* \param [in] kname The name of the kernel to find.
* \param [in,out] targets The array of pointers to character arrays. Each index will
* be modified. If the kernel does not exist on the target, the name will be zeroed.
* If the kernel does exist on the target, the name of the target will be filled in.
* \pre targets must be a preallocated array of vx_char pointers to
* <tt>\ref VX_MAX_TARGET_NAME</tt> characters with number of elements equal to
* the number of targets in the implementation.
* \ingroup group_helper
*/
vx_bool vxFindAllTargetsOfKernelsByName(vx_context context, vx_char kname[VX_MAX_KERNEL_NAME], vx_char *targets[]);
/*! \brief Allocates and returns a list of all available targets in a context.
* \param [in] context The overall context.
* \param [out] targets A pointer to variable to hold the array of target strings.
* \param [out] num_targets A pointer to a variable to hold the number of targets found.
* \ingroup group_helper
*/
vx_bool vxCreateListOfAllTargets(vx_context context, vx_char **targets[], vx_uint32 *num_targets);
/*! \brief Free the array of target name strings.
* \param [in,out] targets The pointer to the variable that holds the array of strings. This variable will be set
* to NULL after this call.
* \param [in] num_targets The number of targets in the system.
* \ingroup group_helper
*/
void vxDestroyListOfAllTargets(vx_char **targets[], vx_uint32 num_targets);
#endif
/*! \brief Find the overlapping rectange between two rectangles.
* \ingroup group_helper
*/
vx_bool vxFindOverlapRectangle(vx_rectangle_t *rect_a, vx_rectangle_t *rect_b, vx_rectangle_t *rect_res);
/*! \brief Read a rectangle-shaped section of an image into a 2D array.
* \ingroup group_helper
*/
void vxReadRectangle(const void *base,
const vx_imagepatch_addressing_t *addr,
const vx_border_t *borders,
vx_df_image type,
vx_uint32 center_x,
vx_uint32 center_y,
vx_uint32 radius_x,
vx_uint32 radius_y,
void *destination);
#ifdef __cplusplus
}
#endif
#endif /* _VX_HELPER_H_ */

View File

@ -0,0 +1,189 @@
/*
* Copyright (c) 2012-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _OPENVX_IMPORT_H_
#define _OPENVX_IMPORT_H_
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \file
* \brief The OpenVX Import API
* part of the OpenVX Export and Import extension API
* and also part of the OpenVX SC deployment feature set.
*/
/*! \brief An enumeration of export uses. See <tt>\ref vxExportObjectsToMemory</tt> and
* <tt>\ref vxImportObjectsFromMemory</tt>
* \ingroup vx_enum_e
*/
#define VX_ENUM_IX_USE 0x18
/*! \brief How to export and import an object
* \ingroup group_import
*/
#define VX_IX_USE_APPLICATION_CREATE (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_IX_USE) + 0x0) /*!< \brief The application will create the object before import. */
/*! \brief How to export and import an object
* \ingroup group_import
*/
#define VX_IX_USE_EXPORT_VALUES (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_IX_USE) + 0x1) /*!< \brief Data values are exported and restored upon import. */
/*! \brief How to export and import an object
* \ingroup group_import
*/
#define VX_IX_USE_NO_EXPORT_VALUES (VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_IX_USE) + 0x2) /*!< \brief Data values are not exported. */
/*=============================================================================
IMPORT
=============================================================================*/
/*! \brief The Import Object. Import is a container of OpenVX objects, which may be retreived
* by name
* \ingroup group_import
*/
typedef struct _vx_import *vx_import;
/*! \brief The Object Type Enumeration for import.
* \ingroup group_import
*/
#define VX_TYPE_IMPORT 0x814/*!< \brief A <tt>\ref vx_import</tt>. */
/*! \brief Imports objects into a context from a vendor-specific format in memory.\n
*
* \details This function imports objects from a memory blob previously created using <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].\n
* A pointer to memory is given where a list of references is stored, together with the list
* of uses which describes how the references are used. The number of references given and the
* list of uses must match that given upon export, or this function will not be sucessful[*REQ*].\n
* The *uses* array specifies how the objects in the corresponding *refs* array will be imported:
* - <tt>\ref VX_IX_USE_APPLICATION_CREATE</tt>\n
* The application must create the object and supply the reference; the
* meta-data of the object must match exactly the meta-data of the object when it was exported,
* except that the name need not match[*REQ*].\n
* If the supplied reference has a different name to that stored, the supplied name is used[*REQ*].
* - <tt>\ref VX_IX_USE_EXPORT_VALUES</tt>\n
* The implementation will create the object and set the data in it[*REQ*].\n
* Any data not defined at the time of export of the object will be set to a default value (zero in the
* absence of any other definition) upon import[*REQ*].
* - <tt>\ref VX_IX_USE_NO_EXPORT_VALUES</tt>\n
* The implementation will create the object and the importing application will set values as applicable[*REQ*].
*
* References are obtained from the import API for those objects whose references were listed at the time of export.
* These are not the same objects; they are equivalent objects created by the framework at import time.
* The implementation guarantees that references will be available and valid for all objects listed at the time
* of export, or the import will fail[*REQ*].\n
* The import operation will fail if more than one object whose reference is listed at *refs*
* has been given the same non-zero length name (via <tt>\ref vxSetReferenceName</tt>)[*REQ*].\n
* The import will be unsuccessful if any of the parameters supplied is NULL[*REQ*].\n
* After completion of the function the memory at *ptr* may be deallocated by the application as it will
* not be used by any of the created objects[*REQ*].\n
* Any delays imported with graphs for which they are registered for auto-aging remain registered
* for auto-aging[*REQ*].\n
* After import, a graph must execute with exactly the same effect with respect to its visible parameters
* as before export[*REQ*].
* \note The *refs* array must be the correct length to hold all references of the import; this will be the same length
* that was supplied at the time of export. Only references for objects created by the application, where the
* corresponding *uses* entry is <tt>\ref VX_IX_USE_APPLICATION_CREATE</tt> should be filled in by the application;
* all other entries will be supplied by the framework and may be initialised by the application to NULL. The *uses* array
* must have the identical length and content as given at the time of export, and the value of *numrefs* must also match;
* these measures increase confidence that the import contains the correct data.
* \note Graph parameters may be changed after import by using the <tt>\ref vxSetGraphParameterByIndex</tt> API, and
* images may also be changed by using the <tt>\ref vxSwapImageHandle</tt> API.
* When <tt>\ref vxSetGraphParameterByIndex</tt> is used, the framework will check that the new parameter is of the
* correct type to run with the graph, which cannot be re-verified. If the reference supplied is not suitable, an error
* will be returned, but there may be circumstances where changing graph parameters for unsuitable ones is not detected
* and could lead to implementation-dependent behaviour; one such circumstance is when the new parameters are images
* corresponding to overlapping regions of interest. The user should avoid these circumstances.
* In other words,
* - The meta data of the new graph parameter must match the meta data of the graph parameter it replaces [*REQ*].
* - A graph parameter must not be NULL [*REQ*].
* \param [in] context context into which to import objects, must be valid [*REQ*].
* \param [in] numrefs number of references to import, must match export[*REQ*].
* \param [in,out] refs references imported or application-created data which must match
* meta-data of the export[*REQ*]
* \param [in] uses how to import the references, must match export values[*REQ*]
* \param [in] ptr pointer to binary buffer containing a valid binary export[*REQ*]
* \param [in] length number of bytes at \*ptr, i.e. the length of the export[*REQ*]
* \return A <tt>\ref vx_import</tt>[*REQ*].
* Calling <tt>\ref vxGetStatus</tt> with the vx_import as a parameter will return VX_SUCCESS if the
* function was successful[*REQ*].\n
* Another value is given to indicate that there was an error[*REQ*].\n
* An implementation may provide several different error codes to give useful diagnostic information
* in the event of failure to import objects, but these are not required to indicate
* possibly recovery mechanisms, and for safety critical use assume errors are not recoverable.
* \post <tt>\ref vxReleaseImport</tt> is used to release the import object.
* \post Use <tt>\ref vxReleaseReference</tt> or an appropriate specific release function to release
* the references in the array refs when they are no longer required.
* \ingroup group_import
*/
VX_API_ENTRY vx_import VX_API_CALL vxImportObjectsFromMemory(
vx_context context,
vx_size numrefs,
vx_reference *refs,
const vx_enum * uses,
const vx_uint8 * ptr,
vx_size length);
/*! \brief Releases an import object when no longer required.\n
* \details This function releases the reference to the import object [*REQ*].\n
* Other objects including those imported at the time of creation of the import object are unaffected[*REQ*].\n
* \param [in,out] import The pointer to the reference to the import object[*REQ*].
* \post After returning sucessfully from this function the reference is zeroed[*REQ*].
* \return A <tt>\ref vx_status</tt> value.
* \retval VX_SUCCESS If no errors occurred and the import was sucessfully released[*REQ*].\n
* An error is indicated when the return value is not VX_SUCCESS[*REQ*].\n
* An implementation may provide several different return values to give useful diagnostic
* information in the event of failure to export, but these are not required to indicate
* possibly recovery mechanisms, and for safety critical use assume errors are not recoverable.
* \pre <tt>\ref vxImportObjectsFromMemory</tt> is used to create an import object.
* \ingroup group_import
*/
VX_API_ENTRY vx_status VX_API_CALL vxReleaseImport(vx_import *import);
/*! \brief Get a reference from the import object by name.\n
*
* \details All accessible references of the import object created using <tt>\ref vxImportObjectsFromMemory</tt> are
* in the array *refs*, which is populated partly by the application before import, and partly by the
* framework. However, it may be more convenient to access the references in the import object without
* referring to this array, for example if the import object is passed as a parameter to another function.
* In this case, references may be retreived by name, assuming that <tt>\ref vxSetReferenceName</tt>
* was called to assign a name to the reference.
* This function searches the given import for the given name and returns the associated reference[*REQ*].\n
* The reference may have been named either before export or after import[*REQ*].\n
* If more than one reference exists in the import with the given name, this is an error[*REQ*].\n
* Only references in the array *refs* after calling <tt>\ref vxImportObjectsFromMemory</tt> may be retrieved
* using this function[*REQ*].\n
* A reference to a named object may be obtained from a valid import object using this API even if all other
* references to the object have been released[*REQ*].
* \param [in] import The import object in which to find the name; the function will fail if this parameter
* is not valid[*REQ*].
* \param [in] name The name to find, points to a string of at least one and less than VX_MAX_REFERENCE_NAME bytes
* followed by a zero byte; the function will fail if this is not valid[*REQ*].
* \return A <tt>\ref vx_reference</tt>[*REQ*].\n
* Calling <tt>\ref vxGetStatus</tt> with the reference as a parameter will return VX_SUCCESS if the function
* was successful[*REQ*].\n
* Another value is given to indicate that there was an error[*REQ*].\n
* On success, the reference count of the object in question is incremented[*REQ*].\n
* An implementation may provide several different error codes to give useful diagnostic information
* in the event of failure to retrieve a reference, but these are not required to indicate
* possibly recovery mechanisms, and for safety critical use assume errors are not recoverable.
* \pre <tt>\ref vxSetReferenceName</tt> was used to name the reference.
* \post use <tt>ref vxReleaseReference</tt> or appropriate specific release function to release a reference
* obtained by this method.
* \ingroup group_import
*/
VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByName(vx_import import, const vx_char *name);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,547 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _OPENVX_KERNELS_H_
#define _OPENVX_KERNELS_H_
/*!
* \file
* \brief The list of supported kernels in the OpenVX standard.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \brief The standard list of available libraries
* \ingroup group_kernel
*/
enum vx_library_e {
/*! \brief The base set of kernels as defined by Khronos. */
VX_LIBRARY_KHR_BASE = 0x0,
};
/*!
* \brief The standard list of available vision kernels.
*
* Each kernel listed here can be used with the <tt>\ref vxGetKernelByEnum</tt> call.
* When programming the parameters, use
* \arg <tt>\ref VX_INPUT</tt> for [in]
* \arg <tt>\ref VX_OUTPUT</tt> for [out]
* \arg <tt>\ref VX_BIDIRECTIONAL</tt> for [in,out]
*
* When programming the parameters, use
* \arg <tt>\ref VX_TYPE_IMAGE</tt> for a <tt>\ref vx_image</tt> in the size field of <tt>\ref vxGetParameterByIndex</tt> or <tt>\ref vxSetParameterByIndex</tt> * \arg <tt>\ref VX_TYPE_ARRAY</tt> for a <tt>\ref vx_array</tt> in the size field of <tt>\ref vxGetParameterByIndex</tt> or <tt>\ref vxSetParameterByIndex</tt> * \arg or other appropriate types in \ref vx_type_e.
* \ingroup group_kernel
*/
enum vx_kernel_e {
/*!
* \brief The Color Space conversion kernel.
* \details The conversions are based on the <tt>\ref vx_df_image_e</tt> code in the images.
* \see group_vision_function_colorconvert
*/
VX_KERNEL_COLOR_CONVERT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1,
/*!
* \brief The Generic Channel Extraction Kernel.
* \details This kernel can remove individual color channels from an interleaved
* or semi-planar, planar, sub-sampled planar image. A client could extract
* a red channel from an interleaved RGB image or do a Luma extract from a
* YUV format.
* \see group_vision_function_channelextract
*/
VX_KERNEL_CHANNEL_EXTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2,
/*!
* \brief The Generic Channel Combine Kernel.
* \details This kernel combine multiple individual planes into a single
* multiplanar image of the type specified in the output image.
* \see group_vision_function_channelcombine
*/
VX_KERNEL_CHANNEL_COMBINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3,
/*! \brief The Sobel 3x3 Filter Kernel.
* \see group_vision_function_sobel3x3
*/
VX_KERNEL_SOBEL_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x4,
/*!
* \brief The Magnitude Kernel.
* \details This kernel produces a magnitude plane from two input gradients.
* \see group_vision_function_magnitude
*/
VX_KERNEL_MAGNITUDE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x5,
/*!
* \brief The Phase Kernel.
* \details This kernel produces a phase plane from two input gradients.
* \see group_vision_function_phase
*/
VX_KERNEL_PHASE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x6,
/*!
* \brief The Scale Image Kernel.
* \details This kernel provides resizing of an input image to an output image.
* The scaling factor is determined but the relative sizes of the input and
* output.
* \see group_vision_function_scale_image
*/
VX_KERNEL_SCALE_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x7,
/*! \brief The Table Lookup kernel
* \see group_vision_function_lut
*/
VX_KERNEL_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x8,
/*! \brief The Histogram Kernel.
* \see group_vision_function_histogram
*/
VX_KERNEL_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x9,
/*! \brief The Histogram Equalization Kernel.
* \see group_vision_function_equalize_hist
*/
VX_KERNEL_EQUALIZE_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xA,
/*! \brief The Absolute Difference Kernel.
* \see group_vision_function_absdiff
*/
VX_KERNEL_ABSDIFF = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xB,
/*! \brief The Mean and Standard Deviation Kernel.
* \see group_vision_function_meanstddev
*/
VX_KERNEL_MEAN_STDDEV = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xC,
/*! \brief The Threshold Kernel.
* \see group_vision_function_threshold
*/
VX_KERNEL_THRESHOLD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xD,
/*! \brief The Integral Image Kernel.
* \see group_vision_function_integral_image
*/
VX_KERNEL_INTEGRAL_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xE,
/*! \brief The dilate kernel.
* \see group_vision_function_dilate_image
*/
VX_KERNEL_DILATE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xF,
/*! \brief The erode kernel.
* \see group_vision_function_erode_image
*/
VX_KERNEL_ERODE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x10,
/*! \brief The median image filter.
* \see group_vision_function_median_image
*/
VX_KERNEL_MEDIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x11,
/*! \brief The box filter kernel.
* \see group_vision_function_box_image
*/
VX_KERNEL_BOX_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x12,
/*! \brief The gaussian filter kernel.
* \see group_vision_function_gaussian_image
*/
VX_KERNEL_GAUSSIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x13,
/*! \brief The custom convolution kernel.
* \see group_vision_function_custom_convolution
*/
VX_KERNEL_CUSTOM_CONVOLUTION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x14,
/*! \brief The gaussian image pyramid kernel.
* \see group_vision_function_gaussian_pyramid
*/
VX_KERNEL_GAUSSIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x15,
/*! \brief The min and max location kernel.
* \see group_vision_function_minmaxloc
*/
VX_KERNEL_MINMAXLOC = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x19,
/*! \brief The bit-depth conversion kernel.
* \see group_vision_function_convertdepth
*/
VX_KERNEL_CONVERTDEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1A,
/*! \brief The Canny Edge Detector.
* \see group_vision_function_canny
*/
VX_KERNEL_CANNY_EDGE_DETECTOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1B,
/*! \brief The Bitwise And Kernel.
* \see group_vision_function_and
*/
VX_KERNEL_AND = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1C,
/*! \brief The Bitwise Inclusive Or Kernel.
* \see group_vision_function_or
*/
VX_KERNEL_OR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1D,
/*! \brief The Bitwise Exclusive Or Kernel.
* \see group_vision_function_xor
*/
VX_KERNEL_XOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1E,
/*! \brief The Bitwise Not Kernel.
* \see group_vision_function_not
*/
VX_KERNEL_NOT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1F,
/*! \brief The Pixelwise Multiplication Kernel.
* \see group_vision_function_mult
*/
VX_KERNEL_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x20,
/*! \brief The Addition Kernel.
* \see group_vision_function_add
*/
VX_KERNEL_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x21,
/*! \brief The Subtraction Kernel.
* \see group_vision_function_sub
*/
VX_KERNEL_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x22,
/*! \brief The Warp Affine Kernel.
* \see group_vision_function_warp_affine
*/
VX_KERNEL_WARP_AFFINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x23,
/*! \brief The Warp Perspective Kernel.
* \see group_vision_function_warp_perspective
*/
VX_KERNEL_WARP_PERSPECTIVE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x24,
/*! \brief The Harris Corners Kernel.
* \see group_vision_function_harris
*/
VX_KERNEL_HARRIS_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x25,
/*! \brief The FAST Corners Kernel.
* \see group_vision_function_fast
*/
VX_KERNEL_FAST_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x26,
/*! \brief The Optical Flow Pyramid (LK) Kernel.
* \see group_vision_function_opticalflowpyrlk
*/
VX_KERNEL_OPTICAL_FLOW_PYR_LK = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x27,
/*! \brief The Remap Kernel.
* \see group_vision_function_remap
*/
VX_KERNEL_REMAP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x28,
/*! \brief The Half Scale Gaussian Kernel.
* \see group_vision_function_scale_image
*/
VX_KERNEL_HALFSCALE_GAUSSIAN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x29,
VX_KERNEL_MAX_1_0, /*!< \internal Used for VX1.0 bounds checking in the conformance test. */
/* kernel added in OpenVX 1.1 */
/*! \brief The Laplacian Image Pyramid Kernel.
* \see group_vision_function_laplacian_pyramid
*/
VX_KERNEL_LAPLACIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2A,
/*! \brief The Laplacian Pyramid Reconstruct Kernel.
* \see group_vision_function_laplacian_pyramid
*/
VX_KERNEL_LAPLACIAN_RECONSTRUCT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2B,
/*! \brief The Non Linear Filter Kernel.
* \see group_vision_function_nonlinear_filter
*/
VX_KERNEL_NON_LINEAR_FILTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2C,
VX_KERNEL_MAX_1_1, /*!< \internal Used for VX1.1 bounds checking in the conformance test. */
/* kernel added in OpenVX 1.2 */
/*! \brief The Match Template Kernel.
* \see group_vision_match_template
*/
VX_KERNEL_MATCH_TEMPLATE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2D,
/*! \brief The LBP Kernel.
* \see group_lbp
*/
VX_KERNEL_LBP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2E,
/*! \brief The hough lines probability Kernel.
* \see group_vision_hough_lines_p
*/
VX_KERNEL_HOUGH_LINES_P = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2F,
/*! \brief The tensor multiply Kernel.
* \see group_vision_function_tensor_multiply
*/
VX_KERNEL_TENSOR_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x30,
/*! \brief The tensor add Kernel.
* \see group_vision_function_tensor_add
*/
VX_KERNEL_TENSOR_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x31,
/*! \brief The tensor subtract Kernel.
* \see group_vision_function_tensor_subtract
*/
VX_KERNEL_TENSOR_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x32,
/*! \brief The tensor table look up Kernel.
* \see group_vision_function_tensor_tablelookup
*/
VX_KERNEL_TENSOR_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x33,
/*! \brief The tensor transpose Kernel.
* \see group_vision_function_tensor_transpose
*/
VX_KERNEL_TENSOR_TRANSPOSE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x34,
/*! \brief The tensor convert depth Kernel.
* \see group_vision_function_tensor_convert_depth
*/
VX_KERNEL_TENSOR_CONVERT_DEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x35,
/*! \brief The tensor matrix multiply Kernel.
* \see group_vision_function_tensor_matrix_multiply
*/
VX_KERNEL_TENSOR_MATRIX_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x36,
/*! \brief The data object copy kernel.
* \see group_vision_function_copy
*/
VX_KERNEL_COPY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x37,
/*! \brief The non-max suppression kernel.
* \see group_vision_function_nms
*/
VX_KERNEL_NON_MAX_SUPPRESSION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x38,
/*! \brief The scalar operation kernel.
* \see group_control_flow
*/
VX_KERNEL_SCALAR_OPERATION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x39,
/*! \brief The HOG features kernel.
* \see group_vision_function_hog
*/
VX_KERNEL_HOG_FEATURES = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3A,
/*! \brief The HOG Cells kernel.
* \see group_vision_function_hog
*/
VX_KERNEL_HOG_CELLS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3B,
/*! \brief The bilateral filter kernel.
* \see group_vision_function_bilateral_filter
*/
VX_KERNEL_BILATERAL_FILTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3C,
/*! \brief The select kernel.
* \see group_control_flow
*/
VX_KERNEL_SELECT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3D,
/* insert new kernels here */
/*! \brief The max kernel.
* \see group_vision_function_max
*/
VX_KERNEL_MAX = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3E,
/*! \brief The min kernel.
* \see group_vision_function_min
*/
VX_KERNEL_MIN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3F,
/*! \brief The weigthed average kernel.
* \see group_vision_function_weighted_average
*/
VX_KERNEL_WEIGHTED_AVERAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x40,
/* insert new kernels here */
VX_KERNEL_NN_CONVOLUTION_RELU_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x0,
VX_KERNEL_NN_CONVOLUTION_RELU_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1,
VX_KERNEL_NN_FULLY_CONNECTED_RELU_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2,
//VX_KERNEL_NN_SOFTMAX_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x3,
//VX_KERNEL_NN_NORMALIZATION_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x4,
VX_KERNEL_NN_LRN_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x3,
//VX_KERNEL_NN_NORMALIZE_IMAGE_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x4,
//VX_KERNEL_NN_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x7,
//VX_KERNEL_NN_ACTIVATION_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x9,
VX_KERNEL_NN_LEAKY = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x4,
VX_KERNEL_NN_BATCH_NORM = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x5,
VX_KERNEL_NN_RPN = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x6,
//VX_KERNEL_NN_ROIPOOL = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xD,
VX_KERNEL_NN_CONCAT2_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x7,
//VX_KERNEL_NN_CONVOLUTION_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xF,
VX_KERNEL_NN_CONCATINDEFINITE_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x8,
VX_KERNEL_NN_REORG_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x9,
//VX_KERNEL_NN_DECONVOLUTION_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x12,
VX_KERNEL_NN_TENSOR_DIV = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xA,
VX_KERNEL_NN_L2NORMALIZE_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xB,
VX_KERNEL_NN_TENSOR_COPY = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xC,
VX_KERNEL_NN_CONVOLUTION_RELU_POOLING_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xD,
VX_KERNEL_NN_POOLING_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xE,
VX_KERNEL_NN_TENSOR_REDUCE_SUM = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0xF,
VX_KERNEL_NN_TENSOR_PAD = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x10,
VX_KERNEL_NN_LSTM_UNIT = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x11,
VX_KERNEL_NN_LSTM_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x12,
VX_KERNEL_NN_REORG2_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x13,
VX_KERNEL_NN_TENSOR_ROUNDING = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x14,
VX_KERNEL_NN_HASH_LUT_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x15,
VX_KERNEL_NN_LSH_PROJECTION_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x16,
VX_KERNEL_NN_TENSOR_RESHPE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x17,
VX_KERNEL_NN_LUT2_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x18,
VX_KERNEL_NN_TENSOR_SCALE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x19,
VX_KERNEL_NN_RNN_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1A,
VX_KERNEL_NN_SOFTMAX2_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1B,
VX_KERNEL_NN_SVDF_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1C,
VX_KERNEL_NN_NORMALIZATION_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1D,
VX_KERNEL_NN_TENSOR_REVERSE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1E,
VX_KERNEL_NN_TENSOR_TRANSPOSE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x1F,
VX_KERNEL_NN_TENSOR_MEAN = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x20,
VX_KERNEL_NN_TENSOR_SQUEEZE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x21,
VX_KERNEL_NN_TENSOR_STRIDE_SLICE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x22,
VX_KERNEL_NN_TENSOR_PAD2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x23,
VX_KERNEL_NN_YUV2RGB_SCALE = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x24,
VX_KERNEL_NN_PRELU = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x25,
VX_KERNEL_NN_GRU_UNIT_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x26,
VX_KERNEL_NN_GRU_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x27,
VX_KERNEL_NN_CONV_LSTM_UNIT_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x28,
VX_KERNEL_NN_CONV_LSTM_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x29,
VX_KERNEL_NN_FULLY_CONNECTED_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2A,
VX_KERNEL_NN_L2NORMALIZE_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2B,
VX_KERNEL_NN_CONVOLUTION_RELU_POOLING_ADD_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2C,
VX_KERNEL_NN_LUT_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2D,
VX_KERNEL_NN_CONVOLUTION_RELU_POOLING_MULTIPLY_LAYER2 = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2E,
VX_KERNEL_NN_BATCH_GEMM = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x2F,
VX_KERNEL_NN_CONV_3D_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x30,
VX_KERNEL_NN_DECONV_3D_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x31,
VX_KERNEL_STREAM_PROCESSOR = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x32,
VX_KERNEL_NN_BATCH_GEMM_RELU_POOLING_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x33,
VX_KERNEL_NN_FUSED_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x34,
VX_KERNEL_NN_CONVOLUTION_RELU_POOLING_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x35,
VX_KERNEL_NN_LAYER_NORMALIZATION_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x36,
VX_KERNEL_NN_INSTANCE_NORMALIZATION_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x37,
VX_KERNEL_NN_GROUP_NORMALIZATION_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x38,
VX_KERNEL_NN_LOGICAL_OPS_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x39,
VX_KERNEL_NN_LOGICAL_NOT_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x40,
VX_KERNEL_NN_RELATIONAL_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x41,
VX_KERNEL_NN_TENSOR_REDUCE_MAX = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x42,
VX_KERNEL_NN_MAXIMUM_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x43,
VX_KERNEL_NN_MINIMUM_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x44,
VX_KERNEL_NN_TENSOR_SELECT_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x45,
VX_KERNEL_NN_REDUCE_SUM_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x46,
VX_KERNEL_NN_GRU_CELL_ACTIVATION_Z_H_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x47,
VX_KERNEL_NN_GRU_CELL_H_TIMES_ACTIVATION_R_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x48,
VX_KERNEL_NN_GRU_CELL_RESET_AFTER_ACTIVATION_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x49,
VX_KERNEL_NN_LSTM_ACTIVATION_SP_LAYER = VX_KERNEL_BASE(VX_ID_VIVANTE, VX_LIBRARY_KHR_BASE) + 0x50,
VX_KERNEL_MAX_1_2, /*!< \internal Used for VX1.2 bounds checking in the conformance test. */
};
#ifdef __cplusplus
}
#endif
#endif /* _OPEN_VISION_LIBRARY_KERNELS_H_ */

View File

@ -0,0 +1,8 @@
#ifndef _VX_KHR_CNN_H_
#define _VX_KHR_CNN_H_
#define OPENVX_KHR_CNN "vx_khr_cnn"
#include <VX/vx_khr_nn.h>
#endif

View File

@ -0,0 +1,374 @@
#ifndef __VX_KHR_COMPATIBLE_H__
#define __VX_KHR_COMPATIBLE_H__
/*
VX_DECONVOLUTION_WEIGHT_LAYOUT_COMPATIBLE_KHRONOS is used to distingush deconvolution weight layout
[value]
0: weight_layout is whnc
1: weight_layout is whcn
*/
#ifndef VX_DECONVOLUTION_WEIGHT_LAYOUT_COMPATIBLE_KHRONOS
#define VX_DECONVOLUTION_WEIGHT_LAYOUT_COMPATIBLE_KHRONOS 1
#endif
/*
VX_CONVERT_POLICY_WRAP_ENABLE is used to differentiate two overflow_policys(VX_CONVERT_POLICY_WRAP and VX_CONVERT_POLICY_SAT)
[value]
0: both overflow_policys considered as VX_CONVERT_POLICY_SAT
1: overflow_policy is determined by arguments.
*/
#ifndef VX_CONVERT_POLICY_WRAP_ENABLE
#define VX_CONVERT_POLICY_WRAP_ENABLE 1
#endif
#ifndef VX_13_NN_COMPATIBLITY
#define VX_13_NN_COMPATIBLITY 1
#endif
/*
VX_L2NORM_AXIS_PARAMETER_SUPPORT is used to declare that L2NORMALIZE can support axis parameter
[value]
0: not support
1: support
*/
#ifndef VX_L2NORM_AXIS_PARAMETER_SUPPORT
#define VX_L2NORM_AXIS_PARAMETER_SUPPORT 1
#endif
/*
VX_SOFTMAX_AXIS_PARAMETER_SUPPORT is used to declare that SOFTAMX can support axis parameter
[value]
0: not support
1: support
*/
#ifndef VX_SOFTMAX_AXIS_PARAMETER_SUPPORT
#define VX_SOFTMAX_AXIS_PARAMETER_SUPPORT 1
#endif
/*
VX_NORMALIZATION_AXIS_PARAMETER_SUPPORT is used to declare that NORMALIZATION can support axis parameter
[value]
0: not support
1: support
*/
#ifndef VX_NORMALIZATION_AXIS_PARAMETER_SUPPORT
#define VX_NORMALIZATION_AXIS_PARAMETER_SUPPORT 1
#endif
/*
VX_ACTIVATION_EXT_SUPPORT is used to declare that ACTIVATION can support swish and hswish
[value]
0: not support
1: support
*/
#ifndef VX_ACTIVATION_EXT_SUPPORT
#define VX_ACTIVATION_EXT_SUPPORT 1
#endif
/*
VX_HARDWARE_CAPS_PARAMS_EXT_SUPPORT is used to query more hardware parameter such as shader sub-group size.
[value]
0: not support
1: support
*/
#ifndef VX_HARDWARE_CAPS_PARAMS_EXT_SUPPORT
#define VX_HARDWARE_CAPS_PARAMS_EXT_SUPPORT 1
#endif
/*
VX_VA40_EXT_SUPPORT is used to declare that openvx can support VA40.
[value]
0: not support
1: support
*/
#ifndef VX_VA40_EXT_SUPPORT
#define VX_VA40_EXT_SUPPORT 0
#endif
/*
VX_USER_LOOKUP_TABLE_SUPPORT is used to declare that openvx can support user lookuptable.
[value]
0: not support
1: support
*/
#ifndef VX_USER_LOOKUP_TABLE_SUPPORT
#define VX_USER_LOOKUP_TABLE_SUPPORT 1
#endif
/*
VX_PRELOAD_CONST_TENSOR_SUPPORT is used to declare that openvx can support preload weight/bias and const tensor
[value]
0: not support
1: support(NN conv and TP FC weightbias, and SH const tensor)
*/
#ifndef VX_PRELOAD_CONST_TENSOR_SUPPORT
#define VX_PRELOAD_CONST_TENSOR_SUPPORT 1
#endif
/*
VX_CREATE_TENSOR_SUPPORT_PHYSICAL is used to declare that openvx can support physical address for vxCreateTensorFromHandle
[value]
0: not support
1: support
*/
#ifndef VX_CREATE_TENSOR_SUPPORT_PHYSICAL
#define VX_CREATE_TENSOR_SUPPORT_PHYSICAL 1
#endif
/*
VX_GRAPH_PREEMPTION_SUPPORT is used to declare that openvx can support different graph preemption function.
[value]
0: not support
1: support
*/
#ifndef VX_GRAPH_PREEMPTION_SUPPORT
#define VX_GRAPH_PREEMPTION_SUPPORT 1
#endif
/*
VX_BATCH_GEMM_API_SUPPORT is used to declare that vsi openvx driver can support vxBatchGemmNode API to transform gemm to convolution
[value]
0: not support
1: support
*/
#ifndef VX_BATCH_GEMM_API_SUPPORT
#define VX_BATCH_GEMM_API_SUPPORT 1
#endif
/*
VX_CONV_3D_API_SUPPORT is used to declare that vsi openvx driver can support conv3d by vxConv3dLayer API.
[value]
0: not support
1: support
*/
#ifndef VX_CONV_3D_API_SUPPORT
#define VX_CONV_3D_API_SUPPORT 1
#endif
/*
VX_DECONV_3D_API_SUPPORT is used to declare that vsi openvx driver can support deconv3d by vxDeconv3dLayer API.
[value]
0: not support
1: support
*/
#ifndef VX_DECONV_3D_API_SUPPORT
#define VX_DECONV_3D_API_SUPPORT 1
#endif
/*
VX_PAD_CONST_SUPPORT is used to declare that openvx can support pad_const for tensorpad and convolution.
[value]
0: not support
1: support
*/
#ifndef VX_PAD_CONST_SUPPORT
#define VX_PAD_CONST_SUPPORT 1
#endif
/*
VX_TENSOR_STRIDE_X_BITS_SUPPORT is used to declare that openvx can support tensor which bits of stride in x dimension is not an integer number of bytes.
[value]
0: not support
1: support
*/
#ifndef VX_TENSOR_STRIDE_X_BITS_SUPPORT
#define VX_TENSOR_STRIDE_X_BITS_SUPPORT 1
#endif
/*
VX_REMOVE_RESHAPE_SUPPORT is used to declare if graph opt support to remove reshape op, if support, it's not need to remove reshape in ovxlib.
0: not support
1: support
*/
/*
#ifndef VX_REMOVE_RESHAPE_SUPPORT
#define VX_REMOVE_RESHAPE_SUPPORT 0
#endif
*/
/*
VX_STREAM_PROCESSOR_SUPPORT is used to declare that vsi openvx driver can support vxStreamProcessorNode API
[value]
0: not support
1: support
*/
#ifndef VX_STREAM_PROCESSOR_SUPPORT
#define VX_STREAM_PROCESSOR_SUPPORT 1
#endif
/*
VX_TENSOR_MEMORY_CONNECT_DMA_CHANNEL is used to declare that this tensor connect to fixed DMA channel.
[value]
0: not support
1: support
*/
#ifndef VX_TENSOR_MEMORY_CONNECT_DMA_CHANNEL
#define VX_TENSOR_MEMORY_CONNECT_DMA_CHANNEL 1
#endif
/*
VX_SCALE_EXTRA_PARAMETER_SUPPORT is used to declare that RESIZE can support align_cornor and half_pixel_center parameter
[value]
0: not support
1: support
*/
#ifndef VX_SCALE_EXTRA_PARAMETER_SUPPORT
#define VX_SCALE_EXTRA_PARAMETER_SUPPORT 1
#endif
/*
VX_INVALIDATE_HANDLE_SUPPORT is used to declare that we refined vxSwapTensorHandle API to follow KHR OpenVX 1.3 spec: tensor don't maintain handle internally if new_ptr is NULL.
[value]
0: not support
1: support
*/
#ifndef VX_INVALIDATE_HANDLE_SUPPORT
#define VX_INVALIDATE_HANDLE_SUPPORT 1
#endif
/*
VX_ACTIVATION_EXT2_SUPPORT is used to declare that ACTIVATION can support sign, hard_sigmoid, neg, clip, exp, sin, cos,
log, mish, gelu, hgelu, elu, selu, celu, rcp, softsign, atan, atanh, acosh, inverse sigmoid, round and erf.
[value]
0: not support
1: support
*/
#ifndef VX_ACTIVATION_EXT2_SUPPORT
#define VX_ACTIVATION_EXT2_SUPPORT 1
#endif
/*
VX_TENSORVIEW_ON_ANY_DIM is used to declare that ovxlib can do optimization for all concat node(all dimision) to tensor view if possiable, not only channel.
[value]
0: disable
1: enable
*/
#ifndef VX_TENSORVIEW_ON_ANY_DIM
#define VX_TENSORVIEW_ON_ANY_DIM 0
#endif
/*
VX_DEPTH2SPACE_CRD_MODE_SUPPORT is used to declare that SPACE2DEPTH can support CRD mode
[value]
0: not support
1: support
*/
#ifndef VX_DEPTH2SPACE_CRD_MODE_SUPPORT
#define VX_DEPTH2SPACE_CRD_MODE_SUPPORT 1
#endif
/*
VX_LAYER_NORMALIZATION_VX_SUPPORT is used to declare driver support layer normalization layer.
[value]
0: not support
1: support
*/
#ifndef VX_LAYER_NORMALIZATION_VX_SUPPORT
#define VX_LAYER_NORMALIZATION_VX_SUPPORT 1
#endif
/*
VX_LAYER_NORMALIZATION_VX_SUPPORT is used to declare driver support layer normalization layer.
[value]
0: not support
1: support
*/
#ifndef VX_INSTANCE_NORMALIZATION_VX_SUPPORT
#define VX_INSTANCE_NORMALIZATION_VX_SUPPORT 1
#endif
/*
VX_GROUP_NORMALIZATION_VX_SUPPORT is used to declare driver support layer normalization layer.
[value]
0: not support
1: support
*/
#ifndef VX_GROUP_NORMALIZATION_VX_SUPPORT
#define VX_GROUP_NORMALIZATION_VX_SUPPORT 1
#endif
/*
VX_LOGICAL_VX_SUPPORT is used to declare driver support layer logical related layer.
[value]
0: not support
1: support
*/
#ifndef VX_LOGICAL_VX_SUPPORT
#define VX_LOGICAL_VX_SUPPORT 1
#endif
/*
VX_RELATIONAL_OPS_VX_SUPPORT is used to declare driver support layer relational related layer.
[value]
0: not support
1: support
*/
#ifndef VX_RELATIONAL_OPS_VX_SUPPORT
#define VX_RELATIONAL_OPS_VX_SUPPORT 1
#endif
/*
VX_REDUCE_MAX_VX_SUPPORT is used to declare driver support layer reduce max layer.
[value]
0: not support
1: support
*/
#ifndef VX_REDUCE_MAX_VX_SUPPORT
#define VX_REDUCE_MAX_VX_SUPPORT 1
#endif
/*
VX_REDUCE_MEAN_VX_SUPPORT is used to declare driver support layer reduce mean layer.
[value]
0: not support
1: support
*/
#ifndef VX_REDUCE_MEAN_VX_SUPPORT
#define VX_REDUCE_MEAN_VX_SUPPORT 1
#endif
/*
VX_REDUCE_SUM_VX_SUPPORT is used to declare driver support layer reduce sum layer.
[value]
0: not support
1: support
*/
#ifndef VX_REDUCE_SUM_VX_SUPPORT
#define VX_REDUCE_SUM_VX_SUPPORT 1
#endif
/*
VX_MAX_MIN_IMUM_VX_SUPPORT is used to declare driver support maximum and minimum layer.
[value]
0: not support
1: support
*/
#ifndef VX_MAX_MIN_IMUM_VX_SUPPORT
#define VX_MAX_MIN_IMUM_VX_SUPPORT 1
#endif
/*
VX_TENSOR_SELECR_VX_SUPPORT is used to declare driver support tensor select layer.
[value]
0: not support
1: support
*/
#ifndef VX_TENSOR_SELECT_VX_SUPPORT
#define VX_TENSOR_SELECT_VX_SUPPORT 1
#endif
/*
VX_GRU_CELL_VX_SUPPORT is used to declare driver support gru cell layer.
[value]
0: not support
1: support
*/
#ifndef VX_GRU_CELL_VX_SUPPORT
#define VX_GRU_CELL_VX_SUPPORT 1
#endif
/*
VX_LSTM_ACTIVATION_SUPPORT is used to declare driver support gru cell layer.
[value]
0: not support
1: support
*/
#ifndef VX_LSTM_ACTIVATION_SUPPORT
#define VX_LSTM_ACTIVATION_SUPPORT 1
#endif
#endif /* __VX_KHR_COMPATIBLE_H__ */

View File

@ -0,0 +1,42 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_DOT_H_
#define _VX_KHR_DOT_H_
#define OPENVX_KHR_DOT "vx_khr_dot"
#include <VX/vx.h>
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Exports a single graph to a dotfile.
* \param [in] graph The graph to export.
* \param [in] dotfile The name of the file to write to.
* \param [in] showData If true, data objects will be listed in the graph too.
* \see http://www.graphviz.com
*/
vx_status vxExportGraphToDot(vx_graph g, vx_char dotfile[], vx_bool showData);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,80 @@
/*
* Copyright (c) 2017-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*! \file
* \defgroup group_icd OpenVX ICD Loader API
* \brief The OpenVX Installable Client Driver (ICD) Loader API.
* \details The vx_khr_icd extension provides a mechanism for vendors to implement Installable Client Driver (ICD) for OpenVX. The OpenVX ICD Loader API provides a mechanism for applications to access these vendor implementations.
*/
#ifndef _VX_KHR_ICD_H_
#define _VX_KHR_ICD_H_
#include <VX/vx.h>
#include <VX/vxu.h>
/*! \brief Platform handle of an implementation.
* \ingroup group_icd
*/
typedef struct _vx_platform * vx_platform;
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Queries list of available platforms.
* \param [in] capacity Maximum number of items that platform[] can hold.
* \param [out] platform[] List of platform handles.
* \param [out] pNumItems Number of platform handles returned.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors.
* \retval VX_FAILURE If no platforms are found.
* \ingroup group_icd
*/
vx_status VX_API_CALL vxIcdGetPlatforms(vx_size capacity, vx_platform platform[], vx_size * pNumItems);
/*! \brief Queries the platform for some specific information.
* \param [in] platform The platform handle.
* \param [in] attribute The attribute to query. Use one of the following:
* <tt>\ref VX_CONTEXT_VENDOR_ID</tt>,
* <tt>\ref VX_CONTEXT_VERSION</tt>,
* <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>,
* <tt>\ref VX_CONTEXT_EXTENSIONS</tt>.
* \param [out] ptr The location at which to store the resulting value.
* \param [in] size The size in bytes of the container to which \a ptr points.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors.
* \retval VX_ERROR_INVALID_REFERENCE If the platform is not a <tt>\ref vx_platform</tt>.
* \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
* \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
* \ingroup group_icd
*/
vx_status VX_API_CALL vxQueryPlatform(vx_platform platform, vx_enum attribute, void *ptr, vx_size size);
/*! \brief Creates a <tt>\ref vx_context</tt> from a <tt>\ref vx_platform</tt>.
* \details This creates a top-level object context for OpenVX from a platform handle.
* \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
* preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
* \ingroup group_icd
*/
vx_context VX_API_CALL vxCreateContextFromPlatform(vx_platform platform);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,88 @@
/*
* Copyright (c) 2012-2018 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
* KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
* SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
* https://www.khronos.org/registry/
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#ifndef _OPENVX_IMPORT_KERNEL_H_
#define _OPENVX_IMPORT_KERNEL_H_
#include <VX/vx.h>
/*!
* \file
* \brief The OpenVX import kernel extension API.
*/
#define OPENVX_KHR_IMPORT_KERNEL "vx_khr_import_kernel"
/*! \brief The import kernel extension library set
* \ingroup group_import_kernel
*/
#define VX_LIBRARY_KHR_IMPORT_KERNEL_EXTENSION (0x5)
/*
define type for vxImportKernelFromURL() function
*/
#define VX_VIVANTE_IMPORT_KERNEL_FROM_FILE "vx_vivante_file"
#define VX_VIVANTE_IMPORT_KERNEL_FROM_FOLDER "vx_vivante_folder"
#define VX_VIVANTE_IMPORT_KERNEL_FROM_LABEL "vx_vivante_label"
#define VX_VIVANTE_IMPORT_KERNEL_FROM_POINTER "vx_vivante_pointer"
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Import a kernel from binary specified by URL.
*
* The name of kernel parameters can be queried using the vxQueryReference API
* with vx_parameter as ref and VX_REFERENCE_NAME as attribute.
*
* \param context [in] The OpenVX context
* \param type [in] Vendor-specific identifier that indicates to the implementation
* how to interpret the url. For example, if an implementation can interpret the url
* as a file, a folder a symbolic label, or a pointer, then a vendor may choose
* to use "vx_<vendor>_file", "vx_<vendor>_folder", "vx_<vendor>_label", and
* "vx_<vendor>_pointer", respectively for this field. Container types starting
* with "vx_khr_" are reserved. Refer to vendor documentation for list of
* container types supported
* \param url [in] URL to binary container.
*
* \retval On success, a valid vx_kernel object. Calling vxGetStatus with the return value
* as a parameter will return VX_SUCCESS if the function was successful.
*
* \ingroup group_import_kernel
*/
VX_API_ENTRY vx_kernel VX_API_CALL vxImportKernelFromURL(
vx_context context,
const vx_char * type,
const vx_char * url
);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_INTERP_H_
#define _VX_KHR_INTERP_H_
/*! \brief The Interpolation Type Query Extension.
* \file
*/
#define OPENVX_KHR_INTERP "vx_khr_interpolation"
#include <VX/vx.h>
/*! \brief Additional interpolation types */
enum vx_interpolation_type_ext_e {
/*! \brief Bicubic interpolation method */
VX_INTERPOLATION_BICUBIC = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x3,
/*! \brief Mipmapping interpolation method */
VX_INTERPOLATION_MIPMAP = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_INTERPOLATION) + 0x4,
};
#endif

View File

@ -0,0 +1,158 @@
/*
* Copyright (c) 2012-2020 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _OPENVX_IMPORT_EXPORT_H_
#define _OPENVX_IMPORT_EXPORT_H_
/*!
* \file
* \brief The OpenVX Export and Import extension API.
*/
#define OPENVX_KHR_IX "vx_khr_ix"
#include <VX/vx_import.h>
#ifdef __cplusplus
extern "C" {
#endif
/*=============================================================================
Export to host memory
=============================================================================*/
/*! \brief Exports selected objects to memory in a vendor-specific format.\n
*
* \details A list of references in the given context is supplied to this function, and all information
* required to re-create these is stored in memory in such a way that those objects may be re-created
* with the corresponding import function, according to the usage specified by the *uses* parameter[*REQ*].\n
* The information must be context independent in that it may be written to external storage for later
* retreival with another instantiation of a compatible implementation[*REQ*].\n
* The list of objects to export may contain only valid references (i.e. vxGetStatus() will return VX_SUCCESS)
* to vx_graph and non-virtual data objects or the function will fail[*REQ*].
* (Specifically not vx_context, vx_import, vx_node, vx_kernel, vx_parameter or vx_meta_format)\n
* Some node creation functions take C parameters rather than OpenVX data objects (such as the *gradient_size*
* parameter of <tt>\ref vxHarrisCornersNode</tt> that is provided as a vx_int32), because these are intended
* to be fixed at node creation time; nevertheless OpenVX data objects may be assigned to them, for example if
* the <tt>\ref vxCreateGenericNode</tt> API is used.
* A data object corresponding to a node parameter that is intended to be fixed at node creation time must not be
* in the list of exported objects nor attached as a graph parameter or the export operation will fail[*REQ*].\n
* The *uses* array specifies how the objects in the corresponding *refs* array will be exported. A data object
* will always have its meta-data (e.g. dimensions and format of an image) exported, and optionally
* may have its data (e.g. pixel values) exported, and additionally you can decide whether the importing
* application will create data objects to replace those attached to graphs, or if the implementation will
* automatically create them:
* - <tt>\ref VX_IX_USE_APPLICATION_CREATE</tt> \n
* Export sufficient data to check that an application-supplied
* object is compatible when the data is later imported[*REQ*].
* \note This value must be given for images created from handles, or the the export operation
* will fail[*REQ*]
* - <tt>\ref VX_IX_USE_EXPORT_VALUES</tt>\n
* Export complete information (for example image data or value of a
* scalar)[*REQ*].
* - <tt>\ref VX_IX_USE_NO_EXPORT_VALUES</tt>\n
* Export meta-data only; the importing application will set values
* as applicable[*REQ*]
*
* The values in *uses* are applicable only for data objects and are ignored for vx_graph objects[*REQ*].\n
* If the list *refs* contains vx_graph objects, these graphs will be verified during the export operation and the export operation will fail if verification fails; when successfully exported graphs are subsequently imported they will appear as verified [*REQ*].\n
* \note The implementation may also choose to re-verify any previously verified graphs and apply
* optimisations based upon which references are to be exported and how.\n
* Any data objects attached to a graph that are hidden, i.e. their references are not in the list *refs*,
* may be treated by the implementation as virtual objects, since they can never be visible when the graph is
* subsequently imported.\n
* Note that imported graphs cannot become unverified. Attempts to change the
* graph that might normally cause the graph to be unverified, e.g. calling
* vxSetGraphParameterByIndex with an object with different metadata, will fail.\n
* The implementation should make sure that all permissible changes of exported objects are possible
* without re-verification. For example:
* - A uniform image may be swapped for a non-uniform image, so corresponding optimisations should be
* inhibited if a uniform image appears in the *refs* list
* - An image that is a region of interest of another image may be similarly replaced by any other image of
* matching size and format, and vice-versa
*
* If a graph is exported that has delays registered for auto-aging, then this information is also
* exported[*REQ*].\n
* If the function is called with NULL for any of its parameters, this is an error [*REQ*].\n
* The reference counts of objects as visible to the calling application will not be affected
* by calling this function [*REQ*].\n
* The export operation will fail if more than one object whose reference is listed at *refs*
* has been given the same non-zero length name (via <tt>\ref vxSetReferenceName</tt>)[*REQ*].\n
* If a graph listed for export has any graph parameters not listed at *refs*, then the
* export operation will fail[*REQ*].
* \note The order of the references supplied in the *refs* array will be the order in which the
* framwork will supply references for the corresponding import operation with <tt>\ref vxImportObjectsFromMemory</tt>.\n
* The same length of *uses* array, containing the same values, and the same value of *numrefs*, must be supplied
* for the corresponding import operation.
*
* For objects not listed in *refs*, the following rules apply:
* 1. In any one graph, if an object is not connected as an output of a node in a graph being exported
* then its data values will be exported (for subsequent import)[*REQ*].
* 2. Where the object in (1) is a composite object (such as a pyramid) then rule (1) applies to
* all of its sub-objects[*REQ*].
* 3. Where the object in (1) is a sub-object such as a region of interest, and the composite object
* (in this case the parent image) does not meet the conditions of rule (1), then rule (1) applies
* to the sub-object only[*REQ*].
* \param [in] context context from which to export objects, must be valid [*REQ*].
* \param [in] numrefs number of references to export [*REQ*].
* \param [in] refs references to export. This is an array of length numrefs populated with
* the references to export[*REQ*].
* \param [in] uses how to export the references. This is an array of length numrefs containing
* values as described above[*REQ*].
* \param [out] ptr returns pointer to binary buffer. On error this is set to NULL[*REQ*].
* \param [out] length number of bytes at \*ptr. On error this is set to zero[*REQ*].
* \return A <tt>\ref vx_status</tt> value.
* \retval VX_SUCCESS If no errors occurred and the objects were sucessfully exported[*REQ*].
* An error is indicated when the return value is not VX_SUCCESS.\n
* An implementation may provide several different return values to give useful diagnostic
* information in the event of failure to export, but these are not required to indicate
* possible recovery mechanisms, and for safety critical use assume errors are not recoverable.
* \post <tt>\ref vxReleaseExportedMemory</tt> is used to deallocate the memory.
* \ingroup group_import
*/
VX_API_ENTRY vx_status VX_API_CALL vxExportObjectsToMemory(
vx_context context,
vx_size numrefs,
const vx_reference *refs,
const vx_enum * uses,
const vx_uint8 ** ptr,
vx_size * length);
/*! \brief Releases memory allocated for a binary export when it is no longer required.
* \details This function releases memory allocated by <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].
* \param [in] context The context for which <tt>\ref vxExportObjectsToMemory</tt> was called[*REQ*].
* \param [in,out] ptr A pointer previously set by calling <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].
* The function will fail if <code>*ptr</code> does not contain an address of memory previously
* allocated by <tt>\ref vxExportObjectsToMemory</tt>[*REQ*].
* \post After returning from sucessfully from this function \*ptr is set to NULL[*REQ*].
* \return A <tt>\ref vx_status</tt> value.
* \retval VX_SUCCESS If no errors occurred and the memory was sucessfully released[*REQ*].\n
* An error is indicated when the return value is not VX_SUCCESS[*REQ*].\n
* An implementation may provide several different return values to give useful diagnostic
* information in the event of failure to export, but these are not required to indicate
* possible recovery mechanisms, and for safety critical use assume errors are not recoverable.
* \pre <tt>\ref vxExportObjectsToMemory</tt> is used to allocate the memory.
* \ingroup group_import
*/
VX_API_ENTRY vx_status VX_API_CALL vxReleaseExportedMemory(
vx_context context, const vx_uint8 ** ptr);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_NODE_MEMORY_H_
#define _VX_KHR_NODE_MEMORY_H_
/*! \brief The Node Memory Extension.
* \file
*/
#define OPENVX_KHR_NODE_MEMORY "vx_khr_node_memory"
#include <VX/vx.h>
/*! \brief The kernel object attributes for global and local memory.
* \ingroup group_kernel
*/
enum vx_kernel_attribute_memory_e {
/*! \brief The global data pointer size to be shared across all instances of
* the kernel (nodes are instances of kernels).
* Use a \ref vx_size parameter.
* \note If not set it will default to zero.
*/
VX_KERNEL_GLOBAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x5,
/*! \brief The global data pointer to the shared across all the instances of
* the kernel (nodes are instances of the kernels).
* Use a \ref void * parameter.
*/
VX_KERNEL_GLOBAL_DATA_PTR = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x6,
};
/*! \brief The node object attributes for global and local memory.
* \ingroup group_node
*/
enum vx_node_attribute_memory_e {
/*! \brief Used to indicate the size of the shared kernel global memory area.
* Use a \ref vx_size parameter.
*/
VX_NODE_GLOBAL_DATA_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0x9,
/*! \brief Used to indicate the pointer to the shared kernel global memory area.
* Use a void * parameter.
*/
VX_NODE_GLOBAL_DATA_PTR = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xA,
};
#endif

View File

@ -0,0 +1,268 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_OPENCL_H_
#define _VX_KHR_OPENCL_H_
#include <VX/vx.h>
#include <VX/vx_compatibility.h>
/*! \file
* \brief The OpenVX to OpenCL Inter-op Extension Header.
*
* \defgroup group_cl_api API
* \brief The API used by Clients to add OpenCL Kernels as <tt>vx_kernel</tt>.
* \details
*
* \defgroup group_cl_def Extension Defines
* \brief The Extension defines and constants.
*
* \defgroup group_cl_image Images
* \brief OpenVX Images
* \details Depending on whether the OpenCL implementation supports images, <tt>vx_image</tt>
* may map to an <tt>image2d_t</tt> or a OpenCL buffer.
*
* \defgroup group_cl_array Arrays
* \brief OpenVX Arrays
*
* \defgroup group_cl_convolution Convolutions
* \brief OpenVX Convolutions
*
* \defgroup group_cl_distribution Distributions
* \brief OpenVX Distributions
*
* \defgroup group_cl_matrix Matricies
* \brief OpenVX Matrix
*
* \defgroup group_cl_types OpenVX to OpenCL Atomic Types
* \brief Atomic Types
* \details OpenVX types map to OpenCL types through this table:
* | VX | OpenCL|
* |:---------|:------|
* |<tt>vx_uint8</tt> |<tt>uchar</tt> |
* |<tt>vx_int8</tt> |<tt>char</tt> |
* |<tt>vx_uint16</tt> |<tt>ushort</tt> |
* |<tt>vx_int16</tt> |<tt>short</tt> |
* |<tt>vx_uint32</tt> |<tt>uint</tt> |
* |<tt>vx_int32</tt> |<tt>int</tt> |
* |<tt>vx_uint64</tt> |<tt>ulong</tt> |
* |<tt>vx_int64</tt> |<tt>long</tt> |
* |<tt>vx_float32</tt>|<tt>float</tt> |
* |<tt>vx_float64</tt>|<tt>double</tt> |
* |<tt>vx_size</tt> |<tt>size_t</tt> |
*
* \note <tt>size_t</tt> can not be used as a parameter to a <tt>__kernel</tt>.
*/
#ifndef VX_SCALE_UNITY
#define VX_SCALE_UNITY (1024)
#endif
/*!\brief The maximum number of planes an image may have which is compatible across both
* API.
* \ingroup group_cl_def
*/
#define VX_CL_MAX_PLANES (4)
#if defined(VX_CL_DOCUMENTATION) || !defined(VX_CL_KERNEL)
#if defined(__APPLE__) || defined(DARWIN)
#include <OpenCL/OpenCL.h>
#else
#include <CL/cl.h>
#endif
#if (!defined(__APPLE__)) && defined(CL_USE_LUMINANCE)
#define CL_USE_IMAGES
#endif
/*! \brief The string name of this extension to match for in the extensions list
* \ingroup group_cl_def
*/
#define OPENVX_KHR_OPENCL "vx_khr_opencl"
/*! \brief Adds an OpenCL Kernel as source code into the OpenVX implementation.
* \param [in] context The OpenVX Context.
* \param [in] name The name of the kernel in OpenVX nomenclature.
* \param [in] enumeration The OpenVX kernel enumeration used to identify this kernel.
* \param [in] source The array of source line pointers.
* \param [in] line_lengths The array of lines lengths for each line of source.
* \param [in] num_lines the number of lines in both the sources array and line_lengths array.
* \param [in] symbol_name The name of the kernel to call in the program.
* \param [in] numParams The number of parameters to the OpenVX kernel.
* \param [in] input The input validator.
* \param [in] output The output validator.
* \see <tt>vxAddParameterToKernel</tt> to configure the specific parameter attributes.
* \ingroup group_cl_api
*/
VX_API_ENTRY vx_kernel VX_API_CALL vxAddOpenCLAsSourceKernel(vx_context context,
vx_char name[VX_MAX_KERNEL_NAME],
vx_enum enumeration,
char *source[],
size_t line_lengths[],
size_t num_lines,
char symbol_name[],
vx_uint32 numParams,
vx_kernel_input_validate_f input,
vx_kernel_output_validate_f output);
/*! \brief Adds an OpenCL Kernel as binary program into the OpenVX implementation.
* \param [in] context The OpenVX Context.
* \param [in] name The name of the kernel in OpenVX nomenclature.
* \param [in] enumeration The OpenVX kernel enumeration used to identify this kernel.
* \param [in] program The OpenCL Program which contains the kernel (either pre-compiled or compiled by user).
* \param [in] symbol_name The name of the kernel to call in the program.
* \param [in] numParams The number of parameters to the OpenVX kernel.
* \param [in] input The input validator.
* \param [in] output The output validator.
* \see <tt>vxAddParameterToKernel</tt> to configure the specific parameter attributes.
* \ingroup group_cl_api
*/
VX_API_ENTRY vx_kernel VX_API_CALL vxAddOpenCLAsBinaryKernel(vx_context context,
vx_char name[VX_MAX_KERNEL_NAME],
vx_enum enumeration,
cl_program program,
char symbol_name[],
vx_uint32 numParams,
vx_kernel_input_validate_f input,
vx_kernel_output_validate_f output);
#endif // External API
#if defined(VX_CL_DOCUMENTATION) || defined(VX_CL_KERNEL)
#if defined(__IMAGE_SUPPORT__) && defined(CL_USE_LUMINANCE)
#define CL_USE_IMAGES
#endif
/*! \brief Allows access to an image pixel as a typecast pointer deference.
* \param type The OpenCL single element type
* \param ptr The <tt>__global</tt> pointer to the base of the image.
* \param x The x coordinate.
* \param y The y coordinate.
* \param sx The x stride.
* \param sy The y stride.
* \ingroup group_cl_image
*/
#define vxImagePixel(type, ptr, x, y, sx, sy) \
(*(type *)(&((uchar *)ptr)[((y) * sy) + ((x) * sx)]))
/*!
* \brief Allows access to an array item as a typecast pointer deference.
* \param type The OpenCL single element type or structure type.
* \param ptr The <tt>__global</tt> pointer to the base of the array.
* \param index The index of the element to access.
* \param stride The stride in bytes between two adjacent elements.
* \ingroup group_cl_array
*/
#define vxArrayItem(type, ptr, index, stride) \
(*(type *)(&((uchar *)ptr)[index*stride]))
/*! \brief Allows access to a matrix element \f$ M_{ij} \f$ where i is the column and j is the row.
* \param type The OpenCL single element type of the matrix.
* \param ptr The <tt>__global</tt> pointer to the base of the array.
* \param columns The number of columns in the matrix.
* \param i The column index
* \param j The row index
* \ingroup group_cl_matrix
*/
#define vxMatrixElement(type, ptr, columns, i, j) (((type *)ptr)[columns*j + i])
/*! \brief Allows access to a convolution element \f$ C_{ij} \f$ where i is the column and j is the row.
* \note Convolution elements are always of type <tt>short</tt>.
* \param ptr The <tt>__global</tt> pointer to the base of the array.
* \param columns The number of columns in the matrix.
* \param i The column index
* \param j The row index
* \ingroup group_cl_convolution
*/
#define vxConvolveElement(ptr, columns, i, j) (((short *)ptr)[columns*j + i])
/*! \brief Allows access to a distribution frequency counter.
* \param ptr The <tt>__global</tt> pointer to the base of the distribution.
* \param value The value to retrive the frequency count for.
* \param offset The offset within the input domain.
* \param range The total range within the domain starting from offset.
* \param window_size The window size of the bin.
* \ingroup group_cl_distribution
*/
#define vxGetFrequency(ptr, value, offset, range, window_size) \
((offset <= value) && (value <= (range+offset)) ? ptr[(value-offset)/window_size] : 0)
/*! \brief Increments a distribution frequency counter for a value.
* \param ptr The <tt>__global</tt> pointer to the base of the distribution.
* \param value The value to increment the frequency count for.
* \param offset The offset within the input domain.
* \param range The total range within the domain starting from offset.
* \param window_size The window size of the bin.
* \ingroup group_cl_distribution
*/
#define vxIncFrequency(ptr, value, offset, range, window_size) \
((offset <= value) && (value <= (range+offset)) ? ++ptr[(value-offset)/window_size] : 0)
/*! \brief Decrements a distribution frequency counter for a value.
* \param ptr The <tt>__global</tt> pointer to the base of the distribution.
* \param value The value to decrement the frequency count for.
* \param offset The offset within the input domain.
* \param range The total range within the domain starting from offset.
* \param window_size The window size of the bin.
* \ingroup group_cl_distribution
*/
#define vxDecFrequency(ptr, value, offset, range, window_size) \
((offset <= value) && (value <= (range+offset)) ? --ptr[(value-offset)/window_size] : 0)
#if defined(VX_VERSION_1_1) && (VX_VERSION >= VX_VERSION_1_1)
/*! \brief Allows access to a distribution frequency counter.
* \param ptr The <tt>__global</tt> pointer to the base of the distribution.
* \param value The value to retrive the frequency count for.
* \param offset The offset within the input domain.
* \param range The total range within the domain starting from offset.
* \param num_bins The number of bins in the domain range.
* \ingroup group_cl_distribution
*/
#define vxGetFrequency2(ptr, value, offset, range, num_bins) \
((offset <= value) && (value <= (range+offset)) ? ptr[(value-offset)*num_bins/range] : 0)
/*! \brief Increments a distribution frequency counter for a value.
* \param ptr The <tt>__global</tt> pointer to the base of the distribution.
* \param value The value to increment the frequency count for.
* \param offset The offset within the input domain.
* \param range The total range within the domain starting from offset.
* \param num_bins The number of bins in the domain range.
* \ingroup group_cl_distribution
*/
#define vxIncFrequency2(ptr, value, offset, range, num_bins) \
((offset <= value) && (value <= (range+offset)) ? ++ptr[(value-offset)*num_bins/range] : 0)
/*! \brief Decrements a distribution frequency counter for a value.
* \param ptr The <tt>__global</tt> pointer to the base of the distribution.
* \param value The value to decrement the frequency count for.
* \param offset The offset within the input domain.
* \param range The total range within the domain starting from offset.
* \param num_bins The number of bins in the domain range.
* \ingroup group_cl_distribution
*/
#define vxDecFrequency2(ptr, value, offset, range, num_bins) \
((offset <= value) && (value <= (range+offset)) ? --ptr[(value-offset)*num_bins/range] : 0)
#endif /*VX_VERSION_1_1*/
#endif
#endif

View File

@ -0,0 +1,347 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_TILING_H_
#define _VX_KHR_TILING_H_
/*!
* \file
* \brief The Khronos Extension for User Tiling Functions.
*
* \defgroup group_tiling Extension: User Tiling API
* \brief The Khronos Extension for User Tiling Functions.
*/
#define OPENVX_KHR_TILING "vx_khr_tiling"
#if defined(OPENVX_TILING_1_0)
#undef OPENVX_TILING_1_1
#endif
#include <VX/vx.h>
/* For vx_kernel_input_validate_f and vx_kernel_output_validate_f: */
#include <VX/vx_compatibility.h>
/*! \def VX_RESTRICT
* \brief A platform wrapper for the restrict keyword.
* \ingroup group_tiling
*/
#if defined(_WIN32)
#define VX_RESTRICT
#else
#if defined(__cplusplus) || defined(ANDROID)
#define VX_RESTRICT __restrict
#elif defined(__linux__)
#define VX_RESTRICT
#elif defined __QNXNTO__
#define VX_RESTRICT
#else
#define VX_RESTRICT restrict
#endif
#endif
/*! \brief The User Tiling Function tile block size declaration.
* \details The author of a User Tiling Kernel will use this structure to define
* the dimensionality of the tile block.
* \ingroup group_tiling
*/
typedef struct _vx_tile_block_size_t {
vx_int32 width; /*!< \brief Tile block width in pixels. */
vx_int32 height; /*!< \brief Tile block height in pixels. */
} vx_tile_block_size_t;
/*! \brief The User Tiling Function Neighborhood declaration.
* \details The author of a User Tiling Kernel will use this structure to define
* the neighborhood surrounding the tile block.
* \ingroup group_tiling
*/
typedef struct _vx_neighborhood_size_t {
vx_int32 left; /*!< \brief Left of the tile block. */
vx_int32 right; /*!< \brief Right of the tile block. */
vx_int32 top; /*!< \brief Top of the tile block. */
vx_int32 bottom; /*!< \brief Bottom of the tile block. */
} vx_neighborhood_size_t;
/*! \brief A structure which describes the tile's parent image.
* \ingroup group_tiling
*/
typedef struct _vx_image_description_t {
vx_uint32 width; /*!< \brief Width of the image */
vx_uint32 height; /*!< \brief Height of the image */
vx_df_image format; /*!< \brief The <tt>\ref vx_df_image_e</tt> of the image */
vx_uint32 planes; /*!< \brief The number of planes in the image */
vx_enum range; /*!< \brief The <tt>\ref vx_channel_range_e</tt> enumeration. */
vx_enum space; /*!< \brief The <tt>\ref vx_color_space_e</tt> enumeration. */
} vx_image_description_t;
/*! \brief The maximum number of planes in a tiled image.
* \ingroup group_tiling
*/
#define VX_MAX_TILING_PLANES (4)
/*! \brief The tile structure declaration.
* \ingroup group_tiling
*/
typedef struct _vx_tile_t {
/*! \brief The array of pointers to the tile's image plane. */
vx_uint8 * VX_RESTRICT base[VX_MAX_TILING_PLANES];
/*! \brief The top left X pixel index within the width dimension of the image. */
vx_uint32 tile_x;
/*! \brief The top left Y pixel index within the height dimension of the image. */
vx_uint32 tile_y;
/*! \brief The array of addressing structure to describe each plane. */
vx_imagepatch_addressing_t addr[VX_MAX_TILING_PLANES];
/*! \brief The output block size structure. */
vx_tile_block_size_t tile_block;
/*! \brief The neighborhood definition. */
vx_neighborhood_size_t neighborhood;
/*! \brief The description and attributes of the image. */
vx_image_description_t image;
} vx_tile_t;
#ifndef VX_TILE_ATTRIBUTES_DEFINITIONS
/*!
* \brief The full height of the tile's parent image in pixels.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxImageHeight(ptile) ((ptile))->image.height)
/*!
* \brief The full width of the tile's parent image in pixels.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxImageWidth(ptile) ((ptile))->image.width)
/*!
* \brief The offset between the left edge of the image and the left edge of the tile, in pixels.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxTileX(ptile) ((ptile)->tile_x)
/*!
* \brief The offset between the top edge of the image and the top edge of the tile, in pixels.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxTileY(ptile) ((ptile)->tile_y)
/*!
* \brief The width of the tile in pixels.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \param [in] index The plane index.
* \ingroup group_tiling
*/
#define vxTileWidth(ptile, index) ((ptile)->addr[index].dim_x)
/*!
* \brief The height of the tile in pixels.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \param [in] index The plane index.
* \ingroup group_tiling
*/
#define vxTileHeight(ptile, index) ((ptile)->addr[index].dim_y)
/*!
* \brief The tile block height.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxTileBlockHeight(ptile) ((ptile)->tile_block.height)
/*!
* \brief The tile block width.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxTileBlockWidth(ptile) ((ptile)->tile_block.width)
/*!
* \brief The simple wrapper to access each image's neighborhood -X value.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxNeighborhoodLeft(ptile) ((ptile)->neighborhood.left)
/*!
* \brief The simple wrapper to access each image's neighborhood +X value.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxNeighborhoodRight(ptile) ((ptile)->neighborhood.right)
/*!
* \brief The simple wrapper to access each image's neighborhood -Y value.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxNeighborhoodTop(ptile) ((ptile)->neighborhood.top)
/*!
* \brief The simple wrapper to access each image's neighborhood +Y value.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \ingroup group_tiling
*/
#define vxNeighborhoodBottom(ptile) ((ptile)->neighborhood.bottom)
#endif
/*! \brief The User Kernel Tiling Attributes.
* \ingroup group_tiling
*/
enum vx_kernel_attribute_tiling_e {
/*! \brief This allows a tiling mode kernel to set its input neighborhood. */
VX_KERNEL_INPUT_NEIGHBORHOOD = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x7,
/*! \brief This allows a tiling mode kernel to set its output tile block size. */
VX_KERNEL_OUTPUT_TILE_BLOCK_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x8,
/*! \brief This allows the author to set the border mode on the tiling kernel. */
VX_KERNEL_BORDER = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0x9,
/*! \brief This determines the per tile memory allocation. */
VX_KERNEL_TILE_MEMORY_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0xA,
#if defined(OPENVX_TILING_1_1)
/*! \brief This allows a tiling mode kernel to set its input tile block size. */
VX_KERNEL_INPUT_TILE_BLOCK_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0xB,
/*! \brief This allows a tiling mode kernel to set its output neighborhood. */
VX_KERNEL_OUTPUT_NEIGHBORHOOD = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_KERNEL) + 0xC,
#endif
};
/*! \brief The User Node Tiling Attributes.
* \note These are largely unusable by the tiling function, as it doesn't give you the node reference!
* \ingroup group_tiling
*/
enum vx_node_attribute_tiling_e {
/*! \brief This allows a tiling mode node to get its input neighborhood. */
VX_NODE_INPUT_NEIGHBORHOOD = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xB,
/*! \brief This allows a tiling mode node to get its output tile block size. */
VX_NODE_OUTPUT_TILE_BLOCK_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xC,
/*! \brief This is the size of the tile local memory area. */
VX_NODE_TILE_MEMORY_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xD,
#if defined(OPENVX_TILING_1_1)
/*! \brief This allows a tiling mode node to get its input tile block size. */
VX_NODE_INPUT_TILE_BLOCK_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xE,
/*! \brief This allows a tiling mode node to get its output neighborhood. */
VX_NODE_OUTPUT_NEIGHBORHOOD = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_NODE) + 0xF,
#endif
};
/*! \brief The tiling border mode extensions
* \ingroup group_tiling
*/
enum vx_border_tiling_e {
/*! \brief This value indicates that the author of the tiling kernel wrote
* code to handle border conditions into the kernel itself. If this mode
* is set, it can not be overriden by a call to the \ref vxSetNodeAttribute
* with \ref VX_NODE_BORDER.
*/
VX_BORDER_MODE_SELF = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_BORDER) + 0x3,
};
/*! \typedef vx_tiling_kernel_f
* \brief Tiling Kernel function typedef for User Tiling Kernels.
* \note Tiles may come in any dimension and are not guaranteed to be delivered in
* any particular order.
* \param [in] parameters The array abstract pointers to parameters.
* \param [in] tile_memory The local tile memory pointer if requested, otherwise NULL.
* \param [in] tile_memory_size The size of the local tile memory, if not requested, 0.
* \ingroup group_tiling
*/
#ifdef __cplusplus
typedef void (*vx_tiling_kernel_f)(void * VX_RESTRICT parameters[],
void * VX_RESTRICT tile_memory,
vx_size tile_memory_size);
#else
typedef void (*vx_tiling_kernel_f)(void * VX_RESTRICT parameters[VX_RESTRICT],
void * VX_RESTRICT tile_memory,
vx_size tile_memory_size);
#endif
#ifndef VX_IMAGE_PIXEL_DEFINITION
/*! \def vxImageOffset
* \brief Computes the offset within an image.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \param [in] i The plane index.
* \param [in] x The Width Coordinates.
* \param [in] y The Height Coordinates.
* \param [in] ox The X offset.
* \param [in] oy The Y offset.
* \ingroup group_tiling
*/
#define vxImageOffset(ptile, i, x, y, ox, oy) \
((ptile)->addr[i].stride_y * (vx_int32)(((vx_int32)((oy)+(y)) * (vx_int32)(ptile)->addr[i].scale_y)/(vx_int32)VX_SCALE_UNITY)) + \
((ptile)->addr[i].stride_x * (vx_int32)(((vx_int32)((ox)+(x)) * (vx_int32)(ptile)->addr[i].scale_x)/(vx_int32)VX_SCALE_UNITY))
/*! \def vxImagePixel
* \brief Accesses an image pixel as a type-cast indexed pointer dereference.
* \param [in] type The type of the image pixel. Example values are <tt>\ref vx_uint8</tt>, <tt>\ref vx_uint16</tt>, <tt>\ref vx_uint32</tt>, etc.
* \param [in] ptile The pointer to the \ref vx_tile_t structure.
* \param [in] i The plane index.
* \param [in] x The Center Pixel in Width Coordinates.
* \param [in] y The Center Pixel in Height Coordinates.
* \param [in] ox The X offset.
* \param [in] oy The Y offset.
* \ingroup group_tiling
*/
#define vxImagePixel(type, ptile, i, x, y, ox, oy) \
*((type *)(&((vx_uint8 *)(ptile)->base[i])[vxImageOffset(ptile, i, x, y, ox, oy)]))
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Allows a user to add a tile-able kernel to the OpenVX system.
* \param [in] context The handle to the implementation context.
* \param [in] name The string to be used to match the kernel.
* \param [in] enumeration The enumerated value of the kernel to be used by clients.
* \param [in] flexible_func_ptr The process-local flexible function pointer to be invoked.
* \param [in] fast_func_ptr The process-local fast function pointer to be invoked.
* \param [in] num_params The number of parameters for this kernel.
* \param [in] input The pointer to a function which will validate the
* input parameters to this kernel.
* \param [in] output The pointer to a function which will validate the
* output parameters to this kernel.
* \note Tiling Kernels do not have access to any of the normal node attributes listed
* in \ref vx_node_attribute_e.
* \post Call <tt>\ref vxAddParameterToKernel</tt> for as many parameters as the function has,
* then call <tt>\ref vxFinalizeKernel</tt>.
* \retval 0 Indicates that an error occurred when adding the kernel.
* Note that the fast or flexible formula, but not both, can be NULL.
* \ingroup group_tiling
*/
VX_API_ENTRY vx_kernel VX_API_CALL vxAddTilingKernel(vx_context context,
vx_char name[VX_MAX_KERNEL_NAME],
vx_enum enumeration,
vx_tiling_kernel_f flexible_func_ptr,
vx_tiling_kernel_f fast_func_ptr,
vx_uint32 num_params,
vx_kernel_input_validate_f input,
vx_kernel_output_validate_f output);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,96 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_VARIANT_H_
#define _VX_KHR_VARIANT_H_
/*!
* \file
* \brief The Khronos Extension for Kernel Variants.
*
* \defgroup group_variants Extension: Kernel Variants
* \brief The Khronos Extension for Kernel Variants.
* \details Kernel Variants allow the Client-Defined Functions to create several
* kernels on the same target with the same name, but with slight variations
* between them. Frequently these variants are expected to employ different
* algorithms or methodologies.
*
* All target specific kernels and target variants must conform to the same OpenVX
* specification of the OpenVX Kernel in order to use the string name and enumeration.
* For example, a vendor may supply multiple targets,
* and implement the same functionality on each. Futhermore the same
* vendor may offer a variant on some specific target which offers some differentiation but
* still conforms to the definition of the OpenVX Kernel.
* In this example there are 3 implementations of the same computer vision function, "Sobel3x3".
* \arg On "CPU" a "Sobel3x3" which is "faster". A variant which may produce slightly less accurate but still conformant results.
* \arg On "CPU" a "Sobel3x3" which is more "accurate". A variant which may run slower but produces bit exact results.
* \arg On "GPU" a "Sobel3x3" \e default variant which may run on a remote core and produce bit exact results.
*
* In each of the cases a client of OpenVX could request the kernels in nearly
* the same the same manner. There are two main approaches, which depend on the
* method a client calls to get the kernel reference. The first uses enumerations.
* This method allows to client to attempt to find other targets and variants, but if
* these are not present, the default node would still have been constructed.
* The second method depends on using fully qualified strings to get the kernel reference.
* This second method is more compact but is does not permit fail-safing to default versions.
*
* As part of this extension, the function <tt>vxGetKernelByName</tt> will now accept more
* qualifications to the string naming scheme. Kernels names can be additionally
* qualified in 2 separate ways, by target and by variant. A "fully" qualified name is in the format of
* <i>target</i><b>:</b><i>kernel</i><b>:</b><i>variant</i>.
* Both \e target and \e variant may be omitted (for an unqualified name).
* In this case, the implementation will assume the "default" value of these
* names (which could literally be "default"). Names may also be fully
* qualified with target included.
* Examples:
* \arg "khronos.c_model:org.khonos.openvx.sobel3x3:default" - fully qualified
* \arg "org.khronos.openvx.sobel3x3:default" (missing target) - partially qualified
* \arg "khronos.c_model:org.khronos.openvx.sobel3x3" (missing variant) - partially qualifed.
* \arg "org.khronos.openvx.sobel3x3" - unqualified.
*
*/
/*! \brief The string name of the extension.
* \ingroup group_variants
*/
#define OPENVX_KHR_VARIANTS "vx_khr_variants"
/*! \brief Defines the maximum number of characters in a variant string.
* \ingroup group_variants
*/
#define VX_MAX_VARIANT_NAME (64)
#include <VX/vx.h>
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Used to choose a variant of a kernel for execution on a particular node.
* \param [in] node The reference to the node.
* \param [in] variantName The name of the variant to choose.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \ingroup group_variants
*/
VX_API_ENTRY vx_status VX_API_CALL vxChooseKernelVariant(vx_node node, vx_char variantName[VX_MAX_VARIANT_NAME]);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,156 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_KHR_XML_H_
#define _VX_KHR_XML_H_
/*! \file
* \brief The OpenVX XML Schema Extension Header.
*
* \defgroup group_xml Extension: XML API
* \brief The Khronos Extension for OpenVX XML Import and Export Support.
*/
#define OPENVX_KHR_XML "vx_khr_xml"
#include <VX/vx.h>
/*! \brief The Object Type Enumeration for Imports.
* \ingroup group_xml
*/
enum vx_ext_import_type_e {
VX_TYPE_IMPORT = 0x814,/*!< \brief A <tt>\ref vx_import</tt> */
};
/*! \brief The import type enumeration.
* \ingroup group_xml
* \see VX_IMPORT_ATTRIBUTE_TYPE
*/
enum vx_ext_import_types_e {
VX_IMPORT_TYPE_XML = 0,/*!< \brief The XML import type */
};
/*! \brief The import attributes list
* \ingroup group_xml
* \see vxQueryImport
*/
enum vx_import_attribute_e {
/*! \brief Returns the number of references in the import object. Use a <tt>\ref vx_uint32</tt> parameter.*/
VX_IMPORT_ATTRIBUTE_COUNT = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMPORT) + 0x0,
/*! \brief Returns the type of import. Use a <tt>\ref vx_ext_import_types_e </tt> parameter */
VX_IMPORT_ATTRIBUTE_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_IMPORT) + 0x1,
};
/*! \brief An abstract handle to an import object.
* \ingroup group_xml
* \extends vx_reference
*/
typedef struct _vx_import *vx_import;
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief Exports all objects in the context to an XML file which uses the OpenVX
* XML Schema.
* \param [in] context The context to export.
* \param [in] xmlfile The file name to write the XML into.
* \note The reference numbers contained in the xml file can appear in any order but
* should be inclusive from index number 0 to [number of references - 1]. For example,
* if there are 20 references in the xml file, none of the reference indices should be >= 20.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \see https://www.khronos.org/registry/vx/schema/openvx-1-1.xsd
* \ingroup group_xml
*/
VX_API_ENTRY vx_status VX_API_CALL vxExportToXML(vx_context context, vx_char xmlfile[]);
/*! \brief Imports all framework and data objects from an XML file into the given context.
* \param [in] context The context to import into.
* \param [in] xmlfile The XML file to read.
* \note The reference indices in the import object corresponds with the reference numbers in the
* XML file. It is assumed that the program has some means to know which references to use from
* imported list (either by name: <tt>\ref vxGetImportReferenceByName</tt>, or by index from looking at the XML
* file (debug use case): <tt>\ref vxGetImportReferenceByIndex</tt>). Alternativly, the program can use
* <tt>\ref vxGetImportReferenceByIndex</tt> in a loop and query each one to understand what was imported. After
* all references of interest have been retrieved, this import obects should be released using
* <tt>\ref vxReleaseImport</tt>.
* \return \ref vx_import object containing references to the imported objects in the context
* \see https://www.khronos.org/registry/vx/schema/openvx-1-1.xsd
* \ingroup group_xml
*/
VX_API_ENTRY vx_import VX_API_CALL vxImportFromXML(vx_context context, vx_char xmlfile[]);
/*! \brief Used to retrieve a reference by name from the import when the name is known beforehand. If
* multiple references have the same name, then *any* one of them may be returned.
* \param [in] import The reference to the import object.
* \param [in] name The reference string name.
* \return <tt>\ref vx_reference</tt>
* \retval 0 Invalid import object or name does not match a reference in the import object.
* \retval * The reference matching the requested name.
* \note Use <tt>\ref vxReleaseReference</tt> to release the reference before releasing the context.
* \pre <tt>\ref vxImportFromXML</tt>
* \ingroup group_xml
*/
VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByName(vx_import import, const vx_char *name);
/*! \brief Used to retrieve a reference by the index from the import.
* \param [in] import The reference to the import object.
* \param [in] index The index of the reference in the import object to return.
* \return <tt>\ref vx_reference</tt>
* \retval 0 Invalid import object or index.
* \retval * The reference at the requested index number.
* \note Use <tt>\ref vxQueryImport</tt> with <tt>\ref VX_IMPORT_ATTRIBUTE_COUNT</tt> to retrieve
* the upper limit of references in the import.
* \note Use <tt>\ref vxReleaseReference</tt> to release the reference before releasing the context.
* \pre <tt>\ref vxImportFromXML</tt>
* \ingroup group_xml
*/
VX_API_ENTRY vx_reference VX_API_CALL vxGetImportReferenceByIndex(vx_import import, vx_uint32 index);
/*! \brief Used to query the import about its properties.
* \param [in] import The reference to the import object.
* \param [in] attribute The <tt>\ref vx_import_attribute_e</tt> value to query for.
* \param [out] ptr The location at which the resulting value will be stored.
* \param [in] size The size of the container to which ptr points.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \pre <tt>\ref vxImportFromXML</tt>
* \ingroup group_xml
*/
VX_API_ENTRY vx_status VX_API_CALL vxQueryImport(vx_import import, vx_enum attribute, void *ptr, vx_size size);
/*! \brief Releases a reference to an import object.
* Also internally releases its references to its imported objects. These
* imported objects may not be garbage collected until their total reference
* counts are zero.
* \param [in] import The pointer to the import object to release.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors.
* \retval VX_ERROR_INVALID_REFERENCE If import is not a <tt>\ref vx_import</tt>.
* \note After returning from this function the reference will be zeroed.
* \pre <tt>\ref vxImportFromXML</tt>
* \ingroup group_xml
*/
VX_API_ENTRY vx_status VX_API_CALL vxReleaseImport(vx_import *import);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,385 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _OPENVX_EXT_DEBUG_H_
#define _OPENVX_EXT_DEBUG_H_
#include <VX/vx.h>
/*!
* \file
* \brief The OpenVX Debugging Extension.
* \defgroup group_debug_ext Debugging Extension
* \defgroup group_vision_function_copy_image Kernel: Copy Image
* \defgroup group_vision_function_copy_array Kernel: Copy Array
* \defgroup group_vision_function_fwrite_image Kernel: File Write Image
* \defgroup group_vision_function_fwrite_array Kernel: File Write Array
* \defgroup group_vision_function_plus1 Kernel: Plus One Image
* \defgroup group_vision_function_fill_image Kernel: Fill Image
* \defgroup group_vision_function_check_image Kernel: Check Image
* \defgroup group_vision_function_check_array Kernel: Check Array
* \defgroup group_vision_function_compare_images Kernel: Compare Images
*/
/*! \brief The maximum filepath name length.
* \ingroup group_debug_ext
*/
#define VX_MAX_FILE_NAME (256)
/*! \brief The library value for the extension
* \ingroup group_debug_ext
*/
#define VX_LIBRARY_KHR_DEBUG (0xFF)
/*! \brief The list of extensions to OpenVX from the Sample Implementation.
* \ingroup group_debug_ext
*/
enum vx_kernel_debug_ext_e {
/*!
* \brief The Copy kernel. Output = Input.
* \param [in] vx_image The input image.
* \param [out] vx_image The output image.
* \see group_vision_function_copy_image
*/
VX_KERNEL_DEBUG_COPY_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x0,
/*!
* \brief The Copy Kernel, Output = Input.
* \param [in] vx_array The input array.
* \param [out] vx_array The output array.
* \see group_vision_function_copy_array
*/
VX_KERNEL_DEBUG_COPY_ARRAY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x1,
/*!
* \brief The File Writing Kernel for Images.
* \param [in] vx_image The input image.
* \param [in] vx_array The name of the file.
* \see group_vision_function_fwrite_image
*/
VX_KERNEL_DEBUG_FWRITE_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x2,
/*!
* \brief The File Writing Kernel for Arrays
* \param [in] vx_array The input array.
* \param [in] vx_array The name of the file.
* \see group_vision_function_fwrite_array
*/
VX_KERNEL_DEBUG_FWRITE_ARRAY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x3,
/*!
* \brief The File Reading Kernel for images.
* \param [in] vx_array The name of the file to read.
* \param [out] vx_image The output image.
* \see group_vision_function_fread_image
*/
VX_KERNEL_DEBUG_FREAD_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x4,
/*!
* \brief The File Reading Kernel for Arrays.
* \param [in] vx_array The name of the file to read.
* \param [out] vx_image The output image.
* \see group_vision_function_fread_array
*/
VX_KERNEL_DEBUG_FREAD_ARRAY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x5,
/*!
* \brief Fills the image with a given value.
* \param [in] vx_uint32
* \param [out] vx_image
* \ingroup group_vision_function_fill_image
*/
VX_KERNEL_FILL_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x6,
/*!
* \brief Checks an image against a known value and returns a number of
* errors.
* \param [in] vx_image
* \param [in] vx_uint32
* \param [out] vx_scalar
* \ingroup group_vision_function_check_image
*/
VX_KERNEL_CHECK_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x7,
/*!
* \brief Checks an array against a known value and returns a number of
* errors.
* \param [in] vx_array
* \param [in] vx_uint8
* \param [out] vx_scalar
* \ingroup group_vision_function_check_array
*/
VX_KERNEL_CHECK_ARRAY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x8,
/*!
* \brief Compares two images and returns the number of differences.
* \param [in] vx_image
* \param [in] vx_image
* \param [out] vx_scalar
* \ingroup group_vision_function_compare_image
*/
VX_KERNEL_COMPARE_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0x9,
/*!
* \brief Copies an image from a memory area.
* \param [in] void *
* \param [out] vx_image
* \see group_vision_function_copy_ptr
*/
VX_KERNEL_COPY_IMAGE_FROM_PTR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_DEBUG) + 0xA,
};
/******************************************************************************/
// GRAPH MODE FUNCTIONS
/******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \brief [Graph] Creates a Copy Image Node.
* \param [in] graph The handle to the graph.
* \param [in] input The input image.
* \param [out] output The output image.
* \see VX_KERNEL_COPY_IMAGE
* \note Graph Mode Function.
* \ingroup group_vision_function_copy_image
*/
vx_node vxCopyImageNode(vx_graph graph, vx_image input, vx_image output);
/*!
* \brief [Graph] Creates a Copy Array Node.
* \param [in] graph The handle to the graph.
* \param [in] input The input array.
* \param [out] output The output array.
* \see VX_KERNEL_COPY_ARRAY
* \note Graph Mode Function.
* \ingroup group_vision_function_copy_array
*/
vx_node vxCopyArrayNode(vx_graph graph, vx_array input, vx_array output);
/*! \brief [Graph] Writes the source image to the file.
* \param [in] graph The handle to the graph.
* \param [in] image The input array.
* \param [in] name The name of the file.
* \note Graph Mode Function.
* \ingroup group_vision_function_fwrite_image
*/
vx_node vxFWriteImageNode(vx_graph graph, vx_image image, vx_char name[VX_MAX_FILE_NAME]);
/*! \brief [Graph] Writes the source array to the file.
* \param [in] graph The handle to the graph.
* \param [in] array The input array.
* \param [in] name The name of the file.
* \note Graph Mode Function.
* \ingroup group_vision_function_fwrite_array
*/
vx_node vxFWriteArrayNode(vx_graph graph, vx_array array, vx_char name[VX_MAX_FILE_NAME]);
/*! \brief [Graph] Writes the source image to the file.
* \param [in] graph The handle to the graph.
* \param [in] name The name of the file.
* \param [out] image The output image.
* \note Graph Mode Function.
* \ingroup group_vision_function_fread_image
*/
vx_node vxFReadImageNode(vx_graph graph, vx_char name[VX_MAX_FILE_NAME], vx_image image);
/*! \brief [Graph] Writes the source array to the file.
* \param [in] graph The handle to the graph.
* \param [in] name The name of the file.
* \param [out] array The output array.
* \note Graph Mode Function.
* \ingroup group_vision_function_fread_array
*/
vx_node vxFReadArrayNode(vx_graph graph, vx_char name[VX_MAX_FILE_NAME], vx_array array);
/*! \brief [Graph] Adds 1 to each uint8 pixel. This will clamp at 255.
* \param [in] graph The handle to the graph.
* \param [in,out] image The image to increment.
* \note Graph Mode Function
* \ingroup group_vision_function_plus1
*/
vx_node vxPlusOneNode(vx_graph graph, vx_image image);
/*!
* \brief [Graph] Fills an image with a known value.
* \param [in] graph The handle to the graph.
* \param [in] value The known value to fill the image with.
* \param [out] output The image to fill.
* \note Graph Mode Function
* \ingroup group_vision_function_fill_image
*/
vx_node vxFillImageNode(vx_graph graph, vx_uint32 value, vx_image output);
/*!
* \brief [Graph] Checks an image against a known value.
* \param [in] graph The handle to the graph.
* \param [in] input The image to check.
* \param [in] value The known value to check the image against.
* \param [out] errs The handle to the number of errors found.
* \note Graph Mode Function
* \ingroup group_vision_function_check_image
*/
vx_node vxCheckImageNode(vx_graph graph, vx_image input, vx_uint32 value, vx_scalar errs);
/*!
* \brief [Graph] Checks a array for a known value.
* \param [in] graph The handle to the graph.
* \param [in] input The array to check.
* \param [in] value The known value to check against.
* \param [out] errs An output of the number of errors.
* \note Graph Mode Function
* \ingroup group_vision_function_check_array
*/
vx_node vxCheckArrayNode(vx_graph graph, vx_array input, vx_uint8 value, vx_scalar errs);
/*!
* \brief [Graph] Compares two images and returns the number of pixel sub-channels
* which are different.
* \param [in] graph The handle to the graph.
* \param [in] a The first image.
* \param [in] b The second image.
* \param [out] diffs The handle to scalar to hold the number of differences.
* \note Graph Mode Function
* \ingroup group_vision_function_compare_image
*/
vx_node vxCompareImagesNode(vx_graph graph, vx_image a, vx_image b, vx_scalar diffs);
/*! \brief [Graph] Copies a HOST memory area into an image.
* \param [in] graph The handle to the graph.
* \param [in] ptr The input pointer to the memory area to copy.
* \param [out] output The output image.
* \note Graph Mode Function
* \ingroup group_vision_function_copy_ptr
*/
vx_node vxCopyImageFromPtrNode(vx_graph graph, void *ptr, vx_image output);
/******************************************************************************/
// IMMEDIATE MODE FUNCTION
/******************************************************************************/
/*! \brief [Immediate] Copies the source image to the destination image.
* \param [in] src The input image.
* \param [in] dst The output image.
* \note Immediate Mode Function.
* \ingroup group_vision_function_copy_image
*/
vx_status vxuCopyImage(vx_context context, vx_image src, vx_image dst);
/*! \brief [Immediate] Copies the source array to the destination array.
* \param [in] src The input array.
* \param [in] dst The output array.
* \note Immediate Mode Function.
* \ingroup group_vision_function_copy_array
*/
vx_status vxuCopyArray(vx_context context, vx_array src, vx_array dst);
/*! \brief [Immediate] Writes the source image to the file.
* \param [in] image The input array.
* \param [in] name The name of the file.
* \note Immediate Mode Function.
* \ingroup group_vision_function_fwrite_image
*/
vx_status vxuFWriteImage(vx_context context, vx_image image, vx_char name[VX_MAX_FILE_NAME]);
/*! \brief [Immediate] Writes the source array to the file.
* \param [in] array The input array.
* \param [in] name The name of the file.
* \note Immediate Mode Function.
* \ingroup group_vision_function_fwrite_array
*/
vx_status vxuFWriteArray(vx_context context, vx_array array, vx_char name[VX_MAX_FILE_NAME]);
/*! \brief [Immediate] Reads the source image from the file.
* \param [in] name The name of the file.
* \param [out] image The output image.
* \note Immediate Mode Function.
* \ingroup group_vision_function_fread_image
*/
vx_status vxuFReadImage(vx_context context, vx_char name[VX_MAX_FILE_NAME], vx_image image);
/*! \brief [Immediate] Reads the source array from the file.
* \param [in] name The name of the file.
* \param [out] array The output array.
* \note Immediate Mode Function.
* \ingroup group_vision_function_fread_array
*/
vx_status vxuFReadArray(vx_context context, vx_char name[VX_MAX_FILE_NAME], vx_array array);
/*! \brief [Immediate] Adds 1 to each uint8 pixel. This will clamp at 255.
* \param [in,out] image The image to increment.
* \note Immediate Mode Function
* \ingroup group_vision_function_plus1
*/
vx_node vxuPlusOneNode(vx_context context, vx_image image);
/*!
* \brief [Immediate] Fills an image with a known value.
* \param [in] value The known value to fill the image with.
* \param [out] output The image to fill.
* \note Immediate Mode Function
* \ingroup group_vision_function_fill_image
*/
vx_status vxuFillImage(vx_context context, vx_uint32 value, vx_image output);
/*!
* \brief [Immediate] Checks an image against a known value.
* \param [in] output The image to check.
* \param [in] value The known value to check the image against.
* \param [out] numErrors The handle to the number of errors found.
* \note Immediate Mode Function
* \ingroup group_vision_function_check_image
*/
vx_status vxuCheckImage(vx_context context, vx_image input, vx_uint32 value, vx_uint32 *numErrors);
/*!
* \brief [Immediate] Checks a array for a known value.
* \param [in] input The array to check.
* \param [in] value The known value to check against.
* \param [out] numErrors An output of the number of errors.
* \note Immediate Mode Function
* \ingroup group_vision_function_check_array
*/
vx_status vxuCheckArray(vx_context context, vx_array input, vx_uint8 value, vx_uint32 *numErrors);
/*!
* \brief [Immediate] Compares two images and returns the number of pixel sub-channels
* which are different.
* \param [in] a The first image.
* \param [in] b The second image.
* \param [out] numDiffs The handle to scalar to hold the number of differences.
* \note Immediate Mode Function
* \ingroup group_vision_function_compare_image
*/
vx_status vxuCompareImages(vx_context context, vx_image a, vx_image b, vx_uint32 *numDiffs);
/*! \brief [Immediate] Copies a HOST memory area into an image.
* \param [in] ptr The input pointer to the memory area to copy.
* \param [out] output The output image.
* \note Immediate Mode Function
* \ingroup group_vision_function_copy_ptr
*/
vx_status vxuCopyImageFromPtr(vx_context context, void *ptr, vx_image output);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,252 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _VX_EXT_EXTRAS_H_
#define _VX_EXT_EXTRAS_H_
/*! \file
* \brief Extras Extension.
*
* \defgroup group_extras_ext Khronos Extras Extension.
* \brief A Set of Kernels which extend OpenVX.
*
* \defgroup group_vision_function_laplacian_image Kernel: Laplacian Filter
* \brief Computes a Laplacian filter over a window of the input image.
* \details This filter uses the follow convolution matrix:
\f[
\mathbf{K}_{gaussian} = \begin{vmatrix}
1 & 1 & 1\\
1 &-8 & 1\\
1 & 1 & 1
\end{vmatrix} * \frac{1}{1}
\f]
*
* \defgroup group_vision_function_scharr3x3 Kernel: Sobel 3x3
* \brief The Scharr Image Filter Kernel
* \details This kernel produces two output planes (one can be omitted)
* in the x and y plane. The Scharr operators \f$G_x, G_y\f$ are defined as:
\f[
\mathbf{G}_x=\begin{vmatrix}
-3 & 0 & +3\\
-10& 0 & +10\\
-3 & 0 & +3
\end{vmatrix}
,
\mathbf{G}_y=\begin{vmatrix}
-3 & -10 & -3 \\
0 & 0 & 0 \\
+3 & +10 & +3
\end{vmatrix}
\f]
*
*/
/*! \brief The Khronos Extras Library
* \ingroup group_extras_ext
*/
#define VX_LIBRARY_KHR_EXTRAS (0xFE)
/*! \brief The Khronos Extras Kernels.
* \ingroup group_extras_ext
*/
enum vx_kernel_extras_ext_e {
/*! \brief The Non-Maximum Supression Kernel for Canny.
* \note Use "org.khronos.extra.nonmaximasuppression" to \ref vxGetKernelByName.
* \param [in] vx_image The magnitude image in VX_DF_IMAGE_U8.
* \param [in] vx_image The phase image in VX_DF_IMAGE_U8.
* \param [out] vx_image The edge image in VX_DF_IMAGE_U8.
* \ingroup group_vision_function_nonmaxsuppression
*/
VX_KERNEL_EXTRAS_NONMAXSUPPRESSION_CANNY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x0,
/*! \brief The laplacian filter kernel.
* \note Use "org.khronos.extras.laplacian3x3" to \ref vxGetKernelByName.
* \param [in] vx_image The VX_DF_IMAGE_U8 input image.
* \param [out] vx_image The VX_DF_IMAGE_U8 output image.
* \see group_vision_function_laplacian_image
*/
VX_KERNEL_EXTRAS_LAPLACIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x1,
/*! \brief The scharr filter kernel.
* \note Use "org.khronos.extras.scharr3x3" to \ref vxGetKernelByName.
* \param [in] vx_image The VX_DF_IMAGE_U8 input image.
* \param [out] vx_image The VX_DF_IMAGE_S16 output gradient x image.
* \param [out] vx_image The VX_DF_IMAGE_S16 output gradient y image.
* \see group_vision_function_scharr3x3
*/
VX_KERNEL_EXTRAS_SCHARR_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x2,
/*! \brief The Harris Score Kernel.
* \note use "org.khronos.extras.harris_score".
* \param [in] vx_image A VX_DF_IMAGE_S16 X Gradient
* \param [in] vx_image A VX_DF_IMAGE_S16 Y Gradient
* \param [in] vx_scalar A block size.
* \param [out] vx_image A VX_DF_IMAGE_S32 corner score per pixel.
* \ingroup group_vision_function_harris_score
*/
VX_KERNEL_EXTRAS_HARRIS_SCORE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x3,
/*! \brief The Sobel MxN kernel.
* \note Use "org.khronos.extras.sobelMxN" to \ref vxGetKernelByName.
* \param [in] vx_image The VX_DF_IMAGE_U8 input image.
* \param [in] vx_scalar Window Size (3,5,7)
* \param [out] vx_image The VX_DF_IMAGE_S16 output gradient x image.
* \param [out] vx_image The VX_DF_IMAGE_S16 output gradient y image.
* \see group_vision_function_sobelmxn
*/
VX_KERNEL_EXTRAS_SOBEL_MxN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x4,
/*! \brief The image to list converter.
* \param [in] vx_image The VX_DF_IMAGE_U8 or VX_DF_IMAGE_S32 image.
* \param [out] vx_array The array of output
* \param [out] vx_scalar The total number of non zero points in image (optional)
* \ingroup group_vision_function_image_lister
*/
VX_KERNEL_EXTRAS_IMAGE_LISTER = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x5,
/*! \brief The Euclidean Non-Maximum Suppression Kernel for Harris Corners.
* \param [in] vx_image The VX_DF_IMAGE_F32 image.
* \param [in] vx_scalar The minimum threshold
* \param [in] vx_scalar The euclidean distance from the considered pixel.
* \param [out] vx_image The VX_DF_IMAGE_F32 image.
* \ingroup group_vision_function_euclidean_nonmax
*/
VX_KERNEL_EXTRAS_EUCLIDEAN_NONMAXSUPPRESSION_HARRIS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x6,
/*! \brief Elementwise binary norm kernel.
* \param [in] vx_image Left image (VX_DF_IMAGE_S16).
* \param [in] vx_image Right image (VX_DF_IMAGE_S16).
* \param [in] vx_scalar Norm type (vx_norm_type_e).
* \param [in] vx_image Output image (VX_DF_IMAGE_U16).
*/
VX_KERNEL_EXTRAS_ELEMENTWISE_NORM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x7,
/*! \brief Edge tracing kernel.
* \param [in] vx_image Norm image (VX_DF_IMAGE_U16).
* \param [in] vx_image Phase image (VX_DF_IMAGE_U8).
* \param [in] vx_threshold Threshold (VX_THRESHOLD_TYPE_RANGE).
* \param [out] vx_image Output binary image (VX_DF_IMAGE_U8).
*/
VX_KERNEL_EXTRAS_EDGE_TRACE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_EXTRAS) + 0x8
};
/*! \brief Extra VX_DF_IMAGE codes supported by this extension. */
enum _vx_extra_df_image {
/*! \brief A single plane of 32 bit float data.
* The range of the data is not specified.
*/
VX_DF_IMAGE_F32 = VX_DF_IMAGE('F','0','3','2'),
};
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief [Graph] Creates a Non Max Suppress Node.
* \param [in] graph The handle to the graph.
* \param [in] input The input image in VX_DF_IMAGE_U8 format.
* \param [out] output The output image in VX_DF_IMAGE_U8 format.
* \ingroup group_vision_function_laplacian_image
*/
vx_node vxNonMaxSuppressionCannyNode(vx_graph graph, vx_image mag, vx_image phase, vx_image edge);
/*! \brief [Immediate] Creates a Non Max Suppress Node.
* \param [in] graph The handle to the graph.
* \param [in] input The input image in VX_DF_IMAGE_U8 format.
* \param [out] output The output image in VX_DF_IMAGE_U8 format.
* \ingroup group_vision_function_laplacian_image
*/
vx_status vxuNonMaxSuppressionCanny(vx_context context, vx_image mag, vx_image phase, vx_image edge);
/*! \brief [Graph] Creates a Laplacian Filter Node.
* \param [in] graph The handle to the graph.
* \param [in] input The input image in VX_DF_IMAGE_U8 format.
* \param [out] output The output image in VX_DF_IMAGE_U8 format.
* \ingroup group_vision_function_laplacian_image
*/
vx_node vxLaplacian3x3Node(vx_graph graph, vx_image input, vx_image output);
/*! \brief [Immediate] Computes a laplacian filter on the image by a 3x3 window.
* \param [in] input The input image in VX_DF_IMAGE_U8 format.
* \param [out] output The output image in VX_DF_IMAGE_U8 format.
* \ingroup group_vision_function_laplacian_image
*/
vx_status vxuLaplacian3x3(vx_context context, vx_image input, vx_image output);
/*! \brief [Graph] Creates a Scharr Filter Node.
* \param [in] graph The handle to the graph.
* \param [in] input The input image in VX_DF_IMAGE_U8 format.
* \param [out] output The output image in VX_DF_IMAGE_U8 format.
* \ingroup group_vision_function_laplacian_image
*/
vx_node vxScharr3x3Node(vx_graph graph, vx_image input, vx_image output1, vx_image output2);
/*! \brief [Immediate] Computes a Scharr filter on the image by a 3x3 window.
* \param [in] input The input image in VX_DF_IMAGE_U8 format.
* \param [out] output The output image in VX_DF_IMAGE_U8 format.
* \ingroup group_vision_function_laplacian_image
*/
vx_status vxuScharr3x3(vx_context context, vx_image input, vx_image output1, vx_image output2);
vx_node vxSobelMxNNode(vx_graph graph, vx_image input, vx_scalar win, vx_image gx, vx_image gy);
vx_status vxuSobelMxN(vx_context context, vx_image input, vx_scalar win, vx_image gx, vx_image gy);
vx_node vxHarrisScoreNode(vx_graph graph,
vx_image gx,
vx_image gy,
vx_scalar sensitivity,
vx_scalar grad_size,
vx_scalar block_size,
vx_scalar shift,
vx_image score);
vx_status vxuHarrisScore(vx_context context, vx_image gx,
vx_image gy,
vx_scalar sensitivity,
vx_scalar grad_size,
vx_scalar block_size,
vx_scalar shift,
vx_image score);
vx_node vxEuclideanNonMaxHarrisNode(vx_graph graph,
vx_image input,
vx_scalar strength_thresh,
vx_scalar min_distance,
vx_image output);
vx_status vxuEuclideanNonMaxHarris(vx_context context, vx_image input,
vx_scalar strength_thresh,
vx_scalar min_distance,
vx_image output);
vx_node vxImageListerNode(vx_graph graph, vx_image input, vx_array arr, vx_scalar num_points);
vx_status vxuImageLister(vx_context context, vx_image input,
vx_array arr, vx_scalar num_points);
vx_node vxElementwiseNormNode(vx_graph graph, vx_image input_x, vx_image input_y, vx_scalar norm_type, vx_image output);
vx_node vxEdgeTraceNode(vx_graph graph, vx_image norm, vx_threshold threshold, vx_image output);
#ifdef __cplusplus
}
#endif
#endif /* _VX_EXT_EXTRAS_H_ */

View File

@ -0,0 +1,109 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#ifndef _OPENVX_EXT_XYZ_H_
#define _OPENVX_EXT_XYZ_H_
/*!
* \file
* \brief An example of how to wrap a User Extension Kernel.
*
* \defgroup group_xyz_ext The Example User Kernel Extension
*
*/
#include <VX/vx.h>
/*!
* \file vx_ext_xyz.h
* \brief The example header for how to write a user mode extension to OpenVX.
*/
/*! \brief The XYZ Data area in bytes
* \ingroup group_xyz_ext
*/
#define XYZ_DATA_AREA (1024)
/*! \brief The required number of items in the temp array
* \ingroup group_xyz_ext
*/
#define XYZ_TEMP_NUMITEMS (374)
/*! \brief The minimum value of the scalar for the XYZ Kernel.
* \ingroup group_xyz_ext
*/
#define XYZ_VALUE_MIN (-10)
/*! \brief The maximum value of the scalar for the XYZ Kernel.
* \ingroup group_xyz_ext
*/
#define XYZ_VALUE_MAX (10)
//! [KERNEL ENUM]
#define VX_KERNEL_NAME_KHR_XYZ "org.khronos.example.xyz"
/*! \brief The XYZ Example Library Set
* \ingroup group_xyz_ext
*/
#define VX_LIBRARY_XYZ (0x3) // assigned from Khronos, vendors control their own
/*! \brief The list of XYZ Kernels.
* \ingroup group_xyz_ext
*/
enum vx_kernel_xyz_ext_e {
/*! \brief The Example User Defined Kernel */
VX_KERNEL_KHR_XYZ = VX_KERNEL_BASE(VX_ID_DEFAULT, VX_LIBRARY_XYZ) + 0x0,
// up to 0xFFF kernel enums can be created.
};
//! [KERNEL ENUM]
#ifdef __cplusplus
extern "C" {
#endif
//! [node]
/*! \brief [Graph] This is an example ISV or OEM provided node which executes
* in the Graph to call the XYZ kernel.
* \param [in] graph The handle to the graph in which to instantiate the node.
* \param [in] input The input image.
* \param [in] value The input scalar value
* \param [out] output The output image.
* \param [in,out] temp A temp array for some data which is needed for
* every iteration.
* \ingroup group_example_kernel
*/
vx_node vxXYZNode(vx_graph graph, vx_image input, vx_uint32 value, vx_image output, vx_array temp);
//! [node]
//! [vxu]
/*! \brief [Immediate] This is an example of an immediate mode version of the XYZ node.
* \param [in] context The overall context of the implementation.
* \param [in] input The input image.
* \param [in] value The input scalar value
* \param [out] output The output image.
* \param [in,out] temp A temp array for some data which is needed for
* every iteration.
* \ingroup group_example_kernel
*/
vx_status vxuXYZ(vx_context context, vx_image input, vx_uint32 value, vx_image output, vx_array temp);
//! [vxu]
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,377 @@
#ifndef _VX_SPINST_H_
#define _VX_SPINST_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef enum _vx_sp_inst_type_e
{
VX_SP_INST_TYPE_FADD,
VX_SP_INST_TYPE_FMULT,
VX_SP_INST_TYPE_MOVE,
VX_SP_INST_TYPE_PWL,
VX_SP_INST_TYPE_COUNT,
}
vx_sp_inst_type_e;
typedef enum _vx_sp_inst_type_fadd_e
{
VX_SP_INST_TYPE_FADD_IDLE, // FADD-IDLE
VX_SP_INST_TYPE_FADD_ADD, // dst = src0 + src1
VX_SP_INST_TYPE_FADD_SUB, // dst = src0 - src1
VX_SP_INST_TYPE_FADD_COUNT,
}
vx_sp_inst_type_fadd_e;
typedef enum _vx_sp_inst_type_fmult_e
{
VX_SP_INST_TYPE_FMULT_IDLE, /* FMULT-IDLE */
VX_SP_INST_TYPE_FMULT_MUL, /* dst = src0 * src1 */
VX_SP_INST_TYPE_FMULT_MUL_CLAMP, /* dst = clamp (src0, src1, R6, R7) */
VX_SP_INST_TYPE_FMULT_COUNT,
}
vx_sp_inst_type_fmult_e;
typedef enum _vx_sp_inst_type_move_e
{
VX_SP_INST_TYPE_MOVE_IDLE,
VX_SP_INST_TYPE_MOVE_MOVE, // dst = src1
VX_SP_INST_TYPE_MOVE_SEL0, // dst = (src0 > 0) ? src1[0] : src1[1]
VX_SP_INST_TYPE_MOVE_SEL1, // dst = (src0 > 0) ? src1 : FA-src0 // use FA's SRC0
VX_SP_INST_TYPE_MOVE_IMMD, // dst = Constant assign immmediate
VX_SP_INST_TYPE_MOVE_ABS, // dst = abs(src1)
VX_SP_INST_TYPE_MOVE_COUNT,
}
vx_sp_inst_type_move_e;
typedef enum _vx_sp_inst_type_pwl_e
{
VX_SP_INST_TYPE_PWL_IDLE,
VX_SP_INST_TYPE_PWL_SETUP_0, /* PWL ID = 0 */
VX_SP_INST_TYPE_PWL_SETUP_1, /* Sigmode() */
VX_SP_INST_TYPE_PWL_SETUP_2, /* Tanh() */
VX_SP_INST_TYPE_PWL_COUNT,
}
vx_sp_inst_type_pwl_e;
typedef enum _vx_sp_inst_src_dst_e
{
VX_SP_INST_SPINOUT,
VX_SP_INST_SR1,
VX_SP_INST_SR2,
VX_SP_INST_SR3,
VX_SP_INST_SR4,
VX_SP_INST_SR5,
VX_SP_INST_SR6, /* nn_clamp_min */
VX_SP_INST_SR7, /* nn_clamp_max */
VX_SP_INST_SR8,
VX_SP_INST_SR9,
VX_SP_INST_SR10,
VX_SP_INST_VR11,
VX_SP_INST_VR12,
VX_SP_INST_VR13,
VX_SP_INST_VR14,
VX_SP_INST_SETUPOUT, /* Input of PWL Mult and Add: FMInA, FMInB, FAInA, FAInB */
}
vx_sp_inst_src_dst_e;
typedef struct _vx_spinst_unit_param
{
vx_enum op; /* vx_sp_inst_type_e */
struct
{
vx_enum op; /* vx_sp_inst_type_fadd/fmult/move/pwl_e */
struct
{
vx_uint8 src0; /* vx_sp_inst_src_dst_e */
vx_uint8 src1; /* vx_sp_inst_src_dst_e */
vx_uint8 dst; /* vx_sp_inst_src_dst_e */
vx_float32 constant;
} var;
} sub;
}
vx_spinst_unit_param;
/**********************************************************************************************/
typedef enum _vx_sp_attribute_e
{
VX_SP_ATTRIBUTE_NONE,
VX_SP_ATTRIBUTE_INPUT_TILE_MAPPING,
VX_SP_ATTRIBUTE_OUTPUT_COLLAPSE_X,
VX_SP_ATTRIBUTE_OUTPUT_COLLAPSE_Y,
VX_SP_ATTRIBUTE_OUTPUT_COLLAPSE_Z,
VX_SP_ATTRIBUTE_PROG_INIT_INSTR_NUM,
VX_SP_ATTRIBUTE_PROG_LOOP_INSTR_NUM,
VX_SP_ATTRIBUTE_PROG_COMPLETE_INSTR_NUM,
VX_SP_ATTRIBUTE_PROG_ROUNDING_MODE,
VX_SP_ATTRIBUTE_INPUT_SETUP,
VX_SP_ATTRIBUTE_IGNORED_LEADING_OUTPUTS,
VX_SP_ATTRIBUTE_FLUSH_CYCLE_NUM,
VX_SP_ATTRIBUTE_IGNORED_LEADING_V11_WR,
VX_SP_ATTRIBUTE_IGNORED_LEADING_V12_WR,
VX_SP_ATTRIBUTE_IGNORED_LEADING_V11_RD,
VX_SP_ATTRIBUTE_IGNORED_LEADING_V12_RD,
VX_SP_ATTRIBUTE_CH0_POST_REDISTRIBUTE,
VX_SP_ATTRIBUTE_CH1_POST_REDISTRIBUTE,
VX_SP_ATTRIBUTE_V11_RESET_AT_START,
VX_SP_ATTRIBUTE_V12_RESET_AT_START,
VX_SP_ATTRIBUTE_V11_POP_CONFIG,
VX_SP_ATTRIBUTE_V12_POP_CONFIG,
VX_SP_ATTRIBUTE_ACCELERATOR_INPUT_SELECT,
VX_SP_ATTRIBUTE_IGNORED_LEADING_ACC_OUT,
VX_SP_ATTRIBUTE_SUM_ENGINE_RESET,
VX_SP_ATTRIBUTE_SUM_ENGINE_CONTROL,
VX_SP_ATTRIBUTE_SUM_ENGINE_NUM_CH_MINUS_ONE,
VX_SP_ATTRIBUTE_SUM_ENGINE_2D_ACCUM_STORAGE,
VX_SP_ATTRIBUTE_SUM_ENGINE_OP_SELECT,
VX_SP_ATTRIBUTE_NUM_OF_ELEMENTS_PER_LOOP_PER_INPUT,
VX_SP_ATTRIBUTE_NUM_OF_V11_RD_IN_FLUSH_CYCLE,
VX_SP_ATTRIBUTE_NUM_OF_V12_RD_IN_FLUSH_CYCLE,
VX_SP_ATTRIBUTE_NUM_OF_V11_WR_IN_FLUSH_CYCLE,
VX_SP_ATTRIBUTE_NUM_OF_V12_WR_IN_FLUSH_CYCLE,
VX_SP_ATTRIBUTE_GENERAL_COUNT,
VX_SP_ATTRIBUTE_CONST0, /* NN post multiplier */
VX_SP_ATTRIBUTE_CONST1, /* NN neg pos multiplier */
VX_SP_ATTRIBUTE_CONST2, /* NN tensor add const */
VX_SP_ATTRIBUTE_CONST3, /* NN clamp max */
VX_SP_ATTRIBUTE_CONST4, /* NN clmap min */
VX_SP_ATTRIBUTE_CONST_COUNT,
VX_SP_ATTRIBUTE_SPLIT_AXIS,
VX_SP_ATTRIBUTE_SPLIT_MAX_SIZE,
VX_SP_ATTRIBUTE_SPLIT_TILEX_EQUAL_INIMAGEX,
VX_SP_ATTRIBUTE_NOT_MERGE_CONVSP,
VX_SP_ATTRIBUTE_UPDATE_CONST0_TO_PCQ_COEF_TENSOR,
VX_SP_ATTRIBUTE_RESHAPE_ARRAY, /* bit layout | output:24-29 | input3:18-23 | input2:12-17 | input1:6-11 | input0:0-5 | */
VX_SP_ATTRIBUTE_ALIGN_SP_CORE_AXIS,
VX_SP_ATTRIBUTE_KEEP_TILE_SIZE,
VX_SP_ATTRIBUTE_TOTAL_COUNT,
}
vx_sp_attribute_e;
typedef enum _vx_sp_attribute_input_tile_mapping_e
{
VX_SP_ATTRIBUTE_INPUT_TILE_MAPPING_XYMERGE,
VX_SP_ATTRIBUTE_INPUT_TILE_MAPPING_YZMERGE,
}
vx_sp_attribute_input_tile_mapping_e;
typedef enum _vx_sp_attribute_output_collapse_e
{
VX_SP_ATTRIBUTE_OUTPUT_COLLAPSE_DISABLED,
VX_SP_ATTRIBUTE_OUTPUT_COLLAPSE_ENABLED,
}
vx_sp_attribute_output_collapse_e;
typedef enum _vx_sp_attribute_rounding_mode_e
{
VX_SP_ATTRIBUTE_PROG_ROUNDING_MODE_RTNE,
VX_SP_ATTRIBUTE_PROG_ROUNDING_MODE_STICKY,
}
vx_sp_attribute_rounding_mode_e;
typedef enum _vx_sp_attribute_input_setup_e
{
VX_SP_ATTRIBUTE_INPUT_SETUP_SINGLE_INPUT,
VX_SP_ATTRIBUTE_INPUT_SETUP_INTERLEAVE_TWO_INPUTS,
VX_SP_ATTRIBUTE_INPUT_SETUP_V11,
VX_SP_ATTRIBUTE_INPUT_SETUP_V12,
}
vx_sp_attribute_input_setup_e;
typedef enum _vx_sp_attribute_ch_post_redistribute_e
{
VX_SP_ATTRIBUTE_CH_POST_REDISTRIBUTE_DISABLED,
VX_SP_ATTRIBUTE_CH_POST_REDISTRIBUTE_SCALAR_GATHER,
VX_SP_ATTRIBUTE_CH_POST_REDISTRIBUTE_VECTOR_GATHER,
VX_SP_ATTRIBUTE_CH_POST_REDISTRIBUTE_VECTOR_SCATTER,
}
vx_sp_attribute_ch_post_redistribute_e;
typedef enum _vx_sp_attribute_v_reset_at_start_e
{
VX_SP_ATTRIBUTE_V_RESET_AT_START_NONE,
VX_SP_ATTRIBUTE_V_RESET_AT_START_RESET,
}
vx_sp_attribute_v_reset_at_start_e;
typedef enum _vx_sp_attribute_v_pop_config_e
{
VX_SP_ATTRIBUTE_V_POP_CONFIG_EVERY_READ,
VX_SP_ATTRIBUTE_V_POP_CONFIG_EVERY_ROW,
}
vx_sp_attribute_v_pop_config_e;
typedef enum _vx_sp_attribute_accelerator_input_select_e
{
VX_SP_ATTRIBUTE_ACCELERATOR_INPUT_SELECT_FROM_OUTPUT,
VX_SP_ATTRIBUTE_ACCELERATOR_INPUT_SELECT_FROM_ACCLERATOR,
}
vx_sp_attribute_accelerator_input_select_e;
typedef enum _vx_sp_attribute_sum_engine_reset_e
{
VX_SP_ATTRIBUTE_SUM_ENGINE_RESET_NONE,
VX_SP_ATTRIBUTE_SUM_ENGINE_RESET_RESET,
}
vx_sp_attribute_sum_engine_reset_e;
typedef enum _vx_sp_attribute_sum_engine_control_e
{
VX_SP_ATTRIBUTE_SUM_ENGINE_CONTROL_ACCUM_INTERNAL,
VX_SP_ATTRIBUTE_SUM_ENGINE_CONTROL_ACCUM_1D,
VX_SP_ATTRIBUTE_SUM_ENGINE_CONTROL_ACCUM_2D,
}
vx_sp_attribute_sum_engine_control_e;
typedef enum _vx_sp_attribute_sum_engine_num_ch_minus_one_e
{
VX_SP_ATTRIBUTE_SUM_ENGINE_NUM_CH_MINUS_ONE_ONE_CH,
VX_SP_ATTRIBUTE_SUM_ENGINE_NUM_CH_MINUS_ONE_TWO_CH,
}
vx_sp_attribute_sum_engine_num_ch_minus_one_e;
typedef enum _vx_sp_attribute_sum_engine_2d_accum_storage_e
{
VX_SP_ATTRIBUTE_SUM_ENGINE_2D_ACCUM_STORAGE_SAME,
VX_SP_ATTRIBUTE_SUM_ENGINE_2D_ACCUM_STORAGE_DIFFERENT,
}
vx_sp_attribute_sum_engine_2d_accum_storage_e;
typedef enum _vx_sp_attribute_sum_engine_op_select_e
{
VX_SP_ATTRIBUTE_SUM_ENGINE_SUM_OP,
VX_SP_ATTRIBUTE_SUM_ENGINE_MAX_OP
} vx_sp_attribute_sum_engine_op_select_e;
typedef enum _vx_sp_attribute_reshape_e
{
VX_SP_ATTRIBUTE_RESHAPE_CHW2CHW = 0x00,
VX_SP_ATTRIBUTE_RESHAPE_CHW2WHC = 0x06,
VX_SP_ATTRIBUTE_RESHAPE_CHW2WCH = 0x09,
VX_SP_ATTRIBUTE_RESHAPE_CHW2HWC = 0x12,
VX_SP_ATTRIBUTE_RESHAPE_CHW2HCW = 0x18,
VX_SP_ATTRIBUTE_RESHAPE_CHW2CWH = 0x21,
}
vx_sp_attribute_reshape_e;
typedef enum _vx_sp_attribute_split_axis_e
{
VX_SP_ATTRIBUTE_SPLIT_ON_AXIS_X,
VX_SP_ATTRIBUTE_SPLIT_ON_AXIS_Y,
VX_SP_ATTRIBUTE_SPLIT_ON_AXIS_Z,
VX_SP_ATTRIBUTE_SPLIT_ON_AXIS_XY,
VX_SP_ATTRIBUTE_SPLIT_ON_AXIS_YZ,
VX_SP_ATTRIBUTE_SPLIT_ON_AXIS_XYZ,
}
vx_sp_attribute_split_axis_e;
typedef enum _vx_sp_attribute_tile_align_sp_core_e
{
VX_SP_ATTRIBUTE_TILE_ALIGN_SP_CORE_NONE = 0,
VX_SP_ATTRIBUTE_TILE_ALIGN_SP_CORE_WITH_AXIS_X,
VX_SP_ATTRIBUTE_TILE_ALIGN_SP_CORE_WITH_AXIS_Y,
VX_SP_ATTRIBUTE_TILE_ALIGN_SP_CORE_WITH_AXIS_XY,
}
vx_sp_attribute_tile_align_sp_core_e;
typedef enum _vx_sp_attribute_keep_tile_size_e
{
VX_SP_ATTRIBUTE_KEEP_TILE_SIZE_NONE = 0,
VX_SP_ATTRIBUTE_KEEP_TILE_SIZE_WITH_AXIS_X,
VX_SP_ATTRIBUTE_KEEP_TILE_SIZE_WITH_AXIS_Y,
VX_SP_ATTRIBUTE_KEEP_TILE_SIZE_WITH_AXIS_XY,
}
vx_sp_attribute_keep_tile_size_e;
/**********************************************************************************************/
/*! \brief Creates an external reference to a spinst data.
* \param [in] context The reference to the implementation context.
* \return A spinst data reference.
* \Any possible errors preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
* \ingroup group_object_spinst
*/
VX_API_ENTRY vx_spinst VX_API_CALL vxCreateSPINST(
vx_context context
);
/*! \brief Releases a reference to a external spinst object.
* The object may not be garbage collected until its total reference count is zero.
* \param [in] spinst_obj The pointer to the spinst data to release.
* \post After returning from this function the reference is zeroed.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors; all other values indicate failure
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_object_spinst
*/
VX_API_ENTRY vx_status VX_API_CALL vxReleaseSPINST(
vx_spinst *spinst_obj
);
/*! \brief Add a instruction to spinst object.
* \param [in] spinst_obj The reference to the spinst object.
* \param [in] inst_unit_array The units of one instruction. Use a <tt>\ref vx_spinst_unit_param</tt>.
* \param [in] inst_unit_count The count of instruction units.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors.
* \retval VX_ERROR_INVALID_REFERENCE If data is not a <tt>\ref spinst_obj</tt>.
* \retval VX_ERROR_INVALID_PARAMETERS If any of parameters is incorrect.
* \retval VX_ERROR_NO_MEMORY If fail to allocate internal instruction memory.
* \ingroup group_object_spinst
*/
VX_API_ENTRY vx_status VX_API_CALL vxAddOneInstToSPINST(
vx_spinst spinst_obj,
vx_spinst_unit_param* inst_unit_array,
vx_uint8 inst_unit_count
);
/*! \brief Set various attributes of a spinst data.
* \param [in] spinst_obj The reference to the vx_spinst object to set.
* \param [in] attribute The attribute to set. Use a <tt>\ref vx_sp_attribute_e</tt>.
* \param [in] value The value of attribute.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors.
* \retval VX_ERROR_INVALID_REFERENCE If data is not a <tt>\ref vx_spinst</tt>.
* \retval VX_ERROR_INVALID_PARAMETERS If any of attribute is incorrect.
* \ingroup group_object_spinst
*/
VX_API_ENTRY vx_status VX_API_CALL vxSetAttributeToSPINST(
vx_spinst spinst_obj,
vx_enum attribute,
vx_uint32 value
);
VX_API_ENTRY vx_status VX_API_CALL vxGetAttributeToSPINST(
vx_spinst spinst_obj,
vx_enum attribute,
vx_uint32* value
);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,67 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _OPENVX_VENDORS_H_
#define _OPENVX_VENDORS_H_
/*!
* \file
* \brief The Vendor ID list for OpenVX.
*/
/*! \brief The Vendor ID of the Implementation. As new vendors submit their
* implementations, this enumeration will grow.
* \ingroup group_basic_features
*/
enum vx_vendor_id_e {
VX_ID_KHRONOS = 0x000, /*!< \brief The Khronos Group */
VX_ID_TI = 0x001, /*!< \brief Texas Instruments, Inc. */
VX_ID_QUALCOMM = 0x002, /*!< \brief Qualcomm, Inc. */
VX_ID_NVIDIA = 0x003, /*!< \brief NVIDIA Corporation */
VX_ID_ARM = 0x004, /*!< \brief ARM Ltd. */
VX_ID_BDTI = 0x005, /*!< \brief Berkley Design Technology, Inc. */
VX_ID_RENESAS = 0x006, /*!< \brief Renasas Electronics */
VX_ID_VIVANTE = 0x007, /*!< \brief Vivante Corporation */
VX_ID_XILINX = 0x008, /*!< \brief Xilinx Inc. */
VX_ID_AXIS = 0x009, /*!< \brief Axis Communications */
VX_ID_MOVIDIUS = 0x00A, /*!< \brief Movidius Ltd. */
VX_ID_SAMSUNG = 0x00B, /*!< \brief Samsung Electronics */
VX_ID_FREESCALE = 0x00C, /*!< \brief Freescale Semiconductor */
VX_ID_AMD = 0x00D, /*!< \brief Advanced Micro Devices */
VX_ID_BROADCOM = 0x00E, /*!< \brief Broadcom Corporation */
VX_ID_INTEL = 0x00F, /*!< \brief Intel Corporation */
VX_ID_MARVELL = 0x010, /*!< \brief Marvell Technology Group Ltd. */
VX_ID_MEDIATEK = 0x011, /*!< \brief MediaTek, Inc. */
VX_ID_ST = 0x012, /*!< \brief STMicroelectronics */
VX_ID_CEVA = 0x013, /*!< \brief CEVA DSP */
VX_ID_ITSEEZ = 0x014, /*!< \brief Itseez, Inc. */
VX_ID_IMAGINATION=0x015, /*!< \brief Imagination Technologies */
VX_ID_NXP = 0x016, /*!< \brief NXP Semiconductors */
VX_ID_VIDEANTIS = 0x017, /*!< \brief Videantis */
VX_ID_SYNOPSYS = 0x018, /*!< \brief Synopsys */
VX_ID_CADENCE = 0x019, /*!< \brief Cadence */
VX_ID_HUAWEI = 0x01A, /*!< \brief Huawei */
VX_ID_SOCIONEXT = 0x01B, /*!< \brief Socionext */
/* Add new vendor code above this line */
VX_ID_USER = 0xFFE, /*!< \brief For use by vxAllocateUserKernelId and vxAllocateUserKernelLibraryId */
VX_ID_MAX = 0xFFF,
/*! \brief For use by all Kernel authors until they can obtain an assigned ID. */
VX_ID_DEFAULT = VX_ID_MAX,
};
#endif

View File

@ -0,0 +1,50 @@
#ifndef _VX_VIV_SYS_H_
#define _VX_VIV_SYS_H_
#include <VX/vx.h>
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief set clock fscale value to change core and shader frequency.
* \param [in] coreIndex Global core index to set the specific core clock frequency.
* If the value is 0xFFFFFFFF, all the cores will be set.
* \param [in] vipFscaleValue Set core frequency scale size. Value can be 64, 32, 16, 8, 4, 2, 1.
* 64 means 64/64 full frequency, 1 means 1/64 frequency.
* \param [in] shaderFscaleValue Set shader frequency scale size. Value can be 64, 32, 16, 8, 4, 2, 1.
* 64 means 64/64 full frequency, 1 means 1/64 frequency.
*
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS No errors;
* \retval VX_ERROR_INVAID_PARAMETERS Invalid frequency scale values.
* \retval VX_FAILURE Failed to change core and shader frequency.
*/
VX_API_ENTRY vx_status VX_API_CALL vxSysSetVipFrequency(
vx_uint32 coreIndex,
vx_uint32 vipFscaleValue,
vx_uint32 shaderFscaleValue
);
/*! \brief cancel all VIP processing jobs on a device.
* \param [in] context The reference to the implementation context.
* \param [in] deviceID bound to graph.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Cancelled all VIP processing job successfully on a device
* and user can check return of vxProcessGraph() to get cancelled status.
* \retval VX_ERROR_INVAID_PARAMETERS Invalid context reference.
* \retval VX_ERROR_NOT_SUPPORTED Hardware does not support job cancellation.
* \retval VX_FAILURE Failed to cancel VIP proccessing job on a device.
*/
VX_API_ENTRY vx_status VX_API_CALL vxSysCancelJob(
vx_context context,
vx_uint32 deviceID
);
#ifdef __cplusplus
}
#endif
#endif

924
unified-tina/inc/VX/vxu.h Normal file
View File

@ -0,0 +1,924 @@
/*
* Copyright (c) 2012-2017 The Khronos Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _OPENVX_UTILITY_H_
#define _OPENVX_UTILITY_H_
/*!
* \file
* \brief The OpenVX Utility Library.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*! \brief [Immediate] Invokes an immediate Color Conversion.
* \param [in] context The reference to the overall context.
* \param [in] input The input image.
* \param [out] output The output image.
* \ingroup group_vision_function_colorconvert
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuColorConvert(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Invokes an immediate Channel Extract.
* \param [in] context The reference to the overall context.
* \param [in] input The input image. Must be one of the defined <tt>\ref vx_df_image_e</tt> multi-channel formats.
* \param [in] channel The <tt>\ref vx_channel_e</tt> enumeration to extract.
* \param [out] output The output image. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
* \ingroup group_vision_function_channelextract
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuChannelExtract(vx_context context, vx_image input, vx_enum channel, vx_image output);
/*! \brief [Immediate] Invokes an immediate Channel Combine.
* \param [in] context The reference to the overall context.
* \param [in] plane0 The plane that forms channel 0. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] plane1 The plane that forms channel 1. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] plane2 [optional] The plane that forms channel 2. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] plane3 [optional] The plane that forms channel 3. Must be <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [out] output The output image.
* \ingroup group_vision_function_channelcombine
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuChannelCombine(vx_context context, vx_image plane0, vx_image plane1, vx_image plane2, vx_image plane3, vx_image output);
/*! \brief [Immediate] Invokes an immediate Sobel 3x3.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output_x [optional] The output gradient in the x direction in <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [out] output_y [optional] The output gradient in the y direction in <tt>\ref VX_DF_IMAGE_S16</tt>.
* \ingroup group_vision_function_sobel3x3
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuSobel3x3(vx_context context, vx_image input, vx_image output_x, vx_image output_y);
/*! \brief [Immediate] Invokes an immediate Magnitude.
* \param [in] context The reference to the overall context.
* \param [in] grad_x The input x image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [in] grad_y The input y image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [out] mag The magnitude image. This will be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \ingroup group_vision_function_magnitude
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMagnitude(vx_context context, vx_image grad_x, vx_image grad_y, vx_image mag);
/*! \brief [Immediate] Invokes an immediate Phase.
* \param [in] context The reference to the overall context.
* \param [in] grad_x The input x image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [in] grad_y The input y image. This must be in <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [out] orientation The phase image. This will be in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \ingroup group_vision_function_phase
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuPhase(vx_context context, vx_image grad_x, vx_image grad_y, vx_image orientation);
/*! \brief [Immediate] Scales an input image to an output image.
* \param [in] context The reference to the overall context.
* \param [in] src The source image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [out] dst The destintation image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] type The interpolation type. \see vx_interpolation_type_e.
* \ingroup group_vision_function_scale_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuScaleImage(vx_context context, vx_image src, vx_image dst, vx_enum type);
/*! \brief [Immediate] Processes the image through the LUT.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [in] lut The LUT which is of type <tt>\ref VX_TYPE_UINT8</tt> if input image is <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_TYPE_INT16</tt> if input image is <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [out] output The output image of the same type as the input image.
* \ingroup group_vision_function_lut
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTableLookup(vx_context context, vx_image input, vx_lut lut, vx_image output);
/*! \brief [Immediate] Generates a distribution from an image.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt>
* \param [out] distribution The output distribution.
* \ingroup group_vision_function_histogram
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuHistogram(vx_context context, vx_image input, vx_distribution distribution);
/*! \brief [Immediate] Equalizes the Histogram of a grayscale image.
* \param [in] context The reference to the overall context.
* \param [in] input The grayscale input image in <tt>\ref VX_DF_IMAGE_U8</tt>
* \param [out] output The grayscale output image of type <tt>\ref VX_DF_IMAGE_U8</tt> with equalized brightness and contrast.
* \ingroup group_vision_function_equalize_hist
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuEqualizeHist(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Computes the absolute difference between two images.
* \param [in] context The reference to the overall context.
* \param [in] in1 An input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [in] in2 An input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \ingroup group_vision_function_absdiff
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuAbsDiff(vx_context context, vx_image in1, vx_image in2, vx_image out);
/*! \brief [Immediate] Computes the mean value and optionally the standard deviation.
* \param [in] context The reference to the overall context.
* \param [in] input The input image. <tt>\ref VX_DF_IMAGE_U8</tt> is supported.
* \param [out] mean The average pixel value.
* \param [out] stddev [optional] The standard deviation of the pixel values.
* \ingroup group_vision_function_meanstddev
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMeanStdDev(vx_context context, vx_image input, vx_float32 *mean, vx_float32 *stddev);
/*! \brief [Immediate] Threshold's an input image and produces a <tt>\ref VX_DF_IMAGE_U8</tt> boolean image.
* \param [in] context The reference to the overall context.
* \param [in] input The input image. Only images with format <tt>\ref VX_DF_IMAGE_U8</tt>
* and <tt>\ref VX_DF_IMAGE_S16</tt> are supported.
* \param [in] thresh The thresholding object that defines the parameters of
* the operation. The <tt>\ref VX_THRESHOLD_INPUT_FORMAT</tt> must be the same as the input image format and
* the <tt>\ref VX_THRESHOLD_OUTPUT_FORMAT</tt> must be the same as the output image format.
* \param [out] output The output image, that will contain as pixel value
* true and false values defined by \p thresh. Only images with format
* <tt>\ref VX_DF_IMAGE_U8</tt> are supported.
* \ingroup group_vision_function_threshold
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuThreshold(vx_context context, vx_image input, vx_threshold thresh, vx_image output);
/*! \brief [Immediate] Performs Non-Maxima Suppression on an image, producing an image of the same type.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [in] mask [optional] Constrict suppression to a ROI. The mask image is of type <tt>\ref VX_DF_IMAGE_U8</tt> and must be the same dimensions as the input image.
* \param [in] win_size The size of window over which to perform the localized non-maxima suppression. Must be odd, and less than or equal to the smallest dimension of the input image.
* \param [out] output The output image, of the same type as the input, that has been non-maxima suppressed.
* \ingroup group_vision_function_nms
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuNonMaxSuppression(vx_context context, vx_image input, vx_image mask, vx_int32 win_size, vx_image output);
/*! \brief [Immediate] Computes the integral image of the input.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U32</tt> format.
* \ingroup group_vision_function_integral_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuIntegralImage(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Erodes an image by a 3x3 window.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \ingroup group_vision_function_erode_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuErode3x3(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Dilates an image by a 3x3 window.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \ingroup group_vision_function_dilate_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuDilate3x3(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Computes a median filter on the image by a 3x3 window.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \ingroup group_vision_function_median_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMedian3x3(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Computes a box filter on the image by a 3x3 window.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \ingroup group_vision_function_box_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuBox3x3(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Computes a gaussian filter on the image by a 3x3 window.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \ingroup group_vision_function_gaussian_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuGaussian3x3(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Performs Non-linear Filtering.
* \param [in] context The reference to the overall context.
* \param [in] function The non-linear filter function. See <tt>\ref vx_non_linear_filter_e</tt>.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [in] mask The mask to be applied to the Non-linear function. <tt>\ref VX_MATRIX_ORIGIN</tt> attribute is used
* to place the mask appropriately when computing the resulting image. See <tt>\ref vxCreateMatrixFromPattern</tt> and <tt>\ref vxCreateMatrixFromPatternAndOrigin</tt>.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_vision_function_nonlinear_filter
*/
VX_API_ENTRY vx_status VX_API_CALL vxuNonLinearFilter(vx_context context, vx_enum function, vx_image input, vx_matrix mask, vx_image output);
/*! \brief [Immediate] Computes a convolution on the input image with the supplied
* matrix.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> format.
* \param [in] conv The <tt>\ref vx_int16</tt> convolution matrix.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \ingroup group_vision_function_custom_convolution
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuConvolve(vx_context context, vx_image input, vx_convolution conv, vx_image output);
/*! \brief [Immediate] Computes a Gaussian pyramid from an input image.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt>
* \param [out] gaussian The Gaussian pyramid with <tt>\ref VX_DF_IMAGE_U8</tt> to construct.
* \ingroup group_vision_function_gaussian_pyramid
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuGaussianPyramid(vx_context context, vx_image input, vx_pyramid gaussian);
/*! \brief [Immediate] Computes a Laplacian pyramid from an input image.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [out] laplacian The Laplacian pyramid with <tt>\ref VX_DF_IMAGE_S16</tt> to construct.
* \param [out] output The lowest resolution image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format necessary to reconstruct the input image from the pyramid. The output image format should be same as input image format.
* \ingroup group_vision_function_laplacian_pyramid
* \see group_pyramid
* \return A <tt>\ref vx_status</tt> enumeration.
* \retval VX_SUCCESS Success.
* \retval * An error occured. See <tt>\ref vx_status_e</tt>
*/
VX_API_ENTRY vx_status VX_API_CALL vxuLaplacianPyramid(vx_context context, vx_image input, vx_pyramid laplacian, vx_image output);
/*! \brief [Immediate] Reconstructs an image from a Laplacian Image pyramid.
* \param [in] context The reference to the overall context.
* \param [in] laplacian The Laplacian pyramid with <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [in] input The lowest resolution image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format for the Laplacian pyramid.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format with the highest possible resolution reconstructed from the Laplacian pyramid. The output image format should be same as input image format.
* \ingroup group_vision_function_laplacian_reconstruct
* \see group_pyramid
* \return A <tt>\ref vx_status</tt> enumeration.
* \retval VX_SUCCESS Success.
* \retval * An error occured. See <tt>\ref vx_status_e</tt>
*/
VX_API_ENTRY vx_status VX_API_CALL vxuLaplacianReconstruct(vx_context context, vx_pyramid laplacian, vx_image input,
vx_image output);
/*! \brief [Immediate] Computes a weighted average image.
* \param [in] context The reference to the overall context.
* \param [in] img1 The first <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] alpha A <tt>\ref VX_TYPE_FLOAT32</tt> type, the input value with the range \f$ 0.0 \le \alpha \le 1.0 \f$.
* \param [in] img2 The second <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \ingroup group_vision_function_weighted_average
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuWeightedAverage(vx_context context, vx_image img1, vx_scalar alpha, vx_image img2, vx_image output);
/*! \brief [Immediate] Computes the minimum and maximum values of the image.
* \param [in] context The reference to the overall context.
* \param [in] input The input image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \param [out] minVal The minimum value in the image, which corresponds to the type of the input.
* \param [out] maxVal The maximum value in the image, which corresponds to the type of the input.
* \param [out] minLoc [optional] The minimum <tt>\ref VX_TYPE_COORDINATES2D</tt> locations. If the input image has several minimums, the kernel will return up to the capacity of the array.
* \param [out] maxLoc [optional] The maximum <tt>\ref VX_TYPE_COORDINATES2D</tt> locations. If the input image has several maximums, the kernel will return up to the capacity of the array.
* \param [out] minCount [optional] The total number of detected minimums in image. Use a <tt>\ref VX_TYPE_SIZE</tt> scalar.
* \param [out] maxCount [optional] The total number of detected maximums in image. Use a <tt>\ref VX_TYPE_SIZE</tt> scalar.
* \ingroup group_vision_function_minmaxloc
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMinMaxLoc(vx_context context, vx_image input,
vx_scalar minVal, vx_scalar maxVal,
vx_array minLoc, vx_array maxLoc,
vx_scalar minCount, vx_scalar maxCount);
/*! \brief [Immediate] Computes pixel-wise minimum values between two images.
* \param [in] context The reference to the overall context.
* \param [in] in1 The first input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [in] in2 The second input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [out] out The output image which will hold the result of min.
* \ingroup group_vision_function_min
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMin(vx_context context, vx_image in1, vx_image in2, vx_image out);
/*! \brief [Immediate] Computes pixel-wise maximum values between two images.
* \param [in] context The reference to the overall context.
* \param [in] in1 The first input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [in] in2 The second input image. Must be of type <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>.
* \param [out] out The output image which will hold the result of max.
* \ingroup group_vision_function_max
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMax(vx_context context, vx_image in1, vx_image in2, vx_image out);
/*! \brief [Immediate] Converts the input images bit-depth into the output image.
* \param [in] context The reference to the overall context.
* \param [in] input The input image.
* \param [out] output The output image.
* \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
* \param [in] shift A scalar containing a <tt>\ref VX_TYPE_INT32</tt> of the shift value.
* \ingroup group_vision_function_convertdepth
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>..
*/
VX_API_ENTRY vx_status VX_API_CALL vxuConvertDepth(vx_context context, vx_image input, vx_image output, vx_enum policy, vx_int32 shift);
/*! \brief [Immediate] Computes Canny Edges on the input image into the output image.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] hyst The double threshold for hysteresis. The <tt>\ref VX_THRESHOLD_INPUT_FORMAT</tt> shall be either
* <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt>. The <tt>\ref VX_THRESHOLD_OUTPUT_FORMAT</tt> is ignored.
* \param [in] gradient_size The size of the Sobel filter window, must support at least 3, 5 and 7.
* \param [in] norm_type A flag indicating the norm used to compute the gradient, <tt>\ref VX_NORM_L1</tt> or <tt>\ref VX_NORM_L2</tt>.
* \param [out] output The output image in <tt>\ref VX_DF_IMAGE_U8</tt> format with values either 0 or 255.
* \ingroup group_vision_function_canny
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuCannyEdgeDetector(vx_context context, vx_image input, vx_threshold hyst,
vx_int32 gradient_size, vx_enum norm_type,
vx_image output);
/*! \brief [Immediate] Performs a Gaussian Blur on an image then half-scales it. The interpolation mode used is nearest-neighbor.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] kernel_size The input size of the Gaussian filter. Supported values are 1, 3 and 5.
* \ingroup group_vision_function_scale_image
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuHalfScaleGaussian(vx_context context, vx_image input, vx_image output, vx_int32 kernel_size);
/*! \brief [Immediate] Computes the bitwise and between two images.
* \param [in] context The reference to the overall context.
* \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
* \ingroup group_vision_function_and
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuAnd(vx_context context, vx_image in1, vx_image in2, vx_image out);
/*! \brief [Immediate] Computes the bitwise inclusive-or between two images.
* \param [in] context The reference to the overall context.
* \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
* \ingroup group_vision_function_or
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuOr(vx_context context, vx_image in1, vx_image in2, vx_image out);
/*! \brief [Immediate] Computes the bitwise exclusive-or between two images.
* \param [in] context The reference to the overall context.
* \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [out] out The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
* \ingroup group_vision_function_xor
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuXor(vx_context context, vx_image in1, vx_image in2, vx_image out);
/*! \brief [Immediate] Computes the bitwise not of an image.
* \param [in] context The reference to the overall context.
* \param [in] input The <tt>\ref VX_DF_IMAGE_U8</tt> input image
* \param [out] output The <tt>\ref VX_DF_IMAGE_U8</tt> output image.
* \ingroup group_vision_function_not
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuNot(vx_context context, vx_image input, vx_image output);
/*! \brief [Immediate] Performs elementwise multiplications on pixel values in the input images and a scale.
* \param [in] context The reference to the overall context.
* \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
* \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
* \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
* \param [in] overflow_policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
* \param [in] rounding_policy A <tt>\ref vx_round_policy_e</tt> enumeration.
* \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \ingroup group_vision_function_mult
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMultiply(vx_context context, vx_image in1, vx_image in2, vx_float32 scale, vx_enum overflow_policy, vx_enum rounding_policy, vx_image out);
/*! \brief [Immediate] Performs arithmetic addition on pixel values in the input images.
* \param [in] context The reference to the overall context.
* \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
* \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image.
* \param [in] policy A \ref vx_convert_policy_e enumeration.
* \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \ingroup group_vision_function_add
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuAdd(vx_context context, vx_image in1, vx_image in2, vx_enum policy, vx_image out);
/*! \brief [Immediate] Performs arithmetic subtraction on pixel values in the input images.
* \param [in] context The reference to the overall context.
* \param [in] in1 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image, the minuend.
* \param [in] in2 A <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> input image, the subtrahend.
* \param [in] policy A \ref vx_convert_policy_e enumeration.
* \param [out] out The output image in <tt>\ref VX_DF_IMAGE_U8</tt> or <tt>\ref VX_DF_IMAGE_S16</tt> format.
* \ingroup group_vision_function_sub
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuSubtract(vx_context context, vx_image in1, vx_image in2, vx_enum policy, vx_image out);
/*! \brief [Immediate] Performs an Affine warp on an image.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] matrix The affine matrix. Must be 2x3 of type \ref VX_TYPE_FLOAT32.
* \param [in] type The interpolation type from \ref vx_interpolation_type_e.
* \ref VX_INTERPOLATION_AREA is not supported.
* \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \ingroup group_vision_function_warp_affine
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuWarpAffine(vx_context context, vx_image input, vx_matrix matrix, vx_enum type, vx_image output);
/*! \brief [Immediate] Performs an Perspective warp on an image.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] matrix The perspective matrix. Must be 3x3 of type \ref VX_TYPE_FLOAT32.
* \param [in] type The interpolation type from \ref vx_interpolation_type_e.
* \ref VX_INTERPOLATION_AREA is not supported.
* \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \ingroup group_vision_function_warp_perspective
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuWarpPerspective(vx_context context, vx_image input, vx_matrix matrix, vx_enum type, vx_image output);
/*! \brief [Immediate] Computes the Harris Corners over an image and produces the array of scored points.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] strength_thresh The <tt>\ref VX_TYPE_FLOAT32</tt> minimum threshold which to eliminate Harris Corner scores (computed using the normalized Sobel kernel).
* \param [in] min_distance The <tt>\ref VX_TYPE_FLOAT32</tt> radial Euclidean distance for non-maximum suppression.
* \param [in] sensitivity The <tt>\ref VX_TYPE_FLOAT32</tt> scalar sensitivity threshold \f$ k \f$ from the Harris-Stephens equation.
* \param [in] gradient_size The gradient window size to use on the input. The
* implementation must support at least 3, 5, and 7.
* \param [in] block_size The block window size used to compute the harris corner score.
* The implementation must support at least 3, 5, and 7.
* \param [out] corners The array of <tt>\ref VX_TYPE_KEYPOINT</tt> structs. The order of the keypoints in this array is implementation dependent.
* \param [out] num_corners [optional] The total number of detected corners in image. Use a \ref VX_TYPE_SIZE scalar
* \ingroup group_vision_function_harris
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuHarrisCorners(vx_context context,
vx_image input,
vx_scalar strength_thresh,
vx_scalar min_distance,
vx_scalar sensitivity,
vx_int32 gradient_size,
vx_int32 block_size,
vx_array corners,
vx_scalar num_corners);
/*! \brief [Immediate] Computes corners on an image using FAST algorithm and produces the array of feature points.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] strength_thresh Threshold on difference between intensity of the central pixel and pixels on Bresenham's circle
* of radius 3 (<tt>\ref VX_TYPE_FLOAT32</tt> scalar), with a value in the range of 0.0 \f$\le\f$ strength_thresh < 256.0.
* Any fractional value will be truncated to an integer.
* \param [in] nonmax_suppression If true, non-maximum suppression is applied to
* detected corners before being places in the <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt> structs.
* \param [out] corners Output corner <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt>. The order of the keypoints in this array is implementation dependent.
* \param [out] num_corners [optional] The total number of detected corners in image. Use a \ref VX_TYPE_SIZE scalar.
* \ingroup group_vision_function_fast
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuFastCorners(vx_context context, vx_image input, vx_scalar strength_thresh, vx_bool nonmax_suppression, vx_array corners, vx_scalar num_corners);
/*! \brief [Immediate] Computes an optical flow on two images.
* \param [in] context The reference to the overall context.
* \param [in] old_images Input of first (old) image pyramid in <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] new_images Input of destination (new) image pyramid in <tt>\ref VX_DF_IMAGE_U8</tt>
* \param [in] old_points an array of key points in a vx_array of <tt>\ref VX_TYPE_KEYPOINT</tt> those key points are defined at
* the old_images high resolution pyramid
* \param [in] new_points_estimates an array of estimation on what is the output key points in a <tt>\ref vx_array</tt> of
* <tt>\ref VX_TYPE_KEYPOINT</tt> those keypoints are defined at the new_images high resolution pyramid
* \param [out] new_points an output array of key points in a <tt>\ref vx_array</tt> of <tt>\ref VX_TYPE_KEYPOINT</tt> those key points are
* defined at the new_images high resolution pyramid
* \param [in] termination termination can be <tt>\ref VX_TERM_CRITERIA_ITERATIONS</tt> or <tt>\ref VX_TERM_CRITERIA_EPSILON</tt> or
* <tt>\ref VX_TERM_CRITERIA_BOTH</tt>
* \param [in] epsilon is the <tt>\ref vx_float32</tt> error for terminating the algorithm
* \param [in] num_iterations is the number of iterations. Use a <tt>\ref VX_TYPE_UINT32</tt> scalar.
* \param [in] use_initial_estimate Can be set to either <tt>\ref vx_false_e</tt> or <tt>\ref vx_true_e</tt>.
* \param [in] window_dimension The size of the window on which to perform the algorithm. See
* <tt>\ref VX_CONTEXT_OPTICAL_FLOW_MAX_WINDOW_DIMENSION</tt>
*
* \ingroup group_vision_function_opticalflowpyrlk
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuOpticalFlowPyrLK(vx_context context,
vx_pyramid old_images,
vx_pyramid new_images,
vx_array old_points,
vx_array new_points_estimates,
vx_array new_points,
vx_enum termination,
vx_scalar epsilon,
vx_scalar num_iterations,
vx_scalar use_initial_estimate,
vx_size window_dimension);
/*! \brief [Immediate] The function compares an image template against overlapped image regions.
* \details The detailed equation to the matching can be found in <tt>\ref vx_comp_metric_e</tt>.
* The output of the template matching node is a comparison map as described in <tt>\ref vx_comp_metric_e</tt>.
* The Node have a limitation on the template image size (width*height). It should not be larger then 65535.
* If the valid region of the template image is smaller than the entire template image, the result in the destination image is implementation-dependent.
* \param [in] context The reference to the overall context.
* \param [in] src The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] templateImage Searched template of type <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] matchingMethod attribute specifying the comparison method <tt>\ref vx_comp_metric_e</tt>. This function support only <tt>\ref VX_COMPARE_CCORR_NORM</tt> and <tt>\ref VX_COMPARE_L2</tt>.
* \param [out] output Map of comparison results. The output is an image of type <tt>\ref VX_DF_IMAGE_S16</tt>
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_vision_function_match_template
*/
VX_API_ENTRY vx_status VX_API_CALL vxuMatchTemplate(vx_context context, vx_image src, vx_image templateImage, vx_enum matchingMethod, vx_image output);
/*! \brief [Immediate] The function extracts LBP image from an input image
* \param [in] context The reference to the overall context.
* \param [in] in An input image in <tt>vx_image</tt>. Or \f$ SrcImg\f$ in the equations. the image is of type <tt>\ref VX_DF_IMAGE_U8</tt>
* \param [in] format A variation of LBP like original LBP and mLBP. see <tt> \ref vx_lbp_format_e </tt>
* \param [in] kernel_size Kernel size. Only size of 3 and 5 are supported
* \param [out] out An output image in <tt>vx_image</tt>.Or \f$ DstImg\f$ in the equations. the image is of type <tt>\ref VX_DF_IMAGE_U8</tt>
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_vision_function_lbp
*/
VX_API_ENTRY vx_status VX_API_CALL vxuLBP(vx_context context,
vx_image in, vx_enum format, vx_int8 kernel_size, vx_image out);
/*! \brief [Immediate] Performs cell calculations for the average gradient magnitude and gradient orientation histograms.
* \details Firstly, the gradient magnitude and gradient orientation are computed for each pixel in the input image.
* Two 1-D centred, point discrete derivative masks are applied to the input image in the horizontal and vertical directions.
* \f[ M_h = [-1, 0, 1] \f] and \f[ M_v = [-1, 0, 1]^T \f]
* \f$G_v\f$ is the result of applying mask \f$M_v\f$ to the input image, and \f$G_h\f$ is the result of applying mask \f$M_h\f$ to the input image.
* The border mode used for the gradient calculation is implementation dependent. Its behavior should be similar to <tt>\ref VX_BORDER_UNDEFINED</tt>.
* The gradient magnitudes and gradient orientations for each pixel are then calculated in the following manner.
* \f[ G(x,y) = \sqrt{G_v(x,y)^2 + G_h(x,y)^2} \f]
* \f[ \theta(x,y) = arctan(G_v(x,y), G_h(x,y)) \f]
* where \f$arctan(v, h)\f$
* is \f$ tan^{-1}(v/h)\f$ when \f$h!=0\f$,
*
* \f$ -pi/2 \f$ if \f$v<0\f$ and \f$h==0\f$,
*
* \f$ pi/2 \f$ if \f$v>0\f$ and \f$h==0\f$
*
* and \f$ 0 \f$ if \f$v==0\f$ and \f$h==0\f$
*
* Secondly, the gradient magnitudes and orientations are used to compute the bins output tensor and optional magnitudes output tensor.
* These tensors are computed on a cell level where the cells are rectangular in shape.
* The magnitudes tensor contains the average gradient magnitude for each cell.
* \f[magnitudes(c) = \frac{1}{(cell\_width * cell\_height)}\sum\limits_{w=0}^{cell\_width} \sum\limits_{h=0}^{cell\_height} G_c(w,h)\f]
* where \f$G_c\f$ is the gradient magnitudes related to cell \f$c\f$.
* The bins tensor contains histograms of gradient orientations for each cell.
* The gradient orientations at each pixel range from 0 to 360 degrees. These are quantised into a set of histogram bins based on the num_bins parameter.
* Each pixel votes for a specific cell histogram bin based on its gradient orientation. The vote itself is the pixel's gradient magnitude.
* \f[bins(c, n) = \sum\limits_{w=0}^{cell\_width} \sum\limits_{h=0}^{cell\_height} G_c(w,h) * 1[B_c(w, h, num\_bins) == n]\f]
* where \f$B_c\f$ produces the histogram bin number based on the gradient orientation of the pixel at location (\f$w\f$, \f$h\f$) in cell \f$c\f$ based on
* the \f$num\_bins\f$ and \f[1[B_c(w, h, num\_bins) == n]\f] is a delta-function with value 1 when \f$B_c(w, h, num\_bins) == n\f$ or 0 otherwise.
* \param [in] context The reference to the overall context.
* \param [in] input The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] cell_width The histogram cell width of type <tt>\ref VX_TYPE_INT32</tt>.
* \param [in] cell_height The histogram cell height of type <tt>\ref VX_TYPE_INT32</tt>.
* \param [in] num_bins The histogram size of type <tt>\ref VX_TYPE_INT32</tt>.
* \param [out] magnitudes The output average gradient magnitudes per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt> of size \f$ [floor(image_{width}/cell_{width}) ,floor(image_{height}/cell_{height}) ] \f$.
* \param [out] bins The output gradient orientation histograms per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt> of size \f$ [floor(image_{width}/cell_{width}) ,floor(image_{height}/cell_{height}), num_{bins}] \f$.
*
* \ingroup group_vision_function_hog
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuHOGCells(vx_context context, vx_image input, vx_int32 cell_width, vx_int32 cell_height, vx_int32 num_bins, vx_tensor magnitudes, vx_tensor bins);
/*! \brief [Immediate] Computes Histogram of Oriented Gradients features for the W1xW2 window in a sliding window fashion over the whole input image.
* \details Firstly if a magnitudes tensor is provided the cell histograms in the bins tensor are normalised by the average cell gradient magnitudes.
\f[bins(c,n) = \frac{bins(c,n)}{magnitudes(c)}\f]
* To account for changes in illumination and contrast the cell histograms must be locally normalized which requires grouping the cell histograms together into larger spatially connected blocks.
* Blocks are rectangular grids represented by three parameters: the number of cells per block, the number of pixels per cell, and the number of bins per cell histogram.
* These blocks typically overlap, meaning that each cell histogram contributes more than once to the final descriptor.
* To normalize a block its cell histograms \f$h\f$ are grouped together to form a vector \f$v = [h_1, h_2, h_3, ... , h_n]\f$.
* This vector is normalised using L2-Hys which means performing L2-norm on this vector; clipping the result (by limiting the maximum values of v to be threshold) and renormalizing again. If the threshold is equal to zero then L2-Hys normalization is not performed.
* \f[L2norm(v) = \frac{v}{\sqrt{\|v\|_2^2 + \epsilon^2}}\f]
* where \f$ \|v\|_k \f$ be its k-norm for k=1, 2, and \f$ \epsilon \f$ be a small constant.
* For a specific window its HOG descriptor is then the concatenated vector of the components of the normalized cell histograms from all of the block regions contained in the window.
* The W1xW2 window starting position is at coordinates 0x0.
* If the input image has dimensions that are not an integer multiple of W1xW2 blocks with the specified stride, then the last positions that contain only a partial W1xW2 window
* will be calculated with the remaining part of the W1xW2 window padded with zeroes.
* The Window W1xW2 must also have a size so that it contains an integer number of cells, otherwise the node is not well-defined.
* The final output tensor will contain HOG descriptors equal to the number of windows in the input image.
* The output features tensor has 3 dimensions, given by:\n
* \f[[ (floor((image_{width}-window_{width})/window_{stride}) + 1),\f]
* \f[ (floor((image_{height}-window_{height})/window_{stride}) + 1),\f]
* \f[ floor((window_{width} - block_{width})/block_{stride} + 1) * floor((window_{height} - block_{height})/block_{stride} + 1) *\f]
* \f[ (((block_{width} * block_{height}) / (cell_{width} * cell_{height})) * num_{bins})] \f]
* See <tt>\ref vxCreateTensor</tt> and <tt>\ref vxCreateVirtualTensor</tt>.
* The output tensor from this function may be very large. For this reason, is it not recommended that this "immediate mode" version of the function be used.
* The preferred method to perform this function is as graph node with a virtual tensor as the output.
* \param [in] context The reference to the overall context.
* \param [in] input The input image of type <tt>\ref VX_DF_IMAGE_U8</tt>.
* \param [in] magnitudes The averge gradient magnitudes per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>. It is the output of <tt>\ref vxuHOGCells</tt>.
* \param [in] bins The gradient orientation histogram per cell of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>. It is the output of <tt>\ref vxuHOGCells</tt>.
* \param [in] params The parameters of type <tt>\ref vx_hog_t</tt>.
* \param [in] hog_param_size Size of <tt>\ref vx_hog_t</tt> in bytes.
* \param [out] features The output HOG features of <tt>\ref vx_tensor</tt> of type <tt>\ref VX_TYPE_INT16</tt>.
*
* \ingroup group_vision_function_hog
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuHOGFeatures(vx_context context, vx_image input, vx_tensor magnitudes, vx_tensor bins, const vx_hog_t *params, vx_size hog_param_size, vx_tensor features);
/*! \brief [Immediate] Finds the Probabilistic Hough Lines detected in the input binary image, each line is stored in the output array as a set of points (x1, y1, x2, y2) .
* \details Some implementations of the algorithm may have a random or non-deterministic element. If the target application is in a safety-critical environment this
* should be borne in mind and steps taken in the implementation, the application or both to achieve the level of determinism required by the system design.
* \param [in] context The reference to the overall context.
* \param [in] input 8 bit, single channel binary source image
* \param [in] params parameters of the struct <tt>\ref vx_hough_lines_p_t</tt>
* \param [out] lines_array lines_array contains array of lines, see <tt>\ref vx_line2d_t</tt> The order of lines in implementation dependent
* \param [out] num_lines [optional] The total number of detected lines in image. Use a VX_TYPE_SIZE scalar
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_vision_function_hough_lines_p
*/
VX_API_ENTRY vx_status VX_API_CALL vxuHoughLinesP(vx_context context, vx_image input, const vx_hough_lines_p_t *params, vx_array lines_array, vx_scalar num_lines);
/*! \brief [Immediate] Remaps an output image from an input image.
* \param [in] context The reference to the overall context.
* \param [in] input The input <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \param [in] table The remap table object.
* \param [in] policy The interpolation policy from \ref vx_interpolation_type_e.
* \ref VX_INTERPOLATION_AREA is not supported.
* \param [out] output The output <tt>\ref VX_DF_IMAGE_U8</tt> image.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \ingroup group_vision_function_remap
*/
VX_API_ENTRY vx_status VX_API_CALL vxuRemap(vx_context context,
vx_image input,
vx_remap table,
vx_enum policy,
vx_image output);
/*! \brief [Immediate] The function applies bilateral filtering to the input tensor.
* \param [in] context The reference to the overall context.
* \param [in] src The input data a <tt>\ref vx_tensor</tt>. maximum 3 dimension and minimum 2. The tensor is of type <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT16</tt>.
* dimensions are [radiometric ,width,height] or [width,height]
* \param [in] diameter of each pixel neighbourhood that is used during filtering. Values of diameter must be odd. Bigger then 3 and smaller then 10.
* \param [in] sigmaValues Filter sigma in the radiometric space. Supported values are bigger then 0 and smaller or equal 20.
* \param [in] sigmaSpace Filter sigma in the spatial space. Supported values are bigger then 0 and smaller or equal 20.
* \param [out] dst The output data a <tt>\ref vx_tensor</tt>,Of type <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT16</tt>. And must be the same type and size of the input.
* \note The border modes
* <tt>\ref VX_NODE_BORDER</tt> value
* <tt>\ref VX_BORDER_REPLICATE</tt> and <tt>\ref VX_BORDER_CONSTANT</tt> are supported.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_vision_function_bilateral_filter
*/
VX_API_ENTRY vx_status VX_API_CALL vxuBilateralFilter(vx_context context, vx_tensor src, vx_int32 diameter, vx_float32 sigmaSpace, vx_float32 sigmaValues, vx_tensor dst);
/*! \brief [Immediate] Performs element wise multiplications on element values in the input tensor data with a scale.
* \param [in] context The reference to the overall context.
* \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
* and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
* \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
* In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
* and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
* The data type must match the data type of Input1.
* \param [in] scale A non-negative <tt>\ref VX_TYPE_FLOAT32</tt> multiplied to each product before overflow handling.
* \param [in] overflow_policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
* \param [in] rounding_policy A <tt>\ref vx_round_policy_e</tt> enumeration.
* \param [out] output The output tensor data with the same dimensions as the input tensor data.
* \ingroup group_vision_function_tensor_multiply
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorMultiply(vx_context context, vx_tensor input1, vx_tensor input2, vx_scalar scale, vx_enum overflow_policy,
vx_enum rounding_policy, vx_tensor output);
/*! \brief [Immediate] Performs arithmetic addition on element values in the input tensor data.
* \param [in] context The reference to the overall context.
* \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
* and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
* \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
* In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
* and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
* The data type must match the data type of Input1.
* \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
* \param [out] output The output tensor data with the same dimensions as the input tensor data.
* \ingroup group_vision_function_tensor_add
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorAdd(vx_context context, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
/*! \brief [Immediate] Performs arithmetic subtraction on element values in the input tensor data.
* \param [in] context The reference to the overall context.
* \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
* and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
* \param [in] input2 Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1.
* In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1,
* and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal.
* The data type must match the data type of Input1.
* \param [in] policy A <tt>\ref vx_convert_policy_e</tt> enumeration.
* \param [out] output The output tensor data with the same dimensions as the input tensor data.
* \ingroup group_vision_function_tensor_subtract
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorSubtract(vx_context context, vx_tensor input1, vx_tensor input2, vx_enum policy, vx_tensor output);
/*! \brief [Immediate] Performs LUT on element values in the input tensor data.
* \param [in] context The reference to the overall context.
* \param [in] input1 Input tensor data. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
* and tensor data types <tt>\ref VX_TYPE_UINT8</tt>, with fixed_point_position 0.
* \param [in] lut The look-up table to use, of type <tt>\ref vx_lut</tt>.
* The elements of input1 are treated as unsigned integers to determine an index into the look-up table.
* The data type of the items in the look-up table must match that of the output tensor.
* \param [out] output The output tensor data with the same dimensions as the input tensor data.
* \ingroup group_vision_function_tensor_tablelookup
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorTableLookup(vx_context context, vx_tensor input1, vx_lut lut, vx_tensor output);
/*! \brief [Immediate] Performs transpose on the input tensor.
* The tensor is transposed according to a specified 2 indexes in the tensor (0-based indexing)
* \param [in] context The reference to the overall context.
* \param [in] input Input tensor data, Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
* and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
* \param [out] output output tensor data,
* \param [in] dimension1 Dimension index that is transposed with dim 2.
* \param [in] dimension2 Dimension index that is transposed with dim 1.
* \ingroup group_vision_function_tensor_transpose
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorTranspose(vx_context context, vx_tensor input, vx_tensor output, vx_size dimension1, vx_size dimension2);
/*! \brief [Immediate] Performs a bit-depth conversion.
* \param [in] context The reference to the overall context.
* \param [in] input The input tensor. Implementations must support input tensor data type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_position 8,
* and tensor data types <tt>\ref VX_TYPE_UINT8</tt> and <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_position 0.
* \param [in] policy A <tt>\ref VX_TYPE_ENUM</tt> of the <tt>\ref vx_convert_policy_e</tt> enumeration.
* \param [in] norm A scalar containing a <tt>\ref VX_TYPE_FLOAT32</tt> of the normalization value.
* \param [in] offset A scalar containing a <tt>\ref VX_TYPE_FLOAT32</tt> of the offset value subtracted before normalization.
* \param [out] output The output tensor. Implementations must support input tensor data type <tt>VX_TYPE_INT16</tt>. with fixed_point_position 8.
* And <tt>VX_TYPE_UINT8</tt> with fixed_point_position 0.
* \ingroup group_vision_function_tensor_convert_depth
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorConvertDepth(vx_context context, vx_tensor input, vx_enum policy, vx_scalar norm, vx_scalar offset, vx_tensor output);
/*! \brief [Immediate] Performs a generalized matrix multiplication.
* \param [in] context The reference to the overall context.
* \param [in] input1 The first input 2D tensor of type <tt>\ref VX_TYPE_INT16</tt> with fixed_point_pos 8, or tensor data types <tt>\ref VX_TYPE_UINT8</tt> or <tt>\ref VX_TYPE_INT8</tt>, with fixed_point_pos 0.
* \param [in] input2 The second 2D tensor. Must be in the same data type as input1.
* \param [in] input3 The third 2D tensor. Must be in the same data type as input1. [optional].
* \param [in] matrix_multiply_params Matrix multiply parameters, see <tt>\ref vx_tensor_matrix_multiply_params_t </tt>.
* \param [out] output The output 2D tensor. Must be in the same data type as input1. Output dimension must agree the formula in the description.
* \ingroup group_vision_function_tensor_matrix_multiply
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
*/
VX_API_ENTRY vx_status VX_API_CALL vxuTensorMatrixMultiply(vx_context context, vx_tensor input1, vx_tensor input2, vx_tensor input3,
const vx_tensor_matrix_multiply_params_t *matrix_multiply_params, vx_tensor output);
/*! \brief [Immediate] Copy data from one object to another.
* \param [in] context The reference to the overall context.
* \param [in] input The input data object.
* \param [out] output The output data object.
* \return A <tt>\ref vx_status_e</tt> enumeration.
* \retval VX_SUCCESS Success
* \retval * An error occurred. See <tt>\ref vx_status_e</tt>.
* \ingroup group_vision_function_copy
*/
VX_API_ENTRY vx_status VX_API_CALL vxuCopy(vx_context context, vx_reference input, vx_reference output);
#ifdef __cplusplus
}
#endif
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More