Commit 79f77045 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #3517 from wangyan42164:ocl_denoising_2

parents 009aec51 fd2d800c
...@@ -83,7 +83,7 @@ inline void calcFirstElementInRow(__global const uchar * src, int src_step, int ...@@ -83,7 +83,7 @@ inline void calcFirstElementInRow(__global const uchar * src, int src_step, int
int sx = x - SEARCH_SIZE2, sy = y - SEARCH_SIZE2; int sx = x - SEARCH_SIZE2, sy = y - SEARCH_SIZE2;
int col_dists_current_private[TEMPLATE_SIZE]; int col_dists_current_private[TEMPLATE_SIZE];
for (int i = id, size = SEARCH_SIZE_SQ; i < size; i += CTA_SIZE) for (int i = id; i < SEARCH_SIZE_SQ; i += CTA_SIZE)
{ {
int dist = 0, value; int dist = 0, value;
...@@ -128,7 +128,7 @@ inline void calcElementInFirstRow(__global const uchar * src, int src_step, int ...@@ -128,7 +128,7 @@ inline void calcElementInFirstRow(__global const uchar * src, int src_step, int
y -= TEMPLATE_SIZE2; y -= TEMPLATE_SIZE2;
int sx = x - SEARCH_SIZE2, sy = y - SEARCH_SIZE2; int sx = x - SEARCH_SIZE2, sy = y - SEARCH_SIZE2;
for (int i = id, size = SEARCH_SIZE_SQ; i < size; i += CTA_SIZE) for (int i = id; i < SEARCH_SIZE_SQ; i += CTA_SIZE)
{ {
__global const uchar_t * src_current = (__global const uchar_t *)(src + mad24(y, src_step, mad24(cn, x, src_offset))); __global const uchar_t * src_current = (__global const uchar_t *)(src + mad24(y, src_step, mad24(cn, x, src_offset)));
__global const uchar_t * src_template = (__global const uchar_t *)(src + __global const uchar_t * src_template = (__global const uchar_t *)(src +
...@@ -167,7 +167,7 @@ inline void calcElement(__global const uchar * src, int src_step, int src_offset ...@@ -167,7 +167,7 @@ inline void calcElement(__global const uchar * src, int src_step, int src_offset
sy_up -= SEARCH_SIZE2; sy_up -= SEARCH_SIZE2;
sy_down -= SEARCH_SIZE2; sy_down -= SEARCH_SIZE2;
for (int i = id, size = SEARCH_SIZE_SQ; i < size; i += CTA_SIZE) for (int i = id; i < SEARCH_SIZE_SQ; i += CTA_SIZE)
{ {
int wx = i % SEARCH_SIZE, wy = i / SEARCH_SIZE; int wx = i % SEARCH_SIZE, wy = i / SEARCH_SIZE;
...@@ -194,7 +194,7 @@ inline void convolveWindow(__global const uchar * src, int src_step, int src_off ...@@ -194,7 +194,7 @@ inline void convolveWindow(__global const uchar * src, int src_step, int src_off
int sx = x - SEARCH_SIZE2, sy = y - SEARCH_SIZE2, weights = 0; int sx = x - SEARCH_SIZE2, sy = y - SEARCH_SIZE2, weights = 0;
int_t weighted_sum = (int_t)(0); int_t weighted_sum = (int_t)(0);
for (int i = id, size = SEARCH_SIZE_SQ; i < size; i += CTA_SIZE) for (int i = id; i < SEARCH_SIZE_SQ; i += CTA_SIZE)
{ {
int src_index = mad24(sy + i / SEARCH_SIZE, src_step, mad24(i % SEARCH_SIZE + sx, cn, src_offset)); int src_index = mad24(sy + i / SEARCH_SIZE, src_step, mad24(i % SEARCH_SIZE + sx, cn, src_offset));
int_t src_value = convert_int_t(*(__global const uchar_t *)(src + src_index)); int_t src_value = convert_int_t(*(__global const uchar_t *)(src + src_index));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment