vf_yadif.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. /*
  2. * Copyright (C) 2006-2011 Michael Niedermayer <michaelni@gmx.at>
  3. * 2010 James Darnley <james.darnley@gmail.com>
  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. #include "libavutil/avassert.h"
  21. #include "libavutil/cpu.h"
  22. #include "libavutil/common.h"
  23. #include "libavutil/opt.h"
  24. #include "libavutil/pixdesc.h"
  25. #include "libavutil/imgutils.h"
  26. #include "avfilter.h"
  27. #include "formats.h"
  28. #include "internal.h"
  29. #include "video.h"
  30. #include "yadif.h"
  31. typedef struct ThreadData {
  32. AVFrame *frame;
  33. int plane;
  34. int w, h;
  35. int parity;
  36. int tff;
  37. } ThreadData;
  38. #define CHECK(j)\
  39. { int score = FFABS(cur[mrefs - 1 + (j)] - cur[prefs - 1 - (j)])\
  40. + FFABS(cur[mrefs +(j)] - cur[prefs -(j)])\
  41. + FFABS(cur[mrefs + 1 + (j)] - cur[prefs + 1 - (j)]);\
  42. if (score < spatial_score) {\
  43. spatial_score= score;\
  44. spatial_pred= (cur[mrefs +(j)] + cur[prefs -(j)])>>1;\
  45. /* The is_not_edge argument here controls when the code will enter a branch
  46. * which reads up to and including x-3 and x+3. */
  47. #define FILTER(start, end, is_not_edge) \
  48. for (x = start; x < end; x++) { \
  49. int c = cur[mrefs]; \
  50. int d = (prev2[0] + next2[0])>>1; \
  51. int e = cur[prefs]; \
  52. int temporal_diff0 = FFABS(prev2[0] - next2[0]); \
  53. int temporal_diff1 =(FFABS(prev[mrefs] - c) + FFABS(prev[prefs] - e) )>>1; \
  54. int temporal_diff2 =(FFABS(next[mrefs] - c) + FFABS(next[prefs] - e) )>>1; \
  55. int diff = FFMAX3(temporal_diff0 >> 1, temporal_diff1, temporal_diff2); \
  56. int spatial_pred = (c+e) >> 1; \
  57. \
  58. if (is_not_edge) {\
  59. int spatial_score = FFABS(cur[mrefs - 1] - cur[prefs - 1]) + FFABS(c-e) \
  60. + FFABS(cur[mrefs + 1] - cur[prefs + 1]) - 1; \
  61. CHECK(-1) CHECK(-2) }} }} \
  62. CHECK( 1) CHECK( 2) }} }} \
  63. }\
  64. \
  65. if (!(mode&2)) { \
  66. int b = (prev2[2 * mrefs] + next2[2 * mrefs])>>1; \
  67. int f = (prev2[2 * prefs] + next2[2 * prefs])>>1; \
  68. int max = FFMAX3(d - e, d - c, FFMIN(b - c, f - e)); \
  69. int min = FFMIN3(d - e, d - c, FFMAX(b - c, f - e)); \
  70. \
  71. diff = FFMAX3(diff, min, -max); \
  72. } \
  73. \
  74. if (spatial_pred > d + diff) \
  75. spatial_pred = d + diff; \
  76. else if (spatial_pred < d - diff) \
  77. spatial_pred = d - diff; \
  78. \
  79. dst[0] = spatial_pred; \
  80. \
  81. dst++; \
  82. cur++; \
  83. prev++; \
  84. next++; \
  85. prev2++; \
  86. next2++; \
  87. }
  88. static void filter_line_c(void *dst1,
  89. void *prev1, void *cur1, void *next1,
  90. int w, int prefs, int mrefs, int parity, int mode)
  91. {
  92. uint8_t *dst = dst1;
  93. uint8_t *prev = prev1;
  94. uint8_t *cur = cur1;
  95. uint8_t *next = next1;
  96. int x;
  97. uint8_t *prev2 = parity ? prev : cur ;
  98. uint8_t *next2 = parity ? cur : next;
  99. /* The function is called with the pointers already pointing to data[3] and
  100. * with 6 subtracted from the width. This allows the FILTER macro to be
  101. * called so that it processes all the pixels normally. A constant value of
  102. * true for is_not_edge lets the compiler ignore the if statement. */
  103. FILTER(0, w, 1)
  104. }
  105. #define MAX_ALIGN 8
  106. static void filter_edges(void *dst1, void *prev1, void *cur1, void *next1,
  107. int w, int prefs, int mrefs, int parity, int mode)
  108. {
  109. uint8_t *dst = dst1;
  110. uint8_t *prev = prev1;
  111. uint8_t *cur = cur1;
  112. uint8_t *next = next1;
  113. int x;
  114. uint8_t *prev2 = parity ? prev : cur ;
  115. uint8_t *next2 = parity ? cur : next;
  116. /* Only edge pixels need to be processed here. A constant value of false
  117. * for is_not_edge should let the compiler ignore the whole branch. */
  118. FILTER(0, 3, 0)
  119. dst = (uint8_t*)dst1 + w - (MAX_ALIGN-1);
  120. prev = (uint8_t*)prev1 + w - (MAX_ALIGN-1);
  121. cur = (uint8_t*)cur1 + w - (MAX_ALIGN-1);
  122. next = (uint8_t*)next1 + w - (MAX_ALIGN-1);
  123. prev2 = (uint8_t*)(parity ? prev : cur);
  124. next2 = (uint8_t*)(parity ? cur : next);
  125. FILTER(w - (MAX_ALIGN-1), w - 3, 1)
  126. FILTER(w - 3, w, 0)
  127. }
  128. static void filter_line_c_16bit(void *dst1,
  129. void *prev1, void *cur1, void *next1,
  130. int w, int prefs, int mrefs, int parity,
  131. int mode)
  132. {
  133. uint16_t *dst = dst1;
  134. uint16_t *prev = prev1;
  135. uint16_t *cur = cur1;
  136. uint16_t *next = next1;
  137. int x;
  138. uint16_t *prev2 = parity ? prev : cur ;
  139. uint16_t *next2 = parity ? cur : next;
  140. mrefs /= 2;
  141. prefs /= 2;
  142. FILTER(0, w, 1)
  143. }
  144. static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1,
  145. int w, int prefs, int mrefs, int parity, int mode)
  146. {
  147. uint16_t *dst = dst1;
  148. uint16_t *prev = prev1;
  149. uint16_t *cur = cur1;
  150. uint16_t *next = next1;
  151. int x;
  152. uint16_t *prev2 = parity ? prev : cur ;
  153. uint16_t *next2 = parity ? cur : next;
  154. mrefs /= 2;
  155. prefs /= 2;
  156. FILTER(0, 3, 0)
  157. dst = (uint16_t*)dst1 + w - (MAX_ALIGN/2-1);
  158. prev = (uint16_t*)prev1 + w - (MAX_ALIGN/2-1);
  159. cur = (uint16_t*)cur1 + w - (MAX_ALIGN/2-1);
  160. next = (uint16_t*)next1 + w - (MAX_ALIGN/2-1);
  161. prev2 = (uint16_t*)(parity ? prev : cur);
  162. next2 = (uint16_t*)(parity ? cur : next);
  163. FILTER(w - (MAX_ALIGN/2-1), w - 3, 1)
  164. FILTER(w - 3, w, 0)
  165. }
  166. static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
  167. {
  168. YADIFContext *s = ctx->priv;
  169. ThreadData *td = arg;
  170. int refs = s->cur->linesize[td->plane];
  171. int df = (s->csp->comp[td->plane].depth + 7) / 8;
  172. int pix_3 = 3 * df;
  173. int slice_start = (td->h * jobnr ) / nb_jobs;
  174. int slice_end = (td->h * (jobnr+1)) / nb_jobs;
  175. int y;
  176. /* filtering reads 3 pixels to the left/right; to avoid invalid reads,
  177. * we need to call the c variant which avoids this for border pixels
  178. */
  179. for (y = slice_start; y < slice_end; y++) {
  180. if ((y ^ td->parity) & 1) {
  181. uint8_t *prev = &s->prev->data[td->plane][y * refs];
  182. uint8_t *cur = &s->cur ->data[td->plane][y * refs];
  183. uint8_t *next = &s->next->data[td->plane][y * refs];
  184. uint8_t *dst = &td->frame->data[td->plane][y * td->frame->linesize[td->plane]];
  185. int mode = y == 1 || y + 2 == td->h ? 2 : s->mode;
  186. s->filter_line(dst + pix_3, prev + pix_3, cur + pix_3,
  187. next + pix_3, td->w - (3 + MAX_ALIGN/df-1),
  188. y + 1 < td->h ? refs : -refs,
  189. y ? -refs : refs,
  190. td->parity ^ td->tff, mode);
  191. s->filter_edges(dst, prev, cur, next, td->w,
  192. y + 1 < td->h ? refs : -refs,
  193. y ? -refs : refs,
  194. td->parity ^ td->tff, mode);
  195. } else {
  196. memcpy(&td->frame->data[td->plane][y * td->frame->linesize[td->plane]],
  197. &s->cur->data[td->plane][y * refs], td->w * df);
  198. }
  199. }
  200. return 0;
  201. }
  202. static void filter(AVFilterContext *ctx, AVFrame *dstpic,
  203. int parity, int tff)
  204. {
  205. YADIFContext *yadif = ctx->priv;
  206. ThreadData td = { .frame = dstpic, .parity = parity, .tff = tff };
  207. int i;
  208. for (i = 0; i < yadif->csp->nb_components; i++) {
  209. int w = dstpic->width;
  210. int h = dstpic->height;
  211. if (i == 1 || i == 2) {
  212. w = AV_CEIL_RSHIFT(w, yadif->csp->log2_chroma_w);
  213. h = AV_CEIL_RSHIFT(h, yadif->csp->log2_chroma_h);
  214. }
  215. td.w = w;
  216. td.h = h;
  217. td.plane = i;
  218. ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(h, ctx->graph->nb_threads));
  219. }
  220. emms_c();
  221. }
  222. static int return_frame(AVFilterContext *ctx, int is_second)
  223. {
  224. YADIFContext *yadif = ctx->priv;
  225. AVFilterLink *link = ctx->outputs[0];
  226. int tff, ret;
  227. if (yadif->parity == -1) {
  228. tff = yadif->cur->interlaced_frame ?
  229. yadif->cur->top_field_first : 1;
  230. } else {
  231. tff = yadif->parity ^ 1;
  232. }
  233. if (is_second) {
  234. yadif->out = ff_get_video_buffer(link, link->w, link->h);
  235. if (!yadif->out)
  236. return AVERROR(ENOMEM);
  237. av_frame_copy_props(yadif->out, yadif->cur);
  238. yadif->out->interlaced_frame = 0;
  239. }
  240. filter(ctx, yadif->out, tff ^ !is_second, tff);
  241. if (is_second) {
  242. int64_t cur_pts = yadif->cur->pts;
  243. int64_t next_pts = yadif->next->pts;
  244. if (next_pts != AV_NOPTS_VALUE && cur_pts != AV_NOPTS_VALUE) {
  245. yadif->out->pts = cur_pts + next_pts;
  246. } else {
  247. yadif->out->pts = AV_NOPTS_VALUE;
  248. }
  249. }
  250. ret = ff_filter_frame(ctx->outputs[0], yadif->out);
  251. yadif->frame_pending = (yadif->mode&1) && !is_second;
  252. return ret;
  253. }
  254. static int checkstride(YADIFContext *yadif, const AVFrame *a, const AVFrame *b)
  255. {
  256. int i;
  257. for (i = 0; i < yadif->csp->nb_components; i++)
  258. if (a->linesize[i] != b->linesize[i])
  259. return 1;
  260. return 0;
  261. }
  262. static void fixstride(AVFilterLink *link, AVFrame *f)
  263. {
  264. AVFrame *dst = ff_default_get_video_buffer(link, f->width, f->height);
  265. if(!dst)
  266. return;
  267. av_frame_copy_props(dst, f);
  268. av_image_copy(dst->data, dst->linesize,
  269. (const uint8_t **)f->data, f->linesize,
  270. dst->format, dst->width, dst->height);
  271. av_frame_unref(f);
  272. av_frame_move_ref(f, dst);
  273. av_frame_free(&dst);
  274. }
  275. static int filter_frame(AVFilterLink *link, AVFrame *frame)
  276. {
  277. AVFilterContext *ctx = link->dst;
  278. YADIFContext *yadif = ctx->priv;
  279. av_assert0(frame);
  280. if (yadif->frame_pending)
  281. return_frame(ctx, 1);
  282. if (yadif->prev)
  283. av_frame_free(&yadif->prev);
  284. yadif->prev = yadif->cur;
  285. yadif->cur = yadif->next;
  286. yadif->next = frame;
  287. if (!yadif->cur &&
  288. !(yadif->cur = av_frame_clone(yadif->next)))
  289. return AVERROR(ENOMEM);
  290. if (checkstride(yadif, yadif->next, yadif->cur)) {
  291. av_log(ctx, AV_LOG_VERBOSE, "Reallocating frame due to differing stride\n");
  292. fixstride(link, yadif->next);
  293. }
  294. if (checkstride(yadif, yadif->next, yadif->cur))
  295. fixstride(link, yadif->cur);
  296. if (yadif->prev && checkstride(yadif, yadif->next, yadif->prev))
  297. fixstride(link, yadif->prev);
  298. if (checkstride(yadif, yadif->next, yadif->cur) || (yadif->prev && checkstride(yadif, yadif->next, yadif->prev))) {
  299. av_log(ctx, AV_LOG_ERROR, "Failed to reallocate frame\n");
  300. return -1;
  301. }
  302. if (!yadif->prev)
  303. return 0;
  304. if ((yadif->deint && !yadif->cur->interlaced_frame) ||
  305. ctx->is_disabled ||
  306. (yadif->deint && !yadif->prev->interlaced_frame && yadif->prev->repeat_pict) ||
  307. (yadif->deint && !yadif->next->interlaced_frame && yadif->next->repeat_pict)
  308. ) {
  309. yadif->out = av_frame_clone(yadif->cur);
  310. if (!yadif->out)
  311. return AVERROR(ENOMEM);
  312. av_frame_free(&yadif->prev);
  313. if (yadif->out->pts != AV_NOPTS_VALUE)
  314. yadif->out->pts *= 2;
  315. return ff_filter_frame(ctx->outputs[0], yadif->out);
  316. }
  317. yadif->out = ff_get_video_buffer(ctx->outputs[0], link->w, link->h);
  318. if (!yadif->out)
  319. return AVERROR(ENOMEM);
  320. av_frame_copy_props(yadif->out, yadif->cur);
  321. yadif->out->interlaced_frame = 0;
  322. if (yadif->out->pts != AV_NOPTS_VALUE)
  323. yadif->out->pts *= 2;
  324. return return_frame(ctx, 0);
  325. }
  326. static int request_frame(AVFilterLink *link)
  327. {
  328. AVFilterContext *ctx = link->src;
  329. YADIFContext *yadif = ctx->priv;
  330. int ret;
  331. if (yadif->frame_pending) {
  332. return_frame(ctx, 1);
  333. return 0;
  334. }
  335. if (yadif->eof)
  336. return AVERROR_EOF;
  337. ret = ff_request_frame(ctx->inputs[0]);
  338. if (ret == AVERROR_EOF && yadif->cur) {
  339. AVFrame *next = av_frame_clone(yadif->next);
  340. if (!next)
  341. return AVERROR(ENOMEM);
  342. next->pts = yadif->next->pts * 2 - yadif->cur->pts;
  343. filter_frame(ctx->inputs[0], next);
  344. yadif->eof = 1;
  345. } else if (ret < 0) {
  346. return ret;
  347. }
  348. return 0;
  349. }
  350. static av_cold void uninit(AVFilterContext *ctx)
  351. {
  352. YADIFContext *yadif = ctx->priv;
  353. av_frame_free(&yadif->prev);
  354. av_frame_free(&yadif->cur );
  355. av_frame_free(&yadif->next);
  356. }
  357. static int query_formats(AVFilterContext *ctx)
  358. {
  359. static const enum AVPixelFormat pix_fmts[] = {
  360. AV_PIX_FMT_YUV420P,
  361. AV_PIX_FMT_YUV422P,
  362. AV_PIX_FMT_YUV444P,
  363. AV_PIX_FMT_YUV410P,
  364. AV_PIX_FMT_YUV411P,
  365. AV_PIX_FMT_GRAY8,
  366. AV_PIX_FMT_YUVJ420P,
  367. AV_PIX_FMT_YUVJ422P,
  368. AV_PIX_FMT_YUVJ444P,
  369. AV_PIX_FMT_GRAY16,
  370. AV_PIX_FMT_YUV440P,
  371. AV_PIX_FMT_YUVJ440P,
  372. AV_PIX_FMT_YUV420P9,
  373. AV_PIX_FMT_YUV422P9,
  374. AV_PIX_FMT_YUV444P9,
  375. AV_PIX_FMT_YUV420P10,
  376. AV_PIX_FMT_YUV422P10,
  377. AV_PIX_FMT_YUV444P10,
  378. AV_PIX_FMT_YUV420P12,
  379. AV_PIX_FMT_YUV422P12,
  380. AV_PIX_FMT_YUV444P12,
  381. AV_PIX_FMT_YUV420P14,
  382. AV_PIX_FMT_YUV422P14,
  383. AV_PIX_FMT_YUV444P14,
  384. AV_PIX_FMT_YUV420P16,
  385. AV_PIX_FMT_YUV422P16,
  386. AV_PIX_FMT_YUV444P16,
  387. AV_PIX_FMT_YUVA420P,
  388. AV_PIX_FMT_YUVA422P,
  389. AV_PIX_FMT_YUVA444P,
  390. AV_PIX_FMT_GBRP,
  391. AV_PIX_FMT_GBRP9,
  392. AV_PIX_FMT_GBRP10,
  393. AV_PIX_FMT_GBRP12,
  394. AV_PIX_FMT_GBRP14,
  395. AV_PIX_FMT_GBRP16,
  396. AV_PIX_FMT_GBRAP,
  397. AV_PIX_FMT_NONE
  398. };
  399. AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
  400. if (!fmts_list)
  401. return AVERROR(ENOMEM);
  402. return ff_set_common_formats(ctx, fmts_list);
  403. }
  404. static int config_props(AVFilterLink *link)
  405. {
  406. AVFilterContext *ctx = link->src;
  407. YADIFContext *s = ctx->priv;
  408. link->time_base.num = ctx->inputs[0]->time_base.num;
  409. link->time_base.den = ctx->inputs[0]->time_base.den * 2;
  410. link->w = ctx->inputs[0]->w;
  411. link->h = ctx->inputs[0]->h;
  412. if(s->mode & 1)
  413. link->frame_rate = av_mul_q(ctx->inputs[0]->frame_rate,
  414. (AVRational){2, 1});
  415. if (link->w < 3 || link->h < 3) {
  416. av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n");
  417. return AVERROR(EINVAL);
  418. }
  419. s->csp = av_pix_fmt_desc_get(link->format);
  420. if (s->csp->comp[0].depth > 8) {
  421. s->filter_line = filter_line_c_16bit;
  422. s->filter_edges = filter_edges_16bit;
  423. } else {
  424. s->filter_line = filter_line_c;
  425. s->filter_edges = filter_edges;
  426. }
  427. if (ARCH_X86)
  428. ff_yadif_init_x86(s);
  429. return 0;
  430. }
  431. #define OFFSET(x) offsetof(YADIFContext, x)
  432. #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
  433. #define CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit }
  434. static const AVOption yadif_options[] = {
  435. { "mode", "specify the interlacing mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=YADIF_MODE_SEND_FRAME}, 0, 3, FLAGS, "mode"},
  436. CONST("send_frame", "send one frame for each frame", YADIF_MODE_SEND_FRAME, "mode"),
  437. CONST("send_field", "send one frame for each field", YADIF_MODE_SEND_FIELD, "mode"),
  438. CONST("send_frame_nospatial", "send one frame for each frame, but skip spatial interlacing check", YADIF_MODE_SEND_FRAME_NOSPATIAL, "mode"),
  439. CONST("send_field_nospatial", "send one frame for each field, but skip spatial interlacing check", YADIF_MODE_SEND_FIELD_NOSPATIAL, "mode"),
  440. { "parity", "specify the assumed picture field parity", OFFSET(parity), AV_OPT_TYPE_INT, {.i64=YADIF_PARITY_AUTO}, -1, 1, FLAGS, "parity" },
  441. CONST("tff", "assume top field first", YADIF_PARITY_TFF, "parity"),
  442. CONST("bff", "assume bottom field first", YADIF_PARITY_BFF, "parity"),
  443. CONST("auto", "auto detect parity", YADIF_PARITY_AUTO, "parity"),
  444. { "deint", "specify which frames to deinterlace", OFFSET(deint), AV_OPT_TYPE_INT, {.i64=YADIF_DEINT_ALL}, 0, 1, FLAGS, "deint" },
  445. CONST("all", "deinterlace all frames", YADIF_DEINT_ALL, "deint"),
  446. CONST("interlaced", "only deinterlace frames marked as interlaced", YADIF_DEINT_INTERLACED, "deint"),
  447. { NULL }
  448. };
  449. AVFILTER_DEFINE_CLASS(yadif);
  450. static const AVFilterPad avfilter_vf_yadif_inputs[] = {
  451. {
  452. .name = "default",
  453. .type = AVMEDIA_TYPE_VIDEO,
  454. .filter_frame = filter_frame,
  455. },
  456. { NULL }
  457. };
  458. static const AVFilterPad avfilter_vf_yadif_outputs[] = {
  459. {
  460. .name = "default",
  461. .type = AVMEDIA_TYPE_VIDEO,
  462. .request_frame = request_frame,
  463. .config_props = config_props,
  464. },
  465. { NULL }
  466. };
  467. AVFilter ff_vf_yadif = {
  468. .name = "yadif",
  469. .description = NULL_IF_CONFIG_SMALL("Deinterlace the input image."),
  470. .priv_size = sizeof(YADIFContext),
  471. .priv_class = &yadif_class,
  472. .uninit = uninit,
  473. .query_formats = query_formats,
  474. .inputs = avfilter_vf_yadif_inputs,
  475. .outputs = avfilter_vf_yadif_outputs,
  476. .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
  477. };