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 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
|
8 | 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 | 8 | 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 | 1365 | 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 | 1365 | auto fixed_border_type = kleidicv::get_fixed_border_type(border_type); | |
27 |
2/2✓ Branch 0 taken 63 times.
✓ Branch 1 taken 1302 times.
|
1365 | if (!fixed_border_type) { |
28 | 63 | return KLEIDICV_ERROR_NOT_IMPLEMENTED; | |
29 | } | ||
30 | |||
31 |
4/4✓ Branch 0 taken 1062 times.
✓ Branch 1 taken 240 times.
✓ Branch 2 taken 1062 times.
✓ Branch 3 taken 240 times.
|
2604 | if (!kleidicv::gaussian_blur_is_implemented(width, height, kernel_width, |
32 | 1302 | kernel_height, sigma_x, sigma_y, | |
33 | 1302 | channels, *fixed_border_type)) { | |
34 | 240 | return KLEIDICV_ERROR_NOT_IMPLEMENTED; | |
35 | } | ||
36 | |||
37 |
6/6✓ Branch 0 taken 378 times.
✓ Branch 1 taken 684 times.
✓ Branch 2 taken 204 times.
✓ Branch 3 taken 174 times.
✓ Branch 4 taken 144 times.
✓ Branch 5 taken 60 times.
|
1062 | if (kernel_width <= 7 || kernel_width == 15 || kernel_width == 21) { |
38 | 2004 | return kleidicv_gaussian_blur_fixed_stripe_u8( | |
39 | 1002 | src, src_stride, dst, dst_stride, width, height, 0, height, channels, | |
40 | 1002 | kernel_width, kernel_height, sigma_x, sigma_y, *fixed_border_type, | |
41 | 1002 | context); | |
42 | } | ||
43 | |||
44 | 120 | return kleidicv_gaussian_blur_arbitrary_stripe_u8( | |
45 | 60 | src, src_stride, dst, dst_stride, width, height, 0, height, channels, | |
46 | 60 | kernel_width, kernel_height, sigma_x, sigma_y, *fixed_border_type, | |
47 | 60 | context); | |
48 | 1365 | } | |
49 | |||
50 | } // extern "C" | ||
51 |