| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: Apache-2.0 | ||
| 4 | |||
| 5 | #include "kleidicv/conversions/rgb_to_yuv_420.h" | ||
| 6 | #include "kleidicv/kleidicv.h" | ||
| 7 | #include "kleidicv/neon.h" | ||
| 8 | #include "rgb_to_yuv420_neon.h" | ||
| 9 | |||
| 10 | namespace kleidicv::neon { | ||
| 11 | |||
| 12 | KLEIDICV_TARGET_FN_ATTRS | ||
| 13 | 59 | kleidicv_error_t rgb_to_yuv420_sp_stripe_u8(const uint8_t *src, | |
| 14 | size_t src_stride, uint8_t *y_dst, | ||
| 15 | size_t y_stride, uint8_t *uv_dst, | ||
| 16 | size_t uv_stride, size_t width, | ||
| 17 | size_t height, bool is_nv21, | ||
| 18 | size_t begin, size_t end) { | ||
| 19 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 57 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 57 times.
|
59 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
| 20 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 55 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 55 times.
|
57 | CHECK_POINTER_AND_STRIDE(y_dst, y_stride, height); |
| 21 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 53 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 53 times.
|
55 | CHECK_POINTER_AND_STRIDE(uv_dst, uv_stride, (height + 1) / 2); |
| 22 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 49 times.
|
53 | CHECK_IMAGE_SIZE(width, height); |
| 23 | 49 | return RGBxorBGRxToYUV420<false, true, true>::rgb2yuv420_operation( | |
| 24 | 49 | src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height, | |
| 25 | 49 | is_nv21, begin, end); | |
| 26 | 59 | } | |
| 27 | |||
| 28 | KLEIDICV_TARGET_FN_ATTRS | ||
| 29 | 59 | kleidicv_error_t rgba_to_yuv420_sp_stripe_u8(const uint8_t *src, | |
| 30 | size_t src_stride, uint8_t *y_dst, | ||
| 31 | size_t y_stride, uint8_t *uv_dst, | ||
| 32 | size_t uv_stride, size_t width, | ||
| 33 | size_t height, bool is_nv21, | ||
| 34 | size_t begin, size_t end) { | ||
| 35 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 57 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 57 times.
|
59 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
| 36 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 55 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 55 times.
|
57 | CHECK_POINTER_AND_STRIDE(y_dst, y_stride, height); |
| 37 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 53 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 53 times.
|
55 | CHECK_POINTER_AND_STRIDE(uv_dst, uv_stride, (height + 1) / 2); |
| 38 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 49 times.
|
53 | CHECK_IMAGE_SIZE(width, height); |
| 39 | 49 | return RGBxorBGRxToYUV420<true, true, true>::rgb2yuv420_operation( | |
| 40 | 49 | src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height, | |
| 41 | 49 | is_nv21, begin, end); | |
| 42 | 59 | } | |
| 43 | |||
| 44 | KLEIDICV_TARGET_FN_ATTRS | ||
| 45 | 59 | kleidicv_error_t bgr_to_yuv420_sp_stripe_u8(const uint8_t *src, | |
| 46 | size_t src_stride, uint8_t *y_dst, | ||
| 47 | size_t y_stride, uint8_t *uv_dst, | ||
| 48 | size_t uv_stride, size_t width, | ||
| 49 | size_t height, bool is_nv21, | ||
| 50 | size_t begin, size_t end) { | ||
| 51 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 57 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 57 times.
|
59 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
| 52 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 55 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 55 times.
|
57 | CHECK_POINTER_AND_STRIDE(y_dst, y_stride, height); |
| 53 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 53 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 53 times.
|
55 | CHECK_POINTER_AND_STRIDE(uv_dst, uv_stride, (height + 1) / 2); |
| 54 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 49 times.
|
53 | CHECK_IMAGE_SIZE(width, height); |
| 55 | 49 | return RGBxorBGRxToYUV420<false, false, true>::rgb2yuv420_operation( | |
| 56 | 49 | src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height, | |
| 57 | 49 | is_nv21, begin, end); | |
| 58 | 59 | } | |
| 59 | |||
| 60 | KLEIDICV_TARGET_FN_ATTRS | ||
| 61 | 59 | kleidicv_error_t bgra_to_yuv420_sp_stripe_u8(const uint8_t *src, | |
| 62 | size_t src_stride, uint8_t *y_dst, | ||
| 63 | size_t y_stride, uint8_t *uv_dst, | ||
| 64 | size_t uv_stride, size_t width, | ||
| 65 | size_t height, bool is_nv21, | ||
| 66 | size_t begin, size_t end) { | ||
| 67 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 57 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 57 times.
|
59 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
| 68 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 55 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 55 times.
|
57 | CHECK_POINTER_AND_STRIDE(y_dst, y_stride, height); |
| 69 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 53 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 53 times.
|
55 | CHECK_POINTER_AND_STRIDE(uv_dst, uv_stride, (height + 1) / 2); |
| 70 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 49 times.
|
53 | CHECK_IMAGE_SIZE(width, height); |
| 71 | 49 | return RGBxorBGRxToYUV420<true, false, true>::rgb2yuv420_operation( | |
| 72 | 49 | src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height, | |
| 73 | 49 | is_nv21, begin, end); | |
| 74 | 59 | } | |
| 75 | |||
| 76 | } // namespace kleidicv::neon | ||
| 77 |