KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/conversions/rgb_to_yuv420sp_sve2.cpp
Date: 2026-01-20 20:58:59
Exec Total Coverage
Lines: 32 32 100.0%
Functions: 1 1 100.0%
Branches: 27 27 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 1104 kleidicv_error_t rgb_to_yuv420sp_stripe_u8(
12 const uint8_t *src, size_t src_stride, uint8_t *y_dst, size_t y_stride,
13 uint8_t *uv_dst, size_t uv_stride, size_t width, size_t height,
14 kleidicv_color_conversion_t color_format, size_t begin, size_t end) {
15
4/4
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1088 times.
✓ Branch 2 taken 16 times.
✓ Branch 3 taken 1088 times.
1104 CHECK_POINTER_AND_STRIDE(src, src_stride, height);
16
4/4
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1072 times.
✓ Branch 2 taken 16 times.
✓ Branch 3 taken 1072 times.
1088 CHECK_POINTER_AND_STRIDE(y_dst, y_stride, height);
17
4/4
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 1056 times.
✓ Branch 2 taken 16 times.
✓ Branch 3 taken 1056 times.
1072 CHECK_POINTER_AND_STRIDE(uv_dst, uv_stride, (height + 1) / 2);
18
6/6
✓ Branch 0 taken 32 times.
✓ Branch 1 taken 1024 times.
✓ Branch 2 taken 32 times.
✓ Branch 3 taken 992 times.
✓ Branch 4 taken 64 times.
✓ Branch 5 taken 992 times.
1056 CHECK_IMAGE_SIZE(width, height);
19
9/9
✓ Branch 0 taken 112 times.
✓ Branch 1 taken 112 times.
✓ Branch 2 taken 112 times.
✓ Branch 3 taken 112 times.
✓ Branch 4 taken 112 times.
✓ Branch 5 taken 112 times.
✓ Branch 6 taken 112 times.
✓ Branch 7 taken 96 times.
✓ Branch 8 taken 112 times.
992 switch (color_format) {
20 case KLEIDICV_BGR_TO_NV21: {
21 112 return RGBxorBGRxToYUV420<false, false, true>::rgb2yuv420_operation_sc(
22 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
23 112 true, begin, end);
24 }
25
26 case KLEIDICV_RGB_TO_NV21: {
27 112 return RGBxorBGRxToYUV420<false, true, true>::rgb2yuv420_operation_sc(
28 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
29 112 true, begin, end);
30 }
31
32 case KLEIDICV_BGRA_TO_NV21: {
33 112 return RGBxorBGRxToYUV420<true, false, true>::rgb2yuv420_operation_sc(
34 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
35 112 true, begin, end);
36 }
37
38 case KLEIDICV_RGBA_TO_NV21: {
39 112 return RGBxorBGRxToYUV420<true, true, true>::rgb2yuv420_operation_sc(
40 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
41 112 true, begin, end);
42 }
43
44 case KLEIDICV_BGR_TO_NV12: {
45 112 return RGBxorBGRxToYUV420<false, false, true>::rgb2yuv420_operation_sc(
46 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
47 112 false, begin, end);
48 }
49
50 case KLEIDICV_RGB_TO_NV12: {
51 112 return RGBxorBGRxToYUV420<false, true, true>::rgb2yuv420_operation_sc(
52 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
53 112 false, begin, end);
54 }
55
56 case KLEIDICV_BGRA_TO_NV12: {
57 112 return RGBxorBGRxToYUV420<true, false, true>::rgb2yuv420_operation_sc(
58 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
59 112 false, begin, end);
60 }
61
62 case KLEIDICV_RGBA_TO_NV12: {
63 112 return RGBxorBGRxToYUV420<true, true, true>::rgb2yuv420_operation_sc(
64 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
65 112 false, begin, end);
66 }
67
68 default:
69 96 return KLEIDICV_ERROR_NOT_IMPLEMENTED;
70 }
71
72 return KLEIDICV_ERROR_NOT_IMPLEMENTED;
73 1104 }
74
75 } // namespace kleidicv::sve2
76