mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
Fix the OpenCL portion to match the c++ code.
Fix an undiscovered bug in the c++ code.
This commit is contained in:
parent
c6772a8f5d
commit
17df65e666
@ -215,7 +215,7 @@ namespace
|
|||||||
if (residual != 0)
|
if (residual != 0)
|
||||||
{
|
{
|
||||||
int residualStep = MAX(histSize / residual, 1);
|
int residualStep = MAX(histSize / residual, 1);
|
||||||
for (int i = 0; i < histSize; i += residualStep)
|
for (int i = 0; i < histSize && residual > 0; i += residualStep, residual--)
|
||||||
tileHist[i]++;
|
tileHist[i]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,10 @@ __kernel void calcLut(__global __const uchar * src, const int srcStep,
|
|||||||
tHistVal += redistBatch;
|
tHistVal += redistBatch;
|
||||||
|
|
||||||
int residual = totalClipped - redistBatch * 256;
|
int residual = totalClipped - redistBatch * 256;
|
||||||
if (tid < residual)
|
int rStep = 256 / residual;
|
||||||
|
if (rStep < 1)
|
||||||
|
rStep = 1;
|
||||||
|
if (tid%rStep == 0 && (tid/rStep)<residual)
|
||||||
++tHistVal;
|
++tHistVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user