mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 10:03:15 +08:00
core(ipp): skip huge input in flip()
- IPP/SSE4.2 works well
This commit is contained in:
parent
dd4f591d54
commit
6a7d1c15d3
@ -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)
|
|||||||
}
|
}
|
||||||
#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,6 +46,7 @@ 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
|
||||||
|
if (!cvtest::runBigDataTests)
|
||||||
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB);
|
testSkipWithTags.push_back(CV_TEST_TAG_MEMORY_6GB);
|
||||||
#endif
|
#endif
|
||||||
testSkipWithTags.push_back(CV_TEST_TAG_VERYLONG);
|
testSkipWithTags.push_back(CV_TEST_TAG_VERYLONG);
|
||||||
|
Loading…
Reference in New Issue
Block a user