The OpenVX Specification  dba1aa3
Tensor Convert Bit-Depth

Detailed Description

Creates a bit-depth conversion node.

Convert tensor from a specific data type and fixed point position to another data type and fixed point position. The equation for the conversion is as follows:

\[ output = \frac{(\frac{input}{2^{input\_fixed\_point\_position}}-offset)}{norm}*2^{output\_fixed\_point\_position} \]

Where offset and norm are the input parameters in vx_float32. input_fixed_point_position and output_fixed_point_position are the fixed point positions of the input and output respectivly. Is case input or output tensors are of VX_TYPE_FLOAT32 fixed point position 0 is used.

Functions

vx_node VX_API_CALL vxTensorConvertDepthNode (vx_graph graph, vx_tensor input, vx_enum policy, vx_scalar norm, vx_scalar offset, vx_tensor output)
 [Graph] Creates a bit-depth conversion node. More...
 
vx_status VX_API_CALL vxuTensorConvertDepth (vx_context context, vx_tensor input, vx_enum policy, vx_scalar norm, vx_scalar offset, vx_tensor output)
 [Immediate] Performs a bit-depth conversion. More...
 

Function Documentation

vx_node VX_API_CALL vxTensorConvertDepthNode ( vx_graph  graph,
vx_tensor  input,
vx_enum  policy,
vx_scalar  norm,
vx_scalar  offset,
vx_tensor  output 
)

[Graph] Creates a bit-depth conversion node.

Parameters
[in]graphThe reference to the graph.
[in]inputThe input tensor. Implementations must support input tensor data type VX_TYPE_INT16 with fixed_point_position 8, and tensor data types VX_TYPE_UINT8 and VX_TYPE_INT8, with fixed_point_position 0.
[in]policyA VX_TYPE_ENUM of the vx_convert_policy_e enumeration.
[in]normA scalar containing a VX_TYPE_FLOAT32 of the normalization value.
[in]offsetA scalar containing a VX_TYPE_FLOAT32 of the offset value subtracted before normalization.
[out]outputThe output tensor. Implementations must support input tensor data type VX_TYPE_INT16. with fixed_point_position 8. And VX_TYPE_UINT8 with fixed_point_position 0.
Returns
vx_node.
Return values
vx_nodeA node reference. Any possible errors preventing a successful creation should be checked using vxGetStatus
vx_status VX_API_CALL vxuTensorConvertDepth ( vx_context  context,
vx_tensor  input,
vx_enum  policy,
vx_scalar  norm,
vx_scalar  offset,
vx_tensor  output 
)

[Immediate] Performs a bit-depth conversion.

Parameters
[in]contextThe reference to the overall context.
[in]inputThe input tensor. Implementations must support input tensor data type VX_TYPE_INT16 with fixed_point_position 8, and tensor data types VX_TYPE_UINT8 and VX_TYPE_INT8, with fixed_point_position 0.
[in]policyA VX_TYPE_ENUM of the vx_convert_policy_e enumeration.
[in]normA scalar containing a VX_TYPE_FLOAT32 of the normalization value.
[in]offsetA scalar containing a VX_TYPE_FLOAT32 of the offset value subtracted before normalization.
[out]outputThe output tensor. Implementations must support input tensor data type VX_TYPE_INT16. with fixed_point_position 8. And VX_TYPE_UINT8 with fixed_point_position 0.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSSuccess
*An error occurred. See vx_status_e.