Merge pull request #12458 from DEEPIR:3.4

* may be an typo fix

* remove identical branch,may be paste error

* add parentheses around macro parameter

* simplify if condition

* check malloc fail

* change the condition of branch removed by commit 3041502861
pull/12465/head
cyy 6 years ago committed by Alexander Alekhin
parent 875de75327
commit 286c2c236b
  1. 2
      modules/core/include/opencv2/core/utils/trace.hpp
  2. 4
      modules/core/include/opencv2/core/vsx_utils.hpp
  3. 2
      modules/core/src/precomp.hpp
  4. 4
      modules/imgcodecs/src/grfmt_webp.cpp
  5. 2
      modules/photo/src/align.cpp
  6. 2
      modules/video/src/bgfg_KNN.cpp
  7. 2
      modules/video/src/bgfg_gaussmix2.cpp
  8. 2
      modules/videoio/src/cap_ffmpeg_impl.hpp

@ -142,7 +142,7 @@ CV_EXPORTS void traceArg(const TraceArg& arg, double value);
static const CV_TRACE_NS::details::Region::LocationStaticStorage \ 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}; 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() \ #define CV__TRACE_OPENCV_FUNCTION() \

@ -203,7 +203,7 @@ VSX_FINLINE(rt) fnm(const rg& a, const rg& b) \
#if __GNUG__ < 5 #if __GNUG__ < 5
// vec_xxpermdi in gcc4 missing little-endian supports just like clang // 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 #else
# define vec_permi vec_xxpermdi # define vec_permi vec_xxpermdi
#endif // __GNUG__ < 5 #endif // __GNUG__ < 5
@ -320,7 +320,7 @@ VSX_FINLINE(rt) fnm(const rg& a) { return __builtin_convertvector(a, rt); }
# define vec_xxsldwi(a, b, c) vec_sld(a, b, (c) * 4) # define vec_xxsldwi(a, b, c) vec_sld(a, b, (c) * 4)
#else #else
// vec_xxpermdi is missing little-endian supports in clang 4 just like gcc4 // 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 #endif // __clang_major__ < 5
// shift left double by word immediate // shift left double by word immediate

@ -204,7 +204,7 @@ struct NoVec
size_t operator()(const void*, const void*, void*, size_t) const { return 0; } 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 }; enum { BLOCK_SIZE = 1024 };

@ -207,9 +207,9 @@ bool WebPDecoder::readData(Mat &img)
{ {
cvtColor(read_img, img, COLOR_BGRA2BGR); 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 else
{ {

@ -123,7 +123,7 @@ public:
Mat img0 = _img0.getMat(); Mat img0 = _img0.getMat();
Mat img1 = _img1.getMat(); Mat img1 = _img1.getMat();
CV_Assert(img0.channels() == 1 && img0.type() == img1.type()); 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; int maxlevel = static_cast<int>(log((double)max(img0.rows, img0.cols)) / log(2.0)) - 1;
maxlevel = min(maxlevel, max_bits - 1); maxlevel = min(maxlevel, max_bits - 1);

@ -229,7 +229,7 @@ public:
virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; } virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; }
virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE
{ {
if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows)) if (bShadowDetection == detectshadows)
return; return;
bShadowDetection = detectshadows; bShadowDetection = detectshadows;
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL

@ -266,7 +266,7 @@ public:
virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; } virtual bool getDetectShadows() const CV_OVERRIDE { return bShadowDetection; }
virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE virtual void setDetectShadows(bool detectshadows) CV_OVERRIDE
{ {
if ((bShadowDetection && detectshadows) || (!bShadowDetection && !detectshadows)) if (bShadowDetection == detectshadows)
return; return;
bShadowDetection = detectshadows; bShadowDetection = detectshadows;
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL

@ -715,6 +715,8 @@ static int LockCallBack(void **mutex, AVLockOp op)
{ {
case AV_LOCK_CREATE: case AV_LOCK_CREATE:
localMutex = reinterpret_cast<ImplMutex*>(malloc(sizeof(ImplMutex))); localMutex = reinterpret_cast<ImplMutex*>(malloc(sizeof(ImplMutex)));
if (!localMutex)
return 1;
localMutex->init(); localMutex->init();
*mutex = localMutex; *mutex = localMutex;
if (!*mutex) if (!*mutex)

Loading…
Cancel
Save