[PATCH v3] avfilter: add XPSNR filter
This is a continuation of last year's version of this filter patch, see also https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305517.html It includes a fix in one of the stride variables and some cleanup in order to adhere even more to the FFmpeg coding guidelines. Christian Helmrich Fraunhofer HHI
ping Should anything be changed in this patch? Christian Helmrich ________________________________ Von: Helmrich, Christian Gesendet: Donnerstag, 4. Juli 2024 17:50 An: ffmpeg-devel@ffmpeg.org Betreff: [PATCH v3] avfilter: add XPSNR filter This is a continuation of last year's version of this filter patch, see also https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305517.html It includes a fix in one of the stride variables and some cleanup in order to adhere even more to the FFmpeg coding guidelines. Christian Helmrich Fraunhofer HHI
On Thu, Jul 04, 2024 at 03:50:34PM +0000, Helmrich, Christian wrote:
This is a continuation of last year's version of this filter patch, see also
https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305517.html
It includes a fix in one of the stride variables and some cleanup in order
to adhere even more to the FFmpeg coding guidelines.
Christian Helmrich
Fraunhofer HHI
doc/filters.texi | 68 +++ libavfilter/Makefile | 1 libavfilter/allfilters.c | 1 libavfilter/vf_xpsnr.c | 739 ++++++++++++++++++++++++++++++++++++++++ libavfilter/x86/Makefile | 1 libavfilter/x86/vf_xpsnr_init.c | 43 ++ libavfilter/xpsnr.h | 48 ++ 7 files changed, 901 insertions(+)
maybe you can add a fate test
50878de1981bb30903785175d4030e4c065c6c85 v3-0001-avfilter-add-XPSNR-filter.patch From 6a020fc9279ab2fd66e6dd8596f566ee6578cb35 Mon Sep 17 00:00:00 2001 From: Christian Helmrich <christian.helmrich@hhi.fraunhofer.de> Date: Thu, 4 Jul 2024 17:10:29 +0200 Subject: [PATCH v3] avfilter: add XPSNR filter
Add XPSNR video filter Register new filter xpsnr. [...]
+#include "libavutil/avstring.h" +#include "libavutil/file_open.h" +#include "libavutil/mem.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "drawutils.h" +#include "framesync.h"
+#include "internal.h"
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h" [...]
+ /* prepare XPSNR calculations: allocate temporary picture and block memory */ + if (s->sse_luma == NULL) + s->sse_luma = (double *) av_malloc_array(w_blk * h_blk, sizeof(double)); + if (s->weights == NULL) + s->weights = (double *) av_malloc_array(w_blk * h_blk, sizeof(double));
the casts are unneeded [...]
+ if (s->sse_luma) + av_freep(&s->sse_luma); + if (s->weights ) + av_freep(&s->weights );
av_free*(NULL) is safe thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
Hi and thanks for taking a look at this!
maybe you can add a fate test
I understand my colleague (who supports me on this) right, he's still looking into how to do that. But to have some quick progress on your other comments:
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h"
Thanks, fixed in v4 (attached).
the casts are unneeded
Thanks, fixed in v4.
av_free*(NULL) is safe
Thanks, fixed in v4. Christian Helmrich Fraunhofer HHI ________________________________ Von: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> im Auftrag von Michael Niedermayer <michael@niedermayer.cc> Gesendet: Freitag, 23. August 2024 22:00 An: FFmpeg development discussions and patches Betreff: Re: [FFmpeg-devel] [PATCH v3] avfilter: add XPSNR filter On Thu, Jul 04, 2024 at 03:50:34PM +0000, Helmrich, Christian wrote:
This is a continuation of last year's version of this filter patch, see also
https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305517.html
It includes a fix in one of the stride variables and some cleanup in order
to adhere even more to the FFmpeg coding guidelines.
Christian Helmrich
Fraunhofer HHI
doc/filters.texi | 68 +++ libavfilter/Makefile | 1 libavfilter/allfilters.c | 1 libavfilter/vf_xpsnr.c | 739 ++++++++++++++++++++++++++++++++++++++++ libavfilter/x86/Makefile | 1 libavfilter/x86/vf_xpsnr_init.c | 43 ++ libavfilter/xpsnr.h | 48 ++ 7 files changed, 901 insertions(+)
maybe you can add a fate test
50878de1981bb30903785175d4030e4c065c6c85 v3-0001-avfilter-add-XPSNR-filter.patch From 6a020fc9279ab2fd66e6dd8596f566ee6578cb35 Mon Sep 17 00:00:00 2001 From: Christian Helmrich <christian.helmrich@hhi.fraunhofer.de> Date: Thu, 4 Jul 2024 17:10:29 +0200 Subject: [PATCH v3] avfilter: add XPSNR filter
Add XPSNR video filter Register new filter xpsnr. [...]
+#include "libavutil/avstring.h" +#include "libavutil/file_open.h" +#include "libavutil/mem.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "drawutils.h" +#include "framesync.h"
+#include "internal.h"
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h" [...]
+ /* prepare XPSNR calculations: allocate temporary picture and block memory */ + if (s->sse_luma == NULL) + s->sse_luma = (double *) av_malloc_array(w_blk * h_blk, sizeof(double)); + if (s->weights == NULL) + s->weights = (double *) av_malloc_array(w_blk * h_blk, sizeof(double));
the casts are unneeded [...]
+ if (s->sse_luma) + av_freep(&s->sse_luma); + if (s->weights ) + av_freep(&s->weights );
av_free*(NULL) is safe thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
Following up on this: attached a (final, in our view) v5. Changes over v3: - cleanup and align to psnr filter - add metadata - add xpsnr tests for yuv and rgb Christian ________________________________ Von: Helmrich, Christian Gesendet: Montag, 26. August 2024 19:41 An: FFmpeg development discussions and patches Betreff: [FFmpeg-devel] [PATCH v4] avfilter: add XPSNR filter Hi and thanks for taking a look at this!
maybe you can add a fate test
I understand my colleague (who supports me on this) right, he's still looking into how to do that. But to have some quick progress on your other comments:
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h"
Thanks, fixed in v4 (attached).
the casts are unneeded
Thanks, fixed in v4.
av_free*(NULL) is safe
Thanks, fixed in v4. Christian Helmrich Fraunhofer HHI ________________________________ Von: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> im Auftrag von Michael Niedermayer <michael@niedermayer.cc> Gesendet: Freitag, 23. August 2024 22:00 An: FFmpeg development discussions and patches Betreff: Re: [FFmpeg-devel] [PATCH v3] avfilter: add XPSNR filter On Thu, Jul 04, 2024 at 03:50:34PM +0000, Helmrich, Christian wrote:
This is a continuation of last year's version of this filter patch, see also
https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305517.html
It includes a fix in one of the stride variables and some cleanup in order
to adhere even more to the FFmpeg coding guidelines.
Christian Helmrich
Fraunhofer HHI
doc/filters.texi | 68 +++ libavfilter/Makefile | 1 libavfilter/allfilters.c | 1 libavfilter/vf_xpsnr.c | 739 ++++++++++++++++++++++++++++++++++++++++ libavfilter/x86/Makefile | 1 libavfilter/x86/vf_xpsnr_init.c | 43 ++ libavfilter/xpsnr.h | 48 ++ 7 files changed, 901 insertions(+)
maybe you can add a fate test
50878de1981bb30903785175d4030e4c065c6c85 v3-0001-avfilter-add-XPSNR-filter.patch From 6a020fc9279ab2fd66e6dd8596f566ee6578cb35 Mon Sep 17 00:00:00 2001 From: Christian Helmrich <christian.helmrich@hhi.fraunhofer.de> Date: Thu, 4 Jul 2024 17:10:29 +0200 Subject: [PATCH v3] avfilter: add XPSNR filter
Add XPSNR video filter Register new filter xpsnr. [...]
+#include "libavutil/avstring.h" +#include "libavutil/file_open.h" +#include "libavutil/mem.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "drawutils.h" +#include "framesync.h"
+#include "internal.h"
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h" [...]
+ /* prepare XPSNR calculations: allocate temporary picture and block memory */ + if (s->sse_luma == NULL) + s->sse_luma = (double *) av_malloc_array(w_blk * h_blk, sizeof(double)); + if (s->weights == NULL) + s->weights = (double *) av_malloc_array(w_blk * h_blk, sizeof(double));
the casts are unneeded [...]
+ if (s->sse_luma) + av_freep(&s->sse_luma); + if (s->weights ) + av_freep(&s->weights );
av_free*(NULL) is safe thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
On Wed, Aug 28, 2024 at 01:40:39PM +0000, Helmrich, Christian wrote:
Following up on this: attached a (final, in our view) v5. Changes over v3: [...] doc/filters.texi | 68 ++ libavfilter/Makefile | 1 libavfilter/allfilters.c | 1 libavfilter/vf_xpsnr.c | 759 +++++++++++++++++++++++++++++++++ libavfilter/x86/Makefile | 1 libavfilter/x86/vf_xpsnr_init.c | 43 + libavfilter/xpsnr.h | 48 ++ tests/fate/filter-video.mak | 6 tests/ref/fate/filter-refcmp-xpsnr-rgb | 20 tests/ref/fate/filter-refcmp-xpsnr-yuv | 20 10 files changed, 967 insertions(+) e1070ae12dc5002c5f529b11cc21d5610e70be7d v5-avfilter-add-XPSNR-filter.patch From ae0de58e4a3250d3e5bc5aa13f633d600d4d112b Mon Sep 17 00:00:00 2001 From: Christian Helmrich <christian.helmrich@hhi.fraunhofer.de> Date: Wed, 28 Aug 2024 11:28:49 +0200 Subject: [PATCH v5] avfilter: add XPSNR filter
If you are interrested in maintaining the filter then please add yourself to MAINTAINERS (in a seperate patch) thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The day soldiers stop bringing you their problems is the day you have stopped leading them. They have either lost confidence that you can help or concluded you do not care. Either case is a failure of leadership. - Colin Powell
On Wed, Aug 28, 2024 at 01:40:39PM +0000, Helmrich, Christian wrote:
Following up on this: attached a (final, in our view) v5. Changes over v3:
- cleanup and align to psnr filter - add metadata - add xpsnr tests for yuv and rgb
will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time.
Hi, adding us XPSNR authors to MAINTAINERS, as requested/suggested in https://ffmpeg.org/pipermail/ffmpeg-devel/2024-September/332940.html Best, Christian Helmrich Fraunhofer HHI ________________________________ Von: Helmrich, Christian Gesendet: Montag, 26. August 2024 19:41 An: FFmpeg development discussions and patches Betreff: [FFmpeg-devel] [PATCH v4] avfilter: add XPSNR filter Hi and thanks for taking a look at this!
maybe you can add a fate test
I understand my colleague (who supports me on this) right, he's still looking into how to do that. But to have some quick progress on your other comments:
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h"
Thanks, fixed in v4 (attached).
the casts are unneeded
Thanks, fixed in v4.
av_free*(NULL) is safe
Thanks, fixed in v4. Christian Helmrich Fraunhofer HHI ________________________________ Von: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> im Auftrag von Michael Niedermayer <michael@niedermayer.cc> Gesendet: Freitag, 23. August 2024 22:00 An: FFmpeg development discussions and patches Betreff: Re: [FFmpeg-devel] [PATCH v3] avfilter: add XPSNR filter On Thu, Jul 04, 2024 at 03:50:34PM +0000, Helmrich, Christian wrote:
This is a continuation of last year's version of this filter patch, see also
https://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/305517.html
It includes a fix in one of the stride variables and some cleanup in order
to adhere even more to the FFmpeg coding guidelines.
Christian Helmrich
Fraunhofer HHI
doc/filters.texi | 68 +++ libavfilter/Makefile | 1 libavfilter/allfilters.c | 1 libavfilter/vf_xpsnr.c | 739 ++++++++++++++++++++++++++++++++++++++++ libavfilter/x86/Makefile | 1 libavfilter/x86/vf_xpsnr_init.c | 43 ++ libavfilter/xpsnr.h | 48 ++ 7 files changed, 901 insertions(+)
maybe you can add a fate test
50878de1981bb30903785175d4030e4c065c6c85 v3-0001-avfilter-add-XPSNR-filter.patch From 6a020fc9279ab2fd66e6dd8596f566ee6578cb35 Mon Sep 17 00:00:00 2001 From: Christian Helmrich <christian.helmrich@hhi.fraunhofer.de> Date: Thu, 4 Jul 2024 17:10:29 +0200 Subject: [PATCH v3] avfilter: add XPSNR filter
Add XPSNR video filter Register new filter xpsnr. [...]
+#include "libavutil/avstring.h" +#include "libavutil/file_open.h" +#include "libavutil/mem.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "drawutils.h" +#include "framesync.h"
+#include "internal.h"
libavfilter/vf_xpsnr.c:38:10: fatal error: internal.h: No such file or directory 38 | #include "internal.h" [...]
+ /* prepare XPSNR calculations: allocate temporary picture and block memory */ + if (s->sse_luma == NULL) + s->sse_luma = (double *) av_malloc_array(w_blk * h_blk, sizeof(double)); + if (s->weights == NULL) + s->weights = (double *) av_malloc_array(w_blk * h_blk, sizeof(double));
the casts are unneeded [...]
+ if (s->sse_luma) + av_freep(&s->sse_luma); + if (s->weights ) + av_freep(&s->weights );
av_free*(NULL) is safe thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato
On Fri, Sep 06, 2024 at 03:11:01PM +0000, Helmrich, Christian wrote:
Hi, adding us XPSNR authors to MAINTAINERS, as requested/suggested in
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-September/332940.html
[...]
MAINTAINERS | 1 + 1 file changed, 1 insertion(+) f69e632b19924e0a25a0735386775488fadf921a xpsnr_add_maintainers.patch From 6a020fc9279ab2fd66e6dd8596f566ee6578cb35 Mon Sep 17 00:00:00 2001 From: Christian Helmrich <christian.helmrich@hhi.fraunhofer.de> Date: Fri, 6 Sep 2024 17:00:00 +0200 Subject: [PATCH v1] XPSNR: add maintainers
Add XPSNR authors to MAINTAINERS ---
diff --git a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS +++ b/MAINTAINERS @@ -344,6 +344,7 @@ vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive dot com) vf_scale.c [2] Michael Niedermayer vf_tonemap_opencl.c Ruiling Song + vf_xpsnr.c Christian Helmrich, Christian Lehmann
please add the status [1] or [2] thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already.
participants (2)
-
Helmrich, Christian -
Michael Niedermayer