Skip to content

Commit 97cd698

Browse files
committed
avfilter/bwdifdsp: Avoid including ff_bwdif_filter_line3_c()
This function is used by the AARCH64 code to filter a few remaining lines in case the dimensions are not suitably aligned; it is furthermore also used by checkasm to actually test the AARCH64 code against. But it is normally not used and this patch therefore moves it in bwdifdsp.h as a static inline function so that it can be avoided if possible or inlined where necessary. Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent fa06f48 commit 97cd698

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

libavfilter/bwdifdsp.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -143,31 +143,6 @@ void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, con
143143
FILTER2()
144144
}
145145

146-
#define NEXT_LINE()\
147-
dst += d_stride; \
148-
prev += prefs; \
149-
cur += prefs; \
150-
next += prefs;
151-
152-
void ff_bwdif_filter_line3_c(void * dst1, int d_stride,
153-
const void * prev1, const void * cur1, const void * next1, int s_stride,
154-
int w, int parity, int clip_max)
155-
{
156-
const int prefs = s_stride;
157-
uint8_t * dst = dst1;
158-
const uint8_t * prev = prev1;
159-
const uint8_t * cur = cur1;
160-
const uint8_t * next = next1;
161-
162-
ff_bwdif_filter_line_c(dst, prev, cur, next, w,
163-
prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max);
164-
NEXT_LINE();
165-
memcpy(dst, cur, w);
166-
NEXT_LINE();
167-
ff_bwdif_filter_line_c(dst, prev, cur, next, w,
168-
prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max);
169-
}
170-
171146
void ff_bwdif_filter_edge_c(void *dst1, const void *prev1, const void *cur1, const void *next1,
172147
int w, int prefs, int mrefs, int prefs2, int mrefs2,
173148
int parity, int clip_max, int spat)

libavfilter/bwdifdsp.h

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#ifndef AVFILTER_BWDIFDSP_H
2020
#define AVFILTER_BWDIFDSP_H
2121

22+
#include <stdint.h>
23+
#include <string.h>
24+
2225
typedef struct BWDIFDSPContext {
2326
void (*filter_intra)(void *dst1, const void *cur1, int w, int prefs, int mrefs,
2427
int prefs3, int mrefs3, int parity, int clip_max);
@@ -50,8 +53,33 @@ void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, con
5053
int prefs3, int mrefs3, int prefs4, int mrefs4,
5154
int parity, int clip_max);
5255

56+
static inline
5357
void ff_bwdif_filter_line3_c(void * dst1, int d_stride,
5458
const void * prev1, const void * cur1, const void * next1, int s_stride,
55-
int w, int parity, int clip_max);
59+
int w, int parity, int clip_max)
60+
{
61+
const int prefs = s_stride;
62+
uint8_t * dst = dst1;
63+
const uint8_t * prev = prev1;
64+
const uint8_t * cur = cur1;
65+
const uint8_t * next = next1;
66+
67+
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+
NEXT_LINE();
76+
memcpy(dst, cur, w);
77+
NEXT_LINE();
78+
#undef NEXT_LINE
79+
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+
}
82+
83+
5684

5785
#endif /* AVFILTER_BWDIFDSP_H */

0 commit comments

Comments
 (0)