| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2023 - 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: Apache-2.0 | ||
| 4 | |||
| 5 | #include "kleidicv/dispatch.h" | ||
| 6 | #include "kleidicv/filters/gaussian_blur.h" | ||
| 7 | #include "kleidicv/kleidicv.h" | ||
| 8 | |||
| 9 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
|
10 | KLEIDICV_MULTIVERSION_C_API( |
| 10 | kleidicv_gaussian_blur_fixed_stripe_u8, | ||
| 11 | &kleidicv::neon::gaussian_blur_fixed_stripe_u8, | ||
| 12 | KLEIDICV_SVE2_IMPL_IF(kleidicv::sve2::gaussian_blur_fixed_stripe_u8), | ||
| 13 | &kleidicv::sme::gaussian_blur_fixed_stripe_u8, nullptr); | ||
| 14 | |||
| 15 | 10 | KLEIDICV_MULTIVERSION_C_API(kleidicv_gaussian_blur_arbitrary_stripe_u8, | |
| 16 | &kleidicv::neon::gaussian_blur_arbitrary_stripe_u8, | ||
| 17 | nullptr, nullptr, nullptr); | ||
| 18 | |||
| 19 | extern "C" { | ||
| 20 | |||
| 21 | 1780 | kleidicv_error_t kleidicv_gaussian_blur_u8( | |
| 22 | const uint8_t *src, size_t src_stride, uint8_t *dst, size_t dst_stride, | ||
| 23 | size_t width, size_t height, size_t channels, size_t kernel_width, | ||
| 24 | size_t kernel_height, float sigma_x, float sigma_y, | ||
| 25 | kleidicv_border_type_t border_type) { | ||
| 26 | 1780 | auto fixed_border_type = kleidicv::get_fixed_border_type(border_type); | |
| 27 |
2/2✓ Branch 0 taken 84 times.
✓ Branch 1 taken 1696 times.
|
1780 | if (!fixed_border_type) { |
| 28 | 84 | return KLEIDICV_ERROR_NOT_IMPLEMENTED; | |
| 29 | } | ||
| 30 | |||
| 31 |
4/4✓ Branch 0 taken 1376 times.
✓ Branch 1 taken 320 times.
✓ Branch 2 taken 1376 times.
✓ Branch 3 taken 320 times.
|
3392 | if (!kleidicv::gaussian_blur_is_implemented(width, height, kernel_width, |
| 32 | 1696 | kernel_height, sigma_x, sigma_y, | |
| 33 | 1696 | channels, *fixed_border_type)) { | |
| 34 | 320 | return KLEIDICV_ERROR_NOT_IMPLEMENTED; | |
| 35 | } | ||
| 36 | |||
| 37 |
6/6✓ Branch 0 taken 472 times.
✓ Branch 1 taken 904 times.
✓ Branch 2 taken 264 times.
✓ Branch 3 taken 208 times.
✓ Branch 4 taken 192 times.
✓ Branch 5 taken 72 times.
|
1376 | if (kernel_width <= 7 || kernel_width == 15 || kernel_width == 21) { |
| 38 | 2608 | return kleidicv_gaussian_blur_fixed_stripe_u8( | |
| 39 | 1304 | src, src_stride, dst, dst_stride, width, height, 0, height, channels, | |
| 40 | 1304 | kernel_width, kernel_height, sigma_x, sigma_y, *fixed_border_type); | |
| 41 | } | ||
| 42 | |||
| 43 | 144 | return kleidicv_gaussian_blur_arbitrary_stripe_u8( | |
| 44 | 72 | src, src_stride, dst, dst_stride, width, height, 0, height, channels, | |
| 45 | 72 | kernel_width, kernel_height, sigma_x, sigma_y, *fixed_border_type); | |
| 46 | 1780 | } | |
| 47 | |||
| 48 | } // extern "C" | ||
| 49 |