KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/conversions/rgb_to_yuv420p_sve2.cpp
Date: 2026-01-20 20:58:59
Exec Total Coverage
Lines: 32 32 100.0%
Functions: 1 1 100.0%
Branches: 23 23 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.h"
6 #include "rgb_to_yuv420_sc.h"
7
8 namespace kleidicv::sve2 {
9
10 KLEIDICV_TARGET_FN_ATTRS
11 1106 kleidicv_error_t rgb_to_yuv420p_stripe_u8(
12 const uint8_t *src, size_t src_stride, uint8_t *dst, size_t dst_stride,
13 size_t width, size_t height, kleidicv_color_conversion_t color_format,
14 size_t begin, size_t end) {
15
4/4
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1090 times.
✓ Branch 2 taken 16 times.
✓ Branch 3 taken 1090 times.
1106 CHECK_POINTER_AND_STRIDE(src, src_stride, height);
16
4/4
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1074 times.
✓ Branch 2 taken 16 times.
✓ Branch 3 taken 1074 times.
1090 CHECK_POINTER_AND_STRIDE(dst, dst_stride, (height * 3 + 1) / 2);
17
6/6
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 1042 times.
✓ Branch 2 taken 32 times.
✓ Branch 3 taken 1010 times.
✓ Branch 4 taken 64 times.
✓ Branch 5 taken 1010 times.
1074 CHECK_IMAGE_SIZE(width, height);
18 1010 uint8_t *uv_dst = dst + dst_stride * height;
19
20
9/9
✓ Branch 0 taken 108 times.
✓ Branch 1 taken 108 times.
✓ Branch 2 taken 108 times.
✓ Branch 3 taken 108 times.
✓ Branch 4 taken 108 times.
✓ Branch 5 taken 108 times.
✓ Branch 6 taken 108 times.
✓ Branch 7 taken 146 times.
✓ Branch 8 taken 108 times.
1010 switch (color_format) {
21 case KLEIDICV_BGR_TO_YV12: {
22 108 return RGBxorBGRxToYUV420<false, false, false>::rgb2yuv420_operation_sc(
23 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
24 108 true, begin, end);
25 }
26
27 case KLEIDICV_RGB_TO_YV12: {
28 108 return RGBxorBGRxToYUV420<false, true, false>::rgb2yuv420_operation_sc(
29 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
30 108 true, begin, end);
31 }
32
33 case KLEIDICV_BGRA_TO_YV12: {
34 108 return RGBxorBGRxToYUV420<true, false, false>::rgb2yuv420_operation_sc(
35 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
36 108 true, begin, end);
37 }
38
39 case KLEIDICV_RGBA_TO_YV12: {
40 108 return RGBxorBGRxToYUV420<true, true, false>::rgb2yuv420_operation_sc(
41 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
42 108 true, begin, end);
43 }
44
45 case KLEIDICV_BGR_TO_IYUV: {
46 108 return RGBxorBGRxToYUV420<false, false, false>::rgb2yuv420_operation_sc(
47 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
48 108 false, begin, end);
49 }
50
51 case KLEIDICV_RGB_TO_IYUV: {
52 108 return RGBxorBGRxToYUV420<false, true, false>::rgb2yuv420_operation_sc(
53 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
54 108 false, begin, end);
55 }
56
57 case KLEIDICV_BGRA_TO_IYUV: {
58 108 return RGBxorBGRxToYUV420<true, false, false>::rgb2yuv420_operation_sc(
59 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
60 108 false, begin, end);
61 }
62
63 case KLEIDICV_RGBA_TO_IYUV: {
64 108 return RGBxorBGRxToYUV420<true, true, false>::rgb2yuv420_operation_sc(
65 108 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
66 108 false, begin, end);
67 }
68
69 default:
70 146 return KLEIDICV_ERROR_NOT_IMPLEMENTED;
71 }
72
73 return KLEIDICV_ERROR_NOT_IMPLEMENTED;
74 1106 }
75
76 } // namespace kleidicv::sve2
77