| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2024 - 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: Apache-2.0 | ||
| 4 | |||
| 5 | #ifndef KLEIDICV_FILTERS_BLUR_AND_DOWNSAMPLE_H | ||
| 6 | #define KLEIDICV_FILTERS_BLUR_AND_DOWNSAMPLE_H | ||
| 7 | |||
| 8 | #include "kleidicv/config.h" | ||
| 9 | #include "kleidicv/kleidicv.h" | ||
| 10 | #include "kleidicv/types.h" | ||
| 11 | #include "kleidicv/workspace/border_types.h" | ||
| 12 | |||
| 13 | extern "C" { | ||
| 14 | // For internal use only. See instead kleidicv_blur_and_downsample_u8. | ||
| 15 | // Blurs and downsamples a horizontal stripe across an image. The stripe is | ||
| 16 | // defined by the range (y_begin, y_end]. | ||
| 17 | KLEIDICV_API_DECLARATION(kleidicv_blur_and_downsample_stripe_u8, | ||
| 18 | const uint8_t *src, size_t src_stride, | ||
| 19 | size_t src_width, size_t src_height, uint8_t *dst, | ||
| 20 | size_t dst_stride, size_t y_begin, size_t y_end, | ||
| 21 | size_t channels, | ||
| 22 | kleidicv::FixedBorderType fixed_border_type, | ||
| 23 | kleidicv_filter_context_t *context); | ||
| 24 | } | ||
| 25 | |||
| 26 | namespace kleidicv { | ||
| 27 | |||
| 28 | 368 | inline bool blur_and_downsample_is_implemented(size_t src_width, | |
| 29 | size_t src_height, | ||
| 30 | size_t channels) { | ||
| 31 |
4/4✓ Branch 0 taken 212 times.
✓ Branch 1 taken 156 times.
✓ Branch 2 taken 4 times.
✓ Branch 3 taken 208 times.
|
368 | return (src_width >= 4 && src_height >= 4) && (channels == 1); |
| 32 | } | ||
| 33 | |||
| 34 | namespace neon { | ||
| 35 | |||
| 36 | kleidicv_error_t kleidicv_blur_and_downsample_stripe_u8( | ||
| 37 | const uint8_t *src, size_t src_stride, size_t src_width, size_t src_height, | ||
| 38 | uint8_t *dst, size_t dst_stride, size_t y_begin, size_t y_end, | ||
| 39 | size_t channels, FixedBorderType fixed_border_type, | ||
| 40 | kleidicv_filter_context_t *context); | ||
| 41 | |||
| 42 | } // namespace neon | ||
| 43 | |||
| 44 | namespace sve2 { | ||
| 45 | |||
| 46 | kleidicv_error_t kleidicv_blur_and_downsample_stripe_u8( | ||
| 47 | const uint8_t *src, size_t src_stride, size_t src_width, size_t src_height, | ||
| 48 | uint8_t *dst, size_t dst_stride, size_t y_begin, size_t y_end, | ||
| 49 | size_t channels, FixedBorderType fixed_border_type, | ||
| 50 | kleidicv_filter_context_t *context); | ||
| 51 | |||
| 52 | } // namespace sve2 | ||
| 53 | |||
| 54 | namespace sme { | ||
| 55 | |||
| 56 | kleidicv_error_t kleidicv_blur_and_downsample_stripe_u8( | ||
| 57 | const uint8_t *src, size_t src_stride, size_t src_width, size_t src_height, | ||
| 58 | uint8_t *dst, size_t dst_stride, size_t y_begin, size_t y_end, | ||
| 59 | size_t channels, FixedBorderType fixed_border_type, | ||
| 60 | kleidicv_filter_context_t *context); | ||
| 61 | |||
| 62 | } // namespace sme | ||
| 63 | |||
| 64 | } // namespace kleidicv | ||
| 65 | |||
| 66 | #endif // KLEIDICV_FILTERS_BLUR_AND_DOWNSAMPLE_H | ||
| 67 |