KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/conversions/rgb_to_yuv420p_sme.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::sme {
9
10 KLEIDICV_LOCALLY_STREAMING KLEIDICV_TARGET_FN_ATTRS kleidicv_error_t
11 53 rgb_to_yuv420_p_stripe_u8(const uint8_t *src, size_t src_stride, uint8_t *dst,
12 size_t dst_stride, size_t width, size_t height,
13 bool is_yv12, size_t begin, size_t end) {
14
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);
15
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);
16
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);
17 45 uint8_t *uv_dst = dst + dst_stride * height;
18 45 return RGBxorBGRxToYUV420<false, true, false>::rgb2yuv420_operation_sc(
19 45 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
20 45 is_yv12, begin, end);
21 53 }
22
23 KLEIDICV_LOCALLY_STREAMING KLEIDICV_TARGET_FN_ATTRS kleidicv_error_t
24 53 rgba_to_yuv420_p_stripe_u8(const uint8_t *src, size_t src_stride, uint8_t *dst,
25 size_t dst_stride, size_t width, size_t height,
26 bool is_yv12, size_t begin, size_t end) {
27
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);
28
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);
29
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);
30 45 uint8_t *uv_dst = dst + dst_stride * height;
31 45 return RGBxorBGRxToYUV420<true, true, false>::rgb2yuv420_operation_sc(
32 45 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
33 45 is_yv12, begin, end);
34 53 }
35
36 KLEIDICV_LOCALLY_STREAMING KLEIDICV_TARGET_FN_ATTRS kleidicv_error_t
37 53 bgr_to_yuv420_p_stripe_u8(const uint8_t *src, size_t src_stride, uint8_t *dst,
38 size_t dst_stride, size_t width, size_t height,
39 bool is_yv12, size_t begin, size_t end) {
40
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);
41
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);
42
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);
43 45 uint8_t *uv_dst = dst + dst_stride * height;
44 45 return RGBxorBGRxToYUV420<false, false, false>::rgb2yuv420_operation_sc(
45 45 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
46 45 is_yv12, begin, end);
47 53 }
48
49 KLEIDICV_LOCALLY_STREAMING KLEIDICV_TARGET_FN_ATTRS kleidicv_error_t
50 53 bgra_to_yuv420_p_stripe_u8(const uint8_t *src, size_t src_stride, uint8_t *dst,
51 size_t dst_stride, size_t width, size_t height,
52 bool is_yv12, size_t begin, size_t end) {
53
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);
54
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);
55
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);
56 45 uint8_t *uv_dst = dst + dst_stride * height;
57 45 return RGBxorBGRxToYUV420<true, false, false>::rgb2yuv420_operation_sc(
58 45 src, src_stride, dst, dst_stride, uv_dst, dst_stride, width, height,
59 45 is_yv12, begin, end);
60 53 }
61
62 } // namespace kleidicv::sme
63