static const CV_TRACE_NS::details::Region::LocationStaticStorage \
CV__TRACE_LOCATION_VARNAME(loc_id) = { &(CV__TRACE_LOCATION_EXTRA_VARNAME(loc_id)), name, CV_TRACE_FILENAME, __LINE__, flags};
-#define CV__TRACE_DEFINE_LOCATION_FN(name, flags) CV__TRACE_DEFINE_LOCATION_(fn, name, (flags | CV_TRACE_NS::details::REGION_FLAG_FUNCTION))
+#define CV__TRACE_DEFINE_LOCATION_FN(name, flags) CV__TRACE_DEFINE_LOCATION_(fn, name, ((flags) | CV_TRACE_NS::details::REGION_FLAG_FUNCTION))
#define CV__TRACE_OPENCV_FUNCTION() \
#if __GNUG__ < 5
// vec_xxpermdi in gcc4 missing little-endian supports just like clang
-# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ ((c & 1) << 1 | c >> 1)))
+# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1)))
#else
# define vec_permi vec_xxpermdi
#endif // __GNUG__ < 5
# define vec_xxsldwi(a, b, c) vec_sld(a, b, (c) * 4)
#else
// vec_xxpermdi is missing little-endian supports in clang 4 just like gcc4
-# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ ((c & 1) << 1 | c >> 1)))
+# define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1)))
#endif // __clang_major__ < 5
// shift left double by word immediate
size_t operator()(const void*, const void*, void*, size_t) const { return 0; }
};
-#define CV_SPLIT_MERGE_MAX_BLOCK_SIZE(cn) ((INT_MAX/4)/cn) // HAL implementation accepts 'int' len, so INT_MAX doesn't work here
+#define CV_SPLIT_MERGE_MAX_BLOCK_SIZE(cn) ((INT_MAX/4)/(cn)) // HAL implementation accepts 'int' len, so INT_MAX doesn't work here
enum { BLOCK_SIZE = 1024 };
{
cvtColor(read_img, img, COLOR_BGRA2BGR);
}
- else if (img.type() == CV_8UC3 && m_type == CV_8UC4)
+ else if (img.type() == CV_8UC4 && m_type == CV_8UC3)
{
- cvtColor(read_img, img, COLOR_BGRA2BGR);
+ cvtColor(read_img, img, COLOR_BGR2BGRA);
}
else
{
Mat img0 = _img0.getMat();
Mat img1 = _img1.getMat();
CV_Assert(img0.channels() == 1 && img0.type() == img1.type());
- CV_Assert(img0.size() == img0.size());
+ CV_Assert(img0.size() == img1.size());
int maxlevel = static_cast<int>(log((double)max(img0.rows, img0.cols)) / log(2.0)) - 1;
maxlevel = min(maxlevel, max_bits - 1);
virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; }
virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE
{
- if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows))
+ if (bShadowDetection == detectshadows)
return;
bShadowDetection = detectshadows;
#ifdef HAVE_OPENCL
virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; }
virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE
{
- if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows))
+ if (bShadowDetection == detectshadows)
return;
bShadowDetection = detectshadows;
#ifdef HAVE_OPENCL
{
case AV_LOCK_CREATE:
localMutex = reinterpret_cast<ImplMutex*>(malloc(sizeof(ImplMutex)));
+ if (!localMutex)
+ return 1;
localMutex->init();
*mutex = localMutex;
if (!*mutex)