* [FFmpeg-devel] [PATCH] lavfi/vf_ssim360: Fix compilation with MSVC
@ 2023-01-28 16:20 Martin Storsjö
2023-01-28 16:54 ` Martin Storsjö
0 siblings, 1 reply; 2+ messages in thread
From: Martin Storsjö @ 2023-01-28 16:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Martin Storsjö
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>
---
libavfilter/vf_ssim360.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c
index 0990db0ed5..a0bf73da1e 100644
--- a/libavfilter/vf_ssim360.c
+++ b/libavfilter/vf_ssim360.c
@@ -72,11 +72,11 @@
#define DEFAULT_EXPANSION_COEF 1.01f
-static const float BARREL_THETA_RANGE = DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F;
-static const float BARREL_PHI_RANGE = DEFAULT_EXPANSION_COEF * M_PI_2_F;
+#define BARREL_THETA_RANGE (DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F)
+#define BARREL_PHI_RANGE (DEFAULT_EXPANSION_COEF * M_PI_2_F)
// Use fixed-point with 16 bit precision for fast bilinear math
-static const int FIXED_POINT_PRECISION = 16;
+#define FIXED_POINT_PRECISION 16
// Use 1MB per channel for the histogram to get 5-digit precise SSIM value
#define SSIM360_HIST_SIZE 131072
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [FFmpeg-devel] [PATCH] lavfi/vf_ssim360: Fix compilation with MSVC
2023-01-28 16:20 [FFmpeg-devel] [PATCH] lavfi/vf_ssim360: Fix compilation with MSVC Martin Storsjö
@ 2023-01-28 16:54 ` Martin Storsjö
0 siblings, 0 replies; 2+ messages in thread
From: Martin Storsjö @ 2023-01-28 16:54 UTC (permalink / raw)
To: ffmpeg-devel
On Sat, 28 Jan 2023, Martin Storsjö wrote:
> 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>
> ---
> libavfilter/vf_ssim360.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavfilter/vf_ssim360.c b/libavfilter/vf_ssim360.c
> index 0990db0ed5..a0bf73da1e 100644
> --- a/libavfilter/vf_ssim360.c
> +++ b/libavfilter/vf_ssim360.c
> @@ -72,11 +72,11 @@
>
> #define DEFAULT_EXPANSION_COEF 1.01f
>
> -static const float BARREL_THETA_RANGE = DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F;
> -static const float BARREL_PHI_RANGE = DEFAULT_EXPANSION_COEF * M_PI_2_F;
> +#define BARREL_THETA_RANGE (DEFAULT_EXPANSION_COEF * 2.0f * M_PI_F)
> +#define BARREL_PHI_RANGE (DEFAULT_EXPANSION_COEF * M_PI_2_F)
>
> // Use fixed-point with 16 bit precision for fast bilinear math
> -static const int FIXED_POINT_PRECISION = 16;
> +#define FIXED_POINT_PRECISION 16
>
> // Use 1MB per channel for the histogram to get 5-digit precise SSIM value
> #define SSIM360_HIST_SIZE 131072
> --
> 2.34.1
OK'd by Anton on irc, pushed.
// Martin
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-28 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-28 16:20 [FFmpeg-devel] [PATCH] lavfi/vf_ssim360: Fix compilation with MSVC Martin Storsjö
2023-01-28 16:54 ` Martin Storsjö
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git