Skip to content

Commit e271623

Browse files
committed
Merge pull request opencv#19143 from vrabaud:stack
2 parents 99d750d + ec3ef52 commit e271623

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

modules/imgproc/src/clahe.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ namespace
162162

163163
// calc histogram
164164

165-
int tileHist[histSize] = {0, };
165+
cv::AutoBuffer<int> _tileHist(histSize);
166+
int* tileHist = _tileHist.data();
167+
std::fill(tileHist, tileHist + histSize, 0);
166168

167169
int height = tileROI.height;
168170
const size_t sstep = src_.step / sizeof(T);

modules/imgproc/src/imgwarp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,8 @@ class WarpAffineInvoker :
21672167
virtual void operator() (const Range& range) const CV_OVERRIDE
21682168
{
21692169
const int BLOCK_SZ = 64;
2170-
short XY[BLOCK_SZ*BLOCK_SZ*2], A[BLOCK_SZ*BLOCK_SZ];
2170+
AutoBuffer<short, 0> __XY(BLOCK_SZ * BLOCK_SZ * 2), __A(BLOCK_SZ * BLOCK_SZ);
2171+
short *XY = __XY.data(), *A = __A.data();
21712172
const int AB_BITS = MAX(10, (int)INTER_BITS);
21722173
const int AB_SCALE = 1 << AB_BITS;
21732174
int round_delta = interpolation == INTER_NEAREST ? AB_SCALE/2 : AB_SCALE/INTER_TAB_SIZE/2, x, y, x1, y1;

modules/imgproc/src/pyramids.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,9 @@ pyrDown_( const Mat& _src, Mat& _dst, int borderType )
750750
Size ssize = _src.size(), dsize = _dst.size();
751751
int cn = _src.channels();
752752

753-
int tabL[CV_CN_MAX*(PD_SZ+2)], tabR[CV_CN_MAX*(PD_SZ+2)];
754-
AutoBuffer<int> _tabM(dsize.width*cn);
755-
int* tabM = _tabM.data();
753+
AutoBuffer<int> _tabM(dsize.width * cn), _tabL(cn * (PD_SZ + 2)),
754+
_tabR(cn * (PD_SZ + 2));
755+
int *tabM = _tabM.data(), *tabL = _tabL.data(), *tabR = _tabR.data();
756756

757757
CV_Assert( ssize.width > 0 && ssize.height > 0 &&
758758
std::abs(dsize.width*2 - ssize.width) <= 2 &&

0 commit comments

Comments
 (0)