Commit Graph

8 Commits

Author SHA1 Message Date
Andreas Rheinhardt 19ffa2ff2d avfilter: Remove unnecessary formats.h inclusions
A filter needs formats.h iff it uses FILTER_QUERY_FUNC();
since lots of filters have been switched to use something
else than FILTER_QUERY_FUNC, they don't need it any more,
but removing this header has been forgotten.
This commit does this; files with formats.h inclusion went down
from 304 to 139 here (it were 449 before the preceding commit).

While just at it, also improve the other headers a bit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-07 09:21:13 +02:00
Andreas Rheinhardt 2732d0507c avfilter/vf_ssim360: Remove dead code
Fixes Coverity issue #1520669.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:45 +01:00
Andreas Rheinhardt 1091963d38 avfilter/vf_ssim360: Use correct type in sizeof
SSIM360Context.ssim360_hist is an array of four pointers to double;
so sizeof(*ssim360_hist[0]) (=sizeof(double)) is the correct size
to use to calculate the amount of memory to allocate, not
sizeof(*ssim360_hist) (which is sizeof(double*)).

Use FF_ALLOCZ_TYPED_ARRAY to avoid this issue altogether.

Fixes Coverity issue #1520671.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-03-14 07:16:06 +01:00
Andreas Rheinhardt 35f837710c avfilter/vf_ssim360: Constify AVFilter
This brings ff_vf_ssim360 in line with its declaration in allfilters.c;
this discrepancy is actually undefined behaviour.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-01-28 18:19:53 +01:00
Andreas Rheinhardt 5fd4d3faf1 avfilter/vf_ssim360: Don't initialize twice
The FILTER_INPUTS and FILTER_OUTPUTS macros already set
AVFilter.(inputs|outputs); Clang therefore emits a warning for
this: "initializer overrides prior initialization of this subobject
[-Winitializer-overrides]"

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-01-28 18:19:24 +01:00
Andreas Rheinhardt 54659e329e avfilter/vf_ssim360: Fix left-shift of negative value
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-01-28 18:18:57 +01:00
Martin Storsjö c0cf2c4786 lavfi/vf_ssim360: Fix compilation with MSVC
Don't use "static const" for compile time float constants, but use
defines. This fixes the following error:

src/libavfilter/vf_ssim360.c(549): error C2099: initializer is not a constant

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-01-28 18:20:19 +02:00
Shannon Chen ed519a3690 lavfi: Add vf_ssim360 filter
Customized SSIM for various projections (and stereo formats) of 360 images and videos.

Further contributions by:
Ashok Mathew Kuruvilla
Matthieu Patou
Yu-Hui Wu
Anton Khirnov

Suggested-By: ffmpeg@fb.com
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-01-28 12:00:27 +01:00