提交 bce65311 编写于 作者: A Alexander Alekhin

Merge pull request #15700 from alalek:issue_12943

...@@ -711,6 +711,13 @@ static bool ipp_flip(Mat &src, Mat &dst, int flip_mode) ...@@ -711,6 +711,13 @@ static bool ipp_flip(Mat &src, Mat &dst, int flip_mode)
#ifdef HAVE_IPP_IW #ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP(); CV_INSTRUMENT_REGION_IPP();
// Details: https://github.com/opencv/opencv/issues/12943
if (flip_mode <= 0 /* swap rows */
&& cv::ipp::getIppTopFeatures() != ippCPUID_SSE42
&& (int64_t)(src.total()) * src.elemSize() >= CV_BIG_INT(0x80000000)/*2Gb*/
)
return false;
IppiAxis ippMode; IppiAxis ippMode;
if(flip_mode < 0) if(flip_mode < 0)
ippMode = ippAxsBoth; ippMode = ippAxsBoth;
......
...@@ -2035,4 +2035,17 @@ TEST(Core_Eigen, eigen2cv_check_Mat_type) ...@@ -2035,4 +2035,17 @@ TEST(Core_Eigen, eigen2cv_check_Mat_type)
} }
#endif // HAVE_EIGEN #endif // HAVE_EIGEN
TEST(Mat, regression_12943) // memory usage: ~4.5 Gb
{
applyTestTag(CV_TEST_TAG_MEMORY_6GB);
const int width = 0x8000;
const int height = 0x10001;
cv::Mat src(height, width, CV_8UC1, Scalar::all(128));
cv::Mat dst;
cv::flip(src, dst, 0);
}
}} // namespace }} // namespace
...@@ -46,7 +46,8 @@ static std::vector<std::string>& getTestTagsSkipList() ...@@ -46,7 +46,8 @@ static std::vector<std::string>& getTestTagsSkipList()
#if OPENCV_32BIT_CONFIGURATION #if OPENCV_32BIT_CONFIGURATION
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_2GB); testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_2GB);
#else #else
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB); if (!cvtest::runBigDataTests)
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB);
#endif #endif
testSkipWithTags.push_back(CV_TEST_TAG_VERYLONG); testSkipWithTags.push_back(CV_TEST_TAG_VERYLONG);
#if defined(_DEBUG) #if defined(_DEBUG)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册