SDAA422 June 2026 TDA4VE-Q1
The public interface of the custom threshold package is divided into three header files under include/TI.
1) Aggregate Package Header
The tivx_custom_threshold.h header provides a single include point for applications using the package.
#include <TI/tivx.h>
#include <TI/tivx_custom_threshold_kernels.h>
#include <TI/tivx_custom_threshold_nodes.h>Applications can include this header to access both the kernel package management APIs and the public node creation API.
2) Kernel Definitions and Package APIs
The tivx_custom_threshold_kernels.h header defines the module name and the unique kernel name used by both the Host and Target Kernel implementations.
#define TIVX_MODULE_NAME_CUSTOM_THRESHOLD "custom_threshold"
#define TIVX_KERNEL_CUSTOM_THRESHOLD_NAME "com.ti.custom.threshold"The module name identifies the kernel package during module registration and loading. The kernel name identifies the custom threshold kernel when the Host Kernel, Target Kernel, and application create or locate the corresponding OpenVX node.
The numerical user kernel ID is not fixed in the public header. Instead, it is allocated at runtime by the Host Kernel using vxAllocateUserKernelId(). This avoids assigning a hard-coded kernel enumeration value and allows the OpenVX context to provide an available user kernel ID.
The same header also defines the parameter indices shared by the Host Kernel, Target Kernel, and node creation API.
enum{
TIVX_KERNEL_CUSTOM_THRESHOLD_INPUT_IDX = 0,
TIVX_KERNEL_CUSTOM_THRESHOLD_THRESHOLD_IDX,
TIVX_KERNEL_CUSTOM_THRESHOLD_OUTPUT_IDX,
TIVX_KERNEL_CUSTOM_THRESHOLD_MAX_PARAMS
};| Index | Parameter | Direction | OpenVX type | Description |
| TIVX_KERNEL_CUSTOM_THRESHOLD_INPUT_IDX | Input image | Input | VX_TYPE_IMAGE | U8 grayscale source image |
TIVX_KERNEL_CUSTOM_THRESHOLD_THRESHOLD_IDX | Threshold value | Input | VX_TYPE_SCALAR | U8 scalar used for pixel comparison |
TIVX_KERNEL_CUSTOM_THRESHOLD_OUTPUT_IDX | Output image | Output | VX_TYPE_IMAGE | U8 binary output image |
TIVX_KERNEL_CUSTOM_THRESHOLD_MAX_PARAMS | Parameter count | - | - | Total number of node parameters |
void tivxCustomThresholdLoadKernels(vx_context context);
void tivxCustomThresholdUnLoadKernels(vx_context context);These functions coordinate the Host Kernel module and A72 Target Kernel registration. The application calls the load function after creating the OpenVX context and calls the unload function before releasing the context.
The A72 Target Kernel registration functions are also declared in the public interface.
void tivxRegisterCustomThresholdTargetA72Kernels(void);
void tivxUnRegisterCustomThresholdTargetA72Kernels(void);These functions register and unregister the Target Kernel implementation associated with TIVX_TARGET_MPU_0.
3) Public Node Creation API
The tivx_custom_threshold_nodes.h header declares the helper function used by an application to instantiate the custom threshold node.
VX_API_ENTRY vx_node VX_API_CALL
tivxCustomThresholdNode(
vx_graph graph,
vx_image input,
vx_scalar threshold,
vx_image output);This function accepts the OpenVX graph and the three node parameters and returns a vx_node object. Internally, the implementation creates the node using the kernel name TIVX_KERNEL_CUSTOM_THRESHOLD_NAME and associates the input image, threshold scalar, and output image with their corresponding parameter indices.