| 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 | 1820 | 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, kleidicv_filter_context_t *context) { | ||
| 26 | 1820 | auto fixed_border_type = kleidicv::get_fixed_border_type(border_type); | |
| 27 |
2/2✓ Branch 0 taken 84 times.
✓ Branch 1 taken 1736 times.
|
1820 | if (!fixed_border_type) { |
| 28 | 84 | return KLEIDICV_ERROR_NOT_IMPLEMENTED; | |
| 29 | } | ||
| 30 | |||
| 31 |
4/4✓ Branch 0 taken 1416 times.
✓ Branch 1 taken 320 times.
✓ Branch 2 taken 1416 times.
✓ Branch 3 taken 320 times.
|
3472 | if (!kleidicv::gaussian_blur_is_implemented(width, height, kernel_width, |
| 32 | 1736 | kernel_height, sigma_x, sigma_y, | |
| 33 | 1736 | channels, *fixed_border_type)) { | |
| 34 | 320 | return KLEIDICV_ERROR_NOT_IMPLEMENTED; | |
| 35 | } | ||
| 36 | |||
| 37 |
6/6✓ Branch 0 taken 504 times.
✓ Branch 1 taken 912 times.
✓ Branch 2 taken 272 times.
✓ Branch 3 taken 232 times.
✓ Branch 4 taken 192 times.
✓ Branch 5 taken 80 times.
|
1416 | if (kernel_width <= 7 || kernel_width == 15 || kernel_width == 21) { |
| 38 | 2672 | return kleidicv_gaussian_blur_fixed_stripe_u8( | |
| 39 | 1336 | src, src_stride, dst, dst_stride, width, height, 0, height, channels, | |
| 40 | 1336 | kernel_width, kernel_height, sigma_x, sigma_y, *fixed_border_type, | |
| 41 | 1336 | context); | |
| 42 | } | ||
| 43 | |||
| 44 | 160 | return kleidicv_gaussian_blur_arbitrary_stripe_u8( | |
| 45 | 80 | src, src_stride, dst, dst_stride, width, height, 0, height, channels, | |
| 46 | 80 | kernel_width, kernel_height, sigma_x, sigma_y, *fixed_border_type, | |
| 47 | 80 | context); | |
| 48 | 1820 | } | |
| 49 | |||
| 50 | } // extern "C" | ||
| 51 |