KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/conversions/rgb_to_yuv420p_sve2.cpp
Date: 2025-09-25 14:13:34
Exec Total Coverage
Lines: 36 36 100.0%
Functions: 4 4 100.0%
Branches: 56 56 100.0%

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