KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/conversions/rgb_to_yuv420sp_sme.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::sme {
9
10 KLEIDICV_LOCALLY_STREAMING KLEIDICV_TARGET_FN_ATTRS kleidicv_error_t
11 1104 rgb_to_yuv420sp_stripe_u8(const uint8_t *src, size_t src_stride, uint8_t *y_dst,
12 size_t y_stride, uint8_t *uv_dst, size_t uv_stride,
13 size_t width, size_t height,
14 kleidicv_color_conversion_t color_format,
15 size_t begin, size_t end) {
16
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);
17
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);
18
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);
19
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);
20
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) {
21 case KLEIDICV_BGR_TO_NV21: {
22 112 return RGBxorBGRxToYUV420<false, false, true>::rgb2yuv420_operation_sc(
23 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
24 112 true, begin, end);
25 }
26
27 case KLEIDICV_RGB_TO_NV21: {
28 112 return RGBxorBGRxToYUV420<false, true, true>::rgb2yuv420_operation_sc(
29 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
30 112 true, begin, end);
31 }
32
33 case KLEIDICV_BGRA_TO_NV21: {
34 112 return RGBxorBGRxToYUV420<true, false, true>::rgb2yuv420_operation_sc(
35 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
36 112 true, begin, end);
37 }
38
39 case KLEIDICV_RGBA_TO_NV21: {
40 112 return RGBxorBGRxToYUV420<true, true, true>::rgb2yuv420_operation_sc(
41 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
42 112 true, begin, end);
43 }
44
45 case KLEIDICV_BGR_TO_NV12: {
46 112 return RGBxorBGRxToYUV420<false, false, true>::rgb2yuv420_operation_sc(
47 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
48 112 false, begin, end);
49 }
50
51 case KLEIDICV_RGB_TO_NV12: {
52 112 return RGBxorBGRxToYUV420<false, true, true>::rgb2yuv420_operation_sc(
53 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
54 112 false, begin, end);
55 }
56
57 case KLEIDICV_BGRA_TO_NV12: {
58 112 return RGBxorBGRxToYUV420<true, false, true>::rgb2yuv420_operation_sc(
59 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
60 112 false, begin, end);
61 }
62
63 case KLEIDICV_RGBA_TO_NV12: {
64 112 return RGBxorBGRxToYUV420<true, true, true>::rgb2yuv420_operation_sc(
65 112 src, src_stride, y_dst, y_stride, uv_dst, uv_stride, width, height,
66 112 false, begin, end);
67 }
68
69 default:
70 96 return KLEIDICV_ERROR_NOT_IMPLEMENTED;
71 }
72
73 return KLEIDICV_ERROR_NOT_IMPLEMENTED;
74 1104 }
75
76 } // namespace kleidicv::sme
77