OpenVX User Kernel Tiling Extension  r29628
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Extension: User Tiling API

The Khronos Extension for User Tiling Functions. More...

Data Structures

struct  vx_image_description_t
 A structure which describes the tile's parent image. More...
 
struct  vx_neighborhood_size_t
 The User Tiling Function Neighborhood declaration. More...
 
struct  vx_tile_block_size_t
 The User Tiling Function tile block size declaration. More...
 
struct  vx_tile_t
 The tile structure declaration. More...
 

Macros

#define VX_MAX_TILING_PLANES   (4)
 The maximum number of planes in a tiled image.
 
#define VX_RESTRICT   restrict
 A platform wrapper for the restrict keyword.
 
#define vxImageHeight(ptile)   ((ptile))->image.height)
 The full height of the tile's parent image in pixels. More...
 
#define vxImageOffset(ptile, i, x, y, ox, oy)
 Computes the offset within an image. More...
 
#define vxImagePixel(type, ptile, i, x, y, ox, oy)   *((type *)(&((vx_uint8 *)(ptile)->base[i])[vxImageOffset(ptile, i, x, y, ox, oy)]))
 Accesses an image pixel as a type-cast indexed pointer dereference. More...
 
#define vxImageWidth(ptile)   ((ptile))->image.width)
 The full width of the tile's parent image in pixels. More...
 
#define vxNeighborhoodBottom(ptile)   ((ptile)->neighborhood.bottom)
 The simple wrapper to access each image's neighborhood +Y value. More...
 
#define vxNeighborhoodLeft(ptile)   ((ptile)->neighborhood.left)
 The simple wrapper to access each image's neighborhood -X value. More...
 
#define vxNeighborhoodRight(ptile)   ((ptile)->neighborhood.right)
 The simple wrapper to access each image's neighborhood +X value. More...
 
#define vxNeighborhoodTop(ptile)   ((ptile)->neighborhood.top)
 The simple wrapper to access each image's neighborhood -Y value. More...
 
#define vxTileBlockHeight(ptile)   ((ptile)->tile_block.height)
 The tile block height. More...
 
#define vxTileBlockWidth(ptile)   ((ptile)->tile_block.width)
 The tile block width. More...
 
#define vxTileHeight(ptile, index)   ((ptile)->addr[index].dim_y)
 The height of the tile in pixels. More...
 
#define vxTileWidth(ptile, index)   ((ptile)->addr[index].dim_x)
 The width of the tile in pixels. More...
 
#define vxTileX(ptile)   ((ptile)->tile_x)
 The offset between the left edge of the image and the left edge of the tile, in pixels. More...
 
#define vxTileY(ptile)   ((ptile)->tile_y)
 The offset between the top edge of the image and the top edge of the tile, in pixels. More...
 

Typedefs

typedef void(* vx_tiling_kernel_f )(void *restrict parameters[restrict], void *restrict tile_memory, vx_size tile_memory_size)
 Tiling Kernel function typedef for User Tiling Kernels. More...
 

Enumerations

enum  vx_border_mode_tiling_e { VX_BORDER_MODE_SELF = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_BORDER_MODE << 12)) + 0x3 }
 The tiling border mode extensions. More...
 
enum  vx_kernel_attribute_tiling_e {
  VX_KERNEL_ATTRIBUTE_INPUT_NEIGHBORHOOD = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x7,
  VX_KERNEL_ATTRIBUTE_OUTPUT_TILE_BLOCK_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x8,
  VX_KERNEL_ATTRIBUTE_BORDER = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x9,
  VX_KERNEL_ATTRIBUTE_TILE_MEMORY_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0xA
}
 The User Kernel Tiling Attributes. More...
 
enum  vx_node_attribute_tiling_e {
  VX_NODE_ATTRIBUTE_INPUT_NEIGHBORHOOD = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x7,
  VX_NODE_ATTRIBUTE_OUTPUT_TILE_BLOCK_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0x8,
  VX_NODE_ATTRIBUTE_TILE_MEMORY_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_NODE << 8)) + 0xA
}
 The User Node Tiling Attributes. More...
 

Functions

vx_kernel vxAddTilingKernel (vx_context context, vx_char name[(256)], 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)
 Allows a user to add a tile-able kernel to the OpenVX system. More...
 

Detailed Description

The Khronos Extension for User Tiling Functions.


Data Structure Documentation

struct vx_image_description_t

A structure which describes the tile's parent image.

Definition at line 86 of file vx_khr_tiling.h.

Collaboration diagram for vx_image_description_t:
Collaboration graph
Data Fields
vx_df_image format The vx_df_image_e of the image.
vx_uint32 height Height of the image.
vx_uint32 planes The number of planes in the image.
vx_enum range The vx_channel_range_e enumeration.
vx_enum space The vx_color_space_e enumeration.
vx_uint32 width Width of the image.
struct vx_neighborhood_size_t

The User Tiling Function Neighborhood declaration.

The author of a User Tiling Kernel will use this structure to define the neighborhood surrounding the tile block.

Definition at line 76 of file vx_khr_tiling.h.

Collaboration diagram for vx_neighborhood_size_t:
Collaboration graph
Data Fields
vx_int32 bottom Bottom of the tile block.
vx_int32 left Left of the tile block.
vx_int32 right Right of the tile block.
vx_int32 top Top of the tile block.
struct vx_tile_block_size_t

The User Tiling Function tile block size declaration.

The author of a User Tiling Kernel will use this structure to define the dimensionality of the tile block.

Definition at line 66 of file vx_khr_tiling.h.

Collaboration diagram for vx_tile_block_size_t:
Collaboration graph
Data Fields
vx_int32 height Tile block height in pixels.
vx_int32 width Tile block width in pixels.
struct vx_tile_t

The tile structure declaration.

Definition at line 103 of file vx_khr_tiling.h.

Collaboration diagram for vx_tile_t:
Collaboration graph
Data Fields
vx_imagepatch_addressing_t addr[(4)] The array of addressing structure to describe each plane.
vx_uint8 *restrict base[(4)] The array of pointers to the tile's image plane.
vx_image_description_t image The description and attributes of the image.
vx_neighborhood_size_t neighborhood The neighborhood definition.
vx_tile_block_size_t tile_block The output block size structure.
vx_uint32 tile_x The top left X pixel index within the width dimension of the image.
vx_uint32 tile_y The top left Y pixel index within the height dimension of the image.

Macro Definition Documentation

#define vxImageHeight (   ptile)    ((ptile))->image.height)

The full height of the tile's parent image in pixels.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 127 of file vx_khr_tiling.h.

#define vxImageOffset (   ptile,
  i,
  x,
  y,
  ox,
  oy 
)
Value:
((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))

Computes the offset within an image.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.
[in]iThe plane index.
[in]xThe Width Coordinates.
[in]yThe Height Coordinates.
[in]oxThe X offset.
[in]oyThe Y offset.

Definition at line 322 of file vx_khr_tiling.h.

#define vxImagePixel (   type,
  ptile,
  i,
  x,
  y,
  ox,
  oy 
)    *((type *)(&((vx_uint8 *)(ptile)->base[i])[vxImageOffset(ptile, i, x, y, ox, oy)]))

Accesses an image pixel as a type-cast indexed pointer dereference.

Parameters
[in]typeThe type of the image pixel. Example values are vx_uint8, vx_uint16, vx_uint32, etc.
[in]ptileThe pointer to the vx_tile_t structure.
[in]iThe plane index.
[in]xThe Center Pixel in Width Coordinates.
[in]yThe Center Pixel in Height Coordinates.
[in]oxThe X offset.
[in]oyThe Y offset.

Definition at line 338 of file vx_khr_tiling.h.

#define vxImageWidth (   ptile)    ((ptile))->image.width)

The full width of the tile's parent image in pixels.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 134 of file vx_khr_tiling.h.

#define vxNeighborhoodBottom (   ptile)    ((ptile)->neighborhood.bottom)

The simple wrapper to access each image's neighborhood +Y value.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 206 of file vx_khr_tiling.h.

#define vxNeighborhoodLeft (   ptile)    ((ptile)->neighborhood.left)

The simple wrapper to access each image's neighborhood -X value.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 185 of file vx_khr_tiling.h.

#define vxNeighborhoodRight (   ptile)    ((ptile)->neighborhood.right)

The simple wrapper to access each image's neighborhood +X value.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 192 of file vx_khr_tiling.h.

#define vxNeighborhoodTop (   ptile)    ((ptile)->neighborhood.top)

The simple wrapper to access each image's neighborhood -Y value.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 199 of file vx_khr_tiling.h.

#define vxTileBlockHeight (   ptile)    ((ptile)->tile_block.height)

The tile block height.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 171 of file vx_khr_tiling.h.

#define vxTileBlockWidth (   ptile)    ((ptile)->tile_block.width)

The tile block width.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 178 of file vx_khr_tiling.h.

#define vxTileHeight (   ptile,
  index 
)    ((ptile)->addr[index].dim_y)

The height of the tile in pixels.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.
[in]indexThe plane index.

Definition at line 164 of file vx_khr_tiling.h.

#define vxTileWidth (   ptile,
  index 
)    ((ptile)->addr[index].dim_x)

The width of the tile in pixels.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.
[in]indexThe plane index.

Definition at line 156 of file vx_khr_tiling.h.

#define vxTileX (   ptile)    ((ptile)->tile_x)

The offset between the left edge of the image and the left edge of the tile, in pixels.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 141 of file vx_khr_tiling.h.

#define vxTileY (   ptile)    ((ptile)->tile_y)

The offset between the top edge of the image and the top edge of the tile, in pixels.

Parameters
[in]ptileThe pointer to the vx_tile_t structure.

Definition at line 148 of file vx_khr_tiling.h.

Typedef Documentation

vx_tiling_kernel_f

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.
Parameters
[in]parametersThe array abstract pointers to parameters.
[in]tile_memoryThe local tile memory pointer if requested, otherwise NULL.
[in]tile_memory_sizeThe size of the local tile memory, if not requested, 0.

Definition at line 305 of file vx_khr_tiling.h.

Enumeration Type Documentation

The tiling border mode extensions.

Enumerator
VX_BORDER_MODE_SELF 

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 vxSetNodeAttribute with VX_NODE_ATTRIBUTE_BORDER_MODE.

Definition at line 282 of file vx_khr_tiling.h.

The User Kernel Tiling Attributes.

Enumerator
VX_KERNEL_ATTRIBUTE_INPUT_NEIGHBORHOOD 

This allows a tiling mode kernel to set its input neighborhood.

VX_KERNEL_ATTRIBUTE_OUTPUT_TILE_BLOCK_SIZE 

This allows a tiling mode kernel to set its output tile block size.

VX_KERNEL_ATTRIBUTE_BORDER 

This allows the author to set the border mode on the tiling kernel.

VX_KERNEL_ATTRIBUTE_TILE_MEMORY_SIZE 

This determines the per tile memory allocation.

Definition at line 243 of file vx_khr_tiling.h.

The User Node Tiling Attributes.

Note
These are largely unusable by the tiling function, as it doesn't give you the node reference!
Enumerator
VX_NODE_ATTRIBUTE_INPUT_NEIGHBORHOOD 

This allows a tiling mode node to get its input neighborhood.

VX_NODE_ATTRIBUTE_OUTPUT_TILE_BLOCK_SIZE 

This allows a tiling mode node to get its output tile block size.

VX_NODE_ATTRIBUTE_TILE_MEMORY_SIZE 

This is the size of the tile local memory area.

Definition at line 264 of file vx_khr_tiling.h.

Function Documentation

vx_kernel vxAddTilingKernel ( vx_context  context,
vx_char  name[(256)],
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 
)

Allows a user to add a tile-able kernel to the OpenVX system.

Parameters
[in]contextThe handle to the implementation context.
[in]nameThe string to be used to match the kernel.
[in]enumerationThe enumerated value of the kernel to be used by clients.
[in]flexible_func_ptrThe process-local flexible function pointer to be invoked.
[in]fast_func_ptrThe process-local fast function pointer to be invoked.
[in]num_paramsThe number of parameters for this kernel.
[in]inputThe pointer to a function which will validate the input parameters to this kernel.
[in]outputThe 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 vx_node_attribute_e.
Postcondition
Call vxAddParameterToKernel for as many parameters as the function has, then call vxFinalizeKernel.
Return values
0Indicates that an error occurred when adding the kernel. Note that the fast or flexible formula, but not both, can be NULL.