ARM Compute Library
17.03.1
|
#include "helpers.h"
Go to the source code of this file.
Macros | |
#define | DATA_TYPE short |
#define | COMPUTE_TYPE int |
#define | DATA_TYPE_OUT uchar |
Functions | |
short8 | convolution1x5 (__global const uchar *left_pixel, const short left1_coeff, const short left2_coeff, const short middle_coeff, const short right1_coeff, const short right2_coeff) |
Compute a 1D horizontal convolution of size 5 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels). More... | |
int8 | convolution5x1 (Image *src, const short up1_coeff, const short up2_coeff, const short middle_coeff, const short down1_coeff, const short down2_coeff) |
Compute a 1D vertical convolution of size 5 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels). More... | |
short8 | convolution5x5 (Image *src, const short mat0, const short mat1, const short mat2, const short mat3, const short mat4, const short mat5, const short mat6, const short mat7, const short mat8, const short mat9, const short mat10, const short mat11, const short mat12, const short mat13, const short mat14, const short mat15, const short mat16, const short mat17, const short mat18, const short mat19, const short mat20, const short mat21, const short mat22, const short mat23, const short mat24, uint scale) |
Apply a 5x5 convolution matrix to a single channel U8 input image and return the result. More... | |
__kernel void | convolution_separable1x5_static (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes) |
Apply a 1x5 static convolution matrix to a single channel U8 input image and output a single temporary channel image(Support U16, S16, S32). More... | |
__kernel void | convolution_separable5x1_static (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes) |
Apply a 5x1 static convolution matrix to a single channel U8 input image and output a single channel image. More... | |
__kernel void | convolution5x5_static (__global uchar *src_ptr, uint src_stride_x, uint src_step_x, uint src_stride_y, uint src_step_y, uint src_offset_first_element_in_bytes, __global uchar *dst_ptr, uint dst_stride_x, uint dst_step_x, uint dst_stride_y, uint dst_step_y, uint dst_offset_first_element_in_bytes) |
Apply a static 5x5 convolution matrix to a single channel U8 input image and output a single channel image including borders. More... | |
#define COMPUTE_TYPE int |
Definition at line 31 of file convolution5x5.cl.
Referenced by convolution1x5(), convolution5x1(), and convolution_separable5x1_static().
#define DATA_TYPE short |
Definition at line 27 of file convolution5x5.cl.
Referenced by convolution1x5(), convolution5x1(), convolution5x5(), and convolution_separable1x5_static().
#define DATA_TYPE_OUT uchar |
Definition at line 35 of file convolution5x5.cl.
Referenced by convolution5x5_static(), and convolution_separable5x1_static().
short8 convolution1x5 | ( | __global const uchar * | left_pixel, |
const short | left1_coeff, | ||
const short | left2_coeff, | ||
const short | middle_coeff, | ||
const short | right1_coeff, | ||
const short | right2_coeff | ||
) |
Compute a 1D horizontal convolution of size 5 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels).
[in] | left_pixel | Pointer to the left pixel |
[in] | left1_coeff | Weight of the most left pixel |
[in] | left2_coeff | Weight of the left pixel |
[in] | middle_coeff | Weight of the middle pixel |
[in] | right1_coeff | Weight of the right pixel |
[in] | right2_coeff | Weight of the most right pixel |
Definition at line 50 of file convolution5x5.cl.
References COMPUTE_TYPE, CONVERT, DATA_TYPE, and VEC_DATA_TYPE.
Referenced by convolution5x5(), convolution_rectangle(), and convolution_separable1x5_static().
int8 convolution5x1 | ( | Image * | src, |
const short | up1_coeff, | ||
const short | up2_coeff, | ||
const short | middle_coeff, | ||
const short | down1_coeff, | ||
const short | down2_coeff | ||
) |
Compute a 1D vertical convolution of size 5 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels).
[in] | src | Pointer to source image. |
[in] | up1_coeff | Weight of the most up pixel |
[in] | up2_coeff | Weight of the up pixel |
[in] | middle_coeff | Weight of the middle pixel |
[in] | down1_coeff | Weight of the down pixel |
[in] | down2_coeff | Weight of the most down pixel |
Definition at line 87 of file convolution5x5.cl.
References COMPUTE_TYPE, CONVERT, DATA_TYPE, offset(), and VEC_DATA_TYPE.
Referenced by convolution_separable5x1_static().
short8 convolution5x5 | ( | Image * | src, |
const short | mat0, | ||
const short | mat1, | ||
const short | mat2, | ||
const short | mat3, | ||
const short | mat4, | ||
const short | mat5, | ||
const short | mat6, | ||
const short | mat7, | ||
const short | mat8, | ||
const short | mat9, | ||
const short | mat10, | ||
const short | mat11, | ||
const short | mat12, | ||
const short | mat13, | ||
const short | mat14, | ||
const short | mat15, | ||
const short | mat16, | ||
const short | mat17, | ||
const short | mat18, | ||
const short | mat19, | ||
const short | mat20, | ||
const short | mat21, | ||
const short | mat22, | ||
const short | mat23, | ||
const short | mat24, | ||
uint | scale | ||
) |
Apply a 5x5 convolution matrix to a single channel U8 input image and return the result.
Convolution matrix layout:
[ mat0, mat1, mat2, mat3 , mat4 ]
[ mat5, mat6, mat7, mat8, mat9 ]
[ mat10, mat11, mat12, mat13, mat14 ]
[ mat15, mat16, mat17, mat18, mat19 ]
[ mat20, mat21, mat22, mat23, mat24 ]
[in] | src | A pointer to source Image structure. |
[in] | mat0 | Coefficient from the convolution matrix |
[in] | mat1 | Coefficient from the convolution matrix |
[in] | mat2 | Coefficient from the convolution matrix |
[in] | mat3 | Coefficient from the convolution matrix |
[in] | mat4 | Coefficient from the convolution matrix |
[in] | mat5 | Coefficient from the convolution matrix |
[in] | mat6 | Coefficient from the convolution matrix |
[in] | mat0 | Coefficient from the convolution matrix |
[in] | mat7 | Coefficient from the convolution matrix |
[in] | mat8 | Coefficient from the convolution matrix |
[in] | mat9 | Coefficient from the convolution matrix |
[in] | mat10 | Coefficient from the convolution matrix |
[in] | mat11 | Coefficient from the convolution matrix |
[in] | mat12 | Coefficient from the convolution matrix |
[in] | mat13 | Coefficient from the convolution matrix |
[in] | mat14 | Coefficient from the convolution matrix |
[in] | mat15 | Coefficient from the convolution matrix |
[in] | mat16 | Coefficient from the convolution matrix |
[in] | mat10 | Coefficient from the convolution matrix |
[in] | mat17 | Coefficient from the convolution matrix |
[in] | mat18 | Coefficient from the convolution matrix |
[in] | mat19 | Coefficient from the convolution matrix |
[in] | mat20 | Coefficient from the convolution matrix |
[in] | mat21 | Coefficient from the convolution matrix |
[in] | mat22 | Coefficient from the convolution matrix |
[in] | mat23 | Coefficient from the convolution matrix |
[in] | mat24 | Coefficient from the convolution matrix |
[in] | scale | Convolution matrix scale (Sum of the coefficients, or 1 if the sum is 0) |
Definition at line 159 of file convolution5x5.cl.
References convolution1x5(), DATA_TYPE, offset(), and VEC_DATA_TYPE.
Referenced by convolution5x5_static().
__kernel void convolution5x5_static | ( | __global uchar * | src_ptr, |
uint | src_stride_x, | ||
uint | src_step_x, | ||
uint | src_stride_y, | ||
uint | src_step_y, | ||
uint | src_offset_first_element_in_bytes, | ||
__global uchar * | dst_ptr, | ||
uint | dst_stride_x, | ||
uint | dst_step_x, | ||
uint | dst_stride_y, | ||
uint | dst_step_y, | ||
uint | dst_offset_first_element_in_bytes | ||
) |
Apply a static 5x5 convolution matrix to a single channel U8 input image and output a single channel image including borders.
[in] | src_ptr | Pointer to the source image. Supported data types: U8 |
[in] | src_stride_x | Stride of the source image in X dimension (in bytes) |
[in] | src_step_x | src_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | src_stride_y | Stride of the source image in Y dimension (in bytes) |
[in] | src_step_y | src_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | src_offset_first_element_in_bytes | The offset of the first element in the source image |
[out] | dst_ptr | Pointer to the destination image. Supported data types: U8, S16 |
[in] | dst_stride_x | Stride of the destination image in X dimension (in bytes) |
[in] | dst_step_x | dst_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | dst_stride_y | Stride of the destination image in Y dimension (in bytes) |
[in] | dst_step_y | dst_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | dst_offset_first_element_in_bytes | The offset of the first element in the destination image |
Definition at line 274 of file convolution5x5.cl.
References CONVERT_SAT, CONVERT_TO_IMAGE_STRUCT, convolution5x5(), DATA_TYPE_OUT, Image::ptr, and VEC_DATA_TYPE.
__kernel void convolution_separable1x5_static | ( | __global uchar * | src_ptr, |
uint | src_stride_x, | ||
uint | src_step_x, | ||
uint | src_stride_y, | ||
uint | src_step_y, | ||
uint | src_offset_first_element_in_bytes, | ||
__global uchar * | dst_ptr, | ||
uint | dst_stride_x, | ||
uint | dst_step_x, | ||
uint | dst_stride_y, | ||
uint | dst_step_y, | ||
uint | dst_offset_first_element_in_bytes | ||
) |
Apply a 1x5 static convolution matrix to a single channel U8 input image and output a single temporary channel image(Support U16, S16, S32).
[in] | src_ptr | Pointer to the source image. Supported data types: U8 |
[in] | src_stride_x | Stride of the source image in X dimension (in bytes) |
[in] | src_step_x | src_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | src_stride_y | Stride of the source image in Y dimension (in bytes) |
[in] | src_step_y | src_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | src_offset_first_element_in_bytes | The offset of the first element in the source image |
[out] | dst_ptr | Pointer to the destination image. Supported data types: U16, S16, S32 |
[in] | dst_stride_x | Stride of the destination image in X dimension (in bytes) |
[in] | dst_step_x | dst_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | dst_stride_y | Stride of the destination image in Y dimension (in bytes) |
[in] | dst_step_y | dst_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | dst_offset_first_element_in_bytes | The offset of the first element in the destination image |
Definition at line 205 of file convolution5x5.cl.
References CONVERT_TO_IMAGE_STRUCT, convolution1x5(), DATA_TYPE, offset(), Image::ptr, and VEC_DATA_TYPE.
__kernel void convolution_separable5x1_static | ( | __global uchar * | src_ptr, |
uint | src_stride_x, | ||
uint | src_step_x, | ||
uint | src_stride_y, | ||
uint | src_step_y, | ||
uint | src_offset_first_element_in_bytes, | ||
__global uchar * | dst_ptr, | ||
uint | dst_stride_x, | ||
uint | dst_step_x, | ||
uint | dst_stride_y, | ||
uint | dst_step_y, | ||
uint | dst_offset_first_element_in_bytes | ||
) |
Apply a 5x1 static convolution matrix to a single channel U8 input image and output a single channel image.
[in] | src_ptr | Pointer to the source image. Supported data types: U16, S16, S32 |
[in] | src_stride_x | Stride of the source image in X dimension (in bytes) |
[in] | src_step_x | src_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | src_stride_y | Stride of the source image in Y dimension (in bytes) |
[in] | src_step_y | src_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | src_offset_first_element_in_bytes | The offset of the first element in the source image |
[out] | dst_ptr | Pointer to the destination image. Supported data types: U8, S16 |
[in] | dst_stride_x | Stride of the destination image in X dimension (in bytes) |
[in] | dst_step_x | dst_stride_x * number of elements along X processed per workitem(in bytes) |
[in] | dst_stride_y | Stride of the destination image in Y dimension (in bytes) |
[in] | dst_step_y | dst_stride_y * number of elements along Y processed per workitem(in bytes) |
[in] | dst_offset_first_element_in_bytes | The offset of the first element in the destination image |
Definition at line 238 of file convolution5x5.cl.
References COMPUTE_TYPE, CONVERT_SAT, CONVERT_TO_IMAGE_STRUCT, convolution5x1(), DATA_TYPE_OUT, Image::ptr, and VEC_DATA_TYPE.