1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge branch 4.x

This commit is contained in:
Alexander Alekhin
2021-12-30 16:23:27 +00:00
951 changed files with 158314 additions and 152668 deletions
+63 -4
View File
@@ -131,7 +131,7 @@ void* allocSingletonNewBuffer(size_t size) { return malloc(size); }
#if defined __ANDROID__ || defined __unix__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __HAIKU__ || defined __Fuchsia__
# include <unistd.h>
# include <fcntl.h>
#if defined __QNXNTO__
#if defined __QNX__
# include <sys/elf.h>
#else
# include <elf.h>
@@ -157,6 +157,9 @@ void* allocSingletonNewBuffer(size_t size) { return malloc(size); }
# ifndef PPC_FEATURE2_ARCH_3_00
# define PPC_FEATURE2_ARCH_3_00 0x00800000
# endif
# ifndef PPC_FEATURE_HAS_VSX
# define PPC_FEATURE_HAS_VSX 0x00000080
# endif
#endif
#if defined _WIN32 || defined WINCE
@@ -551,7 +554,7 @@ struct HWFeatures
}
#endif // CV_CPUID_X86
#if defined __ANDROID__ || defined __linux__ || defined __FreeBSD__
#if defined __ANDROID__ || defined __linux__ || defined __FreeBSD__ || defined __QNX__
#ifdef __aarch64__
have[CV_CPU_NEON] = true;
have[CV_CPU_FP16] = true;
@@ -616,7 +619,7 @@ struct HWFeatures
have[CV_CPU_MSA] = true;
#endif
#if (defined __ppc64__ || defined __PPC64__) && defined __unix__
#if (defined __ppc64__ || defined __PPC64__) && defined __linux__
unsigned int hwcap = getauxval(AT_HWCAP);
if (hwcap & PPC_FEATURE_HAS_VSX) {
hwcap = getauxval(AT_HWCAP2);
@@ -626,8 +629,19 @@ struct HWFeatures
have[CV_CPU_VSX] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
}
}
#elif (defined __ppc64__ || defined __PPC64__) && defined __FreeBSD__
unsigned int hwcap = 0;
elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
if (hwcap & PPC_FEATURE_HAS_VSX) {
elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
if (hwcap & PPC_FEATURE2_ARCH_3_00) {
have[CV_CPU_VSX] = have[CV_CPU_VSX3] = true;
} else {
have[CV_CPU_VSX] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
}
}
#else
// TODO: AIX, FreeBSD
// TODO: AIX, OpenBSD
#if CV_VSX || defined _ARCH_PWR8 || defined __POWER9_VECTOR__
have[CV_CPU_VSX] = true;
#endif
@@ -930,6 +944,51 @@ int64 getCPUTickCount(void)
#endif
namespace internal {
class Timestamp
{
public:
const int64 zeroTickCount;
const double ns_in_ticks;
Timestamp()
: zeroTickCount(getTickCount())
, ns_in_ticks(1e9 / getTickFrequency())
{
// nothing
}
int64 getTimestamp()
{
int64 t = getTickCount();
return (int64)((t - zeroTickCount) * ns_in_ticks);
}
static Timestamp& getInstance()
{
static Timestamp g_timestamp;
return g_timestamp;
}
};
class InitTimestamp {
public:
InitTimestamp() {
Timestamp::getInstance();
}
};
static InitTimestamp g_initialize_timestamp; // force zero timestamp initialization
} // namespace
int64 getTimestampNS()
{
return internal::Timestamp::getInstance().getTimestamp();
}
const String& getBuildInformation()
{
static String build_info =