aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/opencv
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/opencv')
-rw-r--r--meta-oe/recipes-support/opencv/ade_0.1.2.bb20
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch38
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch28
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch42
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch33
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch31
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-build-workaround-GCC-7.1.1-compilation-issue-with-sa.patch127
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-carotene-don-t-use-__asm__-with-aarch64.patch1250
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0002-Do-not-enable-asm-with-clang.patch993
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch26
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0002-imgcodecs-refactoring-improve-code-quality.patch656
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch42
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0003-imgproc-test-add-checks-for-remove-call.patch186
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch138
-rw-r--r--meta-oe/recipes-support/opencv/opencv/CVE-2017-14136.patch288
-rw-r--r--meta-oe/recipes-support/opencv/opencv/already-exists.patch394
-rw-r--r--meta-oe/recipes-support/opencv/opencv/download.patch41
-rw-r--r--meta-oe/recipes-support/opencv/opencv/fixpkgconfig.patch29
-rw-r--r--meta-oe/recipes-support/opencv/opencv/javagen.patch16
-rw-r--r--meta-oe/recipes-support/opencv/opencv/protobuf.patch57
-rw-r--r--meta-oe/recipes-support/opencv/opencv/tinydnn.patch34
-rw-r--r--meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch20
-rw-r--r--meta-oe/recipes-support/opencv/opencv_3.3.bb203
-rw-r--r--meta-oe/recipes-support/opencv/opencv_4.9.0.bb210
24 files changed, 547 insertions, 4355 deletions
diff --git a/meta-oe/recipes-support/opencv/ade_0.1.2.bb b/meta-oe/recipes-support/opencv/ade_0.1.2.bb
new file mode 100644
index 0000000000..93b14ad4f3
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/ade_0.1.2.bb
@@ -0,0 +1,20 @@
+SUMMARY = "A graph construction, manipulation, and processing framework"
+DESCRIPTION = "ADE Framework is a graph construction, manipulation, \
+and processing framework. ADE Framework is suitable for \
+organizing data flow processing and execution."
+HOMEPAGE = "https://github.com/opencv/ade"
+
+SRC_URI = "git://github.com/opencv/ade.git;branch=master;protocol=https"
+
+SRCREV = "1e02d7486bdb9c87993d91b9910e7cc6c4ddbf66"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+inherit cmake
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECMAKE += " -DCMAKE_BUILD_TYPE=Release"
+
+FILES:${PN}-dev += "${datadir}/${BPN}/*.cmake"
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch b/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
deleted file mode 100644
index 4d76ad40ce..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 4801a057730632225337d7f6d26b9335e6b9b078 Mon Sep 17 00:00:00 2001
-From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
-Date: Thu, 31 Mar 2016 00:20:15 +0200
-Subject: [PATCH] 3rdparty/ippicv: Use pre-downloaded ipp
-
-Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
-Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
----
- 3rdparty/ippicv/ippicv.cmake | 15 +--------------
- 1 file changed, 1 insertion(+), 14 deletions(-)
-
-diff --git a/3rdparty/ippicv/ippicv.cmake b/3rdparty/ippicv/ippicv.cmake
-index d601da4bb..f6fc1098c 100644
---- a/3rdparty/ippicv/ippicv.cmake
-+++ b/3rdparty/ippicv/ippicv.cmake
-@@ -39,18 +39,5 @@ function(download_ippicv root_var)
- endif()
-
- set(THE_ROOT "${OpenCV_BINARY_DIR}/3rdparty/ippicv")
-- ocv_download(FILENAME ${OPENCV_ICV_NAME}
-- HASH ${OPENCV_ICV_HASH}
-- URL
-- "${OPENCV_IPPICV_URL}"
-- "$ENV{OPENCV_IPPICV_URL}"
-- "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}/ippicv/"
-- DESTINATION_DIR "${THE_ROOT}"
-- ID IPPICV
-- STATUS res
-- UNPACK RELATIVE_URL)
--
-- if(res)
-- set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE)
-- endif()
-+ set(${root_var} "${THE_ROOT}/${OPENCV_ICV_PACKAGE_SUBDIR}" PARENT_SCOPE)
- endfunction()
---
-2.13.4
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch b/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch
index 6dd48fcdc3..948a80fafa 100644
--- a/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch
+++ b/meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch
@@ -1,24 +1,26 @@
-From 2bc6bb9831d07f035fea74ea745cea43dd5f9ef9 Mon Sep 17 00:00:00 2001
+From 66e50ee69fa9ee2469d349100e70d8b296c4b4dc Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 9 Sep 2017 23:48:31 -0700
+Date: Tue, 11 Sep 2018 00:21:18 -0700
Subject: [PATCH] Dont use isystem
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
+clang really does not like it
+
Upstream-Status: Pending
- cmake/OpenCVPCHSupport.cmake | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ cmake/OpenCVPCHSupport.cmake | 2 ++
+ 1 file changed, 2 insertions(+)
-Index: git/cmake/OpenCVPCHSupport.cmake
-===================================================================
---- git.orig/cmake/OpenCVPCHSupport.cmake
-+++ git/cmake/OpenCVPCHSupport.cmake
-@@ -17,7 +17,8 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
- IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2.0")
+diff --git a/cmake/OpenCVPCHSupport.cmake b/cmake/OpenCVPCHSupport.cmake
+index 08cd06def4..46c9c02da3 100644
+--- a/cmake/OpenCVPCHSupport.cmake
++++ b/cmake/OpenCVPCHSupport.cmake
+@@ -18,6 +18,8 @@ IF(CV_GCC)
SET(PCHSupport_FOUND TRUE)
ENDIF()
--
+
+ SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
+ SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
SET(_PCH_include_prefix "-I")
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch b/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch
new file mode 100644
index 0000000000..d56b8ae67e
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/0001-Make-ts-module-external.patch
@@ -0,0 +1,42 @@
+From 11bbf909e08594628bd757d989ae34cf1bfe200b Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Thu, 18 Jun 2020 05:51:38 +0000
+Subject: [PATCH] Make ts module external
+
+Make ts module external
+
+Reference: https://github.com/qbonnard/opencv/commit/6b229c5834cb9a0930425e762a6c7b03244d7abb
+
+Upstream-Status: Submitted [https://github.com/opencv/opencv/issues/8408]
+
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ modules/ts/CMakeLists.txt | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
+index f95bed0793..66f315bcca 100644
+--- a/modules/ts/CMakeLists.txt
++++ b/modules/ts/CMakeLists.txt
+@@ -4,9 +4,6 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS)
+ ocv_module_disable(ts)
+ endif()
+
+-set(OPENCV_MODULE_TYPE STATIC)
+-set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
+-
+ if(WINRT)
+ # WINRT doesn't have access to environment variables
+ # so adding corresponding macros during CMake run
+@@ -16,7 +13,7 @@ endif()
+
+ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
+
+-ocv_add_module(ts INTERNAL opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
++ocv_add_module(ts opencv_core opencv_imgproc opencv_imgcodecs opencv_videoio opencv_highgui)
+
+ ocv_glob_module_sources()
+ ocv_module_include_directories()
+--
+2.24.1
+
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch b/meta-oe/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch
new file mode 100644
index 0000000000..a3bbefaabe
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch
@@ -0,0 +1,33 @@
+From e4ec6cea72da9e9ae5ba57140fa2f5c63f1f8295 Mon Sep 17 00:00:00 2001
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Wed, 9 May 2018 13:33:59 -0700
+Subject: [PATCH] Temporarliy work around deprecated ffmpeg RAW function
+ compile failure until next uprev
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+---
+Upstream-Status: Pending
+
+ modules/videoio/src/cap_ffmpeg_impl.hpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp
+index 6dca724a89..ae55dd4555 100644
+--- a/modules/videoio/src/cap_ffmpeg_impl.hpp
++++ b/modules/videoio/src/cap_ffmpeg_impl.hpp
+@@ -774,6 +774,14 @@ struct ImplMutex::Impl
+
+ #endif
+
++/* NOTE This is deprecated in ffmpeg and the code should be removed */
++#ifndef AVFMT_RAWPICTURE
++#define AVFMT_RAWPICTURE 0x0020
++#endif /* AVFMT_RAWPICTURE */
++#ifndef CODEC_FLAG_GLOBAL_HEADER
++#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
++#endif
++
+ void ImplMutex::init()
+ {
+ impl = new Impl();
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch b/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch
new file mode 100644
index 0000000000..c5a64387f5
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/0001-Use-Os-to-compile-tinyxml2.cpp.patch
@@ -0,0 +1,31 @@
+From 59fafe6e39759e193b5764b36b4c5a93da352123 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Aug 2020 00:36:49 -0700
+Subject: [PATCH] Use -Os to compile tinyxml2.cpp
+
+This workarounds issue [1] seen on riscv with gcc
+
+[1] https://github.com/riscv/riscv-gnu-toolchain/issues/624
+
+Upstream-Status: Inappropriate [ OE-Specific ]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ modules/datasets/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/datasets/CMakeLists.txt b/modules/datasets/CMakeLists.txt
+index 56ca9e310..99b7a33f6 100644
+--- a/modules/datasets/CMakeLists.txt
++++ b/modules/datasets/CMakeLists.txt
+@@ -2,7 +2,7 @@ set(the_description "datasets framework")
+
+ set(filter_srcs "${CMAKE_CURRENT_LIST_DIR}/src/tinyxml2/tinyxml2.cpp")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+- ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-suggest-override") # GCC
++ ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-suggest-override -Os") # GCC
+ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ ocv_append_source_files_cxx_compiler_options(filter_srcs "-Wno-inconsistent-missing-override") # Clang
+ endif()
+--
+2.28.0
+
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-build-workaround-GCC-7.1.1-compilation-issue-with-sa.patch b/meta-oe/recipes-support/opencv/opencv/0001-build-workaround-GCC-7.1.1-compilation-issue-with-sa.patch
deleted file mode 100644
index 0140633db3..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0001-build-workaround-GCC-7.1.1-compilation-issue-with-sa.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-Upstream-Status: Backport [https://github.com/opencv/opencv/pull/9376/commits/0d854db361106dfcb055231fd0112c5b85ef2287]
-
-Fix CVEs for opencv 3.3.
-
-* CVE-2017-12597
-* CVE-2017-12598
-* CVE-2017-12599
-* CVE-2017-12600
-* CVE-2017-12601
-* CVE-2017-12602
-* CVE-2017-12603
-* CVE-2017-12604
-* CVE-2017-12605
-* CVE-2017-12606
-* CVE-2017-12862
-* CVE-2017-12863
-* CVE-2017-12864
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 0d854db361106dfcb055231fd0112c5b85ef2287 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.a.alekhin@gmail.com>
-Date: Tue, 15 Aug 2017 21:45:05 +0000
-Subject: [PATCH 1/3] build: workaround GCC 7.1.1 compilation issue with
- sanitize flags
-
-Version: gcc (GCC) 7.1.1 20170622 (Red Hat 7.1.1-3)
-Flags: -fsanitize=address,undefined
----
- modules/ts/src/cuda_test.cpp | 56 ++++++++++++++++++++++++++------------------
- 1 file changed, 33 insertions(+), 23 deletions(-)
-
-diff --git a/modules/ts/src/cuda_test.cpp b/modules/ts/src/cuda_test.cpp
-index a48e0a087..eb4cee136 100644
---- a/modules/ts/src/cuda_test.cpp
-+++ b/modules/ts/src/cuda_test.cpp
-@@ -322,16 +322,20 @@ namespace cvtest
-
- if (m1.size() != m2.size())
- {
-- return AssertionFailure() << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different sizes : \""
-- << expr1 << "\" [" << PrintToString(m1.size()) << "] vs \""
-- << expr2 << "\" [" << PrintToString(m2.size()) << "]";
-+ std::stringstream msg;
-+ msg << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different sizes : \""
-+ << expr1 << "\" [" << PrintToString(m1.size()) << "] vs \""
-+ << expr2 << "\" [" << PrintToString(m2.size()) << "]";
-+ return AssertionFailure() << msg.str();
- }
-
- if (m1.type() != m2.type())
- {
-- return AssertionFailure() << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different types : \""
-- << expr1 << "\" [" << PrintToString(MatType(m1.type())) << "] vs \""
-- << expr2 << "\" [" << PrintToString(MatType(m2.type())) << "]";
-+ std::stringstream msg;
-+ msg << "Matrices \"" << expr1 << "\" and \"" << expr2 << "\" have different types : \""
-+ << expr1 << "\" [" << PrintToString(MatType(m1.type())) << "] vs \""
-+ << expr2 << "\" [" << PrintToString(MatType(m2.type())) << "]";
-+ return AssertionFailure() << msg.str();
- }
-
- Mat diff;
-@@ -343,12 +347,14 @@ namespace cvtest
-
- if (maxVal > eps)
- {
-- return AssertionFailure() << "The max difference between matrices \"" << expr1 << "\" and \"" << expr2
-- << "\" is " << maxVal << " at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ")"
-- << ", which exceeds \"" << eps_expr << "\", where \""
-- << expr1 << "\" at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ") evaluates to " << printMatVal(m1, maxLoc) << ", \""
-- << expr2 << "\" at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ") evaluates to " << printMatVal(m2, maxLoc) << ", \""
-- << eps_expr << "\" evaluates to " << eps;
-+ std::stringstream msg;
-+ msg << "The max difference between matrices \"" << expr1 << "\" and \"" << expr2
-+ << "\" is " << maxVal << " at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ")"
-+ << ", which exceeds \"" << eps_expr << "\", where \""
-+ << expr1 << "\" at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ") evaluates to " << printMatVal(m1, maxLoc) << ", \""
-+ << expr2 << "\" at (" << maxLoc.y << ", " << maxLoc.x / m1.channels() << ") evaluates to " << printMatVal(m2, maxLoc) << ", \""
-+ << eps_expr << "\" evaluates to " << eps;
-+ return AssertionFailure() << msg.str();
- }
-
- return AssertionSuccess();
-@@ -469,9 +475,11 @@ namespace cvtest
- {
- if (gold.size() != actual.size())
- {
-- return testing::AssertionFailure() << "KeyPoints size mistmach\n"
-- << "\"" << gold_expr << "\" : " << gold.size() << "\n"
-- << "\"" << actual_expr << "\" : " << actual.size();
-+ std::stringstream msg;
-+ msg << "KeyPoints size mistmach\n"
-+ << "\"" << gold_expr << "\" : " << gold.size() << "\n"
-+ << "\"" << actual_expr << "\" : " << actual.size();
-+ return AssertionFailure() << msg.str();
- }
-
- std::sort(actual.begin(), actual.end(), KeyPointLess());
-@@ -484,14 +492,16 @@ namespace cvtest
-
- if (!keyPointsEquals(p1, p2))
- {
-- return testing::AssertionFailure() << "KeyPoints differ at " << i << "\n"
-- << "\"" << gold_expr << "\" vs \"" << actual_expr << "\" : \n"
-- << "pt : " << testing::PrintToString(p1.pt) << " vs " << testing::PrintToString(p2.pt) << "\n"
-- << "size : " << p1.size << " vs " << p2.size << "\n"
-- << "angle : " << p1.angle << " vs " << p2.angle << "\n"
-- << "response : " << p1.response << " vs " << p2.response << "\n"
-- << "octave : " << p1.octave << " vs " << p2.octave << "\n"
-- << "class_id : " << p1.class_id << " vs " << p2.class_id;
-+ std::stringstream msg;
-+ msg << "KeyPoints differ at " << i << "\n"
-+ << "\"" << gold_expr << "\" vs \"" << actual_expr << "\" : \n"
-+ << "pt : " << testing::PrintToString(p1.pt) << " vs " << testing::PrintToString(p2.pt) << "\n"
-+ << "size : " << p1.size << " vs " << p2.size << "\n"
-+ << "angle : " << p1.angle << " vs " << p2.angle << "\n"
-+ << "response : " << p1.response << " vs " << p2.response << "\n"
-+ << "octave : " << p1.octave << " vs " << p2.octave << "\n"
-+ << "class_id : " << p1.class_id << " vs " << p2.class_id;
-+ return AssertionFailure() << msg.str();
- }
- }
-
---
-2.14.1
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-carotene-don-t-use-__asm__-with-aarch64.patch b/meta-oe/recipes-support/opencv/opencv/0001-carotene-don-t-use-__asm__-with-aarch64.patch
deleted file mode 100644
index a1a56e0e4d..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0001-carotene-don-t-use-__asm__-with-aarch64.patch
+++ /dev/null
@@ -1,1250 +0,0 @@
-From 353fc92618ce0dc6bab4a3e8bff1c13c3b613110 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.alekhin@intel.com>
-Date: Wed, 23 Aug 2017 17:41:23 +0300
-Subject: [PATCH 1/2] carotene: don't use __asm__ with aarch64
-
----
-Upstream-Status: Backport
-
- 3rdparty/carotene/src/channel_extract.cpp | 4 +-
- 3rdparty/carotene/src/channels_combine.cpp | 2 +-
- 3rdparty/carotene/src/colorconvert.cpp | 104 ++++++++++++++---------------
- 3rdparty/carotene/src/convert.cpp | 54 +++++++--------
- 3rdparty/carotene/src/convert_scale.cpp | 72 ++++++++++----------
- 3rdparty/carotene/src/gaussian_blur.cpp | 6 +-
- 3rdparty/carotene/src/pyramid.cpp | 20 +++---
- 3rdparty/carotene/src/scharr.cpp | 4 +-
- 8 files changed, 133 insertions(+), 133 deletions(-)
-
-diff --git a/3rdparty/carotene/src/channel_extract.cpp b/3rdparty/carotene/src/channel_extract.cpp
-index f663bc6005..8238a3ece8 100644
---- a/3rdparty/carotene/src/channel_extract.cpp
-+++ b/3rdparty/carotene/src/channel_extract.cpp
-@@ -231,7 +231,7 @@ void extract4(const Size2D &size,
- srcStride == dst2Stride && \
- srcStride == dst3Stride &&
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-
- #define SPLIT_ASM2(sgn, bits) __asm__ ( \
- "vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
-@@ -351,7 +351,7 @@ void extract4(const Size2D &size,
- } \
- }
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-
- #define ALPHA_QUAD(sgn, bits) { \
- internal::prefetch(src + sj); \
-diff --git a/3rdparty/carotene/src/channels_combine.cpp b/3rdparty/carotene/src/channels_combine.cpp
-index 157c8b8121..fc98fb9181 100644
---- a/3rdparty/carotene/src/channels_combine.cpp
-+++ b/3rdparty/carotene/src/channels_combine.cpp
-@@ -77,7 +77,7 @@ namespace CAROTENE_NS {
- dstStride == src2Stride && \
- dstStride == src3Stride &&
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-
- #define MERGE_ASM2(sgn, bits) __asm__ ( \
- "vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
-diff --git a/3rdparty/carotene/src/colorconvert.cpp b/3rdparty/carotene/src/colorconvert.cpp
-index 3037fe672a..26ae54b15c 100644
---- a/3rdparty/carotene/src/colorconvert.cpp
-+++ b/3rdparty/carotene/src/colorconvert.cpp
-@@ -97,7 +97,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -116,7 +116,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- for (; dj < roiw8; sj += 24, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -198,7 +198,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -217,7 +217,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- for (; dj < roiw8; sj += 32, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -300,7 +300,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -319,7 +319,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- for (; dj < roiw8; sj += 24, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -402,7 +402,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -421,7 +421,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- for (; dj < roiw8; sj += 32, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -512,7 +512,7 @@ void gray2rgb(const Size2D &size,
- for (; sj < roiw16; sj += 16, dj += 48)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld1.8 {d0-d1}, [%[in0]] \n\t"
- "vmov.8 q1, q0 \n\t"
-@@ -538,7 +538,7 @@ void gray2rgb(const Size2D &size,
-
- if (sj < roiw8)
- {
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld1.8 {d0}, [%[in]] \n\t"
- "vmov.8 d1, d0 \n\t"
-@@ -584,7 +584,7 @@ void gray2rgbx(const Size2D &size,
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
- #else
- uint8x16x4_t vRgba;
-@@ -602,7 +602,7 @@ void gray2rgbx(const Size2D &size,
- for (; sj < roiw16; sj += 16, dj += 64)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld1.8 {d0-d1}, [%[in0]] \n\t"
- "vmov.8 q1, q0 \n\t"
-@@ -628,7 +628,7 @@ void gray2rgbx(const Size2D &size,
-
- if (sj < roiw8)
- {
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld1.8 {d5}, [%[in]] \n\t"
- "vmov.8 d6, d5 \n\t"
-@@ -672,7 +672,7 @@ void rgb2rgbx(const Size2D &size,
- internal::assertSupportedConfiguration();
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- register uint8x8_t vc255_0 asm ("d3") = vmov_n_u8(255);
- #else
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
-@@ -688,7 +688,7 @@ void rgb2rgbx(const Size2D &size,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u, j = 0u;
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- for (; j < roiw8; sj += 24, dj += 32, j += 8)
- {
- internal::prefetch(src + sj);
-@@ -742,7 +742,7 @@ void rgbx2rgb(const Size2D &size,
- internal::assertSupportedConfiguration();
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
--#if !defined(__GNUC__) || !defined(__arm__)
-+#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- union { uint8x16x4_t v4; uint8x16x3_t v3; } v_dst0;
- union { uint8x8x4_t v4; uint8x8x3_t v3; } v_dst;
-@@ -754,7 +754,7 @@ void rgbx2rgb(const Size2D &size,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u, j = 0u;
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
-@@ -805,7 +805,7 @@ void rgb2bgr(const Size2D &size,
- {
- internal::assertSupportedConfiguration();
- #ifdef CAROTENE_NEON
--#if !defined(__GNUC__) || !defined(__arm__)
-+#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- #endif
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
-@@ -817,7 +817,7 @@ void rgb2bgr(const Size2D &size,
- size_t sj = 0u, dj = 0u, j = 0u;
-
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
-@@ -874,7 +874,7 @@ void rgbx2bgrx(const Size2D &size,
- {
- internal::assertSupportedConfiguration();
- #ifdef CAROTENE_NEON
--#if !defined(__GNUC__) || !defined(__arm__)
-+#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- #endif
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
-@@ -885,7 +885,7 @@ void rgbx2bgrx(const Size2D &size,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u, j = 0u;
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- for (; j < roiw8; sj += 32, dj += 32, j += 8)
- {
- internal::prefetch(src + sj);
-@@ -943,7 +943,7 @@ void rgbx2bgr(const Size2D &size,
- {
- internal::assertSupportedConfiguration();
- #ifdef CAROTENE_NEON
--#if !defined(__GNUC__) || !defined(__arm__)
-+#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- #endif
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
-@@ -954,7 +954,7 @@ void rgbx2bgr(const Size2D &size,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u, j = 0u;
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
-@@ -1010,7 +1010,7 @@ void rgb2bgrx(const Size2D &size,
- {
- internal::assertSupportedConfiguration();
- #ifdef CAROTENE_NEON
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- register uint8x8_t vc255 asm ("d3") = vmov_n_u8(255);
- #else
- union { uint8x16x4_t v4; uint8x16x3_t v3; } vals0;
-@@ -1019,7 +1019,7 @@ void rgb2bgrx(const Size2D &size,
- vals8.v4.val[3] = vmov_n_u8(255);
- #endif
-
--#if !defined(__GNUC__) || !defined(__arm__)
-+#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- #endif
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
-@@ -1030,7 +1030,7 @@ void rgb2bgrx(const Size2D &size,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u, j = 0u;
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- for (; j < roiw8; sj += 24, dj += 32, j += 8)
- {
- internal::prefetch(src + sj);
-@@ -1409,7 +1409,7 @@ inline void convertToHSV(const s32 r, const s32 g, const s32 b,
- "d24","d25","d26","d27","d28","d29","d30","d31" \
- );
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-
- #define YCRCB_CONSTS \
- register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
-@@ -1555,7 +1555,7 @@ inline uint8x8x3_t convertToYCrCb( const int16x8_t& vR, const int16x8_t& vG, con
- #define COEFF_G ( 8663)
- #define COEFF_B (-17705)
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- #define YUV420ALPHA3_CONST
- #define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
- #define YUV420ALPHA3_CONVERT
-@@ -1852,7 +1852,7 @@ void rgb2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -1871,7 +1871,7 @@ void rgb2hsv(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
- #else
- uint8x8x3_t vRgb = vld3_u8(src + sj);
-@@ -1904,7 +1904,7 @@ void rgbx2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -1923,7 +1923,7 @@ void rgbx2hsv(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
- #else
- uint8x8x4_t vRgb = vld4_u8(src + sj);
-@@ -1956,7 +1956,7 @@ void bgr2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -1975,7 +1975,7 @@ void bgr2hsv(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
- #else
- uint8x8x3_t vRgb = vld3_u8(src + sj);
-@@ -2008,7 +2008,7 @@ void bgrx2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -2027,7 +2027,7 @@ void bgrx2hsv(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
- #else
- uint8x8x4_t vRgb = vld4_u8(src + sj);
-@@ -2068,7 +2068,7 @@ void rgbx2bgr565(const Size2D &size,
- for (; j < roiw16; sj += 64, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
- "vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
-@@ -2122,7 +2122,7 @@ void rgb2bgr565(const Size2D &size,
- for (; j < roiw16; sj += 48, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
- "vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
-@@ -2176,7 +2176,7 @@ void rgbx2rgb565(const Size2D &size,
- for (; j < roiw16; sj += 64, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
- "vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
-@@ -2230,7 +2230,7 @@ void rgb2rgb565(const Size2D &size,
- for (; j < roiw16; sj += 48, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
- "vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
-@@ -2285,7 +2285,7 @@ void rgb2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
- #else
- uint8x8x3_t vRgb = vld3_u8(src + sj);
-@@ -2329,7 +2329,7 @@ void rgbx2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
- #else
- uint8x8x4_t vRgba = vld4_u8(src + sj);
-@@ -2373,7 +2373,7 @@ void bgr2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
- #else
- uint8x8x3_t vBgr = vld3_u8(src + sj);
-@@ -2417,7 +2417,7 @@ void bgrx2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
- #else
- uint8x8x4_t vBgra = vld4_u8(src + sj);
-@@ -2499,7 +2499,7 @@ void yuv420sp2rgb(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(3, d1, d0, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2545,7 +2545,7 @@ void yuv420sp2rgbx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(4, d1, d0, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2591,7 +2591,7 @@ void yuv420i2rgb(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(3, d0, d1, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2637,7 +2637,7 @@ void yuv420i2rgbx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(4, d0, d1, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2683,7 +2683,7 @@ void yuv420sp2bgr(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(3, d1, d0, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2729,7 +2729,7 @@ void yuv420sp2bgrx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(4, d1, d0, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2775,7 +2775,7 @@ void yuv420i2bgr(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(3, d0, d1, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2821,7 +2821,7 @@ void yuv420i2bgrx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CONVERTYUV420TORGB(4, d0, d1, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-diff --git a/3rdparty/carotene/src/convert.cpp b/3rdparty/carotene/src/convert.cpp
-index 403f16d86a..64b6db78ab 100644
---- a/3rdparty/carotene/src/convert.cpp
-+++ b/3rdparty/carotene/src/convert.cpp
-@@ -101,7 +101,7 @@ CVT_FUNC(u8, s8, 16,
- }
- })
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(u8, u16, 16,
- register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
- {
-@@ -135,7 +135,7 @@ CVT_FUNC(u8, u16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(u8, s32, 16,
- register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
- register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
-@@ -173,7 +173,7 @@ CVT_FUNC(u8, s32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(u8, f32, 16,
- ,
- {
-@@ -248,7 +248,7 @@ CVT_FUNC(s8, u8, 16,
- }
- })
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(s8, u16, 16,
- register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
- {
-@@ -284,7 +284,7 @@ CVT_FUNC(s8, u16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s8, s16, 16,
- ,
- {
-@@ -323,7 +323,7 @@ CVT_FUNC(s8, s16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(s8, s32, 16,
- ,
- {
-@@ -377,7 +377,7 @@ CVT_FUNC(s8, s32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s8, f32, 16,
- ,
- {
-@@ -440,7 +440,7 @@ CVT_FUNC(s8, f32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(u16, u8, 16,
- ,
- {
-@@ -479,7 +479,7 @@ CVT_FUNC(u16, u8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(u16, s8, 16,
- register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
- {
-@@ -522,7 +522,7 @@ CVT_FUNC(u16, s8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(u16, s16, 8,
- register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
- {
-@@ -555,7 +555,7 @@ CVT_FUNC(u16, s16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(u16, s32, 8,
- register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
- {
-@@ -589,7 +589,7 @@ CVT_FUNC(u16, s32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(u16, f32, 8,
- ,
- {
-@@ -633,7 +633,7 @@ CVT_FUNC(u16, f32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s16, u8, 16,
- ,
- {
-@@ -672,7 +672,7 @@ CVT_FUNC(s16, u8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s16, s8, 16,
- ,
- {
-@@ -711,7 +711,7 @@ CVT_FUNC(s16, s8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVT_FUNC(s16, u16, 8,
- register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
- {
-@@ -747,7 +747,7 @@ CVT_FUNC(s16, u16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s16, s32, 8,
- ,
- {
-@@ -786,7 +786,7 @@ CVT_FUNC(s16, s32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s16, f32, 8,
- ,
- {
-@@ -829,7 +829,7 @@ CVT_FUNC(s16, f32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s32, u8, 8,
- ,
- {
-@@ -870,7 +870,7 @@ CVT_FUNC(s32, u8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s32, s8, 8,
- ,
- {
-@@ -911,7 +911,7 @@ CVT_FUNC(s32, s8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s32, u16, 8,
- ,
- {
-@@ -950,7 +950,7 @@ CVT_FUNC(s32, u16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s32, s16, 8,
- ,
- {
-@@ -989,7 +989,7 @@ CVT_FUNC(s32, s16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(s32, f32, 8,
- ,
- {
-@@ -1034,7 +1034,7 @@ CVT_FUNC(s32, f32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(f32, u8, 8,
- register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
- register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
-@@ -1101,7 +1101,7 @@ CVT_FUNC(f32, u8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(f32, s8, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-@@ -1153,7 +1153,7 @@ CVT_FUNC(f32, s8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(f32, u16, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-@@ -1212,7 +1212,7 @@ CVT_FUNC(f32, u16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(f32, s16, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-@@ -1271,7 +1271,7 @@ CVT_FUNC(f32, s16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- CVT_FUNC(f32, s32, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-diff --git a/3rdparty/carotene/src/convert_scale.cpp b/3rdparty/carotene/src/convert_scale.cpp
-index 0a14a8035c..ae41a985c8 100644
---- a/3rdparty/carotene/src/convert_scale.cpp
-+++ b/3rdparty/carotene/src/convert_scale.cpp
-@@ -135,7 +135,7 @@ namespace CAROTENE_NS {
-
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC1(u8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -220,7 +220,7 @@ CVTS_FUNC1(u8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC(u8, s8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -305,7 +305,7 @@ CVTS_FUNC(u8, s8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC(u8, u16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -389,7 +389,7 @@ CVTS_FUNC(u8, u16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC(u8, s16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -473,7 +473,7 @@ CVTS_FUNC(u8, s16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u8, s32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -562,7 +562,7 @@ CVTS_FUNC(u8, s32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u8, f32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -643,7 +643,7 @@ CVTS_FUNC(u8, f32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC(s8, u8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -728,7 +728,7 @@ CVTS_FUNC(s8, u8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC1(s8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -813,7 +813,7 @@ CVTS_FUNC1(s8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC(s8, u16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -899,7 +899,7 @@ CVTS_FUNC(s8, u16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- CVTS_FUNC(s8, s16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -985,7 +985,7 @@ CVTS_FUNC(s8, s16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s8, s32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1074,7 +1074,7 @@ CVTS_FUNC(s8, s32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s8, f32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -1155,7 +1155,7 @@ CVTS_FUNC(s8, f32, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u16, u8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1214,7 +1214,7 @@ CVTS_FUNC(u16, u8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u16, s8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1273,7 +1273,7 @@ CVTS_FUNC(u16, s8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC1(u16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1330,7 +1330,7 @@ CVTS_FUNC1(u16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u16, s16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1387,7 +1387,7 @@ CVTS_FUNC(u16, s16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u16, s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1443,7 +1443,7 @@ CVTS_FUNC(u16, s32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(u16, f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -1495,7 +1495,7 @@ CVTS_FUNC(u16, f32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s16, u8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1554,7 +1554,7 @@ CVTS_FUNC(s16, u8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s16, s8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1613,7 +1613,7 @@ CVTS_FUNC(s16, s8, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s16, u16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1670,7 +1670,7 @@ CVTS_FUNC(s16, u16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC1(s16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1727,7 +1727,7 @@ CVTS_FUNC1(s16, 16,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s16, s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1783,7 +1783,7 @@ CVTS_FUNC(s16, s32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s16, f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -1835,7 +1835,7 @@ CVTS_FUNC(s16, f32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s32, u8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1893,7 +1893,7 @@ CVTS_FUNC(s32, u8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s32, s8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1951,7 +1951,7 @@ CVTS_FUNC(s32, s8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s32, u16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2007,7 +2007,7 @@ CVTS_FUNC(s32, u16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s32, s16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2063,7 +2063,7 @@ CVTS_FUNC(s32, s16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC1(s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2118,7 +2118,7 @@ CVTS_FUNC1(s32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(s32, f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -2169,7 +2169,7 @@ CVTS_FUNC(s32, f32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(f32, u8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
-@@ -2239,7 +2239,7 @@ CVTS_FUNC(f32, u8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(f32, s8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2293,7 +2293,7 @@ CVTS_FUNC(f32, s8, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(f32, u16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2345,7 +2345,7 @@ CVTS_FUNC(f32, u16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(f32, s16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2397,7 +2397,7 @@ CVTS_FUNC(f32, s16, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC(f32, s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2448,7 +2448,7 @@ CVTS_FUNC(f32, s32, 8,
- })
- #endif
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- CVTS_FUNC1(f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-diff --git a/3rdparty/carotene/src/gaussian_blur.cpp b/3rdparty/carotene/src/gaussian_blur.cpp
-index 1b5399436f..f7b5f18d79 100644
---- a/3rdparty/carotene/src/gaussian_blur.cpp
-+++ b/3rdparty/carotene/src/gaussian_blur.cpp
-@@ -327,7 +327,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
- u16* lidx1 = lane + x - 1*2;
- u16* lidx3 = lane + x + 1*2;
- u16* lidx4 = lane + x + 2*2;
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ __volatile__ (
- "vld2.16 {d0, d2}, [%[in0]]! \n\t"
- "vld2.16 {d1, d3}, [%[in0]] \n\t"
-@@ -398,7 +398,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
- u16* lidx1 = lane + x - 1*3;
- u16* lidx3 = lane + x + 1*3;
- u16* lidx4 = lane + x + 2*3;
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ __volatile__ (
- "vld3.16 {d0, d2, d4}, [%[in0]]! \n\t"
- "vld3.16 {d1, d3, d5}, [%[in0]] \n\t"
-@@ -482,7 +482,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
- u16* lidx1 = lane + x - 1*4;
- u16* lidx3 = lane + x + 1*4;
- u16* lidx4 = lane + x + 2*4;
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ __volatile__ (
- "vld4.16 {d0, d2, d4, d6}, [%[in0]]! \n\t"
- "vld4.16 {d1, d3, d5, d7}, [%[in0]] \n\t"
-diff --git a/3rdparty/carotene/src/pyramid.cpp b/3rdparty/carotene/src/pyramid.cpp
-index 8ef1268933..232ccf3efd 100644
---- a/3rdparty/carotene/src/pyramid.cpp
-+++ b/3rdparty/carotene/src/pyramid.cpp
-@@ -331,7 +331,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- for (; x < roiw8; x += 8)
- {
- internal::prefetch(lane + 2 * x);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld2.16 {d0-d3}, [%[in0]] \n\t"
- "vld2.16 {d4-d7}, [%[in4]] \n\t"
-@@ -538,7 +538,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- for (; x < roiw4; x += 4)
- {
- internal::prefetch(lane + 2 * x);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld2.32 {d0-d3}, [%[in0]] \n\t"
- "vld2.32 {d4-d7}, [%[in4]] \n\t"
-@@ -672,7 +672,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
- f32* lane = internal::alignPtr(&_buf[2*cn], 32);
-
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
- register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
-
-@@ -739,7 +739,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- for (; x < roiw4; x += 4)
- {
- internal::prefetch(lane + 2 * x);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ __volatile__ (
- "vld2.32 {d0-d3}, [%[in0]] \n\t"
- "vld2.32 {d8-d11}, [%[in4]] \n\t"
-@@ -932,7 +932,7 @@ pyrUp8uHorizontalConvolution:
- for (; x < lim; x += 8)
- {
- internal::prefetch(lane + x);
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ (
- "vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
- "vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
-@@ -973,7 +973,7 @@ pyrUp8uHorizontalConvolution:
- for (; x < lim; x += 24)
- {
- internal::prefetch(lane + x);
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ (
- "vmov.u16 q9, #6 \n\t"
- "vld3.16 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
-@@ -1064,7 +1064,7 @@ pyrUp8uHorizontalConvolution:
- for (; x < lim; x += 8)
- {
- internal::prefetch(lane + x);
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ (
- "vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
- "vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
-@@ -1210,7 +1210,7 @@ pyrUp16sHorizontalConvolution:
- for (; x < lim; x += 4)
- {
- internal::prefetch(lane + x);
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ (
- "vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
- "vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
-@@ -1251,7 +1251,7 @@ pyrUp16sHorizontalConvolution:
- for (; x < lim; x += 12)
- {
- internal::prefetch(lane + x + 3);
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ (
- "vmov.s32 q9, #6 \n\t"
- "vld3.32 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
-@@ -1343,7 +1343,7 @@ pyrUp16sHorizontalConvolution:
- for (; x < lim; x += 4)
- {
- internal::prefetch(lane + x);
--#if defined(__GNUC__) && defined(__arm__)
-+#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
- __asm__ (
- "vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
- "vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
-diff --git a/3rdparty/carotene/src/scharr.cpp b/3rdparty/carotene/src/scharr.cpp
-index 5695804fe4..8d3b6328b1 100644
---- a/3rdparty/carotene/src/scharr.cpp
-+++ b/3rdparty/carotene/src/scharr.cpp
-@@ -109,7 +109,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
- internal::prefetch(srow0 + x);
- internal::prefetch(srow1 + x);
- internal::prefetch(srow2 + x);
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
- __asm__ (
- "vld1.8 {d0}, [%[src0]] \n\t"
- "vld1.8 {d2}, [%[src2]] \n\t"
-@@ -161,7 +161,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
- x = 0;
- for( ; x < roiw8; x += 8 )
- {
--#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
- __asm__ (
- "vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
- "vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
---
-2.14.1
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0002-Do-not-enable-asm-with-clang.patch b/meta-oe/recipes-support/opencv/opencv/0002-Do-not-enable-asm-with-clang.patch
deleted file mode 100644
index 22e868a031..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0002-Do-not-enable-asm-with-clang.patch
+++ /dev/null
@@ -1,993 +0,0 @@
-From 333f60165b6737588eb975a5e4393d847011a1cd Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 19 Sep 2017 18:07:35 -0700
-Subject: [PATCH 2/2] Do not enable asm with clang
-
-clang pretends to be gcc 4.2.0 which means we will
-use inline asm for no reason, instead of builtins
-on clang when possible.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
- 3rdparty/carotene/src/channel_extract.cpp | 4 +-
- 3rdparty/carotene/src/channels_combine.cpp | 2 +-
- 3rdparty/carotene/src/colorconvert.cpp | 78 +++++++++++++++---------------
- 3rdparty/carotene/src/convert.cpp | 54 ++++++++++-----------
- 3rdparty/carotene/src/convert_scale.cpp | 56 ++++++++++-----------
- 3rdparty/carotene/src/gaussian_blur.cpp | 2 +-
- 3rdparty/carotene/src/pyramid.cpp | 8 +--
- 3rdparty/carotene/src/scharr.cpp | 4 +-
- 8 files changed, 104 insertions(+), 104 deletions(-)
-
-diff --git a/3rdparty/carotene/src/channel_extract.cpp b/3rdparty/carotene/src/channel_extract.cpp
-index 8238a3ece8..ff4fb3770c 100644
---- a/3rdparty/carotene/src/channel_extract.cpp
-+++ b/3rdparty/carotene/src/channel_extract.cpp
-@@ -231,7 +231,7 @@ void extract4(const Size2D &size,
- srcStride == dst2Stride && \
- srcStride == dst3Stride &&
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
-
- #define SPLIT_ASM2(sgn, bits) __asm__ ( \
- "vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
-@@ -351,7 +351,7 @@ void extract4(const Size2D &size,
- } \
- }
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
-
- #define ALPHA_QUAD(sgn, bits) { \
- internal::prefetch(src + sj); \
-diff --git a/3rdparty/carotene/src/channels_combine.cpp b/3rdparty/carotene/src/channels_combine.cpp
-index fc98fb9181..5d9251d51c 100644
---- a/3rdparty/carotene/src/channels_combine.cpp
-+++ b/3rdparty/carotene/src/channels_combine.cpp
-@@ -77,7 +77,7 @@ namespace CAROTENE_NS {
- dstStride == src2Stride && \
- dstStride == src3Stride &&
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
-
- #define MERGE_ASM2(sgn, bits) __asm__ ( \
- "vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
-diff --git a/3rdparty/carotene/src/colorconvert.cpp b/3rdparty/carotene/src/colorconvert.cpp
-index 26ae54b15c..d3a40fe64e 100644
---- a/3rdparty/carotene/src/colorconvert.cpp
-+++ b/3rdparty/carotene/src/colorconvert.cpp
-@@ -97,7 +97,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -116,7 +116,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- for (; dj < roiw8; sj += 24, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -198,7 +198,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -217,7 +217,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- for (; dj < roiw8; sj += 32, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -300,7 +300,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -319,7 +319,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- for (; dj < roiw8; sj += 24, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -402,7 +402,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
- const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
- const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
- register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
- register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
-@@ -421,7 +421,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
- u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
- size_t sj = 0u, dj = 0u;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- for (; dj < roiw8; sj += 32, dj += 8)
- {
- internal::prefetch(src + sj);
-@@ -512,7 +512,7 @@ void gray2rgb(const Size2D &size,
- for (; sj < roiw16; sj += 16, dj += 48)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld1.8 {d0-d1}, [%[in0]] \n\t"
- "vmov.8 q1, q0 \n\t"
-@@ -538,7 +538,7 @@ void gray2rgb(const Size2D &size,
-
- if (sj < roiw8)
- {
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld1.8 {d0}, [%[in]] \n\t"
- "vmov.8 d1, d0 \n\t"
-@@ -584,7 +584,7 @@ void gray2rgbx(const Size2D &size,
- size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
- #else
- uint8x16x4_t vRgba;
-@@ -602,7 +602,7 @@ void gray2rgbx(const Size2D &size,
- for (; sj < roiw16; sj += 16, dj += 64)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld1.8 {d0-d1}, [%[in0]] \n\t"
- "vmov.8 q1, q0 \n\t"
-@@ -628,7 +628,7 @@ void gray2rgbx(const Size2D &size,
-
- if (sj < roiw8)
- {
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld1.8 {d5}, [%[in]] \n\t"
- "vmov.8 d6, d5 \n\t"
-@@ -1409,7 +1409,7 @@ inline void convertToHSV(const s32 r, const s32 g, const s32 b,
- "d24","d25","d26","d27","d28","d29","d30","d31" \
- );
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
-
- #define YCRCB_CONSTS \
- register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
-@@ -1555,7 +1555,7 @@ inline uint8x8x3_t convertToYCrCb( const int16x8_t& vR, const int16x8_t& vG, con
- #define COEFF_G ( 8663)
- #define COEFF_B (-17705)
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- #define YUV420ALPHA3_CONST
- #define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
- #define YUV420ALPHA3_CONVERT
-@@ -1852,7 +1852,7 @@ void rgb2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -1871,7 +1871,7 @@ void rgb2hsv(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
- #else
- uint8x8x3_t vRgb = vld3_u8(src + sj);
-@@ -1904,7 +1904,7 @@ void rgbx2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -1923,7 +1923,7 @@ void rgbx2hsv(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
- #else
- uint8x8x4_t vRgb = vld4_u8(src + sj);
-@@ -1956,7 +1956,7 @@ void bgr2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -1975,7 +1975,7 @@ void bgr2hsv(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
- #else
- uint8x8x3_t vRgb = vld3_u8(src + sj);
-@@ -2008,7 +2008,7 @@ void bgrx2hsv(const Size2D &size,
- #ifdef CAROTENE_NEON
- size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
- const s32 hsv_shift = 12;
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register const f32 vsdiv_table = f32(255 << hsv_shift);
- register f32 vhdiv_table = f32(hrange << hsv_shift);
- register const s32 vhrange = hrange;
-@@ -2027,7 +2027,7 @@ void bgrx2hsv(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
- #else
- uint8x8x4_t vRgb = vld4_u8(src + sj);
-@@ -2068,7 +2068,7 @@ void rgbx2bgr565(const Size2D &size,
- for (; j < roiw16; sj += 64, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
- "vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
-@@ -2122,7 +2122,7 @@ void rgb2bgr565(const Size2D &size,
- for (; j < roiw16; sj += 48, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
- "vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
-@@ -2176,7 +2176,7 @@ void rgbx2rgb565(const Size2D &size,
- for (; j < roiw16; sj += 64, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
- "vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
-@@ -2230,7 +2230,7 @@ void rgb2rgb565(const Size2D &size,
- for (; j < roiw16; sj += 48, dj += 32, j += 16)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
- "vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
-@@ -2285,7 +2285,7 @@ void rgb2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
- #else
- uint8x8x3_t vRgb = vld3_u8(src + sj);
-@@ -2329,7 +2329,7 @@ void rgbx2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
- #else
- uint8x8x4_t vRgba = vld4_u8(src + sj);
-@@ -2373,7 +2373,7 @@ void bgr2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 24, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
- #else
- uint8x8x3_t vBgr = vld3_u8(src + sj);
-@@ -2417,7 +2417,7 @@ void bgrx2ycrcb(const Size2D &size,
- for (; j < roiw8; sj += 32, dj += 24, j += 8)
- {
- internal::prefetch(src + sj);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
- #else
- uint8x8x4_t vBgra = vld4_u8(src + sj);
-@@ -2499,7 +2499,7 @@ void yuv420sp2rgb(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(3, d1, d0, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2545,7 +2545,7 @@ void yuv420sp2rgbx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(4, d1, d0, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2591,7 +2591,7 @@ void yuv420i2rgb(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(3, d0, d1, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2637,7 +2637,7 @@ void yuv420i2rgbx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(4, d0, d1, q5, q6)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2683,7 +2683,7 @@ void yuv420sp2bgr(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(3, d1, d0, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2729,7 +2729,7 @@ void yuv420sp2bgrx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(4, d1, d0, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2775,7 +2775,7 @@ void yuv420i2bgr(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(3, d0, d1, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-@@ -2821,7 +2821,7 @@ void yuv420i2bgrx(const Size2D &size,
- internal::prefetch(uv + j);
- internal::prefetch(y1 + j);
- internal::prefetch(y2 + j);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CONVERTYUV420TORGB(4, d0, d1, q6, q5)
- #else
- convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
-diff --git a/3rdparty/carotene/src/convert.cpp b/3rdparty/carotene/src/convert.cpp
-index 64b6db78ab..f0c2d153f2 100644
---- a/3rdparty/carotene/src/convert.cpp
-+++ b/3rdparty/carotene/src/convert.cpp
-@@ -101,7 +101,7 @@ CVT_FUNC(u8, s8, 16,
- }
- })
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(u8, u16, 16,
- register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
- {
-@@ -135,7 +135,7 @@ CVT_FUNC(u8, u16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(u8, s32, 16,
- register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
- register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
-@@ -173,7 +173,7 @@ CVT_FUNC(u8, s32, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(u8, f32, 16,
- ,
- {
-@@ -248,7 +248,7 @@ CVT_FUNC(s8, u8, 16,
- }
- })
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(s8, u16, 16,
- register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
- {
-@@ -284,7 +284,7 @@ CVT_FUNC(s8, u16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s8, s16, 16,
- ,
- {
-@@ -323,7 +323,7 @@ CVT_FUNC(s8, s16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(s8, s32, 16,
- ,
- {
-@@ -377,7 +377,7 @@ CVT_FUNC(s8, s32, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s8, f32, 16,
- ,
- {
-@@ -440,7 +440,7 @@ CVT_FUNC(s8, f32, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(u16, u8, 16,
- ,
- {
-@@ -479,7 +479,7 @@ CVT_FUNC(u16, u8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(u16, s8, 16,
- register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
- {
-@@ -522,7 +522,7 @@ CVT_FUNC(u16, s8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(u16, s16, 8,
- register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
- {
-@@ -555,7 +555,7 @@ CVT_FUNC(u16, s16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(u16, s32, 8,
- register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
- {
-@@ -589,7 +589,7 @@ CVT_FUNC(u16, s32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(u16, f32, 8,
- ,
- {
-@@ -633,7 +633,7 @@ CVT_FUNC(u16, f32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s16, u8, 16,
- ,
- {
-@@ -672,7 +672,7 @@ CVT_FUNC(s16, u8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s16, s8, 16,
- ,
- {
-@@ -711,7 +711,7 @@ CVT_FUNC(s16, s8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVT_FUNC(s16, u16, 8,
- register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
- {
-@@ -747,7 +747,7 @@ CVT_FUNC(s16, u16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s16, s32, 8,
- ,
- {
-@@ -786,7 +786,7 @@ CVT_FUNC(s16, s32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s16, f32, 8,
- ,
- {
-@@ -829,7 +829,7 @@ CVT_FUNC(s16, f32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s32, u8, 8,
- ,
- {
-@@ -870,7 +870,7 @@ CVT_FUNC(s32, u8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s32, s8, 8,
- ,
- {
-@@ -911,7 +911,7 @@ CVT_FUNC(s32, s8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s32, u16, 8,
- ,
- {
-@@ -950,7 +950,7 @@ CVT_FUNC(s32, u16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s32, s16, 8,
- ,
- {
-@@ -989,7 +989,7 @@ CVT_FUNC(s32, s16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(s32, f32, 8,
- ,
- {
-@@ -1034,7 +1034,7 @@ CVT_FUNC(s32, f32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(f32, u8, 8,
- register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
- register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
-@@ -1101,7 +1101,7 @@ CVT_FUNC(f32, u8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(f32, s8, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-@@ -1153,7 +1153,7 @@ CVT_FUNC(f32, s8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(f32, u16, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-@@ -1212,7 +1212,7 @@ CVT_FUNC(f32, u16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(f32, s16, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-@@ -1271,7 +1271,7 @@ CVT_FUNC(f32, s16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- CVT_FUNC(f32, s32, 8,
- register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
- {
-diff --git a/3rdparty/carotene/src/convert_scale.cpp b/3rdparty/carotene/src/convert_scale.cpp
-index ae41a985c8..d599d24c1e 100644
---- a/3rdparty/carotene/src/convert_scale.cpp
-+++ b/3rdparty/carotene/src/convert_scale.cpp
-@@ -473,7 +473,7 @@ CVTS_FUNC(u8, s16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u8, s32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -562,7 +562,7 @@ CVTS_FUNC(u8, s32, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u8, f32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -985,7 +985,7 @@ CVTS_FUNC(s8, s16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s8, s32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1074,7 +1074,7 @@ CVTS_FUNC(s8, s32, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s8, f32, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -1155,7 +1155,7 @@ CVTS_FUNC(s8, f32, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u16, u8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1214,7 +1214,7 @@ CVTS_FUNC(u16, u8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u16, s8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1273,7 +1273,7 @@ CVTS_FUNC(u16, s8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC1(u16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1330,7 +1330,7 @@ CVTS_FUNC1(u16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u16, s16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1387,7 +1387,7 @@ CVTS_FUNC(u16, s16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u16, s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1443,7 +1443,7 @@ CVTS_FUNC(u16, s32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(u16, f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -1495,7 +1495,7 @@ CVTS_FUNC(u16, f32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s16, u8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1554,7 +1554,7 @@ CVTS_FUNC(s16, u8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s16, s8, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1613,7 +1613,7 @@ CVTS_FUNC(s16, s8, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s16, u16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1670,7 +1670,7 @@ CVTS_FUNC(s16, u16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC1(s16, 16,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1727,7 +1727,7 @@ CVTS_FUNC1(s16, 16,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s16, s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1783,7 +1783,7 @@ CVTS_FUNC(s16, s32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s16, f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -1835,7 +1835,7 @@ CVTS_FUNC(s16, f32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s32, u8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1893,7 +1893,7 @@ CVTS_FUNC(s32, u8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s32, s8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -1951,7 +1951,7 @@ CVTS_FUNC(s32, s8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s32, u16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2007,7 +2007,7 @@ CVTS_FUNC(s32, u16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s32, s16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2063,7 +2063,7 @@ CVTS_FUNC(s32, s16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC1(s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2118,7 +2118,7 @@ CVTS_FUNC1(s32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(s32, f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-@@ -2169,7 +2169,7 @@ CVTS_FUNC(s32, f32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(f32, u8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
-@@ -2239,7 +2239,7 @@ CVTS_FUNC(f32, u8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(f32, s8, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2293,7 +2293,7 @@ CVTS_FUNC(f32, s8, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(f32, u16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2345,7 +2345,7 @@ CVTS_FUNC(f32, u16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(f32, s16, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2397,7 +2397,7 @@ CVTS_FUNC(f32, s16, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC(f32, s32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
-@@ -2448,7 +2448,7 @@ CVTS_FUNC(f32, s32, 8,
- })
- #endif
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- CVTS_FUNC1(f32, 8,
- register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
- register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
-diff --git a/3rdparty/carotene/src/gaussian_blur.cpp b/3rdparty/carotene/src/gaussian_blur.cpp
-index f7b5f18d79..e5aa8fc75b 100644
---- a/3rdparty/carotene/src/gaussian_blur.cpp
-+++ b/3rdparty/carotene/src/gaussian_blur.cpp
-@@ -327,7 +327,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
- u16* lidx1 = lane + x - 1*2;
- u16* lidx3 = lane + x + 1*2;
- u16* lidx4 = lane + x + 2*2;
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ __volatile__ (
- "vld2.16 {d0, d2}, [%[in0]]! \n\t"
- "vld2.16 {d1, d3}, [%[in0]] \n\t"
-diff --git a/3rdparty/carotene/src/pyramid.cpp b/3rdparty/carotene/src/pyramid.cpp
-index 232ccf3efd..d4e32ea50f 100644
---- a/3rdparty/carotene/src/pyramid.cpp
-+++ b/3rdparty/carotene/src/pyramid.cpp
-@@ -331,7 +331,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- for (; x < roiw8; x += 8)
- {
- internal::prefetch(lane + 2 * x);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld2.16 {d0-d3}, [%[in0]] \n\t"
- "vld2.16 {d4-d7}, [%[in4]] \n\t"
-@@ -538,7 +538,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- for (; x < roiw4; x += 4)
- {
- internal::prefetch(lane + 2 * x);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld2.32 {d0-d3}, [%[in0]] \n\t"
- "vld2.32 {d4-d7}, [%[in4]] \n\t"
-@@ -672,7 +672,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
- f32* lane = internal::alignPtr(&_buf[2*cn], 32);
-
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
- register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
-
-@@ -739,7 +739,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
- for (; x < roiw4; x += 4)
- {
- internal::prefetch(lane + 2 * x);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ __volatile__ (
- "vld2.32 {d0-d3}, [%[in0]] \n\t"
- "vld2.32 {d8-d11}, [%[in4]] \n\t"
-diff --git a/3rdparty/carotene/src/scharr.cpp b/3rdparty/carotene/src/scharr.cpp
-index 8d3b6328b1..36f6b2276e 100644
---- a/3rdparty/carotene/src/scharr.cpp
-+++ b/3rdparty/carotene/src/scharr.cpp
-@@ -109,7 +109,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
- internal::prefetch(srow0 + x);
- internal::prefetch(srow1 + x);
- internal::prefetch(srow2 + x);
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
- __asm__ (
- "vld1.8 {d0}, [%[src0]] \n\t"
- "vld1.8 {d2}, [%[src2]] \n\t"
-@@ -161,7 +161,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
- x = 0;
- for( ; x < roiw8; x += 8 )
- {
--#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
-+#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
- __asm__ (
- "vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
- "vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
---
-2.14.1
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch b/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch
deleted file mode 100644
index a845505a85..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0002-Make-opencv-ts-create-share-library-intead-of-static.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 350525293aef65490e80104ddd99e1b21c5d54b0 Mon Sep 17 00:00:00 2001
-From: Bian Naimeng <biannm@cn.fujitsu.com>
-Date: Wed, 19 Apr 2017 03:11:37 +0900
-Subject: [PATCH 2/3] Make opencv-ts create share library intead of static.
-
-Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
----
- modules/ts/CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
-index f95bed079..ee67858df 100644
---- a/modules/ts/CMakeLists.txt
-+++ b/modules/ts/CMakeLists.txt
-@@ -4,7 +4,7 @@ if(NOT BUILD_opencv_ts AND NOT BUILD_TESTS AND NOT BUILD_PERF_TESTS)
- ocv_module_disable(ts)
- endif()
-
--set(OPENCV_MODULE_TYPE STATIC)
-+#set(OPENCV_MODULE_TYPE STATIC)
- set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
-
- if(WINRT)
---
-2.13.4
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0002-imgcodecs-refactoring-improve-code-quality.patch b/meta-oe/recipes-support/opencv/opencv/0002-imgcodecs-refactoring-improve-code-quality.patch
deleted file mode 100644
index 39f33af9de..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0002-imgcodecs-refactoring-improve-code-quality.patch
+++ /dev/null
@@ -1,656 +0,0 @@
-Upstream-Status: Backport [https://github.com/opencv/opencv/pull/9376/commits/999f41fb4f4aa94a0cb47256919ae8b5c29ca5f3]
-
-Fix CVEs for opencv 3.3:
-
-* CVE-2017-12597
-* CVE-2017-12598
-* CVE-2017-12599
-* CVE-2017-12600
-* CVE-2017-12601
-* CVE-2017-12602
-* CVE-2017-12603
-* CVE-2017-12604
-* CVE-2017-12605
-* CVE-2017-12606
-* CVE-2017-12862
-* CVE-2017-12863
-* CVE-2017-12864
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 999f41fb4f4aa94a0cb47256919ae8b5c29ca5f3 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.a.alekhin@gmail.com>
-Date: Tue, 15 Aug 2017 22:04:55 +0000
-Subject: [PATCH 2/3] imgcodecs: refactoring, improve code quality
-
----
- modules/imgcodecs/src/bitstrm.cpp | 2 +
- modules/imgcodecs/src/bitstrm.hpp | 19 +++--
- modules/imgcodecs/src/grfmt_bmp.cpp | 13 ++-
- modules/imgcodecs/src/grfmt_pxm.cpp | 122 ++++++++++++++++-----------
- modules/imgcodecs/src/loadsave.cpp | 164 +++++++++++++++++++++++++++++-------
- 5 files changed, 231 insertions(+), 89 deletions(-)
-
-diff --git a/modules/imgcodecs/src/bitstrm.cpp b/modules/imgcodecs/src/bitstrm.cpp
-index a7e187fa0..0a8941aec 100644
---- a/modules/imgcodecs/src/bitstrm.cpp
-+++ b/modules/imgcodecs/src/bitstrm.cpp
-@@ -209,6 +209,8 @@ int RLByteStream::getByte()
- current = m_current;
- }
-
-+ CV_Assert(current < m_end);
-+
- val = *((uchar*)current);
- m_current = current + 1;
- return val;
-diff --git a/modules/imgcodecs/src/bitstrm.hpp b/modules/imgcodecs/src/bitstrm.hpp
-index 465c0a847..26947971f 100644
---- a/modules/imgcodecs/src/bitstrm.hpp
-+++ b/modules/imgcodecs/src/bitstrm.hpp
-@@ -48,13 +48,20 @@
- namespace cv
- {
-
--enum
--{
-- RBS_THROW_EOS=-123, // <end of stream> exception code
-- RBS_THROW_FORB=-124, // <forrbidden huffman code> exception code
-- RBS_HUFF_FORB=2047, // forrbidden huffman code "value"
-- RBS_BAD_HEADER=-125 // invalid header
-+#define DECLARE_RBS_EXCEPTION(name) \
-+class RBS_ ## name ## _Exception : public cv::Exception \
-+{ \
-+public: \
-+ RBS_ ## name ## _Exception(int code_, const String& err_, const String& func_, const String& file_, int line_) : \
-+ cv::Exception(code_, err_, func_, file_, line_) \
-+ {} \
- };
-+DECLARE_RBS_EXCEPTION(THROW_EOS)
-+#define RBS_THROW_EOS RBS_THROW_EOS_Exception(cv::Error::StsError, "Unexpected end of input stream", CV_Func, __FILE__, __LINE__)
-+DECLARE_RBS_EXCEPTION(THROW_FORB)
-+#define RBS_THROW_FORB RBS_THROW_FORB_Exception(cv::Error::StsError, "Forrbidden huffman code", CV_Func, __FILE__, __LINE__)
-+DECLARE_RBS_EXCEPTION(BAD_HEADER)
-+#define RBS_BAD_HEADER RBS_BAD_HEADER_Exception(cv::Error::StsError, "Invalid header", CV_Func, __FILE__, __LINE__)
-
- typedef unsigned long ulong;
-
-diff --git a/modules/imgcodecs/src/grfmt_bmp.cpp b/modules/imgcodecs/src/grfmt_bmp.cpp
-index 86cacd316..257f97c2d 100644
---- a/modules/imgcodecs/src/grfmt_bmp.cpp
-+++ b/modules/imgcodecs/src/grfmt_bmp.cpp
-@@ -118,8 +118,9 @@ bool BmpDecoder::readHeader()
-
- if( m_bpp <= 8 )
- {
-- memset( m_palette, 0, sizeof(m_palette));
-- m_strm.getBytes( m_palette, (clrused == 0? 1<<m_bpp : clrused)*4 );
-+ CV_Assert(clrused < 256);
-+ memset(m_palette, 0, sizeof(m_palette));
-+ m_strm.getBytes(m_palette, (clrused == 0? 1<<m_bpp : clrused)*4 );
- iscolor = IsColorPalette( m_palette, m_bpp );
- }
- else if( m_bpp == 16 && m_rle_code == BMP_BITFIELDS )
-@@ -290,7 +291,9 @@ bool BmpDecoder::readData( Mat& img )
- else if( code > 2 ) // absolute mode
- {
- if( data + code*nch > line_end ) goto decode_rle4_bad;
-- m_strm.getBytes( src, (((code + 1)>>1) + 1) & -2 );
-+ int sz = (((code + 1)>>1) + 1) & (~1);
-+ CV_Assert((size_t)sz < _src.size());
-+ m_strm.getBytes(src, sz);
- if( color )
- data = FillColorRow4( data, src, code, m_palette );
- else
-@@ -379,7 +382,9 @@ decode_rle4_bad: ;
-
- if( data + code3 > line_end )
- goto decode_rle8_bad;
-- m_strm.getBytes( src, (code + 1) & -2 );
-+ int sz = (code + 1) & (~1);
-+ CV_Assert((size_t)sz < _src.size());
-+ m_strm.getBytes(src, sz);
- if( color )
- data = FillColorRow8( data, src, code, m_palette );
- else
-diff --git a/modules/imgcodecs/src/grfmt_pxm.cpp b/modules/imgcodecs/src/grfmt_pxm.cpp
-index 1750cb705..68bd8fd93 100644
---- a/modules/imgcodecs/src/grfmt_pxm.cpp
-+++ b/modules/imgcodecs/src/grfmt_pxm.cpp
-@@ -43,50 +43,58 @@
- #include "precomp.hpp"
- #include "utils.hpp"
- #include "grfmt_pxm.hpp"
-+#include <iostream>
-
- namespace cv
- {
-
- ///////////////////////// P?M reader //////////////////////////////
-
--static int ReadNumber( RLByteStream& strm, int maxdigits )
-+static int ReadNumber(RLByteStream& strm, int maxdigits = 0)
- {
- int code;
-- int val = 0;
-+ int64 val = 0;
- int digits = 0;
-
- code = strm.getByte();
-
-- if( !isdigit(code))
-+ while (!isdigit(code))
- {
-- do
-+ if (code == '#' )
- {
-- if( code == '#' )
-+ do
- {
-- do
-- {
-- code = strm.getByte();
-- }
-- while( code != '\n' && code != '\r' );
-+ code = strm.getByte();
- }
--
-+ while (code != '\n' && code != '\r');
- code = strm.getByte();
--
-- while( isspace(code))
-+ }
-+ else if (isspace(code))
-+ {
-+ while (isspace(code))
- code = strm.getByte();
- }
-- while( !isdigit( code ));
-+ else
-+ {
-+#if 1
-+ CV_ErrorNoReturn_(Error::StsError, ("PXM: Unexpected code in ReadNumber(): 0x%x (%d)", code, code));
-+#else
-+ code = strm.getByte();
-+#endif
-+ }
- }
-
- do
- {
-- val = val*10 + code - '0';
-- if( ++digits >= maxdigits ) break;
-+ val = val*10 + (code - '0');
-+ CV_Assert(val <= INT_MAX && "PXM: ReadNumber(): result is too large");
-+ digits++;
-+ if (maxdigits != 0 && digits >= maxdigits) break;
- code = strm.getByte();
- }
-- while( isdigit(code));
-+ while (isdigit(code));
-
-- return val;
-+ return (int)val;
- }
-
-
-@@ -122,13 +130,13 @@ ImageDecoder PxMDecoder::newDecoder() const
- return makePtr<PxMDecoder>();
- }
-
--void PxMDecoder::close()
-+void PxMDecoder::close()
- {
- m_strm.close();
- }
-
-
--bool PxMDecoder::readHeader()
-+bool PxMDecoder::readHeader()
- {
- bool result = false;
-
-@@ -158,10 +166,10 @@ bool PxMDecoder::readHeader()
- m_binary = code >= '4';
- m_type = m_bpp > 8 ? CV_8UC3 : CV_8UC1;
-
-- m_width = ReadNumber( m_strm, INT_MAX );
-- m_height = ReadNumber( m_strm, INT_MAX );
-+ m_width = ReadNumber(m_strm);
-+ m_height = ReadNumber(m_strm);
-
-- m_maxval = m_bpp == 1 ? 1 : ReadNumber( m_strm, INT_MAX );
-+ m_maxval = m_bpp == 1 ? 1 : ReadNumber(m_strm);
- if( m_maxval > 65535 )
- throw RBS_BAD_HEADER;
-
-@@ -175,8 +183,14 @@ bool PxMDecoder::readHeader()
- result = true;
- }
- }
-- catch(...)
-+ catch (const cv::Exception&)
-+ {
-+ throw;
-+ }
-+ catch (...)
- {
-+ std::cerr << "PXM::readHeader(): unknown C++ exception" << std::endl << std::flush;
-+ throw;
- }
-
- if( !result )
-@@ -189,33 +203,28 @@ bool PxMDecoder::readHeader()
- }
-
-
--bool PxMDecoder::readData( Mat& img )
-+bool PxMDecoder::readData( Mat& img )
- {
- int color = img.channels() > 1;
- uchar* data = img.ptr();
- PaletteEntry palette[256];
- bool result = false;
-- int bit_depth = CV_ELEM_SIZE1(m_type)*8;
-- int src_pitch = (m_width*m_bpp*bit_depth/8 + 7)/8;
-+ const int bit_depth = CV_ELEM_SIZE1(m_type)*8;
-+ const int src_pitch = divUp(m_width*m_bpp*(bit_depth/8), 8);
- int nch = CV_MAT_CN(m_type);
- int width3 = m_width*nch;
-- int i, x, y;
-
- if( m_offset < 0 || !m_strm.isOpened())
- return false;
-
-- AutoBuffer<uchar> _src(src_pitch + 32);
-- uchar* src = _src;
-- AutoBuffer<uchar> _gray_palette;
-- uchar* gray_palette = _gray_palette;
-+ uchar gray_palette[256] = {0};
-
- // create LUT for converting colors
- if( bit_depth == 8 )
- {
-- _gray_palette.allocate(m_maxval + 1);
-- gray_palette = _gray_palette;
-+ CV_Assert(m_maxval < 256);
-
-- for( i = 0; i <= m_maxval; i++ )
-+ for (int i = 0; i <= m_maxval; i++)
- gray_palette[i] = (uchar)((i*255/m_maxval)^(m_bpp == 1 ? 255 : 0));
-
- FillGrayPalette( palette, m_bpp==1 ? 1 : 8 , m_bpp == 1 );
-@@ -229,12 +238,16 @@ bool PxMDecoder::readData( Mat& img )
- {
- ////////////////////////// 1 BPP /////////////////////////
- case 1:
-+ CV_Assert(CV_MAT_DEPTH(m_type) == CV_8U);
- if( !m_binary )
- {
-- for( y = 0; y < m_height; y++, data += img.step )
-+ AutoBuffer<uchar> _src(m_width);
-+ uchar* src = _src;
-+
-+ for (int y = 0; y < m_height; y++, data += img.step)
- {
-- for( x = 0; x < m_width; x++ )
-- src[x] = ReadNumber( m_strm, 1 ) != 0;
-+ for (int x = 0; x < m_width; x++)
-+ src[x] = ReadNumber(m_strm, 1) != 0;
-
- if( color )
- FillColorRow8( data, src, m_width, palette );
-@@ -244,7 +257,10 @@ bool PxMDecoder::readData( Mat& img )
- }
- else
- {
-- for( y = 0; y < m_height; y++, data += img.step )
-+ AutoBuffer<uchar> _src(src_pitch);
-+ uchar* src = _src;
-+
-+ for (int y = 0; y < m_height; y++, data += img.step)
- {
- m_strm.getBytes( src, src_pitch );
-
-@@ -260,13 +276,17 @@ bool PxMDecoder::readData( Mat& img )
- ////////////////////////// 8 BPP /////////////////////////
- case 8:
- case 24:
-- for( y = 0; y < m_height; y++, data += img.step )
-+ {
-+ AutoBuffer<uchar> _src(std::max<size_t>(width3*2, src_pitch));
-+ uchar* src = _src;
-+
-+ for (int y = 0; y < m_height; y++, data += img.step)
- {
- if( !m_binary )
- {
-- for( x = 0; x < width3; x++ )
-+ for (int x = 0; x < width3; x++)
- {
-- int code = ReadNumber( m_strm, INT_MAX );
-+ int code = ReadNumber(m_strm);
- if( (unsigned)code > (unsigned)m_maxval ) code = m_maxval;
- if( bit_depth == 8 )
- src[x] = gray_palette[code];
-@@ -279,7 +299,7 @@ bool PxMDecoder::readData( Mat& img )
- m_strm.getBytes( src, src_pitch );
- if( bit_depth == 16 && !isBigEndian() )
- {
-- for( x = 0; x < width3; x++ )
-+ for (int x = 0; x < width3; x++)
- {
- uchar v = src[x * 2];
- src[x * 2] = src[x * 2 + 1];
-@@ -290,7 +310,7 @@ bool PxMDecoder::readData( Mat& img )
-
- if( img.depth() == CV_8U && bit_depth == 16 )
- {
-- for( x = 0; x < width3; x++ )
-+ for (int x = 0; x < width3; x++)
- {
- int v = ((ushort *)src)[x];
- src[x] = (uchar)(v >> 8);
-@@ -331,12 +351,19 @@ bool PxMDecoder::readData( Mat& img )
- }
- result = true;
- break;
-+ }
- default:
-- assert(0);
-+ CV_ErrorNoReturn(Error::StsError, "m_bpp is not supported");
- }
- }
-- catch(...)
-+ catch (const cv::Exception&)
-+ {
-+ throw;
-+ }
-+ catch (...)
- {
-+ std::cerr << "PXM::readData(): unknown exception" << std::endl << std::flush;
-+ throw;
- }
-
- return result;
-@@ -412,8 +439,9 @@ bool PxMEncoder::write( const Mat& img, const std::vector<int>& params )
- char* buffer = _buffer;
-
- // write header;
-- sprintf( buffer, "P%c\n%d %d\n%d\n",
-+ sprintf( buffer, "P%c\n# Generated by OpenCV %s\n%d %d\n%d\n",
- '2' + (channels > 1 ? 1 : 0) + (isBinary ? 3 : 0),
-+ CV_VERSION,
- width, height, (1 << depth) - 1 );
-
- strm.putBytes( buffer, (int)strlen(buffer) );
-diff --git a/modules/imgcodecs/src/loadsave.cpp b/modules/imgcodecs/src/loadsave.cpp
-index 3b2366217..5ee4ca354 100644
---- a/modules/imgcodecs/src/loadsave.cpp
-+++ b/modules/imgcodecs/src/loadsave.cpp
-@@ -55,6 +55,27 @@
- /****************************************************************************************\
- * Image Codecs *
- \****************************************************************************************/
-+
-+namespace cv {
-+
-+// TODO Add runtime configuration
-+#define CV_IO_MAX_IMAGE_PARAMS (50)
-+#define CV_IO_MAX_IMAGE_WIDTH (1<<20)
-+#define CV_IO_MAX_IMAGE_HEIGHT (1<<20)
-+#define CV_IO_MAX_IMAGE_PIXELS (1<<30) // 1 Gigapixel
-+
-+static Size validateInputImageSize(const Size& size)
-+{
-+ CV_Assert(size.width > 0);
-+ CV_Assert(size.width <= CV_IO_MAX_IMAGE_WIDTH);
-+ CV_Assert(size.height > 0);
-+ CV_Assert(size.height <= CV_IO_MAX_IMAGE_HEIGHT);
-+ uint64 pixels = (uint64)size.width * (uint64)size.height;
-+ CV_Assert(pixels <= CV_IO_MAX_IMAGE_PIXELS);
-+ return size;
-+}
-+
-+
- namespace {
-
- class ByteStreamBuffer: public std::streambuf
-@@ -94,9 +115,6 @@ protected:
-
- }
-
--namespace cv
--{
--
- /**
- * @struct ImageCodecInitializer
- *
-@@ -408,14 +426,26 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 )
- /// set the filename in the driver
- decoder->setSource( filename );
-
-- // read the header to make sure it succeeds
-- if( !decoder->readHeader() )
-+ try
-+ {
-+ // read the header to make sure it succeeds
-+ if( !decoder->readHeader() )
-+ return 0;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
- return 0;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
-+ return 0;
-+ }
-+
-
- // established the required input image size
-- CvSize size;
-- size.width = decoder->width();
-- size.height = decoder->height();
-+ Size size = validateInputImageSize(Size(decoder->width(), decoder->height()));
-
- // grab the decoded type
- int type = decoder->type();
-@@ -451,7 +481,21 @@ imread_( const String& filename, int flags, int hdrtype, Mat* mat=0 )
- }
-
- // read the image data
-- if( !decoder->readData( *data ))
-+ bool success = false;
-+ try
-+ {
-+ if (decoder->readData(*data))
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imread_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
-+ }
-+ if (!success)
- {
- cvReleaseImage( &image );
- cvReleaseMat( &matrix );
-@@ -504,8 +548,22 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats)
- decoder->setSource(filename);
-
- // read the header to make sure it succeeds
-- if (!decoder->readHeader())
-+ try
-+ {
-+ // read the header to make sure it succeeds
-+ if( !decoder->readHeader() )
-+ return 0;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imreadmulti_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
- return 0;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imreadmulti_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
-+ return 0;
-+ }
-
- for (;;)
- {
-@@ -523,17 +581,32 @@ imreadmulti_(const String& filename, int flags, std::vector<Mat>& mats)
- type = CV_MAKETYPE(CV_MAT_DEPTH(type), 1);
- }
-
-+ // established the required input image size
-+ Size size = validateInputImageSize(Size(decoder->width(), decoder->height()));
-+
- // read the image data
-- Mat mat(decoder->height(), decoder->width(), type);
-- if (!decoder->readData(mat))
-+ Mat mat(size.height, size.width, type);
-+ bool success = false;
-+ try
- {
-- // optionally rotate the data if EXIF' orientation flag says so
-- if( (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
-- {
-- ApplyExifOrientation(filename, mat);
-- }
--
-+ if (decoder->readData(mat))
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imreadmulti_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imreadmulti_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
-+ }
-+ if (!success)
- break;
-+
-+ // optionally rotate the data if EXIF' orientation flag says so
-+ if( (flags & IMREAD_IGNORE_ORIENTATION) == 0 && flags != IMREAD_UNCHANGED )
-+ {
-+ ApplyExifOrientation(filename, mat);
- }
-
- mats.push_back(mat);
-@@ -616,6 +689,7 @@ static bool imwrite_( const String& filename, const Mat& image,
- }
-
- encoder->setDestination( filename );
-+ CV_Assert(params.size() <= CV_IO_MAX_IMAGE_PARAMS*2);
- bool code = encoder->write( *pimage, params );
-
- // CV_Assert( code );
-@@ -663,22 +737,35 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
- decoder->setSource(filename);
- }
-
-- if( !decoder->readHeader() )
-+ bool success = false;
-+ try
-+ {
-+ if (decoder->readHeader())
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read header: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read header: unknown exception" << std::endl << std::flush;
-+ }
-+ if (!success)
- {
- decoder.release();
-- if ( !filename.empty() )
-+ if (!filename.empty())
- {
-- if ( remove(filename.c_str()) != 0 )
-+ if (0 != remove(filename.c_str()))
- {
-- CV_Error( CV_StsError, "unable to remove temporary file" );
-+ std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush;
- }
- }
- return 0;
- }
-
-- CvSize size;
-- size.width = decoder->width();
-- size.height = decoder->height();
-+ // established the required input image size
-+ Size size = validateInputImageSize(Size(decoder->width(), decoder->height()));
-
- int type = decoder->type();
- if( (flags & IMREAD_LOAD_GDAL) != IMREAD_LOAD_GDAL && flags != IMREAD_UNCHANGED )
-@@ -712,17 +799,30 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
- temp = cvarrToMat(image);
- }
-
-- bool code = decoder->readData( *data );
-+ success = false;
-+ try
-+ {
-+ if (decoder->readData(*data))
-+ success = true;
-+ }
-+ catch (const cv::Exception& e)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read data: " << e.what() << std::endl << std::flush;
-+ }
-+ catch (...)
-+ {
-+ std::cerr << "imdecode_('" << filename << "'): can't read data: unknown exception" << std::endl << std::flush;
-+ }
- decoder.release();
-- if ( !filename.empty() )
-+ if (!filename.empty())
- {
-- if ( remove(filename.c_str()) != 0 )
-+ if (0 != remove(filename.c_str()))
- {
-- CV_Error( CV_StsError, "unable to remove temporary file" );
-+ std::cerr << "unable to remove temporary file:" << filename << std::endl << std::flush;
- }
- }
-
-- if( !code )
-+ if (!success)
- {
- cvReleaseImage( &image );
- cvReleaseMat( &matrix );
-@@ -859,7 +959,7 @@ cvSaveImage( const char* filename, const CvArr* arr, const int* _params )
- if( _params )
- {
- for( ; _params[i] > 0; i += 2 )
-- ;
-+ CV_Assert(i < CV_IO_MAX_IMAGE_PARAMS*2); // Limit number of params for security reasons
- }
- return cv::imwrite_(filename, cv::cvarrToMat(arr),
- i > 0 ? std::vector<int>(_params, _params+i) : std::vector<int>(),
-@@ -890,7 +990,7 @@ cvEncodeImage( const char* ext, const CvArr* arr, const int* _params )
- if( _params )
- {
- for( ; _params[i] > 0; i += 2 )
-- ;
-+ CV_Assert(i < CV_IO_MAX_IMAGE_PARAMS*2); // Limit number of params for security reasons
- }
- cv::Mat img = cv::cvarrToMat(arr);
- if( CV_IS_IMAGE(arr) && ((const IplImage*)arr)->origin == IPL_ORIGIN_BL )
---
-2.14.1
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch b/meta-oe/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch
index a22b04a905..9df419d0b8 100644
--- a/meta-oe/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch
+++ b/meta-oe/recipes-support/opencv/opencv/0003-To-fix-errors-as-following.patch
@@ -1,7 +1,7 @@
-From ace48a628dca34d742615598afeef42ed323a029 Mon Sep 17 00:00:00 2001
+From f42c9b8c7bafcadc7e95fb25a391707f970eb426 Mon Sep 17 00:00:00 2001
From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
Date: Fri, 19 May 2017 04:27:50 +0900
-Subject: [PATCH 3/3] To fix errors as following:
+Subject: [PATCH] To fix errors as following:
"test_main.cpp:45: undefined reference to `parseCustomOptions(int, char**)'"
"perf_abs.cpp:13: undefined reference to `cvtest::param_seed'"
@@ -13,35 +13,30 @@ Also add the visibility changes for certain OpenCL-related functions in
ts module.
Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
+
---
- modules/ts/include/opencv2/ts.hpp | 6 +++---
+Upstream-Status: Pending
+
+ modules/ts/include/opencv2/ts.hpp | 4 ++--
modules/ts/include/opencv2/ts/ocl_test.hpp | 2 +-
modules/ts/include/opencv2/ts/ts_ext.hpp | 2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
+ 3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/ts/include/opencv2/ts.hpp b/modules/ts/include/opencv2/ts.hpp
-index 41a76b13e..205646140 100644
+index ed7491a89a..80919d13ee 100644
--- a/modules/ts/include/opencv2/ts.hpp
+++ b/modules/ts/include/opencv2/ts.hpp
-@@ -555,7 +555,7 @@ protected:
+@@ -728,7 +728,7 @@ protected:
}
};
-extern uint64 param_seed;
+CV_EXPORTS extern uint64 param_seed;
- struct CV_EXPORTS DefaultRngAuto
+ struct DefaultRngAuto
{
-@@ -611,14 +611,14 @@ CV_EXPORTS std::string findDataFile(const std::string& relative_path, bool requi
-
- #ifdef HAVE_OPENCL
- namespace ocl {
--void dumpOpenCLDevice();
-+CV_EXPORTS void dumpOpenCLDevice();
- }
- #define TEST_DUMP_OCL_INFO cvtest::ocl::dumpOpenCLDevice();
- #else
- #define TEST_DUMP_OCL_INFO
+@@ -791,7 +791,7 @@ private:
+ #endif
#endif
-void parseCustomOptions(int argc, char **argv);
@@ -50,7 +45,7 @@ index 41a76b13e..205646140 100644
#define CV_TEST_INIT0_NOOP (void)0
diff --git a/modules/ts/include/opencv2/ts/ocl_test.hpp b/modules/ts/include/opencv2/ts/ocl_test.hpp
-index 54b33ece8..ef56bf9ef 100644
+index 11572e9f48..438112e2aa 100644
--- a/modules/ts/include/opencv2/ts/ocl_test.hpp
+++ b/modules/ts/include/opencv2/ts/ocl_test.hpp
@@ -82,7 +82,7 @@ inline UMat ToUMat(InputArray src)
@@ -63,7 +58,7 @@ index 54b33ece8..ef56bf9ef 100644
#define MAX_VALUE 357
diff --git a/modules/ts/include/opencv2/ts/ts_ext.hpp b/modules/ts/include/opencv2/ts/ts_ext.hpp
-index 0bdd346dd..2cd34dfce 100644
+index b2a4cac241..b94c681c0c 100644
--- a/modules/ts/include/opencv2/ts/ts_ext.hpp
+++ b/modules/ts/include/opencv2/ts/ts_ext.hpp
@@ -9,7 +9,7 @@
@@ -72,9 +67,6 @@ index 0bdd346dd..2cd34dfce 100644
namespace cvtest {
-void checkIppStatus();
+CV_EXPORTS void checkIppStatus();
- }
-
- #define CV_TEST_INIT \
---
-2.13.4
-
+ extern bool skipUnstableTests;
+ extern bool runBigDataTests;
+ extern int testThreads;
diff --git a/meta-oe/recipes-support/opencv/opencv/0003-imgproc-test-add-checks-for-remove-call.patch b/meta-oe/recipes-support/opencv/opencv/0003-imgproc-test-add-checks-for-remove-call.patch
deleted file mode 100644
index 5f4a60c960..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/0003-imgproc-test-add-checks-for-remove-call.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-Upstream-Status: Backport [https://github.com/opencv/opencv/pull/9376/commits/78a310630fb0a1f6d089576202343e672f27609d]
-
-Fix CVEs for opencv 3.3.
-
-* CVE-2017-12597
-* CVE-2017-12598
-* CVE-2017-12599
-* CVE-2017-12600
-* CVE-2017-12601
-* CVE-2017-12602
-* CVE-2017-12603
-* CVE-2017-12604
-* CVE-2017-12605
-* CVE-2017-12606
-* CVE-2017-12862
-* CVE-2017-12863
-* CVE-2017-12864
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 78a310630fb0a1f6d089576202343e672f27609d Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.alekhin@intel.com>
-Date: Wed, 16 Aug 2017 13:53:12 +0300
-Subject: [PATCH 3/3] imgproc(test): add checks for remove() call
-
----
- modules/imgcodecs/test/test_grfmt.cpp | 2 +-
- modules/imgcodecs/test/test_jpeg.cpp | 12 ++++++------
- modules/imgcodecs/test/test_png.cpp | 2 +-
- modules/imgcodecs/test/test_read_write.cpp | 4 ++--
- modules/imgcodecs/test/test_tiff.cpp | 8 ++++----
- modules/imgcodecs/test/test_webp.cpp | 6 +++---
- 6 files changed, 17 insertions(+), 17 deletions(-)
-
-diff --git a/modules/imgcodecs/test/test_grfmt.cpp b/modules/imgcodecs/test/test_grfmt.cpp
-index 64a0c1e3a..74b72c3b3 100644
---- a/modules/imgcodecs/test/test_grfmt.cpp
-+++ b/modules/imgcodecs/test/test_grfmt.cpp
-@@ -175,7 +175,7 @@ TEST_P(Imgcodecs_ExtSize, write_imageseq)
- EXPECT_LT(n, 1.);
- EXPECT_PRED_FORMAT2(cvtest::MatComparator(0, 0), img, img_gt);
- }
-- remove(filename.c_str());
-+ EXPECT_EQ(0, remove(filename.c_str()));
- }
- }
-
-diff --git a/modules/imgcodecs/test/test_jpeg.cpp b/modules/imgcodecs/test/test_jpeg.cpp
-index 5546f2d91..6ddb02840 100644
---- a/modules/imgcodecs/test/test_jpeg.cpp
-+++ b/modules/imgcodecs/test/test_jpeg.cpp
-@@ -123,8 +123,8 @@ TEST(Imgcodecs_Jpeg, encode_decode_progressive_jpeg)
-
- EXPECT_EQ(0, cvtest::norm(img_jpg_progressive, img_jpg_normal, NORM_INF));
-
-- remove(output_progressive.c_str());
-- remove(output_normal.c_str());
-+ EXPECT_EQ(0, remove(output_progressive.c_str()));
-+ EXPECT_EQ(0, remove(output_normal.c_str()));
- }
-
- TEST(Imgcodecs_Jpeg, encode_decode_optimize_jpeg)
-@@ -148,8 +148,8 @@ TEST(Imgcodecs_Jpeg, encode_decode_optimize_jpeg)
-
- EXPECT_EQ(0, cvtest::norm(img_jpg_optimized, img_jpg_normal, NORM_INF));
-
-- remove(output_optimized.c_str());
-- remove(output_normal.c_str());
-+ EXPECT_EQ(0, remove(output_optimized.c_str()));
-+ EXPECT_EQ(0, remove(output_normal.c_str()));
- }
-
- TEST(Imgcodecs_Jpeg, encode_decode_rst_jpeg)
-@@ -173,8 +173,8 @@ TEST(Imgcodecs_Jpeg, encode_decode_rst_jpeg)
-
- EXPECT_EQ(0, cvtest::norm(img_jpg_rst, img_jpg_normal, NORM_INF));
-
-- remove(output_rst.c_str());
-- remove(output_normal.c_str());
-+ EXPECT_EQ(0, remove(output_rst.c_str()));
-+ EXPECT_EQ(0, remove(output_normal.c_str()));
- }
-
- #endif // HAVE_JPEG
-diff --git a/modules/imgcodecs/test/test_png.cpp b/modules/imgcodecs/test/test_png.cpp
-index c46f90119..4e97043e1 100644
---- a/modules/imgcodecs/test/test_png.cpp
-+++ b/modules/imgcodecs/test/test_png.cpp
-@@ -17,7 +17,7 @@ TEST(Imgcodecs_Png, write_big)
- EXPECT_EQ(13043, img.cols);
- EXPECT_EQ(13917, img.rows);
- ASSERT_NO_THROW(imwrite(dst_file, img));
-- remove(dst_file.c_str());
-+ EXPECT_EQ(0, remove(dst_file.c_str()));
- }
-
- TEST(Imgcodecs_Png, encode)
-diff --git a/modules/imgcodecs/test/test_read_write.cpp b/modules/imgcodecs/test/test_read_write.cpp
-index 38f10225f..5119813bf 100644
---- a/modules/imgcodecs/test/test_read_write.cpp
-+++ b/modules/imgcodecs/test/test_read_write.cpp
-@@ -50,7 +50,7 @@ TEST(Imgcodecs_Image, read_write_bmp)
- psnr = cvtest::PSNR(buf_loaded, image);
- EXPECT_GT(psnr, thresDbell);
-
-- remove(dst_name.c_str());
-+ EXPECT_EQ(0, remove(dst_name.c_str()));
- }
- }
-
-@@ -95,7 +95,7 @@ TEST_P(Imgcodecs_Image, read_write)
- psnr = cvtest::PSNR(buf_loaded, image);
- EXPECT_GT(psnr, thresDbell);
-
-- remove(full_name.c_str());
-+ EXPECT_EQ(0, remove(full_name.c_str()));
- }
-
- const string exts[] = {
-diff --git a/modules/imgcodecs/test/test_tiff.cpp b/modules/imgcodecs/test/test_tiff.cpp
-index 0264da4cd..6ef0c1748 100644
---- a/modules/imgcodecs/test/test_tiff.cpp
-+++ b/modules/imgcodecs/test/test_tiff.cpp
-@@ -41,8 +41,8 @@ TEST(Imgcodecs_Tiff, decode_tile16384x16384)
- // not enough memory
- }
-
-- remove(file3.c_str());
-- remove(file4.c_str());
-+ EXPECT_EQ(0, remove(file3.c_str()));
-+ EXPECT_EQ(0, remove(file4.c_str()));
- }
-
- TEST(Imgcodecs_Tiff, write_read_16bit_big_little_endian)
-@@ -88,7 +88,7 @@ TEST(Imgcodecs_Tiff, write_read_16bit_big_little_endian)
- EXPECT_EQ(0xDEAD, img.at<ushort>(0,0));
- EXPECT_EQ(0xBEEF, img.at<ushort>(0,1));
-
-- remove(filename.c_str());
-+ EXPECT_EQ(0, remove(filename.c_str()));
- }
- }
-
-@@ -143,7 +143,7 @@ TEST(Imgcodecs_Tiff, decode_infinite_rowsperstrip)
-
- EXPECT_NO_THROW(cv::imread(filename, IMREAD_UNCHANGED));
-
-- remove(filename.c_str());
-+ EXPECT_EQ(0, remove(filename.c_str()));
- }
-
- //==================================================================================================
-diff --git a/modules/imgcodecs/test/test_webp.cpp b/modules/imgcodecs/test/test_webp.cpp
-index 6d40ce21e..d82fdd289 100644
---- a/modules/imgcodecs/test/test_webp.cpp
-+++ b/modules/imgcodecs/test/test_webp.cpp
-@@ -44,7 +44,7 @@ TEST(Imgcodecs_WebP, encode_decode_lossless_webp)
- }
- }
-
-- remove(output.c_str());
-+ EXPECT_EQ(0, remove(output.c_str()));
-
- cv::Mat decode = cv::imdecode(buf, IMREAD_COLOR);
- ASSERT_FALSE(decode.empty());
-@@ -71,7 +71,7 @@ TEST(Imgcodecs_WebP, encode_decode_lossy_webp)
-
- EXPECT_NO_THROW(cv::imwrite(output, img, params));
- cv::Mat img_webp = cv::imread(output);
-- remove(output.c_str());
-+ EXPECT_EQ(0, remove(output.c_str()));
- EXPECT_FALSE(img_webp.empty());
- EXPECT_EQ(3, img_webp.channels());
- EXPECT_EQ(512, img_webp.cols);
-@@ -96,7 +96,7 @@ TEST(Imgcodecs_WebP, encode_decode_with_alpha_webp)
-
- EXPECT_NO_THROW(cv::imwrite(output, img));
- cv::Mat img_webp = cv::imread(output);
-- remove(output.c_str());
-+ EXPECT_EQ(0, remove(output.c_str()));
- EXPECT_FALSE(img_webp.empty());
- EXPECT_EQ(4, img_webp.channels());
- EXPECT_EQ(512, img_webp.cols);
---
-2.14.1
-
diff --git a/meta-oe/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch b/meta-oe/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch
new file mode 100644
index 0000000000..8fda857080
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/0008-Do-not-embed-build-directory-in-binaries.patch
@@ -0,0 +1,138 @@
+From: Victor Westerhuis <victor@westerhu.is>
+Date: Sat, 19 Nov 2022 21:45:39 +0100
+Subject: Do not embed build directory in binaries
+
+This makes the opencv core module build reproducibly.
+
+https://salsa.debian.org/science-team/opencv/-/raw/master/debian/patches/0008-Do-not-embed-build-directory-in-binaries.patch
+Upstream-Status: Backport
+Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
+---
+ modules/core/CMakeLists.txt | 10 ------
+ modules/core/include/opencv2/core/private.hpp | 4 +--
+ modules/core/include/opencv2/core/utility.hpp | 4 +--
+ modules/core/src/utils/datafile.cpp | 48 +--------------------------
+ 4 files changed, 5 insertions(+), 61 deletions(-)
+
+diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt
+index b78bb98..d96b669 100644
+--- a/modules/core/CMakeLists.txt
++++ b/modules/core/CMakeLists.txt
+@@ -188,16 +188,6 @@ if(OPENCV_OTHER_INSTALL_PATH)
+ ")
+ endif()
+
+-set(OPENCV_DATA_CONFIG_STR "${OPENCV_DATA_CONFIG_STR}
+-#define OPENCV_BUILD_DIR \"${CMAKE_BINARY_DIR}\"
+-")
+-
+-file(RELATIVE_PATH SOURCE_DIR_RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
+-set(OPENCV_DATA_CONFIG_STR "${OPENCV_DATA_CONFIG_STR}
+-#define OPENCV_DATA_BUILD_DIR_SEARCH_PATHS \\
+- \"${SOURCE_DIR_RELATIVE}/\"
+-")
+-
+ if(WIN32)
+ file(RELATIVE_PATH INSTALL_DATA_DIR_RELATIVE "${CMAKE_INSTALL_PREFIX}/${OPENCV_BIN_INSTALL_PATH}" "${CMAKE_INSTALL_PREFIX}/${OPENCV_OTHER_INSTALL_PATH}")
+ else()
+diff --git a/modules/core/include/opencv2/core/private.hpp b/modules/core/include/opencv2/core/private.hpp
+index 146d37f..dd675bc 100644
+--- a/modules/core/include/opencv2/core/private.hpp
++++ b/modules/core/include/opencv2/core/private.hpp
+@@ -818,10 +818,10 @@ Search directories:
+ 2. Check path specified by configuration parameter with "_HINT" suffix (name of environment variable).
+ 3. Check path specified by configuration parameter (name of environment variable).
+ If parameter value is not empty and nothing is found then stop searching.
+-4. Detects build/install path based on:
++4. Detects install path based on:
+ a. current working directory (CWD)
+ b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage)
+-5. Scan `<source>/{,data}` directories if build directory is detected or the current directory is in source tree.
++5. Scan `<source>/{,data}` directories if the current directory is in source tree.
+ 6. Scan `<install>/share/OpenCV` directory if install directory is detected.
+
+ @param relative_path Relative path to data file
+diff --git a/modules/core/include/opencv2/core/utility.hpp b/modules/core/include/opencv2/core/utility.hpp
+index 108c0d9..f15d9ea 100644
+--- a/modules/core/include/opencv2/core/utility.hpp
++++ b/modules/core/include/opencv2/core/utility.hpp
+@@ -1163,10 +1163,10 @@ Search directories:
+ 2. OPENCV_SAMPLES_DATA_PATH_HINT environment variable
+ 3. OPENCV_SAMPLES_DATA_PATH environment variable
+ If parameter value is not empty and nothing is found then stop searching.
+-4. Detects build/install path based on:
++4. Detects install path based on:
+ a. current working directory (CWD)
+ b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage)
+-5. Scan `<source>/{,data,samples/data}` directories if build directory is detected or the current directory is in source tree.
++5. Scan `<source>/{,data,samples/data}` directories if the current directory is in source tree.
+ 6. Scan `<install>/share/OpenCV` directory if install directory is detected.
+
+ @see cv::utils::findDataFile
+diff --git a/modules/core/src/utils/datafile.cpp b/modules/core/src/utils/datafile.cpp
+index 3af83a5..6bda857 100644
+--- a/modules/core/src/utils/datafile.cpp
++++ b/modules/core/src/utils/datafile.cpp
+@@ -280,32 +280,8 @@ cv::String findDataFile(const cv::String& relative_path,
+
+
+ // Steps: 4, 5, 6
+- cv::String cwd = utils::fs::getcwd();
+- cv::String build_dir(OPENCV_BUILD_DIR);
+- bool has_tested_build_directory = false;
+- if (isSubDirectory(build_dir, cwd) || isSubDirectory(utils::fs::canonical(build_dir), utils::fs::canonical(cwd)))
+- {
+- CV_LOG_DEBUG(NULL, "utils::findDataFile(): the current directory is build sub-directory: " << cwd);
+- const char* build_subdirs[] = { OPENCV_DATA_BUILD_DIR_SEARCH_PATHS };
+- for (size_t k = 0; k < sizeof(build_subdirs)/sizeof(build_subdirs[0]); k++)
+- {
+- CV_LOG_DEBUG(NULL, "utils::findDataFile(): <build>/" << build_subdirs[k]);
+- cv::String datapath = utils::fs::join(build_dir, build_subdirs[k]);
+- if (utils::fs::isDirectory(datapath))
+- {
+- for(size_t i = search_subdir.size(); i > 0; i--)
+- {
+- const cv::String& subdir = search_subdir[i - 1];
+- cv::String prefix = utils::fs::join(datapath, subdir);
+- TRY_FILE_WITH_PREFIX(prefix);
+- }
+- }
+- }
+- has_tested_build_directory = true;
+- }
+-
+ cv::String source_dir;
+- cv::String try_source_dir = cwd;
++ cv::String try_source_dir = utils::fs::getcwd();
+ for (int levels = 0; levels < 3; ++levels)
+ {
+ if (utils::fs::exists(utils::fs::join(try_source_dir, "modules/core/include/opencv2/core/version.hpp")))
+@@ -341,28 +317,6 @@ cv::String findDataFile(const cv::String& relative_path,
+ CV_LOG_INFO(NULL, "Can't detect module binaries location");
+ }
+
+- if (!has_tested_build_directory &&
+- (isSubDirectory(build_dir, module_path) || isSubDirectory(utils::fs::canonical(build_dir), utils::fs::canonical(module_path)))
+- )
+- {
+- CV_LOG_DEBUG(NULL, "utils::findDataFile(): the binary module directory is build sub-directory: " << module_path);
+- const char* build_subdirs[] = { OPENCV_DATA_BUILD_DIR_SEARCH_PATHS };
+- for (size_t k = 0; k < sizeof(build_subdirs)/sizeof(build_subdirs[0]); k++)
+- {
+- CV_LOG_DEBUG(NULL, "utils::findDataFile(): <build>/" << build_subdirs[k]);
+- cv::String datapath = utils::fs::join(build_dir, build_subdirs[k]);
+- if (utils::fs::isDirectory(datapath))
+- {
+- for(size_t i = search_subdir.size(); i > 0; i--)
+- {
+- const cv::String& subdir = search_subdir[i - 1];
+- cv::String prefix = utils::fs::join(datapath, subdir);
+- TRY_FILE_WITH_PREFIX(prefix);
+- }
+- }
+- }
+- }
+-
+ #if defined OPENCV_INSTALL_DATA_DIR_RELATIVE
+ if (!module_path.empty()) // require module path
+ {
diff --git a/meta-oe/recipes-support/opencv/opencv/CVE-2017-14136.patch b/meta-oe/recipes-support/opencv/opencv/CVE-2017-14136.patch
deleted file mode 100644
index 7ad50a2d2f..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/CVE-2017-14136.patch
+++ /dev/null
@@ -1,288 +0,0 @@
-Upstream-Status: Backport [https://github.com/opencv/opencv/pull/9448/commits/aacae20]
-
-Backport patch to fix CVE-2017-14136.
-
-Ref: https://github.com/opencv/opencv/issues/9443
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From aacae2065744adb05e858d327198c7bbe7f452b0 Mon Sep 17 00:00:00 2001
-From: Alexander Alekhin <alexander.alekhin@intel.com>
-Date: Wed, 23 Aug 2017 15:15:27 +0300
-Subject: [PATCH] imgcodesc: fix code problems with integer overflow / address
- arithmetic / UB
-
----
- modules/imgcodecs/src/grfmt_bmp.cpp | 8 ++---
- modules/imgcodecs/src/grfmt_exr.cpp | 10 +++----
- modules/imgcodecs/src/grfmt_jpeg.cpp | 2 +-
- modules/imgcodecs/src/grfmt_jpeg2000.cpp | 6 ++--
- modules/imgcodecs/src/grfmt_pam.cpp | 2 +-
- modules/imgcodecs/src/grfmt_sunras.cpp | 6 ++--
- modules/imgcodecs/src/utils.cpp | 51 +++++++++++++++++++-------------
- modules/imgcodecs/src/utils.hpp | 2 ++
- 8 files changed, 50 insertions(+), 37 deletions(-)
-
-diff --git a/modules/imgcodecs/src/grfmt_bmp.cpp b/modules/imgcodecs/src/grfmt_bmp.cpp
-index 257f97c2d8b..69768e276a3 100644
---- a/modules/imgcodecs/src/grfmt_bmp.cpp
-+++ b/modules/imgcodecs/src/grfmt_bmp.cpp
-@@ -193,7 +193,7 @@ bool BmpDecoder::readHeader()
- bool BmpDecoder::readData( Mat& img )
- {
- uchar* data = img.ptr();
-- int step = (int)img.step;
-+ int step = validateToInt(img.step);
- bool color = img.channels() > 1;
- uchar gray_palette[256] = {0};
- bool result = false;
-@@ -206,7 +206,7 @@ bool BmpDecoder::readData( Mat& img )
-
- if( m_origin == IPL_ORIGIN_BL )
- {
-- data += (m_height - 1)*step;
-+ data += (m_height - 1)*(size_t)step;
- step = -step;
- }
-
-@@ -530,7 +530,7 @@ bool BmpEncoder::write( const Mat& img, const std::vector<int>& )
- int bitmapHeaderSize = 40;
- int paletteSize = channels > 1 ? 0 : 1024;
- int headerSize = 14 /* fileheader */ + bitmapHeaderSize + paletteSize;
-- int fileSize = fileStep*height + headerSize;
-+ size_t fileSize = (size_t)fileStep*height + headerSize;
- PaletteEntry palette[256];
-
- if( m_buf )
-@@ -540,7 +540,7 @@ bool BmpEncoder::write( const Mat& img, const std::vector<int>& )
- strm.putBytes( fmtSignBmp, (int)strlen(fmtSignBmp) );
-
- // write file header
-- strm.putDWord( fileSize ); // file size
-+ strm.putDWord( validateToInt(fileSize) ); // file size
- strm.putDWord( 0 );
- strm.putDWord( headerSize );
-
-diff --git a/modules/imgcodecs/src/grfmt_exr.cpp b/modules/imgcodecs/src/grfmt_exr.cpp
-index 0d2ae9fa7d2..78ffe6c7668 100644
---- a/modules/imgcodecs/src/grfmt_exr.cpp
-+++ b/modules/imgcodecs/src/grfmt_exr.cpp
-@@ -195,7 +195,7 @@ bool ExrDecoder::readData( Mat& img )
- bool color = img.channels() > 1;
-
- uchar* data = img.ptr();
-- int step = img.step;
-+ size_t step = img.step;
- bool justcopy = m_native_depth;
- bool chromatorgb = false;
- bool rgbtogray = false;
-@@ -203,8 +203,8 @@ bool ExrDecoder::readData( Mat& img )
- FrameBuffer frame;
- int xsample[3] = {1, 1, 1};
- char *buffer;
-- int xstep;
-- int ystep;
-+ size_t xstep = 0;
-+ size_t ystep = 0;
-
- xstep = m_native_depth ? 4 : 1;
-
-@@ -593,7 +593,7 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& )
- bool issigned = depth == CV_8S || depth == CV_16S || depth == CV_32S;
- bool isfloat = depth == CV_32F || depth == CV_64F;
- depth = CV_ELEM_SIZE1(depth)*8;
-- const int step = img.step;
-+ const size_t step = img.step;
-
- Header header( width, height );
- Imf::PixelType type;
-@@ -623,7 +623,7 @@ bool ExrEncoder::write( const Mat& img, const std::vector<int>& )
- FrameBuffer frame;
-
- char *buffer;
-- int bufferstep;
-+ size_t bufferstep;
- int size;
- if( type == FLOAT && depth == 32 )
- {
-diff --git a/modules/imgcodecs/src/grfmt_jpeg.cpp b/modules/imgcodecs/src/grfmt_jpeg.cpp
-index ce942ca1995..caf768d2569 100644
---- a/modules/imgcodecs/src/grfmt_jpeg.cpp
-+++ b/modules/imgcodecs/src/grfmt_jpeg.cpp
-@@ -396,7 +396,7 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
- bool JpegDecoder::readData( Mat& img )
- {
- volatile bool result = false;
-- int step = (int)img.step;
-+ size_t step = img.step;
- bool color = img.channels() > 1;
-
- if( m_state && m_width && m_height )
-diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp
-index 950ec21375f..24dfb38bb9d 100644
---- a/modules/imgcodecs/src/grfmt_jpeg2000.cpp
-+++ b/modules/imgcodecs/src/grfmt_jpeg2000.cpp
-@@ -156,7 +156,7 @@ bool Jpeg2KDecoder::readData( Mat& img )
- bool result = false;
- int color = img.channels() > 1;
- uchar* data = img.ptr();
-- int step = (int)img.step;
-+ size_t step = img.step;
- jas_stream_t* stream = (jas_stream_t*)m_stream;
- jas_image_t* image = (jas_image_t*)m_image;
-
-@@ -252,9 +252,9 @@ bool Jpeg2KDecoder::readData( Mat& img )
- if( !jas_image_readcmpt( image, cmptlut[i], 0, 0, xend / xstep, yend / ystep, buffer ))
- {
- if( img.depth() == CV_8U )
-- result = readComponent8u( data + i, buffer, step, cmptlut[i], maxval, offset, ncmpts );
-+ result = readComponent8u( data + i, buffer, validateToInt(step), cmptlut[i], maxval, offset, ncmpts );
- else
-- result = readComponent16u( ((unsigned short *)data) + i, buffer, step / 2, cmptlut[i], maxval, offset, ncmpts );
-+ result = readComponent16u( ((unsigned short *)data) + i, buffer, validateToInt(step / 2), cmptlut[i], maxval, offset, ncmpts );
- if( !result )
- {
- i = ncmpts;
-diff --git a/modules/imgcodecs/src/grfmt_pam.cpp b/modules/imgcodecs/src/grfmt_pam.cpp
-index 11195dc342c..8eb9e012309 100644
---- a/modules/imgcodecs/src/grfmt_pam.cpp
-+++ b/modules/imgcodecs/src/grfmt_pam.cpp
-@@ -479,7 +479,7 @@ bool PAMDecoder::readData( Mat& img )
- {
- uchar* data = img.ptr();
- int target_channels = img.channels();
-- int imp_stride = (int)img.step;
-+ size_t imp_stride = img.step;
- int sample_depth = CV_ELEM_SIZE1(m_type);
- int src_elems_per_row = m_width*m_channels;
- int src_stride = src_elems_per_row*sample_depth;
-diff --git a/modules/imgcodecs/src/grfmt_sunras.cpp b/modules/imgcodecs/src/grfmt_sunras.cpp
-index aca9b369318..6d448f94ed3 100644
---- a/modules/imgcodecs/src/grfmt_sunras.cpp
-+++ b/modules/imgcodecs/src/grfmt_sunras.cpp
-@@ -160,7 +160,7 @@ bool SunRasterDecoder::readData( Mat& img )
- {
- int color = img.channels() > 1;
- uchar* data = img.ptr();
-- int step = (int)img.step;
-+ size_t step = img.step;
- uchar gray_palette[256] = {0};
- bool result = false;
- int src_pitch = ((m_width*m_bpp + 7)/8 + 1) & -2;
-@@ -308,11 +308,11 @@ bool SunRasterDecoder::readData( Mat& img )
- code = m_strm.getByte();
-
- if( color )
-- data = FillUniColor( data, line_end, step, width3,
-+ data = FillUniColor( data, line_end, validateToInt(step), width3,
- y, m_height, len,
- m_palette[code] );
- else
-- data = FillUniGray( data, line_end, step, width3,
-+ data = FillUniGray( data, line_end, validateToInt(step), width3,
- y, m_height, len,
- gray_palette[code] );
- if( y >= m_height )
-diff --git a/modules/imgcodecs/src/utils.cpp b/modules/imgcodecs/src/utils.cpp
-index 2ee5bafc712..474dae008ca 100644
---- a/modules/imgcodecs/src/utils.cpp
-+++ b/modules/imgcodecs/src/utils.cpp
-@@ -42,6 +42,13 @@
- #include "precomp.hpp"
- #include "utils.hpp"
-
-+int validateToInt(size_t sz)
-+{
-+ int valueInt = (int)sz;
-+ CV_Assert((size_t)valueInt == sz);
-+ return valueInt;
-+}
-+
- #define SCALE 14
- #define cR (int)(0.299*(1 << SCALE) + 0.5)
- #define cG (int)(0.587*(1 << SCALE) + 0.5)
-@@ -537,23 +544,25 @@ uchar* FillColorRow1( uchar* data, uchar* indices, int len, PaletteEntry* palett
- {
- uchar* end = data + len*3;
-
-+ const PaletteEntry p0 = palette[0], p1 = palette[1];
-+
- while( (data += 24) < end )
- {
- int idx = *indices++;
-- *((PaletteEntry*)(data - 24)) = palette[(idx & 128) != 0];
-- *((PaletteEntry*)(data - 21)) = palette[(idx & 64) != 0];
-- *((PaletteEntry*)(data - 18)) = palette[(idx & 32) != 0];
-- *((PaletteEntry*)(data - 15)) = palette[(idx & 16) != 0];
-- *((PaletteEntry*)(data - 12)) = palette[(idx & 8) != 0];
-- *((PaletteEntry*)(data - 9)) = palette[(idx & 4) != 0];
-- *((PaletteEntry*)(data - 6)) = palette[(idx & 2) != 0];
-- *((PaletteEntry*)(data - 3)) = palette[(idx & 1) != 0];
-+ *((PaletteEntry*)(data - 24)) = (idx & 128) ? p1 : p0;
-+ *((PaletteEntry*)(data - 21)) = (idx & 64) ? p1 : p0;
-+ *((PaletteEntry*)(data - 18)) = (idx & 32) ? p1 : p0;
-+ *((PaletteEntry*)(data - 15)) = (idx & 16) ? p1 : p0;
-+ *((PaletteEntry*)(data - 12)) = (idx & 8) ? p1 : p0;
-+ *((PaletteEntry*)(data - 9)) = (idx & 4) ? p1 : p0;
-+ *((PaletteEntry*)(data - 6)) = (idx & 2) ? p1 : p0;
-+ *((PaletteEntry*)(data - 3)) = (idx & 1) ? p1 : p0;
- }
-
-- int idx = indices[0] << 24;
-+ int idx = indices[0];
- for( data -= 24; data < end; data += 3, idx += idx )
- {
-- PaletteEntry clr = palette[idx < 0];
-+ const PaletteEntry clr = (idx & 128) ? p1 : p0;
- WRITE_PIX( data, clr );
- }
-
-@@ -565,23 +574,25 @@ uchar* FillGrayRow1( uchar* data, uchar* indices, int len, uchar* palette )
- {
- uchar* end = data + len;
-
-+ const uchar p0 = palette[0], p1 = palette[1];
-+
- while( (data += 8) < end )
- {
- int idx = *indices++;
-- *((uchar*)(data - 8)) = palette[(idx & 128) != 0];
-- *((uchar*)(data - 7)) = palette[(idx & 64) != 0];
-- *((uchar*)(data - 6)) = palette[(idx & 32) != 0];
-- *((uchar*)(data - 5)) = palette[(idx & 16) != 0];
-- *((uchar*)(data - 4)) = palette[(idx & 8) != 0];
-- *((uchar*)(data - 3)) = palette[(idx & 4) != 0];
-- *((uchar*)(data - 2)) = palette[(idx & 2) != 0];
-- *((uchar*)(data - 1)) = palette[(idx & 1) != 0];
-+ *((uchar*)(data - 8)) = (idx & 128) ? p1 : p0;
-+ *((uchar*)(data - 7)) = (idx & 64) ? p1 : p0;
-+ *((uchar*)(data - 6)) = (idx & 32) ? p1 : p0;
-+ *((uchar*)(data - 5)) = (idx & 16) ? p1 : p0;
-+ *((uchar*)(data - 4)) = (idx & 8) ? p1 : p0;
-+ *((uchar*)(data - 3)) = (idx & 4) ? p1 : p0;
-+ *((uchar*)(data - 2)) = (idx & 2) ? p1 : p0;
-+ *((uchar*)(data - 1)) = (idx & 1) ? p1 : p0;
- }
-
-- int idx = indices[0] << 24;
-+ int idx = indices[0];
- for( data -= 8; data < end; data++, idx += idx )
- {
-- data[0] = palette[idx < 0];
-+ data[0] = (idx & 128) ? p1 : p0;
- }
-
- return data;
-diff --git a/modules/imgcodecs/src/utils.hpp b/modules/imgcodecs/src/utils.hpp
-index cab10609db2..7af4c6174ee 100644
---- a/modules/imgcodecs/src/utils.hpp
-+++ b/modules/imgcodecs/src/utils.hpp
-@@ -42,6 +42,8 @@
- #ifndef _UTILS_H_
- #define _UTILS_H_
-
-+int validateToInt(size_t step);
-+
- struct PaletteEntry
- {
- unsigned char b, g, r, a;
diff --git a/meta-oe/recipes-support/opencv/opencv/already-exists.patch b/meta-oe/recipes-support/opencv/opencv/already-exists.patch
deleted file mode 100644
index 6e24f2de87..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/already-exists.patch
+++ /dev/null
@@ -1,394 +0,0 @@
-From e4bf148cddf277834e57c9afeec8daff8378a655 Mon Sep 17 00:00:00 2001
-From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
-Date: Wed, 22 Nov 2017 15:27:07 +0100
-Subject: [PATCH] Fix: File already exists in database: caffe.proto
-
-Fixes error when importing python cv
-
-Upstream-status: Backport https://github.com/opencv/opencv/pull/10092
-Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
----
- modules/dnn/CMakeLists.txt | 6 +++---
- modules/dnn/src/caffe/caffe_importer.cpp | 1 -
- modules/dnn/src/caffe/caffe_io.cpp | 1 -
- modules/dnn/src/caffe/caffe_io.hpp | 2 +-
- modules/dnn/src/caffe/{caffe.proto => opencv-caffe.proto} | 0
- 5 files changed, 4 insertions(+), 6 deletions(-)
- rename modules/dnn/src/caffe/{caffe.proto => opencv-caffe.proto} (100%)
-
-diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt
-index c6329a742263..8ef00ef983ff 100644
---- a/modules/dnn/CMakeLists.txt
-+++ b/modules/dnn/CMakeLists.txt
-@@ -55,13 +55,13 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS
-
- if(PROTOBUF_UPDATE_FILES)
- file(GLOB proto_files src/tensorflow/*.proto)
-- list(APPEND proto_files src/caffe/caffe.proto)
-+ list(APPEND proto_files src/caffe/opencv-caffe.proto)
- PROTOBUF_GENERATE_CPP(Protobuf_HDRS Protobuf_SRCS ${proto_files})
- else()
- file(GLOB fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow/*.cc)
- file(GLOB fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/tensorflow/*.h)
-- list(APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/caffe.pb.cc)
-- list(APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/caffe.pb.h)
-+ list(APPEND fw_srcs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/opencv-caffe.pb.cc)
-+ list(APPEND fw_hdrs ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe/opencv-caffe.pb.h)
- list(APPEND Protobuf_SRCS ${fw_srcs})
- list(APPEND Protobuf_HDRS ${fw_hdrs})
- list(APPEND Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/misc/caffe)
-diff --git a/modules/dnn/src/caffe/caffe_importer.cpp b/modules/dnn/src/caffe/caffe_importer.cpp
-index c075651b95b3..2c977c84b0f4 100644
---- a/modules/dnn/src/caffe/caffe_importer.cpp
-+++ b/modules/dnn/src/caffe/caffe_importer.cpp
-@@ -42,7 +42,6 @@
- #include "../precomp.hpp"
-
- #ifdef HAVE_PROTOBUF
--#include "caffe.pb.h"
-
- #include <iostream>
- #include <fstream>
-diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp
-index 0f46ea77df9a..1d3c518f1328 100644
---- a/modules/dnn/src/caffe/caffe_io.cpp
-+++ b/modules/dnn/src/caffe/caffe_io.cpp
-@@ -99,7 +99,6 @@
- #include <fstream>
- #include <vector>
-
--#include "caffe.pb.h"
- #include "caffe_io.hpp"
- #include "glog_emulator.hpp"
-
-diff --git a/modules/dnn/src/caffe/caffe_io.hpp b/modules/dnn/src/caffe/caffe_io.hpp
-index 09bc5709a24e..f5912c3bcec1 100644
---- a/modules/dnn/src/caffe/caffe_io.hpp
-+++ b/modules/dnn/src/caffe/caffe_io.hpp
-@@ -91,7 +91,7 @@
- #define __OPENCV_DNN_CAFFE_IO_HPP__
- #ifdef HAVE_PROTOBUF
-
--#include "caffe.pb.h"
-+#include "opencv-caffe.pb.h"
-
- namespace cv {
- namespace dnn {
-diff --git a/modules/dnn/src/caffe/caffe.proto b/modules/dnn/src/caffe/opencv-caffe.proto
-similarity index 100%
-rename from modules/dnn/src/caffe/caffe.proto
-rename to modules/dnn/src/caffe/opencv-caffe.proto
-diff --git a/modules/dnn/src/layers/detection_output_layer.cpp b/modules/dnn/src/layers/detection_output_layer.cpp
-index 0b72326f7e7d..f413bad5b81a 100644
---- a/modules/dnn/src/layers/detection_output_layer.cpp
-+++ b/modules/dnn/src/layers/detection_output_layer.cpp
-@@ -44,7 +44,7 @@
- #include "layers_common.hpp"
- #include <float.h>
- #include <string>
--#include <caffe.pb.h>
-+#include <opencv-caffe.pb.h>
-
- namespace cv
- {
-diff --git a/modules/dnn/src/caffe/caffe_importer.cpp b/modules/dnn/src/caffe/caffe_importer.cpp
-index 2c977c84b0f4..a1827a381117 100644
---- a/modules/dnn/src/caffe/caffe_importer.cpp
-+++ b/modules/dnn/src/caffe/caffe_importer.cpp
-@@ -78,8 +78,8 @@ static cv::String toString(const T &v)
-
- class CaffeImporter : public Importer
- {
-- caffe::NetParameter net;
-- caffe::NetParameter netBinary;
-+ opencvcaffe::NetParameter net;
-+ opencvcaffe::NetParameter netBinary;
-
- public:
-
-@@ -197,7 +197,7 @@ public:
- }
- }
-
-- void blobShapeFromProto(const caffe::BlobProto &pbBlob, MatShape& shape)
-+ void blobShapeFromProto(const opencvcaffe::BlobProto &pbBlob, MatShape& shape)
- {
- shape.clear();
- if (pbBlob.has_num() || pbBlob.has_channels() || pbBlob.has_height() || pbBlob.has_width())
-@@ -209,7 +209,7 @@ public:
- }
- else if (pbBlob.has_shape())
- {
-- const caffe::BlobShape &_shape = pbBlob.shape();
-+ const opencvcaffe::BlobShape &_shape = pbBlob.shape();
-
- for (int i = 0; i < _shape.dim_size(); i++)
- shape.push_back((int)_shape.dim(i));
-@@ -218,7 +218,7 @@ public:
- CV_Error(Error::StsError, "Unknown shape of input blob");
- }
-
-- void blobFromProto(const caffe::BlobProto &pbBlob, cv::Mat &dstBlob)
-+ void blobFromProto(const opencvcaffe::BlobProto &pbBlob, cv::Mat &dstBlob)
- {
- MatShape shape;
- blobShapeFromProto(pbBlob, shape);
-@@ -233,7 +233,7 @@ public:
- dstData[i] = pbBlob.data(i);
- }
-
-- void extractBinaryLayerParms(const caffe::LayerParameter& layer, LayerParams& layerParams)
-+ void extractBinaryLayerParms(const opencvcaffe::LayerParameter& layer, LayerParams& layerParams)
- {
- const std::string &name = layer.name();
-
-@@ -247,7 +247,7 @@ public:
- if (li == netBinary.layer_size() || netBinary.layer(li).blobs_size() == 0)
- return;
-
-- const caffe::LayerParameter &binLayer = netBinary.layer(li);
-+ const opencvcaffe::LayerParameter &binLayer = netBinary.layer(li);
- layerParams.blobs.resize(binLayer.blobs_size());
- for (int bi = 0; bi < binLayer.blobs_size(); bi++)
- {
-@@ -289,7 +289,7 @@ public:
-
- for (int li = 0; li < layersSize; li++)
- {
-- const caffe::LayerParameter &layer = net.layer(li);
-+ const opencvcaffe::LayerParameter &layer = net.layer(li);
- String name = layer.name();
- String type = layer.type();
- LayerParams layerParams;
-@@ -313,7 +313,7 @@ public:
- addedBlobs.clear();
- }
-
-- void addOutput(const caffe::LayerParameter &layer, int layerId, int outNum)
-+ void addOutput(const opencvcaffe::LayerParameter &layer, int layerId, int outNum)
- {
- const std::string &name = layer.top(outNum);
-
-diff --git a/modules/dnn/src/caffe/caffe_io.hpp b/modules/dnn/src/caffe/caffe_io.hpp
-index f5912c3bcec1..24cd5fa254eb 100644
---- a/modules/dnn/src/caffe/caffe_io.hpp
-+++ b/modules/dnn/src/caffe/caffe_io.hpp
-@@ -98,9 +98,9 @@ namespace dnn {
-
- // Read parameters from a file into a NetParameter proto message.
- void ReadNetParamsFromTextFileOrDie(const char* param_file,
-- caffe::NetParameter* param);
-+ opencvcaffe::NetParameter* param);
- void ReadNetParamsFromBinaryFileOrDie(const char* param_file,
-- caffe::NetParameter* param);
-+ opencvcaffe::NetParameter* param);
-
- }
- }
-diff --git a/modules/dnn/src/caffe/opencv-caffe.proto b/modules/dnn/src/caffe/opencv-caffe.proto
-index 3d23fb48ea6a..df4e1d3269ae 100644
---- a/modules/dnn/src/caffe/opencv-caffe.proto
-+++ b/modules/dnn/src/caffe/opencv-caffe.proto
-@@ -48,7 +48,7 @@
-
- syntax = "proto2";
-
--package caffe;
-+package opencvcaffe;
-
- // Specifies the shape (dimensions) of a Blob.
- message BlobShape {
-diff --git a/modules/dnn/src/layers/detection_output_layer.cpp b/modules/dnn/src/layers/detection_output_layer.cpp
-index f413bad5b81a..832c257eebf9 100644
---- a/modules/dnn/src/layers/detection_output_layer.cpp
-+++ b/modules/dnn/src/layers/detection_output_layer.cpp
-@@ -72,7 +72,7 @@ public:
-
- int _backgroundLabelId;
-
-- typedef caffe::PriorBoxParameter_CodeType CodeType;
-+ typedef opencvcaffe::PriorBoxParameter_CodeType CodeType;
- CodeType _codeType;
-
- bool _varianceEncodedInTarget;
-@@ -85,7 +85,7 @@ public:
- enum { _numAxes = 4 };
- static const std::string _layerName;
-
-- typedef std::map<int, std::vector<caffe::NormalizedBBox> > LabelBBox;
-+ typedef std::map<int, std::vector<opencvcaffe::NormalizedBBox> > LabelBBox;
-
- bool getParameterDict(const LayerParams &params,
- const std::string &parameterName,
-@@ -131,11 +131,11 @@ public:
- {
- String codeTypeString = params.get<String>("code_type").toLowerCase();
- if (codeTypeString == "corner")
-- _codeType = caffe::PriorBoxParameter_CodeType_CORNER;
-+ _codeType = opencvcaffe::PriorBoxParameter_CodeType_CORNER;
- else if (codeTypeString == "center_size")
-- _codeType = caffe::PriorBoxParameter_CodeType_CENTER_SIZE;
-+ _codeType = opencvcaffe::PriorBoxParameter_CodeType_CENTER_SIZE;
- else
-- _codeType = caffe::PriorBoxParameter_CodeType_CORNER;
-+ _codeType = opencvcaffe::PriorBoxParameter_CodeType_CORNER;
- }
-
- DetectionOutputLayerImpl(const LayerParams &params)
-@@ -215,7 +215,7 @@ public:
- GetConfidenceScores(confidenceData, num, numPriors, _numClasses, allConfidenceScores);
-
- // Retrieve all prior bboxes
-- std::vector<caffe::NormalizedBBox> priorBBoxes;
-+ std::vector<opencvcaffe::NormalizedBBox> priorBBoxes;
- std::vector<std::vector<float> > priorVariances;
- GetPriorBBoxes(priorData, numPriors, priorBBoxes, priorVariances);
-
-@@ -272,7 +272,7 @@ public:
- for (size_t j = 0; j < indices.size(); ++j, ++count)
- {
- int idx = indices[j];
-- const caffe::NormalizedBBox& decode_bbox = label_bboxes->second[idx];
-+ const opencvcaffe::NormalizedBBox& decode_bbox = label_bboxes->second[idx];
- outputsData[count * 7] = i;
- outputsData[count * 7 + 1] = label;
- outputsData[count * 7 + 2] = scores[idx];
-@@ -355,7 +355,7 @@ public:
-
- // Compute bbox size
- template<bool normalized>
-- static float BBoxSize(const caffe::NormalizedBBox& bbox)
-+ static float BBoxSize(const opencvcaffe::NormalizedBBox& bbox)
- {
- if (bbox.xmax() < bbox.xmin() || bbox.ymax() < bbox.ymin())
- {
-@@ -388,10 +388,10 @@ public:
- // Decode a bbox according to a prior bbox
- template<bool variance_encoded_in_target>
- static void DecodeBBox(
-- const caffe::NormalizedBBox& prior_bbox, const std::vector<float>& prior_variance,
-+ const opencvcaffe::NormalizedBBox& prior_bbox, const std::vector<float>& prior_variance,
- const CodeType code_type,
-- const bool clip_bbox, const caffe::NormalizedBBox& bbox,
-- caffe::NormalizedBBox& decode_bbox)
-+ const bool clip_bbox, const opencvcaffe::NormalizedBBox& bbox,
-+ opencvcaffe::NormalizedBBox& decode_bbox)
- {
- float bbox_xmin = variance_encoded_in_target ? bbox.xmin() : prior_variance[0] * bbox.xmin();
- float bbox_ymin = variance_encoded_in_target ? bbox.ymin() : prior_variance[1] * bbox.ymin();
-@@ -399,13 +399,13 @@ public:
- float bbox_ymax = variance_encoded_in_target ? bbox.ymax() : prior_variance[3] * bbox.ymax();
- switch(code_type)
- {
-- case caffe::PriorBoxParameter_CodeType_CORNER:
-+ case opencvcaffe::PriorBoxParameter_CodeType_CORNER:
- decode_bbox.set_xmin(prior_bbox.xmin() + bbox_xmin);
- decode_bbox.set_ymin(prior_bbox.ymin() + bbox_ymin);
- decode_bbox.set_xmax(prior_bbox.xmax() + bbox_xmax);
- decode_bbox.set_ymax(prior_bbox.ymax() + bbox_ymax);
- break;
-- case caffe::PriorBoxParameter_CodeType_CENTER_SIZE:
-+ case opencvcaffe::PriorBoxParameter_CodeType_CENTER_SIZE:
- {
- float prior_width = prior_bbox.xmax() - prior_bbox.xmin();
- CV_Assert(prior_width > 0);
-@@ -431,7 +431,7 @@ public:
- };
- if (clip_bbox)
- {
-- // Clip the caffe::NormalizedBBox such that the range for each corner is [0, 1]
-+ // Clip the opencvcaffe::NormalizedBBox such that the range for each corner is [0, 1]
- decode_bbox.set_xmin(std::max(std::min(decode_bbox.xmin(), 1.f), 0.f));
- decode_bbox.set_ymin(std::max(std::min(decode_bbox.ymin(), 1.f), 0.f));
- decode_bbox.set_xmax(std::max(std::min(decode_bbox.xmax(), 1.f), 0.f));
-@@ -443,11 +443,11 @@ public:
-
- // Decode a set of bboxes according to a set of prior bboxes
- static void DecodeBBoxes(
-- const std::vector<caffe::NormalizedBBox>& prior_bboxes,
-+ const std::vector<opencvcaffe::NormalizedBBox>& prior_bboxes,
- const std::vector<std::vector<float> >& prior_variances,
- const CodeType code_type, const bool variance_encoded_in_target,
-- const bool clip_bbox, const std::vector<caffe::NormalizedBBox>& bboxes,
-- std::vector<caffe::NormalizedBBox>& decode_bboxes)
-+ const bool clip_bbox, const std::vector<opencvcaffe::NormalizedBBox>& bboxes,
-+ std::vector<opencvcaffe::NormalizedBBox>& decode_bboxes)
- {
- CV_Assert(prior_bboxes.size() == prior_variances.size());
- CV_Assert(prior_bboxes.size() == bboxes.size());
-@@ -470,7 +470,7 @@ public:
-
- // Decode all bboxes in a batch
- static void DecodeBBoxesAll(const std::vector<LabelBBox>& all_loc_preds,
-- const std::vector<caffe::NormalizedBBox>& prior_bboxes,
-+ const std::vector<opencvcaffe::NormalizedBBox>& prior_bboxes,
- const std::vector<std::vector<float> >& prior_variances,
- const int num, const bool share_location,
- const int num_loc_classes, const int background_label_id,
-@@ -503,10 +503,10 @@ public:
- // Get prior bounding boxes from prior_data
- // prior_data: 1 x 2 x num_priors * 4 x 1 blob.
- // num_priors: number of priors.
-- // prior_bboxes: stores all the prior bboxes in the format of caffe::NormalizedBBox.
-+ // prior_bboxes: stores all the prior bboxes in the format of opencvcaffe::NormalizedBBox.
- // prior_variances: stores all the variances needed by prior bboxes.
- static void GetPriorBBoxes(const float* priorData, const int& numPriors,
-- std::vector<caffe::NormalizedBBox>& priorBBoxes,
-+ std::vector<opencvcaffe::NormalizedBBox>& priorBBoxes,
- std::vector<std::vector<float> >& priorVariances)
- {
- priorBBoxes.clear(); priorBBoxes.resize(numPriors);
-@@ -514,7 +514,7 @@ public:
- for (int i = 0; i < numPriors; ++i)
- {
- int startIdx = i * 4;
-- caffe::NormalizedBBox& bbox = priorBBoxes[i];
-+ opencvcaffe::NormalizedBBox& bbox = priorBBoxes[i];
- bbox.set_xmin(priorData[startIdx]);
- bbox.set_ymin(priorData[startIdx + 1]);
- bbox.set_xmax(priorData[startIdx + 2]);
-@@ -565,7 +565,7 @@ public:
- {
- labelBBox[label].resize(numPredsPerClass);
- }
-- caffe::NormalizedBBox& bbox = labelBBox[label][p];
-+ opencvcaffe::NormalizedBBox& bbox = labelBBox[label][p];
- bbox.set_xmin(locData[startIdx + c * 4]);
- bbox.set_ymin(locData[startIdx + c * 4 + 1]);
- bbox.set_xmax(locData[startIdx + c * 4 + 2]);
-@@ -612,7 +612,7 @@ public:
- // nms_threshold: a threshold used in non maximum suppression.
- // top_k: if not -1, keep at most top_k picked indices.
- // indices: the kept indices of bboxes after nms.
-- static void ApplyNMSFast(const std::vector<caffe::NormalizedBBox>& bboxes,
-+ static void ApplyNMSFast(const std::vector<opencvcaffe::NormalizedBBox>& bboxes,
- const std::vector<float>& scores, const float score_threshold,
- const float nms_threshold, const float eta, const int top_k,
- std::vector<int>& indices)
-@@ -674,10 +674,10 @@ public:
-
- // Compute the jaccard (intersection over union IoU) overlap between two bboxes.
- template<bool normalized>
-- static float JaccardOverlap(const caffe::NormalizedBBox& bbox1,
-- const caffe::NormalizedBBox& bbox2)
-+ static float JaccardOverlap(const opencvcaffe::NormalizedBBox& bbox1,
-+ const opencvcaffe::NormalizedBBox& bbox2)
- {
-- caffe::NormalizedBBox intersect_bbox;
-+ opencvcaffe::NormalizedBBox intersect_bbox;
- if (bbox2.xmin() > bbox1.xmax() || bbox2.xmax() < bbox1.xmin() ||
- bbox2.ymin() > bbox1.ymax() || bbox2.ymax() < bbox1.ymin())
- {
-diff --git a/modules/dnn/src/caffe/caffe_io.cpp b/modules/dnn/src/caffe/caffe_io.cpp
-index 1d3c518f1328..3cf6e255aa60 100644
---- a/modules/dnn/src/caffe/caffe_io.cpp
-+++ b/modules/dnn/src/caffe/caffe_io.cpp
-@@ -107,7 +107,7 @@ namespace dnn {
-
- using std::string;
- using std::map;
--using namespace caffe;
-+using namespace opencvcaffe;
- using namespace ::google::protobuf;
- using namespace ::google::protobuf::io;
-
diff --git a/meta-oe/recipes-support/opencv/opencv/download.patch b/meta-oe/recipes-support/opencv/opencv/download.patch
new file mode 100644
index 0000000000..33ac483123
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/download.patch
@@ -0,0 +1,41 @@
+From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Thu, 9 Jan 2020 16:24:24 +0000
+Subject: [PATCH] opencv: abort configure if we need to download
+
+This CMake module will download files during do_configure. This is bad as it
+means we can't do offline builds.
+
+Add an option to disallow downloads by emitting a fatal error.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ cmake/OpenCVDownload.cmake | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake
+index 63cf6d3238..4acf477f70 100644
+--- a/cmake/OpenCVDownload.cmake
++++ b/cmake/OpenCVDownload.cmake
+@@ -14,6 +14,7 @@
+ # RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it
+ # Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is <opencv>/.cache
+
++set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads")
+ set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files")
+ if(DEFINED ENV{OPENCV_DOWNLOAD_PATH})
+ set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}")
+@@ -156,6 +157,11 @@ function(ocv_download)
+
+ # Download
+ if(NOT EXISTS "${CACHE_CANDIDATE}")
++ if(NOT OPENCV_ALLOW_DOWNLOADS)
++ message(FATAL_ERROR "Not going to download ${DL_FILENAME}")
++ return()
++ endif()
++
+ ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"")
+ foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST})
+ ocv_download_log("#try ${try}")
diff --git a/meta-oe/recipes-support/opencv/opencv/fixpkgconfig.patch b/meta-oe/recipes-support/opencv/opencv/fixpkgconfig.patch
deleted file mode 100644
index 3aeda7d443..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/fixpkgconfig.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake
-index b8cb8777c06b..75281ee964fd 100644
---- a/cmake/OpenCVGenPkgconfig.cmake
-+++ b/cmake/OpenCVGenPkgconfig.cmake
-@@ -27,7 +27,7 @@ macro(fix_prefix lst isown)
- get_filename_component(libdir "${item}" PATH)
- get_filename_component(libname "${item}" NAME_WE)
- string(REGEX REPLACE "^lib(.*)" "\\1" libname "${libname}")
-- list(APPEND _lst "-L${libdir}" "-l${libname}")
-+ list(APPEND _lst "-l${libname}")
- else()
- list(APPEND _lst "-l${item}")
- endif()
-@@ -66,10 +66,14 @@ ocv_list_unique(_3rdparty)
-
- set(OPENCV_PC_LIBS
- "-L\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}"
-+ "-L\${exec_prefix}/${OPENCV_3P_LIB_INSTALL_PATH}"
- "${_modules}"
- )
- if (BUILD_SHARED_LIBS)
-- set(OPENCV_PC_LIBS_PRIVATE "${_extra}")
-+ set(OPENCV_PC_LIBS_PRIVATE
-+ "-L\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}"
-+ "${_extra}"
-+ )
- else()
- set(OPENCV_PC_LIBS_PRIVATE
- "-L\${exec_prefix}/${OPENCV_3P_LIB_INSTALL_PATH}"
diff --git a/meta-oe/recipes-support/opencv/opencv/javagen.patch b/meta-oe/recipes-support/opencv/opencv/javagen.patch
deleted file mode 100644
index 56526ecd80..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/javagen.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Upstream-status: Inappropriate [OE specific] https://github.com/opencv/opencv/pull/10039#issuecomment-342539288
-
-Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
-diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt
-index 74bc0ef04169..4622fbf9a5f1 100644
---- a/modules/java/CMakeLists.txt
-+++ b/modules/java/CMakeLists.txt
-@@ -291,7 +291,7 @@ foreach(java_file ${step3_input_files})
- endif()
- if(__configure)
- configure_file("${java_file}" "${java_src_dir}/${output_name}" @ONLY)
-- elseif(NOT "${java_file}" MATCHES "${OpenCV_BINARY_DIR}/")
-+ elseif(EXISTS "${java_file}" AND NOT "${java_file}" MATCHES "${OpenCV_BINARY_DIR}/")
- configure_file("${java_file}" "${java_src_dir}/${output_name}" COPYONLY)
- else()
- add_custom_command(OUTPUT "${java_src_dir}/${output_name}"
diff --git a/meta-oe/recipes-support/opencv/opencv/protobuf.patch b/meta-oe/recipes-support/opencv/opencv/protobuf.patch
deleted file mode 100644
index c63dc142ea..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/protobuf.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-Upstream-status: Inappropriate [OE specific]
-
-Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
-diff --git a/cmake/OpenCVFindLibProtobuf.cmake b/cmake/OpenCVFindLibProtobuf.cmake
-index b6ce1e7fd56b..e916ec0df2a6 100644
---- a/cmake/OpenCVFindLibProtobuf.cmake
-+++ b/cmake/OpenCVFindLibProtobuf.cmake
-@@ -7,21 +7,21 @@ OCV_OPTION(BUILD_PROTOBUF "Force to build libprotobuf from sources" ON)
- OCV_OPTION(PROTOBUF_UPDATE_FILES "Force to rebuild .proto files" OFF)
-
- if(PROTOBUF_UPDATE_FILES)
-- if(NOT DEFINED Protobuf_PROTOC_EXECUTABLE)
-+ if(NOT DEFINED PROTOBUF_PROTOC_EXECUTABLE)
- find_package(Protobuf QUIET)
- endif()
-- if(DEFINED Protobuf_PROTOC_EXECUTABLE AND EXISTS ${Protobuf_PROTOC_EXECUTABLE})
-- message(STATUS "The protocol buffer compiler is found (${Protobuf_PROTOC_EXECUTABLE})")
-+ if(DEFINED PROTOBUF_PROTOC_EXECUTABLE AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
-+ message(STATUS "The protocol buffer compiler is found (${PROTOBUF_PROTOC_EXECUTABLE})")
- else()
-- message(FATAL_ERROR "The protocol buffer compiler is not found (Protobuf_PROTOC_EXECUTABLE='${Protobuf_PROTOC_EXECUTABLE}')")
-+ message(FATAL_ERROR "The protocol buffer compiler is not found (PROTOBUF_PROTOC_EXECUTABLE='${PROTOBUF_PROTOC_EXECUTABLE}')")
- endif()
- endif()
-
--if(NOT BUILD_PROTOBUF AND NOT (DEFINED Protobuf_INCLUDE_DIRS AND DEFINED Protobuf_LIBRARIES))
-+if(NOT BUILD_PROTOBUF AND NOT (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES))
- find_package(Protobuf QUIET)
- endif()
-
--if(Protobuf_FOUND)
-+if(PROTOBUF_FOUND OR (DEFINED PROTOBUF_INCLUDE_DIR AND DEFINED PROTOBUF_LIBRARIES))
- # nothing
- else()
- set(Protobuf_LIBRARIES libprotobuf)
-diff --git a/modules/dnn/CMakeLists.txt b/modules/dnn/CMakeLists.txt
-index 2a71568d1a44..c6329a742263 100644
---- a/modules/dnn/CMakeLists.txt
-+++ b/modules/dnn/CMakeLists.txt
-@@ -7,7 +7,7 @@ if(DEFINED BUILD_opencv_dnn AND NOT BUILD_opencv_dnn)
- endif()
-
- include(${OpenCV_SOURCE_DIR}/cmake/OpenCVFindLibProtobuf.cmake)
--if(NOT Protobuf_FOUND)
-+if(NOT PROTOBUF_FOUND)
- ocv_module_disable(opencv_dnn)
- endif()
-
-@@ -72,7 +72,7 @@ ocv_source_group("Src\\protobuf" FILES ${Protobuf_SRCS} ${Protobuf_HDRS})
- ocv_module_include_directories(include ${Protobuf_INCLUDE_DIRS})
-
- ocv_glob_module_sources(${Protobuf_SRCS} ${Protobuf_HDRS} ${CBLAS_H_PROXY_PATH})
--ocv_create_module(${Protobuf_LIBRARIES} ${LAPACK_LIBRARIES})
-+ocv_create_module(${PROTOBUF_LIBRARIES} ${LAPACK_LIBRARIES})
- ocv_add_samples()
- ocv_add_accuracy_tests()
- ocv_add_perf_tests()
diff --git a/meta-oe/recipes-support/opencv/opencv/tinydnn.patch b/meta-oe/recipes-support/opencv/opencv/tinydnn.patch
deleted file mode 100644
index c433fc312d..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/tinydnn.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Upstream-status: Inappropriate [OE specific]
-
-Signed-off-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
-diff --git a/modules/dnn_modern/CMakeLists.txt b/modules/dnn_modern/CMakeLists.txt
-index 79b64b12160b..ba06a0a163e4 100644
---- a/modules/dnn_modern/CMakeLists.txt
-+++ b/modules/dnn_modern/CMakeLists.txt
-@@ -15,24 +15,8 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
- # MODULE REQUIREMENTS
- # ----------------------------------------------------------------------------
-
--set(TINY_DNN_CPP_PATH "${OpenCV_BINARY_DIR}/3rdparty/tinydnn")
--set(TINY_DNN_CPP_ROOT "${TINY_DNN_CPP_PATH}/tiny-dnn-1.0.0a3")
--ocv_download(FILENAME "v1.0.0a3.tar.gz"
-- HASH "adb1c512e09ca2c7a6faef36f9c53e59"
-- URL
-- "${OPENCV_TINY_DNN_URL}"
-- "$ENV{OPENCV_TINY_DNN_URL}"
-- "https://github.com/tiny-dnn/tiny-dnn/archive/"
-- DESTINATION_DIR "${TINY_DNN_CPP_PATH}"
-- STATUS TINY_DNN_DOWNLOAD_SUCCESS
-- ID "tiny-dnn"
-- UNPACK RELATIVE_URL)
--
--if(NOT TINY_DNN_DOWNLOAD_SUCCESS)
-- message(STATUS "Failed to download tiny-dnn sources")
--endif()
--
--find_package(TinyDNN QUIET)
-+set(TINYDNN_INCLUDE_DIRS "${OpenCV_SOURCE_DIR}/3rdparty/tinydnn/tiny-dnn-1.0.0a3")
-+set(TinyDNN_FOUND TRUE)
-
- include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
diff --git a/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch b/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch
deleted file mode 100644
index fc273a8911..0000000000
--- a/meta-oe/recipes-support/opencv/opencv/uselocalxfeatures.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/modules/xfeatures2d/CMakeLists.txt b/modules/xfeatures2d/CMakeLists.txt
-index e1755595..c7009c47 100644
---- a/modules/xfeatures2d/CMakeLists.txt
-+++ b/modules/xfeatures2d/CMakeLists.txt
-@@ -5,10 +5,10 @@ ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d openc
- include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_vgg.cmake)
- include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/download_boostdesc.cmake)
- set(DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/downloads/xfeatures2d")
--download_boost_descriptors("${DOWNLOAD_DIR}" boost_status)
--download_vgg_descriptors("${DOWNLOAD_DIR}" vgg_status)
--if(NOT boost_status OR NOT vgg_status)
-- ocv_module_disable(xfeatures2d)
--endif()
-+#download_boost_descriptors("${DOWNLOAD_DIR}" boost_status)
-+#download_vgg_descriptors("${DOWNLOAD_DIR}" vgg_status)
-+#if(NOT boost_status OR NOT vgg_status)
-+# ocv_module_disable(xfeatures2d)
-+#endif()
-
- ocv_module_include_directories("${DOWNLOAD_DIR}")
diff --git a/meta-oe/recipes-support/opencv/opencv_3.3.bb b/meta-oe/recipes-support/opencv/opencv_3.3.bb
deleted file mode 100644
index ca62de7c8f..0000000000
--- a/meta-oe/recipes-support/opencv/opencv_3.3.bb
+++ /dev/null
@@ -1,203 +0,0 @@
-SUMMARY = "Opencv : The Open Computer Vision Library"
-HOMEPAGE = "http://opencv.org/"
-SECTION = "libs"
-
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=2b2f8752cc5edf504d283107d033f544"
-
-ARM_INSTRUCTION_SET_armv4 = "arm"
-ARM_INSTRUCTION_SET_armv5 = "arm"
-
-DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp"
-
-SRCREV_opencv = "87c27a074db9f6d9d60513f351daa903606ca370"
-SRCREV_contrib = "2a9d1b22ed76eb22fad1a5edf6faf4d05f207b13"
-SRCREV_ipp = "a62e20676a60ee0ad6581e217fe7e4bada3b95db"
-SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26"
-SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"
-SRC_URI[tinydnn.md5sum] = "adb1c512e09ca2c7a6faef36f9c53e59"
-SRC_URI[tinydnn.sha256sum] = "e2c61ce8c5debaa644121179e9dbdcf83f497f39de853f8dd5175846505aa18b"
-
-def ipp_filename(d):
- import re
- arch = d.getVar('TARGET_ARCH', True)
- if re.match("i.86$", arch):
- return "ippicv_2017u2_lnx_ia32_20170418.tgz"
- else:
- return "ippicv_2017u2_lnx_intel64_20170418.tgz"
-
-def ipp_md5sum(d):
- import re
- arch = d.getVar('TARGET_ARCH', True)
- if re.match("i.86$", arch):
- return "f2cece00d802d4dea86df52ed095257e"
- else:
- return "808b791a6eac9ed78d32a7666804320e"
-
-IPP_FILENAME = "${@ipp_filename(d)}"
-IPP_MD5 = "${@ipp_md5sum(d)}"
-
-SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
-SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
- git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \
- git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20170418;destsuffix=ipp;name=ipp \
- git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc \
- git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \
- https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz;destsuffix=git/3rdparty/tinydnn/tiny-dnn-1.0.0a3;name=tinydnn;unpack=false \
- file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \
- file://fixpkgconfig.patch \
- file://uselocalxfeatures.patch;patchdir=../contrib/ \
- file://tinydnn.patch;patchdir=../contrib/ \
- file://0002-Make-opencv-ts-create-share-library-intead-of-static.patch \
- file://0003-To-fix-errors-as-following.patch \
- file://0001-build-workaround-GCC-7.1.1-compilation-issue-with-sa.patch \
- file://0002-imgcodecs-refactoring-improve-code-quality.patch \
- file://0003-imgproc-test-add-checks-for-remove-call.patch \
- file://0001-Dont-use-isystem.patch \
- file://0001-carotene-don-t-use-__asm__-with-aarch64.patch \
- file://0002-Do-not-enable-asm-with-clang.patch \
- file://CVE-2017-14136.patch \
- file://javagen.patch \
- file://protobuf.patch \
- file://already-exists.patch \
-"
-PV = "3.3+git${SRCPV}"
-
-S = "${WORKDIR}/git"
-
-do_unpack_extra() {
- mkdir -p ${S}/3rdparty/tinydnn/
- tar xzf ${WORKDIR}/v1.0.0a3.tar.gz -C ${S}/3rdparty/tinydnn/
- tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}
- cp ${WORKDIR}/vgg/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
- cp ${WORKDIR}/boostdesc/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
-}
-addtask unpack_extra after do_unpack before do_patch
-
-EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
- -DWITH_1394=OFF \
- -DCMAKE_SKIP_RPATH=ON \
- -DOPENCV_ICV_HASH=${IPP_MD5} \
- -DIPPROOT=${WORKDIR}/ippicv_lnx \
- ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
- ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
- ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
- ${@oe.utils.conditional("libdir", "/usr/lib64", "-DLIB_SUFFIX=64", "", d)} \
- ${@oe.utils.conditional("libdir", "/usr/lib32", "-DLIB_SUFFIX=32", "", d)} \
-"
-EXTRA_OECMAKE_append_x86 = " -DX86=ON"
-
-PACKAGECONFIG ??= "python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \
- ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
- ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
-
-PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
-PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
-PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native,"
-PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog,"
-PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype,"
-PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
-PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
-PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
-PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
-PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native,"
-PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
-PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
-PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
-PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/opencl-icd,"
-PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
-PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
-PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy,"
-PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python3-numpy,"
-PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
-PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
-PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract,"
-PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
-PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
-
-inherit pkgconfig cmake
-
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'distutils3-base', '', d)}
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)}
-
-export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
-export PYTHON="${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}"
-export ORACLE_JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
-export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native"
-export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
-
-TARGET_CC_ARCH += "-I${S}/include "
-
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \
- ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \
- ${PN}-apps"
-
-python populate_packages_prepend () {
- cv_libdir = d.expand('${libdir}')
- do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
- do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
- do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
- do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
-
- pn = d.getVar('PN')
- metapkg = pn + '-dev'
- d.setVar('ALLOW_EMPTY_' + metapkg, "1")
- blacklist = [ metapkg ]
- metapkg_rdepends = [ ]
- packages = d.getVar('PACKAGES').split()
- for pkg in packages[1:]:
- if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
- metapkg_rdepends.append(pkg)
- d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
-
- metapkg = pn
- d.setVar('ALLOW_EMPTY_' + metapkg, "1")
- blacklist = [ metapkg, "libopencv-ts" ]
- metapkg_rdepends = [ ]
- for pkg in packages[1:]:
- if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'):
- metapkg_rdepends.append(pkg)
- d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
-}
-
-PACKAGES_DYNAMIC += "^libopencv-.*"
-
-FILES_${PN} = ""
-FILES_${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*"
-FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig ${datadir}/OpenCV/*.cmake"
-FILES_${PN}-staticdev += "${datadir}/OpenCV/3rdparty/lib/*.a"
-FILES_${PN}-apps = "${bindir}/* ${datadir}/OpenCV"
-FILES_${PN}-java = "${datadir}/OpenCV/java"
-FILES_${PN}-samples = "${datadir}/OpenCV/samples/"
-
-INSANE_SKIP_${PN}-java = "libdir"
-INSANE_SKIP_${PN}-dbg = "libdir"
-
-ALLOW_EMPTY_${PN} = "1"
-
-SUMMARY_python-opencv = "Python bindings to opencv"
-FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
-RDEPENDS_python-opencv = "python-core python-numpy"
-
-SUMMARY_python3-opencv = "Python bindings to opencv"
-FILES_python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
-RDEPENDS_python3-opencv = "python3-core python3-numpy"
-
-do_install_append() {
- cp ${S}/include/opencv/*.h ${D}${includedir}/opencv/
- sed -i '/blobtrack/d' ${D}${includedir}/opencv/cvaux.h
-
- # Move Python files into correct library folder (for multilib build)
- if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
- mv ${D}/usr/lib/* ${D}/${libdir}/
- rm -rf ${D}/usr/lib
- fi
-
- if ${@bb.utils.contains("PACKAGECONFIG", "samples", "true", "false", d)}; then
- install -d ${D}${datadir}/OpenCV/samples/bin/
- cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
- fi
-}
diff --git a/meta-oe/recipes-support/opencv/opencv_4.9.0.bb b/meta-oe/recipes-support/opencv/opencv_4.9.0.bb
new file mode 100644
index 0000000000..cf836d3ecf
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv_4.9.0.bb
@@ -0,0 +1,210 @@
+SUMMARY = "Opencv : The Open Computer Vision Library"
+HOMEPAGE = "http://opencv.org/"
+SECTION = "libs"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+ARM_INSTRUCTION_SET:armv4 = "arm"
+ARM_INSTRUCTION_SET:armv5 = "arm"
+
+DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp"
+
+SRCREV_opencv = "dad8af6b17f8e60d7b95a1203a1b4d22f56574cf"
+SRCREV_contrib = "c7602a8f74205e44389bd6a4e8d727d32e7e27b4"
+SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26"
+SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"
+SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12"
+SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252"
+
+
+SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg"
+SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https \
+ git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=4.x;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=git/boostdesc;name=boostdesc;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=git/vgg;name=vgg;protocol=https \
+ git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=git/face;name=face;protocol=https \
+ git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=git/wechat_qrcode;name=wechat-qrcode;protocol=https \
+ file://0003-To-fix-errors-as-following.patch \
+ file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \
+ file://0001-Dont-use-isystem.patch \
+ file://download.patch \
+ file://0001-Make-ts-module-external.patch \
+ file://0008-Do-not-embed-build-directory-in-binaries.patch \
+ "
+SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib"
+
+S = "${WORKDIR}/git"
+
+# OpenCV wants to download more files during configure. We download these in
+# do_fetch and construct a source cache in the format it expects
+OPENCV_DLDIR = "${WORKDIR}/downloads"
+
+do_unpack_extra() {
+
+ md5() {
+ # Return the MD5 of $1
+ echo $(md5sum $1 | cut -d' ' -f1)
+ }
+ cache() {
+ TAG=$1
+ shift
+ mkdir --parents ${OPENCV_DLDIR}/$TAG
+ for F in $*; do
+ DEST=${OPENCV_DLDIR}/$TAG/$(md5 $F)-$(basename $F)
+ test -e $DEST || ln -s $F $DEST
+ done
+ }
+ cache xfeatures2d/boostdesc ${S}/boostdesc/*.i
+ cache xfeatures2d/vgg ${S}/vgg/*.i
+ cache data ${S}/face/*.dat
+ cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel
+ cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt
+}
+addtask unpack_extra after do_unpack before do_patch
+
+CMAKE_VERBOSE = "VERBOSE=1"
+
+EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \
+ -DWITH_1394=OFF \
+ -DENABLE_PRECOMPILED_HEADERS=OFF \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DWITH_IPP=OFF \
+ -DOPENCV_GENERATE_PKGCONFIG=ON \
+ -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \
+ -DOPENCV_ALLOW_DOWNLOADS=OFF \
+ ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
+ ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
+ ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \
+"
+LDFLAGS:append:mips = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
+LDFLAGS:append:riscv32 = " -Wl,--no-as-needed -latomic -Wl,--as-needed"
+
+EXTRA_OECMAKE:append:x86 = " -DX86=ON"
+# disable sse4.1 and sse4.2 to fix 32bit build failure
+# https://github.com/opencv/opencv/issues/21597
+EXTRA_OECMAKE:remove:x86 = " -DENABLE_SSE41=1 -DENABLE_SSE42=1"
+
+PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \
+ ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
+ ${@bb.utils.contains_any("LICENSE_FLAGS_ACCEPTED", "commercial_ffmpeg commercial", "libav", "", d)}"
+
+# TBB does not build for powerpc so disable that package config
+PACKAGECONFIG:remove:powerpc = "tbb"
+# tbb now needs getcontect/setcontext which is not there for all arches on musl
+PACKAGECONFIG:remove:libc-musl:riscv64 = "tbb"
+PACKAGECONFIG:remove:libc-musl:riscv32 = "tbb"
+
+PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade"
+PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
+PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
+PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF -DCMAKE_CXX_STANDARD=17,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native,"
+PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog,"
+PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype,"
+PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2,"
+PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
+PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
+PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
+PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native,"
+PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
+PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
+PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
+PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/opencl-icd,"
+PACKAGECONFIG[openvino] = "-DWITH_OPENVINO=ON,-DWITH_OPENVINO=OFF,openvino-inference-engine,openvino-inference-engine"
+PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native,"
+PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
+PACKAGECONFIG[python3] = "-DPYTHON3_INCLUDE_PATH=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} -DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python3-numpy,"
+PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
+PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
+PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON,-DBUILD_TESTS=OFF,,"
+PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract,"
+PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
+PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
+
+inherit pkgconfig cmake setuptools3-base python3native
+
+export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
+export ORACLE_JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
+export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native"
+export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
+
+TARGET_CC_ARCH += "-I${S}/include "
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \
+ ${PN}-apps"
+
+python populate_packages:prepend () {
+ cv_libdir = d.expand('${libdir}')
+ do_split_packages(d, cv_libdir, r'^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
+ do_split_packages(d, cv_libdir, r'^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
+ do_split_packages(d, cv_libdir, r'^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
+ do_split_packages(d, cv_libdir, r'^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
+
+ pn = d.getVar('PN')
+ metapkg = pn + '-dev'
+ d.setVar('ALLOW_EMPTY:' + metapkg, "1")
+ blacklist = [ metapkg ]
+ metapkg_rdepends = [ ]
+ packages = d.getVar('PACKAGES').split()
+ for pkg in packages[1:]:
+ if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
+ metapkg_rdepends.append(pkg)
+ d.setVar('RRECOMMENDS:' + metapkg, ' '.join(metapkg_rdepends))
+
+ metapkg = pn
+ d.setVar('ALLOW_EMPTY:' + metapkg, "1")
+ blacklist = [ metapkg ]
+ metapkg_rdepends = [ ]
+ for pkg in packages[1:]:
+ if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'):
+ metapkg_rdepends.append(pkg)
+ d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends))
+}
+
+PACKAGES_DYNAMIC += "^libopencv-.*"
+
+FILES:${PN} = ""
+FILES:${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*"
+FILES:${PN}-dev = "${includedir} ${libdir}/pkgconfig ${libdir}/cmake/opencv4/*.cmake"
+FILES:${PN}-staticdev += "${libdir}/opencv4/3rdparty/*.a"
+FILES:${PN}-apps = "${bindir}/* ${datadir}/opencv4 ${datadir}/licenses"
+FILES:${PN}-java = "${datadir}/OpenCV/java"
+FILES:${PN}-samples = "${datadir}/opencv4/samples/"
+
+INSANE_SKIP:${PN}-java = "libdir"
+INSANE_SKIP:${PN}-dbg = "libdir"
+
+ALLOW_EMPTY:${PN} = "1"
+
+SUMMARY:python3-opencv = "Python bindings to opencv"
+FILES:python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
+RDEPENDS:python3-opencv = "python3-core python3-numpy"
+
+RDEPENDS:${PN}-apps = "bash"
+
+do_compile:prepend() {
+ # remove the build host info to improve reproducibility
+ if [ -f ${WORKDIR}/build/modules/core/version_string.inc ]; then
+ sed -i "s#${WORKDIR}#/workdir#g" ${WORKDIR}/build/modules/core/version_string.inc
+ fi
+}
+
+do_install:append() {
+ # Move Python files into correct library folder (for multilib build)
+ if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then
+ mv ${D}/usr/lib/* ${D}/${libdir}/
+ rm -rf ${D}/usr/lib
+ fi
+ # remove build host path to improve reproducibility
+ if [ -f ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake ]; then
+ sed -e 's@${STAGING_DIR_HOST}@@g' \
+ -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake
+ fi
+ # remove setup_vars_opencv4.sh as its content is confusing and useless
+ if [ -f ${D}${bindir}/setup_vars_opencv4.sh ]; then
+ rm -rf ${D}${bindir}/setup_vars_opencv4.sh
+ fi
+}