[PATCH 1/6] reitnerlace - tinterlace-like filter under LGPL
Hello, This is the first part of the first patch. I added interlace options to tinterlace. On the next patch I will delete vf_interlace. Thank you, Vasile Toncu From b2be4e949e071f9017d8a9d6fbd1fbb56505ac50 Mon Sep 17 00:00:00 2001 From: Vasile Toncu <vasile.toncu@tremend.com> Date: Tue, 10 Apr 2018 23:28:32 +0300 Subject: [PATCH] Added interlace options to tinterlace --- libavfilter/Makefile | 2 +- libavfilter/vf_tinterlace.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index a90ca30..586d9c7 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o OBJS-$(CONFIG_IL_FILTER) += vf_il.o OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..5bf384d 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -53,6 +53,15 @@ static const AVOption tinterlace_options[] = { {"complex_filter", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, {"cvlpf", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, {"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" }, + + {"scan", "scanning mode", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"}, + {"tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"}, + {"bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, "mode"}, + + {"lowpass", "set vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags"}, + {"off", "disable low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" }, + {"linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" }, + {"complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, {NULL} }; -- 2.7.4
Hi, 2018-04-10 22:34 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hello,
This is the first part of the first patch. I added interlace options to tinterlace. On the next patch I will delete vf_interlace.
Thank you,
Vasile Toncu
From b2be4e949e071f9017d8a9d6fbd1fbb56505ac50 Mon Sep 17 00:00:00 2001 From: Vasile Toncu <vasile.toncu@tremend.com> Date: Tue, 10 Apr 2018 23:28:32 +0300 Subject: [PATCH] Added interlace options to tinterlace
--- libavfilter/Makefile | 2 +- libavfilter/vf_tinterlace.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/libavfilter/Makefile b/libavfilter/Makefile index a90ca30..586d9c7 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o OBJS-$(CONFIG_IL_FILTER) += vf_il.o OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..5bf384d 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -53,6 +53,15 @@ static const AVOption tinterlace_options[] = { {"complex_filter", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, {"cvlpf", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, {"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" }, + + {"scan", "scanning mode", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"}, + {"tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"}, + {"bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, "mode"}, + + {"lowpass", "set vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags"}, + {"off", "disable low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" }, + {"linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" }, + {"complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
{NULL} }; --
You need to write separate AVOption interlace_options and AVFilter avfilter_vf_interlace in vf_tinterlace.c Have a look at this patch: https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/88e0e2054d911b38662f681b... Regards, Thomas
On 12.04.2018 19:45, Thomas Mundt wrote:
You need to write separate AVOption interlace_options and AVFilter avfilter_vf_interlace in vf_tinterlace.c Have a look at this patch: https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/88e0e2054d911b38662f681b...
Regards, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello, Here is the new patch in accordance with the one that you suggested as a model. Please review it and tell me when should I proceed with the next patch. The next patch will add vf_reinterlace. Thank you, Vasile From b72b643201187bf5d31d7bec9b5064d1b01c8179 Mon Sep 17 00:00:00 2001 From: Vasile Toncu <vasile.toncu@tremend.com> Date: Tue, 17 Apr 2018 13:48:28 +0300 Subject: [PATCH] Removed vf_interlace.c --- libavfilter/Makefile | 2 +- libavfilter/vf_interlace.c | 366 -------------------------------------------- libavfilter/vf_tinterlace.c | 26 ++++ 3 files changed, 27 insertions(+), 367 deletions(-) delete mode 100644 libavfilter/vf_interlace.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 3a9fb02..cfb0f1d 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o OBJS-$(CONFIG_IL_FILTER) += vf_il.o OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c deleted file mode 100644 index 24c422d..0000000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com> - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com> - * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * @file - * progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter - */ - -#include "libavutil/common.h" -#include "libavutil/opt.h" -#include "libavutil/imgutils.h" -#include "libavutil/avassert.h" - -#include "formats.h" -#include "avfilter.h" -#include "interlace.h" -#include "internal.h" -#include "video.h" - -#define OFFSET(x) offsetof(InterlaceContext, x) -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM -static const AVOption interlace_options[] = { - { "scan", "scanning mode", OFFSET(scan), - AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS, .unit = "scan" }, - { "tff", "top field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "bff", "bottom field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "lowpass", "set vertical low-pass filter", OFFSET(lowpass), - AV_OPT_TYPE_INT, {.i64 = VLPF_LIN }, 0, 2, .flags = FLAGS, .unit = "lowpass" }, - { "off", "disable vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_OFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "linear", "linear vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_LIN }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "complex", "complex vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_CMP }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { NULL } -}; - -AVFILTER_DEFINE_CLASS(interlace); - -static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - int i; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2; - } -} - -static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - int i, src_x; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - src_x = av_le2ne16(srcp[i]) << 1; - dstp[i] = av_le2ne16((1 + src_x + av_le2ne16(srcp_above[i]) - + av_le2ne16(srcp_below[i])) >> 2); - } -} - -static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - const uint8_t *srcp_above2 = srcp + mref * 2; - const uint8_t *srcp_below2 = srcp + pref * 2; - int i, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_x = srcp[i] << 1; - src_ab = srcp_above[i] + srcp_below[i]; - dstp[i] = av_clip_uint8((4 + ((srcp[i] + src_x + src_ab) << 1) - - srcp_above2[i] - srcp_below2[i]) >> 3); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dstp[i] < srcp[i]) - dstp[i] = srcp[i]; - } else if (dstp[i] > srcp[i]) - dstp[i] = srcp[i]; - } -} - -static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - const uint16_t *srcp_above2 = srcp + mref; - const uint16_t *srcp_below2 = srcp + pref; - int i, dst_le, src_le, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_le = av_le2ne16(srcp[i]); - src_x = src_le << 1; - src_ab = av_le2ne16(srcp_above[i]) + av_le2ne16(srcp_below[i]); - dst_le = av_clip((4 + ((src_le + src_x + src_ab) << 1) - - av_le2ne16(srcp_above2[i]) - - av_le2ne16(srcp_below2[i])) >> 3, 0, clip_max); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dst_le < src_le) - dstp[i] = av_le2ne16(src_le); - else - dstp[i] = av_le2ne16(dst_le); - } else if (dst_le > src_le) { - dstp[i] = av_le2ne16(src_le); - } else - dstp[i] = av_le2ne16(dst_le); - } -} - -static const enum AVPixelFormat formats_supported[] = { - AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, - AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, - AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV444P10LE, - AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV444P12LE, - AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, - AV_PIX_FMT_YUVA420P10LE, AV_PIX_FMT_YUVA422P10LE, AV_PIX_FMT_YUVA444P10LE, - AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, - AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE -}; - -static int query_formats(AVFilterContext *ctx) -{ - AVFilterFormats *fmts_list = ff_make_format_list(formats_supported); - if (!fmts_list) - return AVERROR(ENOMEM); - return ff_set_common_formats(ctx, fmts_list); -} - -static av_cold void uninit(AVFilterContext *ctx) -{ - InterlaceContext *s = ctx->priv; - - av_frame_free(&s->cur); - av_frame_free(&s->next); -} - -void ff_interlace_init(InterlaceContext *s, int depth) -{ - if (s->lowpass) { - if (s->lowpass == VLPF_LIN) { - if (depth > 8) - s->lowpass_line = lowpass_line_c_16; - else - s->lowpass_line = lowpass_line_c; - } else if (s->lowpass == VLPF_CMP) { - if (depth > 8) - s->lowpass_line = lowpass_line_complex_c_16; - else - s->lowpass_line = lowpass_line_complex_c; - } - if (ARCH_X86) - ff_interlace_init_x86(s, depth); - } -} - -static int config_out_props(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - AVFilterLink *inlink = outlink->src->inputs[0]; - InterlaceContext *s = ctx->priv; - - if (inlink->h < 2) { - av_log(ctx, AV_LOG_ERROR, "input video height is too small\n"); - return AVERROR_INVALIDDATA; - } - - if (!s->lowpass) - av_log(ctx, AV_LOG_WARNING, "Lowpass filter is disabled, " - "the resulting video will be aliased rather than interlaced.\n"); - - // same input size - outlink->w = inlink->w; - outlink->h = inlink->h; - outlink->time_base = inlink->time_base; - outlink->frame_rate = inlink->frame_rate; - // half framerate - outlink->time_base.num *= 2; - outlink->frame_rate.den *= 2; - - s->csp = av_pix_fmt_desc_get(outlink->format); - ff_interlace_init(s, s->csp->comp[0].depth); - - av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n", - s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without"); - - return 0; -} - -static void copy_picture_field(InterlaceContext *s, - AVFrame *src_frame, AVFrame *dst_frame, - AVFilterLink *inlink, enum FieldType field_type, - int lowpass) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); - int hsub = desc->log2_chroma_w; - int vsub = desc->log2_chroma_h; - int plane, j; - - for (plane = 0; plane < desc->nb_components; plane++) { - int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w; - int lines = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h; - uint8_t *dstp = dst_frame->data[plane]; - const uint8_t *srcp = src_frame->data[plane]; - int srcp_linesize = src_frame->linesize[plane] * 2; - int dstp_linesize = dst_frame->linesize[plane] * 2; - int clip_max = (1 << s->csp->comp[plane].depth) - 1; - - av_assert0(cols >= 0 || lines >= 0); - - lines = (lines + (field_type == FIELD_UPPER)) / 2; - if (field_type == FIELD_LOWER) { - srcp += src_frame->linesize[plane]; - dstp += dst_frame->linesize[plane]; - } - if (lowpass) { - int x = 0; - if (lowpass == VLPF_CMP) - x = 1; - for (j = lines; j > 0; j--) { - ptrdiff_t pref = src_frame->linesize[plane]; - ptrdiff_t mref = -pref; - if (j >= (lines - x)) - mref = 0; - else if (j <= (1 + x)) - pref = 0; - s->lowpass_line(dstp, cols, srcp, mref, pref, clip_max); - dstp += dstp_linesize; - srcp += srcp_linesize; - } - } else { - if (s->csp->comp[plane].depth > 8) - cols *= 2; - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines); - } - } -} - -static int filter_frame(AVFilterLink *inlink, AVFrame *buf) -{ - AVFilterContext *ctx = inlink->dst; - AVFilterLink *outlink = ctx->outputs[0]; - InterlaceContext *s = ctx->priv; - AVFrame *out; - int tff, ret; - - av_frame_free(&s->cur); - s->cur = s->next; - s->next = buf; - - /* we need at least two frames */ - if (!s->cur || !s->next) - return 0; - - if (s->cur->interlaced_frame) { - av_log(ctx, AV_LOG_WARNING, - "video is already interlaced, adjusting framerate only\n"); - out = av_frame_clone(s->cur); - if (!out) - return AVERROR(ENOMEM); - out->pts /= 2; // adjust pts to new framerate - ret = ff_filter_frame(outlink, out); - return ret; - } - - tff = (s->scan == MODE_TFF); - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - if (!out) - return AVERROR(ENOMEM); - - av_frame_copy_props(out, s->cur); - out->interlaced_frame = 1; - out->top_field_first = tff; - out->pts /= 2; // adjust pts to new framerate - - /* copy upper/lower field from cur */ - copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass); - av_frame_free(&s->cur); - - /* copy lower/upper field from next */ - copy_picture_field(s, s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass); - av_frame_free(&s->next); - - ret = ff_filter_frame(outlink, out); - - return ret; -} - -static const AVFilterPad inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, - }, - { NULL } -}; - -static const AVFilterPad outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_out_props, - }, - { NULL } -}; - -AVFilter ff_vf_interlace = { - .name = "interlace", - .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), - .uninit = uninit, - .priv_class = &interlace_class, - .priv_size = sizeof(InterlaceContext), - .query_formats = query_formats, - .inputs = inputs, - .outputs = outputs, -}; diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..0e54fe3 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -59,6 +59,20 @@ static const AVOption tinterlace_options[] = { AVFILTER_DEFINE_CLASS(tinterlace); +static const AVOption interlace_options[] = { + { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"}, + { "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" }, + { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"}, + { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0,INT_MAX, 0, "flags" }, + { "off", "disable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, + + { NULL } +}; + +AVFILTER_DEFINE_CLASS(interlace); + #define FULL_SCALE_YUVJ_FORMATS \ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P @@ -525,3 +539,15 @@ AVFilter ff_vf_tinterlace = { .outputs = tinterlace_outputs, .priv_class = &tinterlace_class, }; + + +AVFilter ff_vf_interlace = { + .name = "interlace", + .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), + .priv_size = sizeof(TInterlaceContext), + .uninit = uninit, + .query_formats = query_formats, + .inputs = tinterlace_inputs, + .outputs = tinterlace_outputs, + .priv_class = &interlace_class, +}; -- 2.7.4
On 4/17/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
On 12.04.2018 19:45, Thomas Mundt wrote:
You need to write separate AVOption interlace_options and AVFilter avfilter_vf_interlace in vf_tinterlace.c Have a look at this patch: https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/88e0e2054d911b38662f681b...
Regards, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello,
Here is the new patch in accordance with the one that you suggested as a model. Please review it and tell me when should I proceed with the next patch. The next patch will add vf_reinterlace.
Thank you, Vasile
From b72b643201187bf5d31d7bec9b5064d1b01c8179 Mon Sep 17 00:00:00 2001 From: Vasile Toncu <vasile.toncu@tremend.com> Date: Tue, 17 Apr 2018 13:48:28 +0300 Subject: [PATCH] Removed vf_interlace.c
--- libavfilter/Makefile | 2 +- libavfilter/vf_interlace.c | 366 -------------------------------------------- libavfilter/vf_tinterlace.c | 26 ++++ 3 files changed, 27 insertions(+), 367 deletions(-) delete mode 100644 libavfilter/vf_interlace.c
diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 3a9fb02..cfb0f1d 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o OBJS-$(CONFIG_IL_FILTER) += vf_il.o OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c deleted file mode 100644 index 24c422d..0000000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com> - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com> - * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * @file - * progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter - */ - -#include "libavutil/common.h" -#include "libavutil/opt.h" -#include "libavutil/imgutils.h" -#include "libavutil/avassert.h" - -#include "formats.h" -#include "avfilter.h" -#include "interlace.h" -#include "internal.h" -#include "video.h" - -#define OFFSET(x) offsetof(InterlaceContext, x) -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM -static const AVOption interlace_options[] = { - { "scan", "scanning mode", OFFSET(scan), - AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS, .unit = "scan" }, - { "tff", "top field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "bff", "bottom field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "lowpass", "set vertical low-pass filter", OFFSET(lowpass), - AV_OPT_TYPE_INT, {.i64 = VLPF_LIN }, 0, 2, .flags = FLAGS, .unit = "lowpass" }, - { "off", "disable vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_OFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "linear", "linear vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_LIN }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "complex", "complex vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_CMP }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { NULL } -}; - -AVFILTER_DEFINE_CLASS(interlace); - -static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - int i; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2; - } -} - -static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - int i, src_x; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - src_x = av_le2ne16(srcp[i]) << 1; - dstp[i] = av_le2ne16((1 + src_x + av_le2ne16(srcp_above[i]) - + av_le2ne16(srcp_below[i])) >> 2); - } -} - -static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - const uint8_t *srcp_above2 = srcp + mref * 2; - const uint8_t *srcp_below2 = srcp + pref * 2; - int i, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_x = srcp[i] << 1; - src_ab = srcp_above[i] + srcp_below[i]; - dstp[i] = av_clip_uint8((4 + ((srcp[i] + src_x + src_ab) << 1) - - srcp_above2[i] - srcp_below2[i]) >> 3); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dstp[i] < srcp[i]) - dstp[i] = srcp[i]; - } else if (dstp[i] > srcp[i]) - dstp[i] = srcp[i]; - } -} - -static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - const uint16_t *srcp_above2 = srcp + mref; - const uint16_t *srcp_below2 = srcp + pref; - int i, dst_le, src_le, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_le = av_le2ne16(srcp[i]); - src_x = src_le << 1; - src_ab = av_le2ne16(srcp_above[i]) + av_le2ne16(srcp_below[i]); - dst_le = av_clip((4 + ((src_le + src_x + src_ab) << 1) - - av_le2ne16(srcp_above2[i]) - - av_le2ne16(srcp_below2[i])) >> 3, 0, clip_max); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dst_le < src_le) - dstp[i] = av_le2ne16(src_le); - else - dstp[i] = av_le2ne16(dst_le); - } else if (dst_le > src_le) { - dstp[i] = av_le2ne16(src_le); - } else - dstp[i] = av_le2ne16(dst_le); - } -} - -static const enum AVPixelFormat formats_supported[] = { - AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, - AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, - AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV444P10LE, - AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV444P12LE, - AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, - AV_PIX_FMT_YUVA420P10LE, AV_PIX_FMT_YUVA422P10LE, AV_PIX_FMT_YUVA444P10LE, - AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, - AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE -}; - -static int query_formats(AVFilterContext *ctx) -{ - AVFilterFormats *fmts_list = ff_make_format_list(formats_supported); - if (!fmts_list) - return AVERROR(ENOMEM); - return ff_set_common_formats(ctx, fmts_list); -} - -static av_cold void uninit(AVFilterContext *ctx) -{ - InterlaceContext *s = ctx->priv; - - av_frame_free(&s->cur); - av_frame_free(&s->next); -} - -void ff_interlace_init(InterlaceContext *s, int depth) -{ - if (s->lowpass) { - if (s->lowpass == VLPF_LIN) { - if (depth > 8) - s->lowpass_line = lowpass_line_c_16; - else - s->lowpass_line = lowpass_line_c; - } else if (s->lowpass == VLPF_CMP) { - if (depth > 8) - s->lowpass_line = lowpass_line_complex_c_16; - else - s->lowpass_line = lowpass_line_complex_c; - } - if (ARCH_X86) - ff_interlace_init_x86(s, depth); - } -} - -static int config_out_props(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - AVFilterLink *inlink = outlink->src->inputs[0]; - InterlaceContext *s = ctx->priv; - - if (inlink->h < 2) { - av_log(ctx, AV_LOG_ERROR, "input video height is too small\n"); - return AVERROR_INVALIDDATA; - } - - if (!s->lowpass) - av_log(ctx, AV_LOG_WARNING, "Lowpass filter is disabled, " - "the resulting video will be aliased rather than interlaced.\n"); - - // same input size - outlink->w = inlink->w; - outlink->h = inlink->h; - outlink->time_base = inlink->time_base; - outlink->frame_rate = inlink->frame_rate; - // half framerate - outlink->time_base.num *= 2; - outlink->frame_rate.den *= 2; - - s->csp = av_pix_fmt_desc_get(outlink->format); - ff_interlace_init(s, s->csp->comp[0].depth); - - av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n", - s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without"); - - return 0; -} - -static void copy_picture_field(InterlaceContext *s, - AVFrame *src_frame, AVFrame *dst_frame, - AVFilterLink *inlink, enum FieldType field_type, - int lowpass) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); - int hsub = desc->log2_chroma_w; - int vsub = desc->log2_chroma_h; - int plane, j; - - for (plane = 0; plane < desc->nb_components; plane++) { - int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w; - int lines = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h; - uint8_t *dstp = dst_frame->data[plane]; - const uint8_t *srcp = src_frame->data[plane]; - int srcp_linesize = src_frame->linesize[plane] * 2; - int dstp_linesize = dst_frame->linesize[plane] * 2; - int clip_max = (1 << s->csp->comp[plane].depth) - 1; - - av_assert0(cols >= 0 || lines >= 0); - - lines = (lines + (field_type == FIELD_UPPER)) / 2; - if (field_type == FIELD_LOWER) { - srcp += src_frame->linesize[plane]; - dstp += dst_frame->linesize[plane]; - } - if (lowpass) { - int x = 0; - if (lowpass == VLPF_CMP) - x = 1; - for (j = lines; j > 0; j--) { - ptrdiff_t pref = src_frame->linesize[plane]; - ptrdiff_t mref = -pref; - if (j >= (lines - x)) - mref = 0; - else if (j <= (1 + x)) - pref = 0; - s->lowpass_line(dstp, cols, srcp, mref, pref, clip_max); - dstp += dstp_linesize; - srcp += srcp_linesize; - } - } else { - if (s->csp->comp[plane].depth > 8) - cols *= 2; - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines); - } - } -} - -static int filter_frame(AVFilterLink *inlink, AVFrame *buf) -{ - AVFilterContext *ctx = inlink->dst; - AVFilterLink *outlink = ctx->outputs[0]; - InterlaceContext *s = ctx->priv; - AVFrame *out; - int tff, ret; - - av_frame_free(&s->cur); - s->cur = s->next; - s->next = buf; - - /* we need at least two frames */ - if (!s->cur || !s->next) - return 0; - - if (s->cur->interlaced_frame) { - av_log(ctx, AV_LOG_WARNING, - "video is already interlaced, adjusting framerate only\n"); - out = av_frame_clone(s->cur); - if (!out) - return AVERROR(ENOMEM); - out->pts /= 2; // adjust pts to new framerate - ret = ff_filter_frame(outlink, out); - return ret; - } - - tff = (s->scan == MODE_TFF); - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - if (!out) - return AVERROR(ENOMEM); - - av_frame_copy_props(out, s->cur); - out->interlaced_frame = 1; - out->top_field_first = tff; - out->pts /= 2; // adjust pts to new framerate - - /* copy upper/lower field from cur */ - copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass); - av_frame_free(&s->cur); - - /* copy lower/upper field from next */ - copy_picture_field(s, s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass); - av_frame_free(&s->next); - - ret = ff_filter_frame(outlink, out); - - return ret; -} - -static const AVFilterPad inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, - }, - { NULL } -}; - -static const AVFilterPad outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_out_props, - }, - { NULL } -}; - -AVFilter ff_vf_interlace = { - .name = "interlace", - .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), - .uninit = uninit, - .priv_class = &interlace_class, - .priv_size = sizeof(InterlaceContext), - .query_formats = query_formats, - .inputs = inputs, - .outputs = outputs, -}; diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..0e54fe3 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -59,6 +59,20 @@ static const AVOption tinterlace_options[] = {
AVFILTER_DEFINE_CLASS(tinterlace);
+static const AVOption interlace_options[] = { + { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"}, + { "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" }, + { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"}, + { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0,INT_MAX, 0, "flags" }, + { "off", "disable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, + + { NULL } +}; + +AVFILTER_DEFINE_CLASS(interlace); + #define FULL_SCALE_YUVJ_FORMATS \ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P
@@ -525,3 +539,15 @@ AVFilter ff_vf_tinterlace = { .outputs = tinterlace_outputs, .priv_class = &tinterlace_class, }; + + +AVFilter ff_vf_interlace = { + .name = "interlace", + .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), + .priv_size = sizeof(TInterlaceContext), + .uninit = uninit, + .query_formats = query_formats, + .inputs = tinterlace_inputs, + .outputs = tinterlace_outputs, + .priv_class = &interlace_class, +}; -- 2.7.4
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
lgtm
Hello, Sorry for the late reply, I've been working on other projects. Here is patch 2, which adds vf_reinterlace filter. To my understanding, patch 2 and patch 3 will be merged at the same time, so there is no need to add documentation for reinterlace as it will replace tinterlace. Thank you, Vasile Toncu
Hello, I have updated patch 2, it shall work now. Thank you, Vasile Toncu On Wed, May 30, 2018 at 2:00 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
Sorry for the late reply, I've been working on other projects. Here is patch 2, which adds vf_reinterlace filter. To my understanding, patch 2 and patch 3 will be merged at the same time, so there is no need to add documentation for reinterlace as it will replace tinterlace.
Thank you, Vasile Toncu
Hello, I have updated patch 2, it shall work now. Thank you, Vasile Toncu On Mon, Jul 16, 2018 at 4:49 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
I have updated patch 2, it shall work now.
Thank you, Vasile Toncu
On Wed, May 30, 2018 at 2:00 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
Sorry for the late reply, I've been working on other projects. Here is patch 2, which adds vf_reinterlace filter. To my understanding, patch 2 and patch 3 will be merged at the same time, so there is no need to add documentation for reinterlace as it will replace tinterlace.
Thank you, Vasile Toncu
Fixed tabs. On Mon, Jul 16, 2018 at 4:50 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
I have updated patch 2, it shall work now.
Thank you, Vasile Toncu
On Mon, Jul 16, 2018 at 4:49 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
I have updated patch 2, it shall work now.
Thank you, Vasile Toncu
On Wed, May 30, 2018 at 2:00 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
Sorry for the late reply, I've been working on other projects. Here is patch 2, which adds vf_reinterlace filter. To my understanding, patch 2 and patch 3 will be merged at the same time, so there is no need to add documentation for reinterlace as it will replace tinterlace.
Thank you, Vasile Toncu
Hello, Here is patch 3 which renames reinterlace to tinterlace. Fate tests and warnings should be ok now. In patch 4 I will add the new options to the filter. Thank you, Vasile Toncu
Hello, I've sent a wrong version in the previous email for patch 3. Please ignore. This is the corect one. Have a good day, Vasile Toncu
Hi, 2018-05-30 16:10 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hello,
I've sent a wrong version in the previous email for patch 3. Please ignore. This is the corect one.
the compiler warnings are gone, but fate-filter-pixfmts-tinterlace_pad still fails. Why do you replace the usage of draw utils for generating the black lines in pad mode? It´s not necessary for the relicensing since I implemented their usage in vf_tintelace: https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/58ca446672fec10e851b820c... Regards, Thomas
Hello, I have updated patch 3, it shall work now. Thank you, Vasile Toncu
Hi, Did you have the time to take a look at patches 2 and 3? It's everything fine? Regards, Vasile On Mon, Jul 16, 2018 at 5:51 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
I have updated patch 3, it shall work now.
Thank you, Vasile Toncu
On 7/20/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hi,
Did you have the time to take a look at patches 2 and 3? It's everything fine?
Yes and no, patches have tabs. Please fix that.
Fixed tabs. Thank you for the feedback. On Fri, Jul 20, 2018 at 7:27 PM, Paul B Mahol <onemda@gmail.com> wrote:
On 7/20/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hi,
Did you have the time to take a look at patches 2 and 3? It's everything fine?
Yes and no, patches have tabs. Please fix that. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
What would be the next steps? On Tue, Jul 24, 2018 at 12:17 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Fixed tabs. Thank you for the feedback.
On Fri, Jul 20, 2018 at 7:27 PM, Paul B Mahol <onemda@gmail.com> wrote:
On 7/20/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hi,
Did you have the time to take a look at patches 2 and 3? It's everything fine?
Yes and no, patches have tabs. Please fix that. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
On 7/25/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
What would be the next steps?
Ping patch every second.
2018-07-25 17:11 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
What would be the next steps?
On Tue, Jul 24, 2018 at 12:17 PM, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Fixed tabs. Thank you for the feedback.
On Fri, Jul 20, 2018 at 7:27 PM, Paul B Mahol <onemda@gmail.com> wrote:
On 7/20/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hi,
Did you have the time to take a look at patches 2 and 3? It's everything fine?
Yes and no, patches have tabs. Please fix that.
Please be patient. I´m just back from vacation and full of tasks at work. You took months for the revised patches. Now I need to work into it first.
Hi, 2018-07-24 12:17 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Fixed tabs. Thank you for the feedback.
{....} + case MODE_INTERLEAVE_BOTTOM: + case MODE_INTERLEAVE_TOP: + y = y * 2; + + if (tinterlace->flags & FLAG_VLPF || tinterlace->flags & FLAG_CVLPF) { + + int lines, cols, cvlfp; + AVFrame *from_frame; + uint8_t *from, *to; + int from_step, to_step; + + lines = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? (2 * out->height / y + 1) / 2 : (2 * out->height / y + 0) / 2; + cols = out->width / x; + from_frame = first; + from = from_frame->data[plane]; + to = out->data[plane]; + + if (tinterlace_mode == MODE_INTERLEAVE_BOTTOM) { + from = from + from_frame->linesize[plane]; + to = to + out->linesize[plane]; + } + + from_step = 2 * from_frame->linesize[plane]; + to_step = 2 * out->linesize[plane]; + + // when i = lines - aka first line + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + + cvlfp = !!(tinterlace->flags & FLAG_CVLPF); + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + } + + for (i = lines - 2 - 2 * cvlfp; i; i--) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + } + + // when i == 1 - aka last line + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + } + + + lines = (tinterlace_mode == MODE_INTERLEAVE_BOTTOM) ? ((2 * out->height / y) + 1) / 2 : (2 * out->height / y + 0) / 2; + cols = out->width / x; + from_frame = second; + from = from_frame->data[plane]; + to = out->data[plane]; + + if (tinterlace_mode == MODE_INTERLEAVE_TOP) { + from = from + from_frame->linesize[plane]; + to = to + out->linesize[plane]; } + + from_step = 2 * from_frame->linesize[plane]; + to_step = 2 * out->linesize[plane]; + + // when i = lines + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + } + + + for (i = lines - 2 - 2 * cvlfp; i; i--) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + } + + // when i == 1 + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + }
Compared to the one simple "for"-loop in the GPL version, this looks very complicated. Maybe it´s ok here to just keep the original code since it has been modified in the past anyway. But at least you need to factor it out for not having the same code two times in a row. {....}
+ case MODE_MERGE_TFF: + case MODE_MERGE_BFF: + offset1 = (tinterlace_mode == MODE_MERGE_TFF) ? 0 : out->linesize[plane]; + offset2 = (tinterlace_mode == MODE_MERGE_TFF) ? out->linesize[plane] : 0; + + av_image_copy_plane(out->data[plane] + offset1, 2 * out->linesize[plane], + first->data[plane], first->linesize[plane], first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + offset2, 2 * out->linesize[plane], + second->data[plane], second->linesize[plane], second->width / x, second->height / y); + break;
These are new functions, independent from the license change. Please put them in a separate patch together with documentation and fate tests.
{....} +static TInterlaceThreadData *get_TInterlaceThreadData(AVFrame *out, AVFrame *first, AVFrame *second, + int plane, TInterlaceContext *tinterlace, + int scale_w_plane12_factor, + int scale_h_plane12_factor) { - AVFilterContext *ctx = inlink->dst; - AVFilterLink *outlink = ctx->outputs[0]; - TInterlaceContext *tinterlace = ctx->priv; - AVFrame *cur, *next, *out; - int field, tff, ret; - - av_frame_free(&tinterlace->cur); - tinterlace->cur = tinterlace->next; - tinterlace->next = picref; - - cur = tinterlace->cur; - next = tinterlace->next; - /* we need at least two frames */ - if (!tinterlace->cur) - return 0; - - switch (tinterlace->mode) { - case MODE_MERGEX2: /* move the odd frame into the upper field of the new image, even into - * the lower field, generating a double-height video at same framerate */ - case MODE_MERGE: /* move the odd frame into the upper field of the new image, even into - * the lower field, generating a double-height video at half framerate */ - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + TInterlaceThreadData *rtd = &((TInterlaceThreadData *)tinterlace->thread_data)[plane]; + + if (!rtd) + return rtd; + + rtd->out = out; + rtd->first = first; + rtd->second = second; + rtd->plane = plane; + rtd->tinterlace = tinterlace; + rtd->scale_h_plane12_factor = scale_h_plane12_factor; + rtd->scale_w_plane12_factor = scale_w_plane12_factor; + + return rtd; +}
Threading support is also independent from the lincense change and should be added by a separate patch. {....}
AVFilter ff_vf_tinterlace = { .name = "tinterlace", - .description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."), + .description = NULL_IF_CONFIG_SMALL("Various interlace frame manipulations"), .priv_size = sizeof(TInterlaceContext), + .init = init, .uninit = uninit, .query_formats = query_formats, .inputs = tinterlace_inputs, .outputs = tinterlace_outputs, .priv_class = &tinterlace_class, + .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, };
- AVFilter ff_vf_interlace = { .name = "interlace", .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), .priv_size = sizeof(TInterlaceContext), + .init = init, .uninit = uninit, .query_formats = query_formats, .inputs = tinterlace_inputs,
When you add new flags to vf_tinterlace, please also add them to vf_interlace. {....}
+#elif /* CONFIG_GPL */ + +av_cold void ff_tinterlace_init_x86(ReInterlaceContext *s) {}
ReInterlace? +
+#endif /* CONFIG_GPL */ -- 2.17.1
The rest looks ok to me. Compiler warnings are gone and fate tests passes. However, as stated before, I´m not able to judge the requirements for the license change. Regards, Thomas
Hello, I have updated patch 3 according to review, removed all code related to the new flags (MERGE_TFF, MERGE_BFF) and threading functionality. On Sat, Jul 28, 2018 at 5:04 PM, Thomas Mundt <tmundt75@gmail.com> wrote:
Hi,
2018-07-24 12:17 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Fixed tabs. Thank you for the feedback.
{....} + case MODE_INTERLEAVE_BOTTOM: + case MODE_INTERLEAVE_TOP: + y = y * 2; + + if (tinterlace->flags & FLAG_VLPF || tinterlace->flags & FLAG_CVLPF) { + + int lines, cols, cvlfp; + AVFrame *from_frame; + uint8_t *from, *to; + int from_step, to_step; + + lines = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? (2 * out->height / y + 1) / 2 : (2 * out->height / y + 0) / 2; + cols = out->width / x; + from_frame = first; + from = from_frame->data[plane]; + to = out->data[plane]; + + if (tinterlace_mode == MODE_INTERLEAVE_BOTTOM) { + from = from + from_frame->linesize[plane]; + to = to + out->linesize[plane]; + } + + from_step = 2 * from_frame->linesize[plane]; + to_step = 2 * out->linesize[plane]; + + // when i = lines - aka first line + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + + cvlfp = !!(tinterlace->flags & FLAG_CVLPF); + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + } + + for (i = lines - 2 - 2 * cvlfp; i; i--) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + } + + // when i == 1 - aka last line + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + } + + + lines = (tinterlace_mode == MODE_INTERLEAVE_BOTTOM) ? ((2 * out->height / y) + 1) / 2 : (2 * out->height / y + 0) / 2; + cols = out->width / x; + from_frame = second; + from = from_frame->data[plane]; + to = out->data[plane]; + + if (tinterlace_mode == MODE_INTERLEAVE_TOP) { + from = from + from_frame->linesize[plane]; + to = to + out->linesize[plane]; } + + from_step = 2 * from_frame->linesize[plane]; + to_step = 2 * out->linesize[plane]; + + // when i = lines + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], 0, clip_max); + to += to_step; + from += from_step; + } + + + for (i = lines - 2 - 2 * cvlfp; i; i--) { + tinterlace->lowpass_line(to, cols, from, from_frame->linesize[plane], -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + } + + // when i == 1 + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + + if (cvlfp) { + tinterlace->lowpass_line(to, cols, from, 0, -from_frame->linesize[plane], clip_max); + to += to_step; + from += from_step; + }
Compared to the one simple "for"-loop in the GPL version, this looks very complicated. Maybe it´s ok here to just keep the original code since it has been modified in the past anyway. But at least you need to factor it out for not having the same code two times in a row.
{....}
+ case MODE_MERGE_TFF: + case MODE_MERGE_BFF: + offset1 = (tinterlace_mode == MODE_MERGE_TFF) ? 0 : out->linesize[plane]; + offset2 = (tinterlace_mode == MODE_MERGE_TFF) ? out->linesize[plane] : 0; + + av_image_copy_plane(out->data[plane] + offset1, 2 * out->linesize[plane], + first->data[plane], first->linesize[plane], first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + offset2, 2 * out->linesize[plane], + second->data[plane], second->linesize[plane], second->width / x, second->height / y); + break;
These are new functions, independent from the license change. Please put them in a separate patch together with documentation and fate tests.
{....} +static TInterlaceThreadData *get_TInterlaceThreadData(AVFrame *out, AVFrame *first, AVFrame *second, + int plane, TInterlaceContext *tinterlace, + int scale_w_plane12_factor, + int scale_h_plane12_factor) { - AVFilterContext *ctx = inlink->dst; - AVFilterLink *outlink = ctx->outputs[0]; - TInterlaceContext *tinterlace = ctx->priv; - AVFrame *cur, *next, *out; - int field, tff, ret; - - av_frame_free(&tinterlace->cur); - tinterlace->cur = tinterlace->next; - tinterlace->next = picref; - - cur = tinterlace->cur; - next = tinterlace->next; - /* we need at least two frames */ - if (!tinterlace->cur) - return 0; - - switch (tinterlace->mode) { - case MODE_MERGEX2: /* move the odd frame into the upper field of the new image, even into - * the lower field, generating a double-height video at same framerate */ - case MODE_MERGE: /* move the odd frame into the upper field of the new image, even into - * the lower field, generating a double-height video at half framerate */ - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); + TInterlaceThreadData *rtd = &((TInterlaceThreadData *)tinterlace->thread_data)[plane]; + + if (!rtd) + return rtd; + + rtd->out = out; + rtd->first = first; + rtd->second = second; + rtd->plane = plane; + rtd->tinterlace = tinterlace; + rtd->scale_h_plane12_factor = scale_h_plane12_factor; + rtd->scale_w_plane12_factor = scale_w_plane12_factor; + + return rtd; +}
Threading support is also independent from the lincense change and should be added by a separate patch.
{....}
AVFilter ff_vf_tinterlace = { .name = "tinterlace", - .description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."), + .description = NULL_IF_CONFIG_SMALL("Various interlace frame manipulations"), .priv_size = sizeof(TInterlaceContext), + .init = init, .uninit = uninit, .query_formats = query_formats, .inputs = tinterlace_inputs, .outputs = tinterlace_outputs, .priv_class = &tinterlace_class, + .flags = AVFILTER_FLAG_SLICE_THREADS | AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, };
- AVFilter ff_vf_interlace = { .name = "interlace", .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), .priv_size = sizeof(TInterlaceContext), + .init = init, .uninit = uninit, .query_formats = query_formats, .inputs = tinterlace_inputs,
When you add new flags to vf_tinterlace, please also add them to vf_interlace.
{....}
+#elif /* CONFIG_GPL */ + +av_cold void ff_tinterlace_init_x86(ReInterlaceContext *s) {}
ReInterlace?
+
+#endif /* CONFIG_GPL */ -- 2.17.1
The rest looks ok to me. Compiler warnings are gone and fate tests passes. However, as stated before, I´m not able to judge the requirements for the license change.
Regards, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hi, 2018-08-13 0:02 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hello,
I have updated patch 3 according to review, removed all code related to the new flags (MERGE_TFF, MERGE_BFF) and threading functionality.
Thanks, your patch looks fine to me now. There is just one thing, I forgot to mention last review:
{....} - if (tinterlace->flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF) - && !(tinterlace->mode == MODE_INTERLEAVE_TOP - || tinterlace->mode == MODE_INTERLEAVE_BOTTOM)) { - av_log(ctx, AV_LOG_WARNING, "low_pass_filter flags ignored with mode %d\n", - tinterlace->mode);
{....} + if (tinterlace->flags & FLAG_VLPF || tinterlace->flags & FLAG_CVLPF) {
- av_log(ctx, AV_LOG_VERBOSE, "mode:%d filter:%s h:%d -> h:%d\n", tinterlace->mode, - (tinterlace->flags & TINTERLACE_FLAG_CVLPF) ? "complex" : - (tinterlace->flags & TINTERLACE_FLAG_VLPF) ? "linear" : "off", - inlink->h, outlink->h);
Please keep the log messages. Nothing should change for the user. Regards, Thomas
Hi Thomas, I added the log messages. Thanks for the review. On Tue, Aug 14, 2018 at 3:23 PM, Thomas Mundt <tmundt75@gmail.com> wrote:
Hi,
2018-08-13 0:02 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hello,
I have updated patch 3 according to review, removed all code related to the new flags (MERGE_TFF, MERGE_BFF) and threading functionality.
Thanks, your patch looks fine to me now. There is just one thing, I forgot to mention last review:
{....} - if (tinterlace->flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF) - && !(tinterlace->mode == MODE_INTERLEAVE_TOP - || tinterlace->mode == MODE_INTERLEAVE_BOTTOM)) { - av_log(ctx, AV_LOG_WARNING, "low_pass_filter flags ignored with mode %d\n", - tinterlace->mode);
{....} + if (tinterlace->flags & FLAG_VLPF || tinterlace->flags & FLAG_CVLPF) {
- av_log(ctx, AV_LOG_VERBOSE, "mode:%d filter:%s h:%d -> h:%d\n", tinterlace->mode, - (tinterlace->flags & TINTERLACE_FLAG_CVLPF) ? "complex" : - (tinterlace->flags & TINTERLACE_FLAG_VLPF) ? "linear" : "off", - inlink->h, outlink->h);
Please keep the log messages. Nothing should change for the user.
Regards, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hi, 2018-08-14 18:53 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hi Thomas,
I added the log messages.
Thanks for the review.
I found some more time for testing this evening. Unfortunately there are still issues. I get half green pictures with some modes at high bit depth. But the fix is easy. The bytewidth in all av_image_copy_plane functions need to be adapted for high bit depths. {....}
const AVPixFmtDescriptor *fmt_desc = av_pix_fmt_desc_get(out->format); int mult = (fmt_desc->comp[0].depth > 8 ? 2 : 1);
You used the calculated "mult" in the av_image_copy_plane functions of MODE_MERGE and MODE_PAD only. And forgot the others:
{....}
+ case MODE_INTERLEAVE_BOTTOM:
+ case MODE_INTERLEAVE_TOP: + y = y * 2; + + if (tinterlace->flags & FLAG_VLPF || tinterlace->flags & FLAG_CVLPF) { + int clip_max = (1 << fmt_desc->comp[plane].depth) - 1; + + interleave_filter_frame(tinterlace, first, out, plane, !!(tinterlace->flags & FLAG_CVLPF), tinterlace_mode == MODE_INTERLEAVE_TOP, x, y, clip_max); + interleave_filter_frame(tinterlace, second, out, plane, !!(tinterlace->flags & FLAG_CVLPF), tinterlace_mode == MODE_INTERLEAVE_BOTTOM, x, y, clip_max); } else { - if (tinterlace->csp->comp[plane].depth > 8) - cols *= 2; - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines); + offset1 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? 0 : out->linesize[plane]; + offset2 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? 0 : first->linesize[plane]; + offset3 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? out->linesize[plane] : 0; + offset4 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? second->linesize[plane] : 0; + + av_image_copy_plane(out->data[plane] + offset1, 2 * out->linesize[plane], + first->data[plane] + offset2, 2 * first->linesize[plane], + first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + offset3, 2 * out->linesize[plane], + second->data[plane] + offset4, 2 * second->linesize[plane], + second->width / x, second->height / y);
Here }
+ break; + + case MODE_INTERLACE_X2: + y = y * 2; + + offset1 = 0; offset2 = 0; + offset3 = out->linesize[plane]; + offset4 = second->linesize[plane]; + + if (second->interlaced_frame && second->top_field_first) { + offset1 = out->linesize[plane]; + offset2 = first->linesize[plane]; + offset3 = 0; offset4 = 0; + } + + av_image_copy_plane(out->data[plane] + offset1, 2 * out->linesize[plane], + first->data[plane] + offset2, 2 * first->linesize[plane], + first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + offset3, 2 * out->linesize[plane], + second->data[plane] + offset4, 2 * second->linesize[plane], + second->width / x, second->height / y);
Here + break;
+ + case MODE_MERGE_X2: + if (IS_ODD(tinterlace->current_frame_index - 1)) { + av_image_copy_plane(out->data[plane], 2 * out->linesize[plane], + second->data[plane], second->linesize[plane], second->width / x, second->height / y); + av_image_copy_plane(out->data[plane] + out->linesize[plane], 2 * out->linesize[plane], + first->data[plane], first->linesize[plane], first->width / x, first->height / y); + } else { + av_image_copy_plane(out->data[plane], 2 * out->linesize[plane], + first->data[plane], first->linesize[plane], first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + out->linesize[plane], 2 * out->linesize[plane], + second->data[plane], second->linesize[plane], second->width / x, second->height / y);
Here. Sorry for the piecemeal. Regards, Thomas
Hi, Thank you for the additional testing effort. Fixed the issue. On Tue, Aug 14, 2018 at 10:25 PM, Thomas Mundt <tmundt75@gmail.com> wrote:
Hi,
2018-08-14 18:53 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hi Thomas,
I added the log messages.
Thanks for the review.
I found some more time for testing this evening. Unfortunately there are still issues. I get half green pictures with some modes at high bit depth. But the fix is easy. The bytewidth in all av_image_copy_plane functions need to be adapted for high bit depths.
{....}
const AVPixFmtDescriptor *fmt_desc = av_pix_fmt_desc_get(out->
format);
int mult = (fmt_desc->comp[0].depth > 8 ? 2 : 1);
You used the calculated "mult" in the av_image_copy_plane functions of MODE_MERGE and MODE_PAD only. And forgot the others:
{....}
+ case MODE_INTERLEAVE_BOTTOM:
+ case MODE_INTERLEAVE_TOP: + y = y * 2; + + if (tinterlace->flags & FLAG_VLPF || tinterlace->flags & FLAG_CVLPF) { + int clip_max = (1 << fmt_desc->comp[plane].depth) - 1; + + interleave_filter_frame(tinterlace, first, out, plane, !!(tinterlace->flags & FLAG_CVLPF), tinterlace_mode == MODE_INTERLEAVE_TOP, x, y, clip_max); + interleave_filter_frame(tinterlace, second, out, plane, !!(tinterlace->flags & FLAG_CVLPF), tinterlace_mode == MODE_INTERLEAVE_BOTTOM, x, y, clip_max); } else { - if (tinterlace->csp->comp[plane].depth > 8) - cols *= 2; - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines); + offset1 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? 0 : out->linesize[plane]; + offset2 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? 0 : first->linesize[plane]; + offset3 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? out->linesize[plane] : 0; + offset4 = (tinterlace_mode == MODE_INTERLEAVE_TOP) ? second->linesize[plane] : 0; + + av_image_copy_plane(out->data[plane] + offset1, 2 * out->linesize[plane], + first->data[plane] + offset2, 2 * first->linesize[plane], + first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + offset3, 2 * out->linesize[plane], + second->data[plane] + offset4, 2 * second->linesize[plane], + second->width / x, second->height / y);
Here
}
+ break; + + case MODE_INTERLACE_X2: + y = y * 2; + + offset1 = 0; offset2 = 0; + offset3 = out->linesize[plane]; + offset4 = second->linesize[plane]; + + if (second->interlaced_frame && second->top_field_first) { + offset1 = out->linesize[plane]; + offset2 = first->linesize[plane]; + offset3 = 0; offset4 = 0; + } + + av_image_copy_plane(out->data[plane] + offset1, 2 * out->linesize[plane], + first->data[plane] + offset2, 2 * first->linesize[plane], + first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + offset3, 2 * out->linesize[plane], + second->data[plane] + offset4, 2 * second->linesize[plane], + second->width / x, second->height / y);
Here
+ break;
+ + case MODE_MERGE_X2: + if (IS_ODD(tinterlace->current_frame_index - 1)) { + av_image_copy_plane(out->data[plane], 2 * out->linesize[plane], + second->data[plane], second->linesize[plane], second->width / x, second->height / y); + av_image_copy_plane(out->data[plane] + out->linesize[plane], 2 * out->linesize[plane], + first->data[plane], first->linesize[plane], first->width / x, first->height / y); + } else { + av_image_copy_plane(out->data[plane], 2 * out->linesize[plane], + first->data[plane], first->linesize[plane], first->width / x, first->height / y); + av_image_copy_plane(out->data[plane] + out->linesize[plane], 2 * out->linesize[plane], + second->data[plane], second->linesize[plane], second->width / x, second->height / y);
Here.
Sorry for the piecemeal.
Regards, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hi, 2018-08-16 13:56 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hi,
Thank you for the additional testing effort. Fixed the issue.
thanks, the patch looks good to me as far as I can judge. It´s up to more experienced developers now to permit the license change. Can anybody please have a look at this. Regards, Thomas
* Can one simply change the tinterlace from GPL to LGPL?
Hello, Thank you Thomas for the reviews and support! The proposed actions, by Nicolas George in https://ffmpeg.org/pipermail/ffmpeg-devel/2017-December/223072.html, were taken. * Of course not. There are two non-simple courses of action to achieve it: - Get the approval of all copyright holders. It has been done in the past for other filters. - Remove the GPL tinterlace and at the same time add a new LGPL filter that does the same thing and is also called tinterlace. Only two contributors approved until now, Thomas Mundt and Stefano Sebatini, while Baptiste Coudurier and Michael Zucchi could not be reached. Also, the new implementation supports all the features from the old tinterlace and conditionally (at compile time) the same ASM optimizations are used, but only if CONFIG_GPL is defined. Is there any way we can proceed with this patch? Best regards. On Fri, Aug 17, 2018 at 5:24 PM, Thomas Mundt <tmundt75@gmail.com> wrote:
Hi,
2018-08-16 13:56 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hi,
Thank you for the additional testing effort. Fixed the issue.
thanks, the patch looks good to me as far as I can judge. It´s up to more experienced developers now to permit the license change. Can anybody please have a look at this.
Regards, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello, Still Baptiste Coudurier and Michael Zucchi could not be reached, however since the old GPL tinterlace was replaced with a new LGPL implementation aren't we on the second course of action recommended by Nicolas George? And by that means can we change the license of this implementation without the approval of the original contributors whose code was removed? Maybe someone else can have a look at the new implementation and provide the necessary feedback in order to merge this patch and unblock the development of the patches with new functionalities. Thank you. Best regards. On Mon, Sep 17, 2018 at 8:28 AM, Vasile Toncu <vasile.toncu@tremend.com> wrote: > Hello, > > Thank you Thomas for the reviews and support! > > The proposed actions, by Nicolas George in https://ffmpeg.org/pipermail/ > ffmpeg-devel/2017-December/223072.html, were taken. > > >* Can one simply change the tinterlace from GPL to LGPL? > * > Of course not. There are two non-simple courses of action to achieve it: > > - Get the approval of all copyright holders. It has been done in the > past for other filters. > > - Remove the GPL tinterlace and at the same time add a new LGPL filter > that does the same thing and is also called tinterlace. > > > Only two contributors approved until now, Thomas Mundt and Stefano > Sebatini, while Baptiste Coudurier and Michael Zucchi could not be reached. > Also, the new implementation supports all the features from the old > tinterlace and conditionally (at compile time) the same ASM optimizations > are used, but only if CONFIG_GPL is defined. > > Is there any way we can proceed with this patch? > > Best regards. > > > On Fri, Aug 17, 2018 at 5:24 PM, Thomas Mundt <tmundt75@gmail.com> wrote: > >> Hi, >> >> 2018-08-16 13:56 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>: >> >> > Hi, >> > >> > Thank you for the additional testing effort. >> > Fixed the issue. >> > >> > >> thanks, the patch looks good to me as far as I can judge. >> It´s up to more experienced developers now to permit the license change. >> Can anybody please have a look at this. >> >> Regards, >> Thomas >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> > >
Hi, Since this patch is passing all the current tests, all the modification required by Thomas were implemented and from our point of view it satisfies all requirements for adding the double license to the filter, please approve this patch for integration. Also, there are two more patches blocked at the moment. This two patches add new features and improvements for the filter. Thank you. Regards. On Tue, Oct 16, 2018 at 6:40 PM Vasile Toncu <vasile.toncu@tremend.com> wrote: > Hello, > > Still Baptiste Coudurier and Michael Zucchi could not be reached, however > since the old GPL tinterlace was replaced with a new LGPL implementation > aren't we on the second course of action recommended by Nicolas George? And > by that means can we change the license of this implementation without the > approval of the original contributors whose code was removed? > Maybe someone else can have a look at the new implementation and provide > the necessary feedback in order to merge this patch and unblock the > development of the patches with new functionalities. > > Thank you. > Best regards. > > > > On Mon, Sep 17, 2018 at 8:28 AM, Vasile Toncu <vasile.toncu@tremend.com> > wrote: > >> Hello, >> >> Thank you Thomas for the reviews and support! >> >> The proposed actions, by Nicolas George in >> https://ffmpeg.org/pipermail/ffmpeg-devel/2017-December/223072.html, >> were taken. >> >> >* Can one simply change the tinterlace from GPL to LGPL? >> * >> Of course not. There are two non-simple courses of action to achieve it: >> >> - Get the approval of all copyright holders. It has been done in the >> past for other filters. >> >> - Remove the GPL tinterlace and at the same time add a new LGPL filter >> that does the same thing and is also called tinterlace. >> >> >> Only two contributors approved until now, Thomas Mundt and Stefano >> Sebatini, while Baptiste Coudurier and Michael Zucchi could not be reached. >> Also, the new implementation supports all the features from the old >> tinterlace and conditionally (at compile time) the same ASM optimizations >> are used, but only if CONFIG_GPL is defined. >> >> Is there any way we can proceed with this patch? >> >> Best regards. >> >> >> On Fri, Aug 17, 2018 at 5:24 PM, Thomas Mundt <tmundt75@gmail.com> wrote: >> >>> Hi, >>> >>> 2018-08-16 13:56 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>: >>> >>> > Hi, >>> > >>> > Thank you for the additional testing effort. >>> > Fixed the issue. >>> > >>> > >>> thanks, the patch looks good to me as far as I can judge. >>> It´s up to more experienced developers now to permit the license change. >>> Can anybody please have a look at this. >>> >>> Regards, >>> Thomas >>> _______________________________________________ >>> ffmpeg-devel mailing list >>> ffmpeg-devel@ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >>> >> >> >
Hello, Happy New Year. Any news about this patch? Maybe Carl Eugen Hoyos could help us with this? Best regards. On Thu, Dec 6, 2018 at 6:10 PM Vasile Toncu <vasile.toncu@tremend.com> wrote: > Hi, > > Since this patch is passing all the current tests, all the modification > required by Thomas were implemented and from our point of view it satisfies > all requirements for adding the double license to the filter, please > approve this patch for integration. Also, there are two more patches > blocked at the moment. This two patches add new features and improvements > for the filter. > > Thank you. Regards. > > On Tue, Oct 16, 2018 at 6:40 PM Vasile Toncu <vasile.toncu@tremend.com> > wrote: > >> Hello, >> >> Still Baptiste Coudurier and Michael Zucchi could not be reached, however >> since the old GPL tinterlace was replaced with a new LGPL implementation >> aren't we on the second course of action recommended by Nicolas George? And >> by that means can we change the license of this implementation without the >> approval of the original contributors whose code was removed? >> Maybe someone else can have a look at the new implementation and provide >> the necessary feedback in order to merge this patch and unblock the >> development of the patches with new functionalities. >> >> Thank you. >> Best regards. >> >> >> >> On Mon, Sep 17, 2018 at 8:28 AM, Vasile Toncu <vasile.toncu@tremend.com> >> wrote: >> >>> Hello, >>> >>> Thank you Thomas for the reviews and support! >>> >>> The proposed actions, by Nicolas George in >>> https://ffmpeg.org/pipermail/ffmpeg-devel/2017-December/223072.html, >>> were taken. >>> >>> >* Can one simply change the tinterlace from GPL to LGPL? >>> * >>> Of course not. There are two non-simple courses of action to achieve it: >>> >>> - Get the approval of all copyright holders. It has been done in the >>> past for other filters. >>> >>> - Remove the GPL tinterlace and at the same time add a new LGPL filter >>> that does the same thing and is also called tinterlace. >>> >>> >>> Only two contributors approved until now, Thomas Mundt and Stefano >>> Sebatini, while Baptiste Coudurier and Michael Zucchi could not be reached. >>> Also, the new implementation supports all the features from the old >>> tinterlace and conditionally (at compile time) the same ASM optimizations >>> are used, but only if CONFIG_GPL is defined. >>> >>> Is there any way we can proceed with this patch? >>> >>> Best regards. >>> >>> >>> On Fri, Aug 17, 2018 at 5:24 PM, Thomas Mundt <tmundt75@gmail.com> >>> wrote: >>> >>>> Hi, >>>> >>>> 2018-08-16 13:56 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>: >>>> >>>> > Hi, >>>> > >>>> > Thank you for the additional testing effort. >>>> > Fixed the issue. >>>> > >>>> > >>>> thanks, the patch looks good to me as far as I can judge. >>>> It´s up to more experienced developers now to permit the license change. >>>> Can anybody please have a look at this. >>>> >>>> Regards, >>>> Thomas >>>> _______________________________________________ >>>> ffmpeg-devel mailing list >>>> ffmpeg-devel@ffmpeg.org >>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >>>> >>> >>> >>
Hi,
2018-04-17 13:33 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
>
>
> On 12.04.2018 19:45, Thomas Mundt wrote:
>
>>
>> You need to write separate AVOption interlace_options and AVFilter
>> avfilter_vf_interlace in vf_tinterlace.c
>> Have a look at this patch:
>> https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/88e0e205
>> 4d911b38662f681bdc267e08312d313a
>>
>> Regards,
>> Thomas
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
> Hello,
>
> Here is the new patch in accordance with the one that you suggested as a
> model. Please review it and tell me when should I proceed with the next
> patch. The next patch will add vf_reinterlace.
>
> Thank you,
> Vasile
>
>
> From b72b643201187bf5d31d7bec9b5064d1b01c8179 Mon Sep 17 00:00:00 2001
> From: Vasile Toncu <vasile.toncu@tremend.com>
> Date: Tue, 17 Apr 2018 13:48:28 +0300
> Subject: [PATCH] Removed vf_interlace.c
>
> ---
> libavfilter/Makefile | 2 +-
> libavfilter/vf_interlace.c | 366 ------------------------------
> --------------
> libavfilter/vf_tinterlace.c | 26 ++++
> 3 files changed, 27 insertions(+), 367 deletions(-)
> delete mode 100644 libavfilter/vf_interlace.c
>
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 3a9fb02..cfb0f1d 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) +=
> vf_hysteresis.o framesync.o
> OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o
> OBJS-$(CONFIG_IL_FILTER) += vf_il.o
> OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o
> -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o
> +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o
> OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o
> OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o
> OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
> diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
> deleted file mode 100644
> index 24c422d..0000000
> --- a/libavfilter/vf_interlace.c
> +++ /dev/null
> @@ -1,366 +0,0 @@
> -/*
> - * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com>
> - * Copyright (c) 2010 Baptiste Coudurier
> - * Copyright (c) 2011 Stefano Sabatini
> - * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com>
> - * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com>
> - *
> - * This file is part of FFmpeg.
> - *
> - * FFmpeg is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * FFmpeg is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License along
> - * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
> - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> - */
> -
> -/**
> - * @file
> - * progressive to interlaced content filter, inspired by heavy debugging
> of tinterlace filter
> - */
> -
> -#include "libavutil/common.h"
> -#include "libavutil/opt.h"
> -#include "libavutil/imgutils.h"
> -#include "libavutil/avassert.h"
> -
> -#include "formats.h"
> -#include "avfilter.h"
> -#include "interlace.h"
> -#include "internal.h"
> -#include "video.h"
> -
> -#define OFFSET(x) offsetof(InterlaceContext, x)
> -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> -static const AVOption interlace_options[] = {
> - { "scan", "scanning mode", OFFSET(scan),
> - AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS,
> .unit = "scan" },
> - { "tff", "top field first", 0,
> - AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags =
> FLAGS, .unit = "scan" },
> - { "bff", "bottom field first", 0,
> - AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags =
> FLAGS, .unit = "scan" },
> - { "lowpass", "set vertical low-pass filter", OFFSET(lowpass),
> - AV_OPT_TYPE_INT, {.i64 = VLPF_LIN }, 0, 2, .flags = FLAGS,
> .unit = "lowpass" },
> - { "off", "disable vertical low-pass filter", 0,
> - AV_OPT_TYPE_CONST, {.i64 = VLPF_OFF }, INT_MIN, INT_MAX, .flags =
> FLAGS, .unit = "lowpass" },
> - { "linear", "linear vertical low-pass filter", 0,
> - AV_OPT_TYPE_CONST, {.i64 = VLPF_LIN }, INT_MIN, INT_MAX, .flags =
> FLAGS, .unit = "lowpass" },
> - { "complex", "complex vertical low-pass filter", 0,
> - AV_OPT_TYPE_CONST, {.i64 = VLPF_CMP }, INT_MIN, INT_MAX, .flags =
> FLAGS, .unit = "lowpass" },
> - { NULL }
> -};
> -
> -AVFILTER_DEFINE_CLASS(interlace);
> -
> -static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
> - const uint8_t *srcp, ptrdiff_t mref,
> - ptrdiff_t pref, int clip_max)
> -{
> - const uint8_t *srcp_above = srcp + mref;
> - const uint8_t *srcp_below = srcp + pref;
> - int i;
> - for (i = 0; i < linesize; i++) {
> - // this calculation is an integer representation of
> - // '0.5 * current + 0.25 * above + 0.25 * below'
> - // '1 +' is for rounding.
> - dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i])
> >> 2;
> - }
> -}
> -
> -static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize,
> - const uint8_t *src8, ptrdiff_t mref,
> - ptrdiff_t pref, int clip_max)
> -{
> - uint16_t *dstp = (uint16_t *)dst8;
> - const uint16_t *srcp = (const uint16_t *)src8;
> - const uint16_t *srcp_above = srcp + mref / 2;
> - const uint16_t *srcp_below = srcp + pref / 2;
> - int i, src_x;
> - for (i = 0; i < linesize; i++) {
> - // this calculation is an integer representation of
> - // '0.5 * current + 0.25 * above + 0.25 * below'
> - // '1 +' is for rounding.
> - src_x = av_le2ne16(srcp[i]) << 1;
> - dstp[i] = av_le2ne16((1 + src_x + av_le2ne16(srcp_above[i])
> - + av_le2ne16(srcp_below[i])) >> 2);
> - }
> -}
> -
> -static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize,
> - const uint8_t *srcp, ptrdiff_t mref,
> - ptrdiff_t pref, int clip_max)
> -{
> - const uint8_t *srcp_above = srcp + mref;
> - const uint8_t *srcp_below = srcp + pref;
> - const uint8_t *srcp_above2 = srcp + mref * 2;
> - const uint8_t *srcp_below2 = srcp + pref * 2;
> - int i, src_x, src_ab;
> - for (i = 0; i < linesize; i++) {
> - // this calculation is an integer representation of
> - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2
> - 0.125 * below2'
> - // '4 +' is for rounding.
> - src_x = srcp[i] << 1;
> - src_ab = srcp_above[i] + srcp_below[i];
> - dstp[i] = av_clip_uint8((4 + ((srcp[i] + src_x + src_ab) << 1)
> - - srcp_above2[i] - srcp_below2[i]) >> 3);
> - // Prevent over-sharpening:
> - // dst must not exceed src when the average of above and below
> - // is less than src. And the other way around.
> - if (src_ab > src_x) {
> - if (dstp[i] < srcp[i])
> - dstp[i] = srcp[i];
> - } else if (dstp[i] > srcp[i])
> - dstp[i] = srcp[i];
> - }
> -}
> -
> -static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize,
> - const uint8_t *src8, ptrdiff_t
> mref,
> - ptrdiff_t pref, int clip_max)
> -{
> - uint16_t *dstp = (uint16_t *)dst8;
> - const uint16_t *srcp = (const uint16_t *)src8;
> - const uint16_t *srcp_above = srcp + mref / 2;
> - const uint16_t *srcp_below = srcp + pref / 2;
> - const uint16_t *srcp_above2 = srcp + mref;
> - const uint16_t *srcp_below2 = srcp + pref;
> - int i, dst_le, src_le, src_x, src_ab;
> - for (i = 0; i < linesize; i++) {
> - // this calculation is an integer representation of
> - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2
> - 0.125 * below2'
> - // '4 +' is for rounding.
> - src_le = av_le2ne16(srcp[i]);
> - src_x = src_le << 1;
> - src_ab = av_le2ne16(srcp_above[i]) + av_le2ne16(srcp_below[i]);
> - dst_le = av_clip((4 + ((src_le + src_x + src_ab) << 1)
> - - av_le2ne16(srcp_above2[i])
> - - av_le2ne16(srcp_below2[i])) >> 3, 0, clip_max);
> - // Prevent over-sharpening:
> - // dst must not exceed src when the average of above and below
> - // is less than src. And the other way around.
> - if (src_ab > src_x) {
> - if (dst_le < src_le)
> - dstp[i] = av_le2ne16(src_le);
> - else
> - dstp[i] = av_le2ne16(dst_le);
> - } else if (dst_le > src_le) {
> - dstp[i] = av_le2ne16(src_le);
> - } else
> - dstp[i] = av_le2ne16(dst_le);
> - }
> -}
> -
> -static const enum AVPixelFormat formats_supported[] = {
> - AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
> - AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
> - AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV422P10LE,
> AV_PIX_FMT_YUV444P10LE,
> - AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV422P12LE,
> AV_PIX_FMT_YUV444P12LE,
> - AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
> - AV_PIX_FMT_YUVA420P10LE, AV_PIX_FMT_YUVA422P10LE,
> AV_PIX_FMT_YUVA444P10LE,
> - AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P,
> - AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE
> -};
> -
> -static int query_formats(AVFilterContext *ctx)
> -{
> - AVFilterFormats *fmts_list = ff_make_format_list(formats_supported);
> - if (!fmts_list)
> - return AVERROR(ENOMEM);
> - return ff_set_common_formats(ctx, fmts_list);
> -}
> -
> -static av_cold void uninit(AVFilterContext *ctx)
> -{
> - InterlaceContext *s = ctx->priv;
> -
> - av_frame_free(&s->cur);
> - av_frame_free(&s->next);
> -}
> -
> -void ff_interlace_init(InterlaceContext *s, int depth)
> -{
> - if (s->lowpass) {
> - if (s->lowpass == VLPF_LIN) {
> - if (depth > 8)
> - s->lowpass_line = lowpass_line_c_16;
> - else
> - s->lowpass_line = lowpass_line_c;
> - } else if (s->lowpass == VLPF_CMP) {
> - if (depth > 8)
> - s->lowpass_line = lowpass_line_complex_c_16;
> - else
> - s->lowpass_line = lowpass_line_complex_c;
> - }
> - if (ARCH_X86)
> - ff_interlace_init_x86(s, depth);
> - }
> -}
> -
> -static int config_out_props(AVFilterLink *outlink)
> -{
> - AVFilterContext *ctx = outlink->src;
> - AVFilterLink *inlink = outlink->src->inputs[0];
> - InterlaceContext *s = ctx->priv;
> -
> - if (inlink->h < 2) {
> - av_log(ctx, AV_LOG_ERROR, "input video height is too small\n");
> - return AVERROR_INVALIDDATA;
> - }
> -
> - if (!s->lowpass)
> - av_log(ctx, AV_LOG_WARNING, "Lowpass filter is disabled, "
> - "the resulting video will be aliased rather than
> interlaced.\n");
> -
> - // same input size
> - outlink->w = inlink->w;
> - outlink->h = inlink->h;
> - outlink->time_base = inlink->time_base;
> - outlink->frame_rate = inlink->frame_rate;
> - // half framerate
> - outlink->time_base.num *= 2;
> - outlink->frame_rate.den *= 2;
> -
> - s->csp = av_pix_fmt_desc_get(outlink->format);
> - ff_interlace_init(s, s->csp->comp[0].depth);
> -
> - av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n",
> - s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" :
> "without");
> -
> - return 0;
> -}
> -
> -static void copy_picture_field(InterlaceContext *s,
> - AVFrame *src_frame, AVFrame *dst_frame,
> - AVFilterLink *inlink, enum FieldType
> field_type,
> - int lowpass)
> -{
> - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> - int hsub = desc->log2_chroma_w;
> - int vsub = desc->log2_chroma_h;
> - int plane, j;
> -
> - for (plane = 0; plane < desc->nb_components; plane++) {
> - int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub :
> inlink->w;
> - int lines = (plane == 1 || plane == 2) ?
> AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h;
> - uint8_t *dstp = dst_frame->data[plane];
> - const uint8_t *srcp = src_frame->data[plane];
> - int srcp_linesize = src_frame->linesize[plane] * 2;
> - int dstp_linesize = dst_frame->linesize[plane] * 2;
> - int clip_max = (1 << s->csp->comp[plane].depth) - 1;
> -
> - av_assert0(cols >= 0 || lines >= 0);
> -
> - lines = (lines + (field_type == FIELD_UPPER)) / 2;
> - if (field_type == FIELD_LOWER) {
> - srcp += src_frame->linesize[plane];
> - dstp += dst_frame->linesize[plane];
> - }
> - if (lowpass) {
> - int x = 0;
> - if (lowpass == VLPF_CMP)
> - x = 1;
> - for (j = lines; j > 0; j--) {
> - ptrdiff_t pref = src_frame->linesize[plane];
> - ptrdiff_t mref = -pref;
> - if (j >= (lines - x))
> - mref = 0;
> - else if (j <= (1 + x))
> - pref = 0;
> - s->lowpass_line(dstp, cols, srcp, mref, pref, clip_max);
> - dstp += dstp_linesize;
> - srcp += srcp_linesize;
> - }
> - } else {
> - if (s->csp->comp[plane].depth > 8)
> - cols *= 2;
> - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize,
> cols, lines);
> - }
> - }
> -}
> -
> -static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
> -{
> - AVFilterContext *ctx = inlink->dst;
> - AVFilterLink *outlink = ctx->outputs[0];
> - InterlaceContext *s = ctx->priv;
> - AVFrame *out;
> - int tff, ret;
> -
> - av_frame_free(&s->cur);
> - s->cur = s->next;
> - s->next = buf;
> -
> - /* we need at least two frames */
> - if (!s->cur || !s->next)
> - return 0;
> -
> - if (s->cur->interlaced_frame) {
> - av_log(ctx, AV_LOG_WARNING,
> - "video is already interlaced, adjusting framerate only\n");
> - out = av_frame_clone(s->cur);
> - if (!out)
> - return AVERROR(ENOMEM);
> - out->pts /= 2; // adjust pts to new framerate
> - ret = ff_filter_frame(outlink, out);
> - return ret;
> - }
> -
> - tff = (s->scan == MODE_TFF);
> - out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
> - if (!out)
> - return AVERROR(ENOMEM);
> -
> - av_frame_copy_props(out, s->cur);
> - out->interlaced_frame = 1;
> - out->top_field_first = tff;
> - out->pts /= 2; // adjust pts to new framerate
> -
> - /* copy upper/lower field from cur */
> - copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER :
> FIELD_LOWER, s->lowpass);
> - av_frame_free(&s->cur);
> -
> - /* copy lower/upper field from next */
> - copy_picture_field(s, s->next, out, inlink, tff ? FIELD_LOWER :
> FIELD_UPPER, s->lowpass);
> - av_frame_free(&s->next);
> -
> - ret = ff_filter_frame(outlink, out);
> -
> - return ret;
> -}
> -
> -static const AVFilterPad inputs[] = {
> - {
> - .name = "default",
> - .type = AVMEDIA_TYPE_VIDEO,
> - .filter_frame = filter_frame,
> - },
> - { NULL }
> -};
> -
> -static const AVFilterPad outputs[] = {
> - {
> - .name = "default",
> - .type = AVMEDIA_TYPE_VIDEO,
> - .config_props = config_out_props,
> - },
> - { NULL }
> -};
> -
> -AVFilter ff_vf_interlace = {
> - .name = "interlace",
> - .description = NULL_IF_CONFIG_SMALL("Convert progressive video into
> interlaced."),
> - .uninit = uninit,
> - .priv_class = &interlace_class,
> - .priv_size = sizeof(InterlaceContext),
> - .query_formats = query_formats,
> - .inputs = inputs,
> - .outputs = outputs,
> -};
> diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
> index f13791d..0e54fe3 100644
> --- a/libavfilter/vf_tinterlace.c
> +++ b/libavfilter/vf_tinterlace.c
> @@ -59,6 +59,20 @@ static const AVOption tinterlace_options[] = {
>
> AVFILTER_DEFINE_CLASS(tinterlace);
>
> +static const AVOption interlace_options[] = {
> + { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT,
> {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"},
> + { "tff", "top field first",
> 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX,
> FLAGS, .unit = "mode" },
> + { "bff", "bottom field first",
> 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX,
> FLAGS, .unit = "mode"},
> + { "lowpass", "set vertical low-pass filter", OFFSET(flags),
> AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0,INT_MAX, 0, "flags" },
> + { "off", "disable vertical low-pass filter",
> 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" },
> + { "linear", "linear vertical low-pass filter",
> 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX,
> FLAGS, "flags" },
> + { "complex", "complex vertical low-pass filter",
> 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX,
> FLAGS, "flags" },
> +
> + { NULL }
> +};
> +
> +AVFILTER_DEFINE_CLASS(interlace);
> +
> #define FULL_SCALE_YUVJ_FORMATS \
> AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P,
> AV_PIX_FMT_YUVJ440P
>
> @@ -525,3 +539,15 @@ AVFilter ff_vf_tinterlace = {
> .outputs = tinterlace_outputs,
> .priv_class = &tinterlace_class,
> };
> +
> +
> +AVFilter ff_vf_interlace = {
> + .name = "interlace",
> + .description = NULL_IF_CONFIG_SMALL("Convert progressive video into
> interlaced."),
> + .priv_size = sizeof(TInterlaceContext),
> + .uninit = uninit,
> + .query_formats = query_formats,
> + .inputs = tinterlace_inputs,
> + .outputs = tinterlace_outputs,
> + .priv_class = &interlace_class,
> +};
>
> --
> 2.7.4
>
Please do also remove interlace.h and x86/vf_interlace_init.c. Adapt
x86/Makefile accordingly.
Otherwise the patch is ok.
When sending the LGPL vf_reinterlace patch, please do also send a patch
that renames vf_reinterlace to vf_tinterlace and replaces current
vf_tinterlace with it.
Thanks,
Thomas
On 17.04.2018 19:42, Thomas Mundt wrote:
Please do also remove interlace.h and x86/vf_interlace_init.c. Adapt x86/Makefile accordingly. Otherwise the patch is ok.
When sending the LGPL vf_reinterlace patch, please do also send a patch that renames vf_reinterlace to vf_tinterlace and replaces current vf_tinterlace with it.
Thanks, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello, I have made the changes. Here is the patch. Is it alright? Thanks, Vasile From b93c2bc52d1892ffc9dd3f22e409aeeebd4cc163 Mon Sep 17 00:00:00 2001 From: Vasile Toncu <vasile.toncu@tremend.com> Date: Tue, 17 Apr 2018 13:48:28 +0300 Subject: [PATCH] Remove interlace.h and x86/vf_interlace_init.c --- libavfilter/Makefile | 2 +- libavfilter/interlace.h | 68 ------- libavfilter/vf_interlace.c | 366 ------------------------------------ libavfilter/vf_tinterlace.c | 26 +++ libavfilter/x86/Makefile | 2 +- libavfilter/x86/vf_interlace_init.c | 88 --------- 6 files changed, 28 insertions(+), 524 deletions(-) delete mode 100644 libavfilter/interlace.h delete mode 100644 libavfilter/vf_interlace.c delete mode 100644 libavfilter/x86/vf_interlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 3a9fb02..cfb0f1d 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o OBJS-$(CONFIG_IL_FILTER) += vf_il.o OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h deleted file mode 100644 index b41f0d5..0000000 --- a/libavfilter/interlace.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * @file - * progressive to interlaced content filter, inspired by heavy debugging of - * tinterlace filter. - */ - -#ifndef AVFILTER_INTERLACE_H -#define AVFILTER_INTERLACE_H - -#include "libavutil/bswap.h" -#include "libavutil/common.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" - -enum ScanMode { - MODE_TFF = 0, - MODE_BFF = 1, -}; - -enum FieldType { - FIELD_UPPER = 0, - FIELD_LOWER = 1, -}; - -enum VLPFilter { - VLPF_OFF = 0, - VLPF_LIN = 1, - VLPF_CMP = 2, -}; - -typedef struct InterlaceContext { - const AVClass *class; - enum ScanMode scan; // top or bottom field first scanning - int lowpass; // enable or disable low pass filtering - AVFrame *cur, *next; // the two frames from which the new one is obtained - const AVPixFmtDescriptor *csp; - void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp, - ptrdiff_t mref, ptrdiff_t pref, int clip_max); -} InterlaceContext; - -void ff_interlace_init(InterlaceContext *interlace, int depth); -void ff_interlace_init_x86(InterlaceContext *interlace, int depth); - -#endif /* AVFILTER_INTERLACE_H */ diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c deleted file mode 100644 index 24c422d..0000000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com> - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com> - * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * @file - * progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter - */ - -#include "libavutil/common.h" -#include "libavutil/opt.h" -#include "libavutil/imgutils.h" -#include "libavutil/avassert.h" - -#include "formats.h" -#include "avfilter.h" -#include "interlace.h" -#include "internal.h" -#include "video.h" - -#define OFFSET(x) offsetof(InterlaceContext, x) -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM -static const AVOption interlace_options[] = { - { "scan", "scanning mode", OFFSET(scan), - AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS, .unit = "scan" }, - { "tff", "top field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "bff", "bottom field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "lowpass", "set vertical low-pass filter", OFFSET(lowpass), - AV_OPT_TYPE_INT, {.i64 = VLPF_LIN }, 0, 2, .flags = FLAGS, .unit = "lowpass" }, - { "off", "disable vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_OFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "linear", "linear vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_LIN }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "complex", "complex vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_CMP }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { NULL } -}; - -AVFILTER_DEFINE_CLASS(interlace); - -static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - int i; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2; - } -} - -static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - int i, src_x; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - src_x = av_le2ne16(srcp[i]) << 1; - dstp[i] = av_le2ne16((1 + src_x + av_le2ne16(srcp_above[i]) - + av_le2ne16(srcp_below[i])) >> 2); - } -} - -static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - const uint8_t *srcp_above2 = srcp + mref * 2; - const uint8_t *srcp_below2 = srcp + pref * 2; - int i, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_x = srcp[i] << 1; - src_ab = srcp_above[i] + srcp_below[i]; - dstp[i] = av_clip_uint8((4 + ((srcp[i] + src_x + src_ab) << 1) - - srcp_above2[i] - srcp_below2[i]) >> 3); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dstp[i] < srcp[i]) - dstp[i] = srcp[i]; - } else if (dstp[i] > srcp[i]) - dstp[i] = srcp[i]; - } -} - -static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - const uint16_t *srcp_above2 = srcp + mref; - const uint16_t *srcp_below2 = srcp + pref; - int i, dst_le, src_le, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_le = av_le2ne16(srcp[i]); - src_x = src_le << 1; - src_ab = av_le2ne16(srcp_above[i]) + av_le2ne16(srcp_below[i]); - dst_le = av_clip((4 + ((src_le + src_x + src_ab) << 1) - - av_le2ne16(srcp_above2[i]) - - av_le2ne16(srcp_below2[i])) >> 3, 0, clip_max); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dst_le < src_le) - dstp[i] = av_le2ne16(src_le); - else - dstp[i] = av_le2ne16(dst_le); - } else if (dst_le > src_le) { - dstp[i] = av_le2ne16(src_le); - } else - dstp[i] = av_le2ne16(dst_le); - } -} - -static const enum AVPixelFormat formats_supported[] = { - AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, - AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, - AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV444P10LE, - AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV444P12LE, - AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, - AV_PIX_FMT_YUVA420P10LE, AV_PIX_FMT_YUVA422P10LE, AV_PIX_FMT_YUVA444P10LE, - AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, - AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE -}; - -static int query_formats(AVFilterContext *ctx) -{ - AVFilterFormats *fmts_list = ff_make_format_list(formats_supported); - if (!fmts_list) - return AVERROR(ENOMEM); - return ff_set_common_formats(ctx, fmts_list); -} - -static av_cold void uninit(AVFilterContext *ctx) -{ - InterlaceContext *s = ctx->priv; - - av_frame_free(&s->cur); - av_frame_free(&s->next); -} - -void ff_interlace_init(InterlaceContext *s, int depth) -{ - if (s->lowpass) { - if (s->lowpass == VLPF_LIN) { - if (depth > 8) - s->lowpass_line = lowpass_line_c_16; - else - s->lowpass_line = lowpass_line_c; - } else if (s->lowpass == VLPF_CMP) { - if (depth > 8) - s->lowpass_line = lowpass_line_complex_c_16; - else - s->lowpass_line = lowpass_line_complex_c; - } - if (ARCH_X86) - ff_interlace_init_x86(s, depth); - } -} - -static int config_out_props(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - AVFilterLink *inlink = outlink->src->inputs[0]; - InterlaceContext *s = ctx->priv; - - if (inlink->h < 2) { - av_log(ctx, AV_LOG_ERROR, "input video height is too small\n"); - return AVERROR_INVALIDDATA; - } - - if (!s->lowpass) - av_log(ctx, AV_LOG_WARNING, "Lowpass filter is disabled, " - "the resulting video will be aliased rather than interlaced.\n"); - - // same input size - outlink->w = inlink->w; - outlink->h = inlink->h; - outlink->time_base = inlink->time_base; - outlink->frame_rate = inlink->frame_rate; - // half framerate - outlink->time_base.num *= 2; - outlink->frame_rate.den *= 2; - - s->csp = av_pix_fmt_desc_get(outlink->format); - ff_interlace_init(s, s->csp->comp[0].depth); - - av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n", - s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without"); - - return 0; -} - -static void copy_picture_field(InterlaceContext *s, - AVFrame *src_frame, AVFrame *dst_frame, - AVFilterLink *inlink, enum FieldType field_type, - int lowpass) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); - int hsub = desc->log2_chroma_w; - int vsub = desc->log2_chroma_h; - int plane, j; - - for (plane = 0; plane < desc->nb_components; plane++) { - int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w; - int lines = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h; - uint8_t *dstp = dst_frame->data[plane]; - const uint8_t *srcp = src_frame->data[plane]; - int srcp_linesize = src_frame->linesize[plane] * 2; - int dstp_linesize = dst_frame->linesize[plane] * 2; - int clip_max = (1 << s->csp->comp[plane].depth) - 1; - - av_assert0(cols >= 0 || lines >= 0); - - lines = (lines + (field_type == FIELD_UPPER)) / 2; - if (field_type == FIELD_LOWER) { - srcp += src_frame->linesize[plane]; - dstp += dst_frame->linesize[plane]; - } - if (lowpass) { - int x = 0; - if (lowpass == VLPF_CMP) - x = 1; - for (j = lines; j > 0; j--) { - ptrdiff_t pref = src_frame->linesize[plane]; - ptrdiff_t mref = -pref; - if (j >= (lines - x)) - mref = 0; - else if (j <= (1 + x)) - pref = 0; - s->lowpass_line(dstp, cols, srcp, mref, pref, clip_max); - dstp += dstp_linesize; - srcp += srcp_linesize; - } - } else { - if (s->csp->comp[plane].depth > 8) - cols *= 2; - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines); - } - } -} - -static int filter_frame(AVFilterLink *inlink, AVFrame *buf) -{ - AVFilterContext *ctx = inlink->dst; - AVFilterLink *outlink = ctx->outputs[0]; - InterlaceContext *s = ctx->priv; - AVFrame *out; - int tff, ret; - - av_frame_free(&s->cur); - s->cur = s->next; - s->next = buf; - - /* we need at least two frames */ - if (!s->cur || !s->next) - return 0; - - if (s->cur->interlaced_frame) { - av_log(ctx, AV_LOG_WARNING, - "video is already interlaced, adjusting framerate only\n"); - out = av_frame_clone(s->cur); - if (!out) - return AVERROR(ENOMEM); - out->pts /= 2; // adjust pts to new framerate - ret = ff_filter_frame(outlink, out); - return ret; - } - - tff = (s->scan == MODE_TFF); - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - if (!out) - return AVERROR(ENOMEM); - - av_frame_copy_props(out, s->cur); - out->interlaced_frame = 1; - out->top_field_first = tff; - out->pts /= 2; // adjust pts to new framerate - - /* copy upper/lower field from cur */ - copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass); - av_frame_free(&s->cur); - - /* copy lower/upper field from next */ - copy_picture_field(s, s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass); - av_frame_free(&s->next); - - ret = ff_filter_frame(outlink, out); - - return ret; -} - -static const AVFilterPad inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, - }, - { NULL } -}; - -static const AVFilterPad outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_out_props, - }, - { NULL } -}; - -AVFilter ff_vf_interlace = { - .name = "interlace", - .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), - .uninit = uninit, - .priv_class = &interlace_class, - .priv_size = sizeof(InterlaceContext), - .query_formats = query_formats, - .inputs = inputs, - .outputs = outputs, -}; diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..0e54fe3 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -59,6 +59,20 @@ static const AVOption tinterlace_options[] = { AVFILTER_DEFINE_CLASS(tinterlace); +static const AVOption interlace_options[] = { + { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"}, + { "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" }, + { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"}, + { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0,INT_MAX, 0, "flags" }, + { "off", "disable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, + + { NULL } +}; + +AVFILTER_DEFINE_CLASS(interlace); + #define FULL_SCALE_YUVJ_FORMATS \ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P @@ -525,3 +539,15 @@ AVFilter ff_vf_tinterlace = { .outputs = tinterlace_outputs, .priv_class = &tinterlace_class, }; + + +AVFilter ff_vf_interlace = { + .name = "interlace", + .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), + .priv_size = sizeof(TInterlaceContext), + .uninit = uninit, + .query_formats = query_formats, + .inputs = tinterlace_inputs, + .outputs = tinterlace_outputs, + .priv_class = &interlace_class, +}; diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile index 4d4c5e5..f60de3b 100644 --- a/libavfilter/x86/Makefile +++ b/libavfilter/x86/Makefile @@ -9,7 +9,7 @@ OBJS-$(CONFIG_FRAMERATE_FILTER) += x86/vf_framerate_init.o OBJS-$(CONFIG_HFLIP_FILTER) += x86/vf_hflip_init.o OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d_init.o OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet_init.o -OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace_init.o +OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_tinterlace_init.o OBJS-$(CONFIG_LIMITER_FILTER) += x86/vf_limiter_init.o OBJS-$(CONFIG_MASKEDMERGE_FILTER) += x86/vf_maskedmerge_init.o OBJS-$(CONFIG_NOISE_FILTER) += x86/vf_noise.o diff --git a/libavfilter/x86/vf_interlace_init.c b/libavfilter/x86/vf_interlace_init.c deleted file mode 100644 index 0de0fea..0000000 --- a/libavfilter/x86/vf_interlace_init.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2014 Kieran Kunhya <kierank@obe.tv> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "libavutil/attributes.h" -#include "libavutil/cpu.h" -#include "libavutil/internal.h" -#include "libavutil/mem.h" -#include "libavutil/x86/cpu.h" - -#include "libavfilter/interlace.h" - -void ff_lowpass_line_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_avx (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_avx2 (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -void ff_lowpass_line_16_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_16_avx (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_16_avx2 (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -void ff_lowpass_line_complex_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -av_cold void ff_interlace_init_x86(InterlaceContext *s, int depth) -{ - int cpu_flags = av_get_cpu_flags(); - - if (depth > 8) { - if (EXTERNAL_SSE2(cpu_flags)) { - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_16_sse2; - else if (s->lowpass == VLPF_CMP) - s->lowpass_line = ff_lowpass_line_complex_12_sse2; - } - if (EXTERNAL_AVX(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_16_avx; - if (EXTERNAL_AVX2_FAST(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_16_avx2; - } else { - if (EXTERNAL_SSE2(cpu_flags)) { - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_sse2; - else if (s->lowpass == VLPF_CMP) - s->lowpass_line = ff_lowpass_line_complex_sse2; - } - if (EXTERNAL_AVX(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_avx; - if (EXTERNAL_AVX2_FAST(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_avx2; - } -} -- 2.7.4
On 4/18/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
On 17.04.2018 19:42, Thomas Mundt wrote:
Please do also remove interlace.h and x86/vf_interlace_init.c. Adapt x86/Makefile accordingly. Otherwise the patch is ok.
When sending the LGPL vf_reinterlace patch, please do also send a patch that renames vf_reinterlace to vf_tinterlace and replaces current vf_tinterlace with it.
Thanks, Thomas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello,
I have made the changes. Here is the patch. Is it alright?
Yes, but please send or attach it properly. This can not be applied as is currently.
Signed-off-by: Vasile Toncu <vasile.toncu@tremend.com> --- libavfilter/Makefile | 2 +- libavfilter/interlace.h | 68 ------- libavfilter/vf_interlace.c | 366 ------------------------------------ libavfilter/vf_tinterlace.c | 26 +++ libavfilter/x86/Makefile | 2 +- libavfilter/x86/vf_interlace_init.c | 88 --------- 6 files changed, 28 insertions(+), 524 deletions(-) delete mode 100644 libavfilter/interlace.h delete mode 100644 libavfilter/vf_interlace.c delete mode 100644 libavfilter/x86/vf_interlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 3a9fb02..cfb0f1d 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -231,7 +231,7 @@ OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o OBJS-$(CONFIG_IL_FILTER) += vf_il.o OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o -OBJS-$(CONFIG_INTERLACE_FILTER) += vf_interlace.o +OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h deleted file mode 100644 index b41f0d5..0000000 --- a/libavfilter/interlace.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * @file - * progressive to interlaced content filter, inspired by heavy debugging of - * tinterlace filter. - */ - -#ifndef AVFILTER_INTERLACE_H -#define AVFILTER_INTERLACE_H - -#include "libavutil/bswap.h" -#include "libavutil/common.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" - -enum ScanMode { - MODE_TFF = 0, - MODE_BFF = 1, -}; - -enum FieldType { - FIELD_UPPER = 0, - FIELD_LOWER = 1, -}; - -enum VLPFilter { - VLPF_OFF = 0, - VLPF_LIN = 1, - VLPF_CMP = 2, -}; - -typedef struct InterlaceContext { - const AVClass *class; - enum ScanMode scan; // top or bottom field first scanning - int lowpass; // enable or disable low pass filtering - AVFrame *cur, *next; // the two frames from which the new one is obtained - const AVPixFmtDescriptor *csp; - void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp, - ptrdiff_t mref, ptrdiff_t pref, int clip_max); -} InterlaceContext; - -void ff_interlace_init(InterlaceContext *interlace, int depth); -void ff_interlace_init_x86(InterlaceContext *interlace, int depth); - -#endif /* AVFILTER_INTERLACE_H */ diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c deleted file mode 100644 index 24c422d..0000000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi <notzed@ximian.com> - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara@gmail.com> - * Copyright (c) 2017 Thomas Mundt <tmundt75@gmail.com> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * @file - * progressive to interlaced content filter, inspired by heavy debugging of tinterlace filter - */ - -#include "libavutil/common.h" -#include "libavutil/opt.h" -#include "libavutil/imgutils.h" -#include "libavutil/avassert.h" - -#include "formats.h" -#include "avfilter.h" -#include "interlace.h" -#include "internal.h" -#include "video.h" - -#define OFFSET(x) offsetof(InterlaceContext, x) -#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM -static const AVOption interlace_options[] = { - { "scan", "scanning mode", OFFSET(scan), - AV_OPT_TYPE_INT, {.i64 = MODE_TFF }, 0, 1, .flags = FLAGS, .unit = "scan" }, - { "tff", "top field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_TFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "bff", "bottom field first", 0, - AV_OPT_TYPE_CONST, {.i64 = MODE_BFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "scan" }, - { "lowpass", "set vertical low-pass filter", OFFSET(lowpass), - AV_OPT_TYPE_INT, {.i64 = VLPF_LIN }, 0, 2, .flags = FLAGS, .unit = "lowpass" }, - { "off", "disable vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_OFF }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "linear", "linear vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_LIN }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { "complex", "complex vertical low-pass filter", 0, - AV_OPT_TYPE_CONST, {.i64 = VLPF_CMP }, INT_MIN, INT_MAX, .flags = FLAGS, .unit = "lowpass" }, - { NULL } -}; - -AVFILTER_DEFINE_CLASS(interlace); - -static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - int i; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - dstp[i] = (1 + srcp[i] + srcp[i] + srcp_above[i] + srcp_below[i]) >> 2; - } -} - -static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - int i, src_x; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.5 * current + 0.25 * above + 0.25 * below' - // '1 +' is for rounding. - src_x = av_le2ne16(srcp[i]) << 1; - dstp[i] = av_le2ne16((1 + src_x + av_le2ne16(srcp_above[i]) - + av_le2ne16(srcp_below[i])) >> 2); - } -} - -static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - const uint8_t *srcp_above = srcp + mref; - const uint8_t *srcp_below = srcp + pref; - const uint8_t *srcp_above2 = srcp + mref * 2; - const uint8_t *srcp_below2 = srcp + pref * 2; - int i, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_x = srcp[i] << 1; - src_ab = srcp_above[i] + srcp_below[i]; - dstp[i] = av_clip_uint8((4 + ((srcp[i] + src_x + src_ab) << 1) - - srcp_above2[i] - srcp_below2[i]) >> 3); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dstp[i] < srcp[i]) - dstp[i] = srcp[i]; - } else if (dstp[i] > srcp[i]) - dstp[i] = srcp[i]; - } -} - -static void lowpass_line_complex_c_16(uint8_t *dst8, ptrdiff_t linesize, - const uint8_t *src8, ptrdiff_t mref, - ptrdiff_t pref, int clip_max) -{ - uint16_t *dstp = (uint16_t *)dst8; - const uint16_t *srcp = (const uint16_t *)src8; - const uint16_t *srcp_above = srcp + mref / 2; - const uint16_t *srcp_below = srcp + pref / 2; - const uint16_t *srcp_above2 = srcp + mref; - const uint16_t *srcp_below2 = srcp + pref; - int i, dst_le, src_le, src_x, src_ab; - for (i = 0; i < linesize; i++) { - // this calculation is an integer representation of - // '0.75 * current + 0.25 * above + 0.25 * below - 0.125 * above2 - 0.125 * below2' - // '4 +' is for rounding. - src_le = av_le2ne16(srcp[i]); - src_x = src_le << 1; - src_ab = av_le2ne16(srcp_above[i]) + av_le2ne16(srcp_below[i]); - dst_le = av_clip((4 + ((src_le + src_x + src_ab) << 1) - - av_le2ne16(srcp_above2[i]) - - av_le2ne16(srcp_below2[i])) >> 3, 0, clip_max); - // Prevent over-sharpening: - // dst must not exceed src when the average of above and below - // is less than src. And the other way around. - if (src_ab > src_x) { - if (dst_le < src_le) - dstp[i] = av_le2ne16(src_le); - else - dstp[i] = av_le2ne16(dst_le); - } else if (dst_le > src_le) { - dstp[i] = av_le2ne16(src_le); - } else - dstp[i] = av_le2ne16(dst_le); - } -} - -static const enum AVPixelFormat formats_supported[] = { - AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, - AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, - AV_PIX_FMT_YUV420P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV444P10LE, - AV_PIX_FMT_YUV420P12LE, AV_PIX_FMT_YUV422P12LE, AV_PIX_FMT_YUV444P12LE, - AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P, - AV_PIX_FMT_YUVA420P10LE, AV_PIX_FMT_YUVA422P10LE, AV_PIX_FMT_YUVA444P10LE, - AV_PIX_FMT_GRAY8, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, - AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE -}; - -static int query_formats(AVFilterContext *ctx) -{ - AVFilterFormats *fmts_list = ff_make_format_list(formats_supported); - if (!fmts_list) - return AVERROR(ENOMEM); - return ff_set_common_formats(ctx, fmts_list); -} - -static av_cold void uninit(AVFilterContext *ctx) -{ - InterlaceContext *s = ctx->priv; - - av_frame_free(&s->cur); - av_frame_free(&s->next); -} - -void ff_interlace_init(InterlaceContext *s, int depth) -{ - if (s->lowpass) { - if (s->lowpass == VLPF_LIN) { - if (depth > 8) - s->lowpass_line = lowpass_line_c_16; - else - s->lowpass_line = lowpass_line_c; - } else if (s->lowpass == VLPF_CMP) { - if (depth > 8) - s->lowpass_line = lowpass_line_complex_c_16; - else - s->lowpass_line = lowpass_line_complex_c; - } - if (ARCH_X86) - ff_interlace_init_x86(s, depth); - } -} - -static int config_out_props(AVFilterLink *outlink) -{ - AVFilterContext *ctx = outlink->src; - AVFilterLink *inlink = outlink->src->inputs[0]; - InterlaceContext *s = ctx->priv; - - if (inlink->h < 2) { - av_log(ctx, AV_LOG_ERROR, "input video height is too small\n"); - return AVERROR_INVALIDDATA; - } - - if (!s->lowpass) - av_log(ctx, AV_LOG_WARNING, "Lowpass filter is disabled, " - "the resulting video will be aliased rather than interlaced.\n"); - - // same input size - outlink->w = inlink->w; - outlink->h = inlink->h; - outlink->time_base = inlink->time_base; - outlink->frame_rate = inlink->frame_rate; - // half framerate - outlink->time_base.num *= 2; - outlink->frame_rate.den *= 2; - - s->csp = av_pix_fmt_desc_get(outlink->format); - ff_interlace_init(s, s->csp->comp[0].depth); - - av_log(ctx, AV_LOG_VERBOSE, "%s interlacing %s lowpass filter\n", - s->scan == MODE_TFF ? "tff" : "bff", (s->lowpass) ? "with" : "without"); - - return 0; -} - -static void copy_picture_field(InterlaceContext *s, - AVFrame *src_frame, AVFrame *dst_frame, - AVFilterLink *inlink, enum FieldType field_type, - int lowpass) -{ - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); - int hsub = desc->log2_chroma_w; - int vsub = desc->log2_chroma_h; - int plane, j; - - for (plane = 0; plane < desc->nb_components; plane++) { - int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w; - int lines = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->h, vsub) : inlink->h; - uint8_t *dstp = dst_frame->data[plane]; - const uint8_t *srcp = src_frame->data[plane]; - int srcp_linesize = src_frame->linesize[plane] * 2; - int dstp_linesize = dst_frame->linesize[plane] * 2; - int clip_max = (1 << s->csp->comp[plane].depth) - 1; - - av_assert0(cols >= 0 || lines >= 0); - - lines = (lines + (field_type == FIELD_UPPER)) / 2; - if (field_type == FIELD_LOWER) { - srcp += src_frame->linesize[plane]; - dstp += dst_frame->linesize[plane]; - } - if (lowpass) { - int x = 0; - if (lowpass == VLPF_CMP) - x = 1; - for (j = lines; j > 0; j--) { - ptrdiff_t pref = src_frame->linesize[plane]; - ptrdiff_t mref = -pref; - if (j >= (lines - x)) - mref = 0; - else if (j <= (1 + x)) - pref = 0; - s->lowpass_line(dstp, cols, srcp, mref, pref, clip_max); - dstp += dstp_linesize; - srcp += srcp_linesize; - } - } else { - if (s->csp->comp[plane].depth > 8) - cols *= 2; - av_image_copy_plane(dstp, dstp_linesize, srcp, srcp_linesize, cols, lines); - } - } -} - -static int filter_frame(AVFilterLink *inlink, AVFrame *buf) -{ - AVFilterContext *ctx = inlink->dst; - AVFilterLink *outlink = ctx->outputs[0]; - InterlaceContext *s = ctx->priv; - AVFrame *out; - int tff, ret; - - av_frame_free(&s->cur); - s->cur = s->next; - s->next = buf; - - /* we need at least two frames */ - if (!s->cur || !s->next) - return 0; - - if (s->cur->interlaced_frame) { - av_log(ctx, AV_LOG_WARNING, - "video is already interlaced, adjusting framerate only\n"); - out = av_frame_clone(s->cur); - if (!out) - return AVERROR(ENOMEM); - out->pts /= 2; // adjust pts to new framerate - ret = ff_filter_frame(outlink, out); - return ret; - } - - tff = (s->scan == MODE_TFF); - out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - if (!out) - return AVERROR(ENOMEM); - - av_frame_copy_props(out, s->cur); - out->interlaced_frame = 1; - out->top_field_first = tff; - out->pts /= 2; // adjust pts to new framerate - - /* copy upper/lower field from cur */ - copy_picture_field(s, s->cur, out, inlink, tff ? FIELD_UPPER : FIELD_LOWER, s->lowpass); - av_frame_free(&s->cur); - - /* copy lower/upper field from next */ - copy_picture_field(s, s->next, out, inlink, tff ? FIELD_LOWER : FIELD_UPPER, s->lowpass); - av_frame_free(&s->next); - - ret = ff_filter_frame(outlink, out); - - return ret; -} - -static const AVFilterPad inputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .filter_frame = filter_frame, - }, - { NULL } -}; - -static const AVFilterPad outputs[] = { - { - .name = "default", - .type = AVMEDIA_TYPE_VIDEO, - .config_props = config_out_props, - }, - { NULL } -}; - -AVFilter ff_vf_interlace = { - .name = "interlace", - .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), - .uninit = uninit, - .priv_class = &interlace_class, - .priv_size = sizeof(InterlaceContext), - .query_formats = query_formats, - .inputs = inputs, - .outputs = outputs, -}; diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..0e54fe3 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -59,6 +59,20 @@ static const AVOption tinterlace_options[] = { AVFILTER_DEFINE_CLASS(tinterlace); +static const AVOption interlace_options[] = { + { "scan", "scanning mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_INTERLEAVE_TOP}, 0, MODE_NB-1, FLAGS, "mode"}, + { "tff", "top field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, .unit = "mode" }, + { "bff", "bottom field first", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM}, INT_MIN, INT_MAX, FLAGS, .unit = "mode"}, + { "lowpass", "set vertical low-pass filter", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = TINTERLACE_FLAG_VLPF}, 0,INT_MAX, 0, "flags" }, + { "off", "disable vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "linear", "linear vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags" }, + { "complex", "complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" }, + + { NULL } +}; + +AVFILTER_DEFINE_CLASS(interlace); + #define FULL_SCALE_YUVJ_FORMATS \ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P @@ -525,3 +539,15 @@ AVFilter ff_vf_tinterlace = { .outputs = tinterlace_outputs, .priv_class = &tinterlace_class, }; + + +AVFilter ff_vf_interlace = { + .name = "interlace", + .description = NULL_IF_CONFIG_SMALL("Convert progressive video into interlaced."), + .priv_size = sizeof(TInterlaceContext), + .uninit = uninit, + .query_formats = query_formats, + .inputs = tinterlace_inputs, + .outputs = tinterlace_outputs, + .priv_class = &interlace_class, +}; diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile index 4d4c5e5..f60de3b 100644 --- a/libavfilter/x86/Makefile +++ b/libavfilter/x86/Makefile @@ -9,7 +9,7 @@ OBJS-$(CONFIG_FRAMERATE_FILTER) += x86/vf_framerate_init.o OBJS-$(CONFIG_HFLIP_FILTER) += x86/vf_hflip_init.o OBJS-$(CONFIG_HQDN3D_FILTER) += x86/vf_hqdn3d_init.o OBJS-$(CONFIG_IDET_FILTER) += x86/vf_idet_init.o -OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_interlace_init.o +OBJS-$(CONFIG_INTERLACE_FILTER) += x86/vf_tinterlace_init.o OBJS-$(CONFIG_LIMITER_FILTER) += x86/vf_limiter_init.o OBJS-$(CONFIG_MASKEDMERGE_FILTER) += x86/vf_maskedmerge_init.o OBJS-$(CONFIG_NOISE_FILTER) += x86/vf_noise.o diff --git a/libavfilter/x86/vf_interlace_init.c b/libavfilter/x86/vf_interlace_init.c deleted file mode 100644 index 0de0fea..0000000 --- a/libavfilter/x86/vf_interlace_init.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2014 Kieran Kunhya <kierank@obe.tv> - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with FFmpeg; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "libavutil/attributes.h" -#include "libavutil/cpu.h" -#include "libavutil/internal.h" -#include "libavutil/mem.h" -#include "libavutil/x86/cpu.h" - -#include "libavfilter/interlace.h" - -void ff_lowpass_line_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_avx (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_avx2 (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -void ff_lowpass_line_16_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_16_avx (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); -void ff_lowpass_line_16_avx2 (uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -void ff_lowpass_line_complex_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize, - const uint8_t *srcp, ptrdiff_t mref, - ptrdiff_t pref, int clip_max); - -av_cold void ff_interlace_init_x86(InterlaceContext *s, int depth) -{ - int cpu_flags = av_get_cpu_flags(); - - if (depth > 8) { - if (EXTERNAL_SSE2(cpu_flags)) { - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_16_sse2; - else if (s->lowpass == VLPF_CMP) - s->lowpass_line = ff_lowpass_line_complex_12_sse2; - } - if (EXTERNAL_AVX(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_16_avx; - if (EXTERNAL_AVX2_FAST(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_16_avx2; - } else { - if (EXTERNAL_SSE2(cpu_flags)) { - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_sse2; - else if (s->lowpass == VLPF_CMP) - s->lowpass_line = ff_lowpass_line_complex_sse2; - } - if (EXTERNAL_AVX(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_avx; - if (EXTERNAL_AVX2_FAST(cpu_flags)) - if (s->lowpass == VLPF_LIN) - s->lowpass_line = ff_lowpass_line_avx2; - } -} -- 2.7.4
On Fri, Apr 20, 2018 at 17:44:17 +0300, Vasile Toncu wrote:
-typedef struct InterlaceContext { - const AVClass *class; - enum ScanMode scan; // top or bottom field first scanning - int lowpass; // enable or disable low pass filtering - AVFrame *cur, *next; // the two frames from which the new one is obtained - const AVPixFmtDescriptor *csp; - void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const uint8_t *srcp,
This patch is still corrupted by your mailer, by introducing line breaks. Please attach it as a file, or use "git send-email" Moritz
This patch is still corrupted by your mailer, by introducing line breaks. Please attach it as a file, or use "git send-email"
Moritz _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello, I have attached the patch. It's strange, my mailer shows the message with no line breaks, but on the list it appears like that. I hope this solves the problem. Kind regards, Vasile
On 4/23/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
This patch is still corrupted by your mailer, by introducing line breaks. Please attach it as a file, or use "git send-email"
Moritz _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Hello,
I have attached the patch. It's strange, my mailer shows the message with no line breaks, but on the list it appears like that. I hope this solves the problem.
Kind regards, Vasile
Applied, thanks.
Hello, Here is patches 2. Please review. Thank you, Vasile Toncu
On 4/23/18, Vasile Toncu <vasile.toncu@tremend.com> wrote:
Hello,
Here is patches 2. Please review.
Thank you, Vasile Toncu
Please fix those two patches. They must have proper short description. Looks like it is missing pix formats in query_formats, and thus cannot be compiled as is.
Hello, Here is patch 3. Please review. Thank you, Vasile
Hi, 2018-04-23 18:22 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hello,
Here is patch 3. Please review.
Thank you, Vasile
Some fate tests fail when both patches are applied. I also get lots of compiler warnings. Please fix them and, as already said, run fate. All tests must pass, otherwise there is something wrong with your filter. Regards, Thomas
Hello, Here is patch 2. In this patch I added the reinterlace filter to ffmpeg. Please review. Thank you, Vasile
Hello, Here is patch 3. I renamed reinterlace to tinterlace and replaced the functionality of tinterlace with the one from reinterlace. Please review. Thank you, Vasile
On 4/25/2018 7:54 PM, Vasile Toncu wrote:
Hello,
Here is patch 3. I renamed reinterlace to tinterlace and replaced the functionality of tinterlace with the one from reinterlace. Please review.
If any options are new or different from the original tinterlace filter, please add doc entries for them in doc/filters.texi Thanks, Gyan
Hi, 2018-04-25 16:24 GMT+02:00 Vasile Toncu <vasile.toncu@tremend.com>:
Hello,
Here is patch 3. I renamed reinterlace to tinterlace and replaced the functionality of tinterlace with the one from reinterlace. Please review.
Thank you, Vasile
Same as I wrote for your previous version. Lots of compiler warnings. Fate tests fail. Please fix. Regards, Thomas
participants (5)
-
Gyan Doshi -
Moritz Barsnick -
Paul B Mahol -
Thomas Mundt -
Vasile Toncu