FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavfilter/bwdifdsp.h
Date: 2024-11-20 23:03:26
Exec Total Coverage
Lines: 12 12 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #ifndef AVFILTER_BWDIFDSP_H
20 #define AVFILTER_BWDIFDSP_H
21
22 #include <stdint.h>
23 #include <string.h>
24
25 typedef struct BWDIFDSPContext {
26 void (*filter_intra)(void *dst1, const void *cur1, int w, int prefs, int mrefs,
27 int prefs3, int mrefs3, int parity, int clip_max);
28 void (*filter_line)(void *dst, const void *prev, const void *cur, const void *next,
29 int w, int prefs, int mrefs, int prefs2, int mrefs2,
30 int prefs3, int mrefs3, int prefs4, int mrefs4,
31 int parity, int clip_max);
32 void (*filter_edge)(void *dst, const void *prev, const void *cur, const void *next,
33 int w, int prefs, int mrefs, int prefs2, int mrefs2,
34 int parity, int clip_max, int spat);
35 void (*filter_line3)(void *dst, int dstride,
36 const void *prev, const void *cur, const void *next, int prefs,
37 int w, int parity, int clip_max);
38 } BWDIFDSPContext;
39
40 void ff_bwdif_init_filter_line(BWDIFDSPContext *bwdif, int bit_depth);
41 void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth);
42 void ff_bwdif_init_aarch64(BWDIFDSPContext *bwdif, int bit_depth);
43
44 void ff_bwdif_filter_edge_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
45 int w, int prefs, int mrefs, int prefs2, int mrefs2,
46 int parity, int clip_max, int spat);
47
48 void ff_bwdif_filter_intra_c(void *dst1, const void *cur1, int w, int prefs, int mrefs,
49 int prefs3, int mrefs3, int parity, int clip_max);
50
51 void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
52 int w, int prefs, int mrefs, int prefs2, int mrefs2,
53 int prefs3, int mrefs3, int prefs4, int mrefs4,
54 int parity, int clip_max);
55
56 static inline
57 6 void ff_bwdif_filter_line3_c(void * dst1, int d_stride,
58 const void * prev1, const void * cur1, const void * next1, int s_stride,
59 int w, int parity, int clip_max)
60 {
61 6 const int prefs = s_stride;
62 6 uint8_t * dst = dst1;
63 6 const uint8_t * prev = prev1;
64 6 const uint8_t * cur = cur1;
65 6 const uint8_t * next = next1;
66
67 6 ff_bwdif_filter_line_c(dst, prev, cur, next, w,
68 prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max);
69 #define NEXT_LINE()\
70 dst += d_stride; \
71 prev += prefs; \
72 cur += prefs; \
73 next += prefs;
74
75 6 NEXT_LINE();
76 6 memcpy(dst, cur, w);
77 6 NEXT_LINE();
78 #undef NEXT_LINE
79 6 ff_bwdif_filter_line_c(dst, prev, cur, next, w,
80 prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max);
81 6 }
82
83
84
85 #endif /* AVFILTER_BWDIFDSP_H */
86