You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

462 lines
20KB

  1. /*
  2. * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com>
  3. * Copyright (c) 2011 Stefano Sabatini
  4. * Copyright (c) 2010 Baptiste Coudurier
  5. * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com>
  6. *
  7. * This file is part of FFmpeg.
  8. *
  9. * FFmpeg is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * FFmpeg is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with FFmpeg if not, write to the Free Software Foundation, Inc.,
  21. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  22. */
  23. /**
  24. * @file
  25. * temporal field interlace filter, ported from MPlayer/libmpcodecs
  26. */
  27. #include "libavutil/opt.h"
  28. #include "libavutil/imgutils.h"
  29. #include "libavutil/avassert.h"
  30. #include "avfilter.h"
  31. #include "internal.h"
  32. #include "tinterlace.h"
  33. #define OFFSET(x) offsetof(TInterlaceContext, x)
  34. #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
  35. static const AVOption tinterlace_options[] = {
  36. {"mode", "select interlace mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB-1, FLAGS, "mode"},
  37. {"merge", "merge fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE}, INT_MIN, INT_MAX, FLAGS, "mode"},
  38. {"drop_even", "drop even fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_EVEN}, INT_MIN, INT_MAX, FLAGS, "mode"},
  39. {"drop_odd", "drop odd fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_ODD}, INT_MIN, INT_MAX, FLAGS, "mode"},
  40. {"pad", "pad alternate lines with black", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PAD}, INT_MIN, INT_MAX, FLAGS, "mode"},
  41. {"interleave_top", "interleave top and bottom fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"},
  42. {"interleave_bottom", "interleave bottom and top fields", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, "mode"},
  43. {"interlacex2", "interlace fields from two consecutive frames", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLACEX2}, INT_MIN, INT_MAX, FLAGS, "mode"},
  44. {"mergex2", "merge fields keeping same frame rate", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGEX2}, INT_MIN, INT_MAX, FLAGS, "mode"},
  45. {"flags", "set flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = 0}, 0, INT_MAX, 0, "flags" },
  46. {"low_pass_filter", "enable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" },
  47. {"vlpf", "enable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" },
  48. {"complex_filter", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
  49. {"cvlpf", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
  50. {"exact_tb", "force a timebase which can represent timestamps exactly", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_EXACT_TB}, INT_MIN, INT_MAX, FLAGS, "flags" },
  51. {NULL}
  52. };
  53. AVFILTER_DEFINE_CLASS(tinterlace);
  54. #define FULL_SCALE_YUVJ_FORMATS \
  55. AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
  56. static const enum AVPixelFormat full_scale_yuvj_pix_fmts[] = {
  57. FULL_SCALE_YUVJ_FORMATS, AV_PIX_FMT_NONE
  58. };
  59. static const AVRational standard_tbs[] = {
  60. {1, 25},
  61. {1, 30},
  62. {1001, 30000},
  63. };
  64. static int query_formats(AVFilterContext *ctx)
  65. {
  66. static const enum AVPixelFormat pix_fmts[] = {
  67. AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
  68. AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
  69. AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
  70. AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
  71. AV_PIX_FMT_GRAY8, FULL_SCALE_YUVJ_FORMATS,
  72. AV_PIX_FMT_NONE
  73. };
  74. AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
  75. if (!fmts_list)
  76. return AVERROR(ENOMEM);
  77. return ff_set_common_formats(ctx, fmts_list);
  78. }
  79. static void lowpass_line_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
  80. ptrdiff_t mref, ptrdiff_t pref)
  81. {
  82. const uint8_t *srcp_above = srcp + mref;
  83. const uint8_t *srcp_below = srcp + pref;
  84. int i;
  85. for (i = 0; i < width; i++) {
  86. // this calculation is an integer representation of
  87. // '0.5 * current + 0.25 * above + 0.25 * below'
  88. // '1 +' is for rounding.
  89. dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2;
  90. }
  91. }
  92. static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
  93. ptrdiff_t mref, ptrdiff_t pref)
  94. {
  95. const uint8_t *srcp_above = srcp + mref;
  96. const uint8_t *srcp_below = srcp + pref;
  97. const uint8_t *srcp_above2 = srcp + mref * 2;
  98. const uint8_t *srcp_below2 = srcp + pref * 2;
  99. int i, srcp_x, srcp_ab;
  100. for (i = 0; i < width; i++) {
  101. // this calculation is an integer representation of
  102. // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2'
  103. // '4 +' is for rounding.
  104. srcp_x = srcp[i] << 1;
  105. srcp_ab = srcp_above[i] + srcp_below[i];
  106. dstp[i] = av_clip_uint8((4 + ((srcp[i] + srcp_x + srcp_ab) << 1)
  107. - srcp_above2[i] - srcp_below2[i]) >> 3);
  108. // Prevent over-sharpening:
  109. // dst must not exceed src when the average of above and below
  110. // is less than src. And the other way around.
  111. if (srcp_ab > srcp_x) {
  112. if (dstp[i] < srcp[i])
  113. dstp[i] = srcp[i];
  114. } else if (dstp[i] > srcp[i])
  115. dstp[i] = srcp[i];
  116. }
  117. }
  118. static av_cold void uninit(AVFilterContext *ctx)
  119. {
  120. TInterlaceContext *tinterlace = ctx->priv;
  121. av_frame_free(&tinterlace->cur );
  122. av_frame_free(&tinterlace->next);
  123. av_freep(&tinterlace->black_data[0]);
  124. }
  125. static int config_out_props(AVFilterLink *outlink)
  126. {
  127. AVFilterContext *ctx = outlink->src;
  128. AVFilterLink *inlink = outlink->src->inputs[0];
  129. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
  130. TInterlaceContext *tinterlace = ctx->priv;
  131. int i;
  132. tinterlace->vsub = desc->log2_chroma_h;
  133. outlink->w = inlink->w;
  134. outlink->h = tinterlace->mode == MODE_MERGE || tinterlace->mode == MODE_PAD || tinterlace->mode == MODE_MERGEX2?
  135. inlink->h*2 : inlink->h;
  136. if (tinterlace->mode == MODE_MERGE || tinterlace->mode == MODE_PAD || tinterlace->mode == MODE_MERGEX2)
  137. outlink->sample_aspect_ratio = av_mul_q(inlink->sample_aspect_ratio,
  138. av_make_q(2, 1));
  139. if (tinterlace->mode == MODE_PAD) {
  140. uint8_t black[4] = { 16, 128, 128, 16 };
  141. int i, ret;
  142. if (ff_fmt_is_in(outlink->format, full_scale_yuvj_pix_fmts))
  143. black[0] = black[3] = 0;
  144. ret = av_image_alloc(tinterlace->black_data, tinterlace->black_linesize,
  145. outlink->w, outlink->h, outlink->format, 16);
  146. if (ret < 0)
  147. return ret;
  148. /* fill black picture with black */
  149. for (i = 0; i < 4 && tinterlace->black_data[i]; i++) {
  150. int h = i == 1 || i == 2 ? AV_CEIL_RSHIFT(outlink->h, desc->log2_chroma_h) : outlink->h;
  151. memset(tinterlace->black_data[i], black[i],
  152. tinterlace->black_linesize[i] * h);
  153. }
  154. }
  155. if (tinterlace->flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF)
  156. && !(tinterlace->mode == MODE_INTERLEAVE_TOP
  157. || tinterlace->mode == MODE_INTERLEAVE_BOTTOM)) {
  158. av_log(ctx, AV_LOG_WARNING, "low_pass_filter flags ignored with mode %d\n",
  159. tinterlace->mode);
  160. tinterlace->flags &= ~(TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF);
  161. }
  162. tinterlace->preout_time_base = inlink->time_base;
  163. if (tinterlace->mode == MODE_INTERLACEX2) {
  164. tinterlace->preout_time_base.den *= 2;
  165. outlink->frame_rate = av_mul_q(inlink->frame_rate, (AVRational){2,1});
  166. outlink->time_base = av_mul_q(inlink->time_base , (AVRational){1,2});
  167. } else if (tinterlace->mode == MODE_MERGEX2) {
  168. outlink->frame_rate = inlink->frame_rate;
  169. outlink->time_base = inlink->time_base;
  170. } else if (tinterlace->mode != MODE_PAD) {
  171. outlink->frame_rate = av_mul_q(inlink->frame_rate, (AVRational){1,2});
  172. outlink->time_base = av_mul_q(inlink->time_base , (AVRational){2,1});
  173. }
  174. for (i = 0; i<FF_ARRAY_ELEMS(standard_tbs); i++){
  175. if (!av_cmp_q(standard_tbs[i], outlink->time_base))
  176. break;
  177. }
  178. if (i == FF_ARRAY_ELEMS(standard_tbs) ||
  179. (tinterlace->flags & TINTERLACE_FLAG_EXACT_TB))
  180. outlink->time_base = tinterlace->preout_time_base;
  181. if (tinterlace->flags & TINTERLACE_FLAG_CVLPF) {
  182. tinterlace->lowpass_line = lowpass_line_complex_c;
  183. if (ARCH_X86)
  184. ff_tinterlace_init_x86(tinterlace);
  185. } else if (tinterlace->flags & TINTERLACE_FLAG_VLPF) {
  186. tinterlace->lowpass_line = lowpass_line_c;
  187. if (ARCH_X86)
  188. ff_tinterlace_init_x86(tinterlace);
  189. }
  190. av_log(ctx, AV_LOG_VERBOSE, "mode:%d filter:%s h:%d -> h:%d\n", tinterlace->mode,
  191. (tinterlace->flags & TINTERLACE_FLAG_CVLPF) ? "complex" :
  192. (tinterlace->flags & TINTERLACE_FLAG_VLPF) ? "linear" : "off",
  193. inlink->h, outlink->h);
  194. return 0;
  195. }
  196. #define FIELD_UPPER 0
  197. #define FIELD_LOWER 1
  198. #define FIELD_UPPER_AND_LOWER 2
  199. /**
  200. * Copy picture field from src to dst.
  201. *
  202. * @param src_field copy from upper, lower field or both
  203. * @param interleave leave a padding line between each copied line
  204. * @param dst_field copy to upper or lower field,
  205. * only meaningful when interleave is selected
  206. * @param flags context flags
  207. */
  208. static inline
  209. void copy_picture_field(TInterlaceContext *tinterlace,
  210. uint8_t *dst[4], int dst_linesize[4],
  211. const uint8_t *src[4], int src_linesize[4],
  212. enum AVPixelFormat format, int w, int src_h,
  213. int src_field, int interleave, int dst_field,
  214. int flags)
  215. {
  216. const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
  217. int hsub = desc->log2_chroma_w;
  218. int plane, vsub = desc->log2_chroma_h;
  219. int k = src_field == FIELD_UPPER_AND_LOWER ? 1 : 2;
  220. int h;
  221. for (plane = 0; plane < desc->nb_components; plane++) {
  222. int lines = plane == 1 || plane == 2 ? AV_CEIL_RSHIFT(src_h, vsub) : src_h;
  223. int cols = plane == 1 || plane == 2 ? AV_CEIL_RSHIFT( w, hsub) : w;
  224. uint8_t *dstp = dst[plane];
  225. const uint8_t *srcp = src[plane];
  226. int srcp_linesize = src_linesize[plane] * k;
  227. int dstp_linesize = dst_linesize[plane] * (interleave ? 2 : 1);
  228. lines = (lines + (src_field == FIELD_UPPER)) / k;
  229. if (src_field == FIELD_LOWER)
  230. srcp += src_linesize[plane];
  231. if (interleave && dst_field == FIELD_LOWER)
  232. dstp += dst_linesize[plane];
  233. // Low-pass filtering is required when creating an interlaced destination from
  234. // a progressive source which contains high-frequency vertical detail.
  235. // Filtering will reduce interlace 'twitter' and Moire patterning.
  236. if (flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF)) {
  237. int x = !!(flags & TINTERLACE_FLAG_CVLPF);
  238. for (h = lines; h > 0; h--) {
  239. ptrdiff_t pref = src_linesize[plane];
  240. ptrdiff_t mref = -pref;
  241. if (h >= (lines - x)) mref = 0; // there is no line above
  242. else if (h <= (1 + x)) pref = 0; // there is no line below
  243. tinterlace->lowpass_line(dstp, cols, srcp, mref, pref);
  244. dstp += dstp_linesize;
  245. srcp += srcp_linesize;
  246. }
  247. } else {
  248. av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines);
  249. }
  250. }
  251. }
  252. static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
  253. {
  254. AVFilterContext *ctx = inlink->dst;
  255. AVFilterLink *outlink = ctx->outputs[0];
  256. TInterlaceContext *tinterlace = ctx->priv;
  257. AVFrame *cur, *next, *out;
  258. int field, tff, ret;
  259. av_frame_free(&tinterlace->cur);
  260. tinterlace->cur = tinterlace->next;
  261. tinterlace->next = picref;
  262. cur = tinterlace->cur;
  263. next = tinterlace->next;
  264. /* we need at least two frames */
  265. if (!tinterlace->cur)
  266. return 0;
  267. switch (tinterlace->mode) {
  268. case MODE_MERGEX2: /* move the odd frame into the upper field of the new image, even into
  269. * the lower field, generating a double-height video at same framerate */
  270. case MODE_MERGE: /* move the odd frame into the upper field of the new image, even into
  271. * the lower field, generating a double-height video at half framerate */
  272. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  273. if (!out)
  274. return AVERROR(ENOMEM);
  275. av_frame_copy_props(out, cur);
  276. out->height = outlink->h;
  277. out->interlaced_frame = 1;
  278. out->top_field_first = 1;
  279. out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1));
  280. /* write odd frame lines into the upper field of the new frame */
  281. copy_picture_field(tinterlace, out->data, out->linesize,
  282. (const uint8_t **)cur->data, cur->linesize,
  283. inlink->format, inlink->w, inlink->h,
  284. FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_LOWER : FIELD_UPPER : FIELD_UPPER, tinterlace->flags);
  285. /* write even frame lines into the lower field of the new frame */
  286. copy_picture_field(tinterlace, out->data, out->linesize,
  287. (const uint8_t **)next->data, next->linesize,
  288. inlink->format, inlink->w, inlink->h,
  289. FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_UPPER : FIELD_LOWER : FIELD_LOWER, tinterlace->flags);
  290. if (tinterlace->mode != MODE_MERGEX2)
  291. av_frame_free(&tinterlace->next);
  292. break;
  293. case MODE_DROP_ODD: /* only output even frames, odd frames are dropped; height unchanged, half framerate */
  294. case MODE_DROP_EVEN: /* only output odd frames, even frames are dropped; height unchanged, half framerate */
  295. out = av_frame_clone(tinterlace->mode == MODE_DROP_EVEN ? cur : next);
  296. if (!out)
  297. return AVERROR(ENOMEM);
  298. av_frame_free(&tinterlace->next);
  299. break;
  300. case MODE_PAD: /* expand each frame to double height, but pad alternate
  301. * lines with black; framerate unchanged */
  302. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  303. if (!out)
  304. return AVERROR(ENOMEM);
  305. av_frame_copy_props(out, cur);
  306. out->height = outlink->h;
  307. out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1));
  308. field = (1 + tinterlace->frame) & 1 ? FIELD_UPPER : FIELD_LOWER;
  309. /* copy upper and lower fields */
  310. copy_picture_field(tinterlace, out->data, out->linesize,
  311. (const uint8_t **)cur->data, cur->linesize,
  312. inlink->format, inlink->w, inlink->h,
  313. FIELD_UPPER_AND_LOWER, 1, field, tinterlace->flags);
  314. /* pad with black the other field */
  315. copy_picture_field(tinterlace, out->data, out->linesize,
  316. (const uint8_t **)tinterlace->black_data, tinterlace->black_linesize,
  317. inlink->format, inlink->w, inlink->h,
  318. FIELD_UPPER_AND_LOWER, 1, !field, tinterlace->flags);
  319. break;
  320. /* interleave upper/lower lines from odd frames with lower/upper lines from even frames,
  321. * halving the frame rate and preserving image height */
  322. case MODE_INTERLEAVE_TOP: /* top field first */
  323. case MODE_INTERLEAVE_BOTTOM: /* bottom field first */
  324. tff = tinterlace->mode == MODE_INTERLEAVE_TOP;
  325. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  326. if (!out)
  327. return AVERROR(ENOMEM);
  328. av_frame_copy_props(out, cur);
  329. out->interlaced_frame = 1;
  330. out->top_field_first = tff;
  331. /* copy upper/lower field from cur */
  332. copy_picture_field(tinterlace, out->data, out->linesize,
  333. (const uint8_t **)cur->data, cur->linesize,
  334. inlink->format, inlink->w, inlink->h,
  335. tff ? FIELD_UPPER : FIELD_LOWER, 1, tff ? FIELD_UPPER : FIELD_LOWER,
  336. tinterlace->flags);
  337. /* copy lower/upper field from next */
  338. copy_picture_field(tinterlace, out->data, out->linesize,
  339. (const uint8_t **)next->data, next->linesize,
  340. inlink->format, inlink->w, inlink->h,
  341. tff ? FIELD_LOWER : FIELD_UPPER, 1, tff ? FIELD_LOWER : FIELD_UPPER,
  342. tinterlace->flags);
  343. av_frame_free(&tinterlace->next);
  344. break;
  345. case MODE_INTERLACEX2: /* re-interlace preserving image height, double frame rate */
  346. /* output current frame first */
  347. out = av_frame_clone(cur);
  348. if (!out)
  349. return AVERROR(ENOMEM);
  350. out->interlaced_frame = 1;
  351. if (cur->pts != AV_NOPTS_VALUE)
  352. out->pts = cur->pts*2;
  353. out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, outlink->time_base);
  354. if ((ret = ff_filter_frame(outlink, out)) < 0)
  355. return ret;
  356. /* output mix of current and next frame */
  357. tff = next->top_field_first;
  358. out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
  359. if (!out)
  360. return AVERROR(ENOMEM);
  361. av_frame_copy_props(out, next);
  362. out->interlaced_frame = 1;
  363. out->top_field_first = !tff;
  364. if (next->pts != AV_NOPTS_VALUE && cur->pts != AV_NOPTS_VALUE)
  365. out->pts = cur->pts + next->pts;
  366. else
  367. out->pts = AV_NOPTS_VALUE;
  368. /* write current frame second field lines into the second field of the new frame */
  369. copy_picture_field(tinterlace, out->data, out->linesize,
  370. (const uint8_t **)cur->data, cur->linesize,
  371. inlink->format, inlink->w, inlink->h,
  372. tff ? FIELD_LOWER : FIELD_UPPER, 1, tff ? FIELD_LOWER : FIELD_UPPER,
  373. tinterlace->flags);
  374. /* write next frame first field lines into the first field of the new frame */
  375. copy_picture_field(tinterlace, out->data, out->linesize,
  376. (const uint8_t **)next->data, next->linesize,
  377. inlink->format, inlink->w, inlink->h,
  378. tff ? FIELD_UPPER : FIELD_LOWER, 1, tff ? FIELD_UPPER : FIELD_LOWER,
  379. tinterlace->flags);
  380. break;
  381. default:
  382. av_assert0(0);
  383. }
  384. out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, outlink->time_base);
  385. ret = ff_filter_frame(outlink, out);
  386. tinterlace->frame++;
  387. return ret;
  388. }
  389. static const AVFilterPad tinterlace_inputs[] = {
  390. {
  391. .name = "default",
  392. .type = AVMEDIA_TYPE_VIDEO,
  393. .filter_frame = filter_frame,
  394. },
  395. { NULL }
  396. };
  397. static const AVFilterPad tinterlace_outputs[] = {
  398. {
  399. .name = "default",
  400. .type = AVMEDIA_TYPE_VIDEO,
  401. .config_props = config_out_props,
  402. },
  403. { NULL }
  404. };
  405. AVFilter ff_vf_tinterlace = {
  406. .name = "tinterlace",
  407. .description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."),
  408. .priv_size = sizeof(TInterlaceContext),
  409. .uninit = uninit,
  410. .query_formats = query_formats,
  411. .inputs = tinterlace_inputs,
  412. .outputs = tinterlace_outputs,
  413. .priv_class = &tinterlace_class,
  414. };