36 const float4 clamped_x =
clamp(coords.even, 0.0f - border_size, width - 1 + border_size);
37 const float4 clamped_y =
clamp(coords.odd, 0.0f - border_size, height - 1 + border_size);
38 return (float8)(clamped_x.s0, clamped_y.s0, clamped_x.s1, clamped_y.s1, clamped_x.s2, clamped_y.s2, clamped_x.s3, clamped_y.s3);
65 return (float8)( coord.s0, coord.s1, coord.s0 + 1, coord.s1, coord.s0, coord.s1 + 1, coord.s0 + 1, coord.s1 + 1);
71 return (float2)(get_global_id(0) * 4, get_global_id(1));
85 const
float scale, const
int offset_qasymm)
90 const float8 fc = floor(coords);
91 const float16 c1 = (float16)(
94 const float16 c2 = (float16)(
99 const int16
t = (int16)(
110 const float16 inf32 = convert_float16(t - (int16)offset_qasymm) * (float16)scale;
112 const float8 a = coords - fc;
113 const float8
b = ((float8)(1.f)) - a;
114 const float4 fr = (float4)(
115 ((inf32.s0 * b.s0 * b.s1) + (inf32.s1 * a.s0 * b.s1) + (inf32.s2 * b.s0 * a.s1) + (inf32.s3 * a.s0 * a.s1)),
116 ((inf32.s4 * b.s2 * b.s3) + (inf32.s5 * a.s2 * b.s3) + (inf32.s6 * b.s2 * a.s3) + (inf32.s7 * a.s2 * a.s3)),
117 ((inf32.s8 * b.s4 * b.s5) + (inf32.s9 * a.s4 * b.s5) + (inf32.sa * b.s4 * a.s5) + (inf32.sb * a.s4 * a.s5)),
118 ((inf32.sc * b.s6 * b.s7) + (inf32.sd * a.s6 * b.s7) + (inf32.se * b.s6 * a.s7) + (inf32.sf * a.s6 * a.s7)));
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define CONVERT_SAT(a, b)
const DATA_TYPE4 bilinear_interpolate_quantized(const Image *in, const float8 coords, const float width, const float height, const float scale, const int offset_qasymm)
Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...
DataType clamp(const DataType &n, const DataType &lower=std::numeric_limits< RangeType >::lowest(), const DataType &upper=std::numeric_limits< RangeType >::max())
Performs clamping among a lower and upper value.
const DATA_TYPE4 bilinear_interpolate_with_border_quantized(const Image *in, const float8 coords, const float width, const float height, const float border_size, const float scale, const int offset_qasymm)
Computes the bilinear interpolation for each set of coordinates in the vector coords and returns the ...
const float8 clamp_to_border_with_size_quantized(float8 coords, const float width, const float height, const float border_size)
Clamps the given coordinates to the borders according to the border size.
Structure to hold Image information.
const float2 get_current_coords_quantized()
Returns the current thread coordinates.
const float8 get_neighbour_coords_quantized(const float2 coord)
Given a texel coordinates this function will return the following array of coordinates: [ P...
const float8 clamp_to_border_quantized(float8 coords, const float width, const float height)
Clamps the given coordinates to the borders.
#define VEC_DATA_TYPE(type, size)