mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -36,15 +36,15 @@
|
||||
namespace cv {
|
||||
|
||||
template <typename T>
|
||||
DualQuat<T>::DualQuat():w(0), x(0), y(0), z(0), w_(0), x_(0), y_(0), z_(0){};
|
||||
DualQuat<T>::DualQuat():w(0), x(0), y(0), z(0), w_(0), x_(0), y_(0), z_(0){}
|
||||
|
||||
template <typename T>
|
||||
DualQuat<T>::DualQuat(const T vw, const T vx, const T vy, const T vz, const T _w, const T _x, const T _y, const T _z):
|
||||
w(vw), x(vx), y(vy), z(vz), w_(_w), x_(_x), y_(_y), z_(_z){};
|
||||
w(vw), x(vx), y(vy), z(vz), w_(_w), x_(_x), y_(_y), z_(_z){}
|
||||
|
||||
template <typename T>
|
||||
DualQuat<T>::DualQuat(const Vec<T, 8> &q):w(q[0]), x(q[1]), y(q[2]), z(q[3]),
|
||||
w_(q[4]), x_(q[5]), y_(q[6]), z_(q[7]){};
|
||||
w_(q[4]), x_(q[5]), y_(q[6]), z_(q[7]){}
|
||||
|
||||
template <typename T>
|
||||
DualQuat<T> DualQuat<T>::createFromQuat(const Quat<T> &realPart, const Quat<T> &dualPart)
|
||||
|
||||
@@ -987,6 +987,15 @@ namespace CV__SIMD_NAMESPACE {
|
||||
{ \
|
||||
return a op b; \
|
||||
}
|
||||
#define OPENCV_HAL_WRAP_EQ_OP(_Tpvec) \
|
||||
inline _Tpvec v_eq(const _Tpvec& a, const _Tpvec& b) \
|
||||
{ \
|
||||
return a == b; \
|
||||
} \
|
||||
inline _Tpvec v_ne(const _Tpvec& a, const _Tpvec& b) \
|
||||
{ \
|
||||
return a != b; \
|
||||
}
|
||||
|
||||
#define OPENCV_HAL_WRAP_CMP(_Tpvec) \
|
||||
OPENCV_HAL_WRAP_CMP_OP(_Tpvec, eq, ==) \
|
||||
@@ -999,11 +1008,11 @@ namespace CV__SIMD_NAMESPACE {
|
||||
OPENCV_HAL_WRAP_CMP(v_uint8)
|
||||
OPENCV_HAL_WRAP_CMP(v_uint16)
|
||||
OPENCV_HAL_WRAP_CMP(v_uint32)
|
||||
// OPENCV_HAL_WRAP_CMP(v_uint64)
|
||||
OPENCV_HAL_WRAP_EQ_OP(v_uint64)
|
||||
OPENCV_HAL_WRAP_CMP(v_int8)
|
||||
OPENCV_HAL_WRAP_CMP(v_int16)
|
||||
OPENCV_HAL_WRAP_CMP(v_int32)
|
||||
// OPENCV_HAL_WRAP_CMP(v_int64)
|
||||
OPENCV_HAL_WRAP_EQ_OP(v_int64)
|
||||
OPENCV_HAL_WRAP_CMP(v_float32)
|
||||
#if CV_SIMD_64F
|
||||
OPENCV_HAL_WRAP_CMP(v_float64)
|
||||
@@ -1012,9 +1021,11 @@ namespace CV__SIMD_NAMESPACE {
|
||||
OPENCV_HAL_WRAP_CMP(v_uint8x16)
|
||||
OPENCV_HAL_WRAP_CMP(v_uint16x8)
|
||||
OPENCV_HAL_WRAP_CMP(v_uint32x4)
|
||||
OPENCV_HAL_WRAP_EQ_OP(v_uint64x2)
|
||||
OPENCV_HAL_WRAP_CMP(v_int8x16)
|
||||
OPENCV_HAL_WRAP_CMP(v_int16x8)
|
||||
OPENCV_HAL_WRAP_CMP(v_int32x4)
|
||||
OPENCV_HAL_WRAP_EQ_OP(v_int64x2)
|
||||
OPENCV_HAL_WRAP_CMP(v_float32x4)
|
||||
#if CV_SIMD_64F
|
||||
OPENCV_HAL_WRAP_CMP(v_float64x2)
|
||||
@@ -1024,9 +1035,11 @@ namespace CV__SIMD_NAMESPACE {
|
||||
OPENCV_HAL_WRAP_CMP(v_uint8x32)
|
||||
OPENCV_HAL_WRAP_CMP(v_uint16x16)
|
||||
OPENCV_HAL_WRAP_CMP(v_uint32x8)
|
||||
OPENCV_HAL_WRAP_EQ_OP(v_uint64x4)
|
||||
OPENCV_HAL_WRAP_CMP(v_int8x32)
|
||||
OPENCV_HAL_WRAP_CMP(v_int16x16)
|
||||
OPENCV_HAL_WRAP_CMP(v_int32x8)
|
||||
OPENCV_HAL_WRAP_EQ_OP(v_int64x4)
|
||||
OPENCV_HAL_WRAP_CMP(v_float32x8)
|
||||
#if CV_SIMD_64F
|
||||
OPENCV_HAL_WRAP_CMP(v_float64x4)
|
||||
|
||||
@@ -188,4 +188,4 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END
|
||||
|
||||
//! @endcond
|
||||
|
||||
} // cv::
|
||||
} // cv::
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
// 0.11 -> 0.12 compatibility
|
||||
|
||||
#ifndef _RVV_IMPLICIT_VXRM
|
||||
#define _RVV_IMPLICIT_VXRM __RISCV_VXRM_RNU
|
||||
#endif
|
||||
|
||||
// NOTE: masked should go first to avoid extra substitution (3 arg -> 4 arg -> 5 arg)
|
||||
|
||||
// masked
|
||||
#define __riscv_vaadd(_1, _2, _3, _4) __riscv_vaadd(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vasub(_1, _2, _3, _4) __riscv_vasub(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vaaddu(_1, _2, _3, _4) __riscv_vaaddu(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vasubu(_1, _2, _3, _4) __riscv_vasubu(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vsmul(_1, _2, _3, _4) __riscv_vsmul(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vssra(_1, _2, _3, _4) __riscv_vssra(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vssrl(_1, _2, _3, _4) __riscv_vssrl(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vnclip(_1, _2, _3, _4) __riscv_vnclip(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
#define __riscv_vnclipu(_1, _2, _3, _4) __riscv_vnclipu(_1, _2, _3, _RVV_IMPLICIT_VXRM, _4)
|
||||
|
||||
// unmasked
|
||||
#define __riscv_vaadd(_1, _2, _3) __riscv_vaadd(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vasub(_1, _2, _3) __riscv_vasub(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vaaddu(_1, _2, _3) __riscv_vaaddu(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vasubu(_1, _2, _3) __riscv_vasubu(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vsmul(_1, _2, _3) __riscv_vsmul(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vssra(_1, _2, _3) __riscv_vssra(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vssrl(_1, _2, _3) __riscv_vssrl(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vnclip(_1, _2, _3) __riscv_vnclip(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
#define __riscv_vnclipu(_1, _2, _3) __riscv_vnclipu(_1, _2, _RVV_IMPLICIT_VXRM, _3)
|
||||
@@ -21,6 +21,10 @@
|
||||
#include "intrin_rvv_010_compat_overloaded-non-policy.hpp"
|
||||
#endif
|
||||
|
||||
#if defined(__riscv_v_intrinsic) && __riscv_v_intrinsic>11999
|
||||
#include "intrin_rvv_011_compat.hpp"
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// FIXIT: eliminate massive warnigs from templates
|
||||
// GCC from 'rvv-next': riscv64-unknown-linux-gnu-g++ (g42df3464463) 12.0.1 20220505 (prerelease)
|
||||
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
void copyTo(const _OutputArray& dst) const;
|
||||
void convertTo(const _OutputArray& dst, int type, double scale=1., double shift=0.) const;
|
||||
|
||||
_Tp val[m*n]; //< matrix elements
|
||||
_Tp val[m*n]; ///< matrix elements
|
||||
};
|
||||
|
||||
typedef Matx<float, 1, 2> Matx12f;
|
||||
|
||||
@@ -774,7 +774,7 @@ public:
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
uint64 durationNS() const; //< duration in nanoseconds
|
||||
uint64 durationNS() const; ///< duration in nanoseconds
|
||||
|
||||
protected:
|
||||
struct Impl;
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
//! conjugation
|
||||
Complex conj() const;
|
||||
|
||||
_Tp re, im; //< the real and the imaginary parts
|
||||
_Tp re, im; ///< the real and the imaginary parts
|
||||
};
|
||||
|
||||
typedef Complex<float> Complexf;
|
||||
@@ -2028,8 +2028,8 @@ double jaccardDistance(const Rect_<_Tp>& a, const Rect_<_Tp>& b) {
|
||||
/** @brief Finds out if there is any intersection between two rectangles
|
||||
*
|
||||
* mainly useful for language bindings
|
||||
* @param rect1 First rectangle
|
||||
* @param rect2 Second rectangle
|
||||
* @param a First rectangle
|
||||
* @param b Second rectangle
|
||||
* @return the area of the intersection
|
||||
*/
|
||||
CV_EXPORTS_W inline double rectangleIntersectionArea(const Rect2d& a, const Rect2d& b) { return (a & b).area(); }
|
||||
|
||||
@@ -47,11 +47,11 @@ public:
|
||||
explicit FileLock(const char* fname);
|
||||
~FileLock();
|
||||
|
||||
void lock(); //< acquire exclusive (writer) lock
|
||||
void unlock(); //< release exclusive (writer) lock
|
||||
void lock(); ///< acquire exclusive (writer) lock
|
||||
void unlock(); ///< release exclusive (writer) lock
|
||||
|
||||
void lock_shared(); //< acquire shareable (reader) lock
|
||||
void unlock_shared(); //< release shareable (reader) lock
|
||||
void lock_shared(); ///< acquire shareable (reader) lock
|
||||
void unlock_shared(); ///< release shareable (reader) lock
|
||||
|
||||
struct Impl;
|
||||
protected:
|
||||
|
||||
@@ -70,11 +70,11 @@ public:
|
||||
struct LocationExtraData;
|
||||
struct LocationStaticStorage
|
||||
{
|
||||
LocationExtraData** ppExtra; //< implementation specific data
|
||||
const char* name; //< region name (function name or other custom name)
|
||||
const char* filename; //< source code filename
|
||||
int line; //< source code line
|
||||
int flags; //< flags (implementation code path: Plain, IPP, OpenCL)
|
||||
LocationExtraData** ppExtra; ///< implementation specific data
|
||||
const char* name; ///< region name (function name or other custom name)
|
||||
const char* filename; ///< source code filename
|
||||
int line; ///< source code line
|
||||
int flags; ///< flags (implementation code path: Plain, IPP, OpenCL)
|
||||
};
|
||||
|
||||
Region(const LocationStaticStorage& location);
|
||||
@@ -100,18 +100,18 @@ private:
|
||||
|
||||
//! Specify region flags
|
||||
enum RegionLocationFlag {
|
||||
REGION_FLAG_FUNCTION = (1 << 0), //< region is function (=1) / nested named region (=0)
|
||||
REGION_FLAG_APP_CODE = (1 << 1), //< region is Application code (=1) / OpenCV library code (=0)
|
||||
REGION_FLAG_SKIP_NESTED = (1 << 2), //< avoid processing of nested regions
|
||||
REGION_FLAG_FUNCTION = (1 << 0), ///< region is function (=1) / nested named region (=0)
|
||||
REGION_FLAG_APP_CODE = (1 << 1), ///< region is Application code (=1) / OpenCV library code (=0)
|
||||
REGION_FLAG_SKIP_NESTED = (1 << 2), ///< avoid processing of nested regions
|
||||
|
||||
REGION_FLAG_IMPL_IPP = (1 << 16), //< region is part of IPP code path
|
||||
REGION_FLAG_IMPL_OPENCL = (2 << 16), //< region is part of OpenCL code path
|
||||
REGION_FLAG_IMPL_OPENVX = (3 << 16), //< region is part of OpenVX code path
|
||||
REGION_FLAG_IMPL_IPP = (1 << 16), ///< region is part of IPP code path
|
||||
REGION_FLAG_IMPL_OPENCL = (2 << 16), ///< region is part of OpenCL code path
|
||||
REGION_FLAG_IMPL_OPENVX = (3 << 16), ///< region is part of OpenVX code path
|
||||
|
||||
REGION_FLAG_IMPL_MASK = (15 << 16),
|
||||
|
||||
REGION_FLAG_REGION_FORCE = (1 << 30),
|
||||
REGION_FLAG_REGION_NEXT = (1 << 31), //< close previous region (see #CV_TRACE_REGION_NEXT macro)
|
||||
REGION_FLAG_REGION_NEXT = (1 << 31), ///< close previous region (see #CV_TRACE_REGION_NEXT macro)
|
||||
|
||||
ENUM_REGION_FLAG_FORCE_INT = INT_MAX
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user