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 | 53 | kleidicv_error_t rgb_to_yuv420_p_stripe_u8(const uint8_t *src, | |
14 | size_t src_stride, uint8_t *dst, | ||
15 | size_t dst_stride, size_t width, | ||
16 | size_t height, bool is_yv12, | ||
17 | size_t begin, size_t end) { | ||
18 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 51 times.
|
53 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
19 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 49 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
|
51 | CHECK_POINTER_AND_STRIDE(dst, dst_stride, (height * 3 + 1) / 2); |
20 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 47 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 45 times.
|
49 | CHECK_IMAGE_SIZE(width, height); |
21 | 45 | uint8_t *uv_dst = dst + dst_stride * height; | |
22 | 45 | return RGBxorBGRxToYUV420<false, true, false>::rgb2yuv420_operation( | |
23 | 45 | src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height, | |
24 | 45 | is_yv12, begin, end); | |
25 | 53 | } | |
26 | |||
27 | KLEIDICV_TARGET_FN_ATTRS | ||
28 | 53 | kleidicv_error_t rgba_to_yuv420_p_stripe_u8(const uint8_t *src, | |
29 | size_t src_stride, uint8_t *dst, | ||
30 | size_t dst_stride, size_t width, | ||
31 | size_t height, bool is_yv12, | ||
32 | size_t begin, size_t end) { | ||
33 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 51 times.
|
53 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
34 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 49 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
|
51 | CHECK_POINTER_AND_STRIDE(dst, dst_stride, (height * 3 + 1) / 2); |
35 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 47 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 45 times.
|
49 | CHECK_IMAGE_SIZE(width, height); |
36 | 45 | uint8_t *uv_dst = dst + dst_stride * height; | |
37 | 45 | return RGBxorBGRxToYUV420<true, true, false>::rgb2yuv420_operation( | |
38 | 45 | src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height, | |
39 | 45 | is_yv12, begin, end); | |
40 | 53 | } | |
41 | |||
42 | KLEIDICV_TARGET_FN_ATTRS | ||
43 | 53 | kleidicv_error_t bgr_to_yuv420_p_stripe_u8(const uint8_t *src, | |
44 | size_t src_stride, uint8_t *dst, | ||
45 | size_t dst_stride, size_t width, | ||
46 | size_t height, bool is_yv12, | ||
47 | size_t begin, size_t end) { | ||
48 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 51 times.
|
53 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
49 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 49 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
|
51 | CHECK_POINTER_AND_STRIDE(dst, dst_stride, (height * 3 + 1) / 2); |
50 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 47 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 45 times.
|
49 | CHECK_IMAGE_SIZE(width, height); |
51 | 45 | uint8_t *uv_dst = dst + dst_stride * height; | |
52 | 45 | return RGBxorBGRxToYUV420<false, false, false>::rgb2yuv420_operation( | |
53 | 45 | src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height, | |
54 | 45 | is_yv12, begin, end); | |
55 | 53 | } | |
56 | |||
57 | KLEIDICV_TARGET_FN_ATTRS | ||
58 | 53 | kleidicv_error_t bgra_to_yuv420_p_stripe_u8(const uint8_t *src, | |
59 | size_t src_stride, uint8_t *dst, | ||
60 | size_t dst_stride, size_t width, | ||
61 | size_t height, bool is_yv12, | ||
62 | size_t begin, size_t end) { | ||
63 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 51 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 51 times.
|
53 | CHECK_POINTER_AND_STRIDE(src, src_stride, height); |
64 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 49 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 49 times.
|
51 | CHECK_POINTER_AND_STRIDE(dst, dst_stride, (height * 3 + 1) / 2); |
65 |
6/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 47 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 45 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 45 times.
|
49 | CHECK_IMAGE_SIZE(width, height); |
66 | 45 | uint8_t *uv_dst = dst + dst_stride * height; | |
67 | 45 | return RGBxorBGRxToYUV420<true, false, false>::rgb2yuv420_operation( | |
68 | 45 | src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height, | |
69 | 45 | is_yv12, begin, end); | |
70 | 53 | } | |
71 | |||
72 | } // namespace kleidicv::neon | ||
73 |