36 const float4 in_x_coords = (float4)(coord.s0, 1 + coord.s0, 2 + coord.s0, 3 + coord.s0);
37 #ifdef SAMPLING_POLICY_TOP_LEFT 38 const float4 new_x = in_x_coords * (float4)(scale.s0);
39 const float4 new_y = (float4)(coord.s1 * scale.s1);
40 return (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);
41 #elif SAMPLING_POLICY_CENTER 42 const float4 new_x = (in_x_coords + ((float4)(0.5f))) * (float4)(scale.s0) - (float4)(0.5f);
43 const float4 new_y = (float4)((coord.s1 + 0.5f) * scale.s1 - 0.5f);
44 return (float8)(new_x.s0, new_y.s0, new_x.s1, new_y.s1, new_x.s2, new_y.s2, new_x.s3, new_y.s3);
46 #error("Unsupported sampling policy"); 83 const float2 r = (float2)(scale_x, scale_y);
#define CONVERT_TO_IMAGE_STRUCT(name)
#define IMAGE_DECLARATION(name)
#define CONVERT_TO_IMAGE_STRUCT_NO_STEP(name)
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 transform_bilinear_quantized(const float2 coord, const float2 scale)
Transforms four 2D coordinates.
Structure to hold Image information.
__kernel void scale_bilinear_quantized_nchw(__global uchar *in_ptr, uint in_stride_x, uint in_step_x, uint in_stride_y, uint in_step_y, uint in_offset_first_element_in_bytes, __global uchar *out_ptr, uint out_stride_x, uint out_step_x, uint out_stride_y, uint out_step_y, uint out_offset_first_element_in_bytes, const float input_width, const float input_height, const float scale_x, const float scale_y)
Performs an affine transformation on an image interpolating with the BILINEAR method.
__global uchar * ptr
Pointer to the starting postion of the buffer.
const float2 get_current_coords_quantized()
Returns the current thread coordinates.
const size_t input_height