Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 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 > 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 >> 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 >>> wrote: >>> >>>> Hi, >>>> >>>> 2018-08-16 13:56 GMT+02:00 Vasile Toncu : >>>> >>>> > 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 >>>> >>> >>> >> ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 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 > 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 wrote: >> >>> Hi, >>> >>> 2018-08-16 13:56 GMT+02:00 Vasile Toncu : >>> >>> > 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 >>> >> >> > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 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 wrote: > >> Hi, >> >> 2018-08-16 13:56 GMT+02:00 Vasile Toncu : >> >> > 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 >> > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 wrote: > Hi, > > 2018-08-16 13:56 GMT+02:00 Vasile Toncu : > > > 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 > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
Hi, Thank you for the additional testing effort. Fixed the issue. On Tue, Aug 14, 2018 at 10:25 PM, Thomas Mundt wrote: > Hi, > > 2018-08-14 18:53 GMT+02:00 Vasile Toncu : > > > 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[pl
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
Hi Thomas, I added the log messages. Thanks for the review. On Tue, Aug 14, 2018 at 3:23 PM, Thomas Mundt wrote: > Hi, > > 2018-08-13 0:02 GMT+02:00 Vasile Toncu : > > > 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 > From b2f8fc595312b4b89017c3689dfb80e30b3472ed Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Tue, 24 Jul 2018 12:02:16 +0200 Subject: [PATCH] Patch 3 - Move reinterlace to tinterlace --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 105 libavfilter/tinterlace.h | 96 ++-- libavfilter/vf_reinterlace.c | 775 -- libavfilter/vf_tinterlace.c | 689 +-- libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 102 libavfilter/x86/vf_tinterlace_init.c | 41 +- 10 files changed, 484 insertions(+), 1328 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index e718c1531c..8f42a86f8f 100755 --- a/configure +++ b/configure @@ -3420,7 +3420,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index c8ba079750..245302bbe8 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -246,7 +246,6 @@ 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_tinterlace.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 9956776938..2d19929bdc 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -348,7 +348,6 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index cb512c7639..00 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2017 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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; wi
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 wrote: > Hi, > > 2018-07-24 12:17 GMT+02:00 Vasile Toncu : > > > 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; > > +fr
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
What would be the next steps? On Tue, Jul 24, 2018 at 12:17 PM, Vasile Toncu wrote: > Fixed tabs. > Thank you for the feedback. > > On Fri, Jul 20, 2018 at 7:27 PM, Paul B Mahol wrote: > >> On 7/20/18, Vasile Toncu 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 >> > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
Fixed tabs. Thank you for the feedback. On Fri, Jul 20, 2018 at 7:27 PM, Paul B Mahol wrote: > On 7/20/18, Vasile Toncu 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 > From 965cb710db38ccd57213648c01ba351dc4076293 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Tue, 24 Jul 2018 12:02:16 +0200 Subject: [PATCH] Patch 3 - Move reinterlace to tinterlace --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 105 libavfilter/tinterlace.h | 111 ++-- libavfilter/vf_reinterlace.c | 775 libavfilter/vf_tinterlace.c | 824 +- libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 102 libavfilter/x86/vf_tinterlace_init.c | 41 +- 10 files changed, 633 insertions(+), 1329 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index 5783407bdc..0a33a8dcb3 100755 --- a/configure +++ b/configure @@ -3415,7 +3415,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 49fad08290..5d4549e24c 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -245,7 +245,6 @@ 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_tinterlace.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 874d25e72f..521bc53164 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -347,7 +347,6 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index cb512c7639..00 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2017 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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 - * Reinterlace filter - */ - -#ifndef AVFILTER_REINTERLACE_H -#define AVFILTER_REINTERLACE_H - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "libavutil/bswap.h" - -enum FilterMode { -MODE_MERGE, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, -MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACE_X2, -MODE_MERGE_X2, -MODE_MERGE_TFF, -MODE_MERGE_BFF, -MODE_NB, - }; - -enum FilterFlags { -FLAG_NOTHING= 0x00, -FLAG_VLPF = 0x01, -FLAG_EXACT_TB = 0x02, -FLAG_CVLPF = 0x04, -FLAG_NB -}; - -typedef struct { -const
Re: [FFmpeg-devel] [PATCH 2/5] Added reinterlace filter
Fixed tabs. On Mon, Jul 16, 2018 at 4:50 PM, Vasile Toncu 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 > 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 >> 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 >>> >> >> > From 2e213ec9579e9fd38a9085c437208f1fd54fb423 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 16 Jul 2018 15:24:51 +0200 Subject: [PATCH] Patch 2 - Add reinterlace --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 105 libavfilter/vf_reinterlace.c | 775 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 102 6 files changed, 985 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 5d4549e24c..49fad08290 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -245,6 +245,7 @@ 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_tinterlace.o +OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 521bc53164..874d25e72f 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -347,6 +347,7 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; +extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 00..cb512c7639 --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2017 Vasile Toncu + * Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + * Reinterlace filter + */ + +#ifndef AVFILTER_REINTERLACE_H +#define AVFILTER_REINTERLACE_H + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "libavutil/bswap.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB, + }; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_EXACT_TB = 0x02, +FLAG_CVLPF = 0x04, +FLAG_NB +}; + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int64_t current_frame_index; + +uint8_t *black_vec[4]; +int black_linesize[4]; + +int skip_next_frame; + +void *thread_data; + +uint8_t bit_depth; + +void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 wrote: > Hello, > > I have updated patch 3, it shall work now. > > Thank you, > Vasile Toncu > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
Hello, I have updated patch 3, it shall work now. Thank you, Vasile Toncu From 23bdcea190ccb801e3d5a0eb081fb28b17144452 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 16 Jul 2018 16:13:10 +0200 Subject: [PATCH] Patch 3 - Move reinterlace to tinterlace --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 105 libavfilter/tinterlace.h | 113 ++-- libavfilter/vf_reinterlace.c | 775 libavfilter/vf_tinterlace.c | 822 +- libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 102 libavfilter/x86/vf_tinterlace_init.c | 41 +- 10 files changed, 633 insertions(+), 1329 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index 5783407bdc..0a33a8dcb3 100755 --- a/configure +++ b/configure @@ -3415,7 +3415,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 49fad08290..5d4549e24c 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -245,7 +245,6 @@ 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_tinterlace.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 874d25e72f..521bc53164 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -347,7 +347,6 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index b75a79d7ae..00 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2017 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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 - * Reinterlace filter - */ - -#ifndef AVFILTER_REINTERLACE_H -#define AVFILTER_REINTERLACE_H - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" -#include "libavutil/bswap.h" - -enum FilterMode { -MODE_MERGE, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, - MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACE_X2, -MODE_MERGE_X2, -MODE_MERGE_TFF, -MODE_MERGE_BFF, -MODE_NB, - }; - -enum FilterFlags { -FLAG_NOTHING= 0x00, -FLAG_VLPF = 0x01, -FLAG_EXACT_TB = 0x02, -FLAG_CVLPF = 0x04, -FLAG_NB -}; - -typedef struct { -const AVClass *class; -int mode; -int flags; - -AVFrame *prev_frame, *current_frame; -int64_t current_frame_index; - -uint8_t *black_vec[4]; -int black_linesize[4]; - -int skip_next_frame; - -void *thread_data; - -uint8_t bit_depth; - -void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, - ptrdiff_t mref, ptrdiff_t pref, int clip_max); -
Re: [FFmpeg-devel] [PATCH 2/5] Added reinterlace filter
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 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 > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/5] Added reinterlace filter
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 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 > 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 >> > > From a53d28294cd9ba94d8926d6ba5724e3dc0cf97e5 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 16 Jul 2018 15:24:51 +0200 Subject: [PATCH] Patch 2 - Add reinterlace --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 105 libavfilter/vf_reinterlace.c | 775 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 102 6 files changed, 985 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 5d4549e24c..49fad08290 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -245,6 +245,7 @@ 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_tinterlace.o +OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 521bc53164..874d25e72f 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -347,6 +347,7 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; +extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 00..b75a79d7ae --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2017 Vasile Toncu + * Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + * Reinterlace filter + */ + +#ifndef AVFILTER_REINTERLACE_H +#define AVFILTER_REINTERLACE_H + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "libavutil/bswap.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, + MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB, + }; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_EXACT_TB = 0x02, +FLAG_CVLPF = 0x04, +FLAG_NB +}; + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int64_t current_frame_index; + +uint8_t *black_vec[4]; +int black_linesize[4]; + +int skip_next_frame; + +void *thread_data; + +uint8_t bit_depth; + +void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, + ptrdiff_t mref, ptrdiff_t pref, int clip_max); + +AVRational preout_time_base; + + } ReInterlaceContext; + +#if CONFIG_GPL +void ff_reinterlace_init_x86(ReInterlaceContext *reint
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 >From 5898c531066f8e6c034eb1c882000f60ba4f0cb9 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Tue, 29 May 2018 18:29:06 +0300 Subject: [PATCH] Reint-Patch3 --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 131 -- libavfilter/tinterlace.h | 116 +++-- libavfilter/vf_reinterlace.c | 768 --- libavfilter/vf_tinterlace.c | 834 ++ libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 101 libavfilter/x86/vf_tinterlace_init.c | 41 +- 10 files changed, 651 insertions(+), 1344 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index 22eeca2..20d9eee 100755 --- a/configure +++ b/configure @@ -3400,7 +3400,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 39f9cb7..c68ef05 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -239,7 +239,6 @@ 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_tinterlace.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 0b6f585..b44093d 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -340,7 +340,6 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index 1035a5b..000 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2017 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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 - * Reinterlace filter - */ - -#include - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" - -#include "libavutil/bswap.h" - -enum FilterMode { -MODE_MERGE, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, -MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACE_X2, -MODE_MERGE_X2, -MODE_MERGE_TFF, -MODE_MERGE_BFF, -MODE_NB -}; - -enum FilterFlags { -FLAG_NOTHING= 0x00, -FLAG_VLPF = 0x01, -FLAG_EXACT_TB = 0x02, -FLAG_CVLPF = 0x04, -FLAG_NB -}; - -static const AVRational standard_tbs[] = { -{1, 25}, -{1, 30}, -{1001, 3}, -}; - -typedef struct { -const AVClass *class; -int mode; -int flags; - -AVFrame *prev_frame, *current_frame; -int64_t current_frame_index; - -void *black_vec[4]; - -int skip_next_frame; - -void *thread_data; - -uint8_t bit_depth; - -void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, -
Re: [FFmpeg-devel] [PATCH 2/5] Added reinterlace filter
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 >From 5b19aaac81fd0f5a9d37a1585e2c814414542e2e Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Tue, 29 May 2018 15:54:19 +0300 Subject: [PATCH] Reint-Patch2 --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 133 ++ libavfilter/vf_reinterlace.c | 769 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 101 + 6 files changed, 1006 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index c68ef05..39f9cb7 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -239,6 +239,7 @@ 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_tinterlace.o +OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index b44093d..0b6f585 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -340,6 +340,7 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; +extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 000..6025665 --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2017 Vasile Toncu + * Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + * Reinterlace filter + */ + +#include + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "libavutil/bswap.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB +}; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_EXACT_TB = 0x02, +FLAG_CVLPF = 0x04, +FLAG_NB +}; + +static const AVRational standard_tbs[] = { +{1, 25}, +{1, 30}, +{1001, 3}, +}; + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int64_t current_frame_index; + +void *black_vec[4]; + +int skip_next_frame; + +void *thread_data; + +uint8_t bit_depth; + +void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, + ptrdiff_t mref, ptrdiff_t pref, int clip_max); + +AVRational preout_time_base; + +} ReInterlaceContext; + +#if CONFIG_GPL +void ff_reinterlace_init_x86(ReInterlaceContext *reinterlace); +#endif + +#define OFFSET(x) offsetof(ReInterlaceContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption reinterlace_options[] = { +{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB - 1, FLAGS, "mode" }, +{ "merge", "merge frames",
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 >From 25d4f0154fe2a8bde3a47491f80ce131ebb20330 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Tue, 29 May 2018 18:29:06 +0300 Subject: [PATCH] Reint-Patch3 --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 131 -- libavfilter/tinterlace.h | 156 +-- libavfilter/vf_reinterlace.c | 768 --- libavfilter/vf_tinterlace.c | 826 ++ libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 101 - libavfilter/x86/vf_tinterlace_init.c | 41 +- 10 files changed, 668 insertions(+), 1359 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index 22eeca2..20d9eee 100755 --- a/configure +++ b/configure @@ -3400,7 +3400,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 39f9cb7..c68ef05 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -239,7 +239,6 @@ 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_tinterlace.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.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/allfilters.c b/libavfilter/allfilters.c index 0b6f585..b44093d 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -340,7 +340,6 @@ extern AVFilter ff_vf_thumbnail; extern AVFilter ff_vf_thumbnail_cuda; extern AVFilter ff_vf_tile; extern AVFilter ff_vf_tinterlace; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index 1035a5b..000 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2017 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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 - * Reinterlace filter - */ - -#include - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" - -#include "libavutil/bswap.h" - -enum FilterMode { -MODE_MERGE, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, -MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACE_X2, -MODE_MERGE_X2, -MODE_MERGE_TFF, -MODE_MERGE_BFF, -MODE_NB -}; - -enum FilterFlags { -FLAG_NOTHING= 0x00, -FLAG_VLPF = 0x01, -FLAG_EXACT_TB = 0x02, -FLAG_CVLPF = 0x04, -FLAG_NB -}; - -static const AVRational standard_tbs[] = { -{1, 25}, -{1, 30}, -{1001, 3}, -}; - -typedef struct { -const AVClass *class; -int mode; -int flags; - -AVFrame *prev_frame, *current_frame; -int64_t current_frame_index; - -void *black_vec[4]; - -int skip_next_frame; - -void *thread_data; - -uint8_t bit_depth; - -void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width,
Re: [FFmpeg-devel] [PATCH 2/5] Added reinterlace filter
Hello, Here is patch 2. In this patch I added the reinterlace filter to ffmpeg. Please review. Thank you, Vasile >From 71458a6cba548c9d5a559cdadae7a85a7825e98d Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Tue, 24 Apr 2018 17:46:45 +0300 Subject: [PATCH] Patch2 Signed-off-by: Vasile Toncu --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 125 ++ libavfilter/vf_reinterlace.c | 765 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 102 + 6 files changed, 995 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 8f41805..af702ba 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -294,6 +294,7 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o +OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 643eec2..5488ff4 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -285,6 +285,7 @@ extern AVFilter ff_vf_random; extern AVFilter ff_vf_readeia608; extern AVFilter ff_vf_readvitc; extern AVFilter ff_vf_realtime; +extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_remap; extern AVFilter ff_vf_removegrain; extern AVFilter ff_vf_removelogo; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 000..f90b43a --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2018 Vasile Toncu + * Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "libavutil/bswap.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB +}; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_EXACT_TB = 0x02, +FLAG_CVLPF = 0x04, +FLAG_NB +}; + +static const AVRational standard_tbs[] = { +{1, 25}, +{1, 30}, +{1001, 3}, +}; + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int64_t current_frame_index; + +void *black_vec[4]; + +int skip_next_frame; + +void *thread_data; + +uint8_t bit_depth; + +void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, + ptrdiff_t mref, ptrdiff_t pref, int clip_max); + +AVRational preout_time_base; + +} ReInterlaceContext; + +#if CONFIG_GPL +void ff_reinterlace_init_x86(ReInterlaceContext *reinterlace); +#endif + +#define OFFSET(x) offsetof(ReInterlaceContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption reinterlace_options[] = { +{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB - 1, FLAGS, "mode" }, +{ "merge", "merge frames",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "drop_even", "drop even fr
Re: [FFmpeg-devel] [PATCH 3/5] Renamed reinterlace to tinterlace
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 >From ee33ed769207a99adb193eece32a5043ff0b6d94 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Wed, 25 Apr 2018 11:02:46 +0300 Subject: [PATCH] Patch3 Signed-off-by: Vasile Toncu --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 125 - libavfilter/tinterlace.h | 155 +-- libavfilter/vf_reinterlace.c | 765 --- libavfilter/vf_tinterlace.c | 831 +- libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 102 - libavfilter/x86/vf_tinterlace_init.c | 42 +- 10 files changed, 664 insertions(+), 1360 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index dee507c..d8bc940 100755 --- a/configure +++ b/configure @@ -3388,7 +3388,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index af702ba..8f41805 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -294,7 +294,6 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 5488ff4..643eec2 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -285,7 +285,6 @@ extern AVFilter ff_vf_random; extern AVFilter ff_vf_readeia608; extern AVFilter ff_vf_readvitc; extern AVFilter ff_vf_realtime; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_remap; extern AVFilter ff_vf_removegrain; extern AVFilter ff_vf_removelogo; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index f90b43a..000 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2018 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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 - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" - -#include "libavutil/bswap.h" - -enum FilterMode { -MODE_MERGE, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, -MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACE_X2, -MODE_MERGE_X2, -MODE_MERGE_TFF, -MODE_MERGE_BFF, -MODE_NB -}; - -enum FilterFlags { -FLAG_NOTHING= 0x00, -FLAG_VLPF = 0x01, -FLAG_EXACT_TB = 0x02, -FLAG_CVLPF = 0x04, -FLAG_NB -}; - -static const AVRational standard_tbs[] = { -{1, 25}, -{1, 30}, -{1001, 3}, -}; - -typedef struct { -const AVClass *class; -int mode; -int flags; - -AVFrame *prev_frame, *current_frame; -int64_t current_frame_index; - -void *black_vec[4]; - -int skip_next_frame; - -void *thread_data; - -uint8_t bit_depth; - -void (*lowpass_line)(uint8_t *dstp, ptrdi
Re: [FFmpeg-devel] [PATCH 2/5] reitnerlace - tinterlace-like filter under LGPL
Hello, Here is patches 2. Please review. Thank you, Vasile Toncu >From cb12fbb6de88acfb3f7f54bd83b91661063e92ff Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 23 Apr 2018 18:10:18 +0300 Subject: [PATCH] Patch2 Signed-off-by: Vasile Toncu --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 140 +++ libavfilter/vf_reinterlace.c | 754 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 102 + 6 files changed, 999 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index cfb0f1d..5b503a1 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -291,6 +291,7 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o +OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 68b2992..281eaa5 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -282,6 +282,7 @@ extern AVFilter ff_vf_random; extern AVFilter ff_vf_readeia608; extern AVFilter ff_vf_readvitc; extern AVFilter ff_vf_realtime; +extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_remap; extern AVFilter ff_vf_removegrain; extern AVFilter ff_vf_removelogo; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 000..10832f5 --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2018 Vasile Toncu + * Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "libavutil/bswap.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB +}; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_EXACT_TB = 0x02, +FLAG_CVLPF = 0x04, +FLAG_NB +}; + +static const AVRational standard_tbs[] = { +{1, 25}, +{1, 30}, +{1001, 3}, +}; + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int64_t current_frame_index; + +void *black_vec[4]; + +int skip_next_frame; + +void *thread_data; + +uint8_t bit_depth; + +void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, + ptrdiff_t mref, ptrdiff_t pref, int clip_max); + +AVRational preout_time_base; + +} ReInterlaceContext; + +#if CONFIG_GPL +void ff_reinterlace_init_x86(ReInterlaceContext *reinterlace); +#endif + +#define OFFSET(x) offsetof(ReInterlaceContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption reinterlace_options[] = { +{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB - 1, FLAGS, "mode" }, +{ "merge", "merge frames",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "drop_even", "drop even frames",0, AV_OPT_TYPE_CO
Re: [FFmpeg-devel] [PATCH 3/5] reitnerlace - tinterlace-like filter under LGPL
Hello, Here is patch 3. Please review. Thank you, Vasile >From 180d0b61ca2d835bdc58a17db07d4c79532b1b1e Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 23 Apr 2018 18:59:52 +0300 Subject: [PATCH] Patch3 Signed-off-by: Vasile Toncu --- configure | 1 - libavfilter/Makefile | 1 - libavfilter/allfilters.c | 1 - libavfilter/reinterlace.h | 140 -- libavfilter/tinterlace.h | 170 +-- libavfilter/vf_reinterlace.c | 754 -- libavfilter/vf_tinterlace.c | 842 +- libavfilter/x86/Makefile | 1 - libavfilter/x86/vf_reinterlace_init.c | 102 libavfilter/x86/vf_tinterlace_init.c | 41 +- 10 files changed, 678 insertions(+), 1375 deletions(-) delete mode 100644 libavfilter/reinterlace.h delete mode 100644 libavfilter/vf_reinterlace.c delete mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/configure b/configure index a6f32f8..f1b4935 100755 --- a/configure +++ b/configure @@ -3387,7 +3387,6 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 5b503a1..cfb0f1d 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -291,7 +291,6 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o -OBJS-$(CONFIG_REINTERLACE_FILTER)+= vf_reinterlace.o OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 281eaa5..68b2992 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -282,7 +282,6 @@ extern AVFilter ff_vf_random; extern AVFilter ff_vf_readeia608; extern AVFilter ff_vf_readvitc; extern AVFilter ff_vf_realtime; -extern AVFilter ff_vf_reinterlace; extern AVFilter ff_vf_remap; extern AVFilter ff_vf_removegrain; extern AVFilter ff_vf_removelogo; diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h deleted file mode 100644 index 10832f5..000 --- a/libavfilter/reinterlace.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2018 Vasile Toncu - * Copyright (c) 2017 Thomas Mundt - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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 - -#include "avfilter.h" -#include "formats.h" -#include "internal.h" -#include "video.h" -#include "libavutil/avassert.h" -#include "libavutil/imgutils.h" -#include "libavutil/opt.h" -#include "libavutil/pixdesc.h" - -#include "libavutil/bswap.h" - -enum FilterMode { -MODE_MERGE, -MODE_DROP_EVEN, -MODE_DROP_ODD, -MODE_PAD, -MODE_INTERLEAVE_TOP, -MODE_INTERLEAVE_BOTTOM, -MODE_INTERLACE_X2, -MODE_MERGE_X2, -MODE_MERGE_TFF, -MODE_MERGE_BFF, -MODE_NB -}; - -enum FilterFlags { -FLAG_NOTHING= 0x00, -FLAG_VLPF = 0x01, -FLAG_EXACT_TB = 0x02, -FLAG_CVLPF = 0x04, -FLAG_NB -}; - -static const AVRational standard_tbs[] = { -{1, 25}, -{1, 30}, -{1001, 3}, -}; - -typedef struct { -const AVClass *class; -int mode; -int flags; - -AVFrame *prev_frame, *current_frame; -int64_t current_frame_index; - -void *black_vec[4]; - -int skip_next_frame; - -void *thread_data; - -uint8_t bit_depth; - -void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, - ptrdiff_t mref, ptrdiff_t pref, int clip_max); - -
Re: [FFmpeg-devel] [PATCH 1/6] reitnerlace - tinterlace-like filter under LGPL
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 >From b93c2bc52d1892ffc9dd3f22e409aeeebd4cc163 Mon Sep 17 00:00:00 2001 From: Vasile Toncu 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..000 --- 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..000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara - * Copyright (c) 2017 Thomas Mundt - * - * 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 distri
Re: [FFmpeg-devel] [PATCH 1/6] reitnerlace - tinterlace-like filter under LGPL
Signed-off-by: Vasile Toncu --- 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..000 --- 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..000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara - * Copyright (c) 2017 Thomas Mundt - * - * 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 &q
Re: [FFmpeg-devel] [PATCH 1/6] reitnerlace - tinterlace-like filter under LGPL
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 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..000 --- 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..000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara - * Copyright (c) 2017 Thomas Mundt - * - * 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 th
Re: [FFmpeg-devel] [PATCH 1/6] reitnerlace - tinterlace-like filter under LGPL
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/88e0e2054d911b38662f681bdc267e08312d313a 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 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..000 --- a/libavfilter/vf_interlace.c +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (c) 2003 Michael Zucchi - * Copyright (c) 2010 Baptiste Coudurier - * Copyright (c) 2011 Stefano Sabatini - * Copyright (c) 2013 Vittorio Giovara - * Copyright (c) 2017 Thomas Mundt - * - * 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, -
[FFmpeg-devel] [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 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 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] reitnerlace - tinterlace-like filter under LGPL
On 14.03.2018 18:56, Thomas Mundt wrote: 2018-03-13 16:10 GMT+01:00 Vasile Toncu : On 06.03.2018 20:38, Thomas Mundt wrote: Hi, 2018-03-05 13:48 GMT+01:00 Carl Eugen Hoyos : 2018-03-05 12:37 GMT+01:00, Paul B Mahol : On 3/5/18, Vasile Toncu wrote: Hello, Thanks for the review. I've made changes according to your guidance. It would be great to know if the community will go on with our intention of adding reinterlace as a alternative for tinterlace. That being said, here is the new patch. As already said, this is not acceptable. There is no point in having 2 filters with near same funcionality. If you consider the new filter ok, the existing filter will be removed in the same push. I believe sending only the new filter makes reviewing easier. For me reviewing would be easier when Vasile sends a patchset that includes the replacement of tinterlace filter. That way existing fate tests could be used which are fortunately pretty extensive in this case. Also it would be helpful when you and/or other experienced ffmpeg developers would clarify first which parts of tinterlace have to be rewritten for proper relicensing. Being left in the dark makes working on patches frustrating. Another question is how to deal with vf_interlace? IMHO for the user there should be no difference in output, speed and license. Two options: 1. Relicensing and slice threading will also be ported to vf_interlace 2. The commands from vf_interlace will be included in the new tinterlace filter. vf_interlace will be deleted together with old tinterlace filter I would prefer the second option, but maybe there are even better options that don´t come to my mind. Please comment. Thanks, Thomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Hello everyone, sorry for a delayed response. From what has been discussed in here, I think the reinterlace will exist with tinterlace for a period of time, just after that the tinterlace can be removed. To have the reinterlace added, what is needed to be done from my side? Thanks, Vasile Toncu Two filters with almost the same functionality won´t be accepted, as Paul stated in this thread. Also there is vf_interlace filter, which is a subset of vf_tinterlace and should not differ in speed, output and license. As already said, I would prefer to include vf_interlace options into vf_tinterlace and remove vf_interlace. Also you want several changes: Making tinterlace filter LGPL, adding new options and adding slice threading. This should be done in a patch set: Patch 1/5: Include vf_interlace options into vf_tinterlace filter and remove vf_interlace Hello, Further research I've made showed that vf_tinterlace already contains all the functionality from vf_interlace. I am ready to start the patches. Please confirm. Regards, Vasile Toncu Patch 2/5: Your new LGPL vf_reinterlace filter without the new options, fixes and slice threading Patch 3/5: Rename vf_reinterlace and replace vf_tinterlace by it Patch 4/5: Add slice threading Patch 5/5: Add the new options and fate tests for them Please run fate. All tests should pass. As already said, I don´t have the skills to suggest what has to be done making the relicensing legal. So I can do a technical review only. These are just my suggestions to the best of my knowledge! There might be better ideas from more experienced developers. Please comment. Regards, Thomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] reitnerlace - tinterlace-like filter under LGPL
On 14.03.2018 18:56, Thomas Mundt wrote: 2018-03-13 16:10 GMT+01:00 Vasile Toncu : On 06.03.2018 20:38, Thomas Mundt wrote: Hi, 2018-03-05 13:48 GMT+01:00 Carl Eugen Hoyos : 2018-03-05 12:37 GMT+01:00, Paul B Mahol : On 3/5/18, Vasile Toncu wrote: Hello, Thanks for the review. I've made changes according to your guidance. It would be great to know if the community will go on with our intention of adding reinterlace as a alternative for tinterlace. That being said, here is the new patch. As already said, this is not acceptable. There is no point in having 2 filters with near same funcionality. If you consider the new filter ok, the existing filter will be removed in the same push. I believe sending only the new filter makes reviewing easier. For me reviewing would be easier when Vasile sends a patchset that includes the replacement of tinterlace filter. That way existing fate tests could be used which are fortunately pretty extensive in this case. Also it would be helpful when you and/or other experienced ffmpeg developers would clarify first which parts of tinterlace have to be rewritten for proper relicensing. Being left in the dark makes working on patches frustrating. Another question is how to deal with vf_interlace? IMHO for the user there should be no difference in output, speed and license. Two options: 1. Relicensing and slice threading will also be ported to vf_interlace 2. The commands from vf_interlace will be included in the new tinterlace filter. vf_interlace will be deleted together with old tinterlace filter I would prefer the second option, but maybe there are even better options that don´t come to my mind. Please comment. Thanks, Thomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Hello everyone, sorry for a delayed response. From what has been discussed in here, I think the reinterlace will exist with tinterlace for a period of time, just after that the tinterlace can be removed. To have the reinterlace added, what is needed to be done from my side? Thanks, Vasile Toncu Two filters with almost the same functionality won´t be accepted, as Paul stated in this thread. Also there is vf_interlace filter, which is a subset of vf_tinterlace and should not differ in speed, output and license. As already said, I would prefer to include vf_interlace options into vf_tinterlace and remove vf_interlace. Also you want several changes: Making tinterlace filter LGPL, adding new options and adding slice threading. This should be done in a patch set: Patch 1/5: Include vf_interlace options into vf_tinterlace filter and remove vf_interlace Hi, From what I've researched, it seems that vf_interlace is just an incomplete functionality for vf_tinterlace, so it can be removed directly. Can anyone confirm this? Regards, Vasile Toncu Patch 2/5: Your new LGPL vf_reinterlace filter without the new options, fixes and slice threading Patch 3/5: Rename vf_reinterlace and replace vf_tinterlace by it Patch 4/5: Add slice threading Patch 5/5: Add the new options and fate tests for them Please run fate. All tests should pass. As already said, I don´t have the skills to suggest what has to be done making the relicensing legal. So I can do a technical review only. These are just my suggestions to the best of my knowledge! There might be better ideas from more experienced developers. Please comment. Regards, Thomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] reitnerlace - tinterlace-like filter under LGPL
On 06.03.2018 20:38, Thomas Mundt wrote: Hi, 2018-03-05 13:48 GMT+01:00 Carl Eugen Hoyos : 2018-03-05 12:37 GMT+01:00, Paul B Mahol : On 3/5/18, Vasile Toncu wrote: Hello, Thanks for the review. I've made changes according to your guidance. It would be great to know if the community will go on with our intention of adding reinterlace as a alternative for tinterlace. That being said, here is the new patch. As already said, this is not acceptable. There is no point in having 2 filters with near same funcionality. If you consider the new filter ok, the existing filter will be removed in the same push. I believe sending only the new filter makes reviewing easier. For me reviewing would be easier when Vasile sends a patchset that includes the replacement of tinterlace filter. That way existing fate tests could be used which are fortunately pretty extensive in this case. Also it would be helpful when you and/or other experienced ffmpeg developers would clarify first which parts of tinterlace have to be rewritten for proper relicensing. Being left in the dark makes working on patches frustrating. Another question is how to deal with vf_interlace? IMHO for the user there should be no difference in output, speed and license. Two options: 1. Relicensing and slice threading will also be ported to vf_interlace 2. The commands from vf_interlace will be included in the new tinterlace filter. vf_interlace will be deleted together with old tinterlace filter I would prefer the second option, but maybe there are even better options that don´t come to my mind. Please comment. Thanks, Thomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Hello everyone, sorry for a delayed response. From what has been discussed in here, I think the reinterlace will exist with tinterlace for a period of time, just after that the tinterlace can be removed. To have the reinterlace added, what is needed to be done from my side? Thanks, Vasile Toncu Thanks ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] reitnerlace - tinterlace-like filter under LGPL
Hello, The reinterlace behaves just like the tinterlace and in terms of fps is basically the same. The ASM Opts are used with reinterlace only in case of CONFIG_GPL enabled. There are two new modes, MODE_MERGE_BFF and MODE_MERGE_TFF for which I have documentation. Also reinterlace processes the planes of a frame in separate threads. I've tested it with diferent video formats, and the outputs are correct. Previously there have been acceptance for using some methods form tinterlace. Those methods have nothing to do with old, GPL licensed code, and are doing some trivial stuff. One can check thread starting at [1]. [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-February/224941.html On 3/5/2018 2:53 PM, Paul B Mahol wrote: On 3/5/18, Carl Eugen Hoyos wrote: 2018-03-05 12:37 GMT+01:00, Paul B Mahol : On 3/5/18, Vasile Toncu wrote: Hello, Thanks for the review. I've made changes according to your guidance. It would be great to know if the community will go on with our intention of adding reinterlace as a alternative for tinterlace. That being said, here is the new patch. As already said, this is not acceptable. There is no point in having 2 filters with near same funcionality. If you consider the new filter ok, the existing filter will be removed in the same push. I believe sending only the new filter makes reviewing easier. I'm ok with that, but next commits that do that and also do rename are not available. I'm also not sure can reinterlace filter be cosidered really safe from standpoint that it does not use any old GPL code. Also bunch of stuff it does is trivial, both new and old GPL code so I consider nobody should care about its license. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] reitnerlace - tinterlace-like filter under LGPL
Hello, Thanks for the review. I've made changes according to your guidance. It would be great to know if the community will go on with our intention of adding reinterlace as a alternative for tinterlace. That being said, here is the new patch. Regards, -Vasile Toncu From 7419be6fa213383ed0908976eedfb963837ed738 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 12 Feb 2018 14:16:27 +0200 Subject: [PATCH] Added reitnerlace filter. --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 141 +++ libavfilter/vf_reinterlace.c | 757 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 101 + 6 files changed, 1002 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 6a60836..c3095ba 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -286,6 +286,7 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o +OBJS-$(CONFIG_REINTERLACE_FILTER) += vf_reinterlace.o OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 9adb109..60fb9b5 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -295,6 +295,7 @@ static void register_all(void) REGISTER_FILTER(READEIA608, readeia608, vf); REGISTER_FILTER(READVITC, readvitc, vf); REGISTER_FILTER(REALTIME, realtime, vf); + REGISTER_FILTER(REINTERLACE, reinterlace, vf); REGISTER_FILTER(REMAP, remap, vf); REGISTER_FILTER(REMOVEGRAIN, removegrain, vf); REGISTER_FILTER(REMOVELOGO, removelogo, vf); diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 000..3413a7e --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017 Vasile Toncu + * Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "libavutil/bswap.h" + +enum FilterMode { + MODE_MERGE, + MODE_DROP_EVEN, + MODE_DROP_ODD, + MODE_PAD, + MODE_INTERLEAVE_TOP, + MODE_INTERLEAVE_BOTTOM, + MODE_INTERLACE_X2, + MODE_MERGE_X2, + MODE_MERGE_TFF, + MODE_MERGE_BFF, + MODE_NB +}; + +enum FilterFlags { + FLAG_NOTHING = 0x00, + FLAG_VLPF = 0x01, + FLAG_EXACT_TB = 0x02, + FLAG_CVLPF = 0x04, + FLAG_NB +}; + +static const AVRational standard_tbs[] = { + {1, 25}, + {1, 30}, + {1001, 3}, +}; + +typedef struct { + const AVClass *class; + int mode; + int flags; + + AVFrame *prev_frame, *current_frame; + int64_t current_frame_index; + + void *black_vec[4]; + + int skip_next_frame; + + void *thread_data; + + uint8_t bit_depth; + + void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, + ptrdiff_t mref, ptrdiff_t pref, int clip_max); + + AVRational preout_time_base; + +} ReInterlaceContext; + +#if CONFIG_GPL +void ff_reinterlace_init_x86(ReInterlaceContext *reinterlace); +#endif + +#define OFFSET(x) offsetof(ReInterlaceContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption reinterlace_options[] = { + { "mode", "set mode", OFFSET(mode),
[FFmpeg-devel] reinterlace filter review
Hello, will be there any review for the reinterlace filter [1]. Do you consider adding it to the next release of ffmpeg? Thanks, Vasile Toncu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] reinterlace filter review
On 2/21/2018 12:21 PM, Vasile Toncu wrote: will be there any review for the reinterlace filter [1]. [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-February/225257.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] reitnerlace - tinterlace-like filter under LGPL
Hello, there have been some discussions about tinterlace filter licensing. In the end, I was unable to contact all the authorship holders. The main author, one from MPlayer project, is Michael Zucchi. It is quite probably that the copyright is holden by the company that he worked for, Ximian, which no longer exists. It is less probably that I'll came up with the approval off all the parts involved in this deal. However, some of the later developers of tinterlace agreed to release the parts they wrote under LGPL. I mention here Thomas Mundt and Stefano Sabatini. This being said, I come up with a new filter - reinterlace - which implements all the tinterlace functionalities and adds a few more. The new filter is added to ffmpeg without --enable-gpl and/or --enable-nonfree. However, it these configure options are specified, the reinterlace will use ASM opts, imported from tinterlace. I've used support for 16bit depth video from the code written by Thomas Mundt. I added 2 new modes MERGE_BFF and MERGE_TFF. I've changed MODE_PAD, so it does not drop last frame from the input - tinterlace did so. In terms of performance, reinterlace gives basically the same fps as tinterlace does. Here is the patch thats adds the filter. If everything goes well with this patch, I'll add a new patch that changes current tinterlace with reinterlace. Thanks, -Vasile Toncu From 45010f4b4671edfe1318b84285d09dd28a882d63 Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 12 Feb 2018 14:16:27 +0200 Subject: [PATCH] Added reitnerlace filter. --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/reinterlace.h | 141 +++ libavfilter/vf_reinterlace.c | 773 ++ libavfilter/x86/Makefile | 1 + libavfilter/x86/vf_reinterlace_init.c | 101 + 6 files changed, 1018 insertions(+) create mode 100644 libavfilter/reinterlace.h create mode 100644 libavfilter/vf_reinterlace.c create mode 100644 libavfilter/x86/vf_reinterlace_init.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 6a60836..c3095ba 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -286,6 +286,7 @@ OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o +OBJS-$(CONFIG_REINTERLACE_FILTER) += vf_reinterlace.o OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += vf_removegrain.o OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 9adb109..60fb9b5 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -295,6 +295,7 @@ static void register_all(void) REGISTER_FILTER(READEIA608, readeia608, vf); REGISTER_FILTER(READVITC, readvitc, vf); REGISTER_FILTER(REALTIME, realtime, vf); + REGISTER_FILTER(REINTERLACE, reinterlace, vf); REGISTER_FILTER(REMAP, remap, vf); REGISTER_FILTER(REMOVEGRAIN, removegrain, vf); REGISTER_FILTER(REMOVELOGO, removelogo, vf); diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 000..bb66f63 --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017 Vasile Toncu + Copyright (c) 2017 Thomas Mundt + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +#include "libavutil/bswap.h" + +enum FilterMode { + MODE_MERGE, + MODE_DROP_EVEN, + MODE_DROP_ODD, + MODE_PAD, + MODE_INTERLEAVE_TOP, + MODE_INTERLEAVE_BOTTOM, + MODE_INTERLACE_X2, + MOD
Re: [FFmpeg-devel] tinterlace license
Shall I start a new thread for the patch with the new filter, or can I use this one? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] tinterlace license
From the git history I figured out that they wrote a quite big part of tinterlace. Other parts are written mainly by the maintainers of ffmpeg project. Look at the first commit: lavfi: port tinterlace filter from MPlayer That means you need to look at the MPlayer history too to know all the authors. Yes, you are right. It is Mr. Michael Zucchi who holds the authorship for tinterlace in MPlayer. The ximian company is dead/acquired since 2003. I'll try to get in touch with Michael. Thanks, -Vasile Toncu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] tinterlace license
Hello, Then the best solution - imo! - is that you send a patch that adds your new filter that uses the existing asm optimizations if FFmpeg was configured for GPL. First send one patch only adding a new filter (with a new name) to get some technical review I'll send a patch with my new filter, to have some review. One possible procedure for a change that can actually be committed is that you send two patches: One that removes the existing filter (but not the asm code) and one that adds your new filter. If everything goes well, I'll go on with this step too. At this moment, two people agreed to change the license of the tinterlace - Thomas Mundt and Stefano Sabatini. From the git history I figured out that they wrote a quite big part of tinterlace. Other parts are written mainly by the maintainers of ffmpeg project. That being said, will it be possible to change the tinterlace to LGPL? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] tinterlace license
Yes, I wrote one, reinterlace. It implements tinterlace functionality as it was on version n3.0.2, without ASM opts. Sorry if you have already answered this question: Can the existing asm optimizations be used with the filter you wrote? Yes, I can integrate them with my filter. -Vasile Toncu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] tinterlace license
I'm looking forward to modify *tinterlace* filter from GPL to LGPL. I was under the impression you had already written a new filter licensed under LGPL: What happened to it? Yes, I wrote one, reinterlace. It implements tinterlace functionality as it was on version n3.0.2, without ASM opts. First, I was thinking to update it, to meet the current tinterlace version. But, it can save a lot of work if the copyright holder would agree to change the license. From previous emails, I found that this has been done in the past with other ffmpeg components. Do you believe that this can be done with tinterlace? -Vasile ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] tinterlace license
Hello, I'm looking forward to modify *tinterlace* filter from GPL to LGPL. The ASM opts will remain under GPL. Previously I tried to make a whole new filter, *reinterlace*, that acts just like tinterlace, but it happens that this task results in unnecessary duplicated code. I want to address the main copyright holders Thomas Mundt, Stefano Sabatini, Baptiste Coudurier and other ffmpeg maintainers for their approval. Here is the path for the new changes: From 6cd7a4c7a963baacd9bdcc1b5ded8eef78de521b Mon Sep 17 00:00:00 2001 From: Vasile Toncu Date: Mon, 5 Feb 2018 12:32:30 +0200 Subject: [PATCH] Converted tinterlace from GPL to LGPL, expect the part with ASM opts. --- Changelog | 1 + configure | 2 +- libavfilter/tinterlace.h | 8 +--- libavfilter/vf_tinterlace.c | 10 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index 7a73447..aae5564 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. version : +- Made tinterlace filter LGPL, expect the part with ASM opts - Bitstream filters for editing metadata in H.264, HEVC and MPEG-2 streams - Dropped support for OpenJPEG versions 2.0 and below. Using OpenJPEG now requires 2.1 (or later) and pkg-config. diff --git a/configure b/configure index 2711382..f58038f 100755 --- a/configure +++ b/configure @@ -3281,7 +3281,7 @@ stereo3d_filter_deps="gpl" subtitles_filter_deps="avformat avcodec libass" super2xsai_filter_deps="gpl" pixfmts_super2xsai_test_deps="super2xsai_filter" -tinterlace_filter_deps="gpl" +tinterlace_filter_deps="" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h index b5c39aa..ceda17c 100644 --- a/libavfilter/tinterlace.h +++ b/libavfilter/tinterlace.h @@ -6,16 +6,16 @@ * 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 + * it under the terms of the GNU Lesser 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. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along + * You should have received a copy of the GNU Lesser 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. */ @@ -67,6 +67,8 @@ typedef struct TInterlaceContext { ptrdiff_t mref, ptrdiff_t pref, int clip_max); } TInterlaceContext; +#ifdef CONFIG_GPL void ff_tinterlace_init_x86(TInterlaceContext *interlace); +#endif #endif /* AVFILTER_TINTERLACE_H */ diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index f13791d..238704e 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -7,16 +7,16 @@ * 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 + * it under the terms of the GNU Lesser 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. + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License along + * You should have received a copy of the GNU Lesser 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. */ @@ -262,15 +262,19 @@ static int config_out_props(AVFilterLink *outlink) tinterlace->lowpass_line = lowpass_line_complex_c_16; else tinterlace->lowpass_line = lowpass_line_complex_c; +#ifdef CONFIG_GPL if (ARCH_X86) ff_tinterlace_init_x86(tinterlace); +#endif } else if (tinterlace->flags & TINTERLACE_FLAG_VLPF) { if (tinterlace->csp->comp[0].depth &
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
Hello, From the messages regarding the new reinterlace filter, based on your arguments and guidance, I came out with the following solution. Modify tinterlace filter so that it would behave like that: /if GONGIG_GPL is defined:/ / use curent titnerlace code with asm opts/ /else:/ / use the new reitnerlace filter, without asm opts/ After that I'll make sure that the new tinterlace gets compiled in ffmpeg without /--enable-gpl/ and /--enable-nonfree/. However, if one decides to use old tinterlace code with asm opts, he can use those configure flags. That being said, can the new tinterlace be released under LGPL? It is important for me to confirm once again this, to avoid writing new code that will have no future life. On 28.12.2017 17:30, Nicolas George wrote: Vasile Toncu (2017-12-28): Is submision to an older version possible? No. Branches are only maintained for bugs. New development only happens on Git head. Regards, ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
Thank you for your guidance. I understand your points. I was thinking about a simple solution: Can it be submitted on a new branch, different than master? In the future I may replace the tinterlace to be LGPL, until then can reinterlace exist on a separate branch in git? On Fri, Dec 29, 2017 at 12:14 AM, Carl Eugen Hoyos wrote: > 2017-12-28 16:12 GMT+01:00 Vasile Toncu : > > > Is there anything that I can do to the current version of reinterlace > > so that the filter can be accepted? > > Wasn't this already explained? > Add the existing (GPL'd) asm optimizations to your new filter (and > make sure the filter works both with and without --enable-gpl). > > Or do I miss something? > > Carl Eugen > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
On Thu, 28 Dec 2017 at 17:14, Nicolas George wrote: > Vasile Toncu (2017-12-28): > > Is there anything that I can do to the current version of reinterlace so > > that the filter can be accepted? > > For me, yes: make it fully compatible with tinterlace and call it that. > The reinterlace is compatible with tinterlace on ffmpeg version n3.0.2 Will the same issues regarding the submission rise if I trie to submit the filter to an older branch (3.0.2n)? Is submision to an older version possible? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
On Thu, 28 Dec 2017 at 15:41, Nicolas George wrote: > Vasile Toncu (2017-12-28): > > There are some features that tinterlace has and reinterlace does not. > > > > Tinterlace has some more flags, reinterlace has only simple low pass > filter. > > Also, in a newer version, tinterlace does support input formats on 16 > bit. > > > > Expecting these two, there are no other special features. > > Thanks for that. I suspect that tinterlace is also faster. I suggest you > run some benchmarks. I run some benchmarks and reinterlace has basicaly the same performance as tinterlace. For some modes, tinterlace is up to 5% faster. I run my tests on an win64 machine and on an linux x64. > > > 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. > > The second is probably only acceptable if the new filter has all the > features and performance of the old one. Is there anything that I can do to the current version of reinterlace so that the filter can be accepted? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
On 28.12.2017 15:17, Nicolas George wrote: Vasile Toncu (2017-12-28): Are there any features that tinterlace has and this new filter has not? If not, then I think it would be better to just replace tinterlace entirely. You did not answer the question. I asked if there are features in tinterlace that are not in reinterlace. You answered the opposite question. There are some features that tinterlace has and reinterlace does not. Tinterlace has some more flags, reinterlace has only simple low pass filter. Also, in a newer version, tinterlace does support input formats on 16 bit. Expecting these two, there are no other special features. I can answer myself: tinterlace has asm optimizations. This is not for me only to decide, but I am rather against having duplicated features just for licensing reasons. In this particular instance, I think you could use the GPL asm optimizations while having the filter itself LGPL. Your arguments are valid, but what happens if I want to use a GPL tinterlace in an closed source application that will be distributed. You cannot. But making tinterlace LGPL would solve that for you just the same as adding yet another filter that does the same thing. Can one simply change the tinterlace from GPL to LGPL? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
On 27.12.2017 15:31, Nicolas George wrote: Vasile Toncu (2017-12-27): It is because of licencing issues. I wanted the new filter to be LGPL. Thanks for the explanation. That is a valid reason. But as is, it would result would be duplicated code for people who do not worry about licensing. Are there any features that tinterlace has and this new filter has not? If not, then I think it would be better to just replace tinterlace entirely. The main difference between those those two filters is that reinterlace processes planes of output frames in parallel. Another difference is that reinterlace introduces two new modes, which are described at [1] I can answer myself: tinterlace has asm optimizations. This is not for me only to decide, but I am rather against having duplicated features just for licensing reasons. In this particular instance, I think you could use the GPL asm optimizations while having the filter itself LGPL. Your arguments are valid, but what happens if I want to use a GPL tinterlace in an closed source application that will be distributed. [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2017-December/223066.html ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] reinterlace filter
c b/libavfilter/vf_reinterlace.c new file mode 100644 index 000..5383b7b --- /dev/null +++ b/libavfilter/vf_reinterlace.c @@ -0,0 +1,711 @@ +/* + * Copyright (c) 2017 Vasile Toncu + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + * Reinterlace filter + * + * @author Vasile Toncu ( toncu.vasile gmail com ) + * + * @see https://en.wikipedia.org/wiki/Interlaced_video + */ + + +#include + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" +#include "libavutil/avassert.h" +#include "libavutil/imgutils.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB +}; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_NB +}; + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int64_t current_frame_index; + +uint8_t *black_vec[4]; + +int skip_next_frame; + +void *thread_data; + +} ReInterlaceContext; + +#define OFFSET(x) offsetof(ReInterlaceContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption reinterlace_options[] = { +{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB - 1, FLAGS, "mode" }, +{ "merge", "merge frames",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "drop_even", "drop even frames",0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_EVEN},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "drop_odd", "drop odd frames", 0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_ODD}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "pad", "pad lines of a frame with black lines", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PAD}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "interleave_top","interleave top and bottom frames", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "interleave_bottom", "interleave bottom and top frames",0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "interlacex2", "interlace consecutive frames", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLACE_X2}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "mergex2", "just like merge, but at the same frame rate", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE_X2}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "merge_tff", "merge frames using top_field_first information", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE_TFF},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "merge_bff", "Mmerge frames using top_field_first information", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE_BFF},INT_MIN, INT_MAX, FLAGS, "mode"}, + +{ "flags", "add flag for reinterlace", OFFSET(flags), AV_OPT_TYPE_INT, {.i64=FLAG_NOTHING}, 0, 0xFF, FLAGS, "flags" }, +{ "low_pass_filter", "low pass fitler", 0, AV_OPT_TYPE_CONST, {.i64 = FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags"}, +{ "vlpf", "low pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags"}, +{ NULL } +}; + +AVFILTER_DEFINE_CLASS(reinterlace); + +#define IS_ODD(value) (value & 1) + +typedef struct ReInterlaceThreadData { +AVFrame *out, *first, *seco
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
> > The reinterlace filter does various interlace/interleave/merge operations > > between consecutive frames of a video. It tries too behave just like > > tinterlace filter, including some new modes. Why not add the new modes to the tinterlace filter, then? > It is because of licencing issues. I wanted the new filter to be LGPL. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] added reitnerlace filter
Hello, The reinterlace filter does various interlace/interleave/merge operations between consecutive frames of a video. It tries too behave just like tinterlace filter, including some new modes. On Wed, Dec 27, 2017 at 2:50 PM, Paul B Mahol wrote: > Hi, > > On 12/27/17, Vasile Toncu wrote: > > --- > > doc/filters.texi | 87 ++- > > libavfilter/Makefile | 2 + > > libavfilter/allfilters.c | 2 + > > libavfilter/reinterlace.h| 130 ++ > > libavfilter/vf_reinterlace.c | 597 > > +++ > > 5 files changed, 812 insertions(+), 6 deletions(-) > > create mode 100644 libavfilter/reinterlace.h > > create mode 100644 libavfilter/vf_reinterlace.c > > > > Its not obvious from code and documentation what this does. > > Why is this needed? At least provide some scenario where this is useful. > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] added reitnerlace filter
- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -306,6 +306,8 @@ void avfilter_register_all(void) REGISTER_FILTER(NULLSINK, nullsink, vsink); +REGISTER_FILTER(REINTERLACE,reinterlace,vf); + /* multimedia filters */ REGISTER_FILTER(ADRAWGRAPH, adrawgraph, avf); REGISTER_FILTER(AHISTOGRAM, ahistogram, avf); diff --git a/libavfilter/reinterlace.h b/libavfilter/reinterlace.h new file mode 100644 index 000..924f347 --- /dev/null +++ b/libavfilter/reinterlace.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2017 Vasile Toncu + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser 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 + * Reinterlace filter + * + * @author Vasile Toncu ( toncu.vasile gmail com ) + * + * @see https://en.wikipedia.org/wiki/Interlaced_video + */ + +#include + +#include "libavutil/avassert.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "libavutil/imgutils.h" +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "video.h" + +enum FilterMode { +MODE_MERGE, +MODE_DROP_EVEN, +MODE_DROP_ODD, +MODE_PAD, +MODE_INTERLEAVE_TOP, +MODE_INTERLEAVE_BOTTOM, +MODE_INTERLACE_X2, +MODE_MERGE_X2, +MODE_MERGE_TFF, +MODE_MERGE_BFF, +MODE_NB +}; + +enum FilterFlags { +FLAG_NOTHING= 0x00, +FLAG_VLPF = 0x01, +FLAG_NB +}; + + +typedef struct { +const AVClass *class; +int mode; +int flags; + +AVFrame *prev_frame, *current_frame; +int current_frame_index; + +uint8_t *black_vec[4]; + +int skip_next_frame; + +void *thread_data; + +} ReInterlaceContext; + +#define OFFSET(x) offsetof(ReInterlaceContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM + +static const AVOption reinterlace_options[] = { +{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_MERGE}, 0, MODE_NB - 1, FLAGS, "mode" }, +{ "merge", "MODE_MERGE",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "drop_even", "MODE_DROP_EVEN",0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_EVEN},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "drop_odd", "MODE_DROP_ODD", 0, AV_OPT_TYPE_CONST, {.i64=MODE_DROP_ODD}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "pad", "MODE_PAD", 0, AV_OPT_TYPE_CONST, {.i64=MODE_PAD}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "interleave_top","MODE_INTERLEAVE_TOP", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_TOP}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "interleave_bottom", "MODE_INTERLEAVE_BOTTOM",0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLEAVE_BOTTOM},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "interlacex2", "MODE_INTERLACE_X2", 0, AV_OPT_TYPE_CONST, {.i64=MODE_INTERLACE_X2}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "mergex2", "MODE_MERGE_X2", 0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE_X2}, INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "merge_tff", "MODE_MERGE_TFF",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE_TFF},INT_MIN, INT_MAX, FLAGS, "mode"}, +{ "merge_bff", "MODE_MERGE_BFF",0, AV_OPT_TYPE_CONST, {.i64=MODE_MERGE_BFF},INT_MIN, INT_MAX, FLAGS, "mode"}, + +{ "flags", "add flag for reinterlace", OFFSET(flags), AV_OPT_TYPE_INT, {.i64=FLAG_NOTHING}, 0, 0xFF, FLAGS, "flags" }, +{ "low_pass_filter", "FLAG_VLPF", 0, AV_OPT_TYPE_CONST, {.i64 = FLAG_VLPF}, INT_MIN, INT_MAX, FLAGS, "flags"}, +{ "vlpf", "FLAG_VLPF", 0, AV_OPT_T