All: Removed reliance on compiler performing dead code elimination, changed various...
authorPiotr Pawlowski <p@perkele.cc>
Thu, 30 Oct 2025 13:41:40 +0000 (14:41 +0100)
committerKacper Michajłow <kasper93@gmail.com>
Fri, 28 Nov 2025 18:52:51 +0000 (19:52 +0100)
15 files changed:
libavcodec/avcodec.c
libavcodec/encode.c
libavcodec/x86/flacdsp_init.c
libavcodec/x86/hevc/dsp_init.c
libavcodec/x86/idctdsp_init.c
libavcodec/x86/mlpdsp_init.c
libavcodec/x86/v210-init.c
libavcodec/x86/v210enc_init.c
libavfilter/x86/colorspacedsp_init.c
libavfilter/x86/f_ebur128_init.c
libavfilter/x86/vf_atadenoise_init.c
libavfilter/x86/vf_bwdif_init.c
libavfilter/x86/vf_nlmeans_init.c
libavfilter/x86/vf_ssim_init.c
libavfilter/x86/vf_w3fdif_init.c

index 14aca0f164caa3cfc96460225e526fe45954b875..dacdfba8da1b313aba69d497500c1034fcdff008 100644 (file)
@@ -437,10 +437,11 @@ av_cold void ff_codec_close(AVCodecContext *avctx)
     if (avcodec_is_open(avctx)) {
         AVCodecInternal *avci = avctx->internal;
 
-        if (CONFIG_FRAME_THREAD_ENCODER &&
-            avci->frame_thread_encoder && avctx->thread_count > 1) {
+#if CONFIG_FRAME_THREAD_ENCODER
+        if (avci->frame_thread_encoder && avctx->thread_count > 1) {
             ff_frame_thread_encoder_free(avctx);
         }
+#endif
         if (HAVE_THREADS && avci->thread_ctx)
             ff_thread_free(avctx);
         if (avci->needs_close && ffcodec(avctx->codec)->close)
index 6e0620a36e50d666a52fd518a1da95c5017d1665..407bd8920ff6f28266bf2696e5bd2c5a7d41b608 100644 (file)
@@ -317,12 +317,13 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
 
     av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE);
 
-    if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder)
+#if CONFIG_FRAME_THREAD_ENCODER
+    if (avci->frame_thread_encoder)
         /* This will unref frame. */
         ret = ff_thread_video_encode_frame(avctx, avpkt, frame, &got_packet);
-    else {
+    else
+#endif
         ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
-    }
 
     if (avci->draining && !got_packet)
         avci->draining_done = 1;
@@ -825,11 +826,11 @@ int ff_encode_preinit(AVCodecContext *avctx)
         memcpy(sd_packet->data, sd_frame->data, sd_frame->size);
     }
 
-    if (CONFIG_FRAME_THREAD_ENCODER) {
-        ret = ff_frame_thread_encoder_init(avctx);
-        if (ret < 0)
-            return ret;
-    }
+#if CONFIG_FRAME_THREAD_ENCODER
+    ret = ff_frame_thread_encoder_init(avctx);
+    if (ret < 0)
+        return ret;
+#endif
 
     return 0;
 }
index fa993d34669e739873c578bbffda43fb281d31ad..386955ba67883f994aadcb15e321ab2118cb4650 100644 (file)
@@ -85,8 +85,10 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_16_ssse3;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_16_ssse3;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_16_ssse3;
+#endif
         } else if (fmt == AV_SAMPLE_FMT_S32) {
             if (channels == 2)
                 c->decorrelate[0] = ff_flac_decorrelate_indep2_32_ssse3;
@@ -94,8 +96,10 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int
                 c->decorrelate[0] = ff_flac_decorrelate_indep4_32_ssse3;
             else if (channels == 6)
                 c->decorrelate[0] = ff_flac_decorrelate_indep6_32_ssse3;
-            else if (ARCH_X86_64 && channels == 8)
+#if ARCH_X86_64
+            else if (channels == 8)
                 c->decorrelate[0] = ff_flac_decorrelate_indep8_32_ssse3;
+#endif
         }
     }
     if (EXTERNAL_SSE4(cpu_flags)) {
@@ -105,15 +109,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)) {
index f1558b7e3e2900c03bd811ce8362900dff1cc427..5b2b10f33aba50805cffb77a9c5bfd539606b788 100644 (file)
@@ -821,13 +821,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[0] = ff_hevc_idct_4x4_dc_8_sse2;
@@ -843,10 +843,10 @@ 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 HAVE_SSE4_EXTERNAL && ARCH_X86_64
@@ -866,13 +866,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         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;
@@ -982,7 +982,8 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->add_residual[3] = ff_hevc_add_residual_32_8_avx2;
         }
 #endif /* HAVE_AVX2_EXTERNAL */
-        if (EXTERNAL_AVX512ICL(cpu_flags) && ARCH_X86_64) {
+#if ARCH_X86_64
+        if (EXTERNAL_AVX512ICL(cpu_flags)) {
             c->put_hevc_qpel[1][0][1] = ff_hevc_put_qpel_h4_8_avx512icl;
             c->put_hevc_qpel[3][0][1] = ff_hevc_put_qpel_h8_8_avx512icl;
             c->put_hevc_qpel[5][0][1] = ff_hevc_put_qpel_h16_8_avx512icl;
@@ -990,6 +991,7 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
             c->put_hevc_qpel[9][0][1] = ff_hevc_put_qpel_h64_8_avx512icl;
             c->put_hevc_qpel[3][1][1] = ff_hevc_put_qpel_hv8_8_avx512icl;
         }
+#endif
     } else if (bit_depth == 10) {
         if (EXTERNAL_MMXEXT(cpu_flags)) {
             c->add_residual[0] = ff_hevc_add_residual_4_10_mmxext;
@@ -997,13 +999,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);
 
@@ -1019,10 +1021,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;
         }
+#endif
 #if HAVE_SSE4_EXTERNAL && ARCH_X86_64
         if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4);
@@ -1039,13 +1043,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         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;
@@ -1216,10 +1220,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);
 
@@ -1228,10 +1232,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;
         }
+#endif
 #if HAVE_SSE4_EXTERNAL && ARCH_X86_64
         if (EXTERNAL_SSE4(cpu_flags)) {
             EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4);
@@ -1248,10 +1254,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
         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)) {
index 9c7f235b3f599aac4a279e1d1d9050c58279713e..fce62e5590f6af97558c2f15509f21b25645b48d 100644 (file)
@@ -83,8 +83,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 ||
@@ -95,9 +95,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 ||
@@ -147,4 +149,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
             }
         }
     }
+#endif
 }
index 950f996832b5a57f2fd6a382c216abbdab8b672c..21a0e3814352c646bf083b2af489a47cf5c92d7e 100644 (file)
@@ -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 // ARCH_X86_64
 }
index 8b3677b8aa3b8fb17fb776b601d991751c1f7723..895cc8f3299de46afc16f472c88f2ce07b74d94a 100644 (file)
@@ -38,28 +38,38 @@ av_cold void ff_v210_x86_init(V210DecContext *s)
     if (s->aligned_input) {
         if (cpu_flags & AV_CPU_FLAG_SSSE3)
             s->unpack_frame = ff_v210_planar_unpack_aligned_ssse3;
-
-        if (HAVE_AVX_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX)
+#if HAVE_AVX_EXTERNAL
+        if (cpu_flags & AV_CPU_FLAG_AVX)
             s->unpack_frame = ff_v210_planar_unpack_aligned_avx;
+#endif
 
-        if (HAVE_AVX2_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX2)
+#if HAVE_AVX2_EXTERNAL
+        if (cpu_flags & AV_CPU_FLAG_AVX2)
             s->unpack_frame = ff_v210_planar_unpack_aligned_avx2;
+#endif
 
+#if HAVE_AVX512ICL_EXTERNAL
         if (EXTERNAL_AVX512ICL(cpu_flags))
             s->unpack_frame = ff_v210_planar_unpack_avx512icl;
+#endif
     }
     else {
         if (cpu_flags & AV_CPU_FLAG_SSSE3)
             s->unpack_frame = ff_v210_planar_unpack_unaligned_ssse3;
-
-        if (HAVE_AVX_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX)
+#if HAVE_AVX_EXTERNAL
+        if (cpu_flags & AV_CPU_FLAG_AVX)
             s->unpack_frame = ff_v210_planar_unpack_unaligned_avx;
+#endif
 
-        if (HAVE_AVX2_EXTERNAL && cpu_flags & AV_CPU_FLAG_AVX2)
+#if HAVE_AVX2_EXTERNAL
+        if (cpu_flags & AV_CPU_FLAG_AVX2)
             s->unpack_frame = ff_v210_planar_unpack_unaligned_avx2;
+#endif
 
+#if HAVE_AVX512ICL_EXTERNAL
         if (EXTERNAL_AVX512ICL(cpu_flags))
             s->unpack_frame = ff_v210_planar_unpack_avx512icl;
-    }
 #endif
+    }
+#endif // HAVE_X86ASM
 }
index 44f22ca7fea396854206769afac2321766668f25..8396ea7a0b7c50e2bff6fbd047f3b40c3b109879 100644 (file)
@@ -71,11 +71,12 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
         s->pack_line_10      = ff_v210_planar_pack_10_avx512;
 #endif
     }
-
+#if HAVE_AVX512ICL_EXTERNAL
     if (EXTERNAL_AVX512ICL(cpu_flags)) {
         s->sample_factor_8  = 4;
         s->pack_line_8      = ff_v210_planar_pack_8_avx512icl;
         s->sample_factor_10 = 4;
         s->pack_line_10     = ff_v210_planar_pack_10_avx512icl;
     }
+#endif
 }
index b5006ac2954ba7648bd7b5a08183d7033a81836c..429cc8bd263b464b3b09a02bb2e2dcfbfb1cc916 100644 (file)
@@ -78,9 +78,10 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h,
 
 void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp)
 {
+#if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+    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
 }
index 6d43b4887f45175fe5b070088b4098bf93870606..8169e75cccc53af8bf95502003ee36e7f5998081 100644 (file)
@@ -30,12 +30,14 @@ double ff_ebur128_find_peak_2ch_avx(double *, int, const double *, int);
 
 av_cold void ff_ebur128_init_x86(EBUR128DSPContext *dsp, int nb_channels)
 {
+#if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_AVX(cpu_flags)) {
+    if (EXTERNAL_AVX(cpu_flags)) {
         if (nb_channels >= 2)
             dsp->filter_channels = ff_ebur128_filter_channels_avx;
         if (nb_channels == 2)
             dsp->find_peak = ff_ebur128_find_peak_2ch_avx;
     }
+#endif
 }
index e7a653f1911b7d30d8cd2071d5dcbda1d5759f47..3847e53250a907a5ee17d29c412059e231bdde03 100644 (file)
@@ -36,15 +36,17 @@ 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 ARCH_X86_64
     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 (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
 }
index 76b574b2a921da6002c8aada60bc16d3b2877f65..51508ee771c31a4a04b82954171e476fc40992b7 100644 (file)
@@ -67,18 +67,22 @@ av_cold void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth)
             bwdif->filter_line = ff_bwdif_filter_line_sse2;
         if (EXTERNAL_SSSE3(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_ssse3;
-        if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
+#if ARCH_X86_64
+        if (EXTERNAL_AVX2_FAST(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_avx2;
-        if (ARCH_X86_64 && EXTERNAL_AVX512ICL(cpu_flags))
+        if (EXTERNAL_AVX512ICL(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_avx512icl;
+#endif
     } else if (bit_depth <= 12) {
         if (EXTERNAL_SSE2(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_sse2;
         if (EXTERNAL_SSSE3(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3;
-        if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
+#if ARCH_X86_64
+        if (EXTERNAL_AVX2_FAST(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_avx2;
-        if (ARCH_X86_64 && EXTERNAL_AVX512ICL(cpu_flags))
+        if (EXTERNAL_AVX512ICL(cpu_flags))
             bwdif->filter_line = ff_bwdif_filter_line_12bit_avx512icl;
+#endif
     }
 }
index 37764d30ab402ae291d8a9466b44b5ba17cb18f1..5d67090a98973724a197079134d93836f1e631a1 100644 (file)
@@ -33,8 +33,10 @@ void ff_compute_weights_line_avx2(const uint32_t *const iia,
 
 av_cold void ff_nlmeans_init_x86(NLMeansDSPContext *dsp)
 {
+#if ARCH_X86_64
     int cpu_flags = av_get_cpu_flags();
 
-    if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
+    if (EXTERNAL_AVX2_FAST(cpu_flags))
         dsp->compute_weights_line = ff_compute_weights_line_avx2;
+#endif
 }
index cbaa20ef166a3426bcf224141bb2c37468972b20..6f2305430ce3ec8432b84d1a619e998b4b9d11ae 100644 (file)
@@ -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))
index 16202fba765192bc4147010eb9274808ad01d593..6d677d651da00f497a7c97e3cf54ea489d036e0a 100644 (file)
@@ -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
 }