Coverage Report

Created: 2026-10-28 08:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ffmpeg/libswscale/ops_internal.h
Line
Count
Source
1
/**
2
 * Copyright (C) 2025 Niklas Haas
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
#ifndef SWSCALE_OPS_INTERNAL_H
22
#define SWSCALE_OPS_INTERNAL_H
23
24
#include "libavutil/mem_internal.h"
25
26
#include "ops.h"
27
#include "ops_dispatch.h"
28
29
0
#define Q(N) ((AVRational64) { N, 1 })
30
31
static inline void ff_sws_pack_decode(const uint8_t pattern[4],
32
                                      uint64_t mask[4], int shift[4])
33
0
{
34
0
    int size = 0;
35
0
    for (int i = 0; i < 4; i++)
36
0
        size += pattern[i];
37
0
    for (int i = 0; i < 4; i++) {
38
0
        const int bits = pattern[i];
39
0
        mask[i] = (UINT64_C(1) << bits) - 1;
40
0
        shift[i] = (i ? shift[i - 1] : size) - bits;
41
0
    }
42
0
}
Unexecuted instantiation: format.c:ff_sws_pack_decode
Unexecuted instantiation: ops.c:ff_sws_pack_decode
Unexecuted instantiation: ops_dispatch.c:ff_sws_pack_decode
Unexecuted instantiation: ops_memcpy.c:ff_sws_pack_decode
Unexecuted instantiation: ops_optimizer.c:ff_sws_pack_decode
Unexecuted instantiation: uops_backend.c:ff_sws_pack_decode
Unexecuted instantiation: ops_chain.c:ff_sws_pack_decode
43
44
/**
45
 * Split an op list into two at the given index. The split will be mediated
46
 * by a set of planar read/write operations, plus a swizzle (if necessary)
47
 * to re-order only used components. If a split is performed, both output
48
 * lists will be optimized before returning.
49
 *
50
 * @param ops1 The first part of the split op list. Will be modified in-place.
51
 * @param ops2 The second part of the split op list will be returned here, or
52
 *             NULL if no split was necessary.
53
 * @param index The index of the operation to split before. The operation
54
 *              itself will be absent from `ops1` and instead moved to the
55
 *              start of `ops2`.
56
 *
57
 * Returnse 0 or a negative error code.
58
 */
59
int ff_sws_op_list_split_at(SwsOpList *ops1, SwsOpList **ops2, int index);
60
61
/**
62
 * Reduce an op list into a reduced subset that operates only on a given
63
 * subset of planes. No effect if the output is not planar, or if the plane
64
 * mask is empty or equal to all planes.
65
 *
66
 * @param ops1 Updated in-place to contain only the selected planes.
67
 * @param ops2 The removed remainder is returned here, or NULL if no-op.
68
 * @param planes A mask of the plane indices to keep.
69
 *
70
 * Returns 0 or a negative error code.
71
 */
72
int ff_sws_op_list_split_planes(SwsOpList *ops1, SwsOpList **ops2, SwsCompMask planes);
73
74
#endif /* SWSCALE_OPS_INTERNAL_H */