Re: [FFmpeg-devel] [PATCH] Optimize libavformat/metadata.c
Hi Marton, On Wed, 7 Nov 2018 10:29:31 +0100 (CET) Marton Balint wrote: > On Wed, 7 Nov 2018, Shlomi Fish wrote: > > > On Wed, 4 Jul 2018 23:10:46 +0300 > > Shlomi Fish wrote: > > > > Ping/bump! Can this patch be reviewed already? > > Does your patch has any measureable speed difference for some streams? It > seems like a very micro optimialization, because ff_metadata_conv bails > out early as well. > First of all note that I recall it being the case for several function calls in succession there. Secondly, I didn't measure it, but see what I wrote at: https://en.wikibooks.org/wiki/Optimizing_Code_for_Speed/Factor_Optimizations#Are_%22Small%22_Optimizations_Desirable? non-inline function calls can be quite slow. > Regards, > Marton > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- - Shlomi Fish http://www.shlomifish.org/ http://www.shlomifish.org/humour/bits/Can-I-SCO-Now/ - “Can I SCO Now?” You name it — COBOL does not have it. — http://is.gd/ClKAz5 Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Optimize libavformat/metadata.c
On Wed, 4 Jul 2018 23:10:46 +0300 Shlomi Fish wrote: Ping/bump! Can this patch be reviewed already? -- - Shlomi Fish http://www.shlomifish.org/ http://www.shlomifish.org/humour/bits/facts/Emma-Watson/ The Zeroth Rule of Fight Club is that Chuck Norris can talk about Fight Club. No one tells Chuck Norris what not to do. — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Optimize libavformat/metadata.c
On Fri, 20 Jul 2018 14:31:55 +0300 Shlomi Fish wrote: > On Wed, 11 Jul 2018 19:42:09 +0300 > Shlomi Fish wrote: > > > On Wed, 4 Jul 2018 23:10:46 +0300 > > Shlomi Fish wrote: > > > > Ping! Can this patch be reviewed please? > > > > Ping! bump / ping. -- ----- Shlomi Fish http://www.shlomifish.org/ My Aphorisms - http://www.shlomifish.org/humour.html Tomorrow never dies, unless Chuck Norris volunteers to take it out of its misery. — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] GSOC Complete
On Wed, 22 Aug 2018 14:33:52 +0530 Gagandeep Singh wrote: > Hi, > > I would like to thank all the FFmpeg developers who have helped me in my 3 > months of project. durandal_1707 thanks for the last minute check on the > file. > > I also thank my mentor kierank, for his faith in me even though during the > second month i was not feeling that i would be able to work on it anymore. > > I would continue to be involved in FFmpeg development (in my capacity - > only a B.Tech student here :\ ). > > I also know that the project was comparatively easier and could have been > finished sooner, so thanks for being patient with me. > Thanks Gagandeep and all! > Sincerely > Gagandeep Singh > GSOC 2018 > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- ----- Shlomi Fish http://www.shlomifish.org/ http://shlomifishswiki.branchable.com/Self-Sufficiency/ There are no deletionists. Only Wikipedia articles which Chuck Norris allows to live. (By: joeyadams) — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Optimize libavformat/metadata.c
On Wed, 11 Jul 2018 19:42:09 +0300 Shlomi Fish wrote: > On Wed, 4 Jul 2018 23:10:46 +0300 > Shlomi Fish wrote: > > Ping! Can this patch be reviewed please? > Ping! > -- ----- Shlomi Fish http://www.shlomifish.org/ Summer Glau Facts - http://shlom.in/sglau-facts He who reinvents the wheel, will understand much better how a wheel works. — http://www.shlomifish.org/humour.html Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Optimize libavformat/metadata.c
On Wed, 4 Jul 2018 23:10:46 +0300 Shlomi Fish wrote: Ping! Can this patch be reviewed please? -- - Shlomi Fish http://www.shlomifish.org/ Parody of "The Fountainhead" - http://shlom.in/towtf When Chuck Norris uses git, he takes a coffee break after initiating every git commit. And then he waits for the commit to finish. — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Optimize libavformat/metadata.c
-- - Shlomi Fish http://www.shlomifish.org/ What does “Zionism” mean? - http://shlom.in/def-zionism It is impossible to make anything foolproof because fools are so ingenious. — Source Unknown Please reply to list if it's a mailing list post - http://shlom.in/reply . >From 98e0629d28394f8683abd98f80645ee63b295d24 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 4 Jul 2018 22:53:08 +0300 Subject: [PATCH] Short-circuit several calls on a condition. This is an optimization - more details in the comment in the changeset. --- libavformat/metadata.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/metadata.c b/libavformat/metadata.c index b9b6de7972..4b720efd38 100644 --- a/libavformat/metadata.c +++ b/libavformat/metadata.c @@ -60,6 +60,10 @@ void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv) { int i; +/* We pass those to all ff_metadata_conv calls below and it returns + * immediately if they are equal, so we can short-circuit. */ +if (d_conv == s_conv) +return; ff_metadata_conv(&ctx->metadata, d_conv, s_conv); for (i=0; inb_streams ; i++) ff_metadata_conv(&ctx->streams [i]->metadata, d_conv, s_conv); -- 2.18.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Refactor two near-identical clauses - take 2
On Wed, 4 Jul 2018 18:55:42 +0200 Carl Eugen Hoyos wrote: > 2018-06-28 10:52 GMT+02:00, Shlomi Fish : > > > Attached is the 2nd take of the patch for vf_weave.c. Please review. > > Patch applied. > Thanks! > Thank you, Carl Eugen > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- ----- Shlomi Fish http://www.shlomifish.org/ http://www.shlomifish.org/humour/Summerschool-at-the-NSA/ He who reinvents the wheel, will understand much better how a wheel works. — http://www.shlomifish.org/humour.html Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Refactor two near-identical clauses - take 2
Hi, On Wed, 4 Jul 2018 18:45:09 +0200 Carl Eugen Hoyos wrote: > 2018-06-28 10:52 GMT+02:00, Shlomi Fish : > > > Attached is the 2nd take of the patch for vf_weave.c. Please review. > > For future patches: > > > The changes contained in this patch are hereby placed under the Expat > > licence. > > If you add a new file (like a new filter or decoder) please feel free > to use the MIT license if you prefer it over the LGPL. > If you change a small number of lines in an existing file, please avoid > this, two developers already spent time on this unneeded line. > my intention in that was to avoid licensing my changes under the LGPL, so future maintainers will be able to change the licence of the file to a different one, should it be desirable. Next time, I will provide a better phrasing, however. > Carl Eugen > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel -- ----- Shlomi Fish http://www.shlomifish.org/ http://is.gd/KNvczZ - The FSF Announces New Versions of the GPL He who has more is not happier than he who wants less. — Source unknown, via Nadav Har’El. Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Refactor two near-identical clauses - take 2
On Thu, 28 Jun 2018 11:52:10 +0300 Shlomi Fish wrote: > Hi all! > > Attached is the 2nd take of the patch for vf_weave.c. Please review. > Ping. -- ----- Shlomi Fish http://www.shlomifish.org/ My Aphorisms - http://www.shlomifish.org/humour.html Television is a medium because anything well done is rare. — attributed to both Fred Allen and Ernie Kovacs Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Refactor two near-identical clauses - take 2
Hi all! Attached is the 2nd take of the patch for vf_weave.c. Please review. -- - Shlomi Fish http://www.shlomifish.org/ Freecell Solver - http://fc-solve.shlomifish.org/ Chuck Norris once counted all the real numbers on his fingers. (by: ZadYree) — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ Please reply to list if it's a mailing list post - http://shlom.in/reply . >From c94e6cc8272e2bdb1d23014814dde02eafd739a6 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 28 Jun 2018 11:42:45 +0300 Subject: [PATCH] Refactor two near-identical clauses. The changes contained in this patch are hereby placed under the Expat licence. Share and enjoy! All tests pass. This is a revised version of the first patch, after incorporating some input. --- libavfilter/vf_weave.c | 32 +--- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c index 037f5d1cf2..663d79f511 100644 --- a/libavfilter/vf_weave.c +++ b/libavfilter/vf_weave.c @@ -84,6 +84,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out; int i; +int weave; +int field1, field2; if (!s->prev) { s->prev = in; @@ -98,26 +100,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } av_frame_copy_props(out, in); +weave = (s->double_weave && !(inlink->frame_count_out & 1)); +field1 = weave ? s->first_field : (!s->first_field); +field2 = weave ? (!s->first_field) : s->first_field; for (i = 0; i < s->nb_planes; i++) { -if (s->double_weave && !(inlink->frame_count_out & 1)) { -av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field, -out->linesize[i] * 2, -in->data[i], in->linesize[i], -s->linesize[i], s->planeheight[i]); -av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field, -out->linesize[i] * 2, -s->prev->data[i], s->prev->linesize[i], -s->linesize[i], s->planeheight[i]); -} else { -av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field, -out->linesize[i] * 2, -in->data[i], in->linesize[i], -s->linesize[i], s->planeheight[i]); -av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field, -out->linesize[i] * 2, -s->prev->data[i], s->prev->linesize[i], -s->linesize[i], s->planeheight[i]); -} +av_image_copy_plane(out->data[i] + out->linesize[i] * field1, +out->linesize[i] * 2, +in->data[i], in->linesize[i], +s->linesize[i], s->planeheight[i]); +av_image_copy_plane(out->data[i] + out->linesize[i] * field2, +out->linesize[i] * 2, +s->prev->data[i], s->prev->linesize[i], +s->linesize[i], s->planeheight[i]); } out->pts = s->double_weave ? s->prev->pts : in->pts / 2; -- 2.18.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Fw: [PATCH] Refactor two near-identical clauses.
Hi Michael! Thanks for your review. On Thu, 28 Jun 2018 02:38:51 +0200 Michael Niedermayer wrote: > On Sun, Jun 17, 2018 at 03:40:19PM +0300, Shlomi Fish wrote: > > On Sun, 17 Jun 2018 03:05:27 +0200 > > Michael Niedermayer wrote: > > > > > On Tue, Jun 12, 2018 at 12:53:20PM +0300, Shlomi Fish wrote: > > > > This message did not arrive to the list after three submissions. > > > > > > > > Begin forwarded message: > > > > > > > > Date: Tue, 12 Jun 2018 12:42:52 +0300 > > > > From: Shlomi Fish > > > > To: ffmpeg-devel@ffmpeg.org > > > > Cc: Shlomi Fish > > > > Subject: [PATCH] Refactor two near-identical clauses. > > > > > > > > > > > > Placed under the Expat licence . All tests pass. > > > > --- > > > > libavfilter/vf_weave.c | 33 ++--- > > > > 1 file changed, 14 insertions(+), 19 deletions(-) > > > > > > > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c > > > > index 037f5d1cf2..be371201e1 100644 > > > > --- a/libavfilter/vf_weave.c > > > > +++ b/libavfilter/vf_weave.c > > > > @@ -23,6 +23,7 @@ > > > > #include "libavutil/pixdesc.h" > > > > #include "avfilter.h" > > > > #include "internal.h" > > > > +#include > > > > > > > > typedef struct WeaveContext { > > > > const AVClass *class; > > > > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > > > *in) AVFilterLink *outlink = ctx->outputs[0]; > > > > AVFrame *out; > > > > int i; > > > > +bool weave; > > > > +int field1, field2; > > > > > > > > if (!s->prev) { > > > > s->prev = in; > > > > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, > > > > AVFrame *in) } > > > > av_frame_copy_props(out, in); > > > > > > > > +weave = (s->double_weave && !(inlink->frame_count_out & 1)); > > > > +field1 = s->first_field * weave; > > > > +field2 = s->first_field * !weave; > > > > for (i = 0; i < s->nb_planes; i++) { > > > > -if (s->double_weave && !(inlink->frame_count_out & 1)) { > > > > -av_image_copy_plane(out->data[i] + out->linesize[i] * > > > > s->first_field, > > > > > > this seems to be corrupted by line breaks > > > > > > > Well, the git send-email email was silently dropped three times... See: > > > > http://www.shlomifish.org/Files/files/code/0001-Refactor-two-near-identical-clauses.patch > > > > also attached here. Email has sadly become unreliable. > > > > > [...] > > > > > > > > > > vf_weave.c | 33 ++--- > > 1 file changed, 14 insertions(+), 19 deletions(-) > > f5a0afe735e322c2539a11dd7d8b28534d96c99c > > 0001-Refactor-two-near-identical-clauses.patch From > > b6678799848297cd7079085035259baf6d8c54f0 Mon Sep 17 00:00:00 2001 From: > > Shlomi Fish Date: Fri, 25 May 2018 23:44:54 +0300 > > Subject: [PATCH] Refactor two near-identical clauses. > > > > Placed under the Expat licence . All tests pass. > > --- > > libavfilter/vf_weave.c | 33 ++--- > > 1 file changed, 14 insertions(+), 19 deletions(-) > > > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c > > index 037f5d1cf2..be371201e1 100644 > > --- a/libavfilter/vf_weave.c > > +++ b/libavfilter/vf_weave.c > > @@ -23,6 +23,7 @@ > > #include "libavutil/pixdesc.h" > > #include "avfilter.h" > > #include "internal.h" > > +#include > > > > typedef struct WeaveContext { > > const AVClass *class; > > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) > > AVFilterLink *outlink = ctx->outputs[0]; > > AVFrame *out; > > int i; > > +bool weave; > > +int field1, field2; > > > > if (!s->prev) { > > s->prev = in; > > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > *in) } > > av_frame_copy_props(out, in); > > > > +weave = (s->double_weave && !(inlink->f
Re: [FFmpeg-devel] Fw: [PATCH] Refactor two near-identical clauses.
On Sun, 17 Jun 2018 15:40:19 +0300 Shlomi Fish wrote: > On Sun, 17 Jun 2018 03:05:27 +0200 > Michael Niedermayer wrote: > > > On Tue, Jun 12, 2018 at 12:53:20PM +0300, Shlomi Fish wrote: > > > This message did not arrive to the list after three submissions. > > > > > > Begin forwarded message: > > > > > > Date: Tue, 12 Jun 2018 12:42:52 +0300 > > > From: Shlomi Fish > > > To: ffmpeg-devel@ffmpeg.org > > > Cc: Shlomi Fish > > > Subject: [PATCH] Refactor two near-identical clauses. > > > > > > > > > Placed under the Expat licence . All tests pass. > > > --- > > > libavfilter/vf_weave.c | 33 ++--- > > > 1 file changed, 14 insertions(+), 19 deletions(-) > > > > > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c > > > index 037f5d1cf2..be371201e1 100644 > > > --- a/libavfilter/vf_weave.c > > > +++ b/libavfilter/vf_weave.c > > > @@ -23,6 +23,7 @@ > > > #include "libavutil/pixdesc.h" > > > #include "avfilter.h" > > > #include "internal.h" > > > +#include > > > > > > typedef struct WeaveContext { > > > const AVClass *class; > > > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > > *in) AVFilterLink *outlink = ctx->outputs[0]; > > > AVFrame *out; > > > int i; > > > +bool weave; > > > +int field1, field2; > > > > > > if (!s->prev) { > > > s->prev = in; > > > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > > *in) } > > > av_frame_copy_props(out, in); > > > > > > +weave = (s->double_weave && !(inlink->frame_count_out & 1)); > > > +field1 = s->first_field * weave; > > > +field2 = s->first_field * !weave; > > > for (i = 0; i < s->nb_planes; i++) { > > > -if (s->double_weave && !(inlink->frame_count_out & 1)) { > > > -av_image_copy_plane(out->data[i] + out->linesize[i] * > > > s->first_field, > > > > this seems to be corrupted by line breaks > > > > Well, the git send-email email was silently dropped three times... See: > > http://www.shlomifish.org/Files/files/code/0001-Refactor-two-near-identical-clauses.patch > > also attached here. Email has sadly become unreliable. > Ping! Please review. > > [...] > > > > -- - Shlomi Fish http://www.shlomifish.org/ UNIX Fortune Cookies - http://www.shlomifish.org/humour/fortunes/ Every successful open source project will eventually spawn a sub‐project. — http://www.shlomifish.org/humour/fortunes/osp_rules.html Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Fw: [PATCH] Refactor two near-identical clauses.
On Sun, 17 Jun 2018 03:05:27 +0200 Michael Niedermayer wrote: > On Tue, Jun 12, 2018 at 12:53:20PM +0300, Shlomi Fish wrote: > > This message did not arrive to the list after three submissions. > > > > Begin forwarded message: > > > > Date: Tue, 12 Jun 2018 12:42:52 +0300 > > From: Shlomi Fish > > To: ffmpeg-devel@ffmpeg.org > > Cc: Shlomi Fish > > Subject: [PATCH] Refactor two near-identical clauses. > > > > > > Placed under the Expat licence . All tests pass. > > --- > > libavfilter/vf_weave.c | 33 ++--- > > 1 file changed, 14 insertions(+), 19 deletions(-) > > > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c > > index 037f5d1cf2..be371201e1 100644 > > --- a/libavfilter/vf_weave.c > > +++ b/libavfilter/vf_weave.c > > @@ -23,6 +23,7 @@ > > #include "libavutil/pixdesc.h" > > #include "avfilter.h" > > #include "internal.h" > > +#include > > > > typedef struct WeaveContext { > > const AVClass *class; > > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) > > AVFilterLink *outlink = ctx->outputs[0]; > > AVFrame *out; > > int i; > > +bool weave; > > +int field1, field2; > > > > if (!s->prev) { > > s->prev = in; > > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > > *in) } > > av_frame_copy_props(out, in); > > > > +weave = (s->double_weave && !(inlink->frame_count_out & 1)); > > +field1 = s->first_field * weave; > > +field2 = s->first_field * !weave; > > for (i = 0; i < s->nb_planes; i++) { > > -if (s->double_weave && !(inlink->frame_count_out & 1)) { > > -av_image_copy_plane(out->data[i] + out->linesize[i] * > > s->first_field, > > this seems to be corrupted by line breaks > Well, the git send-email email was silently dropped three times... See: http://www.shlomifish.org/Files/files/code/0001-Refactor-two-near-identical-clauses.patch also attached here. Email has sadly become unreliable. > [...] > >From b6678799848297cd7079085035259baf6d8c54f0 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Fri, 25 May 2018 23:44:54 +0300 Subject: [PATCH] Refactor two near-identical clauses. Placed under the Expat licence . All tests pass. --- libavfilter/vf_weave.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c index 037f5d1cf2..be371201e1 100644 --- a/libavfilter/vf_weave.c +++ b/libavfilter/vf_weave.c @@ -23,6 +23,7 @@ #include "libavutil/pixdesc.h" #include "avfilter.h" #include "internal.h" +#include typedef struct WeaveContext { const AVClass *class; @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out; int i; +bool weave; +int field1, field2; if (!s->prev) { s->prev = in; @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } av_frame_copy_props(out, in); +weave = (s->double_weave && !(inlink->frame_count_out & 1)); +field1 = s->first_field * weave; +field2 = s->first_field * !weave; for (i = 0; i < s->nb_planes; i++) { -if (s->double_weave && !(inlink->frame_count_out & 1)) { -av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field, -out->linesize[i] * 2, -in->data[i], in->linesize[i], -s->linesize[i], s->planeheight[i]); -av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field, -out->linesize[i] * 2, -s->prev->data[i], s->prev->linesize[i], -s->linesize[i], s->planeheight[i]); -} else { -av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field, -out->linesize[i] * 2, -in->data[i], in->linesize[i], -s->linesize[i], s->planeheight[i]); -av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field, -out->linesize[i] * 2, -s->prev->data[i], s->prev->linesize[i], -
Re: [FFmpeg-devel] Fw: [PATCH] Refactor two near-identical clauses.
On Tue, 12 Jun 2018 12:53:20 +0300 Shlomi Fish wrote: > This message did not arrive to the list after three submissions. > hi all! Ping! Can this patch please be reviewed? > Begin forwarded message: > > Date: Tue, 12 Jun 2018 12:42:52 +0300 > From: Shlomi Fish > To: ffmpeg-devel@ffmpeg.org > Cc: Shlomi Fish > Subject: [PATCH] Refactor two near-identical clauses. > > > Placed under the Expat licence . All tests pass. > --- > libavfilter/vf_weave.c | 33 ++--- > 1 file changed, 14 insertions(+), 19 deletions(-) > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c > index 037f5d1cf2..be371201e1 100644 > --- a/libavfilter/vf_weave.c > +++ b/libavfilter/vf_weave.c > @@ -23,6 +23,7 @@ > #include "libavutil/pixdesc.h" > #include "avfilter.h" > #include "internal.h" > +#include > > typedef struct WeaveContext { > const AVClass *class; > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) > AVFilterLink *outlink = ctx->outputs[0]; > AVFrame *out; > int i; > +bool weave; > +int field1, field2; > > if (!s->prev) { > s->prev = in; > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > *in) } > av_frame_copy_props(out, in); > > +weave = (s->double_weave && !(inlink->frame_count_out & 1)); > +field1 = s->first_field * weave; > +field2 = s->first_field * !weave; > for (i = 0; i < s->nb_planes; i++) { > -if (s->double_weave && !(inlink->frame_count_out & 1)) { > -av_image_copy_plane(out->data[i] + out->linesize[i] * > s->first_field, > -out->linesize[i] * 2, > -in->data[i], in->linesize[i], > -s->linesize[i], s->planeheight[i]); > -av_image_copy_plane(out->data[i] + out->linesize[i] > * !s->first_field, > -out->linesize[i] * 2, > -s->prev->data[i], s->prev->linesize[i], > -s->linesize[i], s->planeheight[i]); > -} else { > -av_image_copy_plane(out->data[i] + out->linesize[i] > * !s->first_field, > -out->linesize[i] * 2, > -in->data[i], in->linesize[i], > -s->linesize[i], s->planeheight[i]); > -av_image_copy_plane(out->data[i] + out->linesize[i] * > s->first_field, > -out->linesize[i] * 2, > -s->prev->data[i], s->prev->linesize[i], > -s->linesize[i], s->planeheight[i]); > -} > +av_image_copy_plane(out->data[i] + out->linesize[i] * field1, > +out->linesize[i] * 2, > +in->data[i], in->linesize[i], > +s->linesize[i], s->planeheight[i]); > +av_image_copy_plane(out->data[i] + out->linesize[i] * field2, > +out->linesize[i] * 2, > +s->prev->data[i], s->prev->linesize[i], > +s->linesize[i], s->planeheight[i]); > } > > out->pts = s->double_weave ? s->prev->pts : in->pts / 2; -- - Shlomi Fish http://www.shlomifish.org/ https://github.com/shlomif/PySolFC - open source Solitaire games Larry Wall has more dollars in the bank than in his Perl code. — http://www.shlomifish.org/humour/bits/facts/Larry-Wall/ Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Refactor two near-identical clauses.
On Tue, 12 Jun 2018 12:53:20 +0300 Shlomi Fish wrote: > This message did not arrive to the list after three submissions. > Just for the record, the patch can also be found here: http://www.shlomifish.org/Files/files/code/0001-Refactor-two-near-identical-clauses.patch > Begin forwarded message: > > Date: Tue, 12 Jun 2018 12:42:52 +0300 > From: Shlomi Fish > To: ffmpeg-devel@ffmpeg.org > Cc: Shlomi Fish > Subject: [PATCH] Refactor two near-identical clauses. > > > Placed under the Expat licence . All tests pass. > --- > libavfilter/vf_weave.c | 33 ++--- > 1 file changed, 14 insertions(+), 19 deletions(-) > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c > index 037f5d1cf2..be371201e1 100644 > --- a/libavfilter/vf_weave.c > +++ b/libavfilter/vf_weave.c > @@ -23,6 +23,7 @@ > #include "libavutil/pixdesc.h" > #include "avfilter.h" > #include "internal.h" > +#include > > typedef struct WeaveContext { > const AVClass *class; > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) > AVFilterLink *outlink = ctx->outputs[0]; > AVFrame *out; > int i; > +bool weave; > +int field1, field2; > > if (!s->prev) { > s->prev = in; > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame > *in) } > av_frame_copy_props(out, in); > > +weave = (s->double_weave && !(inlink->frame_count_out & 1)); > +field1 = s->first_field * weave; > +field2 = s->first_field * !weave; > for (i = 0; i < s->nb_planes; i++) { > -if (s->double_weave && !(inlink->frame_count_out & 1)) { > -av_image_copy_plane(out->data[i] + out->linesize[i] * > s->first_field, > -out->linesize[i] * 2, > -in->data[i], in->linesize[i], > -s->linesize[i], s->planeheight[i]); > -av_image_copy_plane(out->data[i] + out->linesize[i] > * !s->first_field, > -out->linesize[i] * 2, > -s->prev->data[i], s->prev->linesize[i], > -s->linesize[i], s->planeheight[i]); > -} else { > -av_image_copy_plane(out->data[i] + out->linesize[i] > * !s->first_field, > -out->linesize[i] * 2, > -in->data[i], in->linesize[i], > -s->linesize[i], s->planeheight[i]); > -av_image_copy_plane(out->data[i] + out->linesize[i] * > s->first_field, > -out->linesize[i] * 2, > -s->prev->data[i], s->prev->linesize[i], > -s->linesize[i], s->planeheight[i]); > -} > +av_image_copy_plane(out->data[i] + out->linesize[i] * field1, > +out->linesize[i] * 2, > +in->data[i], in->linesize[i], > +s->linesize[i], s->planeheight[i]); > +av_image_copy_plane(out->data[i] + out->linesize[i] * field2, > +out->linesize[i] * 2, > +s->prev->data[i], s->prev->linesize[i], > +s->linesize[i], s->planeheight[i]); > } > > out->pts = s->double_weave ? s->prev->pts : in->pts / 2; -- - Shlomi Fish http://www.shlomifish.org/ Freecell Solver - http://fc-solve.shlomifish.org/ A kid always wishes they were older until they are 18. Afterwards, they always wish they were younger. Please reply to list if it's a mailing list post - http://shlom.in/reply . ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Fw: [PATCH] Refactor two near-identical clauses.
This message did not arrive to the list after three submissions. Begin forwarded message: Date: Tue, 12 Jun 2018 12:42:52 +0300 From: Shlomi Fish To: ffmpeg-devel@ffmpeg.org Cc: Shlomi Fish Subject: [PATCH] Refactor two near-identical clauses. Placed under the Expat licence . All tests pass. --- libavfilter/vf_weave.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c index 037f5d1cf2..be371201e1 100644 --- a/libavfilter/vf_weave.c +++ b/libavfilter/vf_weave.c @@ -23,6 +23,7 @@ #include "libavutil/pixdesc.h" #include "avfilter.h" #include "internal.h" +#include typedef struct WeaveContext { const AVClass *class; @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out; int i; +bool weave; +int field1, field2; if (!s->prev) { s->prev = in; @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } av_frame_copy_props(out, in); +weave = (s->double_weave && !(inlink->frame_count_out & 1)); +field1 = s->first_field * weave; +field2 = s->first_field * !weave; for (i = 0; i < s->nb_planes; i++) { -if (s->double_weave && !(inlink->frame_count_out & 1)) { -av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field, -out->linesize[i] * 2, -in->data[i], in->linesize[i], -s->linesize[i], s->planeheight[i]); -av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field, -out->linesize[i] * 2, -s->prev->data[i], s->prev->linesize[i], -s->linesize[i], s->planeheight[i]); -} else { -av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field, -out->linesize[i] * 2, -in->data[i], in->linesize[i], -s->linesize[i], s->planeheight[i]); -av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field, -out->linesize[i] * 2, -s->prev->data[i], s->prev->linesize[i], -s->linesize[i], s->planeheight[i]); -} +av_image_copy_plane(out->data[i] + out->linesize[i] * field1, +out->linesize[i] * 2, +in->data[i], in->linesize[i], +s->linesize[i], s->planeheight[i]); +av_image_copy_plane(out->data[i] + out->linesize[i] * field2, +out->linesize[i] * 2, +s->prev->data[i], s->prev->linesize[i], +s->linesize[i], s->planeheight[i]); } out->pts = s->double_weave ? s->prev->pts : in->pts / 2; -- 2.17.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] Fix branch 3 digits misspelling
Hi all! Attached is a patch for ffmpeg-web. Please consider applying it. Regards, Shlomi Fish -- - Shlomi Fish http://www.shlomifish.org/ https://is.gd/MQHVF3 - The Atom Text Editors edits a 2,000,001b file Chuck Norris had a problem so he decided to use regular expressions. Now, all the World’s problems are solved. — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/ >From 1b86df070f8e9d7d96fcf1a10b1e85c1f66fd679 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sun, 30 Jul 2017 20:58:49 +0300 Subject: [PATCH] Fix a branch misspelling. I hereby disclaim all ownership of my changes and place them under https://creativecommons.org/choose/zero/ . --- src/download | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/download b/src/download index 3f25c1a..7b6fc48 100644 --- a/src/download +++ b/src/download @@ -311,7 +311,7 @@ libpostproc54. 5.100 3.2.7 was released on 2017-07-30. It is the latest stable FFmpeg release -from the 3.2.7 release branch, which was cut from master on 2016-10-26. +from the 3.2 release branch, which was cut from master on 2016-10-26. It includes the following library versions: -- 2.13.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel