summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Farago <sensej007@email.cz>2019-08-08 11:26:55 +0200
committerTomas Farago <sensej007@email.cz>2019-08-08 11:26:55 +0200
commit3888f4b62342f6a216acbb0164ed26283cc0f6dc (patch)
tree74bd6563d7e528f2c537ece3e24acc2a1dc7ace8
parent2dbdae095899286c91b41b3abcb6f2f562671874 (diff)
downloadufo-filters-3888f4b62342f6a216acbb0164ed26283cc0f6dc.tar.gz
ufo-filters-3888f4b62342f6a216acbb0164ed26283cc0f6dc.tar.bz2
ufo-filters-3888f4b62342f6a216acbb0164ed26283cc0f6dc.tar.xz
ufo-filters-3888f4b62342f6a216acbb0164ed26283cc0f6dc.zip
Fix rm-outliers boundary condition
-rw-r--r--src/kernels/rm-outliers.cl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kernels/rm-outliers.cl b/src/kernels/rm-outliers.cl
index 586ed05..4f71ceb 100644
--- a/src/kernels/rm-outliers.cl
+++ b/src/kernels/rm-outliers.cl
@@ -37,7 +37,7 @@ filter (global float *input,
int height = get_global_size(1);
/* Check for boundary elements */
- if (abs(idx - width) < HALF_SIZE && abs(idy - height) < HALF_SIZE)
+ if (idy < HALF_SIZE || idy + HALF_SIZE >= height || idx < HALF_SIZE || idx + HALF_SIZE >= width)
output[idy * width + idx] = input[idy * width + idx];
else {
float elements[BOX_SIZE * BOX_SIZE];