aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NEWarpKernel.cpp
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2017-08-10 16:44:42 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit40ff03b07547ed1e145e956141c2c355e87515ee (patch)
tree182471e7f3cec80ff7940b4e28f1658f62337a33 /src/core/NEON/kernels/NEWarpKernel.cpp
parent369e014b7aeb90419867e1426403e4ae2e171426 (diff)
downloadComputeLibrary-40ff03b07547ed1e145e956141c2c355e87515ee.tar.gz
COMPMID-417 - Bug Fix WarpPerspective kernel
Change-Id: Ic55f9d739f5f8dca65963fdefa6e2528421042b1 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/83550 Reviewed-by: Steven Niu <steven.niu@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEWarpKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NEWarpKernel.cpp46
1 files changed, 35 insertions, 11 deletions
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<interpolation>::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<interpolation>::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<interpolation>::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<interpolation>::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<interpolation>::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<interpolation>::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;