KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/conversions/rgb_to_yuv420sp_api.cpp
Date: 2025-09-25 14:13:34
Exec Total Coverage
Lines: 20 20 100.0%
Functions: 8 8 100.0%
Branches: 16 16 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 "kleidicv/dispatch.h"
7 #include "kleidicv/kleidicv.h"
8
9 #define KLEIDICV_DEFINE_C_API(name, partialname) \
10 KLEIDICV_MULTIVERSION_C_API(name, &kleidicv::neon::partialname, \
11 &kleidicv::sve2::partialname, \
12 &kleidicv::sme::partialname, nullptr)
13
14
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_rgb_to_yuv420_sp_stripe_u8,
15 rgb_to_yuv420_sp_stripe_u8);
16
17
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_rgba_to_yuv420_sp_stripe_u8,
18 rgba_to_yuv420_sp_stripe_u8);
19
20
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_bgr_to_yuv420_sp_stripe_u8,
21 bgr_to_yuv420_sp_stripe_u8);
22
23
4/4
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 1 times.
8 KLEIDICV_DEFINE_C_API(kleidicv_bgra_to_yuv420_sp_stripe_u8,
24 bgra_to_yuv420_sp_stripe_u8);
25
26 extern "C" {
27
28 176 kleidicv_error_t kleidicv_rgb_to_yuv420_sp_u8(const uint8_t *src,
29 size_t src_stride, uint8_t *y_dst,
30 size_t y_stride, uint8_t *uv_dst,
31 size_t uv_stride, size_t width,
32 size_t height, bool is_nv21) {
33 352 return kleidicv_rgb_to_yuv420_sp_stripe_u8(src, src_stride, y_dst, y_stride,
34 176 uv_dst, uv_stride, width, height,
35 176 is_nv21, 0, height);
36 }
37
38 176 kleidicv_error_t kleidicv_rgba_to_yuv420_sp_u8(const uint8_t *src,
39 size_t src_stride,
40 uint8_t *y_dst, size_t y_stride,
41 uint8_t *uv_dst,
42 size_t uv_stride, size_t width,
43 size_t height, bool is_nv21) {
44 352 return kleidicv_rgba_to_yuv420_sp_stripe_u8(src, src_stride, y_dst, y_stride,
45 176 uv_dst, uv_stride, width, height,
46 176 is_nv21, 0, height);
47 }
48
49 176 kleidicv_error_t kleidicv_bgr_to_yuv420_sp_u8(const uint8_t *src,
50 size_t src_stride, uint8_t *y_dst,
51 size_t y_stride, uint8_t *uv_dst,
52 size_t uv_stride, size_t width,
53 size_t height, bool is_nv21) {
54 352 return kleidicv_bgr_to_yuv420_sp_stripe_u8(src, src_stride, y_dst, y_stride,
55 176 uv_dst, uv_stride, width, height,
56 176 is_nv21, 0, height);
57 }
58
59 176 kleidicv_error_t kleidicv_bgra_to_yuv420_sp_u8(const uint8_t *src,
60 size_t src_stride,
61 uint8_t *y_dst, size_t y_stride,
62 uint8_t *uv_dst,
63 size_t uv_stride, size_t width,
64 size_t height, bool is_nv21) {
65 352 return kleidicv_bgra_to_yuv420_sp_stripe_u8(src, src_stride, y_dst, y_stride,
66 176 uv_dst, uv_stride, width, height,
67 176 is_nv21, 0, height);
68 }
69
70 } // extern "C"
71