Skip to content

Commit

Permalink
Merge pull request opencv#8000 from mshabunin:fix-opencl-clahe
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jan 16, 2017
2 parents 10e639c + 8c66531 commit 5b363df
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions modules/imgproc/src/opencl/clahe.cl
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,13 @@ __kernel void calcLut(__global __const uchar * src, const int srcStep,
#else
clipped = smem[0];
#endif

// broadcast evaluated value

__local int totalClipped;

if (tid == 0)
totalClipped = clipped;
barrier(CLK_LOCAL_MEM_FENCE);

// redistribute clipped samples evenly

int redistBatch = totalClipped / 256;
int redistBatch = clipped / 256;
tHistVal += redistBatch;

int residual = totalClipped - redistBatch * 256;
int residual = clipped - redistBatch * 256;
int rStep = 256 / residual;
if (rStep < 1)
rStep = 1;
Expand Down

0 comments on commit 5b363df

Please sign in to comment.