From 7a49c7993a8b2c670f7caa90e3fbe8a5f1c03078 Mon Sep 17 00:00:00 2001 From: Daniil Efremov Date: Tue, 14 Nov 2017 21:25:34 +0700 Subject: COMPMID-661: issue# 23 Scale border fix (#26) Changes in CL and reference in terms of border handling. Change-Id: I5bed95b1f4c308629d7113455dc8a55d74500bcd Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95742 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- src/core/CL/cl_kernels/scale.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/CL/cl_kernels/scale.cl') diff --git a/src/core/CL/cl_kernels/scale.cl b/src/core/CL/cl_kernels/scale.cl index 0106ce095c..d533d970c7 100644 --- a/src/core/CL/cl_kernels/scale.cl +++ b/src/core/CL/cl_kernels/scale.cl @@ -84,7 +84,7 @@ __kernel void scale_nearest_neighbour( Image in = CONVERT_TO_IMAGE_STRUCT_NO_STEP(in); Image out = CONVERT_TO_IMAGE_STRUCT(out); const float2 r = (float2)(scale_x, scale_y); - const float8 tc = clamp_to_border(transform_nearest(get_current_coords(), r), input_width, input_height); + const float8 tc = clamp_to_border_with_size(transform_nearest(get_current_coords(), r), input_width, input_height, BORDER_SIZE); vstore4(read_texels4(&in, convert_int8(tc)), 0, (__global DATA_TYPE *)out.ptr); } @@ -119,5 +119,5 @@ __kernel void scale_bilinear( Image out = CONVERT_TO_IMAGE_STRUCT(out); const float2 r = (float2)(scale_x, scale_y); const float8 tc = transform_bilinear(get_current_coords(), r); - vstore4(bilinear_interpolate(&in, tc, input_width, input_height), 0, (__global DATA_TYPE *)out.ptr); + vstore4(bilinear_interpolate_with_border(&in, tc, input_width, input_height, BORDER_SIZE), 0, (__global DATA_TYPE *)out.ptr); } -- cgit v1.2.1