FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavfilter/vf_xbr.c
Date: 2022-11-26 13:19:19
Exec Total Coverage
Lines: 128 130 98.5%
Branches: 601 604 99.5%

Line Branch Exec Source
1 /*
2 * This file is part of FFmpeg.
3 *
4 * Copyright (c) 2011, 2012 Hyllian/Jararaca <sergiogdb@gmail.com>
5 * Copyright (c) 2014 Arwa Arif <arwaarif1994@gmail.com>
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * XBR Filter is used for depixelization of image.
25 * This is based on Hyllian's xBR shader.
26 *
27 * @see https://forums.libretro.com/t/xbr-algorithm-tutorial/123
28 * @see https://github.com/yoyofr/iFBA/blob/master/fba_src/src/intf/video/scalers/xbr.cpp
29 */
30
31 #include "libavutil/opt.h"
32 #include "libavutil/pixdesc.h"
33 #include "internal.h"
34
35 #define LB_MASK 0x00FEFEFE
36 #define RED_BLUE_MASK 0x00FF00FF
37 #define GREEN_MASK 0x0000FF00
38
39 #ifdef PI
40 #undef PI
41 #endif
42
43 typedef int (*xbrfunc_t)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs);
44
45 typedef struct XBRContext {
46 const AVClass *class;
47 int n;
48 xbrfunc_t func;
49 uint32_t rgbtoyuv[1<<24];
50 } XBRContext;
51
52 typedef struct ThreadData {
53 AVFrame *in, *out;
54 const uint32_t *rgbtoyuv;
55 } ThreadData;
56
57 #define OFFSET(x) offsetof(XBRContext, x)
58 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
59 static const AVOption xbr_options[] = {
60 { "n", "set scale factor", OFFSET(n), AV_OPT_TYPE_INT, {.i64 = 3}, 2, 4, .flags = FLAGS },
61 { NULL }
62 };
63
64 AVFILTER_DEFINE_CLASS(xbr);
65
66 2704426 static uint32_t pixel_diff(uint32_t x, uint32_t y, const uint32_t *r2y)
67 {
68 #define YMASK 0xff0000
69 #define UMASK 0x00ff00
70 #define VMASK 0x0000ff
71 #define ABSDIFF(a,b) (abs((int)(a)-(int)(b)))
72
73 2704426 uint32_t yuv1 = r2y[x & 0xffffff];
74 2704426 uint32_t yuv2 = r2y[y & 0xffffff];
75
76 2704426 return (ABSDIFF(yuv1 & YMASK, yuv2 & YMASK) >> 16) +
77 5408852 (ABSDIFF(yuv1 & UMASK, yuv2 & UMASK) >> 8) +
78 2704426 ABSDIFF(yuv1 & VMASK, yuv2 & VMASK);
79 }
80
81 #define ALPHA_BLEND_128_W(a, b) ((((a) & LB_MASK) >> 1) + (((b) & LB_MASK) >> 1))
82 #define ALPHA_BLEND_BASE(a, b, m, s) ( (RED_BLUE_MASK & (((a) & RED_BLUE_MASK) + (((((b) & RED_BLUE_MASK) - ((a) & RED_BLUE_MASK)) * (m)) >> (s)))) \
83 | (GREEN_MASK & (((a) & GREEN_MASK) + (((((b) & GREEN_MASK) - ((a) & GREEN_MASK)) * (m)) >> (s)))))
84 #define ALPHA_BLEND_32_W(a, b) ALPHA_BLEND_BASE(a, b, 1, 3)
85 #define ALPHA_BLEND_64_W(a, b) ALPHA_BLEND_BASE(a, b, 1, 2)
86 #define ALPHA_BLEND_192_W(a, b) ALPHA_BLEND_BASE(a, b, 3, 2)
87 #define ALPHA_BLEND_224_W(a, b) ALPHA_BLEND_BASE(a, b, 7, 3)
88
89 #define df(A, B) pixel_diff(A, B, r2y)
90 #define eq(A, B) (df(A, B) < 155)
91
92 #define FILT2(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, \
93 N0, N1, N2, N3) do { \
94 if (PE != PH && PE != PF) { \
95 const unsigned e = df(PE,PC) + df(PE,PG) + df(PI,H5) + df(PI,F4) + (df(PH,PF)<<2); \
96 const unsigned i = df(PH,PD) + df(PH,I5) + df(PF,I4) + df(PF,PB) + (df(PE,PI)<<2); \
97 if (e <= i) { \
98 const unsigned px = df(PE,PF) <= df(PE,PH) ? PF : PH; \
99 if (e < i && (!eq(PF,PB) && !eq(PH,PD) || eq(PE,PI) \
100 && (!eq(PF,I4) && !eq(PH,I5)) \
101 || eq(PE,PG) || eq(PE,PC))) { \
102 const unsigned ke = df(PF,PG); \
103 const unsigned ki = df(PH,PC); \
104 const int left = ke<<1 <= ki && PE != PG && PD != PG; \
105 const int up = ke >= ki<<1 && PE != PC && PB != PC; \
106 if (left && up) { \
107 E[N3] = ALPHA_BLEND_224_W(E[N3], px); \
108 E[N2] = ALPHA_BLEND_64_W( E[N2], px); \
109 E[N1] = E[N2]; \
110 } else if (left) { \
111 E[N3] = ALPHA_BLEND_192_W(E[N3], px); \
112 E[N2] = ALPHA_BLEND_64_W( E[N2], px); \
113 } else if (up) { \
114 E[N3] = ALPHA_BLEND_192_W(E[N3], px); \
115 E[N1] = ALPHA_BLEND_64_W( E[N1], px); \
116 } else { /* diagonal */ \
117 E[N3] = ALPHA_BLEND_128_W(E[N3], px); \
118 } \
119 } else { \
120 E[N3] = ALPHA_BLEND_128_W(E[N3], px); \
121 } \
122 } \
123 } \
124 } while (0)
125
126 #define FILT3(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, \
127 N0, N1, N2, N3, N4, N5, N6, N7, N8) do { \
128 if (PE != PH && PE != PF) { \
129 const unsigned e = df(PE,PC) + df(PE,PG) + df(PI,H5) + df(PI,F4) + (df(PH,PF)<<2); \
130 const unsigned i = df(PH,PD) + df(PH,I5) + df(PF,I4) + df(PF,PB) + (df(PE,PI)<<2); \
131 if (e <= i) { \
132 const unsigned px = df(PE,PF) <= df(PE,PH) ? PF : PH; \
133 if (e < i && (!eq(PF,PB) && !eq(PF,PC) || !eq(PH,PD) && !eq(PH,PG) || eq(PE,PI) \
134 && (!eq(PF,F4) && !eq(PF,I4) || !eq(PH,H5) && !eq(PH,I5)) \
135 || eq(PE,PG) || eq(PE,PC))) { \
136 const unsigned ke = df(PF,PG); \
137 const unsigned ki = df(PH,PC); \
138 const int left = ke<<1 <= ki && PE != PG && PD != PG; \
139 const int up = ke >= ki<<1 && PE != PC && PB != PC; \
140 if (left && up) { \
141 E[N7] = ALPHA_BLEND_192_W(E[N7], px); \
142 E[N6] = ALPHA_BLEND_64_W( E[N6], px); \
143 E[N5] = E[N7]; \
144 E[N2] = E[N6]; \
145 E[N8] = px; \
146 } else if (left) { \
147 E[N7] = ALPHA_BLEND_192_W(E[N7], px); \
148 E[N5] = ALPHA_BLEND_64_W( E[N5], px); \
149 E[N6] = ALPHA_BLEND_64_W( E[N6], px); \
150 E[N8] = px; \
151 } else if (up) { \
152 E[N5] = ALPHA_BLEND_192_W(E[N5], px); \
153 E[N7] = ALPHA_BLEND_64_W( E[N7], px); \
154 E[N2] = ALPHA_BLEND_64_W( E[N2], px); \
155 E[N8] = px; \
156 } else { /* diagonal */ \
157 E[N8] = ALPHA_BLEND_224_W(E[N8], px); \
158 E[N5] = ALPHA_BLEND_32_W( E[N5], px); \
159 E[N7] = ALPHA_BLEND_32_W( E[N7], px); \
160 } \
161 } else { \
162 E[N8] = ALPHA_BLEND_128_W(E[N8], px); \
163 } \
164 } \
165 } \
166 } while (0)
167
168 #define FILT4(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, \
169 N15, N14, N11, N3, N7, N10, N13, N12, N9, N6, N2, N1, N5, N8, N4, N0) do { \
170 if (PE != PH && PE != PF) { \
171 const unsigned e = df(PE,PC) + df(PE,PG) + df(PI,H5) + df(PI,F4) + (df(PH,PF)<<2); \
172 const unsigned i = df(PH,PD) + df(PH,I5) + df(PF,I4) + df(PF,PB) + (df(PE,PI)<<2); \
173 if (e <= i) { \
174 const unsigned px = df(PE,PF) <= df(PE,PH) ? PF : PH; \
175 if (e < i && (!eq(PF,PB) && !eq(PH,PD) || eq(PE,PI) \
176 && (!eq(PF,I4) && !eq(PH,I5)) \
177 || eq(PE,PG) || eq(PE,PC))) { \
178 const unsigned ke = df(PF,PG); \
179 const unsigned ki = df(PH,PC); \
180 const int left = ke<<1 <= ki && PE != PG && PD != PG; \
181 const int up = ke >= ki<<1 && PE != PC && PB != PC; \
182 if (left && up) { \
183 E[N13] = ALPHA_BLEND_192_W(E[N13], px); \
184 E[N12] = ALPHA_BLEND_64_W( E[N12], px); \
185 E[N15] = E[N14] = E[N11] = px; \
186 E[N10] = E[N3] = E[N12]; \
187 E[N7] = E[N13]; \
188 } else if (left) { \
189 E[N11] = ALPHA_BLEND_192_W(E[N11], px); \
190 E[N13] = ALPHA_BLEND_192_W(E[N13], px); \
191 E[N10] = ALPHA_BLEND_64_W( E[N10], px); \
192 E[N12] = ALPHA_BLEND_64_W( E[N12], px); \
193 E[N14] = px; \
194 E[N15] = px; \
195 } else if (up) { \
196 E[N14] = ALPHA_BLEND_192_W(E[N14], px); \
197 E[N7 ] = ALPHA_BLEND_192_W(E[N7 ], px); \
198 E[N10] = ALPHA_BLEND_64_W( E[N10], px); \
199 E[N3 ] = ALPHA_BLEND_64_W( E[N3 ], px); \
200 E[N11] = px; \
201 E[N15] = px; \
202 } else { /* diagonal */ \
203 E[N11] = ALPHA_BLEND_128_W(E[N11], px); \
204 E[N14] = ALPHA_BLEND_128_W(E[N14], px); \
205 E[N15] = px; \
206 } \
207 } else { \
208 E[N15] = ALPHA_BLEND_128_W(E[N15], px); \
209 } \
210 } \
211 } \
212 } while (0)
213
214 54 static av_always_inline void xbr_filter(const ThreadData *td, int jobnr, int nb_jobs, int n)
215 {
216 int x, y;
217 54 const AVFrame *input = td->in;
218 54 AVFrame *output = td->out;
219 54 const uint32_t *r2y = td->rgbtoyuv;
220 54 const int slice_start = (input->height * jobnr ) / nb_jobs;
221 54 const int slice_end = (input->height * (jobnr+1)) / nb_jobs;
222 54 const int nl = output->linesize[0] >> 2;
223 54 const int nl1 = nl + nl;
224 54 const int nl2 = nl1 + nl;
225
226
2/2
✓ Branch 0 taken 1554 times.
✓ Branch 1 taken 54 times.
1608 for (y = slice_start; y < slice_end; y++) {
227
228 1554 uint32_t *E = (uint32_t *)(output->data[0] + y * output->linesize[0] * n);
229 1554 const uint32_t *sa2 = (uint32_t *)(input->data[0] + y * input->linesize[0] - 8); /* center */
230 1554 const uint32_t *sa1 = sa2 - (input->linesize[0]>>2); /* up x1 */
231 1554 const uint32_t *sa0 = sa1 - (input->linesize[0]>>2); /* up x2 */
232 1554 const uint32_t *sa3 = sa2 + (input->linesize[0]>>2); /* down x1 */
233 1554 const uint32_t *sa4 = sa3 + (input->linesize[0]>>2); /* down x2 */
234
235
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1542 times.
1554 if (y <= 1) {
236 12 sa0 = sa1;
237
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 6 times.
12 if (y == 0) {
238 6 sa0 = sa1 = sa2;
239 }
240 }
241
242
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 1542 times.
1554 if (y >= input->height - 2) {
243 12 sa4 = sa3;
244
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 6 times.
12 if (y == input->height - 1) {
245 6 sa4 = sa3 = sa2;
246 }
247 }
248
249
2/2
✓ Branch 0 taken 296814 times.
✓ Branch 1 taken 1554 times.
298368 for (x = 0; x < input->width; x++) {
250 296814 const uint32_t B1 = sa0[2];
251 296814 const uint32_t PB = sa1[2];
252 296814 const uint32_t PE = sa2[2];
253 296814 const uint32_t PH = sa3[2];
254 296814 const uint32_t H5 = sa4[2];
255
256
2/2
✓ Branch 0 taken 295260 times.
✓ Branch 1 taken 1554 times.
296814 const int pprev = 2 - (x > 0);
257 296814 const uint32_t A1 = sa0[pprev];
258 296814 const uint32_t PA = sa1[pprev];
259 296814 const uint32_t PD = sa2[pprev];
260 296814 const uint32_t PG = sa3[pprev];
261 296814 const uint32_t G5 = sa4[pprev];
262
263 296814 const int pprev2 = pprev - (x > 1);
264 296814 const uint32_t A0 = sa1[pprev2];
265 296814 const uint32_t D0 = sa2[pprev2];
266 296814 const uint32_t G0 = sa3[pprev2];
267
268
2/2
✓ Branch 0 taken 1554 times.
✓ Branch 1 taken 295260 times.
296814 const int pnext = 3 - (x == input->width - 1);
269 296814 const uint32_t C1 = sa0[pnext];
270 296814 const uint32_t PC = sa1[pnext];
271 296814 const uint32_t PF = sa2[pnext];
272 296814 const uint32_t PI = sa3[pnext];
273 296814 const uint32_t I5 = sa4[pnext];
274
275 296814 const int pnext2 = pnext + 1 - (x >= input->width - 2);
276 296814 const uint32_t C4 = sa1[pnext2];
277 296814 const uint32_t F4 = sa2[pnext2];
278 296814 const uint32_t I4 = sa3[pnext2];
279
280
2/2
✓ Branch 0 taken 98938 times.
✓ Branch 1 taken 197876 times.
296814 if (n == 2) {
281 98938 E[0] = E[1] = // 0, 1
282 98938 E[nl] = E[nl + 1] = PE; // 2, 3
283
284
44/44
✓ Branch 0 taken 30618 times.
✓ Branch 1 taken 68320 times.
✓ Branch 2 taken 15513 times.
✓ Branch 3 taken 15105 times.
✓ Branch 14 taken 9976 times.
✓ Branch 15 taken 5537 times.
✓ Branch 18 taken 8416 times.
✓ Branch 19 taken 1560 times.
✓ Branch 20 taken 9718 times.
✓ Branch 21 taken 258 times.
✓ Branch 23 taken 4254 times.
✓ Branch 24 taken 5464 times.
✓ Branch 26 taken 1315 times.
✓ Branch 27 taken 2939 times.
✓ Branch 29 taken 3921 times.
✓ Branch 30 taken 2858 times.
✓ Branch 32 taken 724 times.
✓ Branch 33 taken 3197 times.
✓ Branch 35 taken 310 times.
✓ Branch 36 taken 414 times.
✓ Branch 38 taken 1380 times.
✓ Branch 39 taken 4985 times.
✓ Branch 41 taken 826 times.
✓ Branch 42 taken 554 times.
✓ Branch 45 taken 2622 times.
✓ Branch 46 taken 6542 times.
✓ Branch 47 taken 2383 times.
✓ Branch 48 taken 239 times.
✓ Branch 49 taken 1954 times.
✓ Branch 50 taken 429 times.
✓ Branch 51 taken 2875 times.
✓ Branch 52 taken 6289 times.
✓ Branch 53 taken 2645 times.
✓ Branch 54 taken 230 times.
✓ Branch 55 taken 2224 times.
✓ Branch 56 taken 421 times.
✓ Branch 57 taken 1954 times.
✓ Branch 58 taken 7210 times.
✓ Branch 59 taken 427 times.
✓ Branch 60 taken 1527 times.
✓ Branch 61 taken 1527 times.
✓ Branch 62 taken 7210 times.
✓ Branch 63 taken 1797 times.
✓ Branch 64 taken 5413 times.
98938 FILT2(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, 0, 1, nl, nl+1);
285
44/44
✓ Branch 0 taken 31128 times.
✓ Branch 1 taken 67810 times.
✓ Branch 2 taken 15271 times.
✓ Branch 3 taken 15857 times.
✓ Branch 14 taken 8857 times.
✓ Branch 15 taken 6414 times.
✓ Branch 18 taken 7535 times.
✓ Branch 19 taken 1322 times.
✓ Branch 20 taken 8601 times.
✓ Branch 21 taken 256 times.
✓ Branch 23 taken 3557 times.
✓ Branch 24 taken 5044 times.
✓ Branch 26 taken 1221 times.
✓ Branch 27 taken 2336 times.
✓ Branch 29 taken 3484 times.
✓ Branch 30 taken 2781 times.
✓ Branch 32 taken 625 times.
✓ Branch 33 taken 2859 times.
✓ Branch 35 taken 275 times.
✓ Branch 36 taken 350 times.
✓ Branch 38 taken 1404 times.
✓ Branch 39 taken 4511 times.
✓ Branch 41 taken 831 times.
✓ Branch 42 taken 573 times.
✓ Branch 45 taken 2553 times.
✓ Branch 46 taken 5475 times.
✓ Branch 47 taken 2330 times.
✓ Branch 48 taken 223 times.
✓ Branch 49 taken 1943 times.
✓ Branch 50 taken 387 times.
✓ Branch 51 taken 2358 times.
✓ Branch 52 taken 5670 times.
✓ Branch 53 taken 2130 times.
✓ Branch 54 taken 228 times.
✓ Branch 55 taken 1732 times.
✓ Branch 56 taken 398 times.
✓ Branch 57 taken 1943 times.
✓ Branch 58 taken 6085 times.
✓ Branch 59 taken 350 times.
✓ Branch 60 taken 1593 times.
✓ Branch 61 taken 1593 times.
✓ Branch 62 taken 6085 times.
✓ Branch 63 taken 1382 times.
✓ Branch 64 taken 4703 times.
98938 FILT2(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, nl, 0, nl+1, 1);
286
44/44
✓ Branch 0 taken 30618 times.
✓ Branch 1 taken 68320 times.
✓ Branch 2 taken 15560 times.
✓ Branch 3 taken 15058 times.
✓ Branch 14 taken 9908 times.
✓ Branch 15 taken 5652 times.
✓ Branch 18 taken 8384 times.
✓ Branch 19 taken 1524 times.
✓ Branch 20 taken 9653 times.
✓ Branch 21 taken 255 times.
✓ Branch 23 taken 4272 times.
✓ Branch 24 taken 5381 times.
✓ Branch 26 taken 1305 times.
✓ Branch 27 taken 2967 times.
✓ Branch 29 taken 3845 times.
✓ Branch 30 taken 2841 times.
✓ Branch 32 taken 648 times.
✓ Branch 33 taken 3197 times.
✓ Branch 35 taken 297 times.
✓ Branch 36 taken 351 times.
✓ Branch 38 taken 1413 times.
✓ Branch 39 taken 4922 times.
✓ Branch 41 taken 849 times.
✓ Branch 42 taken 564 times.
✓ Branch 45 taken 2445 times.
✓ Branch 46 taken 6644 times.
✓ Branch 47 taken 2237 times.
✓ Branch 48 taken 208 times.
✓ Branch 49 taken 1851 times.
✓ Branch 50 taken 386 times.
✓ Branch 51 taken 2919 times.
✓ Branch 52 taken 6170 times.
✓ Branch 53 taken 2691 times.
✓ Branch 54 taken 228 times.
✓ Branch 55 taken 2322 times.
✓ Branch 56 taken 369 times.
✓ Branch 57 taken 1851 times.
✓ Branch 58 taken 7238 times.
✓ Branch 59 taken 407 times.
✓ Branch 60 taken 1444 times.
✓ Branch 61 taken 1444 times.
✓ Branch 62 taken 7238 times.
✓ Branch 63 taken 1915 times.
✓ Branch 64 taken 5323 times.
98938 FILT2(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, nl+1, nl, 1, 0);
287
44/44
✓ Branch 0 taken 31128 times.
✓ Branch 1 taken 67810 times.
✓ Branch 2 taken 15307 times.
✓ Branch 3 taken 15821 times.
✓ Branch 14 taken 8941 times.
✓ Branch 15 taken 6366 times.
✓ Branch 18 taken 7587 times.
✓ Branch 19 taken 1354 times.
✓ Branch 20 taken 8684 times.
✓ Branch 21 taken 257 times.
✓ Branch 23 taken 3581 times.
✓ Branch 24 taken 5103 times.
✓ Branch 26 taken 1124 times.
✓ Branch 27 taken 2457 times.
✓ Branch 29 taken 3440 times.
✓ Branch 30 taken 2787 times.
✓ Branch 32 taken 631 times.
✓ Branch 33 taken 2809 times.
✓ Branch 35 taken 294 times.
✓ Branch 36 taken 337 times.
✓ Branch 38 taken 1469 times.
✓ Branch 39 taken 4421 times.
✓ Branch 41 taken 847 times.
✓ Branch 42 taken 622 times.
✓ Branch 45 taken 2568 times.
✓ Branch 46 taken 5494 times.
✓ Branch 47 taken 2382 times.
✓ Branch 48 taken 186 times.
✓ Branch 49 taken 1998 times.
✓ Branch 50 taken 384 times.
✓ Branch 51 taken 2353 times.
✓ Branch 52 taken 5709 times.
✓ Branch 53 taken 2168 times.
✓ Branch 54 taken 185 times.
✓ Branch 55 taken 1839 times.
✓ Branch 56 taken 329 times.
✓ Branch 57 taken 1998 times.
✓ Branch 58 taken 6064 times.
✓ Branch 59 taken 427 times.
✓ Branch 60 taken 1571 times.
✓ Branch 61 taken 1571 times.
✓ Branch 62 taken 6064 times.
✓ Branch 63 taken 1412 times.
✓ Branch 64 taken 4652 times.
98938 FILT2(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, 1, nl+1, 0, nl);
288
2/2
✓ Branch 0 taken 98938 times.
✓ Branch 1 taken 98938 times.
197876 } else if (n == 3) {
289 98938 E[0] = E[1] = E[2] = // 0, 1, 2
290 98938 E[nl] = E[nl+1] = E[nl+2] = // 3, 4, 5
291 98938 E[nl1] = E[nl1+1] = E[nl1+2] = PE; // 6, 7, 8
292
293
52/52
✓ Branch 0 taken 30618 times.
✓ Branch 1 taken 68320 times.
✓ Branch 2 taken 15513 times.
✓ Branch 3 taken 15105 times.
✓ Branch 14 taken 9976 times.
✓ Branch 15 taken 5537 times.
✓ Branch 18 taken 8416 times.
✓ Branch 19 taken 1560 times.
✓ Branch 20 taken 9718 times.
✓ Branch 21 taken 258 times.
✓ Branch 23 taken 4254 times.
✓ Branch 24 taken 5464 times.
✓ Branch 26 taken 2181 times.
✓ Branch 27 taken 2073 times.
✓ Branch 29 taken 2640 times.
✓ Branch 30 taken 5005 times.
✓ Branch 32 taken 1326 times.
✓ Branch 33 taken 1314 times.
✓ Branch 35 taken 3698 times.
✓ Branch 36 taken 2633 times.
✓ Branch 38 taken 502 times.
✓ Branch 39 taken 3196 times.
✓ Branch 41 taken 137 times.
✓ Branch 42 taken 365 times.
✓ Branch 44 taken 333 times.
✓ Branch 45 taken 3000 times.
✓ Branch 47 taken 91 times.
✓ Branch 48 taken 242 times.
✓ Branch 50 taken 1366 times.
✓ Branch 51 taken 4358 times.
✓ Branch 53 taken 595 times.
✓ Branch 54 taken 771 times.
✓ Branch 57 taken 2424 times.
✓ Branch 58 taken 6523 times.
✓ Branch 59 taken 2185 times.
✓ Branch 60 taken 239 times.
✓ Branch 61 taken 1745 times.
✓ Branch 62 taken 440 times.
✓ Branch 63 taken 2675 times.
✓ Branch 64 taken 6272 times.
✓ Branch 65 taken 2445 times.
✓ Branch 66 taken 230 times.
✓ Branch 67 taken 2018 times.
✓ Branch 68 taken 427 times.
✓ Branch 69 taken 1745 times.
✓ Branch 70 taken 7202 times.
✓ Branch 71 taken 225 times.
✓ Branch 72 taken 1520 times.
✓ Branch 73 taken 1520 times.
✓ Branch 74 taken 7202 times.
✓ Branch 75 taken 1793 times.
✓ Branch 76 taken 5409 times.
98938 FILT3(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, 0, 1, 2, nl, nl+1, nl+2, nl1, nl1+1, nl1+2);
294
52/52
✓ Branch 0 taken 31128 times.
✓ Branch 1 taken 67810 times.
✓ Branch 2 taken 15271 times.
✓ Branch 3 taken 15857 times.
✓ Branch 14 taken 8857 times.
✓ Branch 15 taken 6414 times.
✓ Branch 18 taken 7535 times.
✓ Branch 19 taken 1322 times.
✓ Branch 20 taken 8601 times.
✓ Branch 21 taken 256 times.
✓ Branch 23 taken 3557 times.
✓ Branch 24 taken 5044 times.
✓ Branch 26 taken 1737 times.
✓ Branch 27 taken 1820 times.
✓ Branch 29 taken 2284 times.
✓ Branch 30 taken 4497 times.
✓ Branch 32 taken 1315 times.
✓ Branch 33 taken 969 times.
✓ Branch 35 taken 3275 times.
✓ Branch 36 taken 2537 times.
✓ Branch 38 taken 407 times.
✓ Branch 39 taken 2868 times.
✓ Branch 41 taken 90 times.
✓ Branch 42 taken 317 times.
✓ Branch 44 taken 307 times.
✓ Branch 45 taken 2651 times.
✓ Branch 47 taken 60 times.
✓ Branch 48 taken 247 times.
✓ Branch 50 taken 1403 times.
✓ Branch 51 taken 3845 times.
✓ Branch 53 taken 656 times.
✓ Branch 54 taken 747 times.
✓ Branch 57 taken 2395 times.
✓ Branch 58 taken 5459 times.
✓ Branch 59 taken 2172 times.
✓ Branch 60 taken 223 times.
✓ Branch 61 taken 1774 times.
✓ Branch 62 taken 398 times.
✓ Branch 63 taken 2209 times.
✓ Branch 64 taken 5645 times.
✓ Branch 65 taken 1981 times.
✓ Branch 66 taken 228 times.
✓ Branch 67 taken 1578 times.
✓ Branch 68 taken 403 times.
✓ Branch 69 taken 1774 times.
✓ Branch 70 taken 6080 times.
✓ Branch 71 taken 191 times.
✓ Branch 72 taken 1583 times.
✓ Branch 73 taken 1583 times.
✓ Branch 74 taken 6080 times.
✓ Branch 75 taken 1387 times.
✓ Branch 76 taken 4693 times.
98938 FILT3(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, nl1, nl, 0, nl1+1, nl+1, 1, nl1+2, nl+2, 2);
295
52/52
✓ Branch 0 taken 30618 times.
✓ Branch 1 taken 68320 times.
✓ Branch 2 taken 15560 times.
✓ Branch 3 taken 15058 times.
✓ Branch 14 taken 9908 times.
✓ Branch 15 taken 5652 times.
✓ Branch 18 taken 8384 times.
✓ Branch 19 taken 1524 times.
✓ Branch 20 taken 9653 times.
✓ Branch 21 taken 255 times.
✓ Branch 23 taken 4272 times.
✓ Branch 24 taken 5381 times.
✓ Branch 26 taken 2235 times.
✓ Branch 27 taken 2037 times.
✓ Branch 29 taken 2612 times.
✓ Branch 30 taken 5004 times.
✓ Branch 32 taken 1307 times.
✓ Branch 33 taken 1305 times.
✓ Branch 35 taken 3663 times.
✓ Branch 36 taken 2648 times.
✓ Branch 38 taken 407 times.
✓ Branch 39 taken 3256 times.
✓ Branch 41 taken 97 times.
✓ Branch 42 taken 310 times.
✓ Branch 44 taken 304 times.
✓ Branch 45 taken 3049 times.
✓ Branch 47 taken 90 times.
✓ Branch 48 taken 214 times.
✓ Branch 50 taken 1433 times.
✓ Branch 51 taken 4354 times.
✓ Branch 53 taken 670 times.
✓ Branch 54 taken 763 times.
✓ Branch 57 taken 2246 times.
✓ Branch 58 taken 6644 times.
✓ Branch 59 taken 2038 times.
✓ Branch 60 taken 208 times.
✓ Branch 61 taken 1639 times.
✓ Branch 62 taken 399 times.
✓ Branch 63 taken 2726 times.
✓ Branch 64 taken 6164 times.
✓ Branch 65 taken 2498 times.
✓ Branch 66 taken 228 times.
✓ Branch 67 taken 2116 times.
✓ Branch 68 taken 382 times.
✓ Branch 69 taken 1639 times.
✓ Branch 70 taken 7251 times.
✓ Branch 71 taken 203 times.
✓ Branch 72 taken 1436 times.
✓ Branch 73 taken 1436 times.
✓ Branch 74 taken 7251 times.
✓ Branch 75 taken 1913 times.
✓ Branch 76 taken 5338 times.
98938 FILT3(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, nl1+2, nl1+1, nl1, nl+2, nl+1, nl, 2, 1, 0);
296
52/52
✓ Branch 0 taken 31128 times.
✓ Branch 1 taken 67810 times.
✓ Branch 2 taken 15307 times.
✓ Branch 3 taken 15821 times.
✓ Branch 14 taken 8941 times.
✓ Branch 15 taken 6366 times.
✓ Branch 18 taken 7587 times.
✓ Branch 19 taken 1354 times.
✓ Branch 20 taken 8684 times.
✓ Branch 21 taken 257 times.
✓ Branch 23 taken 3581 times.
✓ Branch 24 taken 5103 times.
✓ Branch 26 taken 1762 times.
✓ Branch 27 taken 1819 times.
✓ Branch 29 taken 2373 times.
✓ Branch 30 taken 4492 times.
✓ Branch 32 taken 1436 times.
✓ Branch 33 taken 937 times.
✓ Branch 35 taken 3253 times.
✓ Branch 36 taken 2675 times.
✓ Branch 38 taken 457 times.
✓ Branch 39 taken 2796 times.
✓ Branch 41 taken 108 times.
✓ Branch 42 taken 349 times.
✓ Branch 44 taken 298 times.
✓ Branch 45 taken 2606 times.
✓ Branch 47 taken 68 times.
✓ Branch 48 taken 230 times.
✓ Branch 50 taken 1508 times.
✓ Branch 51 taken 3841 times.
✓ Branch 53 taken 689 times.
✓ Branch 54 taken 819 times.
✓ Branch 57 taken 2384 times.
✓ Branch 58 taken 5481 times.
✓ Branch 59 taken 2198 times.
✓ Branch 60 taken 186 times.
✓ Branch 61 taken 1799 times.
✓ Branch 62 taken 399 times.
✓ Branch 63 taken 2157 times.
✓ Branch 64 taken 5708 times.
✓ Branch 65 taken 1972 times.
✓ Branch 66 taken 185 times.
✓ Branch 67 taken 1630 times.
✓ Branch 68 taken 342 times.
✓ Branch 69 taken 1799 times.
✓ Branch 70 taken 6066 times.
✓ Branch 71 taken 224 times.
✓ Branch 72 taken 1575 times.
✓ Branch 73 taken 1575 times.
✓ Branch 74 taken 6066 times.
✓ Branch 75 taken 1406 times.
✓ Branch 76 taken 4660 times.
98938 FILT3(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, 2, nl+2, nl1+2, 1, nl+1, nl1+1, 0, nl, nl1);
297
1/2
✓ Branch 0 taken 98938 times.
✗ Branch 1 not taken.
98938 } else if (n == 4) {
298 98938 E[0] = E[1] = E[2] = E[3] = // 0, 1, 2, 3
299 98938 E[nl] = E[nl+1] = E[nl+2] = E[nl+3] = // 4, 5, 6, 7
300 98938 E[nl1] = E[nl1+1] = E[nl1+2] = E[nl1+3] = // 8, 9, 10, 11
301 98938 E[nl2] = E[nl2+1] = E[nl2+2] = E[nl2+3] = PE; // 12, 13, 14, 15
302
303
44/44
✓ Branch 0 taken 30618 times.
✓ Branch 1 taken 68320 times.
✓ Branch 2 taken 15513 times.
✓ Branch 3 taken 15105 times.
✓ Branch 14 taken 9976 times.
✓ Branch 15 taken 5537 times.
✓ Branch 18 taken 8416 times.
✓ Branch 19 taken 1560 times.
✓ Branch 20 taken 9718 times.
✓ Branch 21 taken 258 times.
✓ Branch 23 taken 4254 times.
✓ Branch 24 taken 5464 times.
✓ Branch 26 taken 1315 times.
✓ Branch 27 taken 2939 times.
✓ Branch 29 taken 3921 times.
✓ Branch 30 taken 2858 times.
✓ Branch 32 taken 724 times.
✓ Branch 33 taken 3197 times.
✓ Branch 35 taken 310 times.
✓ Branch 36 taken 414 times.
✓ Branch 38 taken 1380 times.
✓ Branch 39 taken 4985 times.
✓ Branch 41 taken 826 times.
✓ Branch 42 taken 554 times.
✓ Branch 45 taken 2622 times.
✓ Branch 46 taken 6542 times.
✓ Branch 47 taken 2383 times.
✓ Branch 48 taken 239 times.
✓ Branch 49 taken 1954 times.
✓ Branch 50 taken 429 times.
✓ Branch 51 taken 2875 times.
✓ Branch 52 taken 6289 times.
✓ Branch 53 taken 2645 times.
✓ Branch 54 taken 230 times.
✓ Branch 55 taken 2224 times.
✓ Branch 56 taken 421 times.
✓ Branch 57 taken 1954 times.
✓ Branch 58 taken 7210 times.
✓ Branch 59 taken 427 times.
✓ Branch 60 taken 1527 times.
✓ Branch 61 taken 1527 times.
✓ Branch 62 taken 7210 times.
✓ Branch 63 taken 1797 times.
✓ Branch 64 taken 5413 times.
98938 FILT4(PE, PI, PH, PF, PG, PC, PD, PB, PA, G5, C4, G0, D0, C1, B1, F4, I4, H5, I5, A0, A1, nl2+3, nl2+2, nl1+3, 3, nl+3, nl1+2, nl2+1, nl2, nl1+1, nl+2, 2, 1, nl+1, nl1, nl, 0);
304
44/44
✓ Branch 0 taken 31128 times.
✓ Branch 1 taken 67810 times.
✓ Branch 2 taken 15271 times.
✓ Branch 3 taken 15857 times.
✓ Branch 14 taken 8857 times.
✓ Branch 15 taken 6414 times.
✓ Branch 18 taken 7535 times.
✓ Branch 19 taken 1322 times.
✓ Branch 20 taken 8601 times.
✓ Branch 21 taken 256 times.
✓ Branch 23 taken 3557 times.
✓ Branch 24 taken 5044 times.
✓ Branch 26 taken 1221 times.
✓ Branch 27 taken 2336 times.
✓ Branch 29 taken 3484 times.
✓ Branch 30 taken 2781 times.
✓ Branch 32 taken 625 times.
✓ Branch 33 taken 2859 times.
✓ Branch 35 taken 275 times.
✓ Branch 36 taken 350 times.
✓ Branch 38 taken 1404 times.
✓ Branch 39 taken 4511 times.
✓ Branch 41 taken 831 times.
✓ Branch 42 taken 573 times.
✓ Branch 45 taken 2553 times.
✓ Branch 46 taken 5475 times.
✓ Branch 47 taken 2330 times.
✓ Branch 48 taken 223 times.
✓ Branch 49 taken 1943 times.
✓ Branch 50 taken 387 times.
✓ Branch 51 taken 2358 times.
✓ Branch 52 taken 5670 times.
✓ Branch 53 taken 2130 times.
✓ Branch 54 taken 228 times.
✓ Branch 55 taken 1732 times.
✓ Branch 56 taken 398 times.
✓ Branch 57 taken 1943 times.
✓ Branch 58 taken 6085 times.
✓ Branch 59 taken 350 times.
✓ Branch 60 taken 1593 times.
✓ Branch 61 taken 1593 times.
✓ Branch 62 taken 6085 times.
✓ Branch 63 taken 1382 times.
✓ Branch 64 taken 4703 times.
98938 FILT4(PE, PC, PF, PB, PI, PA, PH, PD, PG, I4, A1, I5, H5, A0, D0, B1, C1, F4, C4, G5, G0, 3, nl+3, 2, 0, 1, nl+2, nl1+3, nl2+3, nl1+2, nl+1, nl, nl1, nl1+1, nl2+2, nl2+1, nl2);
305
44/44
✓ Branch 0 taken 30618 times.
✓ Branch 1 taken 68320 times.
✓ Branch 2 taken 15560 times.
✓ Branch 3 taken 15058 times.
✓ Branch 14 taken 9908 times.
✓ Branch 15 taken 5652 times.
✓ Branch 18 taken 8384 times.
✓ Branch 19 taken 1524 times.
✓ Branch 20 taken 9653 times.
✓ Branch 21 taken 255 times.
✓ Branch 23 taken 4272 times.
✓ Branch 24 taken 5381 times.
✓ Branch 26 taken 1305 times.
✓ Branch 27 taken 2967 times.
✓ Branch 29 taken 3845 times.
✓ Branch 30 taken 2841 times.
✓ Branch 32 taken 648 times.
✓ Branch 33 taken 3197 times.
✓ Branch 35 taken 297 times.
✓ Branch 36 taken 351 times.
✓ Branch 38 taken 1413 times.
✓ Branch 39 taken 4922 times.
✓ Branch 41 taken 849 times.
✓ Branch 42 taken 564 times.
✓ Branch 45 taken 2445 times.
✓ Branch 46 taken 6644 times.
✓ Branch 47 taken 2237 times.
✓ Branch 48 taken 208 times.
✓ Branch 49 taken 1851 times.
✓ Branch 50 taken 386 times.
✓ Branch 51 taken 2919 times.
✓ Branch 52 taken 6170 times.
✓ Branch 53 taken 2691 times.
✓ Branch 54 taken 228 times.
✓ Branch 55 taken 2322 times.
✓ Branch 56 taken 369 times.
✓ Branch 57 taken 1851 times.
✓ Branch 58 taken 7238 times.
✓ Branch 59 taken 407 times.
✓ Branch 60 taken 1444 times.
✓ Branch 61 taken 1444 times.
✓ Branch 62 taken 7238 times.
✓ Branch 63 taken 1915 times.
✓ Branch 64 taken 5323 times.
98938 FILT4(PE, PA, PB, PD, PC, PG, PF, PH, PI, C1, G0, C4, F4, G5, H5, D0, A0, B1, A1, I4, I5, 0, 1, nl, nl2, nl1, nl+1, 2, 3, nl+2, nl1+1, nl2+1, nl2+2, nl1+2, nl+3, nl1+3, nl2+3);
306
44/44
✓ Branch 0 taken 31128 times.
✓ Branch 1 taken 67810 times.
✓ Branch 2 taken 15307 times.
✓ Branch 3 taken 15821 times.
✓ Branch 14 taken 8941 times.
✓ Branch 15 taken 6366 times.
✓ Branch 18 taken 7587 times.
✓ Branch 19 taken 1354 times.
✓ Branch 20 taken 8684 times.
✓ Branch 21 taken 257 times.
✓ Branch 23 taken 3581 times.
✓ Branch 24 taken 5103 times.
✓ Branch 26 taken 1124 times.
✓ Branch 27 taken 2457 times.
✓ Branch 29 taken 3440 times.
✓ Branch 30 taken 2787 times.
✓ Branch 32 taken 631 times.
✓ Branch 33 taken 2809 times.
✓ Branch 35 taken 294 times.
✓ Branch 36 taken 337 times.
✓ Branch 38 taken 1469 times.
✓ Branch 39 taken 4421 times.
✓ Branch 41 taken 847 times.
✓ Branch 42 taken 622 times.
✓ Branch 45 taken 2568 times.
✓ Branch 46 taken 5494 times.
✓ Branch 47 taken 2382 times.
✓ Branch 48 taken 186 times.
✓ Branch 49 taken 1998 times.
✓ Branch 50 taken 384 times.
✓ Branch 51 taken 2353 times.
✓ Branch 52 taken 5709 times.
✓ Branch 53 taken 2168 times.
✓ Branch 54 taken 185 times.
✓ Branch 55 taken 1839 times.
✓ Branch 56 taken 329 times.
✓ Branch 57 taken 1998 times.
✓ Branch 58 taken 6064 times.
✓ Branch 59 taken 427 times.
✓ Branch 60 taken 1571 times.
✓ Branch 61 taken 1571 times.
✓ Branch 62 taken 6064 times.
✓ Branch 63 taken 1412 times.
✓ Branch 64 taken 4652 times.
98938 FILT4(PE, PG, PD, PH, PA, PI, PB, PF, PC, A0, I5, A1, B1, I4, F4, H5, G5, D0, G0, C1, C4, nl2, nl1, nl2+1, nl2+3, nl2+2, nl1+1, nl, 0, nl+1, nl1+2, nl1+3, nl+3, nl+2, 1, 2, 3);
307 }
308
309 296814 sa0 += 1;
310 296814 sa1 += 1;
311 296814 sa2 += 1;
312 296814 sa3 += 1;
313 296814 sa4 += 1;
314
315 296814 E += n;
316 }
317 }
318 54 }
319
320 #define XBR_FUNC(size) \
321 static int xbr##size##x(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \
322 { \
323 xbr_filter(arg, jobnr, nb_jobs, size); \
324 return 0; \
325 }
326
327 18 XBR_FUNC(2)
328 18 XBR_FUNC(3)
329 18 XBR_FUNC(4)
330
331
332 6 static int config_output(AVFilterLink *outlink)
333 {
334 6 AVFilterContext *ctx = outlink->src;
335 6 XBRContext *s = ctx->priv;
336 6 AVFilterLink *inlink = ctx->inputs[0];
337
338 6 outlink->w = inlink->w * s->n;
339 6 outlink->h = inlink->h * s->n;
340 6 return 0;
341 }
342
343 6 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
344 {
345 6 AVFilterContext *ctx = inlink->dst;
346 6 AVFilterLink *outlink = ctx->outputs[0];
347 6 XBRContext *s = ctx->priv;
348 ThreadData td;
349
350 6 AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
351
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
6 if (!out) {
352 av_frame_free(&in);
353 return AVERROR(ENOMEM);
354 }
355
356 6 av_frame_copy_props(out, in);
357
358 6 td.in = in;
359 6 td.out = out;
360 6 td.rgbtoyuv = s->rgbtoyuv;
361 6 ff_filter_execute(ctx, s->func, &td, NULL,
362
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 FFMIN(inlink->h, ff_filter_get_nb_threads(ctx)));
363
364 6 out->width = outlink->w;
365 6 out->height = outlink->h;
366
367 6 av_frame_free(&in);
368 6 return ff_filter_frame(outlink, out);
369 }
370
371 6 static av_cold int init(AVFilterContext *ctx)
372 {
373 6 XBRContext *s = ctx->priv;
374 static const xbrfunc_t xbrfuncs[] = {xbr2x, xbr3x, xbr4x};
375
376 uint32_t c;
377 int bg, rg, g;
378
379
2/2
✓ Branch 0 taken 3066 times.
✓ Branch 1 taken 6 times.
3072 for (bg = -255; bg < 256; bg++) {
380
2/2
✓ Branch 0 taken 1566726 times.
✓ Branch 1 taken 3066 times.
1569792 for (rg = -255; rg < 256; rg++) {
381 1566726 const uint32_t u = (uint32_t)((-169*rg + 500*bg)/1000) + 128;
382 1566726 const uint32_t v = (uint32_t)(( 500*rg - 81*bg)/1000) + 128;
383
6/6
✓ Branch 0 taken 781830 times.
✓ Branch 1 taken 784896 times.
✓ Branch 2 taken 1173510 times.
✓ Branch 3 taken 393216 times.
✓ Branch 4 taken 585990 times.
✓ Branch 5 taken 587520 times.
1566726 int startg = FFMAX3(-bg, -rg, 0);
384
6/6
✓ Branch 0 taken 781830 times.
✓ Branch 1 taken 784896 times.
✓ Branch 2 taken 390150 times.
✓ Branch 3 taken 1176576 times.
✓ Branch 4 taken 587520 times.
✓ Branch 5 taken 589056 times.
1566726 int endg = FFMIN3(255-bg, 255-rg, 255);
385 1566726 uint32_t y = (uint32_t)(( 299*rg + 1000*startg + 114*bg)/1000);
386 1566726 c = bg + rg * (1 << 16) + 0x010101 * startg;
387
2/2
✓ Branch 0 taken 100663296 times.
✓ Branch 1 taken 1566726 times.
102230022 for (g = startg; g <= endg; g++) {
388 100663296 s->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
389 100663296 c+= 0x010101;
390 }
391 }
392 }
393
394 6 s->func = xbrfuncs[s->n - 2];
395 6 return 0;
396 }
397
398 static const AVFilterPad xbr_inputs[] = {
399 {
400 .name = "default",
401 .type = AVMEDIA_TYPE_VIDEO,
402 .filter_frame = filter_frame,
403 },
404 };
405
406 static const AVFilterPad xbr_outputs[] = {
407 {
408 .name = "default",
409 .type = AVMEDIA_TYPE_VIDEO,
410 .config_props = config_output,
411 },
412 };
413
414 const AVFilter ff_vf_xbr = {
415 .name = "xbr",
416 .description = NULL_IF_CONFIG_SMALL("Scale the input using xBR algorithm."),
417 FILTER_INPUTS(xbr_inputs),
418 FILTER_OUTPUTS(xbr_outputs),
419 FILTER_SINGLE_PIXFMT(AV_PIX_FMT_0RGB32),
420 .priv_size = sizeof(XBRContext),
421 .priv_class = &xbr_class,
422 .init = init,
423 .flags = AVFILTER_FLAG_SLICE_THREADS,
424 };
425