* [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to disable code
@ 2022-05-13 9:19 Andreas Rheinhardt
2022-05-13 9:25 ` Hendrik Leppkes
2022-05-13 9:44 ` Soft Works
0 siblings, 2 replies; 3+ messages in thread
From: Andreas Rheinhardt @ 2022-05-13 9:19 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Should fix the compilation issue reported in
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
and should also prevent such issues on arches other than X86.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/v210dec_init.h | 3 ++-
libavcodec/v210enc_init.h | 3 ++-
libavfilter/af_afirdsp.h | 3 ++-
libavfilter/vf_blend_init.h | 3 ++-
libavfilter/vf_eq.h | 3 ++-
libavfilter/vf_gblur_init.h | 3 ++-
libavfilter/vf_hflip_init.h | 3 ++-
libavfilter/vf_nlmeans_init.h | 6 +++---
libavfilter/vf_threshold_init.h | 3 ++-
9 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/libavcodec/v210dec_init.h b/libavcodec/v210dec_init.h
index 305ab3911e..707c101ab0 100644
--- a/libavcodec/v210dec_init.h
+++ b/libavcodec/v210dec_init.h
@@ -54,8 +54,9 @@ static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u,
static av_unused av_cold void ff_v210dec_init(V210DecContext *s)
{
s->unpack_frame = v210_planar_unpack_c;
- if (ARCH_X86)
+ #if ARCH_X86
ff_v210_x86_init(s);
+ #endif
}
#endif /* AVCODEC_V210DEC_INIT_H */
diff --git a/libavcodec/v210enc_init.h b/libavcodec/v210enc_init.h
index 6d81cac319..09828d4a14 100644
--- a/libavcodec/v210enc_init.h
+++ b/libavcodec/v210enc_init.h
@@ -83,8 +83,9 @@ static av_cold av_unused void ff_v210enc_init(V210EncContext *s)
s->sample_factor_8 = 2;
s->sample_factor_10 = 1;
- if (ARCH_X86)
+ #if ARCH_X86
ff_v210enc_init_x86(s);
+ #endif
}
#endif /* AVCODEC_V210ENC_INIT_H */
diff --git a/libavfilter/af_afirdsp.h b/libavfilter/af_afirdsp.h
index 05182bebb4..8127194836 100644
--- a/libavfilter/af_afirdsp.h
+++ b/libavfilter/af_afirdsp.h
@@ -54,8 +54,9 @@ static av_unused void ff_afir_init(AudioFIRDSPContext *dsp)
{
dsp->fcmul_add = fcmul_add_c;
- if (ARCH_X86)
+ #if ARCH_X86
ff_afir_init_x86(dsp);
+ #endif
}
#endif /* AVFILTER_AFIRDSP_H */
diff --git a/libavfilter/vf_blend_init.h b/libavfilter/vf_blend_init.h
index 5fb2599490..b377219806 100644
--- a/libavfilter/vf_blend_init.h
+++ b/libavfilter/vf_blend_init.h
@@ -194,8 +194,9 @@ static av_unused void ff_blend_init(FilterParams *param, int depth)
param->blend = depth > 8 ? depth > 16 ? blend_copybottom_32 : blend_copybottom_16 : blend_copybottom_8;
}
- if (ARCH_X86)
+ #if ARCH_X86
ff_blend_init_x86(param, depth);
+ #endif
}
#endif /* AVFILTER_BLEND_INIT_H */
diff --git a/libavfilter/vf_eq.h b/libavfilter/vf_eq.h
index a5756977d2..d68fb7295e 100644
--- a/libavfilter/vf_eq.h
+++ b/libavfilter/vf_eq.h
@@ -123,8 +123,9 @@ void ff_eq_init_x86(EQContext *eq);
static av_unused void ff_eq_init(EQContext *eq)
{
eq->process = process_c;
- if (ARCH_X86)
+ #if ARCH_X86
ff_eq_init_x86(eq);
+ #endif
}
#endif /* AVFILTER_EQ_H */
diff --git a/libavfilter/vf_gblur_init.h b/libavfilter/vf_gblur_init.h
index 0fee64bc98..9ff28c6f59 100644
--- a/libavfilter/vf_gblur_init.h
+++ b/libavfilter/vf_gblur_init.h
@@ -115,8 +115,9 @@ static av_unused void ff_gblur_init(GBlurContext *s)
s->horiz_slice = horiz_slice_c;
s->verti_slice = verti_slice_c;
s->postscale_slice = postscale_c;
- if (ARCH_X86)
+ #if ARCH_X86
ff_gblur_init_x86(s);
+ #endif
}
#endif /* AVFILTER_GBLUR_INIT_H */
diff --git a/libavfilter/vf_hflip_init.h b/libavfilter/vf_hflip_init.h
index b58cfec901..63f9e3b92a 100644
--- a/libavfilter/vf_hflip_init.h
+++ b/libavfilter/vf_hflip_init.h
@@ -101,8 +101,9 @@ static av_unused int ff_hflip_init(FlipContext *s, int step[4], int nb_planes)
return AVERROR_BUG;
}
}
- if (ARCH_X86)
+ #if ARCH_X86
ff_hflip_init_x86(s, step, nb_planes);
+ #endif
return 0;
}
diff --git a/libavfilter/vf_nlmeans_init.h b/libavfilter/vf_nlmeans_init.h
index 04ad8801b6..87fca13b2e 100644
--- a/libavfilter/vf_nlmeans_init.h
+++ b/libavfilter/vf_nlmeans_init.h
@@ -129,11 +129,11 @@ static av_unused void ff_nlmeans_init(NLMeansDSPContext *dsp)
dsp->compute_safe_ssd_integral_image = compute_safe_ssd_integral_image_c;
dsp->compute_weights_line = compute_weights_line_c;
- if (ARCH_AARCH64)
+ #if ARCH_AARCH64
ff_nlmeans_init_aarch64(dsp);
-
- if (ARCH_X86)
+ #elif ARCH_X86
ff_nlmeans_init_x86(dsp);
+ #endif
}
#endif /* AVFILTER_NLMEANS_INIT_H */
diff --git a/libavfilter/vf_threshold_init.h b/libavfilter/vf_threshold_init.h
index e79d2bb63d..c86e9da7f2 100644
--- a/libavfilter/vf_threshold_init.h
+++ b/libavfilter/vf_threshold_init.h
@@ -84,8 +84,9 @@ static av_unused void ff_threshold_init(ThresholdContext *s)
s->bpc = 2;
}
- if (ARCH_X86)
+ #if ARCH_X86
ff_threshold_init_x86(s);
+ #endif
}
#endif /* AVFILTER_THRESHOLD_INIT_H */
--
2.32.0
_______________________________________________
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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to disable code
2022-05-13 9:19 [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to disable code Andreas Rheinhardt
@ 2022-05-13 9:25 ` Hendrik Leppkes
2022-05-13 9:44 ` Soft Works
1 sibling, 0 replies; 3+ messages in thread
From: Hendrik Leppkes @ 2022-05-13 9:25 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Fri, May 13, 2022 at 11:19 AM Andreas Rheinhardt
<andreas.rheinhardt@outlook.com> wrote:
>
> Should fix the compilation issue reported in
> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
> and should also prevent such issues on arches other than X86.
>
Since this doesn't actually affect actual compilers, but custom
scripts that generate project files, maybe those should just be
updated to process header files?
These issues are likely to come back, as this is a rather standard
pattern for all our code, so this is just a bandaid.
- Hendrik
_______________________________________________
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] 3+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to disable code
2022-05-13 9:19 [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to disable code Andreas Rheinhardt
2022-05-13 9:25 ` Hendrik Leppkes
@ 2022-05-13 9:44 ` Soft Works
1 sibling, 0 replies; 3+ messages in thread
From: Soft Works @ 2022-05-13 9:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Andreas Rheinhardt
> Sent: Friday, May 13, 2022 11:19 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> Subject: [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to
> disable code
>
> Should fix the compilation issue reported in
> https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
> and should also prevent such issues on arches other than X86.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/v210dec_init.h | 3 ++-
> libavcodec/v210enc_init.h | 3 ++-
> libavfilter/af_afirdsp.h | 3 ++-
> libavfilter/vf_blend_init.h | 3 ++-
> libavfilter/vf_eq.h | 3 ++-
> libavfilter/vf_gblur_init.h | 3 ++-
> libavfilter/vf_hflip_init.h | 3 ++-
> libavfilter/vf_nlmeans_init.h | 6 +++---
> libavfilter/vf_threshold_init.h | 3 ++-
> 9 files changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/libavcodec/v210dec_init.h b/libavcodec/v210dec_init.h
> index 305ab3911e..707c101ab0 100644
> --- a/libavcodec/v210dec_init.h
> +++ b/libavcodec/v210dec_init.h
> @@ -54,8 +54,9 @@ static void v210_planar_unpack_c(const uint32_t
> *src, uint16_t *y, uint16_t *u,
> static av_unused av_cold void ff_v210dec_init(V210DecContext *s)
> {
> s->unpack_frame = v210_planar_unpack_c;
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_v210_x86_init(s);
> + #endif
> }
>
> #endif /* AVCODEC_V210DEC_INIT_H */
> diff --git a/libavcodec/v210enc_init.h b/libavcodec/v210enc_init.h
> index 6d81cac319..09828d4a14 100644
> --- a/libavcodec/v210enc_init.h
> +++ b/libavcodec/v210enc_init.h
> @@ -83,8 +83,9 @@ static av_cold av_unused void
> ff_v210enc_init(V210EncContext *s)
> s->sample_factor_8 = 2;
> s->sample_factor_10 = 1;
>
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_v210enc_init_x86(s);
> + #endif
> }
>
> #endif /* AVCODEC_V210ENC_INIT_H */
> diff --git a/libavfilter/af_afirdsp.h b/libavfilter/af_afirdsp.h
> index 05182bebb4..8127194836 100644
> --- a/libavfilter/af_afirdsp.h
> +++ b/libavfilter/af_afirdsp.h
> @@ -54,8 +54,9 @@ static av_unused void
> ff_afir_init(AudioFIRDSPContext *dsp)
> {
> dsp->fcmul_add = fcmul_add_c;
>
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_afir_init_x86(dsp);
> + #endif
> }
>
> #endif /* AVFILTER_AFIRDSP_H */
> diff --git a/libavfilter/vf_blend_init.h b/libavfilter/vf_blend_init.h
> index 5fb2599490..b377219806 100644
> --- a/libavfilter/vf_blend_init.h
> +++ b/libavfilter/vf_blend_init.h
> @@ -194,8 +194,9 @@ static av_unused void ff_blend_init(FilterParams
> *param, int depth)
> param->blend = depth > 8 ? depth > 16 ?
> blend_copybottom_32 : blend_copybottom_16 : blend_copybottom_8;
> }
>
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_blend_init_x86(param, depth);
> + #endif
> }
>
> #endif /* AVFILTER_BLEND_INIT_H */
> diff --git a/libavfilter/vf_eq.h b/libavfilter/vf_eq.h
> index a5756977d2..d68fb7295e 100644
> --- a/libavfilter/vf_eq.h
> +++ b/libavfilter/vf_eq.h
> @@ -123,8 +123,9 @@ void ff_eq_init_x86(EQContext *eq);
> static av_unused void ff_eq_init(EQContext *eq)
> {
> eq->process = process_c;
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_eq_init_x86(eq);
> + #endif
> }
>
> #endif /* AVFILTER_EQ_H */
> diff --git a/libavfilter/vf_gblur_init.h b/libavfilter/vf_gblur_init.h
> index 0fee64bc98..9ff28c6f59 100644
> --- a/libavfilter/vf_gblur_init.h
> +++ b/libavfilter/vf_gblur_init.h
> @@ -115,8 +115,9 @@ static av_unused void ff_gblur_init(GBlurContext
> *s)
> s->horiz_slice = horiz_slice_c;
> s->verti_slice = verti_slice_c;
> s->postscale_slice = postscale_c;
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_gblur_init_x86(s);
> + #endif
> }
>
> #endif /* AVFILTER_GBLUR_INIT_H */
> diff --git a/libavfilter/vf_hflip_init.h b/libavfilter/vf_hflip_init.h
> index b58cfec901..63f9e3b92a 100644
> --- a/libavfilter/vf_hflip_init.h
> +++ b/libavfilter/vf_hflip_init.h
> @@ -101,8 +101,9 @@ static av_unused int ff_hflip_init(FlipContext *s,
> int step[4], int nb_planes)
> return AVERROR_BUG;
> }
> }
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_hflip_init_x86(s, step, nb_planes);
> + #endif
>
> return 0;
> }
> diff --git a/libavfilter/vf_nlmeans_init.h
> b/libavfilter/vf_nlmeans_init.h
> index 04ad8801b6..87fca13b2e 100644
> --- a/libavfilter/vf_nlmeans_init.h
> +++ b/libavfilter/vf_nlmeans_init.h
> @@ -129,11 +129,11 @@ static av_unused void
> ff_nlmeans_init(NLMeansDSPContext *dsp)
> dsp->compute_safe_ssd_integral_image =
> compute_safe_ssd_integral_image_c;
> dsp->compute_weights_line = compute_weights_line_c;
>
> - if (ARCH_AARCH64)
> + #if ARCH_AARCH64
> ff_nlmeans_init_aarch64(dsp);
> -
> - if (ARCH_X86)
> + #elif ARCH_X86
> ff_nlmeans_init_x86(dsp);
> + #endif
> }
>
> #endif /* AVFILTER_NLMEANS_INIT_H */
> diff --git a/libavfilter/vf_threshold_init.h
> b/libavfilter/vf_threshold_init.h
> index e79d2bb63d..c86e9da7f2 100644
> --- a/libavfilter/vf_threshold_init.h
> +++ b/libavfilter/vf_threshold_init.h
> @@ -84,8 +84,9 @@ static av_unused void
> ff_threshold_init(ThresholdContext *s)
> s->bpc = 2;
> }
>
> - if (ARCH_X86)
> + #if ARCH_X86
> ff_threshold_init_x86(s);
> + #endif
> }
>
> #endif /* AVFILTER_THRESHOLD_INIT_H */
> --
LGTM.
Tested and working fine.
Thank you very much!
softworkz
_______________________________________________
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] 3+ messages in thread
end of thread, other threads:[~2022-05-13 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 9:19 [FFmpeg-devel] [PATCH] avfilter, avcodec/*_init.h: Use #if to disable code Andreas Rheinhardt
2022-05-13 9:25 ` Hendrik Leppkes
2022-05-13 9:44 ` Soft Works
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