Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE
@ 2022-11-01 21:59 L. E. Segovia
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
                   ` (11 more replies)
  0 siblings, 12 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-01 21:59 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Hi all,

This is a patch to fix building FFmpeg without having DCE enabled.
This was previously attempted by Andreas Rheinhardt in commit 
40e6575aa3eed64cd32bf28c00ae57edc5acb25a. However, this is not remotely
enough for MSVC; one can quickly check for this by configuring the build
without any optimizations, and then overriding OPTFLAGS with /Od:

  ../configure --disable-asm --disable-optimizations --optflags=-Od --enable-shared --disable-static --toolchain=msvc

Issuing make should yield the first of many LNK2019 errors:

  LD      libavformat/avformat-59.dll
    Creating library libavformat/avformat.lib and object libavformat/avformat.exp
  rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_gen_pub_key referenced in function rtmp_handshake
  rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_compute_secret_key referenced in function rtmp_handshake
  rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_encrypt_sig referenced in function rtmp_handshake
  rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_update_keystream referenced in function rtmp_handshake
  libavformat\avformat-59.dll : fatal error LNK1120: 4 unresolved externals
  make: *** [/c/Users/Amalia/Desktop/ffmpeg/ffbuild/library.mak:119: libavformat/avformat-59.dll] Error 96

The proposed patchset comprehensively converts all instances of ARCH_FOO, 
CONFIG_FOO, INLINE_FOO and EXTERNAL_FOO to the equivalent preprocessor
guards.

L. E. Segovia (4):
  all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM

 fftools/ffprobe.c                          |  22 +-
 fftools/opt_common.c                       |  18 +-
 libavcodec/x86/aacencdsp_init.c            |   2 +
 libavcodec/x86/aacpsdsp_init.c             |   2 +
 libavcodec/x86/ac3dsp_init.c               |   4 +
 libavcodec/x86/audiodsp_init.c             |   2 +
 libavcodec/x86/bswapdsp_init.c             |   2 +
 libavcodec/x86/cavsdsp.c                   |   2 +
 libavcodec/x86/celt_pvq_init.c             |   2 +
 libavcodec/x86/cfhddsp_init.c              |   2 +
 libavcodec/x86/cfhdencdsp_init.c           |   2 +
 libavcodec/x86/dcadsp_init.c               |   4 +
 libavcodec/x86/dct_init.c                  |   2 +
 libavcodec/x86/dnxhdenc_init.c             |   2 +
 libavcodec/x86/exrdsp_init.c               |   2 +
 libavcodec/x86/fdctdsp_init.c              |   2 +
 libavcodec/x86/fft_init.c                  |   2 +
 libavcodec/x86/flacdsp_init.c              |   8 +-
 libavcodec/x86/g722dsp_init.c              |   2 +
 libavcodec/x86/h263dsp_init.c              |   2 +
 libavcodec/x86/h264_intrapred_init.c       |   2 +
 libavcodec/x86/h264chroma_init.c           |   2 +
 libavcodec/x86/hevcdsp_init.c              | 465 +++++++++++----------
 libavcodec/x86/hpeldsp_init.c              |   2 +
 libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
 libavcodec/x86/huffyuvdsp_init.c           |   2 +
 libavcodec/x86/huffyuvencdsp_init.c        |   2 +
 libavcodec/x86/idctdsp_init.c              |  11 +-
 libavcodec/x86/jpeg2000dsp_init.c          |   2 +
 libavcodec/x86/lossless_videodsp_init.c    |   2 +
 libavcodec/x86/lossless_videoencdsp_init.c |   2 +
 libavcodec/x86/mdct15_init.c               |   2 +
 libavcodec/x86/me_cmp_init.c               |   2 +
 libavcodec/x86/mlpdsp_init.c               |   8 +-
 libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
 libavcodec/x86/opusdsp_init.c              |   2 +
 libavcodec/x86/pixblockdsp_init.c          |   2 +
 libavcodec/x86/pngdsp_init.c               |   2 +
 libavcodec/x86/proresdsp_init.c            |   2 +
 libavcodec/x86/rv34dsp_init.c              |   2 +
 libavcodec/x86/sbcdsp_init.c               |   2 +
 libavcodec/x86/sbrdsp_init.c               |   2 +
 libavcodec/x86/svq1enc_init.c              |   2 +
 libavcodec/x86/utvideodsp_init.c           |   2 +
 libavcodec/x86/v210enc_init.c              |   2 +
 libavcodec/x86/vc1dsp_init.c               |   6 +-
 libavcodec/x86/vorbisdsp_init.c            |   2 +
 libavcodec/x86/vp3dsp_init.c               |   2 +
 libavcodec/x86/vp6dsp_init.c               |   2 +
 libavfilter/x86/af_afir_init.c             |   2 +
 libavfilter/x86/af_anlmdn_init.c           |   2 +
 libavfilter/x86/af_volume_init.c           |   2 +
 libavfilter/x86/avf_showcqt_init.c         |   2 +
 libavfilter/x86/colorspacedsp_init.c       |   6 +-
 libavfilter/x86/vf_atadenoise_init.c       |   8 +-
 libavfilter/x86/vf_blend_init.c            |   2 +
 libavfilter/x86/vf_bwdif_init.c            |   2 +
 libavfilter/x86/vf_convolution_init.c      |   2 +
 libavfilter/x86/vf_framerate_init.c        |   2 +
 libavfilter/x86/vf_fspp_init.c             |   2 +
 libavfilter/x86/vf_gblur_init.c            |   2 +
 libavfilter/x86/vf_hflip_init.c            |   2 +
 libavfilter/x86/vf_limiter_init.c          |   2 +
 libavfilter/x86/vf_maskedclamp_init.c      |   2 +
 libavfilter/x86/vf_maskedmerge_init.c      |   2 +
 libavfilter/x86/vf_overlay_init.c          |   2 +
 libavfilter/x86/vf_pp7_init.c              |   2 +
 libavfilter/x86/vf_psnr_init.c             |   2 +
 libavfilter/x86/vf_removegrain_init.c      |   2 +
 libavfilter/x86/vf_ssim_init.c             |   8 +-
 libavfilter/x86/vf_stereo3d_init.c         |   2 +
 libavfilter/x86/vf_threshold_init.c        |   2 +
 libavfilter/x86/vf_tinterlace_init.c       |   2 +
 libavfilter/x86/vf_transpose_init.c        |   2 +
 libavfilter/x86/vf_v360_init.c             |   2 +
 libavfilter/x86/vf_w3fdif_init.c           |   6 +-
 libavfilter/x86/vf_yadif_init.c            |   2 +
 libavformat/rtmpproto.c                    |  24 +-
 libavutil/x86/fixed_dsp_init.c             |   2 +
 libavutil/x86/float_dsp_init.c             |   2 +
 libavutil/x86/imgutils_init.c              |   2 +
 libavutil/x86/lls_init.c                   |   2 +
 libavutil/x86/pixelutils_init.c            |   2 +
 libswresample/x86/audio_convert_init.c     |   2 +
 libswresample/x86/resample_init.c          |   6 +
 libswscale/x86/rgb2rgb.c                   |   2 +
 libswscale/x86/swscale.c                   |   2 +
 87 files changed, 493 insertions(+), 255 deletions(-)

-- 
2.37.1.windows.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
@ 2022-11-01 21:59 ` L. E. Segovia
  2022-11-01 22:28   ` Andreas Rheinhardt
  2022-11-03 21:59   ` Carl Eugen Hoyos
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
                   ` (10 subsequent siblings)
  11 siblings, 2 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-01 21:59 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/dcadsp_init.c         |   2 +
 libavcodec/x86/fdctdsp_init.c        |   2 +
 libavcodec/x86/flacdsp_init.c        |   8 +-
 libavcodec/x86/hevcdsp_init.c        | 463 ++++++++++++++-------------
 libavcodec/x86/idctdsp_init.c        |   9 +-
 libavcodec/x86/mlpdsp_init.c         |   6 +-
 libavcodec/x86/vc1dsp_init.c         |   6 +-
 libavfilter/x86/colorspacedsp_init.c |   4 +-
 libavfilter/x86/vf_atadenoise_init.c |   6 +-
 libavfilter/x86/vf_ssim_init.c       |   6 +-
 libavfilter/x86/vf_w3fdif_init.c     |   4 +-
 11 files changed, 272 insertions(+), 244 deletions(-)

diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 0c78dd1c9e..3c125f33fd 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -36,6 +36,7 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if ARCH_X86_32
     if (EXTERNAL_SSE2(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_sse2;
     if (EXTERNAL_SSE3(cpu_flags))
@@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
     }
     if (EXTERNAL_FMA3(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
+#endif
 }
diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
index 92a842433d..4a874a640d 100644
--- a/libavcodec/x86/fdctdsp_init.c
+++ b/libavcodec/x86/fdctdsp_init.c
@@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
 
     if (!high_bit_depth) {
         if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+#if HAVE_INLINE_SSE2
             if (INLINE_SSE2(cpu_flags))
                 c->fdct = ff_fdct_sse2;
+#endif
         }
     }
 }
diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
index 87daed7005..49e67ee2b0 100644
--- a/libavcodec/x86/flacdsp_init.c
+++ b/libavcodec/x86/flacdsp_init.c
@@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
     }
     if (EXTERNAL_AVX(cpu_flags)) {
         if (fmt == AV_SAMPLE_FMT_S16) {
-            if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
+#endif
         } else if (fmt == AV_SAMPLE_FMT_S32) {
             if (channels == 4)
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
+#endif
         }
     }
     if (EXTERNAL_XOP(cpu_flags)) {
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 6f45e5e0db..c7060085a2 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
+#endif
             SAO_BAND_INIT(8, sse2);
 
             c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
@@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
-            if(ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
+#endif
             SAO_EDGE_INIT(8, ssse3);
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
-
+#if ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
@@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_avx;
-                c->idct[3] = ff_hevc_idct_32x32_8_avx;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_8_avx;
+            c->idct[3] = ff_hevc_idct_32x32_8_avx;
+#endif
             SAO_BAND_INIT(8, avx);
 
             c->idct[0] = ff_hevc_idct_4x4_8_avx;
@@ -775,91 +776,91 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
-            if (ARCH_X86_64) {
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+#if ARCH_X86_64
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
 
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
 
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
 
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
-            }
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
+#endif
             SAO_BAND_INIT(8, avx2);
 
             c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
@@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
+#endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
 
@@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
             c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
@@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_avx;
-                c->idct[3] = ff_hevc_idct_32x32_10_avx;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_10_avx;
+            c->idct[3] = ff_hevc_idct_32x32_10_avx;
+#endif
 
             c->idct[0] = ff_hevc_idct_4x4_10_avx;
             c->idct[1] = ff_hevc_idct_8x8_10_avx;
@@ -942,150 +945,150 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
-            if (ARCH_X86_64) {
-                c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+#if ARCH_X86_64
+            c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
 
-                c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+            c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
 
-                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+            c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
 
-                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+            c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
 
-                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
 
-                c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
-                c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
+            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
+            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
 
-                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
-                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
+            c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
+            c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
 
-                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
-                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
+            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
+            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
 
-                c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
-                c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
+            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
+            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
 
-                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
-                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
+            c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
+            c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
 
-                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
-                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
+            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
+            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
 
-                c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
-                c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
+            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
+            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
 
-                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
-                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
+            c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
+            c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
 
-                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
-                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
+            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
+            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
 
-                c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
-                c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
+            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
+            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
 
-                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
-                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
+            c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
+            c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
 
-                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
 
-                c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
-                c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
+            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
+            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
 
-                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
+            c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
 
-                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
+            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
 
-                c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
-                c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
-                c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
-                c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
-                c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
+            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
+            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
+            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
+            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
+            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
 
-                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
+            c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
 
-                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
-            }
+            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
+#endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
 
@@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
+#endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
 
@@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
@@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
+#endif
             SAO_BAND_INIT(12, avx);
         }
         if (EXTERNAL_AVX2(cpu_flags)) {
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index f28a1ad744..4ade52a880 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
 #endif
 
-        if (ARCH_X86_64 &&
-            !high_bit_depth &&
+#if ARCH_X86_64
+        if (!high_bit_depth &&
             avctx->lowres == 0 &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
                 avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
@@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                 c->idct_add  = ff_simple_idct8_add_sse2;
                 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
         }
+#endif
     }
 
-    if (ARCH_X86_64 && avctx->lowres == 0) {
+#if ARCH_X86_64
+    if (avctx->lowres == 0) {
         if (EXTERNAL_AVX(cpu_flags) &&
             !high_bit_depth &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
@@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
             }
         }
     }
+#endif
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 950f996832..333a685f47 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
-    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
+    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
+#endif
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 90b2f3624e..bc63933e83 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
+#if HAVE_6REGS
+    if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
 
-    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
+    if (INLINE_MMXEXT(cpu_flags))
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
+#endif
 
 #define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index b5006ac295..f01db4baf4 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags)) {
 #define assign_yuv2yuv_fns(ss) \
         dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \
         dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \
@@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
+#endif
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index e7a653f191..eb621e172c 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
+#if ARCH_X86_64 
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
         }
 
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
         }
+#endif
     }
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index cbaa20ef16..ddc91f791a 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
-        dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+#if ARCH_X86_64
+    if (EXTERNAL_SSSE3(cpu_flags))
+      dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+#endif
     if (EXTERNAL_SSE4(cpu_flags))
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 16202fba76..6d677d651d 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_scale        = ff_w3fdif_scale_sse2;
     }
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
+#endif
 }
-- 
2.37.1.windows.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2022-11-01 21:59 ` L. E. Segovia
  2022-11-02  0:38   ` Andreas Rheinhardt
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2022-11-01 21:59 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 fftools/ffprobe.c       | 22 ++++++++++++++++++----
 fftools/opt_common.c    | 18 +++++++++++++++++-
 libavformat/rtmpproto.c | 24 ++++++++++++++++++------
 3 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 9b7e82fd8c..c16c68ee92 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3519,8 +3519,7 @@ static void ffprobe_show_program_version(WriterContext *w)
 }
 
 #define SHOW_LIB_VERSION(libname, LIBNAME)                              \
-    do {                                                                \
-        if (CONFIG_##LIBNAME) {                                         \
+        {                                                               \
             unsigned int version = libname##_version();                 \
             writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
             print_str("name",    "lib" #libname);                       \
@@ -3530,20 +3529,35 @@ static void ffprobe_show_program_version(WriterContext *w)
             print_int("version", version);                              \
             print_str("ident",   LIB##LIBNAME##_IDENT);                 \
             writer_print_section_footer(w);                             \
-        }                                                               \
-    } while (0)
+        }
 
 static void ffprobe_show_library_versions(WriterContext *w)
 {
     writer_print_section_header(w, SECTION_ID_LIBRARY_VERSIONS);
+#if CONFIG_AVUTIL
     SHOW_LIB_VERSION(avutil,     AVUTIL);
+#endif
+#if CONFIG_AVCODEC
     SHOW_LIB_VERSION(avcodec,    AVCODEC);
+#endif
+#if CONFIG_AVFORMAT
     SHOW_LIB_VERSION(avformat,   AVFORMAT);
+#endif
+#if CONFIG_AVDEVICE
     SHOW_LIB_VERSION(avdevice,   AVDEVICE);
+#endif
+#if CONFIG_AVFILTER
     SHOW_LIB_VERSION(avfilter,   AVFILTER);
+#endif
+#if CONFIG_SWSCALE
     SHOW_LIB_VERSION(swscale,    SWSCALE);
+#endif
+#if CONFIG_SWRESAMPLE
     SHOW_LIB_VERSION(swresample, SWRESAMPLE);
+#endif
+#if CONFIG_POSTPROC
     SHOW_LIB_VERSION(postproc,   POSTPROC);
+#endif
     writer_print_section_footer(w);
 }
 
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 8a06df82df..243eb4e3a1 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -154,7 +154,7 @@ static int warned_cfg = 0;
 #define SHOW_COPYRIGHT 8
 
 #define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
-    if (CONFIG_##LIBNAME) {                                             \
+    {                                                                   \
         const char *indent = flags & INDENT? "  " : "";                 \
         if (flags & SHOW_VERSION) {                                     \
             unsigned int version = libname##_version();                 \
@@ -184,14 +184,30 @@ static int warned_cfg = 0;
 
 static void print_all_libs_info(int flags, int level)
 {
+#if CONFIG_AVUTIL
     PRINT_LIB_INFO(avutil,     AVUTIL,     flags, level);
+#endif
+#if CONFIG_AVCODEC
     PRINT_LIB_INFO(avcodec,    AVCODEC,    flags, level);
+#endif
+#if CONFIG_AVFORMAT
     PRINT_LIB_INFO(avformat,   AVFORMAT,   flags, level);
+#endif
+#if CONFIG_AVDEVICE
     PRINT_LIB_INFO(avdevice,   AVDEVICE,   flags, level);
+#endif
+#if CONFIG_AVFILTER
     PRINT_LIB_INFO(avfilter,   AVFILTER,   flags, level);
+#endif
+#if CONFIG_SWSCALE
     PRINT_LIB_INFO(swscale,    SWSCALE,    flags, level);
+#endif
+#if CONFIG_SWRESAMPLE
     PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level);
+#endif
+#if CONFIG_POSTPROC
     PRINT_LIB_INFO(postproc,   POSTPROC,   flags, level);
+#endif
 }
 
 static void print_program_info(int flags, int level)
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f0ef223f05..6d84fcf34f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
     for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
         tosend[i] = av_lfg_get(&rnd) >> 24;
 
-    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+    if (rt->encrypted) {
         /* When the client wants to use RTMPE, we have to change the command
          * byte to 0x06 which means to use encrypted data and we have to set
          * the flash version to at least 9.0.115.0. */
@@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
             return ret;
     }
+#endif
 
     client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
     if (client_pos < 0)
@@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
             /* Encrypt the signature received by the server. */
             ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]);
         }
+#endif
 
         if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
             av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
@@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Encrypt the signature to be send to the server. */
             ff_rtmpe_encrypt_sig(rt->stream, tosend +
                                  RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
                                  serverdata[0]);
         }
+#endif
 
         // write reply back to the server
         if ((ret = ffurl_write(rt->stream, tosend,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     } else {
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
                                      serverdata[0]);
             }
         }
+#endif
 
         if ((ret = ffurl_write(rt->stream, serverdata + 1,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     }
 
     return 0;
-- 
2.37.1.windows.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
@ 2022-11-01 21:59 ` L. E. Segovia
  2022-11-02  0:42   ` Andreas Rheinhardt
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2022-11-01 21:59 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/vc1dsp_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index bc63933e83..65fc28ea35 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS
+#if HAVE_6REGS && HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
-- 
2.37.1.windows.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (2 preceding siblings ...)
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
@ 2022-11-01 21:59 ` L. E. Segovia
  2022-11-02  0:26   ` Andreas Rheinhardt
  2022-11-02  1:08 ` [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE Andreas Rheinhardt
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2022-11-01 21:59 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/aacencdsp_init.c            | 2 ++
 libavcodec/x86/aacpsdsp_init.c             | 2 ++
 libavcodec/x86/ac3dsp_init.c               | 4 ++++
 libavcodec/x86/audiodsp_init.c             | 2 ++
 libavcodec/x86/bswapdsp_init.c             | 2 ++
 libavcodec/x86/cavsdsp.c                   | 2 ++
 libavcodec/x86/celt_pvq_init.c             | 2 ++
 libavcodec/x86/cfhddsp_init.c              | 2 ++
 libavcodec/x86/cfhdencdsp_init.c           | 2 ++
 libavcodec/x86/dcadsp_init.c               | 2 ++
 libavcodec/x86/dct_init.c                  | 2 ++
 libavcodec/x86/dnxhdenc_init.c             | 2 ++
 libavcodec/x86/exrdsp_init.c               | 2 ++
 libavcodec/x86/fft_init.c                  | 2 ++
 libavcodec/x86/g722dsp_init.c              | 2 ++
 libavcodec/x86/h263dsp_init.c              | 2 ++
 libavcodec/x86/h264_intrapred_init.c       | 2 ++
 libavcodec/x86/h264chroma_init.c           | 2 ++
 libavcodec/x86/hevcdsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_vp3_init.c          | 2 ++
 libavcodec/x86/huffyuvdsp_init.c           | 2 ++
 libavcodec/x86/huffyuvencdsp_init.c        | 2 ++
 libavcodec/x86/idctdsp_init.c              | 2 ++
 libavcodec/x86/jpeg2000dsp_init.c          | 2 ++
 libavcodec/x86/lossless_videodsp_init.c    | 2 ++
 libavcodec/x86/lossless_videoencdsp_init.c | 2 ++
 libavcodec/x86/mdct15_init.c               | 2 ++
 libavcodec/x86/me_cmp_init.c               | 2 ++
 libavcodec/x86/mlpdsp_init.c               | 2 ++
 libavcodec/x86/mpegvideoencdsp_init.c      | 2 ++
 libavcodec/x86/opusdsp_init.c              | 2 ++
 libavcodec/x86/pixblockdsp_init.c          | 2 ++
 libavcodec/x86/pngdsp_init.c               | 2 ++
 libavcodec/x86/proresdsp_init.c            | 2 ++
 libavcodec/x86/rv34dsp_init.c              | 2 ++
 libavcodec/x86/sbcdsp_init.c               | 2 ++
 libavcodec/x86/sbrdsp_init.c               | 2 ++
 libavcodec/x86/svq1enc_init.c              | 2 ++
 libavcodec/x86/utvideodsp_init.c           | 2 ++
 libavcodec/x86/v210enc_init.c              | 2 ++
 libavcodec/x86/vorbisdsp_init.c            | 2 ++
 libavcodec/x86/vp3dsp_init.c               | 2 ++
 libavcodec/x86/vp6dsp_init.c               | 2 ++
 libavfilter/x86/af_afir_init.c             | 2 ++
 libavfilter/x86/af_anlmdn_init.c           | 2 ++
 libavfilter/x86/af_volume_init.c           | 2 ++
 libavfilter/x86/avf_showcqt_init.c         | 2 ++
 libavfilter/x86/colorspacedsp_init.c       | 2 ++
 libavfilter/x86/vf_atadenoise_init.c       | 2 ++
 libavfilter/x86/vf_blend_init.c            | 2 ++
 libavfilter/x86/vf_bwdif_init.c            | 2 ++
 libavfilter/x86/vf_convolution_init.c      | 2 ++
 libavfilter/x86/vf_framerate_init.c        | 2 ++
 libavfilter/x86/vf_fspp_init.c             | 2 ++
 libavfilter/x86/vf_gblur_init.c            | 2 ++
 libavfilter/x86/vf_hflip_init.c            | 2 ++
 libavfilter/x86/vf_limiter_init.c          | 2 ++
 libavfilter/x86/vf_maskedclamp_init.c      | 2 ++
 libavfilter/x86/vf_maskedmerge_init.c      | 2 ++
 libavfilter/x86/vf_overlay_init.c          | 2 ++
 libavfilter/x86/vf_pp7_init.c              | 2 ++
 libavfilter/x86/vf_psnr_init.c             | 2 ++
 libavfilter/x86/vf_removegrain_init.c      | 2 ++
 libavfilter/x86/vf_ssim_init.c             | 2 ++
 libavfilter/x86/vf_stereo3d_init.c         | 2 ++
 libavfilter/x86/vf_threshold_init.c        | 2 ++
 libavfilter/x86/vf_tinterlace_init.c       | 2 ++
 libavfilter/x86/vf_transpose_init.c        | 2 ++
 libavfilter/x86/vf_v360_init.c             | 2 ++
 libavfilter/x86/vf_w3fdif_init.c           | 2 ++
 libavfilter/x86/vf_yadif_init.c            | 2 ++
 libavutil/x86/fixed_dsp_init.c             | 2 ++
 libavutil/x86/float_dsp_init.c             | 2 ++
 libavutil/x86/imgutils_init.c              | 2 ++
 libavutil/x86/lls_init.c                   | 2 ++
 libavutil/x86/pixelutils_init.c            | 2 ++
 libswresample/x86/audio_convert_init.c     | 2 ++
 libswresample/x86/resample_init.c          | 6 ++++++
 libswscale/x86/rgb2rgb.c                   | 2 ++
 libswscale/x86/swscale.c                   | 2 ++
 81 files changed, 168 insertions(+)

diff --git a/libavcodec/x86/aacencdsp_init.c b/libavcodec/x86/aacencdsp_init.c
index 049a2417d9..7dca1d481b 100644
--- a/libavcodec/x86/aacencdsp_init.c
+++ b/libavcodec/x86/aacencdsp_init.c
@@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled,
 
 av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->quant_bands = ff_aac_quantize_bands_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c
index 0b0ee07db4..44d64f5340 100644
--- a/libavcodec/x86/aacpsdsp_init.c
+++ b/libavcodec/x86/aacpsdsp_init.c
@@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64],
 
 av_cold void ff_psdsp_init_x86(PSDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s)
     if (EXTERNAL_FMA3(cpu_flags)) {
         s->hybrid_analysis        = ff_ps_hybrid_analysis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 43b3b4ac85..76a8c0547d 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
 
 av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
         if (!(cpu_flags & AV_CPU_FLAG_ATOM))
             c->extract_exponents = ff_ac3_extract_exponents_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
 
 #define DOWNMIX_FUNC_OPT(ch, opt)                                       \
@@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3)
 
 void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #define SET_DOWNMIX(ch, suf, SUF)                                       \
@@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
         SET_DOWNMIX_ALL(avx,  AVX)
         SET_DOWNMIX_ALL(fma3, FMA3)
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c
index 68aa3b2129..c5f410678e 100644
--- a/libavcodec/x86/audiodsp_init.c
+++ b/libavcodec/x86/audiodsp_init.c
@@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src,
 
 av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->scalarproduct_int16 = ff_scalarproduct_int16_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c
index 877bab1a2c..08551f6487 100644
--- a/libavcodec/x86/bswapdsp_init.c
+++ b/libavcodec/x86/bswapdsp_init.c
@@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t *src, int w);
 
 av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
         c->bswap_buf = ff_bswap32_buf_ssse3;
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->bswap_buf = ff_bswap32_buf_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 4ad977a034..ad755e7321 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -383,6 +383,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         DSPFUNC(avg, 1,  8, mmxext);
     }
 #endif
+#if HAVE_X86ASM
 #if HAVE_MMX_EXTERNAL
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext;
@@ -397,4 +398,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         c->idct_perm      = FF_IDCT_PERM_TRANSPOSE;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c
index 5a0669e6f2..b88a2f6225 100644
--- a/libavcodec/x86/celt_pvq_init.c
+++ b/libavcodec/x86/celt_pvq_init.c
@@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx  (float *X, int *y, int K, int N);
 
 av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->pvq_search = ff_pvq_search_exact_avx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c
index c5d89561ae..a773c365c1 100644
--- a/libavcodec/x86/cfhddsp_init.c
+++ b/libavcodec/x86/cfhddsp_init.c
@@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output, const int16_t *low, const
 
 av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
         if (depth == 12 && !bayer)
             c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhdencdsp_init.c b/libavcodec/x86/cfhdencdsp_init.c
index 5cea39a80a..79b2f10bf7 100644
--- a/libavcodec/x86/cfhdencdsp_init.c
+++ b/libavcodec/x86/cfhdencdsp_init.c
@@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *hi
 
 av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
         c->vert_filter = ff_cfhdenc_vert_filter_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 3c125f33fd..0475841a40 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3)
 
 av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_32
@@ -48,4 +49,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
     if (EXTERNAL_FMA3(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c
index d0e4b34dd3..6756e1e12d 100644
--- a/libavcodec/x86/dct_init.c
+++ b/libavcodec/x86/dct_init.c
@@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
 
 av_cold void ff_dct_init_x86(DCTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->dct32 = ff_dct32_float_sse2;
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->dct32 = ff_dct32_float_avx;
+#endif
 }
diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c
index fd6f15005a..612b70ad7a 100644
--- a/libavcodec/x86/dnxhdenc_init.c
+++ b/libavcodec/x86/dnxhdenc_init.c
@@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
 
 av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(av_get_cpu_flags())) {
         if (ctx->cid_table->bit_depth == 8)
             ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c
index 63b3480d8f..f9696d7a91 100644
--- a/libavcodec/x86/exrdsp_init.c
+++ b/libavcodec/x86/exrdsp_init.c
@@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size);
 
 av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
         dsp->reorder_pixels = ff_reorder_pixels_avx2;
         dsp->predictor      = ff_predictor_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c
index df79d57dc7..065e231edb 100644
--- a/libavcodec/x86/fft_init.c
+++ b/libavcodec/x86/fft_init.c
@@ -26,6 +26,7 @@
 
 av_cold void ff_fft_init_x86(FFTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->nbits > 16)
@@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s)
         s->fft_calc        = ff_fft_calc_avx;
         s->fft_permutation = FF_FFT_PERM_AVX;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c
index 614695193b..700269d62a 100644
--- a/libavcodec/x86/g722dsp_init.c
+++ b/libavcodec/x86/g722dsp_init.c
@@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t *prev_samples, int xout[2]);
 
 av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         dsp->apply_qmf = ff_g722_apply_qmf_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c
index ab81063233..57ec1640e3 100644
--- a/libavcodec/x86/h263dsp_init.c
+++ b/libavcodec/x86/h263dsp_init.c
@@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale);
 
 av_cold void ff_h263dsp_init_x86(H263DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
         c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
         c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
index ee46927a24..5518961784 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
                                    const int bit_depth,
                                    const int chroma_format_idc)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_avx;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c
index 34934b6ad0..57d92ad107 100644
--- a/libavcodec/x86/h264chroma_init.c
+++ b/libavcodec/x86/h264chroma_init.c
@@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx)
 
 av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
 {
+#if HAVE_X86ASM
     int high_bit_depth = bit_depth > 8;
     int cpu_flags      = av_get_cpu_flags();
 
@@ -105,4 +106,5 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
         c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
         c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index c7060085a2..29c11246ae 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2)
 
 void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             SAO_EDGE_INIT(12, avx2);
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 09c48c341e..d8f4e45849 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -224,6 +224,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (INLINE_MMX(cpu_flags))
         hpeldsp_init_mmx(c, flags);
 
@@ -235,6 +236,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 
     if (EXTERNAL_SSSE3(cpu_flags))
         hpeldsp_init_ssse3(c, flags);
+#endif
 
     if (CONFIG_VP3_DECODER)
         ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);
diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c
index 1dbd1ba6f9..3dd6c45afa 100644
--- a/libavcodec/x86/hpeldsp_vp3_init.c
+++ b/libavcodec/x86/hpeldsp_vp3_init.c
@@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block,
 
 av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
             c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext;
             c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c
index 239d3ca313..445137da87 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *top, co
 
 av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->add_int16 = ff_add_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c
index c9c33b75b4..35d18a040c 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, c
 
 av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     av_unused int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -51,4 +52,5 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 4ade52a880..3f74da85cd 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
 av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_32
@@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/jpeg2000dsp_init.c b/libavcodec/x86/jpeg2000dsp_init.c
index 7310a1d0e1..0256be8046 100644
--- a/libavcodec/x86/jpeg2000dsp_init.c
+++ b/libavcodec/x86/jpeg2000dsp_init.c
@@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize);
 
 av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE(cpu_flags)) {
         c->mct_decode[FF_DWT97] = ff_ict_float_sse;
@@ -57,4 +58,5 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c
index 5690cacaad..720cf98389 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->add_bytes       = ff_add_bytes_sse2;
         c->add_median_pred = ff_add_median_pred_sse2;
@@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
         c->add_left_pred   = ff_add_left_pred_unaligned_avx2;
         c->add_gradient_pred = ff_add_gradient_pred_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videoencdsp_init.c b/libavcodec/x86/lossless_videoencdsp_init.c
index 22a4014ef1..26cfcbb4b2 100644
--- a/libavcodec/x86/lossless_videoencdsp_init.c
+++ b/libavcodec/x86/lossless_videoencdsp_init.c
@@ -91,6 +91,7 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     }
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_sse2;
     }
@@ -102,4 +103,5 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c
index ea7301e1e7..25653013a5 100644
--- a/libavcodec/x86/mdct15_init.c
+++ b/libavcodec/x86/mdct15_init.c
@@ -84,6 +84,7 @@ static void perm_twiddles(MDCT15Context *s)
 av_cold void ff_mdct15_init_x86(MDCT15Context *s)
 {
     int adjust_twiddles = 0;
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags))
@@ -98,6 +99,7 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s)
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         s->postreindex = ff_mdct15_postreindex_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 
     if (adjust_twiddles)
         perm_twiddles(s);
diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c
index bc1051c27e..527fdff4a9 100644
--- a/libavcodec/x86/me_cmp_init.c
+++ b/libavcodec/x86/me_cmp_init.c
@@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
 
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMX(cpu_flags)) {
         c->sse[1]            = ff_sse8_mmx;
 #if HAVE_X86ASM
@@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
         c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 333a685f47..f7eca8cb76 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,10 +200,12 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
+#if HAVE_X86ASM
 #if ARCH_X86_64
     if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
     if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c
index ec174b15aa..82f9df4cba 100644
--- a/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/libavcodec/x86/mpegvideoencdsp_init.c
@@ -216,6 +216,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_sse2;
         c->pix_norm1   = ff_pix_norm1_sse2;
@@ -224,6 +225,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
     if (EXTERNAL_XOP(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_xop;
     }
+#endif /* HAVE_X86ASM */
 
 #if HAVE_INLINE_ASM
 
diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c
index 582fbb4f0c..4598657116 100644
--- a/libavcodec/x86/opusdsp_init.c
+++ b/libavcodec/x86/opusdsp_init.c
@@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len);
 
 av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_FMA3(cpu_flags)) {
         ctx->postfilter = ff_opus_postfilter_fma3;
         ctx->deemphasis = ff_opus_deemphasis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c
index 51f2a0033a..9d3aac4c74 100644
--- a/libavcodec/x86/pixblockdsp_init.c
+++ b/libavcodec/x86/pixblockdsp_init.c
@@ -31,6 +31,7 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
                                      AVCodecContext *avctx,
                                      unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
         c->diff_pixels_unaligned =
         c->diff_pixels = ff_diff_pixels_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c
index e2cd5effe3..c6562f7abb 100644
--- a/libavcodec/x86/pngdsp_init.c
+++ b/libavcodec/x86/pngdsp_init.c
@@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
 
 av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
         dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
     if (EXTERNAL_SSSE3(cpu_flags))
         dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c
index bde79ab8c0..01e5e67236 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize,
 
 av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
 {
+#if HAVE_X86ASM
 #if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
@@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
         }
     }
 #endif /* ARCH_X86_64 */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index caa5c2d653..f76bef39e1 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
 
 av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags)) {
@@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2;
     if (EXTERNAL_SSE4(cpu_flags))
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c
index 7416a86ac6..79914cc565 100644
--- a/libavcodec/x86/sbcdsp_init.c
+++ b/libavcodec/x86/sbcdsp_init.c
@@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8],
 
 av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
         s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
         s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 999f681220..d70ffa0d6c 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2], float phi[3][2][2]);
 
 av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
     if (EXTERNAL_SSE3(cpu_flags)) {
         s->autocorrelate = ff_sbr_autocorrelate_sse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c
index daf573beba..c016811822 100644
--- a/libavcodec/x86/svq1enc_init.c
+++ b/libavcodec/x86/svq1enc_init.c
@@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2,
 
 av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index 2b436c6c5c..e81f6bf3c0 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r, uint16_t *src_g, uint16_t *sr
 
 av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
         c->restore_rgb_planes   = ff_restore_rgb_planes_avx2;
         c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index 13a351dd1d..542bfe8b8a 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -36,6 +36,7 @@ void ff_v210_planar_pack_10_avx2(const uint16_t *y, const uint16_t *u,
 
 av_cold void ff_v210enc_init_x86(V210EncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSSE3(cpu_flags)) {
@@ -52,4 +53,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
         s->sample_factor_10 = 2;
         s->pack_line_10     = ff_v210_planar_pack_10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vorbisdsp_init.c b/libavcodec/x86/vorbisdsp_init.c
index 08a3bb2965..067b92e2a4 100644
--- a/libavcodec/x86/vorbisdsp_init.c
+++ b/libavcodec/x86/vorbisdsp_init.c
@@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang,
 
 av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
         dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index f54fa57b3e..7d69956d22 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a,
 
 av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
         c->idct_put  = ff_vp3_idct_put_sse2;
         c->idct_add  = ff_vp3_idct_add_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c
index 83d45ec36c..6a3bf36bae 100644
--- a/libavcodec/x86/vp6dsp_init.c
+++ b/libavcodec/x86/vp6dsp_init.c
@@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
 
 av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c
index e53817b9c0..3561d9fe3f 100644
--- a/libavfilter/x86/af_afir_init.c
+++ b/libavfilter/x86/af_afir_init.c
@@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t, const float *c,
 
 av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags)) {
@@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
     if (EXTERNAL_AVX_FAST(cpu_flags)) {
         s->fcmul_add = ff_fcmul_add_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_anlmdn_init.c b/libavfilter/x86/af_anlmdn_init.c
index 30eff6f644..047d88b795 100644
--- a/libavfilter/x86/af_anlmdn_init.c
+++ b/libavfilter/x86/af_anlmdn_init.c
@@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1, const float *f2,
 
 av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
         s->compute_distance_ssd = ff_compute_distance_ssd_sse;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_volume_init.c b/libavfilter/x86/af_volume_init.c
index 88f5a9679a..28cfbe1ce1 100644
--- a/libavfilter/x86/af_volume_init.c
+++ b/libavfilter/x86/af_volume_init.c
@@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len,
 
 av_cold void ff_volume_init_x86(VolumeContext *vol)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);
 
@@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol)
             vol->samples_align = 8;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/avf_showcqt_init.c b/libavfilter/x86/avf_showcqt_init.c
index 2320b30239..1a5534a12e 100644
--- a/libavfilter/x86/avf_showcqt_init.c
+++ b/libavfilter/x86/avf_showcqt_init.c
@@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len)
 
 av_cold void ff_showcqt_init_x86(ShowCQTContext *s)
 {
+#if HAVE_X86ASM
     int cpuflags = av_get_cpu_flags();
 
 #define SELECT_CQT_CALC(type, TYPE, align, perm) \
@@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \
     SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm
     SELECT_CQT_CALC(avx,  AVX_FAST,  8, 01452367);
     SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367);
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index f01db4baf4..66c25cb361 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h,
 
 void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index eb621e172c..8ec98f1a82 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst,
 
 av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
@@ -49,4 +50,5 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
         }
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_blend_init.c b/libavfilter/x86/vf_blend_init.c
index c326c43362..6d57bf7eac 100644
--- a/libavfilter/x86/vf_blend_init.c
+++ b/libavfilter/x86/vf_blend_init.c
@@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2)
 
 av_cold void ff_blend_init_x86(FilterParams *param, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (depth == 8) {
@@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param, int depth)
         }
 #endif /* ARCH_X86_64 */
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c
index e24e5cd9b1..ec0ee6af85 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -44,6 +44,7 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne
 
 av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
 {
+#if HAVE_X86ASM
     YADIFContext *yadif = &bwdif->yadif;
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth;
@@ -59,4 +60,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
         if (EXTERNAL_SSSE3(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c
index b78a47d02b..fc9cd49de7 100644
--- a/libavfilter/x86/vf_convolution_init.c
+++ b/libavfilter/x86/vf_convolution_init.c
@@ -31,6 +31,7 @@ void ff_filter_3x3_sse4(uint8_t *dst, int width,
 
 av_cold void ff_convolution_init_x86(ConvolutionContext *s)
 {
+#if HAVE_X86ASM
 #if ARCH_X86_64
     int i;
     int cpu_flags = av_get_cpu_flags();
@@ -43,4 +44,5 @@ av_cold void ff_convolution_init_x86(ConvolutionContext *s)
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_framerate_init.c b/libavfilter/x86/vf_framerate_init.c
index 9d40faf0a4..b4a9dc574d 100644
--- a/libavfilter/x86/vf_framerate_init.c
+++ b/libavfilter/x86/vf_framerate_init.c
@@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS);
 
 void ff_framerate_init_x86(FrameRateContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (s->bitdepth == 8) {
         if (EXTERNAL_AVX2_FAST(cpu_flags))
@@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s)
         else if (EXTERNAL_SSE4(cpu_flags))
             s->blend = ff_blend_frames16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c
index 8e00317cb7..3618b70dc3 100644
--- a/libavfilter/x86/vf_fspp_init.c
+++ b/libavfilter/x86/vf_fspp_init.c
@@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t *pixels, ptrdiff_t line_size,
 
 av_cold void ff_fspp_init_x86(FSPPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s)
         s->row_idct     = ff_row_idct_mmx;
         s->row_fdct     = ff_row_fdct_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_gblur_init.c b/libavfilter/x86/vf_gblur_init.c
index b47f6fbffb..01e1b82131 100644
--- a/libavfilter/x86/vf_gblur_init.c
+++ b/libavfilter/x86/vf_gblur_init.c
@@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begi
 
 av_cold void ff_gblur_init_x86(GBlurContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s)
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_hflip_init.c b/libavfilter/x86/vf_hflip_init.c
index 0ac399b0d4..743b368ee9 100644
--- a/libavfilter/x86/vf_hflip_init.c
+++ b/libavfilter/x86/vf_hflip_init.c
@@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t *dst, int w);
 
 av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int i;
 
@@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_limiter_init.c b/libavfilter/x86/vf_limiter_init.c
index 07c733dc21..2c26f90f0f 100644
--- a/libavfilter/x86/vf_limiter_init.c
+++ b/libavfilter/x86/vf_limiter_init.c
@@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t *dst,
 
 void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
             dsp->limiter = ff_limiter_16bit_sse4;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedclamp_init.c b/libavfilter/x86/vf_maskedclamp_init.c
index 2a5388abac..94217cf485 100644
--- a/libavfilter/x86/vf_maskedclamp_init.c
+++ b/libavfilter/x86/vf_maskedclamp_init.c
@@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc, uint8_t *dst,
 
 av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -43,4 +44,5 @@ av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
     if (EXTERNAL_SSE4(cpu_flags) && depth > 8) {
         dsp->maskedclamp = ff_maskedclamp16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedmerge_init.c b/libavfilter/x86/vf_maskedmerge_init.c
index 73ab888083..2eee4a36c2 100644
--- a/libavfilter/x86/vf_maskedmerge_init.c
+++ b/libavfilter/x86/vf_maskedmerge_init.c
@@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const uint8_t *osrc,
 
 av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) {
         s->maskedmerge = ff_maskedmerge8_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_overlay_init.c b/libavfilter/x86/vf_overlay_init.c
index d4218b18f6..9f7d9c4909 100644
--- a/libavfilter/x86/vf_overlay_init.c
+++ b/libavfilter/x86/vf_overlay_init.c
@@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a,
 av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
                                  int alpha_format, int main_has_alpha)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags) &&
@@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
         s->blend_row[1] = ff_overlay_row_22_sse4;
         s->blend_row[2] = ff_overlay_row_22_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c
index 165b0dd5d0..ed5ab82794 100644
--- a/libavfilter/x86/vf_pp7_init.c
+++ b/libavfilter/x86/vf_pp7_init.c
@@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src);
 
 av_cold void ff_pp7_init_x86(PP7Context *p)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags))
         p->dctB = ff_pp7_dctB_mmx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c
index c387812204..82be86d923 100644
--- a/libavfilter/x86/vf_psnr_init.c
+++ b/libavfilter/x86/vf_psnr_init.c
@@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w);
 
 void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
             dsp->sse_line = ff_sse_line_16bit_sse2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_removegrain_init.c b/libavfilter/x86/vf_removegrain_init.c
index 07314b3244..ff5f4771d2 100644
--- a/libavfilter/x86/vf_removegrain_init.c
+++ b/libavfilter/x86/vf_removegrain_init.c
@@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pix
 
 av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
 {
+#if HAVE_X86ASM
 #if CONFIG_GPL
     int cpu_flags = av_get_cpu_flags();
     int i;
@@ -85,4 +86,5 @@ av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
             }
     }
 #endif /* CONFIG_GPL */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index ddc91f791a..b5c55bd875 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w);
 
 void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_xop;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_stereo3d_init.c b/libavfilter/x86/vf_stereo3d_init.c
index da160a89a0..abd682ee80 100644
--- a/libavfilter/x86/vf_stereo3d_init.c
+++ b/libavfilter/x86/vf_stereo3d_init.c
@@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc,
 
 void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags)) {
         dsp->anaglyph = ff_anaglyph_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_threshold_init.c b/libavfilter/x86/vf_threshold_init.c
index 8e42296791..151a94f429 100644
--- a/libavfilter/x86/vf_threshold_init.c
+++ b/libavfilter/x86/vf_threshold_init.c
@@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2)
 
 av_cold void ff_threshold_init_x86(ThresholdContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->depth == 8) {
@@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s)
             s->threshold = ff_threshold16_avx2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c
index 1c25a2bb7a..c30a3247a2 100644
--- a/libavfilter/x86/vf_tinterlace_init.c
+++ b/libavfilter/x86/vf_tinterlace_init.c
@@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize,
 
 av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->csp->comp[0].depth > 8) {
@@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_transpose_init.c b/libavfilter/x86/vf_transpose_init.c
index 95c56eab73..7db2e66258 100644
--- a/libavfilter/x86/vf_transpose_init.c
+++ b/libavfilter/x86/vf_transpose_init.c
@@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src,
 
 av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) {
@@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) {
         v->transpose_8x8 = ff_transpose_8x8_16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c
index 2b2b06dd40..6b1b3811aa 100644
--- a/libavfilter/x86/vf_v360_init.c
+++ b/libavfilter/x86/vf_v360_init.c
@@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int width, const uint8_t *src, ptrd
 
 av_cold void ff_v360_init_x86(V360Context *s, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth <= 8)
@@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth)
                                           s->interp == MITCHELL) && depth <= 8)
         s->remap_line = ff_remap4_8bit_line_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 6d677d651d..d023ef7a49 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const int32_t *work_pixel,
 
 av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c
index 257c3f9199..54917fa104 100644
--- a/libavfilter/x86/vf_yadif_init.c
+++ b/libavfilter/x86/vf_yadif_init.c
@@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
 
 av_cold void ff_yadif_init_x86(YADIFContext *yadif)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8
                                   : yadif->csp->comp[0].depth;
@@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
         if (EXTERNAL_SSSE3(cpu_flags))
             yadif->filter_line = ff_yadif_filter_line_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c
index d3f4b2e325..eb84027dbf 100644
--- a/libavutil/x86/fixed_dsp_init.c
+++ b/libavutil/x86/fixed_dsp_init.c
@@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int
 
 av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         fdsp->butterflies_fixed = ff_butterflies_fixed_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c
index ad6b506259..7495c0b9a8 100644
--- a/libavutil/x86/float_dsp_init.c
+++ b/libavutil/x86/float_dsp_init.c
@@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1,
 
 av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3;
         fdsp->scalarproduct_float = ff_scalarproduct_float_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c
index 91a16cf594..feac5d6fc7 100644
--- a/libavutil/x86/imgutils_init.c
+++ b/libavutil/x86/imgutils_init.c
@@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
                                     const uint8_t *src, ptrdiff_t src_linesize,
                                     ptrdiff_t bytewidth, int height)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64);
 
@@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
         ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src, src_linesize,
                                          bw_aligned, height);
     else
+#endif /* HAVE_X86ASM */
         return AVERROR(ENOSYS);
 
     return 0;
diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c
index c786376915..67470185da 100644
--- a/libavutil/x86/lls_init.c
+++ b/libavutil/x86/lls_init.c
@@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double *var, int order);
 
 av_cold void ff_init_lls_x86(LLSModel *m)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE2(cpu_flags)) {
         m->update_lls = ff_update_lls_sse2;
@@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m)
     if (EXTERNAL_FMA3_FAST(cpu_flags)) {
         m->update_lls = ff_update_lls_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c
index c3c0662414..a2f842041d 100644
--- a/libavutil/x86/pixelutils_init.c
+++ b/libavutil/x86/pixelutils_init.c
@@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t *src1, ptrdiff_t stride1,
 
 void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     // The best way to use SSE2 would be to do 2 SADs in parallel,
@@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
         case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1   aligned, src2   aligned
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c
index f6d36f9ca6..d9eb43e1d5 100644
--- a/libswresample/x86/audio_convert_init.c
+++ b/libswresample/x86/audio_convert_init.c
@@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
             ac->simd_f =  ff_int32_to_int16_a_ ## cap;\
     }
 
+#if HAVE_X86ASM
 MULTI_CAPS_FUNC(SSE2, sse2)
 
     if(EXTERNAL_SSE(mm_flags)) {
@@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2)
         if(   out_fmt == AV_SAMPLE_FMT_S32  && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP)
             ac->simd_f =  ff_float_to_int32_a_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/resample_init.c b/libswresample/x86/resample_init.c
index d13ccd4833..4eebf5d6f9 100644
--- a/libswresample/x86/resample_init.c
+++ b/libswresample/x86/resample_init.c
@@ -51,6 +51,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
 
     switch(c->format){
     case AV_SAMPLE_FMT_S16P:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_int16_sse2;
             c->dsp.resample_common = ff_resample_common_int16_sse2;
@@ -59,8 +60,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_int16_xop;
             c->dsp.resample_common = ff_resample_common_int16_xop;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_FLTP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_float_sse;
             c->dsp.resample_common = ff_resample_common_float_sse;
@@ -77,8 +80,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_float_fma4;
             c->dsp.resample_common = ff_resample_common_float_fma4;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_DBLP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_double_sse2;
             c->dsp.resample_common = ff_resample_common_double_sse2;
@@ -91,6 +96,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_double_fma3;
             c->dsp.resample_common = ff_resample_common_double_fma3;
         }
+#endif /* HAVE_X86ASM */
         break;
     }
 }
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index b325e5dbd5..e39f327bf2 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void)
         rgb2rgb_init_avx();
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext;
     }
@@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void)
         uyvytoyuv422 = ff_uyvytoyuv422_avx;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..0a14262916 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -529,6 +529,7 @@ switch(c->dstBpc){ \
              else                ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
              break; \
     }
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
         ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
@@ -805,4 +806,5 @@ switch(c->dstBpc){ \
     }
 
 #endif
+#endif /* HAVE_X86ASM */
 }
-- 
2.37.1.windows.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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2022-11-01 22:28   ` Andreas Rheinhardt
  2022-11-03 12:55     ` L. E. Segovia
  2022-11-03 21:59   ` Carl Eugen Hoyos
  1 sibling, 1 reply; 54+ messages in thread
From: Andreas Rheinhardt @ 2022-11-01 22:28 UTC (permalink / raw)
  To: ffmpeg-devel

L. E. Segovia:
> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
> 
> Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
> 
> Signed-off-by: L. E. Segovia <amy@amyspark.me>
> ---
>  libavcodec/x86/dcadsp_init.c         |   2 +
>  libavcodec/x86/fdctdsp_init.c        |   2 +
>  libavcodec/x86/flacdsp_init.c        |   8 +-
>  libavcodec/x86/hevcdsp_init.c        | 463 ++++++++++++++-------------
>  libavcodec/x86/idctdsp_init.c        |   9 +-
>  libavcodec/x86/mlpdsp_init.c         |   6 +-
>  libavcodec/x86/vc1dsp_init.c         |   6 +-
>  libavfilter/x86/colorspacedsp_init.c |   4 +-
>  libavfilter/x86/vf_atadenoise_init.c |   6 +-
>  libavfilter/x86/vf_ssim_init.c       |   6 +-
>  libavfilter/x86/vf_w3fdif_init.c     |   4 +-
>  11 files changed, 272 insertions(+), 244 deletions(-)
> 
> diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
> index 0c78dd1c9e..3c125f33fd 100644
> --- a/libavcodec/x86/dcadsp_init.c
> +++ b/libavcodec/x86/dcadsp_init.c
> @@ -36,6 +36,7 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
>  {
>      int cpu_flags = av_get_cpu_flags();
>  
> +#if ARCH_X86_32

This check is obviously wrong. You are disabling these functions for x64.

>      if (EXTERNAL_SSE2(cpu_flags))
>          s->lfe_fir_float[0] = ff_lfe_fir0_float_sse2;
>      if (EXTERNAL_SSE3(cpu_flags))
> @@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
>      }
>      if (EXTERNAL_FMA3(cpu_flags))
>          s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
> +#endif
>  }
> diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
> index 92a842433d..4a874a640d 100644
> --- a/libavcodec/x86/fdctdsp_init.c
> +++ b/libavcodec/x86/fdctdsp_init.c
> @@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
>  
>      if (!high_bit_depth) {
>          if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
> +#if HAVE_INLINE_SSE2
>              if (INLINE_SSE2(cpu_flags))
>                  c->fdct = ff_fdct_sse2;
> +#endif
>          }
>      }
>  }
> diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
> index 87daed7005..49e67ee2b0 100644
> --- a/libavcodec/x86/flacdsp_init.c
> +++ b/libavcodec/x86/flacdsp_init.c
> @@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
>      }
>      if (EXTERNAL_AVX(cpu_flags)) {
>          if (fmt == AV_SAMPLE_FMT_S16) {
> -            if (ARCH_X86_64 && channels == 8)
> +#if ARCH_X86_64
> +            if (channels == 8)
>                  c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
> +#endif
>          } else if (fmt == AV_SAMPLE_FMT_S32) {
>              if (channels == 4)
>                  c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
>              else if (channels == 6)
>                  c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
> -            else if (ARCH_X86_64 && channels == 8)
> +#if ARCH_X86_64
> +            else if (channels == 8)
>                  c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
> +#endif

Why does the last function need ARCH_X86_64? And why only the last?

>          }
>      }
>      if (EXTERNAL_XOP(cpu_flags)) {
> diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
> index 6f45e5e0db..c7060085a2 100644
> --- a/libavcodec/x86/hevcdsp_init.c
> +++ b/libavcodec/x86/hevcdsp_init.c
> @@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>          if (EXTERNAL_SSE2(cpu_flags)) {
>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
> -            if (ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
>  
> -                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
> -                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
> -            }
> +            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
> +            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
> +#endif
>              SAO_BAND_INIT(8, sse2);
>  
>              c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
> @@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>              c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
>          }
>          if (EXTERNAL_SSSE3(cpu_flags)) {
> -            if(ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
> -            }
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
> +#endif
>              SAO_EDGE_INIT(8, ssse3);
>          }
> -        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
> -
> +#if ARCH_X86_64
> +        if (EXTERNAL_SSE4(cpu_flags)) {
>              EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
>              EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
>              EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
> @@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>              QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
>              QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
>          }
> +#endif
>          if (EXTERNAL_AVX(cpu_flags)) {
>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
> -            if (ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
>  
> -                c->idct[2] = ff_hevc_idct_16x16_8_avx;
> -                c->idct[3] = ff_hevc_idct_32x32_8_avx;
> -            }
> +            c->idct[2] = ff_hevc_idct_16x16_8_avx;
> +            c->idct[3] = ff_hevc_idct_32x32_8_avx;
> +#endif
>              SAO_BAND_INIT(8, avx);
>  
>              c->idct[0] = ff_hevc_idct_4x4_8_avx;
> @@ -775,91 +776,91 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>          if (EXTERNAL_AVX2_FAST(cpu_flags)) {
>              c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
>              c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
> -            if (ARCH_X86_64) {
> -                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
> -                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
> -                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
> +#if ARCH_X86_64
> +            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
> +            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
> +            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
>  
> -                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
> -                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
> -                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
> +            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
> +            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
> +            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
>  
> -                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> -                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> -                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
> +            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> +            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> +            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>  
> -                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> -                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> -                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
> +            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> +            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> +            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>  
> -                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
> -                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
> -                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
> +            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
> +            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
> +            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
>  
> -                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
> -                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
> -                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
> +            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
> +            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
> +            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
>  
> -                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
> -                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
> -                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
> +            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
> +            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
> +            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
>  
> -                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
> -                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
> -                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
> +            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
> +            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
> +            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
>  
> -                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
> -                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
> -                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
> +            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
> +            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
> +            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
>  
> -                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
> -                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
> -                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
> +            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
> +            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
> +            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
>  
> -                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
> -                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
> -                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
> +            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
> +            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
> +            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
>  
> -                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
> -                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
> -                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
> +            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
> +            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
> +            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
>  
> -                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
> -                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
> -                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
> +            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
> +            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
> +            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
>  
> -                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
> -                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
> -                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
> +            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
> +            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
> +            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
>  
> -                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
> -                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
> -                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
> +            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
> +            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
> +            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
>  
> -                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
> -                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
> -                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
> +            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
> +            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
> +            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
>  
> -                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
> -                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
> -                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
> +            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
> +            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
> +            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
>  
> -                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
> -                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
> -                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
> +            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
> +            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
> +            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
>  
> -                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
> -                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
> -                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
> +            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
> +            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
> +            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
>  
> -                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
> -                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
> -                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
> +            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
> +            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
> +            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
>  
> -                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
> -                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
> -                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
> -            }
> +            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
> +            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
> +            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
> +#endif

The reindentation should be performed in a separate commit in cases like
these.

>              SAO_BAND_INIT(8, avx2);
>  
>              c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
> @@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>          if (EXTERNAL_SSE2(cpu_flags)) {
>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
> -            if (ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
>  
> -                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
> -                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
> -            }
> +            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
> +            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
> +#endif
>              SAO_BAND_INIT(10, sse2);
>              SAO_EDGE_INIT(10, sse2);
>  
> @@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>              c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
>              c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
>          }
> -        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
> +#if ARCH_X86_64
> +        if (EXTERNAL_SSSE3(cpu_flags)) {
>              c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
>              c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
>          }
> -        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
> +        if (EXTERNAL_SSE4(cpu_flags)) {
>              EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
>              EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
>              EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
> @@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>              QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
>              QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
>          }
> +#endif
>          if (EXTERNAL_AVX(cpu_flags)) {
>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
> -            if (ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
>  
> -                c->idct[2] = ff_hevc_idct_16x16_10_avx;
> -                c->idct[3] = ff_hevc_idct_32x32_10_avx;
> -            }
> +            c->idct[2] = ff_hevc_idct_16x16_10_avx;
> +            c->idct[3] = ff_hevc_idct_32x32_10_avx;
> +#endif
>  
>              c->idct[0] = ff_hevc_idct_4x4_10_avx;
>              c->idct[1] = ff_hevc_idct_8x8_10_avx;
> @@ -942,150 +945,150 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>          if (EXTERNAL_AVX2_FAST(cpu_flags)) {
>              c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
>              c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
> -            if (ARCH_X86_64) {
> -                c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
> -                c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
> -                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
> -                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
> -                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
> +#if ARCH_X86_64
> +            c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
> +            c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
> +            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
> +            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
> +            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
>  
> -                c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
> -                c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
> -                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
> -                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
> -                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
> +            c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
> +            c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
> +            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
> +            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
> +            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
>  
> -                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> -                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> -                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
> -                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
> -                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
> +            c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> +            c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> +            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
> +            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
> +            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
>  
> -                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> -                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> -                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
> -                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
> -                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
> +            c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
> +            c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
> +            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
> +            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
> +            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
>  
> -                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
> -                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
> -                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
> -                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
> -                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
> -                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
> -                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
> -                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
> -                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
> -                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
> +            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
> +            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
> +            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
> +            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
> +            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
> +            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
> +            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
> +            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
> +            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
> +            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
>  
> -                c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
> -                c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
> -                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
> -                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
> -                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
> +            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
> +            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
> +            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
> +            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
> +            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
>  
> -                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
> -                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
> -                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
> -                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
> -                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
> +            c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
> +            c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
> +            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
> +            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
> +            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
>  
> -                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
> -                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
> -                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
> -                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
> -                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
> +            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
> +            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
> +            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
> +            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
> +            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
>  
> -                c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
> -                c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
> -                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
> -                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
> -                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
> +            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
> +            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
> +            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
> +            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
> +            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
>  
> -                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
> -                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
> -                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
> -                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
> -                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
> +            c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
> +            c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
> +            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
> +            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
> +            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
>  
> -                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
> -                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
> -                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
> -                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
> -                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
> +            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
> +            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
> +            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
> +            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
> +            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
>  
> -                c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
> -                c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
> -                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
> -                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
> -                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
> +            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
> +            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
> +            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
> +            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
> +            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
>  
> -                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
> -                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
> -                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
> -                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
> -                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
> +            c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
> +            c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
> +            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
> +            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
> +            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
>  
> -                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
> -                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
> -                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
> -                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
> -                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
> +            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
> +            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
> +            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
> +            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
> +            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
>  
> -                c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
> -                c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
> -                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
> -                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
> -                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
> +            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
> +            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
> +            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
> +            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
> +            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
>  
> -                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
> -                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
> -                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
> -                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
> -                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
> +            c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
> +            c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
> +            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
> +            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
> +            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
>  
> -                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
> -                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
> -                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
> -                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
> -                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
> +            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
> +            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
> +            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
> +            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
> +            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
>  
> -                c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
> -                c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
> -                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
> -                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
> -                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
> +            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
> +            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
> +            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
> +            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
> +            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
>  
> -                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
> -                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
> -                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
> -                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
> -                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
> +            c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
> +            c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
> +            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
> +            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
> +            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
>  
> -                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
> -                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
> -                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
> -                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
> -                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
> +            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
> +            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
> +            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
> +            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
> +            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
>  
> -                c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
> -                c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
> -                c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
> -                c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
> -                c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
> +            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
> +            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
> +            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
> +            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
> +            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
>  
> -                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
> -                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
> -                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
> -                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
> -                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
> +            c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
> +            c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
> +            c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
> +            c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
> +            c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
>  
> -                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
> -                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
> -                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
> -                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
> -                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
> -            }
> +            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
> +            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
> +            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
> +            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
> +            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
> +#endif
>              SAO_BAND_INIT(10, avx2);
>              SAO_EDGE_INIT(10, avx2);
>  
> @@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>          if (EXTERNAL_SSE2(cpu_flags)) {
>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
> -            if (ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
> -            }
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
> +#endif
>              SAO_BAND_INIT(12, sse2);
>              SAO_EDGE_INIT(12, sse2);
>  
> @@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>              c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
>              c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
>          }
> -        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
> +#if ARCH_X86_64
> +        if (EXTERNAL_SSSE3(cpu_flags)) {
>              c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
>              c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
>          }
> -        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
> +        if (EXTERNAL_SSE4(cpu_flags)) {
>              EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
>              EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
>              EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
> @@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>              QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
>              QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
>          }
> +#endif
>          if (EXTERNAL_AVX(cpu_flags)) {
>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
> -            if (ARCH_X86_64) {
> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
> -            }
> +#if ARCH_X86_64
> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
> +#endif
>              SAO_BAND_INIT(12, avx);
>          }
>          if (EXTERNAL_AVX2(cpu_flags)) {
> diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
> index f28a1ad744..4ade52a880 100644
> --- a/libavcodec/x86/idctdsp_init.c
> +++ b/libavcodec/x86/idctdsp_init.c
> @@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
>          }
>  #endif
>  
> -        if (ARCH_X86_64 &&
> -            !high_bit_depth &&
> +#if ARCH_X86_64
> +        if (!high_bit_depth &&
>              avctx->lowres == 0 &&
>              (avctx->idct_algo == FF_IDCT_AUTO ||
>                  avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
> @@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
>                  c->idct_add  = ff_simple_idct8_add_sse2;
>                  c->perm_type = FF_IDCT_PERM_TRANSPOSE;
>          }
> +#endif
>      }
>  
> -    if (ARCH_X86_64 && avctx->lowres == 0) {
> +#if ARCH_X86_64
> +    if (avctx->lowres == 0) {
>          if (EXTERNAL_AVX(cpu_flags) &&
>              !high_bit_depth &&
>              (avctx->idct_algo == FF_IDCT_AUTO ||
> @@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
>              }
>          }
>      }
> +#endif
>  }
> diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
> index 950f996832..333a685f47 100644
> --- a/libavcodec/x86/mlpdsp_init.c
> +++ b/libavcodec/x86/mlpdsp_init.c
> @@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
>      if (INLINE_MMX(cpu_flags))
>          c->mlp_filter_channel = mlp_filter_channel_x86;
>  #endif
> -    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
> +#if ARCH_X86_64
> +    if (EXTERNAL_SSE4(cpu_flags))
>          c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
> -    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
> +    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
>          c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
> +#endif
>  }
> diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
> index 90b2f3624e..bc63933e83 100644
> --- a/libavcodec/x86/vc1dsp_init.c
> +++ b/libavcodec/x86/vc1dsp_init.c
> @@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
>  {
>      int cpu_flags = av_get_cpu_flags();
>  
> -    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
> +#if HAVE_6REGS
> +    if (INLINE_MMX(cpu_flags))
>          if (EXTERNAL_MMX(cpu_flags))
>          ff_vc1dsp_init_mmx(dsp);
>  
> -    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
> +    if (INLINE_MMXEXT(cpu_flags))
>          if (EXTERNAL_MMXEXT(cpu_flags))
>          ff_vc1dsp_init_mmxext(dsp);
> +#endif
>  
>  #define ASSIGN_LF4(EXT) \
>          dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
> diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
> index b5006ac295..f01db4baf4 100644
> --- a/libavfilter/x86/colorspacedsp_init.c
> +++ b/libavfilter/x86/colorspacedsp_init.c
> @@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
>  {
>      int cpu_flags = av_get_cpu_flags();
>  
> -    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
> +#if ARCH_X86_64
> +    if (EXTERNAL_SSE2(cpu_flags)) {
>  #define assign_yuv2yuv_fns(ss) \
>          dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \
>          dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \
> @@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
>  
>          dsp->multiply3x3 = ff_multiply3x3_sse2;
>      }
> +#endif
>  }
> diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
> index e7a653f191..eb621e172c 100644
> --- a/libavfilter/x86/vf_atadenoise_init.c
> +++ b/libavfilter/x86/vf_atadenoise_init.c
> @@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
>      int cpu_flags = av_get_cpu_flags();
>  
>      for (int p = 0; p < 4; p++) {
> -        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
> +#if ARCH_X86_64 
> +        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
>              dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
>          }
>  
> -        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
> +        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
>              dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
>          }
> +#endif
>      }
>  }
> diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
> index cbaa20ef16..ddc91f791a 100644
> --- a/libavfilter/x86/vf_ssim_init.c
> +++ b/libavfilter/x86/vf_ssim_init.c
> @@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
>  {
>      int cpu_flags = av_get_cpu_flags();
>  
> -    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
> -        dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
> +#if ARCH_X86_64
> +    if (EXTERNAL_SSSE3(cpu_flags))
> +      dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;

We indent by four spaces. And there is actually no reason to touch this
line at all.

> +#endif
>      if (EXTERNAL_SSE4(cpu_flags))
>          dsp->ssim_end_line = ff_ssim_end_line_sse4;
>      if (EXTERNAL_XOP(cpu_flags))
> diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
> index 16202fba76..6d677d651d 100644
> --- a/libavfilter/x86/vf_w3fdif_init.c
> +++ b/libavfilter/x86/vf_w3fdif_init.c
> @@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
>          dsp->filter_scale        = ff_w3fdif_scale_sse2;
>      }
>  
> -    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
> +#if ARCH_X86_64
> +    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
>          dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
>      }
> +#endif
>  }

_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
@ 2022-11-02  0:26   ` Andreas Rheinhardt
  0 siblings, 0 replies; 54+ messages in thread
From: Andreas Rheinhardt @ 2022-11-02  0:26 UTC (permalink / raw)
  To: ffmpeg-devel

L. E. Segovia:
> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
> 
> Signed-off-by: L. E. Segovia <amy@amyspark.me>
> ---
>  libavcodec/x86/aacencdsp_init.c            | 2 ++
>  libavcodec/x86/aacpsdsp_init.c             | 2 ++
>  libavcodec/x86/ac3dsp_init.c               | 4 ++++
>  libavcodec/x86/audiodsp_init.c             | 2 ++
>  libavcodec/x86/bswapdsp_init.c             | 2 ++
>  libavcodec/x86/cavsdsp.c                   | 2 ++
>  libavcodec/x86/celt_pvq_init.c             | 2 ++
>  libavcodec/x86/cfhddsp_init.c              | 2 ++
>  libavcodec/x86/cfhdencdsp_init.c           | 2 ++
>  libavcodec/x86/dcadsp_init.c               | 2 ++
>  libavcodec/x86/dct_init.c                  | 2 ++
>  libavcodec/x86/dnxhdenc_init.c             | 2 ++
>  libavcodec/x86/exrdsp_init.c               | 2 ++
>  libavcodec/x86/fft_init.c                  | 2 ++
>  libavcodec/x86/g722dsp_init.c              | 2 ++
>  libavcodec/x86/h263dsp_init.c              | 2 ++
>  libavcodec/x86/h264_intrapred_init.c       | 2 ++
>  libavcodec/x86/h264chroma_init.c           | 2 ++
>  libavcodec/x86/hevcdsp_init.c              | 2 ++
>  libavcodec/x86/hpeldsp_init.c              | 2 ++
>  libavcodec/x86/hpeldsp_vp3_init.c          | 2 ++
>  libavcodec/x86/huffyuvdsp_init.c           | 2 ++
>  libavcodec/x86/huffyuvencdsp_init.c        | 2 ++
>  libavcodec/x86/idctdsp_init.c              | 2 ++
>  libavcodec/x86/jpeg2000dsp_init.c          | 2 ++
>  libavcodec/x86/lossless_videodsp_init.c    | 2 ++
>  libavcodec/x86/lossless_videoencdsp_init.c | 2 ++
>  libavcodec/x86/mdct15_init.c               | 2 ++
>  libavcodec/x86/me_cmp_init.c               | 2 ++
>  libavcodec/x86/mlpdsp_init.c               | 2 ++
>  libavcodec/x86/mpegvideoencdsp_init.c      | 2 ++
>  libavcodec/x86/opusdsp_init.c              | 2 ++
>  libavcodec/x86/pixblockdsp_init.c          | 2 ++
>  libavcodec/x86/pngdsp_init.c               | 2 ++
>  libavcodec/x86/proresdsp_init.c            | 2 ++
>  libavcodec/x86/rv34dsp_init.c              | 2 ++
>  libavcodec/x86/sbcdsp_init.c               | 2 ++
>  libavcodec/x86/sbrdsp_init.c               | 2 ++
>  libavcodec/x86/svq1enc_init.c              | 2 ++
>  libavcodec/x86/utvideodsp_init.c           | 2 ++
>  libavcodec/x86/v210enc_init.c              | 2 ++
>  libavcodec/x86/vorbisdsp_init.c            | 2 ++
>  libavcodec/x86/vp3dsp_init.c               | 2 ++
>  libavcodec/x86/vp6dsp_init.c               | 2 ++
>  libavfilter/x86/af_afir_init.c             | 2 ++
>  libavfilter/x86/af_anlmdn_init.c           | 2 ++
>  libavfilter/x86/af_volume_init.c           | 2 ++
>  libavfilter/x86/avf_showcqt_init.c         | 2 ++
>  libavfilter/x86/colorspacedsp_init.c       | 2 ++
>  libavfilter/x86/vf_atadenoise_init.c       | 2 ++
>  libavfilter/x86/vf_blend_init.c            | 2 ++
>  libavfilter/x86/vf_bwdif_init.c            | 2 ++
>  libavfilter/x86/vf_convolution_init.c      | 2 ++
>  libavfilter/x86/vf_framerate_init.c        | 2 ++
>  libavfilter/x86/vf_fspp_init.c             | 2 ++
>  libavfilter/x86/vf_gblur_init.c            | 2 ++
>  libavfilter/x86/vf_hflip_init.c            | 2 ++
>  libavfilter/x86/vf_limiter_init.c          | 2 ++
>  libavfilter/x86/vf_maskedclamp_init.c      | 2 ++
>  libavfilter/x86/vf_maskedmerge_init.c      | 2 ++
>  libavfilter/x86/vf_overlay_init.c          | 2 ++
>  libavfilter/x86/vf_pp7_init.c              | 2 ++
>  libavfilter/x86/vf_psnr_init.c             | 2 ++
>  libavfilter/x86/vf_removegrain_init.c      | 2 ++
>  libavfilter/x86/vf_ssim_init.c             | 2 ++
>  libavfilter/x86/vf_stereo3d_init.c         | 2 ++
>  libavfilter/x86/vf_threshold_init.c        | 2 ++
>  libavfilter/x86/vf_tinterlace_init.c       | 2 ++
>  libavfilter/x86/vf_transpose_init.c        | 2 ++
>  libavfilter/x86/vf_v360_init.c             | 2 ++
>  libavfilter/x86/vf_w3fdif_init.c           | 2 ++
>  libavfilter/x86/vf_yadif_init.c            | 2 ++
>  libavutil/x86/fixed_dsp_init.c             | 2 ++
>  libavutil/x86/float_dsp_init.c             | 2 ++
>  libavutil/x86/imgutils_init.c              | 2 ++
>  libavutil/x86/lls_init.c                   | 2 ++
>  libavutil/x86/pixelutils_init.c            | 2 ++
>  libswresample/x86/audio_convert_init.c     | 2 ++
>  libswresample/x86/resample_init.c          | 6 ++++++
>  libswscale/x86/rgb2rgb.c                   | 2 ++
>  libswscale/x86/swscale.c                   | 2 ++
>  81 files changed, 168 insertions(+)
> 


> diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
> index 09c48c341e..d8f4e45849 100644
> --- a/libavcodec/x86/hpeldsp_init.c
> +++ b/libavcodec/x86/hpeldsp_init.c
> @@ -224,6 +224,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
>  {
>      int cpu_flags = av_get_cpu_flags();
>  
> +#if HAVE_X86ASM
>      if (INLINE_MMX(cpu_flags))
>          hpeldsp_init_mmx(c, flags);

Here you are including an INLINE-check inside your #if HAVE_X86ASM.

>  
> @@ -235,6 +236,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
>  
>      if (EXTERNAL_SSSE3(cpu_flags))
>          hpeldsp_init_ssse3(c, flags);
> +#endif
>  
>      if (CONFIG_VP3_DECODER)
>          ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);

> diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c
> index bc1051c27e..527fdff4a9 100644
> --- a/libavcodec/x86/me_cmp_init.c
> +++ b/libavcodec/x86/me_cmp_init.c
> @@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
>  
>  #endif /* HAVE_INLINE_ASM */
>  
> +#if HAVE_X86ASM
>      if (EXTERNAL_MMX(cpu_flags)) {
>          c->sse[1]            = ff_sse8_mmx;
>  #if HAVE_X86ASM

You can remove this.

> @@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
>          c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
>  #endif
>      }
> +#endif /* HAVE_X86ASM */
>  }
> diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
> index 333a685f47..f7eca8cb76 100644
> --- a/libavcodec/x86/mlpdsp_init.c
> +++ b/libavcodec/x86/mlpdsp_init.c
> @@ -200,10 +200,12 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
>      if (INLINE_MMX(cpu_flags))
>          c->mlp_filter_channel = mlp_filter_channel_x86;
>  #endif
> +#if HAVE_X86ASM

You can combine this with the ARCH_X86_64 check.

>  #if ARCH_X86_64
>      if (EXTERNAL_SSE4(cpu_flags))
>          c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
>      if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
>          c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
>  #endif
> +#endif /* HAVE_X86ASM */
>  }
> diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c
> index b78a47d02b..fc9cd49de7 100644
> --- a/libavfilter/x86/vf_convolution_init.c
> +++ b/libavfilter/x86/vf_convolution_init.c
> @@ -31,6 +31,7 @@ void ff_filter_3x3_sse4(uint8_t *dst, int width,
>  
>  av_cold void ff_convolution_init_x86(ConvolutionContext *s)
>  {
> +#if HAVE_X86ASM
>  #if ARCH_X86_64

You can combine the two checks.

>      int i;
>      int cpu_flags = av_get_cpu_flags();
> @@ -43,4 +44,5 @@ av_cold void ff_convolution_init_x86(ConvolutionContext *s)
>          }
>      }
>  #endif
> +#endif /* HAVE_X86ASM */
>  }

_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
@ 2022-11-02  0:38   ` Andreas Rheinhardt
  0 siblings, 0 replies; 54+ messages in thread
From: Andreas Rheinhardt @ 2022-11-02  0:38 UTC (permalink / raw)
  To: ffmpeg-devel

L. E. Segovia:
> Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f
> 
> Signed-off-by: L. E. Segovia <amy@amyspark.me>
> ---
>  fftools/ffprobe.c       | 22 ++++++++++++++++++----
>  fftools/opt_common.c    | 18 +++++++++++++++++-
>  libavformat/rtmpproto.c | 24 ++++++++++++++++++------
>  3 files changed, 53 insertions(+), 11 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index 9b7e82fd8c..c16c68ee92 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -3519,8 +3519,7 @@ static void ffprobe_show_program_version(WriterContext *w)
>  }
>  
>  #define SHOW_LIB_VERSION(libname, LIBNAME)                              \
> -    do {                                                                \
> -        if (CONFIG_##LIBNAME) {                                         \
> +        {                                                               \
>              unsigned int version = libname##_version();                 \
>              writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
>              print_str("name",    "lib" #libname);                       \
> @@ -3530,20 +3529,35 @@ static void ffprobe_show_program_version(WriterContext *w)
>              print_int("version", version);                              \
>              print_str("ident",   LIB##LIBNAME##_IDENT);                 \
>              writer_print_section_footer(w);                             \
> -        }                                                               \
> -    } while (0)
> +        }
>  
>  static void ffprobe_show_library_versions(WriterContext *w)
>  {
>      writer_print_section_header(w, SECTION_ID_LIBRARY_VERSIONS);
> +#if CONFIG_AVUTIL
>      SHOW_LIB_VERSION(avutil,     AVUTIL);
> +#endif
> +#if CONFIG_AVCODEC
>      SHOW_LIB_VERSION(avcodec,    AVCODEC);
> +#endif
> +#if CONFIG_AVFORMAT
>      SHOW_LIB_VERSION(avformat,   AVFORMAT);
> +#endif
> +#if CONFIG_AVDEVICE
>      SHOW_LIB_VERSION(avdevice,   AVDEVICE);
> +#endif
> +#if CONFIG_AVFILTER
>      SHOW_LIB_VERSION(avfilter,   AVFILTER);
> +#endif
> +#if CONFIG_SWSCALE
>      SHOW_LIB_VERSION(swscale,    SWSCALE);
> +#endif
> +#if CONFIG_SWRESAMPLE
>      SHOW_LIB_VERSION(swresample, SWRESAMPLE);
> +#endif
> +#if CONFIG_POSTPROC
>      SHOW_LIB_VERSION(postproc,   POSTPROC);
> +#endif

1. Several of these checks are unnecessary, as ffprobe has hard
dependencies on avcodec and avformat (and therefore also on avutil).
2. Anyway, a better approach would be to modify the macro along the
lines of PCM_DECODER in libavcodec/pcm.c, so that
SHOW_LIB_VERSION(postproc, POSTPROC) expands to
SHOW_LIB_VERSION_1(postproc, POSTPROC) if CONFIG_POSTPROC is 1 and
SHOW_LIB_VERSION_0(postproc, POSTPROC) if CONFIG_POSTPROC is 0 (you may
presume CONFIG_POSTPROC to be defined and to be either 0 or 1).
SHOW_LIB_VERSION_1 would expand to what the current SHOW_LIB_VERSION
expands to (minus the "if (CONFIG_ ##LIBNAME)" check) and
SHOW_LIB_VERSION_0 would expand to nothing/a null statement or so.

The same approach could be used below.

>      writer_print_section_footer(w);
>  }
>  
> diff --git a/fftools/opt_common.c b/fftools/opt_common.c
> index 8a06df82df..243eb4e3a1 100644
> --- a/fftools/opt_common.c
> +++ b/fftools/opt_common.c
> @@ -154,7 +154,7 @@ static int warned_cfg = 0;
>  #define SHOW_COPYRIGHT 8
>  
>  #define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
> -    if (CONFIG_##LIBNAME) {                                             \
> +    {                                                                   \
>          const char *indent = flags & INDENT? "  " : "";                 \
>          if (flags & SHOW_VERSION) {                                     \
>              unsigned int version = libname##_version();                 \
> @@ -184,14 +184,30 @@ static int warned_cfg = 0;
>  
>  static void print_all_libs_info(int flags, int level)
>  {
> +#if CONFIG_AVUTIL
>      PRINT_LIB_INFO(avutil,     AVUTIL,     flags, level);
> +#endif
> +#if CONFIG_AVCODEC
>      PRINT_LIB_INFO(avcodec,    AVCODEC,    flags, level);
> +#endif
> +#if CONFIG_AVFORMAT
>      PRINT_LIB_INFO(avformat,   AVFORMAT,   flags, level);
> +#endif
> +#if CONFIG_AVDEVICE
>      PRINT_LIB_INFO(avdevice,   AVDEVICE,   flags, level);
> +#endif
> +#if CONFIG_AVFILTER
>      PRINT_LIB_INFO(avfilter,   AVFILTER,   flags, level);
> +#endif
> +#if CONFIG_SWSCALE
>      PRINT_LIB_INFO(swscale,    SWSCALE,    flags, level);
> +#endif
> +#if CONFIG_SWRESAMPLE
>      PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level);
> +#endif
> +#if CONFIG_POSTPROC
>      PRINT_LIB_INFO(postproc,   POSTPROC,   flags, level);
> +#endif
>  }
>  
>  static void print_program_info(int flags, int level)
> diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
> index f0ef223f05..6d84fcf34f 100644
> --- a/libavformat/rtmpproto.c
> +++ b/libavformat/rtmpproto.c
> @@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
>      for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
>          tosend[i] = av_lfg_get(&rnd) >> 24;
>  
> -    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
> +#if CONFIG_FFRTMPCRYPT_PROTOCOL
> +    if (rt->encrypted) {
>          /* When the client wants to use RTMPE, we have to change the command
>           * byte to 0x06 which means to use encrypted data and we have to set
>           * the flash version to at least 9.0.115.0. */
> @@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
>          if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
>              return ret;
>      }
> +#endif
>  
>      client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
>      if (client_pos < 0)
> @@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
>          if (ret < 0)
>              return ret;
>  
> -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
> +#if CONFIG_FFRTMPCRYPT_PROTOCOL
> +        if (rt->encrypted) {
>              /* Compute the shared secret key sent by the server and initialize
>               * the RC4 encryption. */
>              if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
> @@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
>              /* Encrypt the signature received by the server. */
>              ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]);
>          }
> +#endif
>  
>          if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
>              av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
> @@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
>          if (ret < 0)
>              return ret;
>  
> -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
> +#if CONFIG_FFRTMPCRYPT_PROTOCOL
> +        if (rt->encrypted) {
>              /* Encrypt the signature to be send to the server. */
>              ff_rtmpe_encrypt_sig(rt->stream, tosend +
>                                   RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
>                                   serverdata[0]);
>          }
> +#endif
>  
>          // write reply back to the server
>          if ((ret = ffurl_write(rt->stream, tosend,
>                                 RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
>              return ret;
>  
> -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
> +#if CONFIG_FFRTMPCRYPT_PROTOCOL
> +        if (rt->encrypted) {
>              /* Set RC4 keys for encryption and update the keystreams. */
>              if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
>                  return ret;
>          }
> +#endif
>      } else {
> -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
> +#if CONFIG_FFRTMPCRYPT_PROTOCOL
> +        if (rt->encrypted) {
>              /* Compute the shared secret key sent by the server and initialize
>               * the RC4 encryption. */
>              if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
> @@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
>                                       serverdata[0]);
>              }
>          }
> +#endif
>  
>          if ((ret = ffurl_write(rt->stream, serverdata + 1,
>                                 RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
>              return ret;
>  
> -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
> +#if CONFIG_FFRTMPCRYPT_PROTOCOL
> +        if (rt->encrypted) {
>              /* Set RC4 keys for encryption and update the keystreams. */
>              if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
>                  return ret;
>          }
> +#endif
>      }
>  
>      return 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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
@ 2022-11-02  0:42   ` Andreas Rheinhardt
  0 siblings, 0 replies; 54+ messages in thread
From: Andreas Rheinhardt @ 2022-11-02  0:42 UTC (permalink / raw)
  To: ffmpeg-devel

L. E. Segovia:
> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
> 
> Signed-off-by: L. E. Segovia <amy@amyspark.me>
> ---
>  libavcodec/x86/vc1dsp_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
> index bc63933e83..65fc28ea35 100644
> --- a/libavcodec/x86/vc1dsp_init.c
> +++ b/libavcodec/x86/vc1dsp_init.c
> @@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
>  {
>      int cpu_flags = av_get_cpu_flags();
>  
> -#if HAVE_6REGS
> +#if HAVE_6REGS && HAVE_INLINE_ASM
>      if (INLINE_MMX(cpu_flags))
>          if (EXTERNAL_MMX(cpu_flags))
>          ff_vc1dsp_init_mmx(dsp);

There is also a check for EXTERNAL_MMX for which you add no #if check
here or in the next commit.

- Andreas

_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (3 preceding siblings ...)
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
@ 2022-11-02  1:08 ` Andreas Rheinhardt
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 0/5] " L. E. Segovia
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: Andreas Rheinhardt @ 2022-11-02  1:08 UTC (permalink / raw)
  To: ffmpeg-devel

L. E. Segovia:
> Hi all,
> 
> This is a patch to fix building FFmpeg without having DCE enabled.
> This was previously attempted by Andreas Rheinhardt in commit 
> 40e6575aa3eed64cd32bf28c00ae57edc5acb25a. However, this is not remotely
> enough for MSVC; one can quickly check for this by configuring the build
> without any optimizations, and then overriding OPTFLAGS with /Od:
> 

You seem to misunderstand the goal of
40e6575aa3eed64cd32bf28c00ae57edc5acb25a: It was not meant for
--disable-optimizations builds; it was instead meant for full LTO builds
(with optimizations enabled), where MSVC wanted to take a look at
arch-specific code that was not available although it was under a "if
(0)". Builds without asm or where components have been disabled (which
can easily lead to linking failures if your compiler does not perform
DCE) are not considered "full" builds in the preceding sentence.

(I actually do not even know whether it has achieved said aim.)

>   ../configure --disable-asm --disable-optimizations --optflags=-Od --enable-shared --disable-static --toolchain=msvc
> 
> Issuing make should yield the first of many LNK2019 errors:
> 
>   LD      libavformat/avformat-59.dll
>     Creating library libavformat/avformat.lib and object libavformat/avformat.exp
>   rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_gen_pub_key referenced in function rtmp_handshake
>   rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_compute_secret_key referenced in function rtmp_handshake
>   rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_encrypt_sig referenced in function rtmp_handshake
>   rtmpproto.o : error LNK2019: unresolved external symbol ff_rtmpe_update_keystream referenced in function rtmp_handshake
>   libavformat\avformat-59.dll : fatal error LNK1120: 4 unresolved externals
>   make: *** [/c/Users/Amalia/Desktop/ffmpeg/ffbuild/library.mak:119: libavformat/avformat-59.dll] Error 96
> 
> The proposed patchset comprehensively converts all instances of ARCH_FOO, 
> CONFIG_FOO, INLINE_FOO and EXTERNAL_FOO to the equivalent preprocessor
> guards.
> 

You are not converting all of them; you seem to only convert those that
caused linker errors in your build (which is fine by me). E.g.
mpegvideo_enc.c is full of CONFIG checks that would lead to linker
errors in case DCE is disabled if some of the components whose existence
is checked are actually disabled.

> L. E. Segovia (4):
>   all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
>   all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
>   all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
>   all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
> 
>  fftools/ffprobe.c                          |  22 +-
>  fftools/opt_common.c                       |  18 +-
>  libavcodec/x86/aacencdsp_init.c            |   2 +
>  libavcodec/x86/aacpsdsp_init.c             |   2 +
>  libavcodec/x86/ac3dsp_init.c               |   4 +
>  libavcodec/x86/audiodsp_init.c             |   2 +
>  libavcodec/x86/bswapdsp_init.c             |   2 +
>  libavcodec/x86/cavsdsp.c                   |   2 +
>  libavcodec/x86/celt_pvq_init.c             |   2 +
>  libavcodec/x86/cfhddsp_init.c              |   2 +
>  libavcodec/x86/cfhdencdsp_init.c           |   2 +
>  libavcodec/x86/dcadsp_init.c               |   4 +
>  libavcodec/x86/dct_init.c                  |   2 +
>  libavcodec/x86/dnxhdenc_init.c             |   2 +
>  libavcodec/x86/exrdsp_init.c               |   2 +
>  libavcodec/x86/fdctdsp_init.c              |   2 +
>  libavcodec/x86/fft_init.c                  |   2 +
>  libavcodec/x86/flacdsp_init.c              |   8 +-
>  libavcodec/x86/g722dsp_init.c              |   2 +
>  libavcodec/x86/h263dsp_init.c              |   2 +
>  libavcodec/x86/h264_intrapred_init.c       |   2 +
>  libavcodec/x86/h264chroma_init.c           |   2 +
>  libavcodec/x86/hevcdsp_init.c              | 465 +++++++++++----------
>  libavcodec/x86/hpeldsp_init.c              |   2 +
>  libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
>  libavcodec/x86/huffyuvdsp_init.c           |   2 +
>  libavcodec/x86/huffyuvencdsp_init.c        |   2 +
>  libavcodec/x86/idctdsp_init.c              |  11 +-
>  libavcodec/x86/jpeg2000dsp_init.c          |   2 +
>  libavcodec/x86/lossless_videodsp_init.c    |   2 +
>  libavcodec/x86/lossless_videoencdsp_init.c |   2 +
>  libavcodec/x86/mdct15_init.c               |   2 +
>  libavcodec/x86/me_cmp_init.c               |   2 +
>  libavcodec/x86/mlpdsp_init.c               |   8 +-
>  libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
>  libavcodec/x86/opusdsp_init.c              |   2 +
>  libavcodec/x86/pixblockdsp_init.c          |   2 +
>  libavcodec/x86/pngdsp_init.c               |   2 +
>  libavcodec/x86/proresdsp_init.c            |   2 +
>  libavcodec/x86/rv34dsp_init.c              |   2 +
>  libavcodec/x86/sbcdsp_init.c               |   2 +
>  libavcodec/x86/sbrdsp_init.c               |   2 +
>  libavcodec/x86/svq1enc_init.c              |   2 +
>  libavcodec/x86/utvideodsp_init.c           |   2 +
>  libavcodec/x86/v210enc_init.c              |   2 +
>  libavcodec/x86/vc1dsp_init.c               |   6 +-
>  libavcodec/x86/vorbisdsp_init.c            |   2 +
>  libavcodec/x86/vp3dsp_init.c               |   2 +
>  libavcodec/x86/vp6dsp_init.c               |   2 +
>  libavfilter/x86/af_afir_init.c             |   2 +
>  libavfilter/x86/af_anlmdn_init.c           |   2 +
>  libavfilter/x86/af_volume_init.c           |   2 +
>  libavfilter/x86/avf_showcqt_init.c         |   2 +
>  libavfilter/x86/colorspacedsp_init.c       |   6 +-
>  libavfilter/x86/vf_atadenoise_init.c       |   8 +-
>  libavfilter/x86/vf_blend_init.c            |   2 +
>  libavfilter/x86/vf_bwdif_init.c            |   2 +
>  libavfilter/x86/vf_convolution_init.c      |   2 +
>  libavfilter/x86/vf_framerate_init.c        |   2 +
>  libavfilter/x86/vf_fspp_init.c             |   2 +
>  libavfilter/x86/vf_gblur_init.c            |   2 +
>  libavfilter/x86/vf_hflip_init.c            |   2 +
>  libavfilter/x86/vf_limiter_init.c          |   2 +
>  libavfilter/x86/vf_maskedclamp_init.c      |   2 +
>  libavfilter/x86/vf_maskedmerge_init.c      |   2 +
>  libavfilter/x86/vf_overlay_init.c          |   2 +
>  libavfilter/x86/vf_pp7_init.c              |   2 +
>  libavfilter/x86/vf_psnr_init.c             |   2 +
>  libavfilter/x86/vf_removegrain_init.c      |   2 +
>  libavfilter/x86/vf_ssim_init.c             |   8 +-
>  libavfilter/x86/vf_stereo3d_init.c         |   2 +
>  libavfilter/x86/vf_threshold_init.c        |   2 +
>  libavfilter/x86/vf_tinterlace_init.c       |   2 +
>  libavfilter/x86/vf_transpose_init.c        |   2 +
>  libavfilter/x86/vf_v360_init.c             |   2 +
>  libavfilter/x86/vf_w3fdif_init.c           |   6 +-
>  libavfilter/x86/vf_yadif_init.c            |   2 +
>  libavformat/rtmpproto.c                    |  24 +-
>  libavutil/x86/fixed_dsp_init.c             |   2 +
>  libavutil/x86/float_dsp_init.c             |   2 +
>  libavutil/x86/imgutils_init.c              |   2 +
>  libavutil/x86/lls_init.c                   |   2 +
>  libavutil/x86/pixelutils_init.c            |   2 +
>  libswresample/x86/audio_convert_init.c     |   2 +
>  libswresample/x86/resample_init.c          |   6 +
>  libswscale/x86/rgb2rgb.c                   |   2 +
>  libswscale/x86/swscale.c                   |   2 +
>  87 files changed, 493 insertions(+), 255 deletions(-)
> 

_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-01 22:28   ` Andreas Rheinhardt
@ 2022-11-03 12:55     ` L. E. Segovia
  2022-11-03 14:19       ` Andreas Rheinhardt
  0 siblings, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 12:55 UTC (permalink / raw)
  To: Andreas Rheinhardt
  Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller, ffmpeg-devel

Hi!

Thanks for the review. The comments will be fixed in the next version of
the patchset. Just a couple remarks:

re dcadsp_init -- this one comes from 4.4.x having a clause there to
support SSE, which also checks for the x86-32 architecture [1]. I've
removed it for the current version.

re flacdsp_init -- ff_flac_decorrelate_indep8_16_avx and
ff_flac_decorrelate_indep8_32_avx are from their inception only
generated for x86-64 [2][3]. This check was missing from the C side,
implying it relied on DCE to pass linking.

[1]:
https://github.com/FFmpeg/FFmpeg/blob/release/4.4/libavcodec/x86/dcadsp_init.c#L40-L41

[2]:
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/x86/flacdsp.asm#L315-L318

[3]:
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/x86/flacdsp.asm#L323-L326

On 01/11/2022 19:28, andreas.rheinhardt at outlook.com (Andreas
Rheinhardt) wrote:
> L. E. Segovia:
>> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
>>
>> Co-authored-by: Nirbheek Chauhan <nirbheek at centricular.com>
>>
>> Signed-off-by: L. E. Segovia <amy at amyspark.me>
>> ---
>>  libavcodec/x86/dcadsp_init.c         |   2 +
>>  libavcodec/x86/fdctdsp_init.c        |   2 +
>>  libavcodec/x86/flacdsp_init.c        |   8 +-
>>  libavcodec/x86/hevcdsp_init.c        | 463 ++++++++++++++-------------
>>  libavcodec/x86/idctdsp_init.c        |   9 +-
>>  libavcodec/x86/mlpdsp_init.c         |   6 +-
>>  libavcodec/x86/vc1dsp_init.c         |   6 +-
>>  libavfilter/x86/colorspacedsp_init.c |   4 +-
>>  libavfilter/x86/vf_atadenoise_init.c |   6 +-
>>  libavfilter/x86/vf_ssim_init.c       |   6 +-
>>  libavfilter/x86/vf_w3fdif_init.c     |   4 +-
>>  11 files changed, 272 insertions(+), 244 deletions(-)
>>
>> diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
>> index 0c78dd1c9e..3c125f33fd 100644
>> --- a/libavcodec/x86/dcadsp_init.c
>> +++ b/libavcodec/x86/dcadsp_init.c
>> @@ -36,6 +36,7 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
>>  {
>>      int cpu_flags = av_get_cpu_flags();
>>  
>> +#if ARCH_X86_32
> 
> This check is obviously wrong. You are disabling these functions for x64.
> 
>>      if (EXTERNAL_SSE2(cpu_flags))
>>          s->lfe_fir_float[0] = ff_lfe_fir0_float_sse2;
>>      if (EXTERNAL_SSE3(cpu_flags))
>> @@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
>>      }
>>      if (EXTERNAL_FMA3(cpu_flags))
>>          s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
>> +#endif
>>  }
>> diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
>> index 92a842433d..4a874a640d 100644
>> --- a/libavcodec/x86/fdctdsp_init.c
>> +++ b/libavcodec/x86/fdctdsp_init.c
>> @@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
>>  
>>      if (!high_bit_depth) {
>>          if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
>> +#if HAVE_INLINE_SSE2
>>              if (INLINE_SSE2(cpu_flags))
>>                  c->fdct = ff_fdct_sse2;
>> +#endif
>>          }
>>      }
>>  }
>> diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
>> index 87daed7005..49e67ee2b0 100644
>> --- a/libavcodec/x86/flacdsp_init.c
>> +++ b/libavcodec/x86/flacdsp_init.c
>> @@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
>>      }
>>      if (EXTERNAL_AVX(cpu_flags)) {
>>          if (fmt == AV_SAMPLE_FMT_S16) {
>> -            if (ARCH_X86_64 && channels == 8)
>> +#if ARCH_X86_64
>> +            if (channels == 8)
>>                  c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
>> +#endif
>>          } else if (fmt == AV_SAMPLE_FMT_S32) {
>>              if (channels == 4)
>>                  c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
>>              else if (channels == 6)
>>                  c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
>> -            else if (ARCH_X86_64 && channels == 8)
>> +#if ARCH_X86_64
>> +            else if (channels == 8)
>>                  c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
>> +#endif
> 
> Why does the last function need ARCH_X86_64? And why only the last?
> 
>>          }
>>      }
>>      if (EXTERNAL_XOP(cpu_flags)) {
>> diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
>> index 6f45e5e0db..c7060085a2 100644
>> --- a/libavcodec/x86/hevcdsp_init.c
>> +++ b/libavcodec/x86/hevcdsp_init.c
>> @@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>          if (EXTERNAL_SSE2(cpu_flags)) {
>>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
>>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
>> -            if (ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
>>  
>> -                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
>> -                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
>> -            }
>> +            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
>> +            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
>> +#endif
>>              SAO_BAND_INIT(8, sse2);
>>  
>>              c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
>> @@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>              c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
>>          }
>>          if (EXTERNAL_SSSE3(cpu_flags)) {
>> -            if(ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
>> -            }
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
>> +#endif
>>              SAO_EDGE_INIT(8, ssse3);
>>          }
>> -        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
>> -
>> +#if ARCH_X86_64
>> +        if (EXTERNAL_SSE4(cpu_flags)) {
>>              EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
>>              EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
>>              EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
>> @@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>              QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
>>              QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
>>          }
>> +#endif
>>          if (EXTERNAL_AVX(cpu_flags)) {
>>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
>>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
>> -            if (ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
>>  
>> -                c->idct[2] = ff_hevc_idct_16x16_8_avx;
>> -                c->idct[3] = ff_hevc_idct_32x32_8_avx;
>> -            }
>> +            c->idct[2] = ff_hevc_idct_16x16_8_avx;
>> +            c->idct[3] = ff_hevc_idct_32x32_8_avx;
>> +#endif
>>              SAO_BAND_INIT(8, avx);
>>  
>>              c->idct[0] = ff_hevc_idct_4x4_8_avx;
>> @@ -775,91 +776,91 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>          if (EXTERNAL_AVX2_FAST(cpu_flags)) {
>>              c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
>>              c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
>> -            if (ARCH_X86_64) {
>> -                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
>> -                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
>> -                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
>> +#if ARCH_X86_64
>> +            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
>> +            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
>> +            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
>>  
>> -                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
>> -                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
>> -                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
>> +            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
>> +            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
>> +            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
>>  
>> -                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> -                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> -                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>> +            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> +            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> +            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>>  
>> -                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> -                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> -                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>> +            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> +            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> +            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>>  
>> -                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
>> -                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
>> -                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
>> +            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
>> +            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
>> +            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
>>  
>> -                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
>> -                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
>> -                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
>> +            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
>> +            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
>> +            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
>>  
>> -                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
>> -                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
>> -                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
>> +            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
>> +            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
>> +            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
>>  
>> -                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
>> -                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
>> -                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
>> +            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
>> +            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
>> +            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
>>  
>> -                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
>> -                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
>> -                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
>> +            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
>> +            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
>> +            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
>>  
>> -                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
>> -                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
>> -                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
>> +            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
>> +            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
>> +            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
>>  
>> -                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
>> -                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
>> -                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
>> +            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
>> +            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
>> +            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
>>  
>> -                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
>> -                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
>> -                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
>> +            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
>> +            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
>> +            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
>>  
>> -                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
>> -                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
>> -                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
>> +            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
>> +            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
>> +            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
>>  
>> -                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
>> -                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
>> -                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
>> +            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
>> +            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
>> +            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
>>  
>> -                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
>> -                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
>> -                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
>> +            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
>> +            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
>> +            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
>>  
>> -                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
>> -                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
>> -                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
>> +            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
>> +            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
>> +            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
>>  
>> -                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
>> -                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
>> -                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
>> +            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
>> +            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
>> +            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
>>  
>> -                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
>> -                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
>> -                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
>> +            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
>> +            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
>> +            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
>>  
>> -                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
>> -                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
>> -                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
>> +            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
>> +            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
>> +            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
>>  
>> -                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
>> -                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
>> -                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
>> +            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
>> +            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
>> +            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
>>  
>> -                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
>> -                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
>> -                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
>> -            }
>> +            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
>> +            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
>> +            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
>> +#endif
> 
> The reindentation should be performed in a separate commit in cases like
> these.
> 
>>              SAO_BAND_INIT(8, avx2);
>>  
>>              c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
>> @@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>          if (EXTERNAL_SSE2(cpu_flags)) {
>>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
>>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
>> -            if (ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
>>  
>> -                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
>> -                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
>> -            }
>> +            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
>> +            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
>> +#endif
>>              SAO_BAND_INIT(10, sse2);
>>              SAO_EDGE_INIT(10, sse2);
>>  
>> @@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>              c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
>>              c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
>>          }
>> -        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
>> +#if ARCH_X86_64
>> +        if (EXTERNAL_SSSE3(cpu_flags)) {
>>              c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
>>              c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
>>          }
>> -        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
>> +        if (EXTERNAL_SSE4(cpu_flags)) {
>>              EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
>>              EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
>>              EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
>> @@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>              QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
>>              QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
>>          }
>> +#endif
>>          if (EXTERNAL_AVX(cpu_flags)) {
>>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
>>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
>> -            if (ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
>>  
>> -                c->idct[2] = ff_hevc_idct_16x16_10_avx;
>> -                c->idct[3] = ff_hevc_idct_32x32_10_avx;
>> -            }
>> +            c->idct[2] = ff_hevc_idct_16x16_10_avx;
>> +            c->idct[3] = ff_hevc_idct_32x32_10_avx;
>> +#endif
>>  
>>              c->idct[0] = ff_hevc_idct_4x4_10_avx;
>>              c->idct[1] = ff_hevc_idct_8x8_10_avx;
>> @@ -942,150 +945,150 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>          if (EXTERNAL_AVX2_FAST(cpu_flags)) {
>>              c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
>>              c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
>> -            if (ARCH_X86_64) {
>> -                c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
>> -                c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
>> -                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
>> -                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
>> -                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
>> +#if ARCH_X86_64
>> +            c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
>> +            c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
>> +            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
>> +            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
>> +            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
>>  
>> -                c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
>> -                c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
>> -                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
>> -                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
>> -                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
>> +            c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
>> +            c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
>> +            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
>> +            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
>> +            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
>>  
>> -                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> -                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> -                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>> -                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
>> -                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
>> +            c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> +            c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> +            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>> +            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
>> +            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
>>  
>> -                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> -                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> -                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>> -                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
>> -                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
>> +            c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
>> +            c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
>> +            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
>> +            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
>> +            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
>>  
>> -                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
>> -                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
>> -                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
>> -                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
>> -                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
>> -                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
>> -                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
>> -                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
>> -                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
>> -                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
>> +            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
>> +            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
>> +            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
>> +            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
>> +            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
>> +            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
>> +            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
>> +            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
>> +            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
>> +            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
>>  
>> -                c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
>> -                c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
>> -                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
>> -                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
>> -                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
>> +            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
>> +            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
>> +            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
>> +            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
>> +            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
>>  
>> -                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
>> -                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
>> -                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
>> -                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
>> -                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
>> +            c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
>> +            c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
>> +            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
>> +            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
>> +            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
>>  
>> -                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
>> -                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
>> -                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
>> -                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
>> -                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
>> +            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
>> +            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
>> +            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
>> +            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
>> +            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
>>  
>> -                c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
>> -                c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
>> -                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
>> -                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
>> -                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
>> +            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
>> +            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
>> +            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
>> +            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
>> +            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
>>  
>> -                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
>> -                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
>> -                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
>> -                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
>> -                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
>> +            c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
>> +            c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
>> +            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
>> +            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
>> +            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
>>  
>> -                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
>> -                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
>> -                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
>> -                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
>> -                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
>> +            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
>> +            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
>> +            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
>> +            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
>> +            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
>>  
>> -                c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
>> -                c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
>> -                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
>> -                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
>> -                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
>> +            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
>> +            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
>> +            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
>> +            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
>> +            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
>>  
>> -                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
>> -                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
>> -                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
>> -                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
>> -                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
>> +            c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
>> +            c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
>> +            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
>> +            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
>> +            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
>>  
>> -                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
>> -                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
>> -                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
>> -                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
>> -                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
>> +            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
>> +            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
>> +            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
>> +            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
>> +            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
>>  
>> -                c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
>> -                c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
>> -                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
>> -                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
>> -                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
>> +            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
>> +            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
>> +            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
>> +            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
>> +            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
>>  
>> -                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
>> -                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
>> -                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
>> -                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
>> -                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
>> +            c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
>> +            c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
>> +            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
>> +            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
>> +            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
>>  
>> -                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
>> -                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
>> -                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
>> -                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
>> -                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
>> +            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
>> +            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
>> +            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
>> +            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
>> +            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
>>  
>> -                c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
>> -                c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
>> -                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
>> -                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
>> -                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
>> +            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
>> +            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
>> +            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
>> +            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
>> +            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
>>  
>> -                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
>> -                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
>> -                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
>> -                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
>> -                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
>> +            c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
>> +            c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
>> +            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
>> +            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
>> +            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
>>  
>> -                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
>> -                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
>> -                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
>> -                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
>> -                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
>> +            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
>> +            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
>> +            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
>> +            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
>> +            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
>>  
>> -                c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
>> -                c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
>> -                c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
>> -                c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
>> -                c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
>> +            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
>> +            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
>> +            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
>> +            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
>> +            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
>>  
>> -                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
>> -                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
>> -                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
>> -                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
>> -                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
>> +            c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
>> +            c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
>> +            c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
>> +            c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
>> +            c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
>>  
>> -                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
>> -                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
>> -                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
>> -                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
>> -                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
>> -            }
>> +            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
>> +            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
>> +            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
>> +            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
>> +            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
>> +#endif
>>              SAO_BAND_INIT(10, avx2);
>>              SAO_EDGE_INIT(10, avx2);
>>  
>> @@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>          if (EXTERNAL_SSE2(cpu_flags)) {
>>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
>>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
>> -            if (ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
>> -            }
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
>> +#endif
>>              SAO_BAND_INIT(12, sse2);
>>              SAO_EDGE_INIT(12, sse2);
>>  
>> @@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>              c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
>>              c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
>>          }
>> -        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
>> +#if ARCH_X86_64
>> +        if (EXTERNAL_SSSE3(cpu_flags)) {
>>              c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
>>              c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
>>          }
>> -        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
>> +        if (EXTERNAL_SSE4(cpu_flags)) {
>>              EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
>>              EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
>>              EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
>> @@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
>>              QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
>>              QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
>>          }
>> +#endif
>>          if (EXTERNAL_AVX(cpu_flags)) {
>>              c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
>>              c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
>> -            if (ARCH_X86_64) {
>> -                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
>> -                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
>> -            }
>> +#if ARCH_X86_64
>> +            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
>> +            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
>> +#endif
>>              SAO_BAND_INIT(12, avx);
>>          }
>>          if (EXTERNAL_AVX2(cpu_flags)) {
>> diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
>> index f28a1ad744..4ade52a880 100644
>> --- a/libavcodec/x86/idctdsp_init.c
>> +++ b/libavcodec/x86/idctdsp_init.c
>> @@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
>>          }
>>  #endif
>>  
>> -        if (ARCH_X86_64 &&
>> -            !high_bit_depth &&
>> +#if ARCH_X86_64
>> +        if (!high_bit_depth &&
>>              avctx->lowres == 0 &&
>>              (avctx->idct_algo == FF_IDCT_AUTO ||
>>                  avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
>> @@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
>>                  c->idct_add  = ff_simple_idct8_add_sse2;
>>                  c->perm_type = FF_IDCT_PERM_TRANSPOSE;
>>          }
>> +#endif
>>      }
>>  
>> -    if (ARCH_X86_64 && avctx->lowres == 0) {
>> +#if ARCH_X86_64
>> +    if (avctx->lowres == 0) {
>>          if (EXTERNAL_AVX(cpu_flags) &&
>>              !high_bit_depth &&
>>              (avctx->idct_algo == FF_IDCT_AUTO ||
>> @@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
>>              }
>>          }
>>      }
>> +#endif
>>  }
>> diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
>> index 950f996832..333a685f47 100644
>> --- a/libavcodec/x86/mlpdsp_init.c
>> +++ b/libavcodec/x86/mlpdsp_init.c
>> @@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
>>      if (INLINE_MMX(cpu_flags))
>>          c->mlp_filter_channel = mlp_filter_channel_x86;
>>  #endif
>> -    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
>> +#if ARCH_X86_64
>> +    if (EXTERNAL_SSE4(cpu_flags))
>>          c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
>> -    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
>> +    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
>>          c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
>> +#endif
>>  }
>> diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
>> index 90b2f3624e..bc63933e83 100644
>> --- a/libavcodec/x86/vc1dsp_init.c
>> +++ b/libavcodec/x86/vc1dsp_init.c
>> @@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
>>  {
>>      int cpu_flags = av_get_cpu_flags();
>>  
>> -    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
>> +#if HAVE_6REGS
>> +    if (INLINE_MMX(cpu_flags))
>>          if (EXTERNAL_MMX(cpu_flags))
>>          ff_vc1dsp_init_mmx(dsp);
>>  
>> -    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
>> +    if (INLINE_MMXEXT(cpu_flags))
>>          if (EXTERNAL_MMXEXT(cpu_flags))
>>          ff_vc1dsp_init_mmxext(dsp);
>> +#endif
>>  
>>  #define ASSIGN_LF4(EXT) \
>>          dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
>> diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
>> index b5006ac295..f01db4baf4 100644
>> --- a/libavfilter/x86/colorspacedsp_init.c
>> +++ b/libavfilter/x86/colorspacedsp_init.c
>> @@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
>>  {
>>      int cpu_flags = av_get_cpu_flags();
>>  
>> -    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
>> +#if ARCH_X86_64
>> +    if (EXTERNAL_SSE2(cpu_flags)) {
>>  #define assign_yuv2yuv_fns(ss) \
>>          dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \
>>          dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \
>> @@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
>>  
>>          dsp->multiply3x3 = ff_multiply3x3_sse2;
>>      }
>> +#endif
>>  }
>> diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
>> index e7a653f191..eb621e172c 100644
>> --- a/libavfilter/x86/vf_atadenoise_init.c
>> +++ b/libavfilter/x86/vf_atadenoise_init.c
>> @@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
>>      int cpu_flags = av_get_cpu_flags();
>>  
>>      for (int p = 0; p < 4; p++) {
>> -        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
>> +#if ARCH_X86_64 
>> +        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
>>              dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
>>          }
>>  
>> -        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
>> +        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
>>              dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
>>          }
>> +#endif
>>      }
>>  }
>> diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
>> index cbaa20ef16..ddc91f791a 100644
>> --- a/libavfilter/x86/vf_ssim_init.c
>> +++ b/libavfilter/x86/vf_ssim_init.c
>> @@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
>>  {
>>      int cpu_flags = av_get_cpu_flags();
>>  
>> -    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
>> -        dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
>> +#if ARCH_X86_64
>> +    if (EXTERNAL_SSSE3(cpu_flags))
>> +      dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
> 
> We indent by four spaces. And there is actually no reason to touch this
> line at all.
> 
>> +#endif
>>      if (EXTERNAL_SSE4(cpu_flags))
>>          dsp->ssim_end_line = ff_ssim_end_line_sse4;
>>      if (EXTERNAL_XOP(cpu_flags))
>> diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
>> index 16202fba76..6d677d651d 100644
>> --- a/libavfilter/x86/vf_w3fdif_init.c
>> +++ b/libavfilter/x86/vf_w3fdif_init.c
>> @@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
>>          dsp->filter_scale        = ff_w3fdif_scale_sse2;
>>      }
>>  
>> -    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
>> +#if ARCH_X86_64
>> +    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
>>          dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
>>      }
>> +#endif
>>  }
> 

-- 
amyspark 🌸 https://www.amyspark.me
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-03 12:55     ` L. E. Segovia
@ 2022-11-03 14:19       ` Andreas Rheinhardt
  0 siblings, 0 replies; 54+ messages in thread
From: Andreas Rheinhardt @ 2022-11-03 14:19 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

L. E. Segovia:
> Hi!
> 
> Thanks for the review. The comments will be fixed in the next version of
> the patchset. Just a couple remarks:
> 
> re dcadsp_init -- this one comes from 4.4.x having a clause there to
> support SSE, which also checks for the x86-32 architecture [1]. I've
> removed it for the current version.
> 
> re flacdsp_init -- ff_flac_decorrelate_indep8_16_avx and
> ff_flac_decorrelate_indep8_32_avx are from their inception only
> generated for x86-64 [2][3]. This check was missing from the C side,
> implying it relied on DCE to pass linking.
> 

Sorry, I somehow did not recognize that there were already ARCH_X86_64
checks for these flacdsp functions.

> [1]:
> https://github.com/FFmpeg/FFmpeg/blob/release/4.4/libavcodec/x86/dcadsp_init.c#L40-L41
> 
> [2]:
> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/x86/flacdsp.asm#L315-L318
> 
> [3]:
> https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/x86/flacdsp.asm#L323-L326
> 

Another idea that I had is as follows: Instead of using if
(EXTERNAL_MMX(cpu_flags)) { ... } we add a macro
IF_EXTERNAL_MMX(cpu_flags, ...) that expands to "if (cpu_flags &
AV_CPU_FLAG_MMX) { __VA_ARGS__ }" if HAVE_EXTERNAL_MMX is true and to
nothing (or a null statement) of it is not.

Advantages of this approach are that it does not involve sprinkling the
codebase with many #ifs and that it automatically checks the right stuff
-- namely the corresponding HAVE_* instead of just HAVE_X86ASM as you do
in the last patch; notice that if an assembler is present, we expect it
to be able to assemble MMX(EXT), SSE etc., but not AVX, and consequently
mostly don't check for it in the .asm files, but as has been said AVX(2)
and XOP are an exception to this, so that one would still get linker
errors with your patchset if one used an assembler that does not support
AVX(2) (or if one disabled it via configure).

Disadvantages of it are that one can not add more #if checks to the
"..." of these macros and that there would be some calls to
av_get_cpu_flags() where the return value would be unused (we might have
to mark the variable as av_unused or mark said function as av_pure to
make the compiler optimize that away and not emit warnings for it).
But it would still be usable for the common case where there are no
further #if checks.

- Andreas

_______________________________________________
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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v2 0/5] Fix FFmpeg compilation without DCE
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (4 preceding siblings ...)
  2022-11-02  1:08 ` [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE Andreas Rheinhardt
@ 2022-11-03 15:30 ` L. E. Segovia
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 15:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Hi all,

Thanks again for the review of the previous version of the patchset.

v2 changes:

- Split indentation fixes for hevcdsp_init into its own commit
- Fixed spurious indentation in vf_ssim_init
- Implemented the macro approach for expanding the CONFIG_FOO checks in fftools
- Added the missing HAVE_X86ASM check in vc1dsp_init
- Added a missing HAVE_INLINE_ASM check in hpeldsp_init (see below)
- Fixed the HAVE_X86ASM check wrongly covering the INLINE_FOO clause in hpeldsp_init
- Removed the duplicate HAVE_X86ASM check in me_cmp_init
- Inlined the HAVE_X86ASM and ARCH_X86_64 checks in mlpdsp_init and vf_convolution_init 

L. E. Segovia (5):
  all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
  all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM

 fftools/ffprobe.c                          |  16 +-
 fftools/opt_common.c                       |  12 +-
 libavcodec/x86/aacencdsp_init.c            |   2 +
 libavcodec/x86/aacpsdsp_init.c             |   2 +
 libavcodec/x86/ac3dsp_init.c               |   4 +
 libavcodec/x86/audiodsp_init.c             |   2 +
 libavcodec/x86/bswapdsp_init.c             |   2 +
 libavcodec/x86/cavsdsp.c                   |   2 +
 libavcodec/x86/celt_pvq_init.c             |   2 +
 libavcodec/x86/cfhddsp_init.c              |   2 +
 libavcodec/x86/cfhdencdsp_init.c           |   2 +
 libavcodec/x86/dcadsp_init.c               |   2 +
 libavcodec/x86/dct_init.c                  |   2 +
 libavcodec/x86/dnxhdenc_init.c             |   2 +
 libavcodec/x86/exrdsp_init.c               |   2 +
 libavcodec/x86/fdctdsp_init.c              |   2 +
 libavcodec/x86/fft_init.c                  |   2 +
 libavcodec/x86/flacdsp_init.c              |   8 +-
 libavcodec/x86/g722dsp_init.c              |   2 +
 libavcodec/x86/h263dsp_init.c              |   2 +
 libavcodec/x86/h264_intrapred_init.c       |   2 +
 libavcodec/x86/h264chroma_init.c           |   2 +
 libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
 libavcodec/x86/hpeldsp_init.c              |   4 +
 libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
 libavcodec/x86/huffyuvdsp_init.c           |   2 +
 libavcodec/x86/huffyuvencdsp_init.c        |   2 +
 libavcodec/x86/idctdsp_init.c              |  11 +-
 libavcodec/x86/jpeg2000dsp_init.c          |   2 +
 libavcodec/x86/lossless_videodsp_init.c    |   2 +
 libavcodec/x86/lossless_videoencdsp_init.c |   2 +
 libavcodec/x86/mdct15_init.c               |   2 +
 libavcodec/x86/me_cmp_init.c               |   2 +
 libavcodec/x86/mlpdsp_init.c               |   6 +-
 libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
 libavcodec/x86/opusdsp_init.c              |   2 +
 libavcodec/x86/pixblockdsp_init.c          |   2 +
 libavcodec/x86/pngdsp_init.c               |   2 +
 libavcodec/x86/proresdsp_init.c            |   2 +
 libavcodec/x86/rv34dsp_init.c              |   2 +
 libavcodec/x86/sbcdsp_init.c               |   2 +
 libavcodec/x86/sbrdsp_init.c               |   2 +
 libavcodec/x86/svq1enc_init.c              |   2 +
 libavcodec/x86/utvideodsp_init.c           |   2 +
 libavcodec/x86/v210enc_init.c              |   2 +
 libavcodec/x86/vc1dsp_init.c               |   6 +-
 libavcodec/x86/vorbisdsp_init.c            |   2 +
 libavcodec/x86/vp3dsp_init.c               |   2 +
 libavcodec/x86/vp6dsp_init.c               |   2 +
 libavfilter/x86/af_afir_init.c             |   2 +
 libavfilter/x86/af_anlmdn_init.c           |   2 +
 libavfilter/x86/af_volume_init.c           |   2 +
 libavfilter/x86/avf_showcqt_init.c         |   2 +
 libavfilter/x86/colorspacedsp_init.c       |   6 +-
 libavfilter/x86/vf_atadenoise_init.c       |   8 +-
 libavfilter/x86/vf_blend_init.c            |   2 +
 libavfilter/x86/vf_bwdif_init.c            |   2 +
 libavfilter/x86/vf_convolution_init.c      |   2 +-
 libavfilter/x86/vf_framerate_init.c        |   2 +
 libavfilter/x86/vf_fspp_init.c             |   2 +
 libavfilter/x86/vf_gblur_init.c            |   2 +
 libavfilter/x86/vf_hflip_init.c            |   2 +
 libavfilter/x86/vf_limiter_init.c          |   2 +
 libavfilter/x86/vf_maskedclamp_init.c      |   2 +
 libavfilter/x86/vf_maskedmerge_init.c      |   2 +
 libavfilter/x86/vf_overlay_init.c          |   2 +
 libavfilter/x86/vf_pp7_init.c              |   2 +
 libavfilter/x86/vf_psnr_init.c             |   2 +
 libavfilter/x86/vf_removegrain_init.c      |   2 +
 libavfilter/x86/vf_ssim_init.c             |   6 +-
 libavfilter/x86/vf_stereo3d_init.c         |   2 +
 libavfilter/x86/vf_threshold_init.c        |   2 +
 libavfilter/x86/vf_tinterlace_init.c       |   2 +
 libavfilter/x86/vf_transpose_init.c        |   2 +
 libavfilter/x86/vf_v360_init.c             |   2 +
 libavfilter/x86/vf_w3fdif_init.c           |   6 +-
 libavfilter/x86/vf_yadif_init.c            |   2 +
 libavformat/rtmpproto.c                    |  24 +-
 libavutil/x86/fixed_dsp_init.c             |   2 +
 libavutil/x86/float_dsp_init.c             |   2 +
 libavutil/x86/imgutils_init.c              |   2 +
 libavutil/x86/lls_init.c                   |   2 +
 libavutil/x86/pixelutils_init.c            |   2 +
 libswresample/x86/audio_convert_init.c     |   2 +
 libswresample/x86/resample_init.c          |   6 +
 libswscale/x86/rgb2rgb.c                   |   2 +
 libswscale/x86/swscale.c                   |   2 +
 87 files changed, 517 insertions(+), 299 deletions(-)

-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v2 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (5 preceding siblings ...)
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 0/5] " L. E. Segovia
@ 2022-11-03 15:30 ` L. E. Segovia
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 15:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/fdctdsp_init.c        |  2 ++
 libavcodec/x86/flacdsp_init.c        |  8 +++--
 libavcodec/x86/hevcdsp_init.c        | 53 +++++++++++++++-------------
 libavcodec/x86/idctdsp_init.c        |  9 +++--
 libavcodec/x86/mlpdsp_init.c         |  6 ++--
 libavcodec/x86/vc1dsp_init.c         |  6 ++--
 libavfilter/x86/colorspacedsp_init.c |  4 ++-
 libavfilter/x86/vf_atadenoise_init.c |  6 ++--
 libavfilter/x86/vf_ssim_init.c       |  4 ++-
 libavfilter/x86/vf_w3fdif_init.c     |  4 ++-
 10 files changed, 64 insertions(+), 38 deletions(-)

diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
index 92a842433d..4a874a640d 100644
--- a/libavcodec/x86/fdctdsp_init.c
+++ b/libavcodec/x86/fdctdsp_init.c
@@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
 
     if (!high_bit_depth) {
         if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+#if HAVE_INLINE_SSE2
             if (INLINE_SSE2(cpu_flags))
                 c->fdct = ff_fdct_sse2;
+#endif
         }
     }
 }
diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
index 87daed7005..49e67ee2b0 100644
--- a/libavcodec/x86/flacdsp_init.c
+++ b/libavcodec/x86/flacdsp_init.c
@@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
     }
     if (EXTERNAL_AVX(cpu_flags)) {
         if (fmt == AV_SAMPLE_FMT_S16) {
-            if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
+#endif
         } else if (fmt == AV_SAMPLE_FMT_S32) {
             if (channels == 4)
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
+#endif
         }
     }
     if (EXTERNAL_XOP(cpu_flags)) {
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 6f45e5e0db..40a295430d 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 
                 c->idct[2] = ff_hevc_idct_16x16_8_sse2;
                 c->idct[3] = ff_hevc_idct_32x32_8_sse2;
-            }
+#endif
             SAO_BAND_INIT(8, sse2);
 
             c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
@@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
-            if(ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
-            }
+#endif
             SAO_EDGE_INIT(8, ssse3);
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
-
+#if ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
@@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 
                 c->idct[2] = ff_hevc_idct_16x16_8_avx;
                 c->idct[3] = ff_hevc_idct_32x32_8_avx;
-            }
+#endif
             SAO_BAND_INIT(8, avx);
 
             c->idct[0] = ff_hevc_idct_4x4_8_avx;
@@ -775,7 +776,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
                 c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
                 c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
@@ -859,7 +860,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
                 c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
                 c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
-            }
+#endif
             SAO_BAND_INIT(8, avx2);
 
             c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
@@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
 
                 c->idct[2] = ff_hevc_idct_16x16_10_sse2;
                 c->idct[3] = ff_hevc_idct_32x32_10_sse2;
-            }
+#endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
 
@@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
             c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
@@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 
                 c->idct[2] = ff_hevc_idct_16x16_10_avx;
                 c->idct[3] = ff_hevc_idct_32x32_10_avx;
-            }
+#endif
 
             c->idct[0] = ff_hevc_idct_4x4_10_avx;
             c->idct[1] = ff_hevc_idct_8x8_10_avx;
@@ -942,7 +945,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
                 c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
                 c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
@@ -1085,7 +1088,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
                 c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
                 c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
-            }
+#endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
 
@@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
-            }
+#endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
 
@@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
@@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
-            }
+#endif
             SAO_BAND_INIT(12, avx);
         }
         if (EXTERNAL_AVX2(cpu_flags)) {
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index f28a1ad744..4ade52a880 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
 #endif
 
-        if (ARCH_X86_64 &&
-            !high_bit_depth &&
+#if ARCH_X86_64
+        if (!high_bit_depth &&
             avctx->lowres == 0 &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
                 avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
@@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                 c->idct_add  = ff_simple_idct8_add_sse2;
                 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
         }
+#endif
     }
 
-    if (ARCH_X86_64 && avctx->lowres == 0) {
+#if ARCH_X86_64
+    if (avctx->lowres == 0) {
         if (EXTERNAL_AVX(cpu_flags) &&
             !high_bit_depth &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
@@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
             }
         }
     }
+#endif
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 950f996832..333a685f47 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
-    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
+    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
+#endif
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 90b2f3624e..bc63933e83 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
+#if HAVE_6REGS
+    if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
 
-    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
+    if (INLINE_MMXEXT(cpu_flags))
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
+#endif
 
 #define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index b5006ac295..f01db4baf4 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags)) {
 #define assign_yuv2yuv_fns(ss) \
         dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \
         dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \
@@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
+#endif
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index e7a653f191..eb621e172c 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
+#if ARCH_X86_64 
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
         }
 
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
         }
+#endif
     }
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index cbaa20ef16..6f2305430c 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSSE3(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+#endif
     if (EXTERNAL_SSE4(cpu_flags))
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 16202fba76..6d677d651d 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_scale        = ff_w3fdif_scale_sse2;
     }
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
+#endif
 }
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v2 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (6 preceding siblings ...)
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2022-11-03 15:30 ` L. E. Segovia
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 15:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

---
 libavcodec/x86/hevcdsp_init.c | 454 +++++++++++++++++-----------------
 1 file changed, 227 insertions(+), 227 deletions(-)

diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 40a295430d..c7060085a2 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -711,11 +711,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
+            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
 #endif
             SAO_BAND_INIT(8, sse2);
 
@@ -732,8 +732,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
 #endif
             SAO_EDGE_INIT(8, ssse3);
         }
@@ -754,11 +754,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_avx;
-                c->idct[3] = ff_hevc_idct_32x32_8_avx;
+            c->idct[2] = ff_hevc_idct_16x16_8_avx;
+            c->idct[3] = ff_hevc_idct_32x32_8_avx;
 #endif
             SAO_BAND_INIT(8, avx);
 
@@ -777,89 +777,89 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
 #if ARCH_X86_64
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
 
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
 
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
 
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
 #endif
             SAO_BAND_INIT(8, avx2);
 
@@ -886,11 +886,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
+            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
 #endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
@@ -927,11 +927,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_avx;
-                c->idct[3] = ff_hevc_idct_32x32_10_avx;
+            c->idct[2] = ff_hevc_idct_16x16_10_avx;
+            c->idct[3] = ff_hevc_idct_32x32_10_avx;
 #endif
 
             c->idct[0] = ff_hevc_idct_4x4_10_avx;
@@ -946,148 +946,148 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
 #if ARCH_X86_64
-                c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
-                c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
-                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
-
-                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
-                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
-
-                c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
-                c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
-                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
-                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
-
-                c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
-                c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
-                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
-                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
-
-                c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
-                c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
-                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
-                c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
-                c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
-                c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
-                c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
-                c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
+            c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
+            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
+            c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
+
+            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
+            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
+
+            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
+            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
+            c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
+            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
+
+            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
+            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
+            c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
+            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
+
+            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
+            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
+            c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
+            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
+            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
+            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
+            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
+            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
 #endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
@@ -1103,8 +1103,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
 #endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
@@ -1134,8 +1134,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
 #endif
             SAO_BAND_INIT(12, avx);
         }
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v2 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (7 preceding siblings ...)
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia
@ 2022-11-03 15:30 ` L. E. Segovia
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 15:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 fftools/ffprobe.c       | 16 +++++++++++-----
 fftools/opt_common.c    | 12 ++++++++++--
 libavformat/rtmpproto.c | 24 ++++++++++++++++++------
 3 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 9b7e82fd8c..b878e258ca 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3518,9 +3518,9 @@ static void ffprobe_show_program_version(WriterContext *w)
     av_bprint_finalize(&pbuf, NULL);
 }
 
-#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
-    do {                                                                \
-        if (CONFIG_##LIBNAME) {                                         \
+#define SHOW_LIB_VERSION_0(libname, LIBNAME)
+#define SHOW_LIB_VERSION_1(libname, LIBNAME)                            \
+        {                                                               \
             unsigned int version = libname##_version();                 \
             writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
             print_str("name",    "lib" #libname);                       \
@@ -3530,8 +3530,14 @@ static void ffprobe_show_program_version(WriterContext *w)
             print_int("version", version);                              \
             print_str("ident",   LIB##LIBNAME##_IDENT);                 \
             writer_print_section_footer(w);                             \
-        }                                                               \
-    } while (0)
+        }
+
+#define SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_ ## cfg(libname, LIBNAME)
+#define SHOW_LIB_VERSION_3(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)
+#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
+    SHOW_LIB_VERSION_3(CONFIG_ ## LIBNAME, libname, LIBNAME)
 
 static void ffprobe_show_library_versions(WriterContext *w)
 {
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 8a06df82df..f901dba806 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -153,8 +153,9 @@ static int warned_cfg = 0;
 #define SHOW_CONFIG   4
 #define SHOW_COPYRIGHT 8
 
-#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
-    if (CONFIG_##LIBNAME) {                                             \
+#define PRINT_LIB_INFO_0(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_1(libname, LIBNAME, flags, level)                \
+    {                                                                   \
         const char *indent = flags & INDENT? "  " : "";                 \
         if (flags & SHOW_VERSION) {                                     \
             unsigned int version = libname##_version();                 \
@@ -182,6 +183,13 @@ static int warned_cfg = 0;
         }                                                               \
     }                                                                   \
 
+#define PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_ ## cfg(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_3(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
+    PRINT_LIB_INFO_3(CONFIG_ ## LIBNAME, libname, LIBNAME, flags, level)
+
 static void print_all_libs_info(int flags, int level)
 {
     PRINT_LIB_INFO(avutil,     AVUTIL,     flags, level);
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f0ef223f05..6d84fcf34f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
     for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
         tosend[i] = av_lfg_get(&rnd) >> 24;
 
-    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+    if (rt->encrypted) {
         /* When the client wants to use RTMPE, we have to change the command
          * byte to 0x06 which means to use encrypted data and we have to set
          * the flash version to at least 9.0.115.0. */
@@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
             return ret;
     }
+#endif
 
     client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
     if (client_pos < 0)
@@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
             /* Encrypt the signature received by the server. */
             ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]);
         }
+#endif
 
         if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
             av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
@@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Encrypt the signature to be send to the server. */
             ff_rtmpe_encrypt_sig(rt->stream, tosend +
                                  RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
                                  serverdata[0]);
         }
+#endif
 
         // write reply back to the server
         if ((ret = ffurl_write(rt->stream, tosend,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     } else {
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
                                      serverdata[0]);
             }
         }
+#endif
 
         if ((ret = ffurl_write(rt->stream, serverdata + 1,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     }
 
     return 0;
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v2 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (8 preceding siblings ...)
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
@ 2022-11-03 15:30 ` L. E. Segovia
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
  11 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 15:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/hpeldsp_init.c | 2 ++
 libavcodec/x86/vc1dsp_init.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 09c48c341e..6bde5a3893 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -224,8 +224,10 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         hpeldsp_init_mmx(c, flags);
+#endif
 
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index bc63933e83..65fc28ea35 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS
+#if HAVE_6REGS && HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (9 preceding siblings ...)
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
@ 2022-11-03 15:30 ` L. E. Segovia
  2022-11-03 15:55   ` Lynne
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
  11 siblings, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 15:30 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/aacencdsp_init.c            | 2 ++
 libavcodec/x86/aacpsdsp_init.c             | 2 ++
 libavcodec/x86/ac3dsp_init.c               | 4 ++++
 libavcodec/x86/audiodsp_init.c             | 2 ++
 libavcodec/x86/bswapdsp_init.c             | 2 ++
 libavcodec/x86/cavsdsp.c                   | 2 ++
 libavcodec/x86/celt_pvq_init.c             | 2 ++
 libavcodec/x86/cfhddsp_init.c              | 2 ++
 libavcodec/x86/cfhdencdsp_init.c           | 2 ++
 libavcodec/x86/dcadsp_init.c               | 2 ++
 libavcodec/x86/dct_init.c                  | 2 ++
 libavcodec/x86/dnxhdenc_init.c             | 2 ++
 libavcodec/x86/exrdsp_init.c               | 2 ++
 libavcodec/x86/fft_init.c                  | 2 ++
 libavcodec/x86/g722dsp_init.c              | 2 ++
 libavcodec/x86/h263dsp_init.c              | 2 ++
 libavcodec/x86/h264_intrapred_init.c       | 2 ++
 libavcodec/x86/h264chroma_init.c           | 2 ++
 libavcodec/x86/hevcdsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_vp3_init.c          | 2 ++
 libavcodec/x86/huffyuvdsp_init.c           | 2 ++
 libavcodec/x86/huffyuvencdsp_init.c        | 2 ++
 libavcodec/x86/idctdsp_init.c              | 2 ++
 libavcodec/x86/jpeg2000dsp_init.c          | 2 ++
 libavcodec/x86/lossless_videodsp_init.c    | 2 ++
 libavcodec/x86/lossless_videoencdsp_init.c | 2 ++
 libavcodec/x86/mdct15_init.c               | 2 ++
 libavcodec/x86/me_cmp_init.c               | 2 ++
 libavcodec/x86/mlpdsp_init.c               | 2 +-
 libavcodec/x86/mpegvideoencdsp_init.c      | 2 ++
 libavcodec/x86/opusdsp_init.c              | 2 ++
 libavcodec/x86/pixblockdsp_init.c          | 2 ++
 libavcodec/x86/pngdsp_init.c               | 2 ++
 libavcodec/x86/proresdsp_init.c            | 2 ++
 libavcodec/x86/rv34dsp_init.c              | 2 ++
 libavcodec/x86/sbcdsp_init.c               | 2 ++
 libavcodec/x86/sbrdsp_init.c               | 2 ++
 libavcodec/x86/svq1enc_init.c              | 2 ++
 libavcodec/x86/utvideodsp_init.c           | 2 ++
 libavcodec/x86/v210enc_init.c              | 2 ++
 libavcodec/x86/vc1dsp_init.c               | 2 +-
 libavcodec/x86/vorbisdsp_init.c            | 2 ++
 libavcodec/x86/vp3dsp_init.c               | 2 ++
 libavcodec/x86/vp6dsp_init.c               | 2 ++
 libavfilter/x86/af_afir_init.c             | 2 ++
 libavfilter/x86/af_anlmdn_init.c           | 2 ++
 libavfilter/x86/af_volume_init.c           | 2 ++
 libavfilter/x86/avf_showcqt_init.c         | 2 ++
 libavfilter/x86/colorspacedsp_init.c       | 2 ++
 libavfilter/x86/vf_atadenoise_init.c       | 2 ++
 libavfilter/x86/vf_blend_init.c            | 2 ++
 libavfilter/x86/vf_bwdif_init.c            | 2 ++
 libavfilter/x86/vf_convolution_init.c      | 2 +-
 libavfilter/x86/vf_framerate_init.c        | 2 ++
 libavfilter/x86/vf_fspp_init.c             | 2 ++
 libavfilter/x86/vf_gblur_init.c            | 2 ++
 libavfilter/x86/vf_hflip_init.c            | 2 ++
 libavfilter/x86/vf_limiter_init.c          | 2 ++
 libavfilter/x86/vf_maskedclamp_init.c      | 2 ++
 libavfilter/x86/vf_maskedmerge_init.c      | 2 ++
 libavfilter/x86/vf_overlay_init.c          | 2 ++
 libavfilter/x86/vf_pp7_init.c              | 2 ++
 libavfilter/x86/vf_psnr_init.c             | 2 ++
 libavfilter/x86/vf_removegrain_init.c      | 2 ++
 libavfilter/x86/vf_ssim_init.c             | 2 ++
 libavfilter/x86/vf_stereo3d_init.c         | 2 ++
 libavfilter/x86/vf_threshold_init.c        | 2 ++
 libavfilter/x86/vf_tinterlace_init.c       | 2 ++
 libavfilter/x86/vf_transpose_init.c        | 2 ++
 libavfilter/x86/vf_v360_init.c             | 2 ++
 libavfilter/x86/vf_w3fdif_init.c           | 2 ++
 libavfilter/x86/vf_yadif_init.c            | 2 ++
 libavutil/x86/fixed_dsp_init.c             | 2 ++
 libavutil/x86/float_dsp_init.c             | 2 ++
 libavutil/x86/imgutils_init.c              | 2 ++
 libavutil/x86/lls_init.c                   | 2 ++
 libavutil/x86/pixelutils_init.c            | 2 ++
 libswresample/x86/audio_convert_init.c     | 2 ++
 libswresample/x86/resample_init.c          | 6 ++++++
 libswscale/x86/rgb2rgb.c                   | 2 ++
 libswscale/x86/swscale.c                   | 2 ++
 82 files changed, 167 insertions(+), 3 deletions(-)

diff --git a/libavcodec/x86/aacencdsp_init.c b/libavcodec/x86/aacencdsp_init.c
index 049a2417d9..7dca1d481b 100644
--- a/libavcodec/x86/aacencdsp_init.c
+++ b/libavcodec/x86/aacencdsp_init.c
@@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled,
 
 av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->quant_bands = ff_aac_quantize_bands_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c
index 0b0ee07db4..44d64f5340 100644
--- a/libavcodec/x86/aacpsdsp_init.c
+++ b/libavcodec/x86/aacpsdsp_init.c
@@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64],
 
 av_cold void ff_psdsp_init_x86(PSDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s)
     if (EXTERNAL_FMA3(cpu_flags)) {
         s->hybrid_analysis        = ff_ps_hybrid_analysis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 43b3b4ac85..76a8c0547d 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
 
 av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
         if (!(cpu_flags & AV_CPU_FLAG_ATOM))
             c->extract_exponents = ff_ac3_extract_exponents_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
 
 #define DOWNMIX_FUNC_OPT(ch, opt)                                       \
@@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3)
 
 void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #define SET_DOWNMIX(ch, suf, SUF)                                       \
@@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
         SET_DOWNMIX_ALL(avx,  AVX)
         SET_DOWNMIX_ALL(fma3, FMA3)
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c
index 68aa3b2129..c5f410678e 100644
--- a/libavcodec/x86/audiodsp_init.c
+++ b/libavcodec/x86/audiodsp_init.c
@@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src,
 
 av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->scalarproduct_int16 = ff_scalarproduct_int16_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c
index 877bab1a2c..08551f6487 100644
--- a/libavcodec/x86/bswapdsp_init.c
+++ b/libavcodec/x86/bswapdsp_init.c
@@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t *src, int w);
 
 av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
         c->bswap_buf = ff_bswap32_buf_ssse3;
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->bswap_buf = ff_bswap32_buf_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 4ad977a034..ad755e7321 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -383,6 +383,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         DSPFUNC(avg, 1,  8, mmxext);
     }
 #endif
+#if HAVE_X86ASM
 #if HAVE_MMX_EXTERNAL
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext;
@@ -397,4 +398,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         c->idct_perm      = FF_IDCT_PERM_TRANSPOSE;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c
index 5a0669e6f2..b88a2f6225 100644
--- a/libavcodec/x86/celt_pvq_init.c
+++ b/libavcodec/x86/celt_pvq_init.c
@@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx  (float *X, int *y, int K, int N);
 
 av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->pvq_search = ff_pvq_search_exact_avx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c
index c5d89561ae..a773c365c1 100644
--- a/libavcodec/x86/cfhddsp_init.c
+++ b/libavcodec/x86/cfhddsp_init.c
@@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output, const int16_t *low, const
 
 av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
         if (depth == 12 && !bayer)
             c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhdencdsp_init.c b/libavcodec/x86/cfhdencdsp_init.c
index 5cea39a80a..79b2f10bf7 100644
--- a/libavcodec/x86/cfhdencdsp_init.c
+++ b/libavcodec/x86/cfhdencdsp_init.c
@@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *hi
 
 av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
         c->vert_filter = ff_cfhdenc_vert_filter_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 0c78dd1c9e..b407679f6a 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3)
 
 av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
     }
     if (EXTERNAL_FMA3(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c
index d0e4b34dd3..6756e1e12d 100644
--- a/libavcodec/x86/dct_init.c
+++ b/libavcodec/x86/dct_init.c
@@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
 
 av_cold void ff_dct_init_x86(DCTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->dct32 = ff_dct32_float_sse2;
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->dct32 = ff_dct32_float_avx;
+#endif
 }
diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c
index fd6f15005a..612b70ad7a 100644
--- a/libavcodec/x86/dnxhdenc_init.c
+++ b/libavcodec/x86/dnxhdenc_init.c
@@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
 
 av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(av_get_cpu_flags())) {
         if (ctx->cid_table->bit_depth == 8)
             ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c
index 63b3480d8f..f9696d7a91 100644
--- a/libavcodec/x86/exrdsp_init.c
+++ b/libavcodec/x86/exrdsp_init.c
@@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size);
 
 av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
         dsp->reorder_pixels = ff_reorder_pixels_avx2;
         dsp->predictor      = ff_predictor_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c
index df79d57dc7..065e231edb 100644
--- a/libavcodec/x86/fft_init.c
+++ b/libavcodec/x86/fft_init.c
@@ -26,6 +26,7 @@
 
 av_cold void ff_fft_init_x86(FFTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->nbits > 16)
@@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s)
         s->fft_calc        = ff_fft_calc_avx;
         s->fft_permutation = FF_FFT_PERM_AVX;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c
index 614695193b..700269d62a 100644
--- a/libavcodec/x86/g722dsp_init.c
+++ b/libavcodec/x86/g722dsp_init.c
@@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t *prev_samples, int xout[2]);
 
 av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         dsp->apply_qmf = ff_g722_apply_qmf_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c
index ab81063233..57ec1640e3 100644
--- a/libavcodec/x86/h263dsp_init.c
+++ b/libavcodec/x86/h263dsp_init.c
@@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale);
 
 av_cold void ff_h263dsp_init_x86(H263DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
         c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
         c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
index ee46927a24..5518961784 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
                                    const int bit_depth,
                                    const int chroma_format_idc)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_avx;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c
index 34934b6ad0..57d92ad107 100644
--- a/libavcodec/x86/h264chroma_init.c
+++ b/libavcodec/x86/h264chroma_init.c
@@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx)
 
 av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
 {
+#if HAVE_X86ASM
     int high_bit_depth = bit_depth > 8;
     int cpu_flags      = av_get_cpu_flags();
 
@@ -105,4 +106,5 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
         c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
         c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index c7060085a2..29c11246ae 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2)
 
 void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             SAO_EDGE_INIT(12, avx2);
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 6bde5a3893..99a1ab7310 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -229,6 +229,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
         hpeldsp_init_mmx(c, flags);
 #endif
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
 
@@ -237,6 +238,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 
     if (EXTERNAL_SSSE3(cpu_flags))
         hpeldsp_init_ssse3(c, flags);
+#endif
 
     if (CONFIG_VP3_DECODER)
         ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);
diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c
index 1dbd1ba6f9..3dd6c45afa 100644
--- a/libavcodec/x86/hpeldsp_vp3_init.c
+++ b/libavcodec/x86/hpeldsp_vp3_init.c
@@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block,
 
 av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
             c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext;
             c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c
index 239d3ca313..445137da87 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *top, co
 
 av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->add_int16 = ff_add_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c
index c9c33b75b4..35d18a040c 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, c
 
 av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     av_unused int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -51,4 +52,5 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 4ade52a880..3f74da85cd 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
 av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_32
@@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/jpeg2000dsp_init.c b/libavcodec/x86/jpeg2000dsp_init.c
index 7310a1d0e1..0256be8046 100644
--- a/libavcodec/x86/jpeg2000dsp_init.c
+++ b/libavcodec/x86/jpeg2000dsp_init.c
@@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize);
 
 av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE(cpu_flags)) {
         c->mct_decode[FF_DWT97] = ff_ict_float_sse;
@@ -57,4 +58,5 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c
index 5690cacaad..720cf98389 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->add_bytes       = ff_add_bytes_sse2;
         c->add_median_pred = ff_add_median_pred_sse2;
@@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
         c->add_left_pred   = ff_add_left_pred_unaligned_avx2;
         c->add_gradient_pred = ff_add_gradient_pred_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videoencdsp_init.c b/libavcodec/x86/lossless_videoencdsp_init.c
index 22a4014ef1..26cfcbb4b2 100644
--- a/libavcodec/x86/lossless_videoencdsp_init.c
+++ b/libavcodec/x86/lossless_videoencdsp_init.c
@@ -91,6 +91,7 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     }
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_sse2;
     }
@@ -102,4 +103,5 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c
index ea7301e1e7..25653013a5 100644
--- a/libavcodec/x86/mdct15_init.c
+++ b/libavcodec/x86/mdct15_init.c
@@ -84,6 +84,7 @@ static void perm_twiddles(MDCT15Context *s)
 av_cold void ff_mdct15_init_x86(MDCT15Context *s)
 {
     int adjust_twiddles = 0;
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags))
@@ -98,6 +99,7 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s)
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         s->postreindex = ff_mdct15_postreindex_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 
     if (adjust_twiddles)
         perm_twiddles(s);
diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c
index bc1051c27e..527fdff4a9 100644
--- a/libavcodec/x86/me_cmp_init.c
+++ b/libavcodec/x86/me_cmp_init.c
@@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
 
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMX(cpu_flags)) {
         c->sse[1]            = ff_sse8_mmx;
 #if HAVE_X86ASM
@@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
         c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 333a685f47..4843e1abdb 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,7 +200,7 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
     if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c
index ec174b15aa..82f9df4cba 100644
--- a/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/libavcodec/x86/mpegvideoencdsp_init.c
@@ -216,6 +216,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_sse2;
         c->pix_norm1   = ff_pix_norm1_sse2;
@@ -224,6 +225,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
     if (EXTERNAL_XOP(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_xop;
     }
+#endif /* HAVE_X86ASM */
 
 #if HAVE_INLINE_ASM
 
diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c
index 582fbb4f0c..4598657116 100644
--- a/libavcodec/x86/opusdsp_init.c
+++ b/libavcodec/x86/opusdsp_init.c
@@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len);
 
 av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_FMA3(cpu_flags)) {
         ctx->postfilter = ff_opus_postfilter_fma3;
         ctx->deemphasis = ff_opus_deemphasis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c
index 51f2a0033a..9d3aac4c74 100644
--- a/libavcodec/x86/pixblockdsp_init.c
+++ b/libavcodec/x86/pixblockdsp_init.c
@@ -31,6 +31,7 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
                                      AVCodecContext *avctx,
                                      unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
         c->diff_pixels_unaligned =
         c->diff_pixels = ff_diff_pixels_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c
index e2cd5effe3..c6562f7abb 100644
--- a/libavcodec/x86/pngdsp_init.c
+++ b/libavcodec/x86/pngdsp_init.c
@@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
 
 av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
         dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
     if (EXTERNAL_SSSE3(cpu_flags))
         dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c
index bde79ab8c0..01e5e67236 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize,
 
 av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
 {
+#if HAVE_X86ASM
 #if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
@@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
         }
     }
 #endif /* ARCH_X86_64 */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index caa5c2d653..f76bef39e1 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
 
 av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags)) {
@@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2;
     if (EXTERNAL_SSE4(cpu_flags))
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c
index 7416a86ac6..79914cc565 100644
--- a/libavcodec/x86/sbcdsp_init.c
+++ b/libavcodec/x86/sbcdsp_init.c
@@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8],
 
 av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
         s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
         s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 999f681220..d70ffa0d6c 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2], float phi[3][2][2]);
 
 av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
     if (EXTERNAL_SSE3(cpu_flags)) {
         s->autocorrelate = ff_sbr_autocorrelate_sse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c
index daf573beba..c016811822 100644
--- a/libavcodec/x86/svq1enc_init.c
+++ b/libavcodec/x86/svq1enc_init.c
@@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2,
 
 av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index 2b436c6c5c..e81f6bf3c0 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r, uint16_t *src_g, uint16_t *sr
 
 av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
         c->restore_rgb_planes   = ff_restore_rgb_planes_avx2;
         c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index 13a351dd1d..542bfe8b8a 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -36,6 +36,7 @@ void ff_v210_planar_pack_10_avx2(const uint16_t *y, const uint16_t *u,
 
 av_cold void ff_v210enc_init_x86(V210EncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSSE3(cpu_flags)) {
@@ -52,4 +53,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
         s->sample_factor_10 = 2;
         s->pack_line_10     = ff_v210_planar_pack_10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 65fc28ea35..ea6c0fa0fe 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS && HAVE_INLINE_ASM
+#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_X86ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
diff --git a/libavcodec/x86/vorbisdsp_init.c b/libavcodec/x86/vorbisdsp_init.c
index 08a3bb2965..067b92e2a4 100644
--- a/libavcodec/x86/vorbisdsp_init.c
+++ b/libavcodec/x86/vorbisdsp_init.c
@@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang,
 
 av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
         dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index f54fa57b3e..7d69956d22 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a,
 
 av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
         c->idct_put  = ff_vp3_idct_put_sse2;
         c->idct_add  = ff_vp3_idct_add_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c
index 83d45ec36c..6a3bf36bae 100644
--- a/libavcodec/x86/vp6dsp_init.c
+++ b/libavcodec/x86/vp6dsp_init.c
@@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
 
 av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c
index e53817b9c0..3561d9fe3f 100644
--- a/libavfilter/x86/af_afir_init.c
+++ b/libavfilter/x86/af_afir_init.c
@@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t, const float *c,
 
 av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags)) {
@@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
     if (EXTERNAL_AVX_FAST(cpu_flags)) {
         s->fcmul_add = ff_fcmul_add_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_anlmdn_init.c b/libavfilter/x86/af_anlmdn_init.c
index 30eff6f644..047d88b795 100644
--- a/libavfilter/x86/af_anlmdn_init.c
+++ b/libavfilter/x86/af_anlmdn_init.c
@@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1, const float *f2,
 
 av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
         s->compute_distance_ssd = ff_compute_distance_ssd_sse;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_volume_init.c b/libavfilter/x86/af_volume_init.c
index 88f5a9679a..28cfbe1ce1 100644
--- a/libavfilter/x86/af_volume_init.c
+++ b/libavfilter/x86/af_volume_init.c
@@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len,
 
 av_cold void ff_volume_init_x86(VolumeContext *vol)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);
 
@@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol)
             vol->samples_align = 8;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/avf_showcqt_init.c b/libavfilter/x86/avf_showcqt_init.c
index 2320b30239..1a5534a12e 100644
--- a/libavfilter/x86/avf_showcqt_init.c
+++ b/libavfilter/x86/avf_showcqt_init.c
@@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len)
 
 av_cold void ff_showcqt_init_x86(ShowCQTContext *s)
 {
+#if HAVE_X86ASM
     int cpuflags = av_get_cpu_flags();
 
 #define SELECT_CQT_CALC(type, TYPE, align, perm) \
@@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \
     SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm
     SELECT_CQT_CALC(avx,  AVX_FAST,  8, 01452367);
     SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367);
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index f01db4baf4..66c25cb361 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h,
 
 void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index eb621e172c..8ec98f1a82 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst,
 
 av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
@@ -49,4 +50,5 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
         }
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_blend_init.c b/libavfilter/x86/vf_blend_init.c
index c326c43362..6d57bf7eac 100644
--- a/libavfilter/x86/vf_blend_init.c
+++ b/libavfilter/x86/vf_blend_init.c
@@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2)
 
 av_cold void ff_blend_init_x86(FilterParams *param, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (depth == 8) {
@@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param, int depth)
         }
 #endif /* ARCH_X86_64 */
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c
index e24e5cd9b1..ec0ee6af85 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -44,6 +44,7 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne
 
 av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
 {
+#if HAVE_X86ASM
     YADIFContext *yadif = &bwdif->yadif;
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth;
@@ -59,4 +60,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
         if (EXTERNAL_SSSE3(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c
index b78a47d02b..105c223366 100644
--- a/libavfilter/x86/vf_convolution_init.c
+++ b/libavfilter/x86/vf_convolution_init.c
@@ -31,7 +31,7 @@ void ff_filter_3x3_sse4(uint8_t *dst, int width,
 
 av_cold void ff_convolution_init_x86(ConvolutionContext *s)
 {
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     int i;
     int cpu_flags = av_get_cpu_flags();
     for (i = 0; i < 4; i++) {
diff --git a/libavfilter/x86/vf_framerate_init.c b/libavfilter/x86/vf_framerate_init.c
index 9d40faf0a4..b4a9dc574d 100644
--- a/libavfilter/x86/vf_framerate_init.c
+++ b/libavfilter/x86/vf_framerate_init.c
@@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS);
 
 void ff_framerate_init_x86(FrameRateContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (s->bitdepth == 8) {
         if (EXTERNAL_AVX2_FAST(cpu_flags))
@@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s)
         else if (EXTERNAL_SSE4(cpu_flags))
             s->blend = ff_blend_frames16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c
index 8e00317cb7..3618b70dc3 100644
--- a/libavfilter/x86/vf_fspp_init.c
+++ b/libavfilter/x86/vf_fspp_init.c
@@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t *pixels, ptrdiff_t line_size,
 
 av_cold void ff_fspp_init_x86(FSPPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s)
         s->row_idct     = ff_row_idct_mmx;
         s->row_fdct     = ff_row_fdct_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_gblur_init.c b/libavfilter/x86/vf_gblur_init.c
index b47f6fbffb..01e1b82131 100644
--- a/libavfilter/x86/vf_gblur_init.c
+++ b/libavfilter/x86/vf_gblur_init.c
@@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begi
 
 av_cold void ff_gblur_init_x86(GBlurContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s)
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_hflip_init.c b/libavfilter/x86/vf_hflip_init.c
index 0ac399b0d4..743b368ee9 100644
--- a/libavfilter/x86/vf_hflip_init.c
+++ b/libavfilter/x86/vf_hflip_init.c
@@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t *dst, int w);
 
 av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int i;
 
@@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_limiter_init.c b/libavfilter/x86/vf_limiter_init.c
index 07c733dc21..2c26f90f0f 100644
--- a/libavfilter/x86/vf_limiter_init.c
+++ b/libavfilter/x86/vf_limiter_init.c
@@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t *dst,
 
 void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
             dsp->limiter = ff_limiter_16bit_sse4;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedclamp_init.c b/libavfilter/x86/vf_maskedclamp_init.c
index 2a5388abac..94217cf485 100644
--- a/libavfilter/x86/vf_maskedclamp_init.c
+++ b/libavfilter/x86/vf_maskedclamp_init.c
@@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc, uint8_t *dst,
 
 av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -43,4 +44,5 @@ av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
     if (EXTERNAL_SSE4(cpu_flags) && depth > 8) {
         dsp->maskedclamp = ff_maskedclamp16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedmerge_init.c b/libavfilter/x86/vf_maskedmerge_init.c
index 73ab888083..2eee4a36c2 100644
--- a/libavfilter/x86/vf_maskedmerge_init.c
+++ b/libavfilter/x86/vf_maskedmerge_init.c
@@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const uint8_t *osrc,
 
 av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) {
         s->maskedmerge = ff_maskedmerge8_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_overlay_init.c b/libavfilter/x86/vf_overlay_init.c
index d4218b18f6..9f7d9c4909 100644
--- a/libavfilter/x86/vf_overlay_init.c
+++ b/libavfilter/x86/vf_overlay_init.c
@@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a,
 av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
                                  int alpha_format, int main_has_alpha)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags) &&
@@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
         s->blend_row[1] = ff_overlay_row_22_sse4;
         s->blend_row[2] = ff_overlay_row_22_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c
index 165b0dd5d0..ed5ab82794 100644
--- a/libavfilter/x86/vf_pp7_init.c
+++ b/libavfilter/x86/vf_pp7_init.c
@@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src);
 
 av_cold void ff_pp7_init_x86(PP7Context *p)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags))
         p->dctB = ff_pp7_dctB_mmx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c
index c387812204..82be86d923 100644
--- a/libavfilter/x86/vf_psnr_init.c
+++ b/libavfilter/x86/vf_psnr_init.c
@@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w);
 
 void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
             dsp->sse_line = ff_sse_line_16bit_sse2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_removegrain_init.c b/libavfilter/x86/vf_removegrain_init.c
index 07314b3244..ff5f4771d2 100644
--- a/libavfilter/x86/vf_removegrain_init.c
+++ b/libavfilter/x86/vf_removegrain_init.c
@@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pix
 
 av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
 {
+#if HAVE_X86ASM
 #if CONFIG_GPL
     int cpu_flags = av_get_cpu_flags();
     int i;
@@ -85,4 +86,5 @@ av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
             }
     }
 #endif /* CONFIG_GPL */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index 6f2305430c..ef39247056 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w);
 
 void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_xop;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_stereo3d_init.c b/libavfilter/x86/vf_stereo3d_init.c
index da160a89a0..abd682ee80 100644
--- a/libavfilter/x86/vf_stereo3d_init.c
+++ b/libavfilter/x86/vf_stereo3d_init.c
@@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc,
 
 void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags)) {
         dsp->anaglyph = ff_anaglyph_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_threshold_init.c b/libavfilter/x86/vf_threshold_init.c
index 8e42296791..151a94f429 100644
--- a/libavfilter/x86/vf_threshold_init.c
+++ b/libavfilter/x86/vf_threshold_init.c
@@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2)
 
 av_cold void ff_threshold_init_x86(ThresholdContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->depth == 8) {
@@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s)
             s->threshold = ff_threshold16_avx2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c
index 1c25a2bb7a..c30a3247a2 100644
--- a/libavfilter/x86/vf_tinterlace_init.c
+++ b/libavfilter/x86/vf_tinterlace_init.c
@@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize,
 
 av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->csp->comp[0].depth > 8) {
@@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_transpose_init.c b/libavfilter/x86/vf_transpose_init.c
index 95c56eab73..7db2e66258 100644
--- a/libavfilter/x86/vf_transpose_init.c
+++ b/libavfilter/x86/vf_transpose_init.c
@@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src,
 
 av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) {
@@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) {
         v->transpose_8x8 = ff_transpose_8x8_16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c
index 2b2b06dd40..6b1b3811aa 100644
--- a/libavfilter/x86/vf_v360_init.c
+++ b/libavfilter/x86/vf_v360_init.c
@@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int width, const uint8_t *src, ptrd
 
 av_cold void ff_v360_init_x86(V360Context *s, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth <= 8)
@@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth)
                                           s->interp == MITCHELL) && depth <= 8)
         s->remap_line = ff_remap4_8bit_line_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 6d677d651d..d023ef7a49 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const int32_t *work_pixel,
 
 av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c
index 257c3f9199..54917fa104 100644
--- a/libavfilter/x86/vf_yadif_init.c
+++ b/libavfilter/x86/vf_yadif_init.c
@@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
 
 av_cold void ff_yadif_init_x86(YADIFContext *yadif)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8
                                   : yadif->csp->comp[0].depth;
@@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
         if (EXTERNAL_SSSE3(cpu_flags))
             yadif->filter_line = ff_yadif_filter_line_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c
index d3f4b2e325..eb84027dbf 100644
--- a/libavutil/x86/fixed_dsp_init.c
+++ b/libavutil/x86/fixed_dsp_init.c
@@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int
 
 av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         fdsp->butterflies_fixed = ff_butterflies_fixed_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c
index ad6b506259..7495c0b9a8 100644
--- a/libavutil/x86/float_dsp_init.c
+++ b/libavutil/x86/float_dsp_init.c
@@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1,
 
 av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3;
         fdsp->scalarproduct_float = ff_scalarproduct_float_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c
index 91a16cf594..feac5d6fc7 100644
--- a/libavutil/x86/imgutils_init.c
+++ b/libavutil/x86/imgutils_init.c
@@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
                                     const uint8_t *src, ptrdiff_t src_linesize,
                                     ptrdiff_t bytewidth, int height)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64);
 
@@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
         ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src, src_linesize,
                                          bw_aligned, height);
     else
+#endif /* HAVE_X86ASM */
         return AVERROR(ENOSYS);
 
     return 0;
diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c
index c786376915..67470185da 100644
--- a/libavutil/x86/lls_init.c
+++ b/libavutil/x86/lls_init.c
@@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double *var, int order);
 
 av_cold void ff_init_lls_x86(LLSModel *m)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE2(cpu_flags)) {
         m->update_lls = ff_update_lls_sse2;
@@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m)
     if (EXTERNAL_FMA3_FAST(cpu_flags)) {
         m->update_lls = ff_update_lls_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c
index c3c0662414..a2f842041d 100644
--- a/libavutil/x86/pixelutils_init.c
+++ b/libavutil/x86/pixelutils_init.c
@@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t *src1, ptrdiff_t stride1,
 
 void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     // The best way to use SSE2 would be to do 2 SADs in parallel,
@@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
         case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1   aligned, src2   aligned
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c
index f6d36f9ca6..d9eb43e1d5 100644
--- a/libswresample/x86/audio_convert_init.c
+++ b/libswresample/x86/audio_convert_init.c
@@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
             ac->simd_f =  ff_int32_to_int16_a_ ## cap;\
     }
 
+#if HAVE_X86ASM
 MULTI_CAPS_FUNC(SSE2, sse2)
 
     if(EXTERNAL_SSE(mm_flags)) {
@@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2)
         if(   out_fmt == AV_SAMPLE_FMT_S32  && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP)
             ac->simd_f =  ff_float_to_int32_a_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/resample_init.c b/libswresample/x86/resample_init.c
index d13ccd4833..4eebf5d6f9 100644
--- a/libswresample/x86/resample_init.c
+++ b/libswresample/x86/resample_init.c
@@ -51,6 +51,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
 
     switch(c->format){
     case AV_SAMPLE_FMT_S16P:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_int16_sse2;
             c->dsp.resample_common = ff_resample_common_int16_sse2;
@@ -59,8 +60,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_int16_xop;
             c->dsp.resample_common = ff_resample_common_int16_xop;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_FLTP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_float_sse;
             c->dsp.resample_common = ff_resample_common_float_sse;
@@ -77,8 +80,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_float_fma4;
             c->dsp.resample_common = ff_resample_common_float_fma4;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_DBLP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_double_sse2;
             c->dsp.resample_common = ff_resample_common_double_sse2;
@@ -91,6 +96,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_double_fma3;
             c->dsp.resample_common = ff_resample_common_double_fma3;
         }
+#endif /* HAVE_X86ASM */
         break;
     }
 }
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index b325e5dbd5..e39f327bf2 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void)
         rgb2rgb_init_avx();
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext;
     }
@@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void)
         uyvytoyuv422 = ff_uyvytoyuv422_avx;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..0a14262916 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -529,6 +529,7 @@ switch(c->dstBpc){ \
              else                ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
              break; \
     }
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
         ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
@@ -805,4 +806,5 @@ switch(c->dstBpc){ \
     }
 
 #endif
+#endif /* HAVE_X86ASM */
 }
-- 
2.38.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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
@ 2022-11-03 15:55   ` Lynne
  2022-11-14  9:01     ` L. E. Segovia
  0 siblings, 1 reply; 54+ messages in thread
From: Lynne @ 2022-11-03 15:55 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Nov 3, 2022, 16:30 by amy@amyspark.me:

> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
>
> Signed-off-by: L. E. Segovia <> amy@amyspark.me> >
>

Wrong way to fix it. Makefile to prevent compilation + ifdef guards
on all arch-specific init function calls.

_______________________________________________
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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
                   ` (10 preceding siblings ...)
  2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
@ 2022-11-03 16:36 ` L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
                     ` (7 more replies)
  11 siblings, 8 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 16:36 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Hi all,

This new version is intended to make Patchwork log the set correctly.
(My apologies there, I'm not used to send patches through the command line.)

v3 changes (same as v2):

- Split indentation fixes for hevcdsp_init into its own commit
- Fixed spurious indentation in vf_ssim_init
- Implemented the macro approach for expanding the CONFIG_FOO checks in fftools
- Added the missing HAVE_X86ASM check in vc1dsp_init
- Added a missing HAVE_INLINE_ASM check in hpeldsp_init (see below)
- Fixed the HAVE_X86ASM check wrongly covering the INLINE_FOO clause in hpeldsp_init
- Removed the duplicate HAVE_X86ASM check in me_cmp_init
- Inlined the HAVE_X86ASM and ARCH_X86_64 checks in mlpdsp_init and vf_convolution_init 

L. E. Segovia (5):
  all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
  all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM

 fftools/ffprobe.c                          |  16 +-
 fftools/opt_common.c                       |  12 +-
 libavcodec/x86/aacencdsp_init.c            |   2 +
 libavcodec/x86/aacpsdsp_init.c             |   2 +
 libavcodec/x86/ac3dsp_init.c               |   4 +
 libavcodec/x86/audiodsp_init.c             |   2 +
 libavcodec/x86/bswapdsp_init.c             |   2 +
 libavcodec/x86/cavsdsp.c                   |   2 +
 libavcodec/x86/celt_pvq_init.c             |   2 +
 libavcodec/x86/cfhddsp_init.c              |   2 +
 libavcodec/x86/cfhdencdsp_init.c           |   2 +
 libavcodec/x86/dcadsp_init.c               |   2 +
 libavcodec/x86/dct_init.c                  |   2 +
 libavcodec/x86/dnxhdenc_init.c             |   2 +
 libavcodec/x86/exrdsp_init.c               |   2 +
 libavcodec/x86/fdctdsp_init.c              |   2 +
 libavcodec/x86/fft_init.c                  |   2 +
 libavcodec/x86/flacdsp_init.c              |   8 +-
 libavcodec/x86/g722dsp_init.c              |   2 +
 libavcodec/x86/h263dsp_init.c              |   2 +
 libavcodec/x86/h264_intrapred_init.c       |   2 +
 libavcodec/x86/h264chroma_init.c           |   2 +
 libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
 libavcodec/x86/hpeldsp_init.c              |   4 +
 libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
 libavcodec/x86/huffyuvdsp_init.c           |   2 +
 libavcodec/x86/huffyuvencdsp_init.c        |   2 +
 libavcodec/x86/idctdsp_init.c              |  11 +-
 libavcodec/x86/jpeg2000dsp_init.c          |   2 +
 libavcodec/x86/lossless_videodsp_init.c    |   2 +
 libavcodec/x86/lossless_videoencdsp_init.c |   2 +
 libavcodec/x86/mdct15_init.c               |   2 +
 libavcodec/x86/me_cmp_init.c               |   2 +
 libavcodec/x86/mlpdsp_init.c               |   6 +-
 libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
 libavcodec/x86/opusdsp_init.c              |   2 +
 libavcodec/x86/pixblockdsp_init.c          |   2 +
 libavcodec/x86/pngdsp_init.c               |   2 +
 libavcodec/x86/proresdsp_init.c            |   2 +
 libavcodec/x86/rv34dsp_init.c              |   2 +
 libavcodec/x86/sbcdsp_init.c               |   2 +
 libavcodec/x86/sbrdsp_init.c               |   2 +
 libavcodec/x86/svq1enc_init.c              |   2 +
 libavcodec/x86/utvideodsp_init.c           |   2 +
 libavcodec/x86/v210enc_init.c              |   2 +
 libavcodec/x86/vc1dsp_init.c               |   6 +-
 libavcodec/x86/vorbisdsp_init.c            |   2 +
 libavcodec/x86/vp3dsp_init.c               |   2 +
 libavcodec/x86/vp6dsp_init.c               |   2 +
 libavfilter/x86/af_afir_init.c             |   2 +
 libavfilter/x86/af_anlmdn_init.c           |   2 +
 libavfilter/x86/af_volume_init.c           |   2 +
 libavfilter/x86/avf_showcqt_init.c         |   2 +
 libavfilter/x86/colorspacedsp_init.c       |   6 +-
 libavfilter/x86/vf_atadenoise_init.c       |   8 +-
 libavfilter/x86/vf_blend_init.c            |   2 +
 libavfilter/x86/vf_bwdif_init.c            |   2 +
 libavfilter/x86/vf_convolution_init.c      |   2 +-
 libavfilter/x86/vf_framerate_init.c        |   2 +
 libavfilter/x86/vf_fspp_init.c             |   2 +
 libavfilter/x86/vf_gblur_init.c            |   2 +
 libavfilter/x86/vf_hflip_init.c            |   2 +
 libavfilter/x86/vf_limiter_init.c          |   2 +
 libavfilter/x86/vf_maskedclamp_init.c      |   2 +
 libavfilter/x86/vf_maskedmerge_init.c      |   2 +
 libavfilter/x86/vf_overlay_init.c          |   2 +
 libavfilter/x86/vf_pp7_init.c              |   2 +
 libavfilter/x86/vf_psnr_init.c             |   2 +
 libavfilter/x86/vf_removegrain_init.c      |   2 +
 libavfilter/x86/vf_ssim_init.c             |   6 +-
 libavfilter/x86/vf_stereo3d_init.c         |   2 +
 libavfilter/x86/vf_threshold_init.c        |   2 +
 libavfilter/x86/vf_tinterlace_init.c       |   2 +
 libavfilter/x86/vf_transpose_init.c        |   2 +
 libavfilter/x86/vf_v360_init.c             |   2 +
 libavfilter/x86/vf_w3fdif_init.c           |   6 +-
 libavfilter/x86/vf_yadif_init.c            |   2 +
 libavformat/rtmpproto.c                    |  24 +-
 libavutil/x86/fixed_dsp_init.c             |   2 +
 libavutil/x86/float_dsp_init.c             |   2 +
 libavutil/x86/imgutils_init.c              |   2 +
 libavutil/x86/lls_init.c                   |   2 +
 libavutil/x86/pixelutils_init.c            |   2 +
 libswresample/x86/audio_convert_init.c     |   2 +
 libswresample/x86/resample_init.c          |   6 +
 libswscale/x86/rgb2rgb.c                   |   2 +
 libswscale/x86/swscale.c                   |   2 +
 87 files changed, 517 insertions(+), 299 deletions(-)

-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v3 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
@ 2022-11-03 16:36   ` L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 16:36 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/fdctdsp_init.c        |  2 ++
 libavcodec/x86/flacdsp_init.c        |  8 +++--
 libavcodec/x86/hevcdsp_init.c        | 53 +++++++++++++++-------------
 libavcodec/x86/idctdsp_init.c        |  9 +++--
 libavcodec/x86/mlpdsp_init.c         |  6 ++--
 libavcodec/x86/vc1dsp_init.c         |  6 ++--
 libavfilter/x86/colorspacedsp_init.c |  4 ++-
 libavfilter/x86/vf_atadenoise_init.c |  6 ++--
 libavfilter/x86/vf_ssim_init.c       |  4 ++-
 libavfilter/x86/vf_w3fdif_init.c     |  4 ++-
 10 files changed, 64 insertions(+), 38 deletions(-)

diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
index 92a842433d..4a874a640d 100644
--- a/libavcodec/x86/fdctdsp_init.c
+++ b/libavcodec/x86/fdctdsp_init.c
@@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
 
     if (!high_bit_depth) {
         if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+#if HAVE_INLINE_SSE2
             if (INLINE_SSE2(cpu_flags))
                 c->fdct = ff_fdct_sse2;
+#endif
         }
     }
 }
diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
index 87daed7005..49e67ee2b0 100644
--- a/libavcodec/x86/flacdsp_init.c
+++ b/libavcodec/x86/flacdsp_init.c
@@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
     }
     if (EXTERNAL_AVX(cpu_flags)) {
         if (fmt == AV_SAMPLE_FMT_S16) {
-            if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
+#endif
         } else if (fmt == AV_SAMPLE_FMT_S32) {
             if (channels == 4)
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
+#endif
         }
     }
     if (EXTERNAL_XOP(cpu_flags)) {
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 6f45e5e0db..40a295430d 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 
                 c->idct[2] = ff_hevc_idct_16x16_8_sse2;
                 c->idct[3] = ff_hevc_idct_32x32_8_sse2;
-            }
+#endif
             SAO_BAND_INIT(8, sse2);
 
             c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
@@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
-            if(ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
-            }
+#endif
             SAO_EDGE_INIT(8, ssse3);
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
-
+#if ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
@@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 
                 c->idct[2] = ff_hevc_idct_16x16_8_avx;
                 c->idct[3] = ff_hevc_idct_32x32_8_avx;
-            }
+#endif
             SAO_BAND_INIT(8, avx);
 
             c->idct[0] = ff_hevc_idct_4x4_8_avx;
@@ -775,7 +776,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
                 c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
                 c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
@@ -859,7 +860,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
                 c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
                 c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
-            }
+#endif
             SAO_BAND_INIT(8, avx2);
 
             c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
@@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
 
                 c->idct[2] = ff_hevc_idct_16x16_10_sse2;
                 c->idct[3] = ff_hevc_idct_32x32_10_sse2;
-            }
+#endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
 
@@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
             c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
@@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 
                 c->idct[2] = ff_hevc_idct_16x16_10_avx;
                 c->idct[3] = ff_hevc_idct_32x32_10_avx;
-            }
+#endif
 
             c->idct[0] = ff_hevc_idct_4x4_10_avx;
             c->idct[1] = ff_hevc_idct_8x8_10_avx;
@@ -942,7 +945,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
                 c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
                 c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
@@ -1085,7 +1088,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
                 c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
                 c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
                 c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
-            }
+#endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
 
@@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
-            }
+#endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
 
@@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
@@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
-            if (ARCH_X86_64) {
+#if ARCH_X86_64
                 c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
                 c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
-            }
+#endif
             SAO_BAND_INIT(12, avx);
         }
         if (EXTERNAL_AVX2(cpu_flags)) {
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index f28a1ad744..4ade52a880 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
 #endif
 
-        if (ARCH_X86_64 &&
-            !high_bit_depth &&
+#if ARCH_X86_64
+        if (!high_bit_depth &&
             avctx->lowres == 0 &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
                 avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
@@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                 c->idct_add  = ff_simple_idct8_add_sse2;
                 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
         }
+#endif
     }
 
-    if (ARCH_X86_64 && avctx->lowres == 0) {
+#if ARCH_X86_64
+    if (avctx->lowres == 0) {
         if (EXTERNAL_AVX(cpu_flags) &&
             !high_bit_depth &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
@@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
             }
         }
     }
+#endif
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 950f996832..333a685f47 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
-    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
+    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
+#endif
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 90b2f3624e..bc63933e83 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
+#if HAVE_6REGS
+    if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
 
-    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
+    if (INLINE_MMXEXT(cpu_flags))
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
+#endif
 
 #define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index b5006ac295..f01db4baf4 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags)) {
 #define assign_yuv2yuv_fns(ss) \
         dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \
         dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \
@@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
+#endif
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index e7a653f191..eb621e172c 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
+#if ARCH_X86_64 
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
         }
 
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
         }
+#endif
     }
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index cbaa20ef16..6f2305430c 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSSE3(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+#endif
     if (EXTERNAL_SSE4(cpu_flags))
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 16202fba76..6d677d651d 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_scale        = ff_w3fdif_scale_sse2;
     }
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
+#endif
 }
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v3 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2022-11-03 16:36   ` L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 16:36 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

---
 libavcodec/x86/hevcdsp_init.c | 454 +++++++++++++++++-----------------
 1 file changed, 227 insertions(+), 227 deletions(-)

diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 40a295430d..c7060085a2 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -711,11 +711,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
+            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
 #endif
             SAO_BAND_INIT(8, sse2);
 
@@ -732,8 +732,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
 #endif
             SAO_EDGE_INIT(8, ssse3);
         }
@@ -754,11 +754,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_avx;
-                c->idct[3] = ff_hevc_idct_32x32_8_avx;
+            c->idct[2] = ff_hevc_idct_16x16_8_avx;
+            c->idct[3] = ff_hevc_idct_32x32_8_avx;
 #endif
             SAO_BAND_INIT(8, avx);
 
@@ -777,89 +777,89 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
 #if ARCH_X86_64
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
 
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
 
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
 
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
 
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
 
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
 
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
 
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
 
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
 #endif
             SAO_BAND_INIT(8, avx2);
 
@@ -886,11 +886,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
+            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
 #endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
@@ -927,11 +927,11 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_avx;
-                c->idct[3] = ff_hevc_idct_32x32_10_avx;
+            c->idct[2] = ff_hevc_idct_16x16_10_avx;
+            c->idct[3] = ff_hevc_idct_32x32_10_avx;
 #endif
 
             c->idct[0] = ff_hevc_idct_4x4_10_avx;
@@ -946,148 +946,148 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
 #if ARCH_X86_64
-                c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
-                c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
-                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
-
-                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
-                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
-
-                c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
-                c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
-                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
-                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
-
-                c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
-                c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
-                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
-                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
-
-                c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
-                c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
-                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
-                c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
-                c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
-                c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
-                c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
-                c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
+            c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
+            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
+            c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
+
+            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
+            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
+
+            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
+            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
+            c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
+            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
+
+            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
+            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
+            c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
+            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
+
+            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
+            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
+            c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
+            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
+            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
+            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
+            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
+            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
 #endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
@@ -1103,8 +1103,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
 #endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
@@ -1134,8 +1134,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
 #if ARCH_X86_64
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
 #endif
             SAO_BAND_INIT(12, avx);
         }
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v3 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia
@ 2022-11-03 16:36   ` L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 16:36 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 fftools/ffprobe.c       | 16 +++++++++++-----
 fftools/opt_common.c    | 12 ++++++++++--
 libavformat/rtmpproto.c | 24 ++++++++++++++++++------
 3 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 9b7e82fd8c..b878e258ca 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3518,9 +3518,9 @@ static void ffprobe_show_program_version(WriterContext *w)
     av_bprint_finalize(&pbuf, NULL);
 }
 
-#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
-    do {                                                                \
-        if (CONFIG_##LIBNAME) {                                         \
+#define SHOW_LIB_VERSION_0(libname, LIBNAME)
+#define SHOW_LIB_VERSION_1(libname, LIBNAME)                            \
+        {                                                               \
             unsigned int version = libname##_version();                 \
             writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
             print_str("name",    "lib" #libname);                       \
@@ -3530,8 +3530,14 @@ static void ffprobe_show_program_version(WriterContext *w)
             print_int("version", version);                              \
             print_str("ident",   LIB##LIBNAME##_IDENT);                 \
             writer_print_section_footer(w);                             \
-        }                                                               \
-    } while (0)
+        }
+
+#define SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_ ## cfg(libname, LIBNAME)
+#define SHOW_LIB_VERSION_3(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)
+#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
+    SHOW_LIB_VERSION_3(CONFIG_ ## LIBNAME, libname, LIBNAME)
 
 static void ffprobe_show_library_versions(WriterContext *w)
 {
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 8a06df82df..f901dba806 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -153,8 +153,9 @@ static int warned_cfg = 0;
 #define SHOW_CONFIG   4
 #define SHOW_COPYRIGHT 8
 
-#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
-    if (CONFIG_##LIBNAME) {                                             \
+#define PRINT_LIB_INFO_0(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_1(libname, LIBNAME, flags, level)                \
+    {                                                                   \
         const char *indent = flags & INDENT? "  " : "";                 \
         if (flags & SHOW_VERSION) {                                     \
             unsigned int version = libname##_version();                 \
@@ -182,6 +183,13 @@ static int warned_cfg = 0;
         }                                                               \
     }                                                                   \
 
+#define PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_ ## cfg(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_3(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
+    PRINT_LIB_INFO_3(CONFIG_ ## LIBNAME, libname, LIBNAME, flags, level)
+
 static void print_all_libs_info(int flags, int level)
 {
     PRINT_LIB_INFO(avutil,     AVUTIL,     flags, level);
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f0ef223f05..6d84fcf34f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
     for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
         tosend[i] = av_lfg_get(&rnd) >> 24;
 
-    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+    if (rt->encrypted) {
         /* When the client wants to use RTMPE, we have to change the command
          * byte to 0x06 which means to use encrypted data and we have to set
          * the flash version to at least 9.0.115.0. */
@@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
             return ret;
     }
+#endif
 
     client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
     if (client_pos < 0)
@@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
             /* Encrypt the signature received by the server. */
             ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]);
         }
+#endif
 
         if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
             av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
@@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Encrypt the signature to be send to the server. */
             ff_rtmpe_encrypt_sig(rt->stream, tosend +
                                  RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
                                  serverdata[0]);
         }
+#endif
 
         // write reply back to the server
         if ((ret = ffurl_write(rt->stream, tosend,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     } else {
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
                                      serverdata[0]);
             }
         }
+#endif
 
         if ((ret = ffurl_write(rt->stream, serverdata + 1,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     }
 
     return 0;
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v3 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
                     ` (2 preceding siblings ...)
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
@ 2022-11-03 16:36   ` L. E. Segovia
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 16:36 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/hpeldsp_init.c | 2 ++
 libavcodec/x86/vc1dsp_init.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 09c48c341e..6bde5a3893 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -224,8 +224,10 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         hpeldsp_init_mmx(c, flags);
+#endif
 
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index bc63933e83..65fc28ea35 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS
+#if HAVE_6REGS && HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
-- 
2.38.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v3 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
                     ` (3 preceding siblings ...)
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
@ 2022-11-03 16:36   ` L. E. Segovia
  2022-11-07 14:48   ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-03 16:36 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/aacencdsp_init.c            | 2 ++
 libavcodec/x86/aacpsdsp_init.c             | 2 ++
 libavcodec/x86/ac3dsp_init.c               | 4 ++++
 libavcodec/x86/audiodsp_init.c             | 2 ++
 libavcodec/x86/bswapdsp_init.c             | 2 ++
 libavcodec/x86/cavsdsp.c                   | 2 ++
 libavcodec/x86/celt_pvq_init.c             | 2 ++
 libavcodec/x86/cfhddsp_init.c              | 2 ++
 libavcodec/x86/cfhdencdsp_init.c           | 2 ++
 libavcodec/x86/dcadsp_init.c               | 2 ++
 libavcodec/x86/dct_init.c                  | 2 ++
 libavcodec/x86/dnxhdenc_init.c             | 2 ++
 libavcodec/x86/exrdsp_init.c               | 2 ++
 libavcodec/x86/fft_init.c                  | 2 ++
 libavcodec/x86/g722dsp_init.c              | 2 ++
 libavcodec/x86/h263dsp_init.c              | 2 ++
 libavcodec/x86/h264_intrapred_init.c       | 2 ++
 libavcodec/x86/h264chroma_init.c           | 2 ++
 libavcodec/x86/hevcdsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_vp3_init.c          | 2 ++
 libavcodec/x86/huffyuvdsp_init.c           | 2 ++
 libavcodec/x86/huffyuvencdsp_init.c        | 2 ++
 libavcodec/x86/idctdsp_init.c              | 2 ++
 libavcodec/x86/jpeg2000dsp_init.c          | 2 ++
 libavcodec/x86/lossless_videodsp_init.c    | 2 ++
 libavcodec/x86/lossless_videoencdsp_init.c | 2 ++
 libavcodec/x86/mdct15_init.c               | 2 ++
 libavcodec/x86/me_cmp_init.c               | 2 ++
 libavcodec/x86/mlpdsp_init.c               | 2 +-
 libavcodec/x86/mpegvideoencdsp_init.c      | 2 ++
 libavcodec/x86/opusdsp_init.c              | 2 ++
 libavcodec/x86/pixblockdsp_init.c          | 2 ++
 libavcodec/x86/pngdsp_init.c               | 2 ++
 libavcodec/x86/proresdsp_init.c            | 2 ++
 libavcodec/x86/rv34dsp_init.c              | 2 ++
 libavcodec/x86/sbcdsp_init.c               | 2 ++
 libavcodec/x86/sbrdsp_init.c               | 2 ++
 libavcodec/x86/svq1enc_init.c              | 2 ++
 libavcodec/x86/utvideodsp_init.c           | 2 ++
 libavcodec/x86/v210enc_init.c              | 2 ++
 libavcodec/x86/vc1dsp_init.c               | 2 +-
 libavcodec/x86/vorbisdsp_init.c            | 2 ++
 libavcodec/x86/vp3dsp_init.c               | 2 ++
 libavcodec/x86/vp6dsp_init.c               | 2 ++
 libavfilter/x86/af_afir_init.c             | 2 ++
 libavfilter/x86/af_anlmdn_init.c           | 2 ++
 libavfilter/x86/af_volume_init.c           | 2 ++
 libavfilter/x86/avf_showcqt_init.c         | 2 ++
 libavfilter/x86/colorspacedsp_init.c       | 2 ++
 libavfilter/x86/vf_atadenoise_init.c       | 2 ++
 libavfilter/x86/vf_blend_init.c            | 2 ++
 libavfilter/x86/vf_bwdif_init.c            | 2 ++
 libavfilter/x86/vf_convolution_init.c      | 2 +-
 libavfilter/x86/vf_framerate_init.c        | 2 ++
 libavfilter/x86/vf_fspp_init.c             | 2 ++
 libavfilter/x86/vf_gblur_init.c            | 2 ++
 libavfilter/x86/vf_hflip_init.c            | 2 ++
 libavfilter/x86/vf_limiter_init.c          | 2 ++
 libavfilter/x86/vf_maskedclamp_init.c      | 2 ++
 libavfilter/x86/vf_maskedmerge_init.c      | 2 ++
 libavfilter/x86/vf_overlay_init.c          | 2 ++
 libavfilter/x86/vf_pp7_init.c              | 2 ++
 libavfilter/x86/vf_psnr_init.c             | 2 ++
 libavfilter/x86/vf_removegrain_init.c      | 2 ++
 libavfilter/x86/vf_ssim_init.c             | 2 ++
 libavfilter/x86/vf_stereo3d_init.c         | 2 ++
 libavfilter/x86/vf_threshold_init.c        | 2 ++
 libavfilter/x86/vf_tinterlace_init.c       | 2 ++
 libavfilter/x86/vf_transpose_init.c        | 2 ++
 libavfilter/x86/vf_v360_init.c             | 2 ++
 libavfilter/x86/vf_w3fdif_init.c           | 2 ++
 libavfilter/x86/vf_yadif_init.c            | 2 ++
 libavutil/x86/fixed_dsp_init.c             | 2 ++
 libavutil/x86/float_dsp_init.c             | 2 ++
 libavutil/x86/imgutils_init.c              | 2 ++
 libavutil/x86/lls_init.c                   | 2 ++
 libavutil/x86/pixelutils_init.c            | 2 ++
 libswresample/x86/audio_convert_init.c     | 2 ++
 libswresample/x86/resample_init.c          | 6 ++++++
 libswscale/x86/rgb2rgb.c                   | 2 ++
 libswscale/x86/swscale.c                   | 2 ++
 82 files changed, 167 insertions(+), 3 deletions(-)

diff --git a/libavcodec/x86/aacencdsp_init.c b/libavcodec/x86/aacencdsp_init.c
index 049a2417d9..7dca1d481b 100644
--- a/libavcodec/x86/aacencdsp_init.c
+++ b/libavcodec/x86/aacencdsp_init.c
@@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled,
 
 av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->quant_bands = ff_aac_quantize_bands_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c
index 0b0ee07db4..44d64f5340 100644
--- a/libavcodec/x86/aacpsdsp_init.c
+++ b/libavcodec/x86/aacpsdsp_init.c
@@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64],
 
 av_cold void ff_psdsp_init_x86(PSDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s)
     if (EXTERNAL_FMA3(cpu_flags)) {
         s->hybrid_analysis        = ff_ps_hybrid_analysis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 43b3b4ac85..76a8c0547d 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
 
 av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
         if (!(cpu_flags & AV_CPU_FLAG_ATOM))
             c->extract_exponents = ff_ac3_extract_exponents_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
 
 #define DOWNMIX_FUNC_OPT(ch, opt)                                       \
@@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3)
 
 void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #define SET_DOWNMIX(ch, suf, SUF)                                       \
@@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
         SET_DOWNMIX_ALL(avx,  AVX)
         SET_DOWNMIX_ALL(fma3, FMA3)
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c
index 68aa3b2129..c5f410678e 100644
--- a/libavcodec/x86/audiodsp_init.c
+++ b/libavcodec/x86/audiodsp_init.c
@@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src,
 
 av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->scalarproduct_int16 = ff_scalarproduct_int16_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c
index 877bab1a2c..08551f6487 100644
--- a/libavcodec/x86/bswapdsp_init.c
+++ b/libavcodec/x86/bswapdsp_init.c
@@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t *src, int w);
 
 av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
         c->bswap_buf = ff_bswap32_buf_ssse3;
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->bswap_buf = ff_bswap32_buf_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 4ad977a034..ad755e7321 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -383,6 +383,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         DSPFUNC(avg, 1,  8, mmxext);
     }
 #endif
+#if HAVE_X86ASM
 #if HAVE_MMX_EXTERNAL
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext;
@@ -397,4 +398,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         c->idct_perm      = FF_IDCT_PERM_TRANSPOSE;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c
index 5a0669e6f2..b88a2f6225 100644
--- a/libavcodec/x86/celt_pvq_init.c
+++ b/libavcodec/x86/celt_pvq_init.c
@@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx  (float *X, int *y, int K, int N);
 
 av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->pvq_search = ff_pvq_search_exact_avx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c
index c5d89561ae..a773c365c1 100644
--- a/libavcodec/x86/cfhddsp_init.c
+++ b/libavcodec/x86/cfhddsp_init.c
@@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output, const int16_t *low, const
 
 av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
         if (depth == 12 && !bayer)
             c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhdencdsp_init.c b/libavcodec/x86/cfhdencdsp_init.c
index 5cea39a80a..79b2f10bf7 100644
--- a/libavcodec/x86/cfhdencdsp_init.c
+++ b/libavcodec/x86/cfhdencdsp_init.c
@@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *hi
 
 av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
         c->vert_filter = ff_cfhdenc_vert_filter_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 0c78dd1c9e..b407679f6a 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3)
 
 av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
     }
     if (EXTERNAL_FMA3(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c
index d0e4b34dd3..6756e1e12d 100644
--- a/libavcodec/x86/dct_init.c
+++ b/libavcodec/x86/dct_init.c
@@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
 
 av_cold void ff_dct_init_x86(DCTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->dct32 = ff_dct32_float_sse2;
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->dct32 = ff_dct32_float_avx;
+#endif
 }
diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c
index fd6f15005a..612b70ad7a 100644
--- a/libavcodec/x86/dnxhdenc_init.c
+++ b/libavcodec/x86/dnxhdenc_init.c
@@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
 
 av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(av_get_cpu_flags())) {
         if (ctx->cid_table->bit_depth == 8)
             ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c
index 63b3480d8f..f9696d7a91 100644
--- a/libavcodec/x86/exrdsp_init.c
+++ b/libavcodec/x86/exrdsp_init.c
@@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size);
 
 av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
         dsp->reorder_pixels = ff_reorder_pixels_avx2;
         dsp->predictor      = ff_predictor_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c
index df79d57dc7..065e231edb 100644
--- a/libavcodec/x86/fft_init.c
+++ b/libavcodec/x86/fft_init.c
@@ -26,6 +26,7 @@
 
 av_cold void ff_fft_init_x86(FFTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->nbits > 16)
@@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s)
         s->fft_calc        = ff_fft_calc_avx;
         s->fft_permutation = FF_FFT_PERM_AVX;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c
index 614695193b..700269d62a 100644
--- a/libavcodec/x86/g722dsp_init.c
+++ b/libavcodec/x86/g722dsp_init.c
@@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t *prev_samples, int xout[2]);
 
 av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         dsp->apply_qmf = ff_g722_apply_qmf_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c
index ab81063233..57ec1640e3 100644
--- a/libavcodec/x86/h263dsp_init.c
+++ b/libavcodec/x86/h263dsp_init.c
@@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale);
 
 av_cold void ff_h263dsp_init_x86(H263DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
         c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
         c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
index ee46927a24..5518961784 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
                                    const int bit_depth,
                                    const int chroma_format_idc)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_avx;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c
index 34934b6ad0..57d92ad107 100644
--- a/libavcodec/x86/h264chroma_init.c
+++ b/libavcodec/x86/h264chroma_init.c
@@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx)
 
 av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
 {
+#if HAVE_X86ASM
     int high_bit_depth = bit_depth > 8;
     int cpu_flags      = av_get_cpu_flags();
 
@@ -105,4 +106,5 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
         c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
         c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index c7060085a2..29c11246ae 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2)
 
 void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             SAO_EDGE_INIT(12, avx2);
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 6bde5a3893..99a1ab7310 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -229,6 +229,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
         hpeldsp_init_mmx(c, flags);
 #endif
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
 
@@ -237,6 +238,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 
     if (EXTERNAL_SSSE3(cpu_flags))
         hpeldsp_init_ssse3(c, flags);
+#endif
 
     if (CONFIG_VP3_DECODER)
         ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);
diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c
index 1dbd1ba6f9..3dd6c45afa 100644
--- a/libavcodec/x86/hpeldsp_vp3_init.c
+++ b/libavcodec/x86/hpeldsp_vp3_init.c
@@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block,
 
 av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
             c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext;
             c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c
index 239d3ca313..445137da87 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *top, co
 
 av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->add_int16 = ff_add_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c
index c9c33b75b4..35d18a040c 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, c
 
 av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     av_unused int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -51,4 +52,5 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 4ade52a880..3f74da85cd 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
 av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_32
@@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/jpeg2000dsp_init.c b/libavcodec/x86/jpeg2000dsp_init.c
index 7310a1d0e1..0256be8046 100644
--- a/libavcodec/x86/jpeg2000dsp_init.c
+++ b/libavcodec/x86/jpeg2000dsp_init.c
@@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize);
 
 av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE(cpu_flags)) {
         c->mct_decode[FF_DWT97] = ff_ict_float_sse;
@@ -57,4 +58,5 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c
index 5690cacaad..720cf98389 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->add_bytes       = ff_add_bytes_sse2;
         c->add_median_pred = ff_add_median_pred_sse2;
@@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
         c->add_left_pred   = ff_add_left_pred_unaligned_avx2;
         c->add_gradient_pred = ff_add_gradient_pred_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videoencdsp_init.c b/libavcodec/x86/lossless_videoencdsp_init.c
index 22a4014ef1..26cfcbb4b2 100644
--- a/libavcodec/x86/lossless_videoencdsp_init.c
+++ b/libavcodec/x86/lossless_videoencdsp_init.c
@@ -91,6 +91,7 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     }
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_sse2;
     }
@@ -102,4 +103,5 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c
index ea7301e1e7..25653013a5 100644
--- a/libavcodec/x86/mdct15_init.c
+++ b/libavcodec/x86/mdct15_init.c
@@ -84,6 +84,7 @@ static void perm_twiddles(MDCT15Context *s)
 av_cold void ff_mdct15_init_x86(MDCT15Context *s)
 {
     int adjust_twiddles = 0;
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags))
@@ -98,6 +99,7 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s)
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         s->postreindex = ff_mdct15_postreindex_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 
     if (adjust_twiddles)
         perm_twiddles(s);
diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c
index bc1051c27e..527fdff4a9 100644
--- a/libavcodec/x86/me_cmp_init.c
+++ b/libavcodec/x86/me_cmp_init.c
@@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
 
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMX(cpu_flags)) {
         c->sse[1]            = ff_sse8_mmx;
 #if HAVE_X86ASM
@@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
         c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 333a685f47..4843e1abdb 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,7 +200,7 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
     if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c
index ec174b15aa..82f9df4cba 100644
--- a/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/libavcodec/x86/mpegvideoencdsp_init.c
@@ -216,6 +216,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_sse2;
         c->pix_norm1   = ff_pix_norm1_sse2;
@@ -224,6 +225,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
     if (EXTERNAL_XOP(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_xop;
     }
+#endif /* HAVE_X86ASM */
 
 #if HAVE_INLINE_ASM
 
diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c
index 582fbb4f0c..4598657116 100644
--- a/libavcodec/x86/opusdsp_init.c
+++ b/libavcodec/x86/opusdsp_init.c
@@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len);
 
 av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_FMA3(cpu_flags)) {
         ctx->postfilter = ff_opus_postfilter_fma3;
         ctx->deemphasis = ff_opus_deemphasis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c
index 51f2a0033a..9d3aac4c74 100644
--- a/libavcodec/x86/pixblockdsp_init.c
+++ b/libavcodec/x86/pixblockdsp_init.c
@@ -31,6 +31,7 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
                                      AVCodecContext *avctx,
                                      unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
         c->diff_pixels_unaligned =
         c->diff_pixels = ff_diff_pixels_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c
index e2cd5effe3..c6562f7abb 100644
--- a/libavcodec/x86/pngdsp_init.c
+++ b/libavcodec/x86/pngdsp_init.c
@@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
 
 av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
         dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
     if (EXTERNAL_SSSE3(cpu_flags))
         dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c
index bde79ab8c0..01e5e67236 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize,
 
 av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
 {
+#if HAVE_X86ASM
 #if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
@@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
         }
     }
 #endif /* ARCH_X86_64 */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index caa5c2d653..f76bef39e1 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
 
 av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags)) {
@@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2;
     if (EXTERNAL_SSE4(cpu_flags))
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c
index 7416a86ac6..79914cc565 100644
--- a/libavcodec/x86/sbcdsp_init.c
+++ b/libavcodec/x86/sbcdsp_init.c
@@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8],
 
 av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
         s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
         s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 999f681220..d70ffa0d6c 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2], float phi[3][2][2]);
 
 av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
     if (EXTERNAL_SSE3(cpu_flags)) {
         s->autocorrelate = ff_sbr_autocorrelate_sse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c
index daf573beba..c016811822 100644
--- a/libavcodec/x86/svq1enc_init.c
+++ b/libavcodec/x86/svq1enc_init.c
@@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2,
 
 av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index 2b436c6c5c..e81f6bf3c0 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r, uint16_t *src_g, uint16_t *sr
 
 av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
         c->restore_rgb_planes   = ff_restore_rgb_planes_avx2;
         c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index 13a351dd1d..542bfe8b8a 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -36,6 +36,7 @@ void ff_v210_planar_pack_10_avx2(const uint16_t *y, const uint16_t *u,
 
 av_cold void ff_v210enc_init_x86(V210EncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSSE3(cpu_flags)) {
@@ -52,4 +53,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
         s->sample_factor_10 = 2;
         s->pack_line_10     = ff_v210_planar_pack_10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 65fc28ea35..ea6c0fa0fe 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS && HAVE_INLINE_ASM
+#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_X86ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
diff --git a/libavcodec/x86/vorbisdsp_init.c b/libavcodec/x86/vorbisdsp_init.c
index 08a3bb2965..067b92e2a4 100644
--- a/libavcodec/x86/vorbisdsp_init.c
+++ b/libavcodec/x86/vorbisdsp_init.c
@@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang,
 
 av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
         dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index f54fa57b3e..7d69956d22 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a,
 
 av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
         c->idct_put  = ff_vp3_idct_put_sse2;
         c->idct_add  = ff_vp3_idct_add_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c
index 83d45ec36c..6a3bf36bae 100644
--- a/libavcodec/x86/vp6dsp_init.c
+++ b/libavcodec/x86/vp6dsp_init.c
@@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
 
 av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c
index e53817b9c0..3561d9fe3f 100644
--- a/libavfilter/x86/af_afir_init.c
+++ b/libavfilter/x86/af_afir_init.c
@@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t, const float *c,
 
 av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags)) {
@@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
     if (EXTERNAL_AVX_FAST(cpu_flags)) {
         s->fcmul_add = ff_fcmul_add_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_anlmdn_init.c b/libavfilter/x86/af_anlmdn_init.c
index 30eff6f644..047d88b795 100644
--- a/libavfilter/x86/af_anlmdn_init.c
+++ b/libavfilter/x86/af_anlmdn_init.c
@@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1, const float *f2,
 
 av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
         s->compute_distance_ssd = ff_compute_distance_ssd_sse;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_volume_init.c b/libavfilter/x86/af_volume_init.c
index 88f5a9679a..28cfbe1ce1 100644
--- a/libavfilter/x86/af_volume_init.c
+++ b/libavfilter/x86/af_volume_init.c
@@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len,
 
 av_cold void ff_volume_init_x86(VolumeContext *vol)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);
 
@@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol)
             vol->samples_align = 8;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/avf_showcqt_init.c b/libavfilter/x86/avf_showcqt_init.c
index 2320b30239..1a5534a12e 100644
--- a/libavfilter/x86/avf_showcqt_init.c
+++ b/libavfilter/x86/avf_showcqt_init.c
@@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len)
 
 av_cold void ff_showcqt_init_x86(ShowCQTContext *s)
 {
+#if HAVE_X86ASM
     int cpuflags = av_get_cpu_flags();
 
 #define SELECT_CQT_CALC(type, TYPE, align, perm) \
@@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \
     SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm
     SELECT_CQT_CALC(avx,  AVX_FAST,  8, 01452367);
     SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367);
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index f01db4baf4..66c25cb361 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h,
 
 void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index eb621e172c..8ec98f1a82 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst,
 
 av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
@@ -49,4 +50,5 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
         }
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_blend_init.c b/libavfilter/x86/vf_blend_init.c
index c326c43362..6d57bf7eac 100644
--- a/libavfilter/x86/vf_blend_init.c
+++ b/libavfilter/x86/vf_blend_init.c
@@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2)
 
 av_cold void ff_blend_init_x86(FilterParams *param, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (depth == 8) {
@@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param, int depth)
         }
 #endif /* ARCH_X86_64 */
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c
index e24e5cd9b1..ec0ee6af85 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -44,6 +44,7 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne
 
 av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
 {
+#if HAVE_X86ASM
     YADIFContext *yadif = &bwdif->yadif;
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth;
@@ -59,4 +60,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif)
         if (EXTERNAL_SSSE3(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c
index b78a47d02b..105c223366 100644
--- a/libavfilter/x86/vf_convolution_init.c
+++ b/libavfilter/x86/vf_convolution_init.c
@@ -31,7 +31,7 @@ void ff_filter_3x3_sse4(uint8_t *dst, int width,
 
 av_cold void ff_convolution_init_x86(ConvolutionContext *s)
 {
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     int i;
     int cpu_flags = av_get_cpu_flags();
     for (i = 0; i < 4; i++) {
diff --git a/libavfilter/x86/vf_framerate_init.c b/libavfilter/x86/vf_framerate_init.c
index 9d40faf0a4..b4a9dc574d 100644
--- a/libavfilter/x86/vf_framerate_init.c
+++ b/libavfilter/x86/vf_framerate_init.c
@@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS);
 
 void ff_framerate_init_x86(FrameRateContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (s->bitdepth == 8) {
         if (EXTERNAL_AVX2_FAST(cpu_flags))
@@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s)
         else if (EXTERNAL_SSE4(cpu_flags))
             s->blend = ff_blend_frames16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c
index 8e00317cb7..3618b70dc3 100644
--- a/libavfilter/x86/vf_fspp_init.c
+++ b/libavfilter/x86/vf_fspp_init.c
@@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t *pixels, ptrdiff_t line_size,
 
 av_cold void ff_fspp_init_x86(FSPPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s)
         s->row_idct     = ff_row_idct_mmx;
         s->row_fdct     = ff_row_fdct_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_gblur_init.c b/libavfilter/x86/vf_gblur_init.c
index b47f6fbffb..01e1b82131 100644
--- a/libavfilter/x86/vf_gblur_init.c
+++ b/libavfilter/x86/vf_gblur_init.c
@@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begi
 
 av_cold void ff_gblur_init_x86(GBlurContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s)
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_hflip_init.c b/libavfilter/x86/vf_hflip_init.c
index 0ac399b0d4..743b368ee9 100644
--- a/libavfilter/x86/vf_hflip_init.c
+++ b/libavfilter/x86/vf_hflip_init.c
@@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t *dst, int w);
 
 av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int i;
 
@@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_limiter_init.c b/libavfilter/x86/vf_limiter_init.c
index 07c733dc21..2c26f90f0f 100644
--- a/libavfilter/x86/vf_limiter_init.c
+++ b/libavfilter/x86/vf_limiter_init.c
@@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t *dst,
 
 void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
             dsp->limiter = ff_limiter_16bit_sse4;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedclamp_init.c b/libavfilter/x86/vf_maskedclamp_init.c
index 2a5388abac..94217cf485 100644
--- a/libavfilter/x86/vf_maskedclamp_init.c
+++ b/libavfilter/x86/vf_maskedclamp_init.c
@@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc, uint8_t *dst,
 
 av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -43,4 +44,5 @@ av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
     if (EXTERNAL_SSE4(cpu_flags) && depth > 8) {
         dsp->maskedclamp = ff_maskedclamp16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedmerge_init.c b/libavfilter/x86/vf_maskedmerge_init.c
index 73ab888083..2eee4a36c2 100644
--- a/libavfilter/x86/vf_maskedmerge_init.c
+++ b/libavfilter/x86/vf_maskedmerge_init.c
@@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const uint8_t *osrc,
 
 av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) {
         s->maskedmerge = ff_maskedmerge8_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_overlay_init.c b/libavfilter/x86/vf_overlay_init.c
index d4218b18f6..9f7d9c4909 100644
--- a/libavfilter/x86/vf_overlay_init.c
+++ b/libavfilter/x86/vf_overlay_init.c
@@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a,
 av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
                                  int alpha_format, int main_has_alpha)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags) &&
@@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
         s->blend_row[1] = ff_overlay_row_22_sse4;
         s->blend_row[2] = ff_overlay_row_22_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c
index 165b0dd5d0..ed5ab82794 100644
--- a/libavfilter/x86/vf_pp7_init.c
+++ b/libavfilter/x86/vf_pp7_init.c
@@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src);
 
 av_cold void ff_pp7_init_x86(PP7Context *p)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags))
         p->dctB = ff_pp7_dctB_mmx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c
index c387812204..82be86d923 100644
--- a/libavfilter/x86/vf_psnr_init.c
+++ b/libavfilter/x86/vf_psnr_init.c
@@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w);
 
 void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
             dsp->sse_line = ff_sse_line_16bit_sse2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_removegrain_init.c b/libavfilter/x86/vf_removegrain_init.c
index 07314b3244..ff5f4771d2 100644
--- a/libavfilter/x86/vf_removegrain_init.c
+++ b/libavfilter/x86/vf_removegrain_init.c
@@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pix
 
 av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
 {
+#if HAVE_X86ASM
 #if CONFIG_GPL
     int cpu_flags = av_get_cpu_flags();
     int i;
@@ -85,4 +86,5 @@ av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
             }
     }
 #endif /* CONFIG_GPL */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index 6f2305430c..ef39247056 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w);
 
 void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_xop;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_stereo3d_init.c b/libavfilter/x86/vf_stereo3d_init.c
index da160a89a0..abd682ee80 100644
--- a/libavfilter/x86/vf_stereo3d_init.c
+++ b/libavfilter/x86/vf_stereo3d_init.c
@@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc,
 
 void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags)) {
         dsp->anaglyph = ff_anaglyph_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_threshold_init.c b/libavfilter/x86/vf_threshold_init.c
index 8e42296791..151a94f429 100644
--- a/libavfilter/x86/vf_threshold_init.c
+++ b/libavfilter/x86/vf_threshold_init.c
@@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2)
 
 av_cold void ff_threshold_init_x86(ThresholdContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->depth == 8) {
@@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s)
             s->threshold = ff_threshold16_avx2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c
index 1c25a2bb7a..c30a3247a2 100644
--- a/libavfilter/x86/vf_tinterlace_init.c
+++ b/libavfilter/x86/vf_tinterlace_init.c
@@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize,
 
 av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->csp->comp[0].depth > 8) {
@@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_transpose_init.c b/libavfilter/x86/vf_transpose_init.c
index 95c56eab73..7db2e66258 100644
--- a/libavfilter/x86/vf_transpose_init.c
+++ b/libavfilter/x86/vf_transpose_init.c
@@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src,
 
 av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) {
@@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) {
         v->transpose_8x8 = ff_transpose_8x8_16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c
index 2b2b06dd40..6b1b3811aa 100644
--- a/libavfilter/x86/vf_v360_init.c
+++ b/libavfilter/x86/vf_v360_init.c
@@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int width, const uint8_t *src, ptrd
 
 av_cold void ff_v360_init_x86(V360Context *s, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth <= 8)
@@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth)
                                           s->interp == MITCHELL) && depth <= 8)
         s->remap_line = ff_remap4_8bit_line_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 6d677d651d..d023ef7a49 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const int32_t *work_pixel,
 
 av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c
index 257c3f9199..54917fa104 100644
--- a/libavfilter/x86/vf_yadif_init.c
+++ b/libavfilter/x86/vf_yadif_init.c
@@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
 
 av_cold void ff_yadif_init_x86(YADIFContext *yadif)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8
                                   : yadif->csp->comp[0].depth;
@@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
         if (EXTERNAL_SSSE3(cpu_flags))
             yadif->filter_line = ff_yadif_filter_line_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c
index d3f4b2e325..eb84027dbf 100644
--- a/libavutil/x86/fixed_dsp_init.c
+++ b/libavutil/x86/fixed_dsp_init.c
@@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int
 
 av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         fdsp->butterflies_fixed = ff_butterflies_fixed_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c
index ad6b506259..7495c0b9a8 100644
--- a/libavutil/x86/float_dsp_init.c
+++ b/libavutil/x86/float_dsp_init.c
@@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1,
 
 av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3;
         fdsp->scalarproduct_float = ff_scalarproduct_float_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c
index 91a16cf594..feac5d6fc7 100644
--- a/libavutil/x86/imgutils_init.c
+++ b/libavutil/x86/imgutils_init.c
@@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
                                     const uint8_t *src, ptrdiff_t src_linesize,
                                     ptrdiff_t bytewidth, int height)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64);
 
@@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
         ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src, src_linesize,
                                          bw_aligned, height);
     else
+#endif /* HAVE_X86ASM */
         return AVERROR(ENOSYS);
 
     return 0;
diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c
index c786376915..67470185da 100644
--- a/libavutil/x86/lls_init.c
+++ b/libavutil/x86/lls_init.c
@@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double *var, int order);
 
 av_cold void ff_init_lls_x86(LLSModel *m)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE2(cpu_flags)) {
         m->update_lls = ff_update_lls_sse2;
@@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m)
     if (EXTERNAL_FMA3_FAST(cpu_flags)) {
         m->update_lls = ff_update_lls_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c
index c3c0662414..a2f842041d 100644
--- a/libavutil/x86/pixelutils_init.c
+++ b/libavutil/x86/pixelutils_init.c
@@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t *src1, ptrdiff_t stride1,
 
 void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     // The best way to use SSE2 would be to do 2 SADs in parallel,
@@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
         case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1   aligned, src2   aligned
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c
index f6d36f9ca6..d9eb43e1d5 100644
--- a/libswresample/x86/audio_convert_init.c
+++ b/libswresample/x86/audio_convert_init.c
@@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
             ac->simd_f =  ff_int32_to_int16_a_ ## cap;\
     }
 
+#if HAVE_X86ASM
 MULTI_CAPS_FUNC(SSE2, sse2)
 
     if(EXTERNAL_SSE(mm_flags)) {
@@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2)
         if(   out_fmt == AV_SAMPLE_FMT_S32  && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP)
             ac->simd_f =  ff_float_to_int32_a_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/resample_init.c b/libswresample/x86/resample_init.c
index d13ccd4833..4eebf5d6f9 100644
--- a/libswresample/x86/resample_init.c
+++ b/libswresample/x86/resample_init.c
@@ -51,6 +51,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
 
     switch(c->format){
     case AV_SAMPLE_FMT_S16P:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_int16_sse2;
             c->dsp.resample_common = ff_resample_common_int16_sse2;
@@ -59,8 +60,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_int16_xop;
             c->dsp.resample_common = ff_resample_common_int16_xop;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_FLTP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_float_sse;
             c->dsp.resample_common = ff_resample_common_float_sse;
@@ -77,8 +80,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_float_fma4;
             c->dsp.resample_common = ff_resample_common_float_fma4;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_DBLP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_double_sse2;
             c->dsp.resample_common = ff_resample_common_double_sse2;
@@ -91,6 +96,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_double_fma3;
             c->dsp.resample_common = ff_resample_common_double_fma3;
         }
+#endif /* HAVE_X86ASM */
         break;
     }
 }
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index b325e5dbd5..e39f327bf2 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void)
         rgb2rgb_init_avx();
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext;
     }
@@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void)
         uyvytoyuv422 = ff_uyvytoyuv422_avx;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..0a14262916 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -529,6 +529,7 @@ switch(c->dstBpc){ \
              else                ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
              break; \
     }
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
         ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
@@ -805,4 +806,5 @@ switch(c->dstBpc){ \
     }
 
 #endif
+#endif /* HAVE_X86ASM */
 }
-- 
2.38.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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
  2022-11-01 22:28   ` Andreas Rheinhardt
@ 2022-11-03 21:59   ` Carl Eugen Hoyos
  1 sibling, 0 replies; 54+ messages in thread
From: Carl Eugen Hoyos @ 2022-11-03 21:59 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am Di., 1. Nov. 2022 um 23:00 Uhr schrieb L. E. Segovia <amy@amyspark.me>:
>
> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
>
> Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
>
> Signed-off-by: L. E. Segovia <amy@amyspark.me>
> ---
>  libavcodec/x86/dcadsp_init.c         |   2 +
>  libavcodec/x86/fdctdsp_init.c        |   2 +
>  libavcodec/x86/flacdsp_init.c        |   8 +-
>  libavcodec/x86/hevcdsp_init.c        | 463 ++++++++++++++-------------
>  libavcodec/x86/idctdsp_init.c        |   9 +-
>  libavcodec/x86/mlpdsp_init.c         |   6 +-
>  libavcodec/x86/vc1dsp_init.c         |   6 +-
>  libavfilter/x86/colorspacedsp_init.c |   4 +-
>  libavfilter/x86/vf_atadenoise_init.c |   6 +-
>  libavfilter/x86/vf_ssim_init.c       |   6 +-
>  libavfilter/x86/vf_w3fdif_init.c     |   4 +-
>  11 files changed, 272 insertions(+), 244 deletions(-)

I regularly compile with MSVC without this patch and I believe
the patch makes our code less readable and harder to maintain.

Carl Eugen
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
                     ` (4 preceding siblings ...)
  2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
@ 2022-11-07 14:48   ` L. E. Segovia
  2022-11-17 22:45     ` L. E. Segovia
  2022-11-26 19:17     ` L. E. Segovia
  2023-07-28  1:37   ` [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations L. E. Segovia
       [not found]   ` <cover.1690508131.git.amy@amyspark.me>
  7 siblings, 2 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-07 14:48 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Ping for review.

amyspark

On 03/11/2022 13:36, L. E. Segovia wrote:
> Hi all,
> 
> This new version is intended to make Patchwork log the set correctly.
> (My apologies there, I'm not used to send patches through the command line.)
> 
> v3 changes (same as v2):
> 
> - Split indentation fixes for hevcdsp_init into its own commit
> - Fixed spurious indentation in vf_ssim_init
> - Implemented the macro approach for expanding the CONFIG_FOO checks in fftools
> - Added the missing HAVE_X86ASM check in vc1dsp_init
> - Added a missing HAVE_INLINE_ASM check in hpeldsp_init (see below)
> - Fixed the HAVE_X86ASM check wrongly covering the INLINE_FOO clause in hpeldsp_init
> - Removed the duplicate HAVE_X86ASM check in me_cmp_init
> - Inlined the HAVE_X86ASM and ARCH_X86_64 checks in mlpdsp_init and vf_convolution_init 
> 
> L. E. Segovia (5):
>   all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
>   avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
>   all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
>   all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
>   all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
> 
>  fftools/ffprobe.c                          |  16 +-
>  fftools/opt_common.c                       |  12 +-
>  libavcodec/x86/aacencdsp_init.c            |   2 +
>  libavcodec/x86/aacpsdsp_init.c             |   2 +
>  libavcodec/x86/ac3dsp_init.c               |   4 +
>  libavcodec/x86/audiodsp_init.c             |   2 +
>  libavcodec/x86/bswapdsp_init.c             |   2 +
>  libavcodec/x86/cavsdsp.c                   |   2 +
>  libavcodec/x86/celt_pvq_init.c             |   2 +
>  libavcodec/x86/cfhddsp_init.c              |   2 +
>  libavcodec/x86/cfhdencdsp_init.c           |   2 +
>  libavcodec/x86/dcadsp_init.c               |   2 +
>  libavcodec/x86/dct_init.c                  |   2 +
>  libavcodec/x86/dnxhdenc_init.c             |   2 +
>  libavcodec/x86/exrdsp_init.c               |   2 +
>  libavcodec/x86/fdctdsp_init.c              |   2 +
>  libavcodec/x86/fft_init.c                  |   2 +
>  libavcodec/x86/flacdsp_init.c              |   8 +-
>  libavcodec/x86/g722dsp_init.c              |   2 +
>  libavcodec/x86/h263dsp_init.c              |   2 +
>  libavcodec/x86/h264_intrapred_init.c       |   2 +
>  libavcodec/x86/h264chroma_init.c           |   2 +
>  libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
>  libavcodec/x86/hpeldsp_init.c              |   4 +
>  libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
>  libavcodec/x86/huffyuvdsp_init.c           |   2 +
>  libavcodec/x86/huffyuvencdsp_init.c        |   2 +
>  libavcodec/x86/idctdsp_init.c              |  11 +-
>  libavcodec/x86/jpeg2000dsp_init.c          |   2 +
>  libavcodec/x86/lossless_videodsp_init.c    |   2 +
>  libavcodec/x86/lossless_videoencdsp_init.c |   2 +
>  libavcodec/x86/mdct15_init.c               |   2 +
>  libavcodec/x86/me_cmp_init.c               |   2 +
>  libavcodec/x86/mlpdsp_init.c               |   6 +-
>  libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
>  libavcodec/x86/opusdsp_init.c              |   2 +
>  libavcodec/x86/pixblockdsp_init.c          |   2 +
>  libavcodec/x86/pngdsp_init.c               |   2 +
>  libavcodec/x86/proresdsp_init.c            |   2 +
>  libavcodec/x86/rv34dsp_init.c              |   2 +
>  libavcodec/x86/sbcdsp_init.c               |   2 +
>  libavcodec/x86/sbrdsp_init.c               |   2 +
>  libavcodec/x86/svq1enc_init.c              |   2 +
>  libavcodec/x86/utvideodsp_init.c           |   2 +
>  libavcodec/x86/v210enc_init.c              |   2 +
>  libavcodec/x86/vc1dsp_init.c               |   6 +-
>  libavcodec/x86/vorbisdsp_init.c            |   2 +
>  libavcodec/x86/vp3dsp_init.c               |   2 +
>  libavcodec/x86/vp6dsp_init.c               |   2 +
>  libavfilter/x86/af_afir_init.c             |   2 +
>  libavfilter/x86/af_anlmdn_init.c           |   2 +
>  libavfilter/x86/af_volume_init.c           |   2 +
>  libavfilter/x86/avf_showcqt_init.c         |   2 +
>  libavfilter/x86/colorspacedsp_init.c       |   6 +-
>  libavfilter/x86/vf_atadenoise_init.c       |   8 +-
>  libavfilter/x86/vf_blend_init.c            |   2 +
>  libavfilter/x86/vf_bwdif_init.c            |   2 +
>  libavfilter/x86/vf_convolution_init.c      |   2 +-
>  libavfilter/x86/vf_framerate_init.c        |   2 +
>  libavfilter/x86/vf_fspp_init.c             |   2 +
>  libavfilter/x86/vf_gblur_init.c            |   2 +
>  libavfilter/x86/vf_hflip_init.c            |   2 +
>  libavfilter/x86/vf_limiter_init.c          |   2 +
>  libavfilter/x86/vf_maskedclamp_init.c      |   2 +
>  libavfilter/x86/vf_maskedmerge_init.c      |   2 +
>  libavfilter/x86/vf_overlay_init.c          |   2 +
>  libavfilter/x86/vf_pp7_init.c              |   2 +
>  libavfilter/x86/vf_psnr_init.c             |   2 +
>  libavfilter/x86/vf_removegrain_init.c      |   2 +
>  libavfilter/x86/vf_ssim_init.c             |   6 +-
>  libavfilter/x86/vf_stereo3d_init.c         |   2 +
>  libavfilter/x86/vf_threshold_init.c        |   2 +
>  libavfilter/x86/vf_tinterlace_init.c       |   2 +
>  libavfilter/x86/vf_transpose_init.c        |   2 +
>  libavfilter/x86/vf_v360_init.c             |   2 +
>  libavfilter/x86/vf_w3fdif_init.c           |   6 +-
>  libavfilter/x86/vf_yadif_init.c            |   2 +
>  libavformat/rtmpproto.c                    |  24 +-
>  libavutil/x86/fixed_dsp_init.c             |   2 +
>  libavutil/x86/float_dsp_init.c             |   2 +
>  libavutil/x86/imgutils_init.c              |   2 +
>  libavutil/x86/lls_init.c                   |   2 +
>  libavutil/x86/pixelutils_init.c            |   2 +
>  libswresample/x86/audio_convert_init.c     |   2 +
>  libswresample/x86/resample_init.c          |   6 +
>  libswscale/x86/rgb2rgb.c                   |   2 +
>  libswscale/x86/swscale.c                   |   2 +
>  87 files changed, 517 insertions(+), 299 deletions(-)
> 

-- 
amyspark 🌸 https://www.amyspark.me
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
  2022-11-03 15:55   ` Lynne
@ 2022-11-14  9:01     ` L. E. Segovia
  0 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-14  9:01 UTC (permalink / raw)
  To: dev; +Cc: Nirbheek Chauhan, Halla Rempt, Timothée Giet, ffmpeg-devel

Hi,

I preferred to check instead for HAVE_X86ASM, as those checks would only
hit on either a missing or crippled NASM. Moreover, the EXTERNAL_<arch>
macros do both the HAVE_<arch>_EXTERNAL  and the runtime CPU flag check.
The former of which would become redundant and duplicated with your
suggestion.

Should I move forward anyway with it?

On 03/11/2022 12:55, dev at lynne.ee (Lynne) wrote:
> Nov 3, 2022, 16:30 by amy at amyspark.me:
> 
>> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
>>
>> Signed-off-by: L. E. Segovia <> amy at amyspark.me> >
>>
> 
> Wrong way to fix it. Makefile to prevent compilation + ifdef guards
> on all arch-specific init function calls.
> 

-- 
amyspark 🌸 https://www.amyspark.me
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-07 14:48   ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
@ 2022-11-17 22:45     ` L. E. Segovia
  2022-11-26 19:17     ` L. E. Segovia
  1 sibling, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2022-11-17 22:45 UTC (permalink / raw)
  To: ffmpeg-devel, Andreas Rheinhardt, dev
  Cc: Nirbheek Chauhan, Halla Rempt, Tim-Philipp Müller

Renewing ping. CC Andreas and Lynne since they were interested previously.

amyspark

On 07/11/2022 11:48, L. E. Segovia wrote:
> Ping for review.
> 
> amyspark
> 
> On 03/11/2022 13:36, L. E. Segovia wrote:
>> Hi all,
>>
>> This new version is intended to make Patchwork log the set correctly.
>> (My apologies there, I'm not used to send patches through the command line.)
>>
>> v3 changes (same as v2):
>>
>> - Split indentation fixes for hevcdsp_init into its own commit
>> - Fixed spurious indentation in vf_ssim_init
>> - Implemented the macro approach for expanding the CONFIG_FOO checks in fftools
>> - Added the missing HAVE_X86ASM check in vc1dsp_init
>> - Added a missing HAVE_INLINE_ASM check in hpeldsp_init (see below)
>> - Fixed the HAVE_X86ASM check wrongly covering the INLINE_FOO clause in hpeldsp_init
>> - Removed the duplicate HAVE_X86ASM check in me_cmp_init
>> - Inlined the HAVE_X86ASM and ARCH_X86_64 checks in mlpdsp_init and vf_convolution_init 
>>
>> L. E. Segovia (5):
>>   all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
>>   avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
>>   all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
>>   all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
>>   all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
>>
>>  fftools/ffprobe.c                          |  16 +-
>>  fftools/opt_common.c                       |  12 +-
>>  libavcodec/x86/aacencdsp_init.c            |   2 +
>>  libavcodec/x86/aacpsdsp_init.c             |   2 +
>>  libavcodec/x86/ac3dsp_init.c               |   4 +
>>  libavcodec/x86/audiodsp_init.c             |   2 +
>>  libavcodec/x86/bswapdsp_init.c             |   2 +
>>  libavcodec/x86/cavsdsp.c                   |   2 +
>>  libavcodec/x86/celt_pvq_init.c             |   2 +
>>  libavcodec/x86/cfhddsp_init.c              |   2 +
>>  libavcodec/x86/cfhdencdsp_init.c           |   2 +
>>  libavcodec/x86/dcadsp_init.c               |   2 +
>>  libavcodec/x86/dct_init.c                  |   2 +
>>  libavcodec/x86/dnxhdenc_init.c             |   2 +
>>  libavcodec/x86/exrdsp_init.c               |   2 +
>>  libavcodec/x86/fdctdsp_init.c              |   2 +
>>  libavcodec/x86/fft_init.c                  |   2 +
>>  libavcodec/x86/flacdsp_init.c              |   8 +-
>>  libavcodec/x86/g722dsp_init.c              |   2 +
>>  libavcodec/x86/h263dsp_init.c              |   2 +
>>  libavcodec/x86/h264_intrapred_init.c       |   2 +
>>  libavcodec/x86/h264chroma_init.c           |   2 +
>>  libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
>>  libavcodec/x86/hpeldsp_init.c              |   4 +
>>  libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
>>  libavcodec/x86/huffyuvdsp_init.c           |   2 +
>>  libavcodec/x86/huffyuvencdsp_init.c        |   2 +
>>  libavcodec/x86/idctdsp_init.c              |  11 +-
>>  libavcodec/x86/jpeg2000dsp_init.c          |   2 +
>>  libavcodec/x86/lossless_videodsp_init.c    |   2 +
>>  libavcodec/x86/lossless_videoencdsp_init.c |   2 +
>>  libavcodec/x86/mdct15_init.c               |   2 +
>>  libavcodec/x86/me_cmp_init.c               |   2 +
>>  libavcodec/x86/mlpdsp_init.c               |   6 +-
>>  libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
>>  libavcodec/x86/opusdsp_init.c              |   2 +
>>  libavcodec/x86/pixblockdsp_init.c          |   2 +
>>  libavcodec/x86/pngdsp_init.c               |   2 +
>>  libavcodec/x86/proresdsp_init.c            |   2 +
>>  libavcodec/x86/rv34dsp_init.c              |   2 +
>>  libavcodec/x86/sbcdsp_init.c               |   2 +
>>  libavcodec/x86/sbrdsp_init.c               |   2 +
>>  libavcodec/x86/svq1enc_init.c              |   2 +
>>  libavcodec/x86/utvideodsp_init.c           |   2 +
>>  libavcodec/x86/v210enc_init.c              |   2 +
>>  libavcodec/x86/vc1dsp_init.c               |   6 +-
>>  libavcodec/x86/vorbisdsp_init.c            |   2 +
>>  libavcodec/x86/vp3dsp_init.c               |   2 +
>>  libavcodec/x86/vp6dsp_init.c               |   2 +
>>  libavfilter/x86/af_afir_init.c             |   2 +
>>  libavfilter/x86/af_anlmdn_init.c           |   2 +
>>  libavfilter/x86/af_volume_init.c           |   2 +
>>  libavfilter/x86/avf_showcqt_init.c         |   2 +
>>  libavfilter/x86/colorspacedsp_init.c       |   6 +-
>>  libavfilter/x86/vf_atadenoise_init.c       |   8 +-
>>  libavfilter/x86/vf_blend_init.c            |   2 +
>>  libavfilter/x86/vf_bwdif_init.c            |   2 +
>>  libavfilter/x86/vf_convolution_init.c      |   2 +-
>>  libavfilter/x86/vf_framerate_init.c        |   2 +
>>  libavfilter/x86/vf_fspp_init.c             |   2 +
>>  libavfilter/x86/vf_gblur_init.c            |   2 +
>>  libavfilter/x86/vf_hflip_init.c            |   2 +
>>  libavfilter/x86/vf_limiter_init.c          |   2 +
>>  libavfilter/x86/vf_maskedclamp_init.c      |   2 +
>>  libavfilter/x86/vf_maskedmerge_init.c      |   2 +
>>  libavfilter/x86/vf_overlay_init.c          |   2 +
>>  libavfilter/x86/vf_pp7_init.c              |   2 +
>>  libavfilter/x86/vf_psnr_init.c             |   2 +
>>  libavfilter/x86/vf_removegrain_init.c      |   2 +
>>  libavfilter/x86/vf_ssim_init.c             |   6 +-
>>  libavfilter/x86/vf_stereo3d_init.c         |   2 +
>>  libavfilter/x86/vf_threshold_init.c        |   2 +
>>  libavfilter/x86/vf_tinterlace_init.c       |   2 +
>>  libavfilter/x86/vf_transpose_init.c        |   2 +
>>  libavfilter/x86/vf_v360_init.c             |   2 +
>>  libavfilter/x86/vf_w3fdif_init.c           |   6 +-
>>  libavfilter/x86/vf_yadif_init.c            |   2 +
>>  libavformat/rtmpproto.c                    |  24 +-
>>  libavutil/x86/fixed_dsp_init.c             |   2 +
>>  libavutil/x86/float_dsp_init.c             |   2 +
>>  libavutil/x86/imgutils_init.c              |   2 +
>>  libavutil/x86/lls_init.c                   |   2 +
>>  libavutil/x86/pixelutils_init.c            |   2 +
>>  libswresample/x86/audio_convert_init.c     |   2 +
>>  libswresample/x86/resample_init.c          |   6 +
>>  libswscale/x86/rgb2rgb.c                   |   2 +
>>  libswscale/x86/swscale.c                   |   2 +
>>  87 files changed, 517 insertions(+), 299 deletions(-)
>>
> 

-- 
amyspark 🌸 https://www.amyspark.me
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-07 14:48   ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
  2022-11-17 22:45     ` L. E. Segovia
@ 2022-11-26 19:17     ` L. E. Segovia
  2022-11-27 15:51       ` Carl Eugen Hoyos
  1 sibling, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2022-11-26 19:17 UTC (permalink / raw)
  To: ffmpeg-devel

Hi again,

Pinging again for review. I've asked for clarification about how should
the EXTERNAL_<arch> checks be dealt with, but I've not received any
response here.

Best,

amyspark

On 07/11/2022 11:48, L. E. Segovia wrote:
> Ping for review.
> 
> amyspark
> 
> On 03/11/2022 13:36, L. E. Segovia wrote:
>> Hi all,
>>
>> This new version is intended to make Patchwork log the set correctly.
>> (My apologies there, I'm not used to send patches through the command line.)
>>
>> v3 changes (same as v2):
>>
>> - Split indentation fixes for hevcdsp_init into its own commit
>> - Fixed spurious indentation in vf_ssim_init
>> - Implemented the macro approach for expanding the CONFIG_FOO checks in fftools
>> - Added the missing HAVE_X86ASM check in vc1dsp_init
>> - Added a missing HAVE_INLINE_ASM check in hpeldsp_init (see below)
>> - Fixed the HAVE_X86ASM check wrongly covering the INLINE_FOO clause in hpeldsp_init
>> - Removed the duplicate HAVE_X86ASM check in me_cmp_init
>> - Inlined the HAVE_X86ASM and ARCH_X86_64 checks in mlpdsp_init and vf_convolution_init 
>>
>> L. E. Segovia (5):
>>   all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
>>   avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes
>>   all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
>>   all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
>>   all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
>>
>>  fftools/ffprobe.c                          |  16 +-
>>  fftools/opt_common.c                       |  12 +-
>>  libavcodec/x86/aacencdsp_init.c            |   2 +
>>  libavcodec/x86/aacpsdsp_init.c             |   2 +
>>  libavcodec/x86/ac3dsp_init.c               |   4 +
>>  libavcodec/x86/audiodsp_init.c             |   2 +
>>  libavcodec/x86/bswapdsp_init.c             |   2 +
>>  libavcodec/x86/cavsdsp.c                   |   2 +
>>  libavcodec/x86/celt_pvq_init.c             |   2 +
>>  libavcodec/x86/cfhddsp_init.c              |   2 +
>>  libavcodec/x86/cfhdencdsp_init.c           |   2 +
>>  libavcodec/x86/dcadsp_init.c               |   2 +
>>  libavcodec/x86/dct_init.c                  |   2 +
>>  libavcodec/x86/dnxhdenc_init.c             |   2 +
>>  libavcodec/x86/exrdsp_init.c               |   2 +
>>  libavcodec/x86/fdctdsp_init.c              |   2 +
>>  libavcodec/x86/fft_init.c                  |   2 +
>>  libavcodec/x86/flacdsp_init.c              |   8 +-
>>  libavcodec/x86/g722dsp_init.c              |   2 +
>>  libavcodec/x86/h263dsp_init.c              |   2 +
>>  libavcodec/x86/h264_intrapred_init.c       |   2 +
>>  libavcodec/x86/h264chroma_init.c           |   2 +
>>  libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
>>  libavcodec/x86/hpeldsp_init.c              |   4 +
>>  libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
>>  libavcodec/x86/huffyuvdsp_init.c           |   2 +
>>  libavcodec/x86/huffyuvencdsp_init.c        |   2 +
>>  libavcodec/x86/idctdsp_init.c              |  11 +-
>>  libavcodec/x86/jpeg2000dsp_init.c          |   2 +
>>  libavcodec/x86/lossless_videodsp_init.c    |   2 +
>>  libavcodec/x86/lossless_videoencdsp_init.c |   2 +
>>  libavcodec/x86/mdct15_init.c               |   2 +
>>  libavcodec/x86/me_cmp_init.c               |   2 +
>>  libavcodec/x86/mlpdsp_init.c               |   6 +-
>>  libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
>>  libavcodec/x86/opusdsp_init.c              |   2 +
>>  libavcodec/x86/pixblockdsp_init.c          |   2 +
>>  libavcodec/x86/pngdsp_init.c               |   2 +
>>  libavcodec/x86/proresdsp_init.c            |   2 +
>>  libavcodec/x86/rv34dsp_init.c              |   2 +
>>  libavcodec/x86/sbcdsp_init.c               |   2 +
>>  libavcodec/x86/sbrdsp_init.c               |   2 +
>>  libavcodec/x86/svq1enc_init.c              |   2 +
>>  libavcodec/x86/utvideodsp_init.c           |   2 +
>>  libavcodec/x86/v210enc_init.c              |   2 +
>>  libavcodec/x86/vc1dsp_init.c               |   6 +-
>>  libavcodec/x86/vorbisdsp_init.c            |   2 +
>>  libavcodec/x86/vp3dsp_init.c               |   2 +
>>  libavcodec/x86/vp6dsp_init.c               |   2 +
>>  libavfilter/x86/af_afir_init.c             |   2 +
>>  libavfilter/x86/af_anlmdn_init.c           |   2 +
>>  libavfilter/x86/af_volume_init.c           |   2 +
>>  libavfilter/x86/avf_showcqt_init.c         |   2 +
>>  libavfilter/x86/colorspacedsp_init.c       |   6 +-
>>  libavfilter/x86/vf_atadenoise_init.c       |   8 +-
>>  libavfilter/x86/vf_blend_init.c            |   2 +
>>  libavfilter/x86/vf_bwdif_init.c            |   2 +
>>  libavfilter/x86/vf_convolution_init.c      |   2 +-
>>  libavfilter/x86/vf_framerate_init.c        |   2 +
>>  libavfilter/x86/vf_fspp_init.c             |   2 +
>>  libavfilter/x86/vf_gblur_init.c            |   2 +
>>  libavfilter/x86/vf_hflip_init.c            |   2 +
>>  libavfilter/x86/vf_limiter_init.c          |   2 +
>>  libavfilter/x86/vf_maskedclamp_init.c      |   2 +
>>  libavfilter/x86/vf_maskedmerge_init.c      |   2 +
>>  libavfilter/x86/vf_overlay_init.c          |   2 +
>>  libavfilter/x86/vf_pp7_init.c              |   2 +
>>  libavfilter/x86/vf_psnr_init.c             |   2 +
>>  libavfilter/x86/vf_removegrain_init.c      |   2 +
>>  libavfilter/x86/vf_ssim_init.c             |   6 +-
>>  libavfilter/x86/vf_stereo3d_init.c         |   2 +
>>  libavfilter/x86/vf_threshold_init.c        |   2 +
>>  libavfilter/x86/vf_tinterlace_init.c       |   2 +
>>  libavfilter/x86/vf_transpose_init.c        |   2 +
>>  libavfilter/x86/vf_v360_init.c             |   2 +
>>  libavfilter/x86/vf_w3fdif_init.c           |   6 +-
>>  libavfilter/x86/vf_yadif_init.c            |   2 +
>>  libavformat/rtmpproto.c                    |  24 +-
>>  libavutil/x86/fixed_dsp_init.c             |   2 +
>>  libavutil/x86/float_dsp_init.c             |   2 +
>>  libavutil/x86/imgutils_init.c              |   2 +
>>  libavutil/x86/lls_init.c                   |   2 +
>>  libavutil/x86/pixelutils_init.c            |   2 +
>>  libswresample/x86/audio_convert_init.c     |   2 +
>>  libswresample/x86/resample_init.c          |   6 +
>>  libswscale/x86/rgb2rgb.c                   |   2 +
>>  libswscale/x86/swscale.c                   |   2 +
>>  87 files changed, 517 insertions(+), 299 deletions(-)
>>
> 

-- 
amyspark 🌸 https://www.amyspark.me
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-26 19:17     ` L. E. Segovia
@ 2022-11-27 15:51       ` Carl Eugen Hoyos
  2022-11-27 16:29         ` Soft Works
  0 siblings, 1 reply; 54+ messages in thread
From: Carl Eugen Hoyos @ 2022-11-27 15:51 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am Sa., 26. Nov. 2022 um 20:17 Uhr schrieb L. E. Segovia <amy@amyspark.me>:
>
> Hi again,
>
> Pinging again for review. I've asked for clarification about how should
> the EXTERNAL_<arch> checks be dealt with, but I've not received any
> response here.

As said before:
I regularly compile with MSVC without this patch set and I believe
the patch set makes our code less readable and harder to maintain.

Carl Eugen
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 15:51       ` Carl Eugen Hoyos
@ 2022-11-27 16:29         ` Soft Works
  2022-11-27 16:46           ` Carl Eugen Hoyos
  0 siblings, 1 reply; 54+ messages in thread
From: Soft Works @ 2022-11-27 16:29 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Carl Eugen Hoyos
> Sent: Sunday, November 27, 2022 4:52 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation
> without DCE
> 
> Am Sa., 26. Nov. 2022 um 20:17 Uhr schrieb L. E. Segovia
> <amy@amyspark.me>:
> >
> > Hi again,
> >
> > Pinging again for review. I've asked for clarification about how
> should
> > the EXTERNAL_<arch> checks be dealt with, but I've not received any
> > response here.
> 
> As said before:
> I regularly compile with MSVC without this patch set and I believe
> the patch set makes our code less readable and harder to maintain.
> 
> Carl Eugen
> _______________________________________________

IMO, relying on DCE makes the code less accessible and understandable,
than having explicit declarations that are clearly indicating which
code is included under which conditions.

How do you set this up when you are compiling with MSVC?

Best,
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 16:29         ` Soft Works
@ 2022-11-27 16:46           ` Carl Eugen Hoyos
  2022-11-27 17:16             ` Soft Works
  0 siblings, 1 reply; 54+ messages in thread
From: Carl Eugen Hoyos @ 2022-11-27 16:46 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am So., 27. Nov. 2022 um 17:29 Uhr schrieb Soft Works <softworkz@hotmail.com>:

> How do you set this up when you are compiling with MSVC?

My configure line to compile with MSVC is:
$ src/configure --enable-gpl --toolchain=msvc --host-os=win32

But maybe I misunderstand your question?

Carl Eugen
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 16:46           ` Carl Eugen Hoyos
@ 2022-11-27 17:16             ` Soft Works
  2022-11-27 17:45               ` Carl Eugen Hoyos
  2022-11-27 17:50               ` Hendrik Leppkes
  0 siblings, 2 replies; 54+ messages in thread
From: Soft Works @ 2022-11-27 17:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Carl Eugen Hoyos
> Sent: Sunday, November 27, 2022 5:47 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation
> without DCE
> 
> Am So., 27. Nov. 2022 um 17:29 Uhr schrieb Soft Works
> <softworkz@hotmail.com>:
> 
> > How do you set this up when you are compiling with MSVC?
> 
> My configure line to compile with MSVC is:
> $ src/configure --enable-gpl --toolchain=msvc --host-os=win32
> 
> But maybe I misunderstand your question?

What I meant is the environment. Are you running this from 
an MSYS shell? Or WSL? 

And does running configure output VS project files, so that
you can compile inside VS (I think this existed at some 
earlier time at least, but I was under the impression that
it's broken)..?

Thanks,
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 17:16             ` Soft Works
@ 2022-11-27 17:45               ` Carl Eugen Hoyos
  2022-11-27 19:23                 ` Soft Works
  2022-11-27 17:50               ` Hendrik Leppkes
  1 sibling, 1 reply; 54+ messages in thread
From: Carl Eugen Hoyos @ 2022-11-27 17:45 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am So., 27. Nov. 2022 um 18:16 Uhr schrieb Soft Works <softworkz@hotmail.com>:
>
>
>
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> > Carl Eugen Hoyos
> > Sent: Sunday, November 27, 2022 5:47 PM
> > To: FFmpeg development discussions and patches <ffmpeg-
> > devel@ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation
> > without DCE

Please consider fixing your mail client.

> > Am So., 27. Nov. 2022 um 17:29 Uhr schrieb Soft Works
> > <softworkz@hotmail.com>:
> >
> > > How do you set this up when you are compiling with MSVC?
> >
> > My configure line to compile with MSVC is:
> > $ src/configure --enable-gpl --toolchain=msvc --host-os=win32
> >
> > But maybe I misunderstand your question?
>
> What I meant is the environment. Are you running this from
> an MSYS shell? Or WSL?

WSL
From what I remember, running configure in MSYS literally
took ages, I don't know if this has improved.

> And does running configure output VS project files

I don't think so.

> so that you can compile inside VS (I think this
> existed at some earlier time at least, but I was
> under the impression that it's broken)..?

Which commit changed behaviour in this respect?

Thank you, Carl Eugen
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 17:16             ` Soft Works
  2022-11-27 17:45               ` Carl Eugen Hoyos
@ 2022-11-27 17:50               ` Hendrik Leppkes
  2022-11-27 18:28                 ` Soft Works
  1 sibling, 1 reply; 54+ messages in thread
From: Hendrik Leppkes @ 2022-11-27 17:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

>
> And does running configure output VS project files, so that
> you can compile inside VS (I think this existed at some
> earlier time at least, but I was under the impression that
> it's broken)..?
>

This was never a feature, and likely never will be. We have our own
build system and its the only supported one.
The compiler is the same regardless, the msvc compiler.

- 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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 17:50               ` Hendrik Leppkes
@ 2022-11-27 18:28                 ` Soft Works
  0 siblings, 0 replies; 54+ messages in thread
From: Soft Works @ 2022-11-27 18:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Hendrik Leppkes
> Sent: Sunday, November 27, 2022 6:51 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation
> without DCE
> 
> >
> > And does running configure output VS project files, so that
> > you can compile inside VS (I think this existed at some
> > earlier time at least, but I was under the impression that
> > it's broken)..?
> >
> 
> This was never a feature, and likely never will be. We have our own
> build system and its the only supported one.
> The compiler is the same regardless, the msvc compiler.

Then I have probably mixed this up with some tool or 
script who did that. I remember it was supposed to create
VS project files in a subfolder named Build (not ffbuild).
(and it was many years ago)

Thanks,
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE
  2022-11-27 17:45               ` Carl Eugen Hoyos
@ 2022-11-27 19:23                 ` Soft Works
  0 siblings, 0 replies; 54+ messages in thread
From: Soft Works @ 2022-11-27 19:23 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Carl Eugen Hoyos
> Sent: Sunday, November 27, 2022 6:45 PM
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation
> without DCE
> 
> Am So., 27. Nov. 2022 um 18:16 Uhr schrieb Soft Works
> <softworkz@hotmail.com>:
> >
> >
> >
> > > -----Original Message-----
> > > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> > > Carl Eugen Hoyos
> > > Sent: Sunday, November 27, 2022 5:47 PM
> > > To: FFmpeg development discussions and patches <ffmpeg-
> > > devel@ffmpeg.org>
> > > Subject: Re: [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation
> > > without DCE
> 
> Please consider fixing your mail client.

What did it do wrong?


> > > Am So., 27. Nov. 2022 um 17:29 Uhr schrieb Soft Works
> > > <softworkz@hotmail.com>:
> > >
> > > > How do you set this up when you are compiling with MSVC?
> > >
> > > My configure line to compile with MSVC is:
> > > $ src/configure --enable-gpl --toolchain=msvc --host-os=win32
> > >
> > > But maybe I misunderstand your question?
> >

> From what I remember, running configure in MSYS literally
> took ages, I don't know if this has improved.

Nope. It's still as horribly long as it was, even with everything
update to latest..

> > What I meant is the environment. Are you running this from
> > an MSYS shell? Or WSL?
> 
> WSL

Ah alright. Probably a better choice when all you need is the scripting
environment.


> > And does running configure output VS project files
> 
> I don't think so.

Sorry, I must have confused this with some external script or
something.
 

I was asking because when it's about msvc, I'm used to picture
someone would be using VS as an IDE. So, yes, the plain msvc
compiler doesn't have a problem with DCE. The problem is when
creating projects to compile and work with the code in the 
VS IDE. And what VS does is pre-parsing the code in the 
background while you're working on it, so you don't really 
need to compile as you see errors and warning while you 
write them. As there's no actual linking being done, this
procedure cannot "simulate" the DCE process and it can only
assume that those symbols that DCE would eliminate are 
missing symbols. The result is that you cannot work in the
IDE because it is full of errors due to this.

Likely, this is also the use case of the submitter of 
this patch.
I'm using VS as well, not for final compilation but 
for writing and debugging as this allows me to work in the
way I want to work. Currently, I'm using Matt Oliver's
VS project generator, which does a really good job in working
around these problems by creating empty definitions for
all these loose ends that are missing (as long as a final
compilation hasn't determined that they aren't actually 
needed.

But this does also have drawbacks: when changes are made
in the ffmpeg base, those definitions may not match
anymore and the projects need to be re-generated (which 
is painful). And the same applies when switching branches,
so I usually have multiple sets of VS project/solutions,
but these still get outdated and I need to re-create 
again.

For these reasons, I would very much welcome when this
situation could be improved. And not only for those but
I also had a situation at some time where I wasted a lot
of time and got quite desperate on something that turned
out to be caused by the code relying on DCE - which wasn't
clear to me in that situation. When you know about it,
then you can live with it, but when not, then it just 
adds to the experience for those who are new to ffmpeg.

Also, I'm not sure whether that is a reasonable use case
for DCE, that it allows you to spare writing a few 
conditionals in the code.

Anyway, I would find it nice if the code would not
rely on DCE anymore.

Best wishes,
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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations
  2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
                     ` (5 preceding siblings ...)
  2022-11-07 14:48   ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
@ 2023-07-28  1:37   ` L. E. Segovia
  2023-07-28 10:40     ` Reimar Döffinger
                       ` (2 more replies)
       [not found]   ` <cover.1690508131.git.amy@amyspark.me>
  7 siblings, 3 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-28  1:37 UTC (permalink / raw)
  To: ffmpeg-devel

Updated for 6.0, any constructive feedback will be appreciated.

L. E. Segovia (4):
  all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM

 fftools/ffprobe.c                          |  16 +-
 fftools/opt_common.c                       |  12 +-
 libavcodec/x86/aacencdsp_init.c            |   2 +
 libavcodec/x86/aacpsdsp_init.c             |   2 +
 libavcodec/x86/ac3dsp_init.c               |   4 +
 libavcodec/x86/audiodsp_init.c             |   2 +
 libavcodec/x86/bswapdsp_init.c             |   2 +
 libavcodec/x86/cavsdsp.c                   |   2 +
 libavcodec/x86/celt_pvq_init.c             |   2 +
 libavcodec/x86/cfhddsp_init.c              |   2 +
 libavcodec/x86/cfhdencdsp_init.c           |   2 +
 libavcodec/x86/dcadsp_init.c               |   2 +
 libavcodec/x86/dct_init.c                  |   2 +
 libavcodec/x86/dnxhdenc_init.c             |   2 +
 libavcodec/x86/exrdsp_init.c               |   2 +
 libavcodec/x86/fdctdsp_init.c              |   2 +
 libavcodec/x86/fft_init.c                  |   2 +
 libavcodec/x86/flacdsp_init.c              |   8 +-
 libavcodec/x86/g722dsp_init.c              |   2 +
 libavcodec/x86/h263dsp_init.c              |   2 +
 libavcodec/x86/h264_intrapred_init.c       |   2 +
 libavcodec/x86/h264chroma_init.c           |   2 +
 libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
 libavcodec/x86/hpeldsp_init.c              |   4 +
 libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
 libavcodec/x86/huffyuvdsp_init.c           |   2 +
 libavcodec/x86/huffyuvencdsp_init.c        |   2 +
 libavcodec/x86/idctdsp_init.c              |  11 +-
 libavcodec/x86/jpeg2000dsp_init.c          |   2 +
 libavcodec/x86/lossless_videodsp_init.c    |   2 +
 libavcodec/x86/lossless_videoencdsp_init.c |   2 +
 libavcodec/x86/me_cmp_init.c               |   2 +
 libavcodec/x86/mlpdsp_init.c               |   6 +-
 libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
 libavcodec/x86/opusdsp_init.c              |   2 +
 libavcodec/x86/pixblockdsp_init.c          |   2 +
 libavcodec/x86/pngdsp_init.c               |   2 +
 libavcodec/x86/proresdsp_init.c            |   2 +
 libavcodec/x86/rv34dsp_init.c              |   2 +
 libavcodec/x86/sbcdsp_init.c               |   2 +
 libavcodec/x86/sbrdsp_init.c               |   2 +
 libavcodec/x86/svq1enc_init.c              |   2 +
 libavcodec/x86/utvideodsp_init.c           |   2 +
 libavcodec/x86/v210enc_init.c              |   6 +-
 libavcodec/x86/vc1dsp_init.c               |   6 +-
 libavcodec/x86/vorbisdsp_init.c            |   2 +
 libavcodec/x86/vp3dsp_init.c               |   2 +
 libavcodec/x86/vp6dsp_init.c               |   2 +
 libavfilter/x86/af_afir_init.c             |   2 +
 libavfilter/x86/af_anlmdn_init.c           |   2 +
 libavfilter/x86/af_volume_init.c           |   2 +
 libavfilter/x86/avf_showcqt_init.c         |   2 +
 libavfilter/x86/colorspacedsp_init.c       |   6 +-
 libavfilter/x86/vf_atadenoise_init.c       |   8 +-
 libavfilter/x86/vf_blend_init.c            |   2 +
 libavfilter/x86/vf_bwdif_init.c            |   2 +
 libavfilter/x86/vf_convolution_init.c      |   2 +-
 libavfilter/x86/vf_framerate_init.c        |   2 +
 libavfilter/x86/vf_fspp_init.c             |   2 +
 libavfilter/x86/vf_gblur_init.c            |   2 +
 libavfilter/x86/vf_hflip_init.c            |   2 +
 libavfilter/x86/vf_limiter_init.c          |   2 +
 libavfilter/x86/vf_maskedclamp_init.c      |   2 +
 libavfilter/x86/vf_maskedmerge_init.c      |   2 +
 libavfilter/x86/vf_overlay_init.c          |   2 +
 libavfilter/x86/vf_pp7_init.c              |   2 +
 libavfilter/x86/vf_psnr_init.c             |   2 +
 libavfilter/x86/vf_removegrain_init.c      |   2 +
 libavfilter/x86/vf_ssim_init.c             |   6 +-
 libavfilter/x86/vf_stereo3d_init.c         |   2 +
 libavfilter/x86/vf_threshold_init.c        |   2 +
 libavfilter/x86/vf_tinterlace_init.c       |   2 +
 libavfilter/x86/vf_transpose_init.c        |   2 +
 libavfilter/x86/vf_v360_init.c             |   2 +
 libavfilter/x86/vf_w3fdif_init.c           |   6 +-
 libavfilter/x86/vf_yadif_init.c            |   2 +
 libavformat/rtmpproto.c                    |  24 +-
 libavutil/x86/fixed_dsp_init.c             |   2 +
 libavutil/x86/float_dsp_init.c             |   2 +
 libavutil/x86/imgutils_init.c              |   2 +
 libavutil/x86/lls_init.c                   |   2 +
 libavutil/x86/pixelutils_init.c            |   2 +
 libswresample/x86/audio_convert_init.c     |   2 +
 libswresample/x86/resample_init.c          |   6 +
 libswscale/x86/rgb2rgb.c                   |   2 +
 libswscale/x86/swscale.c                   |   2 +
 86 files changed, 517 insertions(+), 301 deletions(-)

-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v4 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
       [not found]   ` <cover.1690508131.git.amy@amyspark.me>
@ 2023-07-28  1:37     ` L. E. Segovia
  2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-28  1:37 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/fdctdsp_init.c        |   2 +
 libavcodec/x86/flacdsp_init.c        |   8 +-
 libavcodec/x86/hevcdsp_init.c        | 547 ++++++++++++++-------------
 libavcodec/x86/idctdsp_init.c        |   9 +-
 libavcodec/x86/mlpdsp_init.c         |   6 +-
 libavcodec/x86/vc1dsp_init.c         |   6 +-
 libavfilter/x86/colorspacedsp_init.c |   4 +-
 libavfilter/x86/vf_atadenoise_init.c |   6 +-
 libavfilter/x86/vf_ssim_init.c       |   4 +-
 libavfilter/x86/vf_w3fdif_init.c     |   4 +-
 10 files changed, 311 insertions(+), 285 deletions(-)

diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
index 92a842433d..4a874a640d 100644
--- a/libavcodec/x86/fdctdsp_init.c
+++ b/libavcodec/x86/fdctdsp_init.c
@@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c,
AVCodecContext *avctx,
      if (!high_bit_depth) {
         if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+#if HAVE_INLINE_SSE2
             if (INLINE_SSE2(cpu_flags))
                 c->fdct = ff_fdct_sse2;
+#endif
         }
     }
 }
diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
index 87daed7005..49e67ee2b0 100644
--- a/libavcodec/x86/flacdsp_init.c
+++ b/libavcodec/x86/flacdsp_init.c
@@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c,
enum AVSampleFormat fmt, int
     }
     if (EXTERNAL_AVX(cpu_flags)) {
         if (fmt == AV_SAMPLE_FMT_S16) {
-            if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
+#endif
         } else if (fmt == AV_SAMPLE_FMT_S32) {
             if (channels == 4)
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
+#endif
         }
     }
     if (EXTERNAL_XOP(cpu_flags)) {
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 6f45e5e0db..c7060085a2 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma =
ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma =
ff_hevc_h_loop_filter_chroma_8_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_8_sse2;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_8_sse2;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 -                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
+#endif
             SAO_BAND_INIT(8, sse2);
              c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
@@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
             c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
-            if(ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_8_ssse3;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_8_ssse3;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_8_ssse3;
+            c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_8_ssse3;
+#endif
             SAO_EDGE_INIT(8, ssse3);
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
-
+#if ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
@@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma =
ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma =
ff_hevc_h_loop_filter_chroma_8_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_8_avx;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_8_avx;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 -                c->idct[2] = ff_hevc_idct_16x16_8_avx;
-                c->idct[3] = ff_hevc_idct_32x32_8_avx;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_8_avx;
+            c->idct[3] = ff_hevc_idct_32x32_8_avx;
+#endif
             SAO_BAND_INIT(8, avx);
              c->idct[0] = ff_hevc_idct_4x4_8_avx;
@@ -775,91 +776,91 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
-            if (ARCH_X86_64) {
-                c->put_hevc_epel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_epel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_epel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_8_avx2;
-
-                c->put_hevc_qpel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_qpel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_qpel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_8_avx2;
-
-                c->put_hevc_epel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-
-                c->put_hevc_qpel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-
-                c->put_hevc_qpel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
-
-                c->put_hevc_epel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_epel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_epel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
-
-                c->put_hevc_epel[7][0][1] =
ff_hevc_put_hevc_epel_h32_8_avx2;
-                c->put_hevc_epel[8][0][1] =
ff_hevc_put_hevc_epel_h48_8_avx2;
-                c->put_hevc_epel[9][0][1] =
ff_hevc_put_hevc_epel_h64_8_avx2;
-
-                c->put_hevc_epel_uni[7][0][1] =
ff_hevc_put_hevc_uni_epel_h32_8_avx2;
-                c->put_hevc_epel_uni[8][0][1] =
ff_hevc_put_hevc_uni_epel_h48_8_avx2;
-                c->put_hevc_epel_uni[9][0][1] =
ff_hevc_put_hevc_uni_epel_h64_8_avx2;
-
-                c->put_hevc_epel_bi[7][0][1] =
ff_hevc_put_hevc_bi_epel_h32_8_avx2;
-                c->put_hevc_epel_bi[8][0][1] =
ff_hevc_put_hevc_bi_epel_h48_8_avx2;
-                c->put_hevc_epel_bi[9][0][1] =
ff_hevc_put_hevc_bi_epel_h64_8_avx2;
-
-                c->put_hevc_epel[7][1][0] =
ff_hevc_put_hevc_epel_v32_8_avx2;
-                c->put_hevc_epel[8][1][0] =
ff_hevc_put_hevc_epel_v48_8_avx2;
-                c->put_hevc_epel[9][1][0] =
ff_hevc_put_hevc_epel_v64_8_avx2;
-
-                c->put_hevc_epel_uni[7][1][0] =
ff_hevc_put_hevc_uni_epel_v32_8_avx2;
-                c->put_hevc_epel_uni[8][1][0] =
ff_hevc_put_hevc_uni_epel_v48_8_avx2;
-                c->put_hevc_epel_uni[9][1][0] =
ff_hevc_put_hevc_uni_epel_v64_8_avx2;
-
-                c->put_hevc_epel_bi[7][1][0] =
ff_hevc_put_hevc_bi_epel_v32_8_avx2;
-                c->put_hevc_epel_bi[8][1][0] =
ff_hevc_put_hevc_bi_epel_v48_8_avx2;
-                c->put_hevc_epel_bi[9][1][0] =
ff_hevc_put_hevc_bi_epel_v64_8_avx2;
-
-                c->put_hevc_epel[7][1][1] =
ff_hevc_put_hevc_epel_hv32_8_avx2;
-                c->put_hevc_epel[8][1][1] =
ff_hevc_put_hevc_epel_hv48_8_avx2;
-                c->put_hevc_epel[9][1][1] =
ff_hevc_put_hevc_epel_hv64_8_avx2;
-
-                c->put_hevc_epel_uni[7][1][1] =
ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
-                c->put_hevc_epel_uni[8][1][1] =
ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
-                c->put_hevc_epel_uni[9][1][1] =
ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
-
-                c->put_hevc_epel_bi[7][1][1] =
ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
-                c->put_hevc_epel_bi[8][1][1] =
ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
-                c->put_hevc_epel_bi[9][1][1] =
ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
-
-                c->put_hevc_qpel[7][0][1] =
ff_hevc_put_hevc_qpel_h32_8_avx2;
-                c->put_hevc_qpel[8][0][1] =
ff_hevc_put_hevc_qpel_h48_8_avx2;
-                c->put_hevc_qpel[9][0][1] =
ff_hevc_put_hevc_qpel_h64_8_avx2;
-
-                c->put_hevc_qpel[7][1][0] =
ff_hevc_put_hevc_qpel_v32_8_avx2;
-                c->put_hevc_qpel[8][1][0] =
ff_hevc_put_hevc_qpel_v48_8_avx2;
-                c->put_hevc_qpel[9][1][0] =
ff_hevc_put_hevc_qpel_v64_8_avx2;
-
-                c->put_hevc_qpel_uni[7][0][1] =
ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][1] =
ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][1] =
ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
-
-                c->put_hevc_qpel_uni[7][1][0] =
ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
-                c->put_hevc_qpel_uni[8][1][0] =
ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
-                c->put_hevc_qpel_uni[9][1][0] =
ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
-
-                c->put_hevc_qpel_bi[7][0][1] =
ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][1] =
ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][1] =
ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
-
-                c->put_hevc_qpel_bi[7][1][0] =
ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
-                c->put_hevc_qpel_bi[8][1][0] =
ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
-                c->put_hevc_qpel_bi[9][1][0] =
ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
-            }
+#if ARCH_X86_64
+            c->put_hevc_epel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_epel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_epel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_8_avx2;
+
+            c->put_hevc_qpel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_qpel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_qpel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_8_avx2;
+
+            c->put_hevc_epel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+
+            c->put_hevc_qpel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+
+            c->put_hevc_qpel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+
+            c->put_hevc_epel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_epel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_epel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
+
+            c->put_hevc_epel_uni[7][0][1] =
ff_hevc_put_hevc_uni_epel_h32_8_avx2;
+            c->put_hevc_epel_uni[8][0][1] =
ff_hevc_put_hevc_uni_epel_h48_8_avx2;
+            c->put_hevc_epel_uni[9][0][1] =
ff_hevc_put_hevc_uni_epel_h64_8_avx2;
+
+            c->put_hevc_epel_bi[7][0][1] =
ff_hevc_put_hevc_bi_epel_h32_8_avx2;
+            c->put_hevc_epel_bi[8][0][1] =
ff_hevc_put_hevc_bi_epel_h48_8_avx2;
+            c->put_hevc_epel_bi[9][0][1] =
ff_hevc_put_hevc_bi_epel_h64_8_avx2;
+
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
+
+            c->put_hevc_epel_uni[7][1][0] =
ff_hevc_put_hevc_uni_epel_v32_8_avx2;
+            c->put_hevc_epel_uni[8][1][0] =
ff_hevc_put_hevc_uni_epel_v48_8_avx2;
+            c->put_hevc_epel_uni[9][1][0] =
ff_hevc_put_hevc_uni_epel_v64_8_avx2;
+
+            c->put_hevc_epel_bi[7][1][0] =
ff_hevc_put_hevc_bi_epel_v32_8_avx2;
+            c->put_hevc_epel_bi[8][1][0] =
ff_hevc_put_hevc_bi_epel_v48_8_avx2;
+            c->put_hevc_epel_bi[9][1][0] =
ff_hevc_put_hevc_bi_epel_v64_8_avx2;
+
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
+
+            c->put_hevc_epel_uni[7][1][1] =
ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
+            c->put_hevc_epel_uni[8][1][1] =
ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
+            c->put_hevc_epel_uni[9][1][1] =
ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
+
+            c->put_hevc_epel_bi[7][1][1] =
ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
+            c->put_hevc_epel_bi[8][1][1] =
ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
+            c->put_hevc_epel_bi[9][1][1] =
ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
+
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
+
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
+
+            c->put_hevc_qpel_uni[7][0][1] =
ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][1] =
ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][1] =
ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
+
+            c->put_hevc_qpel_uni[7][1][0] =
ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
+            c->put_hevc_qpel_uni[8][1][0] =
ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
+            c->put_hevc_qpel_uni[9][1][0] =
ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
+
+            c->put_hevc_qpel_bi[7][0][1] =
ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][1] =
ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][1] =
ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
+
+            c->put_hevc_qpel_bi[7][1][0] =
ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
+            c->put_hevc_qpel_bi[8][1][0] =
ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
+            c->put_hevc_qpel_bi[9][1][0] =
ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
+#endif
             SAO_BAND_INIT(8, avx2);
              c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
@@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma =
ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma =
ff_hevc_h_loop_filter_chroma_10_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_10_sse2;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_10_sse2;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_10_sse2;
+            c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_10_sse2;
 -                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
+#endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
 @@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c,
const int bit_depth)
             c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
             c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_10_ssse3;
             c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_10_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
@@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma =
ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma =
ff_hevc_h_loop_filter_chroma_10_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_10_avx;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_10_avx;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 -                c->idct[2] = ff_hevc_idct_16x16_10_avx;
-                c->idct[3] = ff_hevc_idct_32x32_10_avx;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_10_avx;
+            c->idct[3] = ff_hevc_idct_32x32_10_avx;
+#endif
              c->idct[0] = ff_hevc_idct_4x4_10_avx;
             c->idct[1] = ff_hevc_idct_8x8_10_avx;
@@ -942,150 +945,150 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c,
const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
-            if (ARCH_X86_64) {
-                c->put_hevc_epel[5][0][0] =
ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_epel[6][0][0] =
ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_epel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_epel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_epel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_qpel[5][0][0] =
ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_qpel[6][0][0] =
ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_qpel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_qpel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_qpel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[6][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_qpel_uni[5][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[6][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_epel_bi[5][0][0] =
ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_epel_bi[6][0][0] =
ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_epel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_epel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_epel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-                c->put_hevc_qpel_bi[5][0][0] =
ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][0] =
ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel[5][0][1] =
ff_hevc_put_hevc_epel_h16_10_avx2;
-                c->put_hevc_epel[6][0][1] =
ff_hevc_put_hevc_epel_h24_10_avx2;
-                c->put_hevc_epel[7][0][1] =
ff_hevc_put_hevc_epel_h32_10_avx2;
-                c->put_hevc_epel[8][0][1] =
ff_hevc_put_hevc_epel_h48_10_avx2;
-                c->put_hevc_epel[9][0][1] =
ff_hevc_put_hevc_epel_h64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][1] =
ff_hevc_put_hevc_uni_epel_h16_10_avx2;
-                c->put_hevc_epel_uni[6][0][1] =
ff_hevc_put_hevc_uni_epel_h24_10_avx2;
-                c->put_hevc_epel_uni[7][0][1] =
ff_hevc_put_hevc_uni_epel_h32_10_avx2;
-                c->put_hevc_epel_uni[8][0][1] =
ff_hevc_put_hevc_uni_epel_h48_10_avx2;
-                c->put_hevc_epel_uni[9][0][1] =
ff_hevc_put_hevc_uni_epel_h64_10_avx2;
-
-                c->put_hevc_epel_bi[5][0][1] =
ff_hevc_put_hevc_bi_epel_h16_10_avx2;
-                c->put_hevc_epel_bi[6][0][1] =
ff_hevc_put_hevc_bi_epel_h24_10_avx2;
-                c->put_hevc_epel_bi[7][0][1] =
ff_hevc_put_hevc_bi_epel_h32_10_avx2;
-                c->put_hevc_epel_bi[8][0][1] =
ff_hevc_put_hevc_bi_epel_h48_10_avx2;
-                c->put_hevc_epel_bi[9][0][1] =
ff_hevc_put_hevc_bi_epel_h64_10_avx2;
-
-                c->put_hevc_epel[5][1][0] =
ff_hevc_put_hevc_epel_v16_10_avx2;
-                c->put_hevc_epel[6][1][0] =
ff_hevc_put_hevc_epel_v24_10_avx2;
-                c->put_hevc_epel[7][1][0] =
ff_hevc_put_hevc_epel_v32_10_avx2;
-                c->put_hevc_epel[8][1][0] =
ff_hevc_put_hevc_epel_v48_10_avx2;
-                c->put_hevc_epel[9][1][0] =
ff_hevc_put_hevc_epel_v64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][0] =
ff_hevc_put_hevc_uni_epel_v16_10_avx2;
-                c->put_hevc_epel_uni[6][1][0] =
ff_hevc_put_hevc_uni_epel_v24_10_avx2;
-                c->put_hevc_epel_uni[7][1][0] =
ff_hevc_put_hevc_uni_epel_v32_10_avx2;
-                c->put_hevc_epel_uni[8][1][0] =
ff_hevc_put_hevc_uni_epel_v48_10_avx2;
-                c->put_hevc_epel_uni[9][1][0] =
ff_hevc_put_hevc_uni_epel_v64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][0] =
ff_hevc_put_hevc_bi_epel_v16_10_avx2;
-                c->put_hevc_epel_bi[6][1][0] =
ff_hevc_put_hevc_bi_epel_v24_10_avx2;
-                c->put_hevc_epel_bi[7][1][0] =
ff_hevc_put_hevc_bi_epel_v32_10_avx2;
-                c->put_hevc_epel_bi[8][1][0] =
ff_hevc_put_hevc_bi_epel_v48_10_avx2;
-                c->put_hevc_epel_bi[9][1][0] =
ff_hevc_put_hevc_bi_epel_v64_10_avx2;
-
-                c->put_hevc_epel[5][1][1] =
ff_hevc_put_hevc_epel_hv16_10_avx2;
-                c->put_hevc_epel[6][1][1] =
ff_hevc_put_hevc_epel_hv24_10_avx2;
-                c->put_hevc_epel[7][1][1] =
ff_hevc_put_hevc_epel_hv32_10_avx2;
-                c->put_hevc_epel[8][1][1] =
ff_hevc_put_hevc_epel_hv48_10_avx2;
-                c->put_hevc_epel[9][1][1] =
ff_hevc_put_hevc_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][1] =
ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
-                c->put_hevc_epel_uni[6][1][1] =
ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
-                c->put_hevc_epel_uni[7][1][1] =
ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
-                c->put_hevc_epel_uni[8][1][1] =
ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
-                c->put_hevc_epel_uni[9][1][1] =
ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][1] =
ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
-                c->put_hevc_epel_bi[6][1][1] =
ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
-                c->put_hevc_epel_bi[7][1][1] =
ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
-                c->put_hevc_epel_bi[8][1][1] =
ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
-                c->put_hevc_epel_bi[9][1][1] =
ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
-
-                c->put_hevc_qpel[5][0][1] =
ff_hevc_put_hevc_qpel_h16_10_avx2;
-                c->put_hevc_qpel[6][0][1] =
ff_hevc_put_hevc_qpel_h24_10_avx2;
-                c->put_hevc_qpel[7][0][1] =
ff_hevc_put_hevc_qpel_h32_10_avx2;
-                c->put_hevc_qpel[8][0][1] =
ff_hevc_put_hevc_qpel_h48_10_avx2;
-                c->put_hevc_qpel[9][0][1] =
ff_hevc_put_hevc_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][0][1] =
ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
-                c->put_hevc_qpel_uni[6][0][1] =
ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
-                c->put_hevc_qpel_uni[7][0][1] =
ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
-                c->put_hevc_qpel_uni[8][0][1] =
ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
-                c->put_hevc_qpel_uni[9][0][1] =
ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][0][1] =
ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][1] =
ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][1] =
ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][1] =
ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][1] =
ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel[5][1][0] =
ff_hevc_put_hevc_qpel_v16_10_avx2;
-                c->put_hevc_qpel[6][1][0] =
ff_hevc_put_hevc_qpel_v24_10_avx2;
-                c->put_hevc_qpel[7][1][0] =
ff_hevc_put_hevc_qpel_v32_10_avx2;
-                c->put_hevc_qpel[8][1][0] =
ff_hevc_put_hevc_qpel_v48_10_avx2;
-                c->put_hevc_qpel[9][1][0] =
ff_hevc_put_hevc_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][0] =
ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][0] =
ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][0] =
ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][0] =
ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][0] =
ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][0] =
ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][0] =
ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][0] =
ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][0] =
ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][0] =
ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel[5][1][1] =
ff_hevc_put_hevc_qpel_hv16_10_avx2;
-                c->put_hevc_qpel[6][1][1] =
ff_hevc_put_hevc_qpel_hv24_10_avx2;
-                c->put_hevc_qpel[7][1][1] =
ff_hevc_put_hevc_qpel_hv32_10_avx2;
-                c->put_hevc_qpel[8][1][1] =
ff_hevc_put_hevc_qpel_hv48_10_avx2;
-                c->put_hevc_qpel[9][1][1] =
ff_hevc_put_hevc_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][1] =
ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][1] =
ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][1] =
ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][1] =
ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][1] =
ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][1] =
ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][1] =
ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][1] =
ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][1] =
ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][1] =
ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
-            }
+#if ARCH_X86_64
+            c->put_hevc_epel[5][0][0] =
ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_epel[6][0][0] =
ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_epel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_epel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_epel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_qpel[5][0][0] =
ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_qpel[6][0][0] =
ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_qpel[7][0][0] =
ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_qpel[8][0][0] =
ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_qpel[9][0][0] =
ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[6][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_qpel_uni[5][0][0] =
ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[6][0][0] =
ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] =
ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] =
ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] =
ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_epel_bi[5][0][0] =
ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_epel_bi[6][0][0] =
ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_epel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_epel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_epel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][0] =
ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][0] =
ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][0] =
ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][0] =
ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][0] =
ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
+            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][1] =
ff_hevc_put_hevc_uni_epel_h16_10_avx2;
+            c->put_hevc_epel_uni[6][0][1] =
ff_hevc_put_hevc_uni_epel_h24_10_avx2;
+            c->put_hevc_epel_uni[7][0][1] =
ff_hevc_put_hevc_uni_epel_h32_10_avx2;
+            c->put_hevc_epel_uni[8][0][1] =
ff_hevc_put_hevc_uni_epel_h48_10_avx2;
+            c->put_hevc_epel_uni[9][0][1] =
ff_hevc_put_hevc_uni_epel_h64_10_avx2;
+
+            c->put_hevc_epel_bi[5][0][1] =
ff_hevc_put_hevc_bi_epel_h16_10_avx2;
+            c->put_hevc_epel_bi[6][0][1] =
ff_hevc_put_hevc_bi_epel_h24_10_avx2;
+            c->put_hevc_epel_bi[7][0][1] =
ff_hevc_put_hevc_bi_epel_h32_10_avx2;
+            c->put_hevc_epel_bi[8][0][1] =
ff_hevc_put_hevc_bi_epel_h48_10_avx2;
+            c->put_hevc_epel_bi[9][0][1] =
ff_hevc_put_hevc_bi_epel_h64_10_avx2;
+
+            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
+            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][0] =
ff_hevc_put_hevc_uni_epel_v16_10_avx2;
+            c->put_hevc_epel_uni[6][1][0] =
ff_hevc_put_hevc_uni_epel_v24_10_avx2;
+            c->put_hevc_epel_uni[7][1][0] =
ff_hevc_put_hevc_uni_epel_v32_10_avx2;
+            c->put_hevc_epel_uni[8][1][0] =
ff_hevc_put_hevc_uni_epel_v48_10_avx2;
+            c->put_hevc_epel_uni[9][1][0] =
ff_hevc_put_hevc_uni_epel_v64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][0] =
ff_hevc_put_hevc_bi_epel_v16_10_avx2;
+            c->put_hevc_epel_bi[6][1][0] =
ff_hevc_put_hevc_bi_epel_v24_10_avx2;
+            c->put_hevc_epel_bi[7][1][0] =
ff_hevc_put_hevc_bi_epel_v32_10_avx2;
+            c->put_hevc_epel_bi[8][1][0] =
ff_hevc_put_hevc_bi_epel_v48_10_avx2;
+            c->put_hevc_epel_bi[9][1][0] =
ff_hevc_put_hevc_bi_epel_v64_10_avx2;
+
+            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
+            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][1] =
ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
+            c->put_hevc_epel_uni[6][1][1] =
ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
+            c->put_hevc_epel_uni[7][1][1] =
ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
+            c->put_hevc_epel_uni[8][1][1] =
ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
+            c->put_hevc_epel_uni[9][1][1] =
ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][1] =
ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
+            c->put_hevc_epel_bi[6][1][1] =
ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
+            c->put_hevc_epel_bi[7][1][1] =
ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
+            c->put_hevc_epel_bi[8][1][1] =
ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
+            c->put_hevc_epel_bi[9][1][1] =
ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
+
+            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
+            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][0][1] =
ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
+            c->put_hevc_qpel_uni[6][0][1] =
ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
+            c->put_hevc_qpel_uni[7][0][1] =
ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
+            c->put_hevc_qpel_uni[8][0][1] =
ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
+            c->put_hevc_qpel_uni[9][0][1] =
ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][0][1] =
ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][1] =
ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][1] =
ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][1] =
ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][1] =
ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
+            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][0] =
ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][0] =
ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][0] =
ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][0] =
ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][0] =
ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][0] =
ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][0] =
ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][0] =
ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][0] =
ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][0] =
ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
+            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
+            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
+            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
+            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][1] =
ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][1] =
ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][1] =
ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][1] =
ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][1] =
ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][1] =
ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][1] =
ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][1] =
ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][1] =
ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][1] =
ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
+#endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
 @@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c,
const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma =
ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma =
ff_hevc_h_loop_filter_chroma_12_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_12_sse2;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_12_sse2;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_12_sse2;
+            c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_12_sse2;
+#endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
 @@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c,
const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_12_ssse3;
             c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_12_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
@@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c,
const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma =
ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma =
ff_hevc_h_loop_filter_chroma_12_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma =
ff_hevc_v_loop_filter_luma_12_avx;
-                c->hevc_h_loop_filter_luma =
ff_hevc_h_loop_filter_luma_12_avx;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
+#endif
             SAO_BAND_INIT(12, avx);
         }
         if (EXTERNAL_AVX2(cpu_flags)) {
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index f28a1ad744..4ade52a880 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c,
AVCodecContext *avctx,
         }
 #endif
 -        if (ARCH_X86_64 &&
-            !high_bit_depth &&
+#if ARCH_X86_64
+        if (!high_bit_depth &&
             avctx->lowres == 0 &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
                 avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
@@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c,
AVCodecContext *avctx,
                 c->idct_add  = ff_simple_idct8_add_sse2;
                 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
         }
+#endif
     }
 -    if (ARCH_X86_64 && avctx->lowres == 0) {
+#if ARCH_X86_64
+    if (avctx->lowres == 0) {
         if (EXTERNAL_AVX(cpu_flags) &&
             !high_bit_depth &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
@@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c,
AVCodecContext *avctx,
             }
         }
     }
+#endif
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 950f996832..333a685f47 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
-    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags &
AV_CPU_FLAG_BMI2)
+    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
+#endif
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 90b2f3624e..bc63933e83 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 -    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
+#if HAVE_6REGS
+    if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
 -    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
+    if (INLINE_MMXEXT(cpu_flags))
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
+#endif
  #define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
diff --git a/libavfilter/x86/colorspacedsp_init.c
b/libavfilter/x86/colorspacedsp_init.c
index b5006ac295..f01db4baf4 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 -    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags)) {
 #define assign_yuv2yuv_fns(ss) \
         dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] =
ff_yuv2yuv_##ss##p8to8_sse2; \
         dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] =
ff_yuv2yuv_##ss##p8to10_sse2; \
@@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext
*dsp)
          dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
+#endif
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c
b/libavfilter/x86/vf_atadenoise_init.c
index e7a653f191..eb621e172c 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -39,12 +39,14 @@ av_cold void
ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
     int cpu_flags = av_get_cpu_flags();
      for (int p = 0; p < 4; p++) {
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 &&
algorithm == PARALLEL && sigma[p] == INT16_MAX) {
+#if ARCH_X86_64 +        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 &&
algorithm == PARALLEL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
         }
 -        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 &&
algorithm == SERIAL && sigma[p] == INT16_MAX) {
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm ==
SERIAL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
         }
+#endif
     }
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index cbaa20ef16..6f2305430c 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 -    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSSE3(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+#endif
     if (EXTERNAL_SSE4(cpu_flags))
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
diff --git a/libavfilter/x86/vf_w3fdif_init.c
b/libavfilter/x86/vf_w3fdif_init.c
index 16202fba76..6d677d651d 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp,
int depth)
         dsp->filter_scale        = ff_w3fdif_scale_sse2;
     }
 -    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
+#endif
 }
-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v4 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
       [not found]   ` <cover.1690508131.git.amy@amyspark.me>
  2023-07-28  1:37     ` [FFmpeg-devel] [PATCH v4 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2023-07-28  1:38     ` L. E. Segovia
  2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
  2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-28  1:38 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 fftools/ffprobe.c       | 16 +++++++++++-----
 fftools/opt_common.c    | 12 ++++++++++--
 libavformat/rtmpproto.c | 24 ++++++++++++++++++------
 3 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index a39185f6fe..c3e90a9409 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3572,9 +3572,9 @@ static void
ffprobe_show_program_version(WriterContext *w)
     av_bprint_finalize(&pbuf, NULL);
 }
 -#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
-    do {                                                                \
-        if (CONFIG_##LIBNAME) {                                         \
+#define SHOW_LIB_VERSION_0(libname, LIBNAME)
+#define SHOW_LIB_VERSION_1(libname, LIBNAME)                            \
+        {                                                               \
             unsigned int version = libname##_version();                 \
             writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
             print_str("name",    "lib" #libname);                       \
@@ -3584,8 +3584,14 @@ static void
ffprobe_show_program_version(WriterContext *w)
             print_int("version", version);                              \
             print_str("ident",   LIB##LIBNAME##_IDENT);                 \
             writer_print_section_footer(w);                             \
-        }                                                               \
-    } while (0)
+        }
+
+#define SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_ ## cfg(libname, LIBNAME)
+#define SHOW_LIB_VERSION_3(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)
+#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
+    SHOW_LIB_VERSION_3(CONFIG_ ## LIBNAME, libname, LIBNAME)
  static void ffprobe_show_library_versions(WriterContext *w)
 {
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 7c996f140d..5729d656e9 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -153,8 +153,9 @@ static int warned_cfg = 0;
 #define SHOW_CONFIG   4
 #define SHOW_COPYRIGHT 8
 -#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
-    if (CONFIG_##LIBNAME) {                                             \
+#define PRINT_LIB_INFO_0(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_1(libname, LIBNAME, flags, level)                \
+    {                                                                   \
         const char *indent = flags & INDENT? "  " : "";                 \
         if (flags & SHOW_VERSION) {                                     \
             unsigned int version = libname##_version();                 \
@@ -182,6 +183,13 @@ static int warned_cfg = 0;
         }                                                               \
     }                                                                   \
 +#define PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_ ## cfg(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_3(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
+    PRINT_LIB_INFO_3(CONFIG_ ## LIBNAME, libname, LIBNAME, flags, level)
+
 static void print_all_libs_info(int flags, int level)
 {
     PRINT_LIB_INFO(avutil,     AVUTIL,     flags, level);
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f0ef223f05..6d84fcf34f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s,
RTMPContext *rt)
     for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
         tosend[i] = av_lfg_get(&rnd) >> 24;
 -    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+    if (rt->encrypted) {
         /* When the client wants to use RTMPE, we have to change the
command
          * byte to 0x06 which means to use encrypted data and we have
to set
          * the flash version to at least 9.0.115.0. */
@@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s,
RTMPContext *rt)
         if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
             return ret;
     }
+#endif
      client_pos = rtmp_handshake_imprint_with_digest(tosend + 1,
rt->encrypted);
     if (client_pos < 0)
@@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s,
RTMPContext *rt)
         if (ret < 0)
             return ret;
 -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and
initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream,
serverdata + 1,
@@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s,
RTMPContext *rt)
             /* Encrypt the signature received by the server. */
             ff_rtmpe_encrypt_sig(rt->stream, signature, digest,
serverdata[0]);
         }
+#endif
          if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE
- 32, 32)) {
             av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
@@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s,
RTMPContext *rt)
         if (ret < 0)
             return ret;
 -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Encrypt the signature to be send to the server. */
             ff_rtmpe_encrypt_sig(rt->stream, tosend +
                                  RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
                                  serverdata[0]);
         }
+#endif
          // write reply back to the server
         if ((ret = ffurl_write(rt->stream, tosend,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     } else {
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and
initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream,
serverdata + 1,
@@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s,
RTMPContext *rt)
                                      serverdata[0]);
             }
         }
+#endif
          if ((ret = ffurl_write(rt->stream, serverdata + 1,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 -        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     }
      return 0;
-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v4 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
       [not found]   ` <cover.1690508131.git.amy@amyspark.me>
  2023-07-28  1:37     ` [FFmpeg-devel] [PATCH v4 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
  2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
@ 2023-07-28  1:38     ` L. E. Segovia
  2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-28  1:38 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/hpeldsp_init.c | 2 ++
 libavcodec/x86/vc1dsp_init.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 09c48c341e..6bde5a3893 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -224,8 +224,10 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c,
int flags)
 {
     int cpu_flags = av_get_cpu_flags();
 +#if HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         hpeldsp_init_mmx(c, flags);
+#endif
      if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index bc63933e83..65fc28ea35 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 -#if HAVE_6REGS
+#if HAVE_6REGS && HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v4 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
       [not found]   ` <cover.1690508131.git.amy@amyspark.me>
                       ` (2 preceding siblings ...)
  2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
@ 2023-07-28  1:38     ` L. E. Segovia
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-28  1:38 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/aacencdsp_init.c            | 2 ++
 libavcodec/x86/aacpsdsp_init.c             | 2 ++
 libavcodec/x86/ac3dsp_init.c               | 4 ++++
 libavcodec/x86/audiodsp_init.c             | 2 ++
 libavcodec/x86/bswapdsp_init.c             | 2 ++
 libavcodec/x86/cavsdsp.c                   | 2 ++
 libavcodec/x86/celt_pvq_init.c             | 2 ++
 libavcodec/x86/cfhddsp_init.c              | 2 ++
 libavcodec/x86/cfhdencdsp_init.c           | 2 ++
 libavcodec/x86/dcadsp_init.c               | 2 ++
 libavcodec/x86/dct_init.c                  | 2 ++
 libavcodec/x86/dnxhdenc_init.c             | 2 ++
 libavcodec/x86/exrdsp_init.c               | 2 ++
 libavcodec/x86/fft_init.c                  | 2 ++
 libavcodec/x86/g722dsp_init.c              | 2 ++
 libavcodec/x86/h263dsp_init.c              | 2 ++
 libavcodec/x86/h264_intrapred_init.c       | 2 ++
 libavcodec/x86/h264chroma_init.c           | 2 ++
 libavcodec/x86/hevcdsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_vp3_init.c          | 2 ++
 libavcodec/x86/huffyuvdsp_init.c           | 2 ++
 libavcodec/x86/huffyuvencdsp_init.c        | 2 ++
 libavcodec/x86/idctdsp_init.c              | 2 ++
 libavcodec/x86/jpeg2000dsp_init.c          | 2 ++
 libavcodec/x86/lossless_videodsp_init.c    | 2 ++
 libavcodec/x86/lossless_videoencdsp_init.c | 2 ++
 libavcodec/x86/me_cmp_init.c               | 2 ++
 libavcodec/x86/mlpdsp_init.c               | 2 +-
 libavcodec/x86/mpegvideoencdsp_init.c      | 2 ++
 libavcodec/x86/opusdsp_init.c              | 2 ++
 libavcodec/x86/pixblockdsp_init.c          | 2 ++
 libavcodec/x86/pngdsp_init.c               | 2 ++
 libavcodec/x86/proresdsp_init.c            | 2 ++
 libavcodec/x86/rv34dsp_init.c              | 2 ++
 libavcodec/x86/sbcdsp_init.c               | 2 ++
 libavcodec/x86/sbrdsp_init.c               | 2 ++
 libavcodec/x86/svq1enc_init.c              | 2 ++
 libavcodec/x86/utvideodsp_init.c           | 2 ++
 libavcodec/x86/v210enc_init.c              | 6 ++++--
 libavcodec/x86/vc1dsp_init.c               | 2 +-
 libavcodec/x86/vorbisdsp_init.c            | 2 ++
 libavcodec/x86/vp3dsp_init.c               | 2 ++
 libavcodec/x86/vp6dsp_init.c               | 2 ++
 libavfilter/x86/af_afir_init.c             | 2 ++
 libavfilter/x86/af_anlmdn_init.c           | 2 ++
 libavfilter/x86/af_volume_init.c           | 2 ++
 libavfilter/x86/avf_showcqt_init.c         | 2 ++
 libavfilter/x86/colorspacedsp_init.c       | 2 ++
 libavfilter/x86/vf_atadenoise_init.c       | 2 ++
 libavfilter/x86/vf_blend_init.c            | 2 ++
 libavfilter/x86/vf_bwdif_init.c            | 2 ++
 libavfilter/x86/vf_convolution_init.c      | 2 +-
 libavfilter/x86/vf_framerate_init.c        | 2 ++
 libavfilter/x86/vf_fspp_init.c             | 2 ++
 libavfilter/x86/vf_gblur_init.c            | 2 ++
 libavfilter/x86/vf_hflip_init.c            | 2 ++
 libavfilter/x86/vf_limiter_init.c          | 2 ++
 libavfilter/x86/vf_maskedclamp_init.c      | 2 ++
 libavfilter/x86/vf_maskedmerge_init.c      | 2 ++
 libavfilter/x86/vf_overlay_init.c          | 2 ++
 libavfilter/x86/vf_pp7_init.c              | 2 ++
 libavfilter/x86/vf_psnr_init.c             | 2 ++
 libavfilter/x86/vf_removegrain_init.c      | 2 ++
 libavfilter/x86/vf_ssim_init.c             | 2 ++
 libavfilter/x86/vf_stereo3d_init.c         | 2 ++
 libavfilter/x86/vf_threshold_init.c        | 2 ++
 libavfilter/x86/vf_tinterlace_init.c       | 2 ++
 libavfilter/x86/vf_transpose_init.c        | 2 ++
 libavfilter/x86/vf_v360_init.c             | 2 ++
 libavfilter/x86/vf_w3fdif_init.c           | 2 ++
 libavfilter/x86/vf_yadif_init.c            | 2 ++
 libavutil/x86/fixed_dsp_init.c             | 2 ++
 libavutil/x86/float_dsp_init.c             | 2 ++
 libavutil/x86/imgutils_init.c              | 2 ++
 libavutil/x86/lls_init.c                   | 2 ++
 libavutil/x86/pixelutils_init.c            | 2 ++
 libswresample/x86/audio_convert_init.c     | 2 ++
 libswresample/x86/resample_init.c          | 6 ++++++
 libswscale/x86/rgb2rgb.c                   | 2 ++
 libswscale/x86/swscale.c                   | 2 ++
 81 files changed, 167 insertions(+), 5 deletions(-)

diff --git a/libavcodec/x86/aacencdsp_init.c
b/libavcodec/x86/aacencdsp_init.c
index 049a2417d9..7dca1d481b 100644
--- a/libavcodec/x86/aacencdsp_init.c
+++ b/libavcodec/x86/aacencdsp_init.c
@@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float
*in, const float *scaled,
  av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
      if (EXTERNAL_SSE2(cpu_flags))
         s->quant_bands = ff_aac_quantize_bands_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c
index 0b0ee07db4..44d64f5340 100644
--- a/libavcodec/x86/aacpsdsp_init.c
+++ b/libavcodec/x86/aacpsdsp_init.c
@@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float
(*out)[32][2], float L[2][38][64],
  av_cold void ff_psdsp_init_x86(PSDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags)) {
@@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s)
     if (EXTERNAL_FMA3(cpu_flags)) {
         s->hybrid_analysis        = ff_ps_hybrid_analysis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 43b3b4ac85..76a8c0547d 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp,
int32_t *coef, int nb_coefs);
  av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
         if (!(cpu_flags & AV_CPU_FLAG_ATOM))
             c->extract_exponents = ff_ac3_extract_exponents_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
  #define DOWNMIX_FUNC_OPT(ch, opt)                                       \
@@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3)
  void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
  #define SET_DOWNMIX(ch, suf, SUF)                                       \
@@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
         SET_DOWNMIX_ALL(avx,  AVX)
         SET_DOWNMIX_ALL(fma3, FMA3)
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c
index 68aa3b2129..c5f410678e 100644
--- a/libavcodec/x86/audiodsp_init.c
+++ b/libavcodec/x86/audiodsp_init.c
@@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src,
  av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags))
@@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
      if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->scalarproduct_int16 = ff_scalarproduct_int16_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c
index 877bab1a2c..08551f6487 100644
--- a/libavcodec/x86/bswapdsp_init.c
+++ b/libavcodec/x86/bswapdsp_init.c
@@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t
*src, int w);
  av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags))
@@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
         c->bswap_buf = ff_bswap32_buf_ssse3;
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->bswap_buf = ff_bswap32_buf_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 96680836a1..2463481803 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -379,6 +379,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         DSPFUNC(avg, 1,  8, mmxext);
     }
 #endif
+#if HAVE_X86ASM
 #if HAVE_MMX_EXTERNAL
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext;
@@ -393,4 +394,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         c->idct_perm      = FF_IDCT_PERM_TRANSPOSE;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c
index 5a0669e6f2..b88a2f6225 100644
--- a/libavcodec/x86/celt_pvq_init.c
+++ b/libavcodec/x86/celt_pvq_init.c
@@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx  (float *X, int
*y, int K, int N);
  av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
      if (EXTERNAL_AVX_FAST(cpu_flags))
         s->pvq_search = ff_pvq_search_exact_avx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c
index c5d89561ae..a773c365c1 100644
--- a/libavcodec/x86/cfhddsp_init.c
+++ b/libavcodec/x86/cfhddsp_init.c
@@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output,
const int16_t *low, const
  av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c,
int depth, int bayer)
         if (depth == 12 && !bayer)
             c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhdencdsp_init.c
b/libavcodec/x86/cfhdencdsp_init.c
index 5cea39a80a..79b2f10bf7 100644
--- a/libavcodec/x86/cfhdencdsp_init.c
+++ b/libavcodec/x86/cfhdencdsp_init.c
@@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input,
int16_t *low, int16_t *hi
  av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
  #if ARCH_X86_64
@@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
         c->vert_filter = ff_cfhdenc_vert_filter_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 0c78dd1c9e..b407679f6a 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3)
  av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags))
@@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
     }
     if (EXTERNAL_FMA3(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c
index d0e4b34dd3..6756e1e12d 100644
--- a/libavcodec/x86/dct_init.c
+++ b/libavcodec/x86/dct_init.c
@@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const
FFTSample *in);
  av_cold void ff_dct_init_x86(DCTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags))
         s->dct32 = ff_dct32_float_sse2;
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->dct32 = ff_dct32_float_avx;
+#endif
 }
diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c
index fd6f15005a..612b70ad7a 100644
--- a/libavcodec/x86/dnxhdenc_init.c
+++ b/libavcodec/x86/dnxhdenc_init.c
@@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const
uint8_t *pixels,
  av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(av_get_cpu_flags())) {
         if (ctx->cid_table->bit_depth == 8)
             ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c
index 63b3480d8f..f9696d7a91 100644
--- a/libavcodec/x86/exrdsp_init.c
+++ b/libavcodec/x86/exrdsp_init.c
@@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size);
  av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
         dsp->reorder_pixels = ff_reorder_pixels_avx2;
         dsp->predictor      = ff_predictor_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c
index df79d57dc7..065e231edb 100644
--- a/libavcodec/x86/fft_init.c
+++ b/libavcodec/x86/fft_init.c
@@ -26,6 +26,7 @@
  av_cold void ff_fft_init_x86(FFTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (s->nbits > 16)
@@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s)
         s->fft_calc        = ff_fft_calc_avx;
         s->fft_permutation = FF_FFT_PERM_AVX;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c
index 614695193b..700269d62a 100644
--- a/libavcodec/x86/g722dsp_init.c
+++ b/libavcodec/x86/g722dsp_init.c
@@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t
*prev_samples, int xout[2]);
  av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags))
         dsp->apply_qmf = ff_g722_apply_qmf_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c
index ab81063233..57ec1640e3 100644
--- a/libavcodec/x86/h263dsp_init.c
+++ b/libavcodec/x86/h263dsp_init.c
@@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int
stride, int qscale);
  av_cold void ff_h263dsp_init_x86(H263DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMX(cpu_flags)) {
         c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
         c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264_intrapred_init.c
b/libavcodec/x86/h264_intrapred_init.c
index ee46927a24..5518961784 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext
*h, int codec_id,
                                    const int bit_depth,
                                    const int chroma_format_idc)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (bit_depth == 8) {
@@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext
*h, int codec_id,
             h->pred8x8l[HOR_UP_PRED         ] =
ff_pred8x8l_horizontal_up_10_avx;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264chroma_init.c
b/libavcodec/x86/h264chroma_init.c
index 34934b6ad0..57d92ad107 100644
--- a/libavcodec/x86/h264chroma_init.c
+++ b/libavcodec/x86/h264chroma_init.c
@@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx)
  av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
 {
+#if HAVE_X86ASM
     int high_bit_depth = bit_depth > 8;
     int cpu_flags      = av_get_cpu_flags();
 @@ -105,4 +106,5 @@ av_cold void
ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
         c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
         c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index c7060085a2..29c11246ae 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2)
  void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (bit_depth == 8) {
@@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const
int bit_depth)
             SAO_EDGE_INIT(12, avx2);
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 6bde5a3893..99a1ab7310 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -229,6 +229,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c,
int flags)
         hpeldsp_init_mmx(c, flags);
 #endif
 +#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
 @@ -237,6 +238,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c,
int flags)
      if (EXTERNAL_SSSE3(cpu_flags))
         hpeldsp_init_ssse3(c, flags);
+#endif
      if (CONFIG_VP3_DECODER)
         ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);
diff --git a/libavcodec/x86/hpeldsp_vp3_init.c
b/libavcodec/x86/hpeldsp_vp3_init.c
index 1dbd1ba6f9..3dd6c45afa 100644
--- a/libavcodec/x86/hpeldsp_vp3_init.c
+++ b/libavcodec/x86/hpeldsp_vp3_init.c
@@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t
*block,
  av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags,
int flags)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
             c->put_no_rnd_pixels_tab[1][1] =
ff_put_no_rnd_pixels8_x2_exact_mmxext;
             c->put_no_rnd_pixels_tab[1][2] =
ff_put_no_rnd_pixels8_y2_exact_mmxext;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/huffyuvdsp_init.c
b/libavcodec/x86/huffyuvdsp_init.c
index 239d3ca313..445137da87 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t
*dst, const uint16_t *top, co
  av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum
AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 @@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext
*c, enum AVPixelFormat pix
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->add_int16 = ff_add_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/huffyuvencdsp_init.c
b/libavcodec/x86/huffyuvencdsp_init.c
index c9c33b75b4..35d18a040c 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t
*dst, const uint16_t *src1, c
  av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum
AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     av_unused int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 @@ -51,4 +52,5 @@ av_cold void
ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 4ade52a880..3f74da85cd 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t
*idct_permutation,
 av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
  #if ARCH_X86_32
@@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c,
AVCodecContext *avctx,
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/jpeg2000dsp_init.c
b/libavcodec/x86/jpeg2000dsp_init.c
index 7310a1d0e1..0256be8046 100644
--- a/libavcodec/x86/jpeg2000dsp_init.c
+++ b/libavcodec/x86/jpeg2000dsp_init.c
@@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void
*src2, int csize);
  av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE(cpu_flags)) {
         c->mct_decode[FF_DWT97] = ff_ict_float_sse;
@@ -57,4 +58,5 @@ av_cold void
ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videodsp_init.c
b/libavcodec/x86/lossless_videodsp_init.c
index 5690cacaad..720cf98389 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 +#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->add_bytes       = ff_add_bytes_sse2;
         c->add_median_pred = ff_add_median_pred_sse2;
@@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
         c->add_left_pred   = ff_add_left_pred_unaligned_avx2;
         c->add_gradient_pred = ff_add_gradient_pred_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videoencdsp_init.c
b/libavcodec/x86/lossless_videoencdsp_init.c
index 22a4014ef1..26cfcbb4b2 100644
--- a/libavcodec/x86/lossless_videoencdsp_init.c
+++ b/libavcodec/x86/lossless_videoencdsp_init.c
@@ -91,6 +91,7 @@ av_cold void
ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     }
 #endif /* HAVE_INLINE_ASM */
 +#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_sse2;
     }
@@ -102,4 +103,5 @@ av_cold void
ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c
index bc1051c27e..527fdff4a9 100644
--- a/libavcodec/x86/me_cmp_init.c
+++ b/libavcodec/x86/me_cmp_init.c
@@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c,
AVCodecContext *avctx)
  #endif /* HAVE_INLINE_ASM */
 +#if HAVE_X86ASM
     if (EXTERNAL_MMX(cpu_flags)) {
         c->sse[1]            = ff_sse8_mmx;
 #if HAVE_X86ASM
@@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c,
AVCodecContext *avctx)
         c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 333a685f47..4843e1abdb 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,7 +200,7 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
     if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c
b/libavcodec/x86/mpegvideoencdsp_init.c
index ec174b15aa..82f9df4cba 100644
--- a/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/libavcodec/x86/mpegvideoencdsp_init.c
@@ -216,6 +216,7 @@ av_cold void
ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
 {
     int cpu_flags = av_get_cpu_flags();
 +#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_sse2;
         c->pix_norm1   = ff_pix_norm1_sse2;
@@ -224,6 +225,7 @@ av_cold void
ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
     if (EXTERNAL_XOP(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_xop;
     }
+#endif /* HAVE_X86ASM */
  #if HAVE_INLINE_ASM
 diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c
index 582fbb4f0c..4598657116 100644
--- a/libavcodec/x86/opusdsp_init.c
+++ b/libavcodec/x86/opusdsp_init.c
@@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in,
float coeff, int len);
  av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_FMA3(cpu_flags)) {
         ctx->postfilter = ff_opus_postfilter_fma3;
         ctx->deemphasis = ff_opus_deemphasis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pixblockdsp_init.c
b/libavcodec/x86/pixblockdsp_init.c
index 51f2a0033a..9d3aac4c74 100644
--- a/libavcodec/x86/pixblockdsp_init.c
+++ b/libavcodec/x86/pixblockdsp_init.c
@@ -31,6 +31,7 @@ av_cold void
ff_pixblockdsp_init_x86(PixblockDSPContext *c,
                                      AVCodecContext *avctx,
                                      unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ av_cold void
ff_pixblockdsp_init_x86(PixblockDSPContext *c,
         c->diff_pixels_unaligned =
         c->diff_pixels = ff_diff_pixels_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c
index e2cd5effe3..c6562f7abb 100644
--- a/libavcodec/x86/pngdsp_init.c
+++ b/libavcodec/x86/pngdsp_init.c
@@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
  av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMXEXT(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
         dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
     if (EXTERNAL_SSSE3(cpu_flags))
         dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/proresdsp_init.c
b/libavcodec/x86/proresdsp_init.c
index bde79ab8c0..01e5e67236 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst,
ptrdiff_t linesize,
  av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp,
AVCodecContext *avctx)
 {
+#if HAVE_X86ASM
 #if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 @@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext
*dsp, AVCodecContext *avctx)
         }
     }
 #endif /* ARCH_X86_64 */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index caa5c2d653..f76bef39e1 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t
stride, int16_t *block);
  av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMXEXT(cpu_flags)) {
@@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2;
     if (EXTERNAL_SSE4(cpu_flags))
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c
index 7416a86ac6..79914cc565 100644
--- a/libavcodec/x86/sbcdsp_init.c
+++ b/libavcodec/x86/sbcdsp_init.c
@@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t
sb_sample_f[16][2][8],
  av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMX(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
         s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
         s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 999f681220..d70ffa0d6c 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2],
float phi[3][2][2]);
  av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags)) {
@@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
     if (EXTERNAL_SSE3(cpu_flags)) {
         s->autocorrelate = ff_sbr_autocorrelate_sse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c
index daf573beba..c016811822 100644
--- a/libavcodec/x86/svq1enc_init.c
+++ b/libavcodec/x86/svq1enc_init.c
@@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1,
const int16_t *pix2,
  av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
         c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/utvideodsp_init.c
b/libavcodec/x86/utvideodsp_init.c
index 2b436c6c5c..e81f6bf3c0 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r,
uint16_t *src_g, uint16_t *sr
  av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
         c->restore_rgb_planes   = ff_restore_rgb_planes_avx2;
         c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index 44f22ca7fe..656f0e21c7 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -46,6 +46,7 @@ void ff_v210_planar_pack_10_avx512icl(const uint16_t
*y, const uint16_t *u,
  av_cold void ff_v210enc_init_x86(V210EncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSSE3(cpu_flags)) {
@@ -66,10 +67,10 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
     if (EXTERNAL_AVX512(cpu_flags)) {
         s->sample_factor_8  = 2;
         s->pack_line_8      = ff_v210_planar_pack_8_avx512;
-#if ARCH_X86_64
+#   if ARCH_X86_64
         s->sample_factor_10  = 2;
         s->pack_line_10      = ff_v210_planar_pack_10_avx512;
-#endif
+#   endif
     }
      if (EXTERNAL_AVX512ICL(cpu_flags)) {
@@ -78,4 +79,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
         s->sample_factor_10 = 4;
         s->pack_line_10     = ff_v210_planar_pack_10_avx512icl;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 65fc28ea35..ea6c0fa0fe 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 -#if HAVE_6REGS && HAVE_INLINE_ASM
+#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_X86ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
diff --git a/libavcodec/x86/vorbisdsp_init.c
b/libavcodec/x86/vorbisdsp_init.c
index 08a3bb2965..067b92e2a4 100644
--- a/libavcodec/x86/vorbisdsp_init.c
+++ b/libavcodec/x86/vorbisdsp_init.c
@@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float
*ang,
  av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags))
         dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index f54fa57b3e..7d69956d22 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst,
const uint8_t *a,
  av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMX(cpu_flags)) {
@@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int
flags)
         c->idct_put  = ff_vp3_idct_put_sse2;
         c->idct_add  = ff_vp3_idct_add_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c
index 83d45ec36c..6a3bf36bae 100644
--- a/libavcodec/x86/vp6dsp_init.c
+++ b/libavcodec/x86/vp6dsp_init.c
@@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t
*src, ptrdiff_t stride,
  av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
         c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c
index e53817b9c0..3561d9fe3f 100644
--- a/libavfilter/x86/af_afir_init.c
+++ b/libavfilter/x86/af_afir_init.c
@@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t,
const float *c,
  av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE3(cpu_flags)) {
@@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
     if (EXTERNAL_AVX_FAST(cpu_flags)) {
         s->fcmul_add = ff_fcmul_add_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_anlmdn_init.c
b/libavfilter/x86/af_anlmdn_init.c
index 30eff6f644..047d88b795 100644
--- a/libavfilter/x86/af_anlmdn_init.c
+++ b/libavfilter/x86/af_anlmdn_init.c
@@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1,
const float *f2,
  av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags)) {
         s->compute_distance_ssd = ff_compute_distance_ssd_sse;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_volume_init.c
b/libavfilter/x86/af_volume_init.c
index 88f5a9679a..28cfbe1ce1 100644
--- a/libavfilter/x86/af_volume_init.c
+++ b/libavfilter/x86/af_volume_init.c
@@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const
uint8_t *src, int len,
  av_cold void ff_volume_init_x86(VolumeContext *vol)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     enum AVSampleFormat sample_fmt =
av_get_packed_sample_fmt(vol->sample_fmt);
 @@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol)
             vol->samples_align = 8;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/avf_showcqt_init.c
b/libavfilter/x86/avf_showcqt_init.c
index 2320b30239..1a5534a12e 100644
--- a/libavfilter/x86/avf_showcqt_init.c
+++ b/libavfilter/x86/avf_showcqt_init.c
@@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len)
  av_cold void ff_showcqt_init_x86(ShowCQTContext *s)
 {
+#if HAVE_X86ASM
     int cpuflags = av_get_cpu_flags();
  #define SELECT_CQT_CALC(type, TYPE, align, perm) \
@@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \
     SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm
     SELECT_CQT_CALC(avx,  AVX_FAST,  8, 01452367);
     SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367);
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/colorspacedsp_init.c
b/libavfilter/x86/colorspacedsp_init.c
index f01db4baf4..66c25cb361 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t
stride, int w, int h,
  void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
  #if ARCH_X86_64
@@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext
*dsp)
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c
b/libavfilter/x86/vf_atadenoise_init.c
index eb621e172c..8ec98f1a82 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const
uint8_t *src, uint8_t *dst,
  av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int
depth, int algorithm, const float *sigma)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      for (int p = 0; p < 4; p++) {
@@ -49,4 +50,5 @@ av_cold void
ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
         }
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_blend_init.c
b/libavfilter/x86/vf_blend_init.c
index c326c43362..6d57bf7eac 100644
--- a/libavfilter/x86/vf_blend_init.c
+++ b/libavfilter/x86/vf_blend_init.c
@@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2)
  av_cold void ff_blend_init_x86(FilterParams *param, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (depth == 8) {
@@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param,
int depth)
         }
 #endif /* ARCH_X86_64 */
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_bwdif_init.c
b/libavfilter/x86/vf_bwdif_init.c
index 57f908a8ef..e20c655a9b 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -52,6 +52,7 @@ void ff_bwdif_filter_line_12bit_avx2(void *dst, void
*prev, void *cur, void *nex
  av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif, int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (bit_depth <= 8) {
@@ -69,4 +70,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif,
int bit_depth)
         if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_convolution_init.c
b/libavfilter/x86/vf_convolution_init.c
index bff10ca1a4..5b5d1b672b 100644
--- a/libavfilter/x86/vf_convolution_init.c
+++ b/libavfilter/x86/vf_convolution_init.c
@@ -36,7 +36,7 @@ void ff_filter_sobel_avx512icl(uint8_t *dst, int width,
  av_cold void ff_convolution_init_x86(ConvolutionContext *s)
 {
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     int i;
     int cpu_flags = av_get_cpu_flags();
     for (i = 0; i < 4; i++) {
diff --git a/libavfilter/x86/vf_framerate_init.c
b/libavfilter/x86/vf_framerate_init.c
index 9d40faf0a4..b4a9dc574d 100644
--- a/libavfilter/x86/vf_framerate_init.c
+++ b/libavfilter/x86/vf_framerate_init.c
@@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS);
  void ff_framerate_init_x86(FrameRateContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (s->bitdepth == 8) {
         if (EXTERNAL_AVX2_FAST(cpu_flags))
@@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s)
         else if (EXTERNAL_SSE4(cpu_flags))
             s->blend = ff_blend_frames16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c
index 8e00317cb7..3618b70dc3 100644
--- a/libavfilter/x86/vf_fspp_init.c
+++ b/libavfilter/x86/vf_fspp_init.c
@@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t
*pixels, ptrdiff_t line_size,
  av_cold void ff_fspp_init_x86(FSPPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMX(cpu_flags)) {
@@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s)
         s->row_idct     = ff_row_idct_mmx;
         s->row_fdct     = ff_row_fdct_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_gblur_init.c
b/libavfilter/x86/vf_gblur_init.c
index b47f6fbffb..01e1b82131 100644
--- a/libavfilter/x86/vf_gblur_init.c
+++ b/libavfilter/x86/vf_gblur_init.c
@@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width,
int height, int column_begi
  av_cold void ff_gblur_init_x86(GBlurContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags)) {
@@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s)
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_hflip_init.c
b/libavfilter/x86/vf_hflip_init.c
index 0ac399b0d4..743b368ee9 100644
--- a/libavfilter/x86/vf_hflip_init.c
+++ b/libavfilter/x86/vf_hflip_init.c
@@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t
*dst, int w);
  av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int i;
 @@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int
step[4], int nb_planes)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_limiter_init.c
b/libavfilter/x86/vf_limiter_init.c
index 07c733dc21..2c26f90f0f 100644
--- a/libavfilter/x86/vf_limiter_init.c
+++ b/libavfilter/x86/vf_limiter_init.c
@@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t
*dst,
  void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
             dsp->limiter = ff_limiter_16bit_sse4;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedclamp_init.c
b/libavfilter/x86/vf_maskedclamp_init.c
index 2a5388abac..94217cf485 100644
--- a/libavfilter/x86/vf_maskedclamp_init.c
+++ b/libavfilter/x86/vf_maskedclamp_init.c
@@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc,
uint8_t *dst,
  av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int
depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -43,4 +44,5 @@ av_cold void
ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
     if (EXTERNAL_SSE4(cpu_flags) && depth > 8) {
         dsp->maskedclamp = ff_maskedclamp16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedmerge_init.c
b/libavfilter/x86/vf_maskedmerge_init.c
index 73ab888083..2eee4a36c2 100644
--- a/libavfilter/x86/vf_maskedmerge_init.c
+++ b/libavfilter/x86/vf_maskedmerge_init.c
@@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const
uint8_t *osrc,
  av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) {
         s->maskedmerge = ff_maskedmerge8_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_overlay_init.c
b/libavfilter/x86/vf_overlay_init.c
index d4218b18f6..9f7d9c4909 100644
--- a/libavfilter/x86/vf_overlay_init.c
+++ b/libavfilter/x86/vf_overlay_init.c
@@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da,
uint8_t *s, uint8_t *a,
 av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int
pix_format,
                                  int alpha_format, int main_has_alpha)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE4(cpu_flags) &&
@@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s,
int format, int pix_format,
         s->blend_row[1] = ff_overlay_row_22_sse4;
         s->blend_row[2] = ff_overlay_row_22_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c
index 165b0dd5d0..ed5ab82794 100644
--- a/libavfilter/x86/vf_pp7_init.c
+++ b/libavfilter/x86/vf_pp7_init.c
@@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src);
  av_cold void ff_pp7_init_x86(PP7Context *p)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_MMX(cpu_flags))
         p->dctB = ff_pp7_dctB_mmx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c
index c387812204..82be86d923 100644
--- a/libavfilter/x86/vf_psnr_init.c
+++ b/libavfilter/x86/vf_psnr_init.c
@@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf,
const uint8_t *ref, int w);
  void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
@@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
             dsp->sse_line = ff_sse_line_16bit_sse2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_removegrain_init.c
b/libavfilter/x86/vf_removegrain_init.c
index 07314b3244..ff5f4771d2 100644
--- a/libavfilter/x86/vf_removegrain_init.c
+++ b/libavfilter/x86/vf_removegrain_init.c
@@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src,
ptrdiff_t stride, int pix
  av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
 {
+#if HAVE_X86ASM
 #if CONFIG_GPL
     int cpu_flags = av_get_cpu_flags();
     int i;
@@ -85,4 +86,5 @@ av_cold void
ff_removegrain_init_x86(RemoveGrainContext *rg)
             }
     }
 #endif /* CONFIG_GPL */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index 6f2305430c..ef39247056 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4],
const int (*sum1)[4], int w);
  void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
  #if ARCH_X86_64
@@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_xop;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_stereo3d_init.c
b/libavfilter/x86/vf_stereo3d_init.c
index da160a89a0..abd682ee80 100644
--- a/libavfilter/x86/vf_stereo3d_init.c
+++ b/libavfilter/x86/vf_stereo3d_init.c
@@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc,
uint8_t *rsrc,
  void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE4(cpu_flags)) {
         dsp->anaglyph = ff_anaglyph_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_threshold_init.c
b/libavfilter/x86/vf_threshold_init.c
index 8e42296791..151a94f429 100644
--- a/libavfilter/x86/vf_threshold_init.c
+++ b/libavfilter/x86/vf_threshold_init.c
@@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2)
  av_cold void ff_threshold_init_x86(ThresholdContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (s->depth == 8) {
@@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s)
             s->threshold = ff_threshold16_avx2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_tinterlace_init.c
b/libavfilter/x86/vf_tinterlace_init.c
index 1c25a2bb7a..c30a3247a2 100644
--- a/libavfilter/x86/vf_tinterlace_init.c
+++ b/libavfilter/x86/vf_tinterlace_init.c
@@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp,
ptrdiff_t linesize,
  av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (s->csp->comp[0].depth > 8) {
@@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_transpose_init.c
b/libavfilter/x86/vf_transpose_init.c
index 95c56eab73..7db2e66258 100644
--- a/libavfilter/x86/vf_transpose_init.c
+++ b/libavfilter/x86/vf_transpose_init.c
@@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src,
  av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) {
@@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int
pixstep)
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) {
         v->transpose_8x8 = ff_transpose_8x8_16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c
index 2b2b06dd40..6b1b3811aa 100644
--- a/libavfilter/x86/vf_v360_init.c
+++ b/libavfilter/x86/vf_v360_init.c
@@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int
width, const uint8_t *src, ptrd
  av_cold void ff_v360_init_x86(V360Context *s, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth
<= 8)
@@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth)
                                           s->interp == MITCHELL) &&
depth <= 8)
         s->remap_line = ff_remap4_8bit_line_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_w3fdif_init.c
b/libavfilter/x86/vf_w3fdif_init.c
index 6d677d651d..d023ef7a49 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const
int32_t *work_pixel,
  av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp,
int depth)
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_yadif_init.c
b/libavfilter/x86/vf_yadif_init.c
index 257c3f9199..54917fa104 100644
--- a/libavfilter/x86/vf_yadif_init.c
+++ b/libavfilter/x86/vf_yadif_init.c
@@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void
*prev, void *cur,
  av_cold void ff_yadif_init_x86(YADIFContext *yadif)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8
                                   : yadif->csp->comp[0].depth;
@@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
         if (EXTERNAL_SSSE3(cpu_flags))
             yadif->filter_line = ff_yadif_filter_line_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c
index d3f4b2e325..eb84027dbf 100644
--- a/libavutil/x86/fixed_dsp_init.c
+++ b/libavutil/x86/fixed_dsp_init.c
@@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0,
int *av_restrict src1, int
  av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE2(cpu_flags)) {
         fdsp->butterflies_fixed = ff_butterflies_fixed_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c
index ad6b506259..7495c0b9a8 100644
--- a/libavutil/x86/float_dsp_init.c
+++ b/libavutil/x86/float_dsp_init.c
@@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0,
float *av_restrict src1,
  av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      if (EXTERNAL_SSE(cpu_flags)) {
@@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext
*fdsp)
         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3;
         fdsp->scalarproduct_float = ff_scalarproduct_float_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c
index 91a16cf594..feac5d6fc7 100644
--- a/libavutil/x86/imgutils_init.c
+++ b/libavutil/x86/imgutils_init.c
@@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t
*dst, ptrdiff_t dst_linesize,
                                     const uint8_t *src, ptrdiff_t
src_linesize,
                                     ptrdiff_t bytewidth, int height)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64);
 @@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t
*dst, ptrdiff_t dst_linesize,
         ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src,
src_linesize,
                                          bw_aligned, height);
     else
+#endif /* HAVE_X86ASM */
         return AVERROR(ENOSYS);
      return 0;
diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c
index c786376915..67470185da 100644
--- a/libavutil/x86/lls_init.c
+++ b/libavutil/x86/lls_init.c
@@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double
*var, int order);
  av_cold void ff_init_lls_x86(LLSModel *m)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE2(cpu_flags)) {
         m->update_lls = ff_update_lls_sse2;
@@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m)
     if (EXTERNAL_FMA3_FAST(cpu_flags)) {
         m->update_lls = ff_update_lls_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/pixelutils_init.c
b/libavutil/x86/pixelutils_init.c
index c3c0662414..a2f842041d 100644
--- a/libavutil/x86/pixelutils_init.c
+++ b/libavutil/x86/pixelutils_init.c
@@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t
*src1, ptrdiff_t stride1,
  void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
      // The best way to use SSE2 would be to do 2 SADs in parallel,
@@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn
*sad, int aligned)
         case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1
  aligned, src2   aligned
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/audio_convert_init.c
b/libswresample/x86/audio_convert_init.c
index f6d36f9ca6..d9eb43e1d5 100644
--- a/libswresample/x86/audio_convert_init.c
+++ b/libswresample/x86/audio_convert_init.c
@@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct
AudioConvert *ac,
             ac->simd_f =  ff_int32_to_int16_a_ ## cap;\
     }
 +#if HAVE_X86ASM
 MULTI_CAPS_FUNC(SSE2, sse2)
      if(EXTERNAL_SSE(mm_flags)) {
@@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2)
         if(   out_fmt == AV_SAMPLE_FMT_S32  && in_fmt ==
AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt ==
AV_SAMPLE_FMT_FLTP)
             ac->simd_f =  ff_float_to_int32_a_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/resample_init.c
b/libswresample/x86/resample_init.c
index d13ccd4833..4eebf5d6f9 100644
--- a/libswresample/x86/resample_init.c
+++ b/libswresample/x86/resample_init.c
@@ -51,6 +51,7 @@ av_cold void
swri_resample_dsp_x86_init(ResampleContext *c)
      switch(c->format){
     case AV_SAMPLE_FMT_S16P:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_int16_sse2;
             c->dsp.resample_common = ff_resample_common_int16_sse2;
@@ -59,8 +60,10 @@ av_cold void
swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_int16_xop;
             c->dsp.resample_common = ff_resample_common_int16_xop;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_FLTP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_float_sse;
             c->dsp.resample_common = ff_resample_common_float_sse;
@@ -77,8 +80,10 @@ av_cold void
swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_float_fma4;
             c->dsp.resample_common = ff_resample_common_float_fma4;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_DBLP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_double_sse2;
             c->dsp.resample_common = ff_resample_common_double_sse2;
@@ -91,6 +96,7 @@ av_cold void
swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_double_fma3;
             c->dsp.resample_common = ff_resample_common_double_fma3;
         }
+#endif /* HAVE_X86ASM */
         break;
     }
 }
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index b325e5dbd5..e39f327bf2 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void)
         rgb2rgb_init_avx();
 #endif /* HAVE_INLINE_ASM */
 +#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext;
     }
@@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void)
         uyvytoyuv422 = ff_uyvytoyuv422_avx;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..0a14262916 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -529,6 +529,7 @@ switch(c->dstBpc){ \
              else                ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1,
opt2); \
              break; \
     }
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
         ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
@@ -805,4 +806,5 @@ switch(c->dstBpc){ \
     }
  #endif
+#endif /* HAVE_X86ASM */
 }
-- 
2.41.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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations
  2023-07-28  1:37   ` [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations L. E. Segovia
@ 2023-07-28 10:40     ` Reimar Döffinger
  2023-07-28 10:48       ` Reimar Döffinger
  2023-07-29 19:07     ` [FFmpeg-devel] [PATCH v5 " L. E. Segovia
       [not found]     ` <cover.1690657578.git.amy@amyspark.me>
  2 siblings, 1 reply; 54+ messages in thread
From: Reimar Döffinger @ 2023-07-28 10:40 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


> On 28 Jul 2023, at 03:37, L. E. Segovia <amy@amyspark.me> wrote:
>
> Updated for 6.0, any constructive feedback will be appreciated.

Using #if means the code will not even be compile tested if the
feature is disabled, this makes maintenance especially of rare
features much harder (nevermind code readability).
Also I believe we do not support compiling without optimizations
even on primary platforms like Linux/gcc, so I'd find it very unlikely
we'd want that for MSVC.
At least there would have to be a very good argument why this is so
important to have that we'd accept the drawbacks.

Best regards,
Reimar
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations
  2023-07-28 10:40     ` Reimar Döffinger
@ 2023-07-28 10:48       ` Reimar Döffinger
  2023-07-28 10:55         ` Nicolas George
  0 siblings, 1 reply; 54+ messages in thread
From: Reimar Döffinger @ 2023-07-28 10:48 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> On 28 Jul 2023, at 12:40, Reimar Döffinger <Reimar.Doeffinger@gmx.de> wrote:
> 
> 
>> On 28 Jul 2023, at 03:37, L. E. Segovia <amy@amyspark.me> wrote:
>> 
>> Updated for 6.0, any constructive feedback will be appreciated.
> 
> Using #if means the code will not even be compile tested if the
> feature is disabled, this makes maintenance especially of rare
> features much harder (nevermind code readability).
> Also I believe we do not support compiling without optimizations
> even on primary platforms like Linux/gcc, so I'd find it very unlikely
> we'd want that for MSVC.
> At least there would have to be a very good argument why this is so
> important to have that we'd accept the drawbacks.

Since you asked for constructive feedback:
I assume the issue is missing symbols during linking?
If you really want this, why not create a file that provides dummy
symbols for all that are missing, concentrating the #if mess in
a single place and avoiding affecting any of the regular code, and thus
having no impact at all when compiling with optimizations.
Yes, it's likely to be a good bit of maintenance effort for those who
want to use it, but at least anyone not caring about this feature can
ignore it, so at least I would not have a reason to be against it.

Best regards,
Reimar
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations
  2023-07-28 10:48       ` Reimar Döffinger
@ 2023-07-28 10:55         ` Nicolas George
  2023-07-28 13:21           ` Matt Oliver
  0 siblings, 1 reply; 54+ messages in thread
From: Nicolas George @ 2023-07-28 10:55 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 872 bytes --]

Reimar Döffinger (12023-07-28):
> I assume the issue is missing symbols during linking?
> If you really want this, why not create a file that provides dummy
> symbols for all that are missing, concentrating the #if mess in
> a single place and avoiding affecting any of the regular code, and thus
> having no impact at all when compiling with optimizations.
> Yes, it's likely to be a good bit of maintenance effort for those who
> want to use it, but at least anyone not caring about this feature can
> ignore it, so at least I would not have a reason to be against it.

This is an interesting idea. It would even be possible to include a tool
that generate these stubs directly from the linker's errors, reducing
the maintenance.

Maybe even make the stubs static inline functions rather than actual
linking symbols.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations
  2023-07-28 10:55         ` Nicolas George
@ 2023-07-28 13:21           ` Matt Oliver
  2023-07-29 18:57             ` L. E. Segovia
  0 siblings, 1 reply; 54+ messages in thread
From: Matt Oliver @ 2023-07-28 13:21 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Fri, 28 Jul 2023 at 20:55, Nicolas George <george@nsup.org> wrote:

> Reimar Döffinger (12023-07-28):
> > I assume the issue is missing symbols during linking?
> > If you really want this, why not create a file that provides dummy
> > symbols for all that are missing, concentrating the #if mess in
> > a single place and avoiding affecting any of the regular code, and thus
> > having no impact at all when compiling with optimizations.
> > Yes, it's likely to be a good bit of maintenance effort for those who
> > want to use it, but at least anyone not caring about this feature can
> > ignore it, so at least I would not have a reason to be against it.
>
> This is an interesting idea. It would even be possible to include a tool
> that generate these stubs directly from the linker's errors, reducing
> the maintenance.
>
> Maybe even make the stubs static inline functions rather than actual
> linking symbols.
>

The issue with dead code elimination and msvc has been raised many times
over the years and the general response has been to not support it. The
last discussion was back in 2016 (
https://ffmpeg.org/pipermail/ffmpeg-devel/2016-December/204530.html) which
apparently was by me.
There was an attempt previously by someone to try and semi-manually add all
the missing symbols using dummy functions but it obviously didnt go
anywhere as if I remember correctly it was difficult to track them all down
for all possible configuration options and maintaining it was just too hard
and it never got completed. I dont have the link but if you crawl through
old mailing list posts it is in there somewhere.

About a decade ago I went the auto generation route and created a tool that
generated Visual Studio projects by scanning ffmpegs make/configure files
and as part of that the tool creates dummy files with all the missing
symbols for the requested configuration options (
https://github.com/ShiftMediaProject/FFVS-Project-Generator). Its not the
most readable code but it does work. Whats potentially more interesting is
over all the years that project has been used the number of dummy dce stubs
has decreased from what used to be there when some of those early attempts
I mentioned were made. However just checking it now shows that there are
still a good 1000 dummy functions created for avcodec alone, although
admittedly theres only about a dozen for all the other libs. So a
pre-processing tool can work nicely, the trick is to be able to get it to
work with different compilers as the command line options and output format
is slightly different and that only gives you the function name you still
need to then scan the code to work out the correct types for the functions
parameters and return types in order to make a dummy stub.
_______________________________________________
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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations
  2023-07-28 13:21           ` Matt Oliver
@ 2023-07-29 18:57             ` L. E. Segovia
  0 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-29 18:57 UTC (permalink / raw)
  To: ffmpeg-devel

Hi all,

Yes, the linking step bails out with optimizations disabled under MSVC.
The rest of the compilers perform DCE even at -O0, but under Windows,
the /FORCE:UNRESOLVED linker flag is needed to work around this.

As for the stub generation --  given the amount of places that these
patches touch, and that someone would need to figure out a complete
configuration to test them all, I believe it's very much infeasible.
Conversely, hooking into the macro uses makes testing as simple as
one run with /O2 and another with /O0 -- which we use in development
as well.

best,

amyspark

On 28/07/2023 10:21, Matt Oliver wrote:
> On Fri, 28 Jul 2023 at 20:55, Nicolas George <george@nsup.org> wrote:
> 
>> Reimar Döffinger (12023-07-28):
>>> I assume the issue is missing symbols during linking?
>>> If you really want this, why not create a file that provides dummy
>>> symbols for all that are missing, concentrating the #if mess in
>>> a single place and avoiding affecting any of the regular code, and thus
>>> having no impact at all when compiling with optimizations.
>>> Yes, it's likely to be a good bit of maintenance effort for those who
>>> want to use it, but at least anyone not caring about this feature can
>>> ignore it, so at least I would not have a reason to be against it.
>>
>> This is an interesting idea. It would even be possible to include a tool
>> that generate these stubs directly from the linker's errors, reducing
>> the maintenance.
>>
>> Maybe even make the stubs static inline functions rather than actual
>> linking symbols.
>>
> 
> The issue with dead code elimination and msvc has been raised many times
> over the years and the general response has been to not support it. The
> last discussion was back in 2016 (
> https://ffmpeg.org/pipermail/ffmpeg-devel/2016-December/204530.html) which
> apparently was by me.
> There was an attempt previously by someone to try and semi-manually add all
> the missing symbols using dummy functions but it obviously didnt go
> anywhere as if I remember correctly it was difficult to track them all down
> for all possible configuration options and maintaining it was just too hard
> and it never got completed. I dont have the link but if you crawl through
> old mailing list posts it is in there somewhere.
> 
> About a decade ago I went the auto generation route and created a tool that
> generated Visual Studio projects by scanning ffmpegs make/configure files
> and as part of that the tool creates dummy files with all the missing
> symbols for the requested configuration options (
> https://github.com/ShiftMediaProject/FFVS-Project-Generator). Its not the
> most readable code but it does work. Whats potentially more interesting is
> over all the years that project has been used the number of dummy dce stubs
> has decreased from what used to be there when some of those early attempts
> I mentioned were made. However just checking it now shows that there are
> still a good 1000 dummy functions created for avcodec alone, although
> admittedly theres only about a dozen for all the other libs. So a
> pre-processing tool can work nicely, the trick is to be able to get it to
> work with different compilers as the command line options and output format
> is slightly different and that only gives you the function name you still
> need to then scan the code to work out the correct types for the functions
> parameters and return types in order to make a dummy stub.
> _______________________________________________
> 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".

-- 
amyspark 🌸 https://www.amyspark.me
_______________________________________________
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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v5 0/4] Fix MSVC build without optimizations
  2023-07-28  1:37   ` [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations L. E. Segovia
  2023-07-28 10:40     ` Reimar Döffinger
@ 2023-07-29 19:07     ` L. E. Segovia
       [not found]     ` <cover.1690657578.git.amy@amyspark.me>
  2 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-29 19:07 UTC (permalink / raw)
  To: ffmpeg-devel

Sending again to fix the format=flowed mishap.

L. E. Segovia (4):
  all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
  all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
  all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM

 fftools/ffprobe.c                          |  16 +-
 fftools/opt_common.c                       |  12 +-
 libavcodec/x86/aacencdsp_init.c            |   2 +
 libavcodec/x86/aacpsdsp_init.c             |   2 +
 libavcodec/x86/ac3dsp_init.c               |   4 +
 libavcodec/x86/audiodsp_init.c             |   2 +
 libavcodec/x86/bswapdsp_init.c             |   2 +
 libavcodec/x86/cavsdsp.c                   |   2 +
 libavcodec/x86/celt_pvq_init.c             |   2 +
 libavcodec/x86/cfhddsp_init.c              |   2 +
 libavcodec/x86/cfhdencdsp_init.c           |   2 +
 libavcodec/x86/dcadsp_init.c               |   2 +
 libavcodec/x86/dct_init.c                  |   2 +
 libavcodec/x86/dnxhdenc_init.c             |   2 +
 libavcodec/x86/exrdsp_init.c               |   2 +
 libavcodec/x86/fdctdsp_init.c              |   2 +
 libavcodec/x86/fft_init.c                  |   2 +
 libavcodec/x86/flacdsp_init.c              |   8 +-
 libavcodec/x86/g722dsp_init.c              |   2 +
 libavcodec/x86/h263dsp_init.c              |   2 +
 libavcodec/x86/h264_intrapred_init.c       |   2 +
 libavcodec/x86/h264chroma_init.c           |   2 +
 libavcodec/x86/hevcdsp_init.c              | 549 +++++++++++----------
 libavcodec/x86/hpeldsp_init.c              |   4 +
 libavcodec/x86/hpeldsp_vp3_init.c          |   2 +
 libavcodec/x86/huffyuvdsp_init.c           |   2 +
 libavcodec/x86/huffyuvencdsp_init.c        |   2 +
 libavcodec/x86/idctdsp_init.c              |  11 +-
 libavcodec/x86/jpeg2000dsp_init.c          |   2 +
 libavcodec/x86/lossless_videodsp_init.c    |   2 +
 libavcodec/x86/lossless_videoencdsp_init.c |   2 +
 libavcodec/x86/me_cmp_init.c               |   2 +
 libavcodec/x86/mlpdsp_init.c               |   6 +-
 libavcodec/x86/mpegvideoencdsp_init.c      |   2 +
 libavcodec/x86/opusdsp_init.c              |   2 +
 libavcodec/x86/pixblockdsp_init.c          |   2 +
 libavcodec/x86/pngdsp_init.c               |   2 +
 libavcodec/x86/proresdsp_init.c            |   2 +
 libavcodec/x86/rv34dsp_init.c              |   2 +
 libavcodec/x86/sbcdsp_init.c               |   2 +
 libavcodec/x86/sbrdsp_init.c               |   2 +
 libavcodec/x86/svq1enc_init.c              |   2 +
 libavcodec/x86/utvideodsp_init.c           |   2 +
 libavcodec/x86/v210enc_init.c              |   6 +-
 libavcodec/x86/vc1dsp_init.c               |   6 +-
 libavcodec/x86/vorbisdsp_init.c            |   2 +
 libavcodec/x86/vp3dsp_init.c               |   2 +
 libavcodec/x86/vp6dsp_init.c               |   2 +
 libavfilter/x86/af_afir_init.c             |   2 +
 libavfilter/x86/af_anlmdn_init.c           |   2 +
 libavfilter/x86/af_volume_init.c           |   2 +
 libavfilter/x86/avf_showcqt_init.c         |   2 +
 libavfilter/x86/colorspacedsp_init.c       |   6 +-
 libavfilter/x86/vf_atadenoise_init.c       |   8 +-
 libavfilter/x86/vf_blend_init.c            |   2 +
 libavfilter/x86/vf_bwdif_init.c            |   2 +
 libavfilter/x86/vf_convolution_init.c      |   2 +-
 libavfilter/x86/vf_framerate_init.c        |   2 +
 libavfilter/x86/vf_fspp_init.c             |   2 +
 libavfilter/x86/vf_gblur_init.c            |   2 +
 libavfilter/x86/vf_hflip_init.c            |   2 +
 libavfilter/x86/vf_limiter_init.c          |   2 +
 libavfilter/x86/vf_maskedclamp_init.c      |   2 +
 libavfilter/x86/vf_maskedmerge_init.c      |   2 +
 libavfilter/x86/vf_overlay_init.c          |   2 +
 libavfilter/x86/vf_pp7_init.c              |   2 +
 libavfilter/x86/vf_psnr_init.c             |   2 +
 libavfilter/x86/vf_removegrain_init.c      |   2 +
 libavfilter/x86/vf_ssim_init.c             |   6 +-
 libavfilter/x86/vf_stereo3d_init.c         |   2 +
 libavfilter/x86/vf_threshold_init.c        |   2 +
 libavfilter/x86/vf_tinterlace_init.c       |   2 +
 libavfilter/x86/vf_transpose_init.c        |   2 +
 libavfilter/x86/vf_v360_init.c             |   2 +
 libavfilter/x86/vf_w3fdif_init.c           |   6 +-
 libavfilter/x86/vf_yadif_init.c            |   2 +
 libavformat/rtmpproto.c                    |  24 +-
 libavutil/x86/fixed_dsp_init.c             |   2 +
 libavutil/x86/float_dsp_init.c             |   2 +
 libavutil/x86/imgutils_init.c              |   2 +
 libavutil/x86/lls_init.c                   |   2 +
 libavutil/x86/pixelutils_init.c            |   2 +
 libswresample/x86/audio_convert_init.c     |   2 +
 libswresample/x86/resample_init.c          |   6 +
 libswscale/x86/rgb2rgb.c                   |   2 +
 libswscale/x86/swscale.c                   |   2 +
 86 files changed, 517 insertions(+), 301 deletions(-)

-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
       [not found]     ` <cover.1690657578.git.amy@amyspark.me>
@ 2023-07-29 19:07       ` L. E. Segovia
  2023-07-31 18:28         ` Michael Niedermayer
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
                         ` (2 subsequent siblings)
  3 siblings, 1 reply; 54+ messages in thread
From: L. E. Segovia @ 2023-07-29 19:07 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/fdctdsp_init.c        |   2 +
 libavcodec/x86/flacdsp_init.c        |   8 +-
 libavcodec/x86/hevcdsp_init.c        | 547 ++++++++++++++-------------
 libavcodec/x86/idctdsp_init.c        |   9 +-
 libavcodec/x86/mlpdsp_init.c         |   6 +-
 libavcodec/x86/vc1dsp_init.c         |   6 +-
 libavfilter/x86/colorspacedsp_init.c |   4 +-
 libavfilter/x86/vf_atadenoise_init.c |   6 +-
 libavfilter/x86/vf_ssim_init.c       |   4 +-
 libavfilter/x86/vf_w3fdif_init.c     |   4 +-
 10 files changed, 311 insertions(+), 285 deletions(-)

diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c
index 92a842433d..4a874a640d 100644
--- a/libavcodec/x86/fdctdsp_init.c
+++ b/libavcodec/x86/fdctdsp_init.c
@@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx,
 
     if (!high_bit_depth) {
         if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) {
+#if HAVE_INLINE_SSE2
             if (INLINE_SSE2(cpu_flags))
                 c->fdct = ff_fdct_sse2;
+#endif
         }
     }
 }
diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c
index 87daed7005..49e67ee2b0 100644
--- a/libavcodec/x86/flacdsp_init.c
+++ b/libavcodec/x86/flacdsp_init.c
@@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
     }
     if (EXTERNAL_AVX(cpu_flags)) {
         if (fmt == AV_SAMPLE_FMT_S16) {
-            if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx;
+#endif
         } else if (fmt == AV_SAMPLE_FMT_S32) {
             if (channels == 4)
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx;
+#endif
         }
     }
     if (EXTERNAL_XOP(cpu_flags)) {
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index 6f45e5e0db..c7060085a2 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_8_sse2;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_8_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_8_sse2;
+#endif
             SAO_BAND_INIT(8, sse2);
 
             c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2;
@@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[3] = ff_hevc_add_residual_32_8_sse2;
         }
         if (EXTERNAL_SSSE3(cpu_flags)) {
-            if(ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3;
+#endif
             SAO_EDGE_INIT(8, ssse3);
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
-
+#if ARCH_X86_64
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels,  8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,      8, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,      8, sse4);
@@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     8, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    8, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_8_avx;
-                c->idct[3] = ff_hevc_idct_32x32_8_avx;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_8_avx;
+            c->idct[3] = ff_hevc_idct_32x32_8_avx;
+#endif
             SAO_BAND_INIT(8, avx);
 
             c->idct[0] = ff_hevc_idct_4x4_8_avx;
@@ -775,91 +776,91 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2;
-            if (ARCH_X86_64) {
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
-
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
-
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
-
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
-
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
-
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
-
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
-
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
-
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
-
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
-
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
-
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
-
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
-
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
-
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
-
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
-
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
-
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
-
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
-            }
+#if ARCH_X86_64
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2;
+
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2;
+
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2;
+
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2;
+
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2;
+
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2;
+
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2;
+
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2;
+
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2;
+
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2;
+
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2;
+
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2;
+
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2;
+
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2;
+
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2;
+
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2;
+
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2;
+#endif
             SAO_BAND_INIT(8, avx2);
 
             c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2;
@@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_sse2;
-                c->idct[3] = ff_hevc_idct_32x32_10_sse2;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_10_sse2;
+            c->idct[3] = ff_hevc_idct_32x32_10_sse2;
+#endif
             SAO_BAND_INIT(10, sse2);
             SAO_EDGE_INIT(10, sse2);
 
@@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[2] = ff_hevc_add_residual_16_10_sse2;
             c->add_residual[3] = ff_hevc_add_residual_32_10_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     10, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     10, sse4);
@@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     10, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    10, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx;
 
-                c->idct[2] = ff_hevc_idct_16x16_10_avx;
-                c->idct[3] = ff_hevc_idct_32x32_10_avx;
-            }
+            c->idct[2] = ff_hevc_idct_16x16_10_avx;
+            c->idct[3] = ff_hevc_idct_32x32_10_avx;
+#endif
 
             c->idct[0] = ff_hevc_idct_4x4_10_avx;
             c->idct[1] = ff_hevc_idct_8x8_10_avx;
@@ -942,150 +945,150 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2;
-            if (ARCH_X86_64) {
-                c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
-                c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
-                c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
-                c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
-                c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
-                c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
-                c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
-                c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
-                c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
-
-                c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-                c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
-
-                c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
-                c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
-                c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
-                c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
-                c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
-
-                c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
-                c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
-                c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
-                c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
-                c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
-
-                c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
-                c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
-                c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
-                c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
-                c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
-
-                c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
-                c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
-                c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
-                c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
-                c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
-                c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
-                c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
-                c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
-                c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
-                c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
-                c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
-                c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
-                c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
-
-                c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
-                c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
-                c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
-                c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
-                c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
-                c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
-                c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
-                c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
-                c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
-
-                c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
-                c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
-                c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
-                c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
-                c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
-
-                c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
-                c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
-                c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
-                c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
-                c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
-                c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
-                c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
-                c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
-                c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
-                c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
-                c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
-                c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
-                c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
-
-                c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
-                c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
-                c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
-                c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
-                c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
-
-                c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
-                c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
-                c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
-                c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
-                c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
-
-                c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
-                c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
-                c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
-                c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
-                c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
-            }
+#if ARCH_X86_64
+            c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2;
+            c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2;
+            c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2;
+            c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2;
+            c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2;
+            c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2;
+            c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2;
+            c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2;
+            c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2;
+
+            c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+            c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2;
+
+            c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2;
+            c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2;
+            c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2;
+            c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2;
+            c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2;
+
+            c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2;
+            c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2;
+            c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2;
+            c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2;
+            c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2;
+
+            c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2;
+            c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2;
+            c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2;
+            c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2;
+            c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2;
+
+            c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2;
+            c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2;
+            c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2;
+            c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2;
+            c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2;
+            c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2;
+            c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2;
+            c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2;
+            c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2;
+            c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2;
+            c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2;
+            c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2;
+            c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2;
+
+            c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2;
+            c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2;
+            c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2;
+            c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2;
+            c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2;
+            c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2;
+            c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2;
+            c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2;
+            c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2;
+
+            c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2;
+            c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2;
+            c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2;
+            c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2;
+            c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2;
+
+            c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2;
+            c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2;
+            c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2;
+            c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2;
+            c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2;
+            c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2;
+            c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2;
+            c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2;
+            c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2;
+            c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2;
+            c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2;
+            c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2;
+            c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2;
+
+            c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2;
+            c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2;
+            c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2;
+            c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2;
+            c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2;
+
+            c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2;
+            c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2;
+            c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2;
+            c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2;
+            c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2;
+
+            c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2;
+            c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2;
+            c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2;
+            c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2;
+            c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2;
+#endif
             SAO_BAND_INIT(10, avx2);
             SAO_EDGE_INIT(10, avx2);
 
@@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         if (EXTERNAL_SSE2(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2;
+#endif
             SAO_BAND_INIT(12, sse2);
             SAO_EDGE_INIT(12, sse2);
 
@@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2;
             c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2;
         }
-        if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_SSSE3(cpu_flags)) {
             c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3;
             c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3;
         }
-        if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) {
+        if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h,     12, sse4);
             EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v,     12, sse4);
@@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v,     12, sse4);
             QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv,    12, sse4);
         }
+#endif
         if (EXTERNAL_AVX(cpu_flags)) {
             c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx;
             c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx;
-            if (ARCH_X86_64) {
-                c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
-                c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
-            }
+#if ARCH_X86_64
+            c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx;
+            c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx;
+#endif
             SAO_BAND_INIT(12, avx);
         }
         if (EXTERNAL_AVX2(cpu_flags)) {
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index f28a1ad744..4ade52a880 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
 #endif
 
-        if (ARCH_X86_64 &&
-            !high_bit_depth &&
+#if ARCH_X86_64
+        if (!high_bit_depth &&
             avctx->lowres == 0 &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
                 avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
@@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                 c->idct_add  = ff_simple_idct8_add_sse2;
                 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
         }
+#endif
     }
 
-    if (ARCH_X86_64 && avctx->lowres == 0) {
+#if ARCH_X86_64
+    if (avctx->lowres == 0) {
         if (EXTERNAL_AVX(cpu_flags) &&
             !high_bit_depth &&
             (avctx->idct_algo == FF_IDCT_AUTO ||
@@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
             }
         }
     }
+#endif
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 950f996832..333a685f47 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-    if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
-    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
+    if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
+#endif
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 90b2f3624e..bc63933e83 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (HAVE_6REGS && INLINE_MMX(cpu_flags))
+#if HAVE_6REGS
+    if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
 
-    if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags))
+    if (INLINE_MMXEXT(cpu_flags))
         if (EXTERNAL_MMXEXT(cpu_flags))
         ff_vc1dsp_init_mmxext(dsp);
+#endif
 
 #define ASSIGN_LF4(EXT) \
         dsp->vc1_v_loop_filter4  = ff_vc1_v_loop_filter4_ ## EXT; \
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index b5006ac295..f01db4baf4 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags)) {
 #define assign_yuv2yuv_fns(ss) \
         dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \
         dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \
@@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
+#endif
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index e7a653f191..eb621e172c 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
+#if ARCH_X86_64 
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
         }
 
-        if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
+        if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
             dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
         }
+#endif
     }
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index cbaa20ef16..6f2305430c 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags))
+#if ARCH_X86_64
+    if (EXTERNAL_SSSE3(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3;
+#endif
     if (EXTERNAL_SSE4(cpu_flags))
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 16202fba76..6d677d651d 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_scale        = ff_w3fdif_scale_sse2;
     }
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
+#if ARCH_X86_64
+    if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
+#endif
 }
-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v5 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO
       [not found]     ` <cover.1690657578.git.amy@amyspark.me>
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2023-07-29 19:07       ` L. E. Segovia
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
  2023-07-29 19:08       ` [FFmpeg-devel] [PATCH v5 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-29 19:07 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 fftools/ffprobe.c       | 16 +++++++++++-----
 fftools/opt_common.c    | 12 ++++++++++--
 libavformat/rtmpproto.c | 24 ++++++++++++++++++------
 3 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index a39185f6fe..c3e90a9409 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3572,9 +3572,9 @@ static void ffprobe_show_program_version(WriterContext *w)
     av_bprint_finalize(&pbuf, NULL);
 }
 
-#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
-    do {                                                                \
-        if (CONFIG_##LIBNAME) {                                         \
+#define SHOW_LIB_VERSION_0(libname, LIBNAME)
+#define SHOW_LIB_VERSION_1(libname, LIBNAME)                            \
+        {                                                               \
             unsigned int version = libname##_version();                 \
             writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \
             print_str("name",    "lib" #libname);                       \
@@ -3584,8 +3584,14 @@ static void ffprobe_show_program_version(WriterContext *w)
             print_int("version", version);                              \
             print_str("ident",   LIB##LIBNAME##_IDENT);                 \
             writer_print_section_footer(w);                             \
-        }                                                               \
-    } while (0)
+        }
+
+#define SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_ ## cfg(libname, LIBNAME)
+#define SHOW_LIB_VERSION_3(cfg, libname, LIBNAME)                       \
+    SHOW_LIB_VERSION_2(cfg, libname, LIBNAME)
+#define SHOW_LIB_VERSION(libname, LIBNAME)                              \
+    SHOW_LIB_VERSION_3(CONFIG_ ## LIBNAME, libname, LIBNAME)
 
 static void ffprobe_show_library_versions(WriterContext *w)
 {
diff --git a/fftools/opt_common.c b/fftools/opt_common.c
index 7c996f140d..5729d656e9 100644
--- a/fftools/opt_common.c
+++ b/fftools/opt_common.c
@@ -153,8 +153,9 @@ static int warned_cfg = 0;
 #define SHOW_CONFIG   4
 #define SHOW_COPYRIGHT 8
 
-#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
-    if (CONFIG_##LIBNAME) {                                             \
+#define PRINT_LIB_INFO_0(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_1(libname, LIBNAME, flags, level)                \
+    {                                                                   \
         const char *indent = flags & INDENT? "  " : "";                 \
         if (flags & SHOW_VERSION) {                                     \
             unsigned int version = libname##_version();                 \
@@ -182,6 +183,13 @@ static int warned_cfg = 0;
         }                                                               \
     }                                                                   \
 
+#define PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_ ## cfg(libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO_3(cfg, libname, LIBNAME, flags, level)           \
+    PRINT_LIB_INFO_2(cfg, libname, LIBNAME, flags, level)
+#define PRINT_LIB_INFO(libname, LIBNAME, flags, level)                  \
+    PRINT_LIB_INFO_3(CONFIG_ ## LIBNAME, libname, LIBNAME, flags, level)
+
 static void print_all_libs_info(int flags, int level)
 {
     PRINT_LIB_INFO(avutil,     AVUTIL,     flags, level);
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index f0ef223f05..6d84fcf34f 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
     for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++)
         tosend[i] = av_lfg_get(&rnd) >> 24;
 
-    if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+    if (rt->encrypted) {
         /* When the client wants to use RTMPE, we have to change the command
          * byte to 0x06 which means to use encrypted data and we have to set
          * the flash version to at least 9.0.115.0. */
@@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0)
             return ret;
     }
+#endif
 
     client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted);
     if (client_pos < 0)
@@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
             /* Encrypt the signature received by the server. */
             ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]);
         }
+#endif
 
         if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) {
             av_log(s, AV_LOG_ERROR, "Signature mismatch\n");
@@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
         if (ret < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Encrypt the signature to be send to the server. */
             ff_rtmpe_encrypt_sig(rt->stream, tosend +
                                  RTMP_HANDSHAKE_PACKET_SIZE - 32, digest,
                                  serverdata[0]);
         }
+#endif
 
         // write reply back to the server
         if ((ret = ffurl_write(rt->stream, tosend,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     } else {
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Compute the shared secret key sent by the server and initialize
              * the RC4 encryption. */
             if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1,
@@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt)
                                      serverdata[0]);
             }
         }
+#endif
 
         if ((ret = ffurl_write(rt->stream, serverdata + 1,
                                RTMP_HANDSHAKE_PACKET_SIZE)) < 0)
             return ret;
 
-        if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) {
+#if CONFIG_FFRTMPCRYPT_PROTOCOL
+        if (rt->encrypted) {
             /* Set RC4 keys for encryption and update the keystreams. */
             if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0)
                 return ret;
         }
+#endif
     }
 
     return 0;
-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v5 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM
       [not found]     ` <cover.1690657578.git.amy@amyspark.me>
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
@ 2023-07-29 19:07       ` L. E. Segovia
  2023-07-29 19:08       ` [FFmpeg-devel] [PATCH v5 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-29 19:07 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/hpeldsp_init.c | 2 ++
 libavcodec/x86/vc1dsp_init.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 09c48c341e..6bde5a3893 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -224,8 +224,10 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         hpeldsp_init_mmx(c, flags);
+#endif
 
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index bc63933e83..65fc28ea35 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS
+#if HAVE_6REGS && HAVE_INLINE_ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
-- 
2.41.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] 54+ messages in thread

* [FFmpeg-devel] [PATCH v5 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM
       [not found]     ` <cover.1690657578.git.amy@amyspark.me>
                         ` (2 preceding siblings ...)
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
@ 2023-07-29 19:08       ` L. E. Segovia
  3 siblings, 0 replies; 54+ messages in thread
From: L. E. Segovia @ 2023-07-29 19:08 UTC (permalink / raw)
  To: ffmpeg-devel

Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a

Signed-off-by: L. E. Segovia <amy@amyspark.me>
---
 libavcodec/x86/aacencdsp_init.c            | 2 ++
 libavcodec/x86/aacpsdsp_init.c             | 2 ++
 libavcodec/x86/ac3dsp_init.c               | 4 ++++
 libavcodec/x86/audiodsp_init.c             | 2 ++
 libavcodec/x86/bswapdsp_init.c             | 2 ++
 libavcodec/x86/cavsdsp.c                   | 2 ++
 libavcodec/x86/celt_pvq_init.c             | 2 ++
 libavcodec/x86/cfhddsp_init.c              | 2 ++
 libavcodec/x86/cfhdencdsp_init.c           | 2 ++
 libavcodec/x86/dcadsp_init.c               | 2 ++
 libavcodec/x86/dct_init.c                  | 2 ++
 libavcodec/x86/dnxhdenc_init.c             | 2 ++
 libavcodec/x86/exrdsp_init.c               | 2 ++
 libavcodec/x86/fft_init.c                  | 2 ++
 libavcodec/x86/g722dsp_init.c              | 2 ++
 libavcodec/x86/h263dsp_init.c              | 2 ++
 libavcodec/x86/h264_intrapred_init.c       | 2 ++
 libavcodec/x86/h264chroma_init.c           | 2 ++
 libavcodec/x86/hevcdsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_init.c              | 2 ++
 libavcodec/x86/hpeldsp_vp3_init.c          | 2 ++
 libavcodec/x86/huffyuvdsp_init.c           | 2 ++
 libavcodec/x86/huffyuvencdsp_init.c        | 2 ++
 libavcodec/x86/idctdsp_init.c              | 2 ++
 libavcodec/x86/jpeg2000dsp_init.c          | 2 ++
 libavcodec/x86/lossless_videodsp_init.c    | 2 ++
 libavcodec/x86/lossless_videoencdsp_init.c | 2 ++
 libavcodec/x86/me_cmp_init.c               | 2 ++
 libavcodec/x86/mlpdsp_init.c               | 2 +-
 libavcodec/x86/mpegvideoencdsp_init.c      | 2 ++
 libavcodec/x86/opusdsp_init.c              | 2 ++
 libavcodec/x86/pixblockdsp_init.c          | 2 ++
 libavcodec/x86/pngdsp_init.c               | 2 ++
 libavcodec/x86/proresdsp_init.c            | 2 ++
 libavcodec/x86/rv34dsp_init.c              | 2 ++
 libavcodec/x86/sbcdsp_init.c               | 2 ++
 libavcodec/x86/sbrdsp_init.c               | 2 ++
 libavcodec/x86/svq1enc_init.c              | 2 ++
 libavcodec/x86/utvideodsp_init.c           | 2 ++
 libavcodec/x86/v210enc_init.c              | 6 ++++--
 libavcodec/x86/vc1dsp_init.c               | 2 +-
 libavcodec/x86/vorbisdsp_init.c            | 2 ++
 libavcodec/x86/vp3dsp_init.c               | 2 ++
 libavcodec/x86/vp6dsp_init.c               | 2 ++
 libavfilter/x86/af_afir_init.c             | 2 ++
 libavfilter/x86/af_anlmdn_init.c           | 2 ++
 libavfilter/x86/af_volume_init.c           | 2 ++
 libavfilter/x86/avf_showcqt_init.c         | 2 ++
 libavfilter/x86/colorspacedsp_init.c       | 2 ++
 libavfilter/x86/vf_atadenoise_init.c       | 2 ++
 libavfilter/x86/vf_blend_init.c            | 2 ++
 libavfilter/x86/vf_bwdif_init.c            | 2 ++
 libavfilter/x86/vf_convolution_init.c      | 2 +-
 libavfilter/x86/vf_framerate_init.c        | 2 ++
 libavfilter/x86/vf_fspp_init.c             | 2 ++
 libavfilter/x86/vf_gblur_init.c            | 2 ++
 libavfilter/x86/vf_hflip_init.c            | 2 ++
 libavfilter/x86/vf_limiter_init.c          | 2 ++
 libavfilter/x86/vf_maskedclamp_init.c      | 2 ++
 libavfilter/x86/vf_maskedmerge_init.c      | 2 ++
 libavfilter/x86/vf_overlay_init.c          | 2 ++
 libavfilter/x86/vf_pp7_init.c              | 2 ++
 libavfilter/x86/vf_psnr_init.c             | 2 ++
 libavfilter/x86/vf_removegrain_init.c      | 2 ++
 libavfilter/x86/vf_ssim_init.c             | 2 ++
 libavfilter/x86/vf_stereo3d_init.c         | 2 ++
 libavfilter/x86/vf_threshold_init.c        | 2 ++
 libavfilter/x86/vf_tinterlace_init.c       | 2 ++
 libavfilter/x86/vf_transpose_init.c        | 2 ++
 libavfilter/x86/vf_v360_init.c             | 2 ++
 libavfilter/x86/vf_w3fdif_init.c           | 2 ++
 libavfilter/x86/vf_yadif_init.c            | 2 ++
 libavutil/x86/fixed_dsp_init.c             | 2 ++
 libavutil/x86/float_dsp_init.c             | 2 ++
 libavutil/x86/imgutils_init.c              | 2 ++
 libavutil/x86/lls_init.c                   | 2 ++
 libavutil/x86/pixelutils_init.c            | 2 ++
 libswresample/x86/audio_convert_init.c     | 2 ++
 libswresample/x86/resample_init.c          | 6 ++++++
 libswscale/x86/rgb2rgb.c                   | 2 ++
 libswscale/x86/swscale.c                   | 2 ++
 81 files changed, 167 insertions(+), 5 deletions(-)

diff --git a/libavcodec/x86/aacencdsp_init.c b/libavcodec/x86/aacencdsp_init.c
index 049a2417d9..7dca1d481b 100644
--- a/libavcodec/x86/aacencdsp_init.c
+++ b/libavcodec/x86/aacencdsp_init.c
@@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled,
 
 av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s)
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->quant_bands = ff_aac_quantize_bands_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c
index 0b0ee07db4..44d64f5340 100644
--- a/libavcodec/x86/aacpsdsp_init.c
+++ b/libavcodec/x86/aacpsdsp_init.c
@@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64],
 
 av_cold void ff_psdsp_init_x86(PSDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s)
     if (EXTERNAL_FMA3(cpu_flags)) {
         s->hybrid_analysis        = ff_ps_hybrid_analysis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 43b3b4ac85..76a8c0547d 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
 
 av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c)
         if (!(cpu_flags & AV_CPU_FLAG_ATOM))
             c->extract_exponents = ff_ac3_extract_exponents_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
 
 #define DOWNMIX_FUNC_OPT(ch, opt)                                       \
@@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3)
 
 void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #define SET_DOWNMIX(ch, suf, SUF)                                       \
@@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c)
         SET_DOWNMIX_ALL(avx,  AVX)
         SET_DOWNMIX_ALL(fma3, FMA3)
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c
index 68aa3b2129..c5f410678e 100644
--- a/libavcodec/x86/audiodsp_init.c
+++ b/libavcodec/x86/audiodsp_init.c
@@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src,
 
 av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
@@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c)
 
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->scalarproduct_int16 = ff_scalarproduct_int16_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c
index 877bab1a2c..08551f6487 100644
--- a/libavcodec/x86/bswapdsp_init.c
+++ b/libavcodec/x86/bswapdsp_init.c
@@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t *src, int w);
 
 av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c)
         c->bswap_buf = ff_bswap32_buf_ssse3;
     if (EXTERNAL_AVX2_FAST(cpu_flags))
         c->bswap_buf = ff_bswap32_buf_avx2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 96680836a1..2463481803 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -379,6 +379,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         DSPFUNC(avg, 1,  8, mmxext);
     }
 #endif
+#if HAVE_X86ASM
 #if HAVE_MMX_EXTERNAL
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext;
@@ -393,4 +394,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c)
         c->idct_perm      = FF_IDCT_PERM_TRANSPOSE;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c
index 5a0669e6f2..b88a2f6225 100644
--- a/libavcodec/x86/celt_pvq_init.c
+++ b/libavcodec/x86/celt_pvq_init.c
@@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx  (float *X, int *y, int K, int N);
 
 av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->pvq_search = ff_pvq_search_exact_avx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c
index c5d89561ae..a773c365c1 100644
--- a/libavcodec/x86/cfhddsp_init.c
+++ b/libavcodec/x86/cfhddsp_init.c
@@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output, const int16_t *low, const
 
 av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer)
         if (depth == 12 && !bayer)
             c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/cfhdencdsp_init.c b/libavcodec/x86/cfhdencdsp_init.c
index 5cea39a80a..79b2f10bf7 100644
--- a/libavcodec/x86/cfhdencdsp_init.c
+++ b/libavcodec/x86/cfhdencdsp_init.c
@@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *hi
 
 av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c)
         c->vert_filter = ff_cfhdenc_vert_filter_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c
index 0c78dd1c9e..b407679f6a 100644
--- a/libavcodec/x86/dcadsp_init.c
+++ b/libavcodec/x86/dcadsp_init.c
@@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3)
 
 av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
@@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
     }
     if (EXTERNAL_FMA3(cpu_flags))
         s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c
index d0e4b34dd3..6756e1e12d 100644
--- a/libavcodec/x86/dct_init.c
+++ b/libavcodec/x86/dct_init.c
@@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
 
 av_cold void ff_dct_init_x86(DCTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         s->dct32 = ff_dct32_float_sse2;
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->dct32 = ff_dct32_float_avx;
+#endif
 }
diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c
index fd6f15005a..612b70ad7a 100644
--- a/libavcodec/x86/dnxhdenc_init.c
+++ b/libavcodec/x86/dnxhdenc_init.c
@@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels,
 
 av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(av_get_cpu_flags())) {
         if (ctx->cid_table->bit_depth == 8)
             ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c
index 63b3480d8f..f9696d7a91 100644
--- a/libavcodec/x86/exrdsp_init.c
+++ b/libavcodec/x86/exrdsp_init.c
@@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size);
 
 av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
         dsp->reorder_pixels = ff_reorder_pixels_avx2;
         dsp->predictor      = ff_predictor_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c
index df79d57dc7..065e231edb 100644
--- a/libavcodec/x86/fft_init.c
+++ b/libavcodec/x86/fft_init.c
@@ -26,6 +26,7 @@
 
 av_cold void ff_fft_init_x86(FFTContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->nbits > 16)
@@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s)
         s->fft_calc        = ff_fft_calc_avx;
         s->fft_permutation = FF_FFT_PERM_AVX;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c
index 614695193b..700269d62a 100644
--- a/libavcodec/x86/g722dsp_init.c
+++ b/libavcodec/x86/g722dsp_init.c
@@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t *prev_samples, int xout[2]);
 
 av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags))
         dsp->apply_qmf = ff_g722_apply_qmf_sse2;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c
index ab81063233..57ec1640e3 100644
--- a/libavcodec/x86/h263dsp_init.c
+++ b/libavcodec/x86/h263dsp_init.c
@@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale);
 
 av_cold void ff_h263dsp_init_x86(H263DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
         c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
         c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c
index ee46927a24..5518961784 100644
--- a/libavcodec/x86/h264_intrapred_init.c
+++ b/libavcodec/x86/h264_intrapred_init.c
@@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
                                    const int bit_depth,
                                    const int chroma_format_idc)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id,
             h->pred8x8l[HOR_UP_PRED         ] = ff_pred8x8l_horizontal_up_10_avx;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c
index 34934b6ad0..57d92ad107 100644
--- a/libavcodec/x86/h264chroma_init.c
+++ b/libavcodec/x86/h264chroma_init.c
@@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx)
 
 av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
 {
+#if HAVE_X86ASM
     int high_bit_depth = bit_depth > 8;
     int cpu_flags      = av_get_cpu_flags();
 
@@ -105,4 +106,5 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth)
         c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx;
         c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c
index c7060085a2..29c11246ae 100644
--- a/libavcodec/x86/hevcdsp_init.c
+++ b/libavcodec/x86/hevcdsp_init.c
@@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2)
 
 void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth == 8) {
@@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             SAO_EDGE_INIT(12, avx2);
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 6bde5a3893..99a1ab7310 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -229,6 +229,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
         hpeldsp_init_mmx(c, flags);
 #endif
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags))
         hpeldsp_init_mmxext(c, flags);
 
@@ -237,6 +238,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 
     if (EXTERNAL_SSSE3(cpu_flags))
         hpeldsp_init_ssse3(c, flags);
+#endif
 
     if (CONFIG_VP3_DECODER)
         ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags);
diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c
index 1dbd1ba6f9..3dd6c45afa 100644
--- a/libavcodec/x86/hpeldsp_vp3_init.c
+++ b/libavcodec/x86/hpeldsp_vp3_init.c
@@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block,
 
 av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags)
 {
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         if (flags & AV_CODEC_FLAG_BITEXACT) {
             c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext;
             c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c
index 239d3ca313..445137da87 100644
--- a/libavcodec/x86/huffyuvdsp_init.c
+++ b/libavcodec/x86/huffyuvdsp_init.c
@@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *top, co
 
 av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->add_int16 = ff_add_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c
index c9c33b75b4..35d18a040c 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, c
 
 av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt)
 {
+#if HAVE_X86ASM
     av_unused int cpu_flags = av_get_cpu_flags();
     const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
 
@@ -51,4 +52,5 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_int16 = ff_diff_int16_avx2;
     }
+#endif
 }
diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 4ade52a880..3f74da85cd 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
 av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
                                  unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_32
@@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/jpeg2000dsp_init.c b/libavcodec/x86/jpeg2000dsp_init.c
index 7310a1d0e1..0256be8046 100644
--- a/libavcodec/x86/jpeg2000dsp_init.c
+++ b/libavcodec/x86/jpeg2000dsp_init.c
@@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize);
 
 av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE(cpu_flags)) {
         c->mct_decode[FF_DWT97] = ff_ict_float_sse;
@@ -57,4 +58,5 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c
index 5690cacaad..720cf98389 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->add_bytes       = ff_add_bytes_sse2;
         c->add_median_pred = ff_add_median_pred_sse2;
@@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c)
         c->add_left_pred   = ff_add_left_pred_unaligned_avx2;
         c->add_gradient_pred = ff_add_gradient_pred_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/lossless_videoencdsp_init.c b/libavcodec/x86/lossless_videoencdsp_init.c
index 22a4014ef1..26cfcbb4b2 100644
--- a/libavcodec/x86/lossless_videoencdsp_init.c
+++ b/libavcodec/x86/lossless_videoencdsp_init.c
@@ -91,6 +91,7 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     }
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_sse2;
     }
@@ -102,4 +103,5 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c)
     if (EXTERNAL_AVX2_FAST(cpu_flags)) {
         c->diff_bytes = ff_diff_bytes_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c
index bc1051c27e..527fdff4a9 100644
--- a/libavcodec/x86/me_cmp_init.c
+++ b/libavcodec/x86/me_cmp_init.c
@@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
 
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMX(cpu_flags)) {
         c->sse[1]            = ff_sse8_mmx;
 #if HAVE_X86ASM
@@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx)
         c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c
index 333a685f47..4843e1abdb 100644
--- a/libavcodec/x86/mlpdsp_init.c
+++ b/libavcodec/x86/mlpdsp_init.c
@@ -200,7 +200,7 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
     if (INLINE_MMX(cpu_flags))
         c->mlp_filter_channel = mlp_filter_channel_x86;
 #endif
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     if (EXTERNAL_SSE4(cpu_flags))
         c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
     if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c
index ec174b15aa..82f9df4cba 100644
--- a/libavcodec/x86/mpegvideoencdsp_init.c
+++ b/libavcodec/x86/mpegvideoencdsp_init.c
@@ -216,6 +216,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
 {
     int cpu_flags = av_get_cpu_flags();
 
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_sse2;
         c->pix_norm1   = ff_pix_norm1_sse2;
@@ -224,6 +225,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c,
     if (EXTERNAL_XOP(cpu_flags)) {
         c->pix_sum     = ff_pix_sum16_xop;
     }
+#endif /* HAVE_X86ASM */
 
 #if HAVE_INLINE_ASM
 
diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c
index 582fbb4f0c..4598657116 100644
--- a/libavcodec/x86/opusdsp_init.c
+++ b/libavcodec/x86/opusdsp_init.c
@@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len);
 
 av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_FMA3(cpu_flags)) {
         ctx->postfilter = ff_opus_postfilter_fma3;
         ctx->deemphasis = ff_opus_deemphasis_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c
index 51f2a0033a..9d3aac4c74 100644
--- a/libavcodec/x86/pixblockdsp_init.c
+++ b/libavcodec/x86/pixblockdsp_init.c
@@ -31,6 +31,7 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
                                      AVCodecContext *avctx,
                                      unsigned high_bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
         c->diff_pixels_unaligned =
         c->diff_pixels = ff_diff_pixels_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c
index e2cd5effe3..c6562f7abb 100644
--- a/libavcodec/x86/pngdsp_init.c
+++ b/libavcodec/x86/pngdsp_init.c
@@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1,
 
 av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags))
@@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp)
         dsp->add_bytes_l2         = ff_add_bytes_l2_sse2;
     if (EXTERNAL_SSSE3(cpu_flags))
         dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c
index bde79ab8c0..01e5e67236 100644
--- a/libavcodec/x86/proresdsp_init.c
+++ b/libavcodec/x86/proresdsp_init.c
@@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize,
 
 av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
 {
+#if HAVE_X86ASM
 #if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
@@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx)
         }
     }
 #endif /* ARCH_X86_64 */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c
index caa5c2d653..f76bef39e1 100644
--- a/libavcodec/x86/rv34dsp_init.c
+++ b/libavcodec/x86/rv34dsp_init.c
@@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
 
 av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMXEXT(cpu_flags)) {
@@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c)
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2;
     if (EXTERNAL_SSE4(cpu_flags))
         c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c
index 7416a86ac6..79914cc565 100644
--- a/libavcodec/x86/sbcdsp_init.c
+++ b/libavcodec/x86/sbcdsp_init.c
@@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8],
 
 av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s)
         s->sbc_analyze_8 = ff_sbc_analyze_8_mmx;
         s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c
index 999f681220..d70ffa0d6c 100644
--- a/libavcodec/x86/sbrdsp_init.c
+++ b/libavcodec/x86/sbrdsp_init.c
@@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2], float phi[3][2][2]);
 
 av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s)
     if (EXTERNAL_SSE3(cpu_flags)) {
         s->autocorrelate = ff_sbr_autocorrelate_sse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c
index daf573beba..c016811822 100644
--- a/libavcodec/x86/svq1enc_init.c
+++ b/libavcodec/x86/svq1enc_init.c
@@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2,
 
 av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index 2b436c6c5c..e81f6bf3c0 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r, uint16_t *src_g, uint16_t *sr
 
 av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
         c->restore_rgb_planes   = ff_restore_rgb_planes_avx2;
         c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index 44f22ca7fe..656f0e21c7 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -46,6 +46,7 @@ void ff_v210_planar_pack_10_avx512icl(const uint16_t *y, const uint16_t *u,
 
 av_cold void ff_v210enc_init_x86(V210EncContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSSE3(cpu_flags)) {
@@ -66,10 +67,10 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
     if (EXTERNAL_AVX512(cpu_flags)) {
         s->sample_factor_8  = 2;
         s->pack_line_8      = ff_v210_planar_pack_8_avx512;
-#if ARCH_X86_64
+#   if ARCH_X86_64
         s->sample_factor_10  = 2;
         s->pack_line_10      = ff_v210_planar_pack_10_avx512;
-#endif
+#   endif
     }
 
     if (EXTERNAL_AVX512ICL(cpu_flags)) {
@@ -78,4 +79,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
         s->sample_factor_10 = 4;
         s->pack_line_10     = ff_v210_planar_pack_10_avx512icl;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index 65fc28ea35..ea6c0fa0fe 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
 {
     int cpu_flags = av_get_cpu_flags();
 
-#if HAVE_6REGS && HAVE_INLINE_ASM
+#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_X86ASM
     if (INLINE_MMX(cpu_flags))
         if (EXTERNAL_MMX(cpu_flags))
         ff_vc1dsp_init_mmx(dsp);
diff --git a/libavcodec/x86/vorbisdsp_init.c b/libavcodec/x86/vorbisdsp_init.c
index 08a3bb2965..067b92e2a4 100644
--- a/libavcodec/x86/vorbisdsp_init.c
+++ b/libavcodec/x86/vorbisdsp_init.c
@@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang,
 
 av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags))
         dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index f54fa57b3e..7d69956d22 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a,
 
 av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
         c->idct_put  = ff_vp3_idct_put_sse2;
         c->idct_add  = ff_vp3_idct_add_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c
index 83d45ec36c..6a3bf36bae 100644
--- a/libavcodec/x86/vp6dsp_init.c
+++ b/libavcodec/x86/vp6dsp_init.c
@@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
 
 av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c
index e53817b9c0..3561d9fe3f 100644
--- a/libavfilter/x86/af_afir_init.c
+++ b/libavfilter/x86/af_afir_init.c
@@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t, const float *c,
 
 av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE3(cpu_flags)) {
@@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s)
     if (EXTERNAL_AVX_FAST(cpu_flags)) {
         s->fcmul_add = ff_fcmul_add_avx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_anlmdn_init.c b/libavfilter/x86/af_anlmdn_init.c
index 30eff6f644..047d88b795 100644
--- a/libavfilter/x86/af_anlmdn_init.c
+++ b/libavfilter/x86/af_anlmdn_init.c
@@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1, const float *f2,
 
 av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
         s->compute_distance_ssd = ff_compute_distance_ssd_sse;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/af_volume_init.c b/libavfilter/x86/af_volume_init.c
index 88f5a9679a..28cfbe1ce1 100644
--- a/libavfilter/x86/af_volume_init.c
+++ b/libavfilter/x86/af_volume_init.c
@@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len,
 
 av_cold void ff_volume_init_x86(VolumeContext *vol)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);
 
@@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol)
             vol->samples_align = 8;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/avf_showcqt_init.c b/libavfilter/x86/avf_showcqt_init.c
index 2320b30239..1a5534a12e 100644
--- a/libavfilter/x86/avf_showcqt_init.c
+++ b/libavfilter/x86/avf_showcqt_init.c
@@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len)
 
 av_cold void ff_showcqt_init_x86(ShowCQTContext *s)
 {
+#if HAVE_X86ASM
     int cpuflags = av_get_cpu_flags();
 
 #define SELECT_CQT_CALC(type, TYPE, align, perm) \
@@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \
     SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm
     SELECT_CQT_CALC(avx,  AVX_FAST,  8, 01452367);
     SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367);
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c
index f01db4baf4..66c25cb361 100644
--- a/libavfilter/x86/colorspacedsp_init.c
+++ b/libavfilter/x86/colorspacedsp_init.c
@@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h,
 
 void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
         dsp->multiply3x3 = ff_multiply3x3_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index eb621e172c..8ec98f1a82 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst,
 
 av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     for (int p = 0; p < 4; p++) {
@@ -49,4 +50,5 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al
         }
 #endif
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_blend_init.c b/libavfilter/x86/vf_blend_init.c
index c326c43362..6d57bf7eac 100644
--- a/libavfilter/x86/vf_blend_init.c
+++ b/libavfilter/x86/vf_blend_init.c
@@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2)
 
 av_cold void ff_blend_init_x86(FilterParams *param, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (depth == 8) {
@@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param, int depth)
         }
 #endif /* ARCH_X86_64 */
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c
index 57f908a8ef..e20c655a9b 100644
--- a/libavfilter/x86/vf_bwdif_init.c
+++ b/libavfilter/x86/vf_bwdif_init.c
@@ -52,6 +52,7 @@ void ff_bwdif_filter_line_12bit_avx2(void *dst, void *prev, void *cur, void *nex
 
 av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif, int bit_depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (bit_depth <= 8) {
@@ -69,4 +70,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif, int bit_depth)
         if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c
index bff10ca1a4..5b5d1b672b 100644
--- a/libavfilter/x86/vf_convolution_init.c
+++ b/libavfilter/x86/vf_convolution_init.c
@@ -36,7 +36,7 @@ void ff_filter_sobel_avx512icl(uint8_t *dst, int width,
 
 av_cold void ff_convolution_init_x86(ConvolutionContext *s)
 {
-#if ARCH_X86_64
+#if ARCH_X86_64 && HAVE_X86ASM
     int i;
     int cpu_flags = av_get_cpu_flags();
     for (i = 0; i < 4; i++) {
diff --git a/libavfilter/x86/vf_framerate_init.c b/libavfilter/x86/vf_framerate_init.c
index 9d40faf0a4..b4a9dc574d 100644
--- a/libavfilter/x86/vf_framerate_init.c
+++ b/libavfilter/x86/vf_framerate_init.c
@@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS);
 
 void ff_framerate_init_x86(FrameRateContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (s->bitdepth == 8) {
         if (EXTERNAL_AVX2_FAST(cpu_flags))
@@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s)
         else if (EXTERNAL_SSE4(cpu_flags))
             s->blend = ff_blend_frames16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c
index 8e00317cb7..3618b70dc3 100644
--- a/libavfilter/x86/vf_fspp_init.c
+++ b/libavfilter/x86/vf_fspp_init.c
@@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t *pixels, ptrdiff_t line_size,
 
 av_cold void ff_fspp_init_x86(FSPPContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags)) {
@@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s)
         s->row_idct     = ff_row_idct_mmx;
         s->row_fdct     = ff_row_fdct_mmx;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_gblur_init.c b/libavfilter/x86/vf_gblur_init.c
index b47f6fbffb..01e1b82131 100644
--- a/libavfilter/x86/vf_gblur_init.c
+++ b/libavfilter/x86/vf_gblur_init.c
@@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begi
 
 av_cold void ff_gblur_init_x86(GBlurContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s)
         }
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_hflip_init.c b/libavfilter/x86/vf_hflip_init.c
index 0ac399b0d4..743b368ee9 100644
--- a/libavfilter/x86/vf_hflip_init.c
+++ b/libavfilter/x86/vf_hflip_init.c
@@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t *dst, int w);
 
 av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int i;
 
@@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_limiter_init.c b/libavfilter/x86/vf_limiter_init.c
index 07c733dc21..2c26f90f0f 100644
--- a/libavfilter/x86/vf_limiter_init.c
+++ b/libavfilter/x86/vf_limiter_init.c
@@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t *dst,
 
 void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp)
             dsp->limiter = ff_limiter_16bit_sse4;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedclamp_init.c b/libavfilter/x86/vf_maskedclamp_init.c
index 2a5388abac..94217cf485 100644
--- a/libavfilter/x86/vf_maskedclamp_init.c
+++ b/libavfilter/x86/vf_maskedclamp_init.c
@@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc, uint8_t *dst,
 
 av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -43,4 +44,5 @@ av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth)
     if (EXTERNAL_SSE4(cpu_flags) && depth > 8) {
         dsp->maskedclamp = ff_maskedclamp16_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_maskedmerge_init.c b/libavfilter/x86/vf_maskedmerge_init.c
index 73ab888083..2eee4a36c2 100644
--- a/libavfilter/x86/vf_maskedmerge_init.c
+++ b/libavfilter/x86/vf_maskedmerge_init.c
@@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const uint8_t *osrc,
 
 av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) {
         s->maskedmerge = ff_maskedmerge8_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_overlay_init.c b/libavfilter/x86/vf_overlay_init.c
index d4218b18f6..9f7d9c4909 100644
--- a/libavfilter/x86/vf_overlay_init.c
+++ b/libavfilter/x86/vf_overlay_init.c
@@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a,
 av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
                                  int alpha_format, int main_has_alpha)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags) &&
@@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format,
         s->blend_row[1] = ff_overlay_row_22_sse4;
         s->blend_row[2] = ff_overlay_row_22_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c
index 165b0dd5d0..ed5ab82794 100644
--- a/libavfilter/x86/vf_pp7_init.c
+++ b/libavfilter/x86/vf_pp7_init.c
@@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src);
 
 av_cold void ff_pp7_init_x86(PP7Context *p)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_MMX(cpu_flags))
         p->dctB = ff_pp7_dctB_mmx;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c
index c387812204..82be86d923 100644
--- a/libavfilter/x86/vf_psnr_init.c
+++ b/libavfilter/x86/vf_psnr_init.c
@@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w);
 
 void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
@@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp)
             dsp->sse_line = ff_sse_line_16bit_sse2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_removegrain_init.c b/libavfilter/x86/vf_removegrain_init.c
index 07314b3244..ff5f4771d2 100644
--- a/libavfilter/x86/vf_removegrain_init.c
+++ b/libavfilter/x86/vf_removegrain_init.c
@@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pix
 
 av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
 {
+#if HAVE_X86ASM
 #if CONFIG_GPL
     int cpu_flags = av_get_cpu_flags();
     int i;
@@ -85,4 +86,5 @@ av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg)
             }
     }
 #endif /* CONFIG_GPL */
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c
index 6f2305430c..ef39247056 100644
--- a/libavfilter/x86/vf_ssim_init.c
+++ b/libavfilter/x86/vf_ssim_init.c
@@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w);
 
 void ff_ssim_init_x86(SSIMDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
 #if ARCH_X86_64
@@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp)
         dsp->ssim_end_line = ff_ssim_end_line_sse4;
     if (EXTERNAL_XOP(cpu_flags))
         dsp->ssim_4x4_line = ff_ssim_4x4_line_xop;
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_stereo3d_init.c b/libavfilter/x86/vf_stereo3d_init.c
index da160a89a0..abd682ee80 100644
--- a/libavfilter/x86/vf_stereo3d_init.c
+++ b/libavfilter/x86/vf_stereo3d_init.c
@@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc,
 
 void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE4(cpu_flags)) {
         dsp->anaglyph = ff_anaglyph_sse4;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_threshold_init.c b/libavfilter/x86/vf_threshold_init.c
index 8e42296791..151a94f429 100644
--- a/libavfilter/x86/vf_threshold_init.c
+++ b/libavfilter/x86/vf_threshold_init.c
@@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2)
 
 av_cold void ff_threshold_init_x86(ThresholdContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->depth == 8) {
@@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s)
             s->threshold = ff_threshold16_avx2;
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c
index 1c25a2bb7a..c30a3247a2 100644
--- a/libavfilter/x86/vf_tinterlace_init.c
+++ b/libavfilter/x86/vf_tinterlace_init.c
@@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize,
 
 av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (s->csp->comp[0].depth > 8) {
@@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s)
             }
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_transpose_init.c b/libavfilter/x86/vf_transpose_init.c
index 95c56eab73..7db2e66258 100644
--- a/libavfilter/x86/vf_transpose_init.c
+++ b/libavfilter/x86/vf_transpose_init.c
@@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src,
 
 av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) {
@@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep)
     if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) {
         v->transpose_8x8 = ff_transpose_8x8_16_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c
index 2b2b06dd40..6b1b3811aa 100644
--- a/libavfilter/x86/vf_v360_init.c
+++ b/libavfilter/x86/vf_v360_init.c
@@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int width, const uint8_t *src, ptrd
 
 av_cold void ff_v360_init_x86(V360Context *s, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth <= 8)
@@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth)
                                           s->interp == MITCHELL) && depth <= 8)
         s->remap_line = ff_remap4_8bit_line_avx2;
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c
index 6d677d651d..d023ef7a49 100644
--- a/libavfilter/x86/vf_w3fdif_init.c
+++ b/libavfilter/x86/vf_w3fdif_init.c
@@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const int32_t *work_pixel,
 
 av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) {
@@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth)
         dsp->filter_complex_high = ff_w3fdif_complex_high_sse2;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c
index 257c3f9199..54917fa104 100644
--- a/libavfilter/x86/vf_yadif_init.c
+++ b/libavfilter/x86/vf_yadif_init.c
@@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur,
 
 av_cold void ff_yadif_init_x86(YADIFContext *yadif)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     int bit_depth = (!yadif->csp) ? 8
                                   : yadif->csp->comp[0].depth;
@@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif)
         if (EXTERNAL_SSSE3(cpu_flags))
             yadif->filter_line = ff_yadif_filter_line_ssse3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c
index d3f4b2e325..eb84027dbf 100644
--- a/libavutil/x86/fixed_dsp_init.c
+++ b/libavutil/x86/fixed_dsp_init.c
@@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int
 
 av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE2(cpu_flags)) {
         fdsp->butterflies_fixed = ff_butterflies_fixed_sse2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c
index ad6b506259..7495c0b9a8 100644
--- a/libavutil/x86/float_dsp_init.c
+++ b/libavutil/x86/float_dsp_init.c
@@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1,
 
 av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     if (EXTERNAL_SSE(cpu_flags)) {
@@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
         fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3;
         fdsp->scalarproduct_float = ff_scalarproduct_float_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c
index 91a16cf594..feac5d6fc7 100644
--- a/libavutil/x86/imgutils_init.c
+++ b/libavutil/x86/imgutils_init.c
@@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
                                     const uint8_t *src, ptrdiff_t src_linesize,
                                     ptrdiff_t bytewidth, int height)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64);
 
@@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t       *dst, ptrdiff_t dst_linesize,
         ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src, src_linesize,
                                          bw_aligned, height);
     else
+#endif /* HAVE_X86ASM */
         return AVERROR(ENOSYS);
 
     return 0;
diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c
index c786376915..67470185da 100644
--- a/libavutil/x86/lls_init.c
+++ b/libavutil/x86/lls_init.c
@@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double *var, int order);
 
 av_cold void ff_init_lls_x86(LLSModel *m)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
     if (EXTERNAL_SSE2(cpu_flags)) {
         m->update_lls = ff_update_lls_sse2;
@@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m)
     if (EXTERNAL_FMA3_FAST(cpu_flags)) {
         m->update_lls = ff_update_lls_fma3;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c
index c3c0662414..a2f842041d 100644
--- a/libavutil/x86/pixelutils_init.c
+++ b/libavutil/x86/pixelutils_init.c
@@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t *src1, ptrdiff_t stride1,
 
 void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
 {
+#if HAVE_X86ASM
     int cpu_flags = av_get_cpu_flags();
 
     // The best way to use SSE2 would be to do 2 SADs in parallel,
@@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned)
         case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1   aligned, src2   aligned
         }
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c
index f6d36f9ca6..d9eb43e1d5 100644
--- a/libswresample/x86/audio_convert_init.c
+++ b/libswresample/x86/audio_convert_init.c
@@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac,
             ac->simd_f =  ff_int32_to_int16_a_ ## cap;\
     }
 
+#if HAVE_X86ASM
 MULTI_CAPS_FUNC(SSE2, sse2)
 
     if(EXTERNAL_SSE(mm_flags)) {
@@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2)
         if(   out_fmt == AV_SAMPLE_FMT_S32  && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP)
             ac->simd_f =  ff_float_to_int32_a_avx2;
     }
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswresample/x86/resample_init.c b/libswresample/x86/resample_init.c
index d13ccd4833..4eebf5d6f9 100644
--- a/libswresample/x86/resample_init.c
+++ b/libswresample/x86/resample_init.c
@@ -51,6 +51,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
 
     switch(c->format){
     case AV_SAMPLE_FMT_S16P:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_int16_sse2;
             c->dsp.resample_common = ff_resample_common_int16_sse2;
@@ -59,8 +60,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_int16_xop;
             c->dsp.resample_common = ff_resample_common_int16_xop;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_FLTP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_float_sse;
             c->dsp.resample_common = ff_resample_common_float_sse;
@@ -77,8 +80,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_float_fma4;
             c->dsp.resample_common = ff_resample_common_float_fma4;
         }
+#endif /* HAVE_X86ASM */
         break;
     case AV_SAMPLE_FMT_DBLP:
+#if HAVE_X86ASM
         if (EXTERNAL_SSE2(mm_flags)) {
             c->dsp.resample_linear = ff_resample_linear_double_sse2;
             c->dsp.resample_common = ff_resample_common_double_sse2;
@@ -91,6 +96,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
             c->dsp.resample_linear = ff_resample_linear_double_fma3;
             c->dsp.resample_common = ff_resample_common_double_fma3;
         }
+#endif /* HAVE_X86ASM */
         break;
     }
 }
diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c
index b325e5dbd5..e39f327bf2 100644
--- a/libswscale/x86/rgb2rgb.c
+++ b/libswscale/x86/rgb2rgb.c
@@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void)
         rgb2rgb_init_avx();
 #endif /* HAVE_INLINE_ASM */
 
+#if HAVE_X86ASM
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext;
     }
@@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void)
         uyvytoyuv422 = ff_uyvytoyuv422_avx;
     }
 #endif
+#endif /* HAVE_X86ASM */
 }
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index ff16398988..0a14262916 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -529,6 +529,7 @@ switch(c->dstBpc){ \
              else                ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
              break; \
     }
+#if HAVE_X86ASM
     if (EXTERNAL_SSE2(cpu_flags)) {
         ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
         ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
@@ -805,4 +806,5 @@ switch(c->dstBpc){ \
     }
 
 #endif
+#endif /* HAVE_X86ASM */
 }
-- 
2.41.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] 54+ messages in thread

* Re: [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2
  2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
@ 2023-07-31 18:28         ` Michael Niedermayer
  0 siblings, 0 replies; 54+ messages in thread
From: Michael Niedermayer @ 2023-07-31 18:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1282 bytes --]

On Sat, Jul 29, 2023 at 04:07:15PM -0300, L. E. Segovia wrote:
> Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a
> 
> Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
> 
> Signed-off-by: L. E. Segovia <amy@amyspark.me>
> ---
>  libavcodec/x86/fdctdsp_init.c        |   2 +
>  libavcodec/x86/flacdsp_init.c        |   8 +-
>  libavcodec/x86/hevcdsp_init.c        | 547 ++++++++++++++-------------
>  libavcodec/x86/idctdsp_init.c        |   9 +-
>  libavcodec/x86/mlpdsp_init.c         |   6 +-
>  libavcodec/x86/vc1dsp_init.c         |   6 +-
>  libavfilter/x86/colorspacedsp_init.c |   4 +-
>  libavfilter/x86/vf_atadenoise_init.c |   6 +-
>  libavfilter/x86/vf_ssim_init.c       |   4 +-
>  libavfilter/x86/vf_w3fdif_init.c     |   4 +-
>  10 files changed, 311 insertions(+), 285 deletions(-)

this produces heavy distortion in files encoded like this:

./ffmpeg -enable_drefs 1 -i mov-ref/dir1/dir2/movie3.mov  -bitexact file4671-3.avi

https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4671/

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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] 54+ messages in thread

end of thread, other threads:[~2023-07-31 18:28 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia
2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
2022-11-01 22:28   ` Andreas Rheinhardt
2022-11-03 12:55     ` L. E. Segovia
2022-11-03 14:19       ` Andreas Rheinhardt
2022-11-03 21:59   ` Carl Eugen Hoyos
2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
2022-11-02  0:38   ` Andreas Rheinhardt
2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
2022-11-02  0:42   ` Andreas Rheinhardt
2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
2022-11-02  0:26   ` Andreas Rheinhardt
2022-11-02  1:08 ` [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE Andreas Rheinhardt
2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 0/5] " L. E. Segovia
2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia
2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
2022-11-03 15:55   ` Lynne
2022-11-14  9:01     ` L. E. Segovia
2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia
2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
2022-11-03 16:36   ` [FFmpeg-devel] [PATCH v3 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
2022-11-07 14:48   ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia
2022-11-17 22:45     ` L. E. Segovia
2022-11-26 19:17     ` L. E. Segovia
2022-11-27 15:51       ` Carl Eugen Hoyos
2022-11-27 16:29         ` Soft Works
2022-11-27 16:46           ` Carl Eugen Hoyos
2022-11-27 17:16             ` Soft Works
2022-11-27 17:45               ` Carl Eugen Hoyos
2022-11-27 19:23                 ` Soft Works
2022-11-27 17:50               ` Hendrik Leppkes
2022-11-27 18:28                 ` Soft Works
2023-07-28  1:37   ` [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations L. E. Segovia
2023-07-28 10:40     ` Reimar Döffinger
2023-07-28 10:48       ` Reimar Döffinger
2023-07-28 10:55         ` Nicolas George
2023-07-28 13:21           ` Matt Oliver
2023-07-29 18:57             ` L. E. Segovia
2023-07-29 19:07     ` [FFmpeg-devel] [PATCH v5 " L. E. Segovia
     [not found]     ` <cover.1690657578.git.amy@amyspark.me>
2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
2023-07-31 18:28         ` Michael Niedermayer
2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
2023-07-29 19:07       ` [FFmpeg-devel] [PATCH v5 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
2023-07-29 19:08       ` [FFmpeg-devel] [PATCH v5 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
     [not found]   ` <cover.1690508131.git.amy@amyspark.me>
2023-07-28  1:37     ` [FFmpeg-devel] [PATCH v4 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia
2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia
2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia
2023-07-28  1:38     ` [FFmpeg-devel] [PATCH v4 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia

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