FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libswscale/aarch64/ops_impl_conv.c
Date: 2026-10-07 23:37:25
Exec Total Coverage
Lines: 22 22 100.0%
Functions: 1 1 100.0%
Branches: 7 7 100.0%

Line Branch Exec Source
1 /*
2 * Copyright (C) 2026 Ramiro Polla
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 /**
22 * NOTE: This file is #include'd directly by both the NEON backend and
23 * the sws_ops_aarch64 tool.
24 */
25
26 #include "libavutil/error.h"
27
28 #include "ops_impl.h"
29
30 /**
31 * Convert SwsUOp to a SwsAArch64OpImplParams. Read the comments regarding
32 * SwsAArch64OpImplParams in ops_impl.h for more information.
33 */
34 147591 static void convert_to_aarch64_impl(const SwsUOp *uop, int block_size,
35 SwsAArch64OpImplParams *out)
36 {
37 147591 out->uop = uop->uop;
38 147591 out->mask = uop->mask;
39 147591 out->type = uop->type;
40 147591 out->block_size = block_size;
41 147591 out->par = uop->par;
42
43 /**
44 * Deduplicate params to prevent identical CPS functions from being
45 * instantiated multiple times under different names.
46 */
47
3/3
✓ Branch 0 taken 11832 times.
✓ Branch 1 taken 10579 times.
✓ Branch 2 taken 125180 times.
147591 switch (out->uop) {
48 11832 case SWS_UOP_PERMUTE:
49 case SWS_UOP_COPY: {
50 /* Recompute mask taking identity swizzle into account */
51 11832 out->mask = 0;
52
2/2
✓ Branch 0 taken 35375 times.
✓ Branch 1 taken 11832 times.
47207 for (int i = 0; i < out->par.move.num_moves; i++) {
53 35375 int dst = out->par.move.dst[i];
54
2/2
✓ Branch 0 taken 27568 times.
✓ Branch 1 taken 7807 times.
35375 if (dst >= 0)
55 27568 out->mask |= SWS_COMP(dst);
56 }
57
58 /* The element size and type don't matter. */
59 11832 out->block_size = block_size * ff_sws_pixel_type_size(out->type);
60 11832 out->type = SWS_PIXEL_U8;
61 11832 break;
62 }
63 10579 case SWS_UOP_LINEAR_FMA:
64 /* par.lin.exact is currently unused by asmgen_op_linear(). */
65 10579 out->par.lin.exact = 0;
66 10579 break;
67 125180 default:
68 125180 break;
69 }
70 147591 }
71