21.02
|
#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 | convolution1x7 (__global const uchar *left_pixel, const short left1_coeff, const short left2_coeff, const short left3_coeff, const short middle_coeff, const short right1_coeff, const short right2_coeff, const short right3_coeff) |
Compute a 1D horizontal convolution of size 7 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels). More... | |
int8 | convolution7x1 (Image *src, const short up1_coeff, const short up2_coeff, const short up3_coeff, const short middle_coeff, const short down1_coeff, const short down2_coeff, const short down3_coeff) |
Compute a 1D vertical convolution of size 7 for 8 bytes assuming the input is made of 1 channel of 1 byte (i.e 8 pixels). More... | |
short8 | convolution7x7 (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, const short mat25, const short mat26, const short mat27, const short mat28, const short mat29, const short mat30, const short mat31, const short mat32, const short mat33, const short mat34, const short mat35, const short mat36, const short mat37, const short mat38, const short mat39, const short mat40, const short mat41, const short mat42, const short mat43, const short mat44, const short mat45, const short mat46, const short mat47, const short mat48, uint scale) |
Apply a 7x7 convolution matrix to a single channel U8 input image and return the result. More... | |
__kernel void | convolution_separable1x7_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 1x7 static convolution matrix to a single channel U8 input image and output a single temporary channel image. More... | |
__kernel void | convolution_separable7x1_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 7x1 static convolution matrix to a single channel U8 input image and output a single channel image. More... | |
__kernel void | convolution7x7_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 7x7 convolution matrix to a single channel U8 input image and output a single channel U8 image including the borders. More... | |
#define COMPUTE_TYPE int |
Definition at line 31 of file convolution7x7.cl.
Referenced by convolution1x7(), convolution7x1(), and convolution_separable7x1_static().
#define DATA_TYPE short |
Definition at line 27 of file convolution7x7.cl.
Referenced by convolution1x7(), convolution7x1(), convolution7x7(), and convolution_separable1x7_static().
#define DATA_TYPE_OUT uchar |
Definition at line 35 of file convolution7x7.cl.
Referenced by convolution7x7_static(), and convolution_separable7x1_static().
short8 convolution1x7 | ( | __global const uchar * | left_pixel, |
const short | left1_coeff, | ||
const short | left2_coeff, | ||
const short | left3_coeff, | ||
const short | middle_coeff, | ||
const short | right1_coeff, | ||
const short | right2_coeff, | ||
const short | right3_coeff | ||
) |
Compute a 1D horizontal convolution of size 7 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 second left pixel |
[in] | left3_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 second right pixel |
[in] | right3_coeff | Weight of the most right pixel |
Definition at line 52 of file convolution7x7.cl.
References COMPUTE_TYPE, CONVERT, DATA_TYPE, and VEC_DATA_TYPE.
Referenced by convolution7x7(), convolution_rectangle(), and convolution_separable1x7_static().
int8 convolution7x1 | ( | Image * | src, |
const short | up1_coeff, | ||
const short | up2_coeff, | ||
const short | up3_coeff, | ||
const short | middle_coeff, | ||
const short | down1_coeff, | ||
const short | down2_coeff, | ||
const short | down3_coeff | ||
) |
Compute a 1D vertical convolution of size 7 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 second up pixel |
[in] | up3_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 second down pixel |
[in] | down3_coeff | Weight of the third down pixel |
Definition at line 97 of file convolution7x7.cl.
References COMPUTE_TYPE, CONVERT, DATA_TYPE, offset(), arm_compute::test::validation::src, and VEC_DATA_TYPE.
Referenced by convolution_separable7x1_static().
short8 convolution7x7 | ( | 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, | ||
const short | mat25, | ||
const short | mat26, | ||
const short | mat27, | ||
const short | mat28, | ||
const short | mat29, | ||
const short | mat30, | ||
const short | mat31, | ||
const short | mat32, | ||
const short | mat33, | ||
const short | mat34, | ||
const short | mat35, | ||
const short | mat36, | ||
const short | mat37, | ||
const short | mat38, | ||
const short | mat39, | ||
const short | mat40, | ||
const short | mat41, | ||
const short | mat42, | ||
const short | mat43, | ||
const short | mat44, | ||
const short | mat45, | ||
const short | mat46, | ||
const short | mat47, | ||
const short | mat48, | ||
uint | scale | ||
) |
Apply a 7x7 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, mat25, mat26, mat27 ]
[ mat28, mat29, mat30, mat31, mat32, mat33, mat34 ]
[ mat35, mat36, mat37, mat38, mat39, mat40, mat41 ]
[ mat42, mat43, mat44, mat45, mat46, mat47, mat48 ]
[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] | 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] | 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] | mat25 | Coefficient from the convolution matrix |
[in] | mat26 | Coefficient from the convolution matrix |
[in] | mat27 | Coefficient from the convolution matrix |
[in] | mat28 | Coefficient from the convolution matrix |
[in] | mat29 | Coefficient from the convolution matrix |
[in] | mat30 | Coefficient from the convolution matrix |
[in] | mat31 | Coefficient from the convolution matrix |
[in] | mat32 | Coefficient from the convolution matrix |
[in] | mat33 | Coefficient from the convolution matrix |
[in] | mat34 | Coefficient from the convolution matrix |
[in] | mat35 | Coefficient from the convolution matrix |
[in] | mat36 | Coefficient from the convolution matrix |
[in] | mat37 | Coefficient from the convolution matrix |
[in] | mat38 | Coefficient from the convolution matrix |
[in] | mat39 | Coefficient from the convolution matrix |
[in] | mat40 | Coefficient from the convolution matrix |
[in] | mat41 | Coefficient from the convolution matrix |
[in] | mat42 | Coefficient from the convolution matrix |
[in] | mat43 | Coefficient from the convolution matrix |
[in] | mat44 | Coefficient from the convolution matrix |
[in] | mat45 | Coefficient from the convolution matrix |
[in] | mat46 | Coefficient from the convolution matrix |
[in] | mat47 | Coefficient from the convolution matrix |
[in] | mat48 | Coefficient from the convolution matrix |
[in] | scale | Convolution matrix scale (Sum of the coefficients, or 1 if the sum is 0) |
Definition at line 200 of file convolution7x7.cl.
References convolution1x7(), DATA_TYPE, offset(), and VEC_DATA_TYPE.
Referenced by convolution7x7_static().
__kernel void convolution7x7_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 7x7 convolution matrix to a single channel U8 input image and output a single channel U8 image including the 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 321 of file convolution7x7.cl.
References CONVERT_SAT, CONVERT_TO_IMAGE_STRUCT, convolution7x7(), DATA_TYPE_OUT, arm_compute::test::validation::dst, Image::ptr, arm_compute::test::validation::src, and VEC_DATA_TYPE.
__kernel void convolution_separable1x7_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 1x7 static convolution matrix to a single channel U8 input image and output a single temporary channel image.
[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 252 of file convolution7x7.cl.
References CONVERT_TO_IMAGE_STRUCT, convolution1x7(), DATA_TYPE, arm_compute::test::validation::dst, offset(), Image::ptr, arm_compute::test::validation::src, and VEC_DATA_TYPE.
__kernel void convolution_separable7x1_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 7x1 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 285 of file convolution7x7.cl.
References COMPUTE_TYPE, CONVERT_SAT, CONVERT_TO_IMAGE_STRUCT, convolution7x1(), DATA_TYPE_OUT, arm_compute::test::validation::dst, Image::ptr, arm_compute::test::validation::src, and VEC_DATA_TYPE.