mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
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
This commit is contained in:
parent
875de75327
commit
286c2c236b
@ -142,7 +142,7 @@ CV_EXPORTS void traceArg(const TraceArg& arg, double value);
|
||||
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() \
|
||||
|
@ -203,7 +203,7 @@ VSX_FINLINE(rt) fnm(const rg& a, const rg& b) \
|
||||
|
||||
#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
|
||||
@ -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)
|
||||
#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
|
||||
|
@ -204,7 +204,7 @@ struct NoVec
|
||||
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 };
|
||||
|
||||
|
@ -207,9 +207,9 @@ bool WebPDecoder::readData(Mat &img)
|
||||
{
|
||||
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
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
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);
|
||||
|
@ -229,7 +229,7 @@ public:
|
||||
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
|
||||
|
@ -266,7 +266,7 @@ public:
|
||||
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
|
||||
|
@ -715,6 +715,8 @@ static int LockCallBack(void **mutex, AVLockOp op)
|
||||
{
|
||||
case AV_LOCK_CREATE:
|
||||
localMutex = reinterpret_cast<ImplMutex*>(malloc(sizeof(ImplMutex)));
|
||||
if (!localMutex)
|
||||
return 1;
|
||||
localMutex->init();
|
||||
*mutex = localMutex;
|
||||
if (!*mutex)
|
||||
|
Loading…
Reference in New Issue
Block a user