From 40ff03b07547ed1e145e956141c2c355e87515ee Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Thu, 10 Aug 2017 16:44:42 +0100 Subject: COMPMID-417 - Bug Fix WarpPerspective kernel Change-Id: Ic55f9d739f5f8dca65963fdefa6e2528421042b1 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/83550 Reviewed-by: Steven Niu Tested-by: Kaizen --- src/core/NEON/kernels/NEWarpKernel.cpp | 46 ++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 11 deletions(-) (limited to 'src/core/NEON/kernels/NEWarpKernel.cpp') diff --git a/src/core/NEON/kernels/NEWarpKernel.cpp b/src/core/NEON/kernels/NEWarpKernel.cpp index 5ca1395b47..a1ec1a0b51 100644 --- a/src/core/NEON/kernels/NEWarpKernel.cpp +++ b/src/core/NEON/kernels/NEWarpKernel.cpp @@ -395,7 +395,11 @@ void NEWarpPerspectiveKernel::warp_undefined(const Window &window const float start_z0 = M20 * window.x().start(); // Current row - int y_cur = window.y().start(); + int y_cur = window.y().start(); + int z_cur = window.z().start(); + int d3_cur = window[3].start(); + int d4_cur = window[4].start(); + int d5_cur = window[5].start(); // const_x0, const_y0 and const_z0 are the constant parts of x0, y0 and z0 during the row processing float const_x0 = M01 * y_cur + M02; @@ -410,9 +414,13 @@ void NEWarpPerspectiveKernel::warp_undefined(const Window &window execute_window_loop(window, [&](const Coordinates & id) { // Check if we are processing a new row. If so, update the current processed row (y_cur), x0, y0 and z0 - if(y_cur != id.y()) + if((y_cur != id.y()) || (z_cur != id.z()) || (d3_cur != id[3]) || (d4_cur != id[4]) || (d5_cur != id[5])) { - y_cur = id.y(); + y_cur = id.y(); + z_cur = id.z(); + d3_cur = id[3]; + d4_cur = id[4]; + d5_cur = id[5]; const_x0 = M01 * y_cur + M02; const_y0 = M11 * y_cur + M12; @@ -489,7 +497,11 @@ void NEWarpPerspectiveKernel::warp_constant(const Window &window) const float start_z0 = M20 * window.x().start(); // Current row - int y_cur = window.y().start(); + int y_cur = window.y().start(); + int z_cur = window.z().start(); + int d3_cur = window[3].start(); + int d4_cur = window[4].start(); + int d5_cur = window[5].start(); // const_x0, const_y0 and const_z0 are the constant parts of x0, y0 and z0 during the row processing float const_x0 = M01 * y_cur + M02; @@ -503,10 +515,14 @@ void NEWarpPerspectiveKernel::warp_constant(const Window &window) execute_window_loop(window, [&](const Coordinates & id) { - // Check if we are processing a new row. If so, update the current row (y_cur), x0, y0 and z0 - if(y_cur != id.y()) + // Check if we are processing a new row. If so, update the current processed row (y_cur), x0, y0 and z0 + if((y_cur != id.y()) || (z_cur != id.z()) || (d3_cur != id[3]) || (d4_cur != id[4]) || (d5_cur != id[5])) { - y_cur = id.y(); + y_cur = id.y(); + z_cur = id.z(); + d3_cur = id[3]; + d4_cur = id[4]; + d5_cur = id[5]; const_x0 = M01 * y_cur + M02; const_y0 = M11 * y_cur + M12; @@ -593,7 +609,11 @@ void NEWarpPerspectiveKernel::warp_replicate(const Window &window const size_t stride = _input->info()->strides_in_bytes()[1]; // Current row - int y_cur = window.y().start(); + int y_cur = window.y().start(); + int z_cur = window.z().start(); + int d3_cur = window[3].start(); + int d4_cur = window[4].start(); + int d5_cur = window[5].start(); // x0 = M00 * x + M01 * y + M02 // y0 = M10 * x + M11 * y + M12 @@ -627,10 +647,14 @@ void NEWarpPerspectiveKernel::warp_replicate(const Window &window execute_window_loop(window, [&](const Coordinates & id) { - // Check if we are processing a new row. If so, update the current row (y_cur), x0, y0 and z0 - if(y_cur != id.y()) + // Check if we are processing a new row. If so, update the current processed row (y_cur), x0, y0 and z0 + if((y_cur != id.y()) || (z_cur != id.z()) || (d3_cur != id[3]) || (d4_cur != id[4]) || (d5_cur != id[5])) { - y_cur = id.y(); + y_cur = id.y(); + z_cur = id.z(); + d3_cur = id[3]; + d4_cur = id[4]; + d5_cur = id[5]; const_x0 = M01 * y_cur + M02; const_y0 = M11 * y_cur + M12; -- cgit v1.2.1