From b8e1510f63621bd48b64082107acf17941f26b0d Mon Sep 17 00:00:00 2001 From: Denes Tarjan Date: Thu, 5 Dec 2024 13:51:12 +0000 Subject: [PATCH] Disable Remap and WarpPerspective because they need more tests --- CHANGELOG.md | 5 ---- adapters/opencv/kleidicv_hal.cpp | 6 +++++ adapters/opencv/kleidicv_hal.h | 11 +++++++++ benchmark/benchmark.cpp | 4 ++++ doc/functionality.md | 11 --------- doc/opencv.md | 23 ------------------- kleidicv/CMakeLists.txt | 2 ++ kleidicv/include/kleidicv/config.h.in | 4 ++++ kleidicv/include/kleidicv/kleidicv.h | 4 ++++ kleidicv/src/transform/remap_api.cpp | 2 ++ kleidicv/src/transform/remap_neon.cpp | 2 ++ kleidicv/src/transform/remap_sc.h | 2 ++ kleidicv/src/transform/remap_sme2.cpp | 2 ++ kleidicv/src/transform/remap_sve2.cpp | 2 ++ .../src/transform/warp_perspective_api.cpp | 3 +++ .../src/transform/warp_perspective_neon.cpp | 3 +++ kleidicv/src/transform/warp_perspective_sc.h | 2 ++ .../src/transform/warp_perspective_sve2.cpp | 2 ++ kleidicv_thread/src/kleidicv_thread.cpp | 4 ++++ test/api/test_remap.cpp | 3 +++ test/api/test_thread.cpp | 4 ++++ test/api/test_warp_perspective.cpp | 3 +++ 22 files changed, 65 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23ac56994..4aa816a5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,11 +16,6 @@ This changelog aims to follow the guiding principles of ## 0.3.0 - not yet released ### Added -- Remap implementation - - 2-channel s16 and s16+u16 fixed-point coordinates and 1-channel u8 input, replicated borders. - - 2-channel s16 + 5+5 bits' fractions fixed-point coordinates and 1-channel u8 input, replicated borders. -- WarpPerspective implementation - - Nearest neighbour implementation for replicated borders and 1-channel u8 input. - Implementation of cv::pyrDown in the OpenCV HAL. - Implementation of cv::buildOpticalFlowPyramid in the OpenCV HAL. - Sum implementation for 1-channel f32 input (not exposed to OpenCV). diff --git a/adapters/opencv/kleidicv_hal.cpp b/adapters/opencv/kleidicv_hal.cpp index 450135886..ce1cbddc6 100644 --- a/adapters/opencv/kleidicv_hal.cpp +++ b/adapters/opencv/kleidicv_hal.cpp @@ -1248,6 +1248,8 @@ int inRange_f32(const uchar *src_data, size_t src_step, uchar *dst_data, static_cast(lower_bound), static_cast(upper_bound))); } +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP + int remap_s16(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, const int16_t *mapxy, @@ -1311,6 +1313,8 @@ int remap_s16point5(int src_type, const uchar *src_data, size_t src_step, return CV_HAL_ERROR_NOT_IMPLEMENTED; } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP + int pyrdown(const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, int depth, int cn, int border_type) { @@ -1374,6 +1378,7 @@ int scharr_deriv(const uchar *src_data, size_t src_step, int16_t *dst_data, src, src_step, width + 2, height + 2, cn, dst_data, dst_step, mt)); } +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE int warp_perspective(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, @@ -1415,5 +1420,6 @@ int warp_perspective(int src_type, const uchar *src_data, size_t src_step, return CV_HAL_ERROR_NOT_IMPLEMENTED; } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE } // namespace kleidicv::hal diff --git a/adapters/opencv/kleidicv_hal.h b/adapters/opencv/kleidicv_hal.h index c8bac7902..f2db78759 100644 --- a/adapters/opencv/kleidicv_hal.h +++ b/adapters/opencv/kleidicv_hal.h @@ -141,6 +141,7 @@ int inRange_f32(const uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step, int dst_depth, int width, int height, int cn, double lower_bound, double upper_bound); +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP int remap_s16(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, const int16_t *mapxy, @@ -152,12 +153,15 @@ int remap_s16point5(int src_type, const uchar *src_data, size_t src_step, const int16_t *mapxy, size_t mapxy_step, const uint16_t *mapfrac, size_t mapfrac_step, int border_type, const double border_value[4]); +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE int warp_perspective(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, const double transformation[9], int interpolation, int borderType, const double borderValue[4]); +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE int scharr_deriv(const uchar *src_data, size_t src_step, int16_t *dst_data, size_t dst_step, int width, int height, int cn); @@ -376,6 +380,7 @@ static inline int kleidicv_canny_with_fallback( #define cv_hal_canny kleidicv_canny_with_fallback #endif // KLEIDICV_EXPERIMENTAL_FEATURE_CANNY +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP // remap // This condition can be removed if this HAL macro is defined in all supported // versions @@ -413,6 +418,8 @@ static inline int kleidicv_remap_s16point5_with_fallback( #define cv_hal_remap16s16u kleidicv_remap_s16point5_with_fallback #endif // cv_hal_remap16s16u +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP + // pyrdown static inline int kleidicv_pyrdown_with_fallback( const uchar *src_data, size_t src_step, int src_width, int src_height, @@ -425,6 +432,8 @@ static inline int kleidicv_pyrdown_with_fallback( #undef cv_hal_pyrdown #define cv_hal_pyrdown kleidicv_pyrdown_with_fallback +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE +// warp_perspective static inline int kleidicv_warp_perspective_with_fallback( int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, @@ -439,6 +448,8 @@ static inline int kleidicv_warp_perspective_with_fallback( #undef cv_hal_warpPerspective #define cv_hal_warpPerspective kleidicv_warp_perspective_with_fallback +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE + #endif // OPENCV_IMGPROC_HAL_REPLACEMENT_HPP #ifdef OPENCV_CORE_HAL_REPLACEMENT_HPP diff --git a/benchmark/benchmark.cpp b/benchmark/benchmark.cpp index 2cbaa4caf..ba7287b65 100644 --- a/benchmark/benchmark.cpp +++ b/benchmark/benchmark.cpp @@ -495,6 +495,7 @@ static void scharr_interleaved_s16_u8(benchmark::State& state) { } BENCHMARK(scharr_interleaved_s16_u8); +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP template static const ScalarType* get_random_mapxy() { auto generate_mapxy = [&]() { @@ -676,7 +677,9 @@ BENCH_REMAP_S16POINT5(remap_s16point5_u8_flip, remap_s16point5_u8, BENCH_REMAP_S16POINT5(remap_s16point5_u8_identity, remap_s16point5_u8, get_identity_mapxy, 1, KLEIDICV_BORDER_TYPE_REPLICATE, uint8_t); +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE // clang-format off static const float transform_identity[] = { 1.0, 0, 0, @@ -751,3 +754,4 @@ BENCH_WARP_PERSPECTIVE(warp_perspective_u8_rotate, warp_perspective_u8, BENCH_WARP_PERSPECTIVE(warp_perspective_u8_near, warp_perspective_u8, transform_near, 1, KLEIDICV_INTERPOLATION_NEAREST, KLEIDICV_BORDER_TYPE_REPLICATE, uint8_t); +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE diff --git a/doc/functionality.md b/doc/functionality.md index 806c4b786..44eb65a6d 100644 --- a/doc/functionality.md +++ b/doc/functionality.md @@ -90,14 +90,3 @@ See `doc/opencv.md` for details of the functionality available in OpenCV. | 2x2 | x | x | | 4x4 | x | x | | 8x8 | | x | - -# Remap -| | u8 | u16 | -|--------------------------------------------|-----|-----| -| Remap int16 coordinates | x | | -| Remap int16+uint16 fixed-point coordinates | x | | - -# WarpPerspective -| | u8 | u16 | -|---------------------------------------|-----|-----| -| Nearest neighbour, replicated borders | x | | diff --git a/doc/opencv.md b/doc/opencv.md index 0b3672ffa..250605a02 100644 --- a/doc/opencv.md +++ b/doc/opencv.md @@ -191,29 +191,6 @@ Notes on parameters: * `src.depth()` - only supports `CV_8U` and `CV_32F` depths and 1 channel. * `src`, `lowerb` and `upperb` need to have the same type. -### [`cv::remap()`](https://docs.opencv.org/4.10.0/da/d54/group__imgproc__transform.html#gab75ef31ce5cdfb5c44b6da5f3b908ea4) -Geometrically transforms the `src` image by taking the pixels specified by the coordinates from the `map` image. - -Notes on parameters: -* `src.depth()` - only supports `CV_8U` depth and 1 channel. -* `borderMode` - only supports `BORDER_REPLICATE` -Supported map configurations: -* `map1` is 16SC2: channel #1 is x coordinate (column) and channel #2 is y (row) - * supported `interpolation`: `INTER_NEAREST` only -* `map1` is 16SC2 and `map2` is 16UC1: `map1` is as above, `map2` contains combined 5+5 bits of x (low) and y (high) fractions, i.e. x = x1 + x2 / 2^5 - * supported `interpolation`: `INTER_LINEAR` only - -### [`cv::warpPerspective()`](https://docs.opencv.org/4.10.0/da/d54/group__imgproc__transform.html#gaf73673a7e8e18ec6963e3774e6a94b87) -Performs a perspective transformation on an image. - -Notes on parameters: -* `src.depth()` - only supports `CV_8U` depth and 1 channel. -* `src.cols`, `src.rows` - must be less than 2^24 -* `src.step` - must be less than 2^32 -* `dst.cols` - must be at least 8 -* `borderMode` - only supports `BORDER_REPLICATE` -* `interpolation` - only supports `INTER_NEAREST` - ### [`cv::pyrDown()`](https://docs.opencv.org/4.10.0/d4/d86/group__imgproc__filter.html#gaf9bba239dfca11654cb7f50f889fc2ff) Blurs and downsamples an image. diff --git a/kleidicv/CMakeLists.txt b/kleidicv/CMakeLists.txt index 0b0fa2c81..41097c5e9 100644 --- a/kleidicv/CMakeLists.txt +++ b/kleidicv/CMakeLists.txt @@ -50,6 +50,8 @@ option(KLEIDICV_ASSUME_128BIT_SVE2 "Internal - If turned ON 128-bit SVE2 vector option(KLEIDICV_PREFER_INTERLEAVING_LOAD_STORE "Internal - If turned ON interleaving loads and stores are preferred instead of continuous loads and stores" OFF) option(KLEIDICV_EXPERIMENTAL_FEATURE_CANNY "Internal - Enable experimental Canny algorithm" OFF) option(KLEIDICV_CANNY_ALGORITHM_CONFORM_OPENCV "Internal - If turned ON Canny algorithm creates bit exact result compared to OpenCV's original implementation" ON) +option(KLEIDICV_EXPERIMENTAL_FEATURE_REMAP "Internal - Enable experimental Remap algorithm" OFF) +option(KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE "Internal - Enable experimental WarpPerspective algorithm" OFF) if(KLEIDICV_ENABLE_SME2 AND NOT KLEIDICV_LIMIT_SME2_TO_SELECTED_ALGORITHMS) set(KLEIDICV_ALWAYS_ENABLE_SME2 ON) diff --git a/kleidicv/include/kleidicv/config.h.in b/kleidicv/include/kleidicv/config.h.in index 18a0970f3..ac9f2991b 100644 --- a/kleidicv/include/kleidicv/config.h.in +++ b/kleidicv/include/kleidicv/config.h.in @@ -21,6 +21,10 @@ #cmakedefine01 KLEIDICV_CANNY_ALGORITHM_CONFORM_OPENCV +#cmakedefine01 KLEIDICV_EXPERIMENTAL_FEATURE_REMAP + +#cmakedefine01 KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE + // Set to '1' if compiling NEON code paths, otherwise it is set to '0'. #ifndef KLEIDICV_TARGET_NEON #define KLEIDICV_TARGET_NEON 0 diff --git a/kleidicv/include/kleidicv/kleidicv.h b/kleidicv/include/kleidicv/kleidicv.h index b23b934b1..86f6f5d5c 100644 --- a/kleidicv/include/kleidicv/kleidicv.h +++ b/kleidicv/include/kleidicv/kleidicv.h @@ -1723,6 +1723,7 @@ KLEIDICV_API_DECLARATION(kleidicv_in_range_f32, const float *src, size_t width, size_t height, float lower_bound, float upper_bound); +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP /// Transforms the `src` image by taking the pixels specified by the coordinates /// from the `mapxy` image. /// @@ -1779,6 +1780,7 @@ KLEIDICV_API_DECLARATION(kleidicv_remap_s16point5_u8, const uint8_t *src, kleidicv_border_type_t border_type, kleidicv_border_values_t border_values); #endif // DOXYGEN +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP #ifndef DOXYGEN /// Internal - not part of the public API and its direct use is not supported. @@ -1835,6 +1837,7 @@ kleidicv_error_t kleidicv_scharr_interleaved_s16_u8( size_t src_channels, int16_t *dst, size_t dst_stride); #endif // DOXYGEN +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE /// Performs a perspective transformation on an image. /// For each pixel in `dst` take a pixel from `src` specified by /// the transformed x and y coordinates, and optionally doing a bilinear @@ -1875,6 +1878,7 @@ kleidicv_error_t kleidicv_warp_perspective_u8( const float transformation[9], size_t channels, kleidicv_interpolation_type_t interpolation, kleidicv_border_type_t border_type, kleidicv_border_values_t border_values); +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE #ifdef __cplusplus } // extern "C" diff --git a/kleidicv/src/transform/remap_api.cpp b/kleidicv/src/transform/remap_api.cpp index 52dda6203..28f7228fa 100644 --- a/kleidicv/src/transform/remap_api.cpp +++ b/kleidicv/src/transform/remap_api.cpp @@ -6,6 +6,7 @@ #include "kleidicv/kleidicv.h" #include "kleidicv/transform/remap.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP KLEIDICV_MULTIVERSION_C_API(kleidicv_remap_s16_u8, &kleidicv::neon::remap_s16, &kleidicv::sve2::remap_s16, nullptr); @@ -14,3 +15,4 @@ KLEIDICV_MULTIVERSION_C_API( kleidicv_remap_s16point5_u8, &kleidicv::neon::remap_s16point5, &kleidicv::sve2::remap_s16point5, KLEIDICV_SME2_IMPL_IF(&kleidicv::sme2::remap_s16point5)); +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP diff --git a/kleidicv/src/transform/remap_neon.cpp b/kleidicv/src/transform/remap_neon.cpp index 3259a5a96..327c23971 100644 --- a/kleidicv/src/transform/remap_neon.cpp +++ b/kleidicv/src/transform/remap_neon.cpp @@ -8,6 +8,7 @@ #include "kleidicv/neon.h" #include "kleidicv/transform/remap.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP namespace kleidicv::neon { template @@ -273,3 +274,4 @@ KLEIDICV_INSTANTIATE_TEMPLATE_REMAP_S16(uint8_t); KLEIDICV_INSTANTIATE_TEMPLATE_REMAP_S16Point5(uint8_t); } // namespace kleidicv::neon +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP diff --git a/kleidicv/src/transform/remap_sc.h b/kleidicv/src/transform/remap_sc.h index 383b4d78f..617016e71 100644 --- a/kleidicv/src/transform/remap_sc.h +++ b/kleidicv/src/transform/remap_sc.h @@ -15,6 +15,7 @@ #include "kleidicv/sve2.h" #include "kleidicv/transform/remap.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP namespace KLEIDICV_TARGET_NAMESPACE { #if !KLEIDICV_TARGET_SME2 @@ -427,5 +428,6 @@ kleidicv_error_t remap_s16point5_sc( } } // namespace KLEIDICV_TARGET_NAMESPACE +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP #endif // KLEIDICV_REMAP_SC_H diff --git a/kleidicv/src/transform/remap_sme2.cpp b/kleidicv/src/transform/remap_sme2.cpp index 7117256ad..e5c0d6a44 100644 --- a/kleidicv/src/transform/remap_sme2.cpp +++ b/kleidicv/src/transform/remap_sme2.cpp @@ -4,6 +4,7 @@ #include "remap_sc.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP namespace kleidicv::sme2 { template @@ -33,3 +34,4 @@ kleidicv_error_t remap_s16point5(const T *src, size_t src_stride, KLEIDICV_INSTANTIATE_TEMPLATE_REMAP_S16Point5(uint8_t); } // namespace kleidicv::sme2 +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP diff --git a/kleidicv/src/transform/remap_sve2.cpp b/kleidicv/src/transform/remap_sve2.cpp index 2bda17419..acf3c164f 100644 --- a/kleidicv/src/transform/remap_sve2.cpp +++ b/kleidicv/src/transform/remap_sve2.cpp @@ -4,6 +4,7 @@ #include "remap_sc.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP namespace kleidicv::sve2 { template @@ -55,3 +56,4 @@ KLEIDICV_INSTANTIATE_TEMPLATE_REMAP_S16(uint8_t); KLEIDICV_INSTANTIATE_TEMPLATE_REMAP_S16Point5(uint8_t); } // namespace kleidicv::sve2 +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP diff --git a/kleidicv/src/transform/warp_perspective_api.cpp b/kleidicv/src/transform/warp_perspective_api.cpp index 8db7d08cc..d4cae3760 100644 --- a/kleidicv/src/transform/warp_perspective_api.cpp +++ b/kleidicv/src/transform/warp_perspective_api.cpp @@ -6,6 +6,8 @@ #include "kleidicv/kleidicv.h" #include "kleidicv/transform/warp_perspective.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE + KLEIDICV_MULTIVERSION_C_API(kleidicv_warp_perspective_stripe_u8, &kleidicv::neon::warp_perspective_stripe, &kleidicv::sve2::warp_perspective_stripe, @@ -32,3 +34,4 @@ kleidicv_error_t kleidicv_warp_perspective_u8( } } // extern "C" +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE diff --git a/kleidicv/src/transform/warp_perspective_neon.cpp b/kleidicv/src/transform/warp_perspective_neon.cpp index 173f140f7..67469f49b 100644 --- a/kleidicv/src/transform/warp_perspective_neon.cpp +++ b/kleidicv/src/transform/warp_perspective_neon.cpp @@ -8,6 +8,8 @@ #include "kleidicv/traits.h" #include "kleidicv/transform/warp_perspective.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE + namespace kleidicv::neon { // Template for WarpPerspective transformation. @@ -194,3 +196,4 @@ kleidicv_error_t warp_perspective_stripe( KLEIDICV_INSTANTIATE_WARP_PERSPECTIVE(uint8_t); } // namespace kleidicv::neon +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE diff --git a/kleidicv/src/transform/warp_perspective_sc.h b/kleidicv/src/transform/warp_perspective_sc.h index 0a39960be..9df1c6318 100644 --- a/kleidicv/src/transform/warp_perspective_sc.h +++ b/kleidicv/src/transform/warp_perspective_sc.h @@ -12,6 +12,7 @@ #include "kleidicv/traits.h" #include "kleidicv/transform/warp_perspective.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE namespace KLEIDICV_TARGET_NAMESPACE { // Gather load is not available in streaming mode, and in general random access @@ -232,3 +233,4 @@ KLEIDICV_INSTANTIATE_WARP_PERSPECTIVE_SC(uint8_t); #endif } // namespace KLEIDICV_TARGET_NAMESPACE +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE diff --git a/kleidicv/src/transform/warp_perspective_sve2.cpp b/kleidicv/src/transform/warp_perspective_sve2.cpp index 3043da7b3..1bee07812 100644 --- a/kleidicv/src/transform/warp_perspective_sve2.cpp +++ b/kleidicv/src/transform/warp_perspective_sve2.cpp @@ -4,6 +4,7 @@ #include "warp_perspective_sc.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE namespace kleidicv::sve2 { template @@ -33,3 +34,4 @@ kleidicv_error_t warp_perspective_stripe( KLEIDICV_INSTANTIATE_WARP_PERSPECTIVE(uint8_t); } // namespace kleidicv::sve2 +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE diff --git a/kleidicv_thread/src/kleidicv_thread.cpp b/kleidicv_thread/src/kleidicv_thread.cpp index f5d5f1822..0c2ff4201 100644 --- a/kleidicv_thread/src/kleidicv_thread.cpp +++ b/kleidicv_thread/src/kleidicv_thread.cpp @@ -636,6 +636,7 @@ kleidicv_error_t kleidicv_thread_resize_linear_f32( return parallel_batches(callback, mt, std::max(1, src_height - 1)); } +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP kleidicv_error_t kleidicv_thread_remap_s16_u8( const uint8_t *src, size_t src_stride, size_t src_width, size_t src_height, uint8_t *dst, size_t dst_stride, size_t dst_width, size_t dst_height, @@ -677,7 +678,9 @@ kleidicv_error_t kleidicv_thread_remap_s16point5_u8( }; return parallel_batches(callback, mt, dst_height); } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE kleidicv_error_t kleidicv_thread_warp_perspective_u8( const uint8_t *src, size_t src_stride, size_t src_width, size_t src_height, uint8_t *dst, size_t dst_stride, size_t dst_width, size_t dst_height, @@ -698,3 +701,4 @@ kleidicv_error_t kleidicv_thread_warp_perspective_u8( }; return parallel_batches(callback, mt, dst_height); } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE diff --git a/test/api/test_remap.cpp b/test/api/test_remap.cpp index bdb5bf9d3..dd4b02548 100644 --- a/test/api/test_remap.cpp +++ b/test/api/test_remap.cpp @@ -9,6 +9,8 @@ #include "framework/utils.h" #include "kleidicv/kleidicv.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP + template class RemapS16 : public testing::Test { public: @@ -551,3 +553,4 @@ TYPED_TEST(RemapS16Point5, UnsupportedTooSmallImage) { src, 1, 1, 1, dst, 8, 7, 1, 1, mapxy, 4, mapfrac, 2, KLEIDICV_BORDER_TYPE_REPLICATE, kleidicv_border_values_t{})); } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP diff --git a/test/api/test_thread.cpp b/test/api/test_thread.cpp index 662a8d83d..443eb794c 100644 --- a/test/api/test_thread.cpp +++ b/test/api/test_thread.cpp @@ -594,6 +594,7 @@ TEST(ThreadSeparableFilter2D, NotImplemented) { kleidicv_thread_separable_filter_2d_u16); } +#if KLEIDICV_EXPERIMENTAL_FEATURE_REMAP TEST_P(Thread, remap_s16_u8_border_replicate) { check_remap_s16(kleidicv_remap_s16_u8, kleidicv_thread_remap_s16_u8, 1, KLEIDICV_BORDER_TYPE_REPLICATE, @@ -624,7 +625,9 @@ TEST_P(Thread, remap_s16point5_u8_not_implemented) { kleidicv_thread_remap_s16point5_u8, 1, KLEIDICV_BORDER_TYPE_CONSTANT, kleidicv_border_values_t{}); } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_REMAP +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE TEST_P(Thread, warp_perspective_u8_border_replicate) { check_warp_perspective( kleidicv_warp_perspective_u8, kleidicv_thread_warp_perspective_u8, 1, @@ -643,6 +646,7 @@ TEST_P(Thread, warp_perspective_u8_not_implemented) { kleidicv_thread_warp_perspective_u8, 1, KLEIDICV_INTERPOLATION_NEAREST, KLEIDICV_BORDER_TYPE_CONSTANT, kleidicv_border_values_t{}); } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE TEST_P(Thread, SobelHorizontal1Channel) { check_unary_op(kleidicv_sobel_3x3_horizontal_s16_u8, diff --git a/test/api/test_warp_perspective.cpp b/test/api/test_warp_perspective.cpp index c91021701..f43ee2ed8 100644 --- a/test/api/test_warp_perspective.cpp +++ b/test/api/test_warp_perspective.cpp @@ -10,6 +10,8 @@ #include "kleidicv/ctypes.h" #include "kleidicv/kleidicv.h" +#if KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE + // clang-format off static const float transform_identity[] = { 1.0, 0, 0, @@ -413,3 +415,4 @@ TYPED_TEST(WarpPerspective, UnsupportedBigWidth) { KLEIDICV_INTERPOLATION_NEAREST, KLEIDICV_BORDER_TYPE_REPLICATE, kleidicv_border_values_t{})); } +#endif // KLEIDICV_EXPERIMENTAL_FEATURE_WARP_PERSPECTIVE -- GitLab