History

all: Replace if (ARCH_FOO) checks by #if ARCH_FOO

This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components).

Andreas Rheinhardt committed 4 years ago

Commit 40e65751 parent e5f6707131 files · +739 −568Browse files

Unified · Split

131 files
  1. libavcodec/aacdec_template.c +3 −2
  2. libavcodec/aacenc.c +6 −4
  3. libavcodec/aacpsdsp_template.c +9 −8
  4. libavcodec/aacsbr_template.c +3 −2
  5. libavcodec/ac3dsp.c +10 −8
  6. libavcodec/acelp_filters.c +3 −2
  7. libavcodec/acelp_vectors.c +3 −2
  8. libavcodec/alacdsp.c +3 −2
  9. libavcodec/audiodsp.c +7 −6
  10. libavcodec/blockdsp.c +11 −10
  11. libavcodec/bswapdsp.c +3 −2
  12. libavcodec/cavsdsp.c +3 −2
  13. libavcodec/celp_filters.c +3 −2
  14. libavcodec/celp_math.c +3 −2
  15. libavcodec/cfhddsp.c +3 −2
  16. libavcodec/cfhdencdsp.c +3 −2
  17. libavcodec/dcadsp.c +3 −2
  18. libavcodec/dct.c +3 −2
  19. libavcodec/dirac_dwt.c +3 −1
  20. libavcodec/diracdsp.c +3 −2
  21. libavcodec/dnxhdenc.c +3 −2
  22. libavcodec/exrdsp.c +3 −2
  23. libavcodec/fdctdsp.c +6 −5
  24. libavcodec/fft_template.c +12 −5
  25. libavcodec/flacdsp.c +5 −4
  26. libavcodec/fmtconvert.c +12 −10
  27. libavcodec/g722dsp.c +5 −4
  28. libavcodec/h263dsp.c +5 −4
  29. libavcodec/h264chroma.c +13 −12
  30. libavcodec/h264dsp.c +13 −6
  31. libavcodec/h264pred.c +11 −10
  32. libavcodec/h264qpel.c +13 −12
  33. libavcodec/hevcdsp.c +13 −12
  34. libavcodec/hevcpred.c +3 −2
  35. libavcodec/hpeldsp.c +15 −14
  36. libavcodec/huffyuvdsp.c +3 −2
  37. libavcodec/huffyuvencdsp.c +3 −2
  38. libavcodec/idctdsp.c +21 −19
  39. libavcodec/iirfilter.c +3 −2
  40. libavcodec/jpeg2000dsp.c +3 −2
  41. libavcodec/lossless_audiodsp.c +7 −6
  42. libavcodec/lossless_videodsp.c +5 −4
  43. libavcodec/lossless_videoencdsp.c +3 −2
  44. libavcodec/lpc.c +3 −2
  45. libavcodec/mdct15.c +3 −2
  46. libavcodec/me_cmp.c +11 −10
  47. libavcodec/mlpdsp.c +5 −4
  48. libavcodec/mpegaudiodsp.c +18 −8
  49. libavcodec/mpegvideo.c +15 −13
  50. libavcodec/mpegvideo_enc.c +3 −2
  51. libavcodec/mpegvideodsp.c +5 −4
  52. libavcodec/mpegvideoencdsp.c +9 −8
  53. libavcodec/opus_pvq.c +3 −2
  54. libavcodec/opusdsp.c +5 −5
  55. libavcodec/pixblockdsp.c +14 −13
  56. libavcodec/pngdsp.c +3 −2
  57. libavcodec/proresdsp.c +3 −2
  58. libavcodec/qpeldsp.c +5 −4
  59. libavcodec/rdft.c +3 −1
  60. libavcodec/rv34dsp.c +5 −4
  61. libavcodec/rv40dsp.c +7 −6
  62. libavcodec/sbcdsp.c +5 −4
  63. libavcodec/sbrdsp_template.c +9 −8
  64. libavcodec/snow_dwt.c +3 −2
  65. libavcodec/svq1enc.c +5 −4
  66. libavcodec/synth_filter.c +7 −6
  67. libavcodec/takdsp.c +3 −2
  68. libavcodec/ttadsp.c +3 −2
  69. libavcodec/ttaencdsp.c +3 −2
  70. libavcodec/utvideodsp.c +3 −2
  71. libavcodec/v210dec_init.h +3 −2
  72. libavcodec/v210enc_init.h +3 −2
  73. libavcodec/vc1dsp.c +13 −12
  74. libavcodec/videodsp.c +13 −12
  75. libavcodec/vorbisdsp.c +9 −8
  76. libavcodec/vp3dsp.c +9 −8
  77. libavcodec/vp56dsp.c +5 −4
  78. libavcodec/vp8dsp.c +20 −18
  79. libavcodec/vp9dsp.c +11 −5
  80. libavcodec/wmv2dsp.c +3 −2
  81. libavcodec/x86/mdct15_init.c +4 −2
  82. libavcodec/xvididct.c +5 −4
  83. libavfilter/af_afirdsp.h +3 −2
  84. libavfilter/af_anlmdn.c +3 −2
  85. libavfilter/af_volume.c +3 −2
  86. libavfilter/avf_showcqt.c +3 −2
  87. libavfilter/colorspacedsp.c +3 −2
  88. libavfilter/scene_sad.c +3 −2
  89. libavfilter/vf_atadenoise.c +3 −2
  90. libavfilter/vf_blend_init.h +3 −2
  91. libavfilter/vf_bwdif.c +3 −2
  92. libavfilter/vf_eq.h +3 −2
  93. libavfilter/vf_framerate.c +3 −2
  94. libavfilter/vf_fspp.c +3 −2
  95. libavfilter/vf_gblur_init.h +3 −2
  96. libavfilter/vf_gradfun.c +3 −2
  97. libavfilter/vf_hflip_init.h +3 −2
  98. libavfilter/vf_hqdn3d.c +3 −2
  99. libavfilter/vf_idet.c +6 −4
  100. libavfilter/vf_limiter.c +3 −2
  101. libavfilter/vf_lut3d.c +3 −3
  102. libavfilter/vf_maskedclamp.c +3 −2
  103. libavfilter/vf_maskedmerge.c +3 −2
  104. libavfilter/vf_nlmeans_init.h +5 −5
  105. libavfilter/vf_noise.c +3 −2
  106. libavfilter/vf_overlay.c +4 −3
  107. libavfilter/vf_pp7.c +3 −2
  108. libavfilter/vf_psnr.c +3 −2
  109. libavfilter/vf_pullup.c +3 −2
  110. libavfilter/vf_removegrain.c +3 −2
  111. libavfilter/vf_spp.c +3 −2
  112. libavfilter/vf_ssim.c +3 −2
  113. libavfilter/vf_stereo3d.c +3 −2
  114. libavfilter/vf_threshold_init.h +3 −2
  115. libavfilter/vf_tinterlace.c +6 −4
  116. libavfilter/vf_transpose.c +5 −5
  117. libavfilter/vf_v360.c +3 −2
  118. libavfilter/vf_w3fdif.c +3 −2
  119. libavfilter/vf_yadif.c +3 −2
  120. libavutil/cpu.c +26 −24
  121. libavutil/fixed_dsp.c +3 −2
  122. libavutil/float_dsp.c +11 −10
  123. libavutil/lls.c +3 −2
  124. libswresample/audioconvert.c +7 −3
  125. libswresample/rematrix.c +3 −2
  126. libswresample/resample_dsp.c +7 −3
  127. libswscale/rgb2rgb.c +5 −4
  128. libswscale/swscale.c +9 −8
  129. libswscale/swscale_unscaled.c +7 −6
  130. libswscale/utils.c +4 −3
  131. libswscale/yuv2rgb.c +5 −4
libavcodec/aacdec_template.c+3−2
@@ -3550,8 +3550,9 @@ static void aacdec_init(AACContext *c) · 3549 unmodified lines
35503550 #endif
35513551
35523552 #if !USE_FIXED
3553− if(ARCH_MIPS)
3554− ff_aacdec_init_mips(c);
3553+#if ARCH_MIPS
3554+ ff_aacdec_init_mips(c);
3555+#endif
35553556 #endif /* !USE_FIXED */
35563557 }
35573558 /**
libavcodec/aacenc.c+6−4
@@ -1096,11 +1096,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 1095 unmodified lines
10961096 s->abs_pow34 = abs_pow34_v;
10971097 s->quant_bands = quantize_bands;
10981098
1099− if (ARCH_X86)
1100− ff_aac_dsp_init_x86(s);
1099+#if ARCH_X86
1100+ ff_aac_dsp_init_x86(s);
1101+#endif
11011102
1102− if (HAVE_MIPSDSP)
1103− ff_aac_coder_init_mips(s);
1103+#if HAVE_MIPSDSP
1104+ ff_aac_coder_init_mips(s);
1105+#endif
11041106
11051107 ff_af_queue_init(avctx, &s->afq);
11061108 ff_aac_tableinit();
libavcodec/aacpsdsp_template.c+9−8
@@ -221,13 +221,14 @@ av_cold void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s) · 220 unmodified lines
221221 s->stereo_interpolate[1] = ps_stereo_interpolate_ipdopd_c;
222222
223223 #if !USE_FIXED
224− if (ARCH_ARM)
225− ff_psdsp_init_arm(s);
226− if (ARCH_AARCH64)
227− ff_psdsp_init_aarch64(s);
228− if (ARCH_MIPS)
229− ff_psdsp_init_mips(s);
230− if (ARCH_X86)
231− ff_psdsp_init_x86(s);
224+#if ARCH_ARM
225+ ff_psdsp_init_arm(s);
226+#elif ARCH_AARCH64
227+ ff_psdsp_init_aarch64(s);
228+#elif ARCH_MIPS
229+ ff_psdsp_init_mips(s);
230+#elif ARCH_X86
231+ ff_psdsp_init_x86(s);
232+#endif
232233 #endif /* !USE_FIXED */
233234 }
libavcodec/aacsbr_template.c+3−2
@@ -1573,7 +1573,8 @@ static void aacsbr_func_ptr_init(AACSBRContext *c) · 1572 unmodified lines
15731573 c->sbr_hf_inverse_filter = sbr_hf_inverse_filter;
15741574
15751575 #if !USE_FIXED
1576− if(ARCH_MIPS)
1577− ff_aacsbr_func_ptr_init_mips(c);
1576+#if ARCH_MIPS
1577+ ff_aacsbr_func_ptr_init_mips(c);
1578+#endif
15781579 #endif
15791580 }
libavcodec/ac3dsp.c+10−8
@@ -363,8 +363,9 @@ void ff_ac3dsp_downmix(AC3DSPContext *c, float **samples, float **matrix, · 362 unmodified lines
363363 c->downmix = ac3_downmix_5_to_1_symmetric_c;
364364 }
365365
366− if (ARCH_X86)
367− ff_ac3dsp_set_downmix_x86(c);
366+#if ARCH_X86
367+ ff_ac3dsp_set_downmix_x86(c);
368+#endif
368369 }
369370
370371 if (c->downmix)
@@ -388,10 +389,11 @@ av_cold void ff_ac3dsp_init(AC3DSPContext *c, int bit_exact) · 17 unmodified lines
388389 c->downmix = NULL;
389390 c->downmix_fixed = NULL;
390391
391− if (ARCH_ARM)
392− ff_ac3dsp_init_arm(c, bit_exact);
393− if (ARCH_X86)
394− ff_ac3dsp_init_x86(c, bit_exact);
395− if (ARCH_MIPS)
396− ff_ac3dsp_init_mips(c, bit_exact);
392+#if ARCH_ARM
393+ ff_ac3dsp_init_arm(c, bit_exact);
394+#elif ARCH_X86
395+ ff_ac3dsp_init_x86(c, bit_exact);
396+#elif ARCH_MIPS
397+ ff_ac3dsp_init_mips(c, bit_exact);
398+#endif
397399 }
libavcodec/acelp_filters.c+3−2
@@ -152,6 +152,7 @@ void ff_acelp_filter_init(ACELPFContext *c) · 151 unmodified lines
152152 c->acelp_interpolatef = ff_acelp_interpolatef;
153153 c->acelp_apply_order_2_transfer_function = ff_acelp_apply_order_2_transfer_function;
154154
155− if(HAVE_MIPSFPU)
156− ff_acelp_filter_init_mips(c);
155+#if HAVE_MIPSFPU
156+ ff_acelp_filter_init_mips(c);
157+#endif
157158 }
libavcodec/acelp_vectors.c+3−2
@@ -259,6 +259,7 @@ void ff_acelp_vectors_init(ACELPVContext *c) · 258 unmodified lines
259259 {
260260 c->weighted_vector_sumf = ff_weighted_vector_sumf;
261261
262− if(HAVE_MIPSFPU)
263− ff_acelp_vectors_init_mips(c);
262+#if HAVE_MIPSFPU
263+ ff_acelp_vectors_init_mips(c);
264+#endif
264265 }
libavcodec/alacdsp.c+3−2
@@ -58,6 +58,7 @@ av_cold void ff_alacdsp_init(ALACDSPContext *c) · 57 unmodified lines
5858 c->append_extra_bits[0] =
5959 c->append_extra_bits[1] = append_extra_bits;
6060
61− if (ARCH_X86)
62− ff_alacdsp_init_x86(c);
61+#if ARCH_X86
62+ ff_alacdsp_init_x86(c);
63+#endif
6364 }
libavcodec/audiodsp.c+7−6
@@ -109,10 +109,11 @@ av_cold void ff_audiodsp_init(AudioDSPContext *c) · 108 unmodified lines
109109 c->vector_clip_int32 = vector_clip_int32_c;
110110 c->vector_clipf = vector_clipf_c;
111111
112− if (ARCH_ARM)
113− ff_audiodsp_init_arm(c);
114− if (ARCH_PPC)
115− ff_audiodsp_init_ppc(c);
116− if (ARCH_X86)
117− ff_audiodsp_init_x86(c);
112+#if ARCH_ARM
113+ ff_audiodsp_init_arm(c);
114+#elif ARCH_PPC
115+ ff_audiodsp_init_ppc(c);
116+#elif ARCH_X86
117+ ff_audiodsp_init_x86(c);
118+#endif
118119 }
libavcodec/blockdsp.c+11−10
@@ -64,14 +64,15 @@ av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx) · 63 unmodified lines
6464 c->fill_block_tab[0] = fill_block16_c;
6565 c->fill_block_tab[1] = fill_block8_c;
6666
67− if (ARCH_ALPHA)
68− ff_blockdsp_init_alpha(c);
69− if (ARCH_ARM)
70− ff_blockdsp_init_arm(c);
71− if (ARCH_PPC)
72− ff_blockdsp_init_ppc(c);
73− if (ARCH_X86)
74− ff_blockdsp_init_x86(c, avctx);
75− if (ARCH_MIPS)
76− ff_blockdsp_init_mips(c);
67+#if ARCH_ALPHA
68+ ff_blockdsp_init_alpha(c);
69+#elif ARCH_ARM
70+ ff_blockdsp_init_arm(c);
71+#elif ARCH_PPC
72+ ff_blockdsp_init_ppc(c);
73+#elif ARCH_X86
74+ ff_blockdsp_init_x86(c, avctx);
75+#elif ARCH_MIPS
76+ ff_blockdsp_init_mips(c);
77+#endif
7778 }
libavcodec/bswapdsp.c+3−2
@@ -51,6 +51,7 @@ av_cold void ff_bswapdsp_init(BswapDSPContext *c) · 50 unmodified lines
5151 c->bswap_buf = bswap_buf;
5252 c->bswap16_buf = bswap16_buf;
5353
54− if (ARCH_X86)
55− ff_bswapdsp_init_x86(c);
54+#if ARCH_X86
55+ ff_bswapdsp_init_x86(c);
56+#endif
5657 }
libavcodec/cavsdsp.c+3−2
@@ -577,6 +577,7 @@ av_cold void ff_cavsdsp_init(CAVSDSPContext* c, AVCodecContext *avctx) { · 576 unmodified lines
577577 c->cavs_idct8_add = cavs_idct8_add_c;
578578 c->idct_perm = FF_IDCT_PERM_NONE;
579579
580− if (ARCH_X86)
581− ff_cavsdsp_init_x86(c, avctx);
580+#if ARCH_X86
581+ ff_cavsdsp_init_x86(c, avctx);
582+#endif
582583 }
libavcodec/celp_filters.c+3−2
@@ -215,6 +215,7 @@ void ff_celp_filter_init(CELPFContext *c) · 214 unmodified lines
215215 c->celp_lp_synthesis_filterf = ff_celp_lp_synthesis_filterf;
216216 c->celp_lp_zero_synthesis_filterf = ff_celp_lp_zero_synthesis_filterf;
217217
218− if(HAVE_MIPSFPU)
219− ff_celp_filter_init_mips(c);
218+#if HAVE_MIPSFPU
219+ ff_celp_filter_init_mips(c);
220+#endif
220221 }
libavcodec/celp_math.c+3−2
@@ -122,6 +122,7 @@ void ff_celp_math_init(CELPMContext *c) · 121 unmodified lines
122122 {
123123 c->dot_productf = ff_dot_productf;
124124
125− if(HAVE_MIPSFPU)
126− ff_celp_math_init_mips(c);
125+#if HAVE_MIPSFPU
126+ ff_celp_math_init_mips(c);
127+#endif
127128 }
libavcodec/cfhddsp.c+3−2
@@ -112,6 +112,7 @@ av_cold void ff_cfhddsp_init(CFHDDSPContext *c, int depth, int bayer) · 111 unmodified lines
112112 else
113113 c->horiz_filter_clip = horiz_filter_clip;
114114
115− if (ARCH_X86)
116− ff_cfhddsp_init_x86(c, depth, bayer);
115+#if ARCH_X86
116+ ff_cfhddsp_init_x86(c, depth, bayer);
117+#endif
117118 }
libavcodec/cfhdencdsp.c+3−2
@@ -73,6 +73,7 @@ av_cold void ff_cfhdencdsp_init(CFHDEncDSPContext *c) · 72 unmodified lines
7373 c->horiz_filter = horiz_filter;
7474 c->vert_filter = vert_filter;
7575
76− if (ARCH_X86)
77− ff_cfhdencdsp_init_x86(c);
76+#if ARCH_X86
77+ ff_cfhdencdsp_init_x86(c);
78+#endif
7879 }
libavcodec/dcadsp.c+3−2
@@ -485,6 +485,7 @@ av_cold void ff_dcadsp_init(DCADSPContext *s) · 484 unmodified lines
485485 s->lbr_bank = lbr_bank_c;
486486 s->lfe_iir = lfe_iir_c;
487487
488− if (ARCH_X86)
489− ff_dcadsp_init_x86(s);
488+#if ARCH_X86
489+ ff_dcadsp_init_x86(s);
490+#endif
490491 }
libavcodec/dct.c+3−2
@@ -214,8 +214,9 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse) · 213 unmodified lines
214214 }
215215
216216 s->dct32 = ff_dct32_float;
217− if (ARCH_X86)
218− ff_dct_init_x86(s);
217+#if ARCH_X86
218+ ff_dct_init_x86(s);
219+#endif
219220
220221 return 0;
221222 }
libavcodec/dirac_dwt.c+3−1
@@ -58,8 +58,10 @@ int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type, · 57 unmodified lines
5858 return AVERROR_INVALIDDATA;
5959 }
6060
61− if (ARCH_X86 && bit_depth == 8)
61+#if ARCH_X86
62+ if (bit_depth == 8)
6263 ff_spatial_idwt_init_x86(d, type);
64+#endif
6365 return 0;
6466 }
6567
libavcodec/diracdsp.c+3−2
@@ -247,6 +247,7 @@ av_cold void ff_diracdsp_init(DiracDSPContext *c) · 246 unmodified lines
247247 PIXFUNC(avg, 16);
248248 PIXFUNC(avg, 32);
249249
250− if (ARCH_X86)
251− ff_diracdsp_init_x86(c);
250+#if ARCH_X86
251+ ff_diracdsp_init_x86(c);
252+#endif
252253 }
libavcodec/dnxhdenc.c+3−2
@@ -445,8 +445,9 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx) · 444 unmodified lines
445445 ctx->block_width_l2 = 3;
446446 }
447447
448− if (ARCH_X86)
449− ff_dnxhdenc_init_x86(ctx);
448+#if ARCH_X86
449+ ff_dnxhdenc_init_x86(ctx);
450+#endif
450451
451452 ctx->m.mb_height = (avctx->height + 15) / 16;
452453 ctx->m.mb_width = (avctx->width + 15) / 16;
libavcodec/exrdsp.c+3−2
@@ -51,6 +51,7 @@ av_cold void ff_exrdsp_init(ExrDSPContext *c) · 50 unmodified lines
5151 c->reorder_pixels = reorder_pixels_scalar;
5252 c->predictor = predictor_scalar;
5353
54− if (ARCH_X86)
55− ff_exrdsp_init_x86(c);
54+#if ARCH_X86
55+ ff_exrdsp_init_x86(c);
56+#endif
5657 }
libavcodec/fdctdsp.c+6−5
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
2727 {
28− const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
28+ av_unused const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
2929
3030 if (avctx->bits_per_raw_sample == 10 || avctx->bits_per_raw_sample == 9) {
3131 c->fdct = ff_jpeg_fdct_islow_10;
@@ -43,8 +43,9 @@ av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx) · 11 unmodified lines
4343 c->fdct248 = ff_fdct248_islow_8;
4444 }
4545
46− if (ARCH_PPC)
47− ff_fdctdsp_init_ppc(c, avctx, high_bit_depth);
48− if (ARCH_X86)
49− ff_fdctdsp_init_x86(c, avctx, high_bit_depth);
46+#if ARCH_PPC
47+ ff_fdctdsp_init_ppc(c, avctx, high_bit_depth);
48+#elif ARCH_X86
49+ ff_fdctdsp_init_x86(c, avctx, high_bit_depth);
50+#endif
5051 }
libavcodec/fft_template.c+12−5
@@ -227,11 +227,18 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) · 226 unmodified lines
227227 #endif
228228
229229 #if FFT_FLOAT
230− if (ARCH_AARCH64) ff_fft_init_aarch64(s);
231− if (ARCH_ARM) ff_fft_init_arm(s);
232− if (ARCH_PPC) ff_fft_init_ppc(s);
233− if (ARCH_X86) ff_fft_init_x86(s);
234− if (HAVE_MIPSFPU) ff_fft_init_mips(s);
230+#if ARCH_AARCH64
231+ ff_fft_init_aarch64(s);
232+#elif ARCH_ARM
233+ ff_fft_init_arm(s);
234+#elif ARCH_PPC
235+ ff_fft_init_ppc(s);
236+#elif ARCH_X86
237+ ff_fft_init_x86(s);
238+#endif
239+#if HAVE_MIPSFPU
240+ ff_fft_init_mips(s);
241+#endif
235242 for(j=4; j<=nbits; j++) {
236243 ff_init_ff_cos_tabs(j);
237244 }
libavcodec/flacdsp.c+5−4
@@ -124,8 +124,9 @@ av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int cha · 123 unmodified lines
124124 break;
125125 }
126126
127− if (ARCH_ARM)
128− ff_flacdsp_init_arm(c, fmt, channels, bps);
129− if (ARCH_X86)
130− ff_flacdsp_init_x86(c, fmt, channels, bps);
127+#if ARCH_ARM
128+ ff_flacdsp_init_arm(c, fmt, channels, bps);
129+#elif ARCH_X86
130+ ff_flacdsp_init_x86(c, fmt, channels, bps);
131+#endif
131132 }
libavcodec/fmtconvert.c+12−10
@@ -56,14 +56,16 @@ av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx) · 55 unmodified lines
5656 c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c;
5757 c->int32_to_float_fmul_array8 = int32_to_float_fmul_array8_c;
5858
59− if (ARCH_AARCH64)
60− ff_fmt_convert_init_aarch64(c, avctx);
61− if (ARCH_ARM)
62− ff_fmt_convert_init_arm(c, avctx);
63− if (ARCH_PPC)
64− ff_fmt_convert_init_ppc(c, avctx);
65− if (ARCH_X86)
66− ff_fmt_convert_init_x86(c, avctx);
67− if (HAVE_MIPSFPU)
68− ff_fmt_convert_init_mips(c);
59+#if ARCH_AARCH64
60+ ff_fmt_convert_init_aarch64(c, avctx);
61+#elif ARCH_ARM
62+ ff_fmt_convert_init_arm(c, avctx);
63+#elif ARCH_PPC
64+ ff_fmt_convert_init_ppc(c, avctx);
65+#elif ARCH_X86
66+ ff_fmt_convert_init_x86(c, avctx);
67+#endif
68+#if HAVE_MIPSFPU
69+ ff_fmt_convert_init_mips(c);
70+#endif
6971 }
libavcodec/g722dsp.c+5−4
@@ -69,8 +69,9 @@ av_cold void ff_g722dsp_init(G722DSPContext *c) · 68 unmodified lines
6969 {
7070 c->apply_qmf = g722_apply_qmf;
7171
72− if (ARCH_ARM)
73− ff_g722dsp_init_arm(c);
74− if (ARCH_X86)
75− ff_g722dsp_init_x86(c);
72+#if ARCH_ARM
73+ ff_g722dsp_init_arm(c);
74+#elif ARCH_X86
75+ ff_g722dsp_init_x86(c);
76+#endif
7677 }
libavcodec/h263dsp.c+5−4
@@ -119,8 +119,9 @@ av_cold void ff_h263dsp_init(H263DSPContext *ctx) · 118 unmodified lines
119119 ctx->h263_h_loop_filter = h263_h_loop_filter_c;
120120 ctx->h263_v_loop_filter = h263_v_loop_filter_c;
121121
122− if (ARCH_X86)
123− ff_h263dsp_init_x86(ctx);
124− if (ARCH_MIPS)
125− ff_h263dsp_init_mips(ctx);
122+#if ARCH_X86
123+ ff_h263dsp_init_x86(ctx);
124+#elif ARCH_MIPS
125+ ff_h263dsp_init_mips(ctx);
126+#endif
126127 }
libavcodec/h264chroma.c+13−12
@@ -46,16 +46,17 @@ av_cold void ff_h264chroma_init(H264ChromaContext *c, int bit_depth) · 45 unmodified lines
4646 SET_CHROMA(8);
4747 }
4848
49− if (ARCH_AARCH64)
50− ff_h264chroma_init_aarch64(c, bit_depth);
51− if (ARCH_ARM)
52− ff_h264chroma_init_arm(c, bit_depth);
53− if (ARCH_PPC)
54− ff_h264chroma_init_ppc(c, bit_depth);
55− if (ARCH_X86)
56− ff_h264chroma_init_x86(c, bit_depth);
57− if (ARCH_MIPS)
58− ff_h264chroma_init_mips(c, bit_depth);
59− if (ARCH_LOONGARCH64)
60− ff_h264chroma_init_loongarch(c, bit_depth);
49+#if ARCH_AARCH64
50+ ff_h264chroma_init_aarch64(c, bit_depth);
51+#elif ARCH_ARM
52+ ff_h264chroma_init_arm(c, bit_depth);
53+#elif ARCH_PPC
54+ ff_h264chroma_init_ppc(c, bit_depth);
55+#elif ARCH_X86
56+ ff_h264chroma_init_x86(c, bit_depth);
57+#elif ARCH_MIPS
58+ ff_h264chroma_init_mips(c, bit_depth);
59+#elif ARCH_LOONGARCH64
60+ ff_h264chroma_init_loongarch(c, bit_depth);
61+#endif
6162 }
libavcodec/h264dsp.c+13−6
@@ -152,10 +152,17 @@ av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, · 151 unmodified lines
152152 }
153153 c->startcode_find_candidate = ff_startcode_find_candidate_c;
154154
155− if (ARCH_AARCH64) ff_h264dsp_init_aarch64(c, bit_depth, chroma_format_idc);
156− if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
157− if (ARCH_PPC) ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc);
158− if (ARCH_X86) ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc);
159− if (ARCH_MIPS) ff_h264dsp_init_mips(c, bit_depth, chroma_format_idc);
160− if (ARCH_LOONGARCH) ff_h264dsp_init_loongarch(c, bit_depth, chroma_format_idc);
155+#if ARCH_AARCH64
156+ ff_h264dsp_init_aarch64(c, bit_depth, chroma_format_idc);
157+#elif ARCH_ARM
158+ ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
159+#elif ARCH_PPC
160+ ff_h264dsp_init_ppc(c, bit_depth, chroma_format_idc);
161+#elif ARCH_X86
162+ ff_h264dsp_init_x86(c, bit_depth, chroma_format_idc);
163+#elif ARCH_MIPS
164+ ff_h264dsp_init_mips(c, bit_depth, chroma_format_idc);
165+#elif ARCH_LOONGARCH
166+ ff_h264dsp_init_loongarch(c, bit_depth, chroma_format_idc);
167+#endif
161168 }
libavcodec/h264pred.c+11−10
@@ -588,14 +588,15 @@ av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id, · 587 unmodified lines
588588 break;
589589 }
590590
591− if (ARCH_AARCH64)
592− ff_h264_pred_init_aarch64(h, codec_id, bit_depth, chroma_format_idc);
593− if (ARCH_ARM)
594− ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
595− if (ARCH_X86)
596− ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
597− if (ARCH_MIPS)
598− ff_h264_pred_init_mips(h, codec_id, bit_depth, chroma_format_idc);
599− if (ARCH_LOONGARCH)
600− ff_h264_pred_init_loongarch(h, codec_id, bit_depth, chroma_format_idc);
591+#if ARCH_AARCH64
592+ ff_h264_pred_init_aarch64(h, codec_id, bit_depth, chroma_format_idc);
593+#elif ARCH_ARM
594+ ff_h264_pred_init_arm(h, codec_id, bit_depth, chroma_format_idc);
595+#elif ARCH_X86
596+ ff_h264_pred_init_x86(h, codec_id, bit_depth, chroma_format_idc);
597+#elif ARCH_MIPS
598+ ff_h264_pred_init_mips(h, codec_id, bit_depth, chroma_format_idc);
599+#elif ARCH_LOONGARCH
600+ ff_h264_pred_init_loongarch(h, codec_id, bit_depth, chroma_format_idc);
601+#endif
601602 }
libavcodec/h264qpel.c+13−12
@@ -96,16 +96,17 @@ av_cold void ff_h264qpel_init(H264QpelContext *c, int bit_depth) · 95 unmodified lines
9696 break;
9797 }
9898
99− if (ARCH_AARCH64)
100− ff_h264qpel_init_aarch64(c, bit_depth);
101− if (ARCH_ARM)
102− ff_h264qpel_init_arm(c, bit_depth);
103− if (ARCH_PPC)
104− ff_h264qpel_init_ppc(c, bit_depth);
105− if (ARCH_X86)
106− ff_h264qpel_init_x86(c, bit_depth);
107− if (ARCH_MIPS)
108− ff_h264qpel_init_mips(c, bit_depth);
109− if (ARCH_LOONGARCH64)
110− ff_h264qpel_init_loongarch(c, bit_depth);
99+#if ARCH_AARCH64
100+ ff_h264qpel_init_aarch64(c, bit_depth);
101+#elif ARCH_ARM
102+ ff_h264qpel_init_arm(c, bit_depth);
103+#elif ARCH_PPC
104+ ff_h264qpel_init_ppc(c, bit_depth);
105+#elif ARCH_X86
106+ ff_h264qpel_init_x86(c, bit_depth);
107+#elif ARCH_MIPS
108+ ff_h264qpel_init_mips(c, bit_depth);
109+#elif ARCH_LOONGARCH64
110+ ff_h264qpel_init_loongarch(c, bit_depth);
111+#endif
111112 }
libavcodec/hevcdsp.c+13−12
@@ -257,16 +257,17 @@ int i = 0; · 256 unmodified lines
257257 break;
258258 }
259259
260− if (ARCH_AARCH64)
261− ff_hevc_dsp_init_aarch64(hevcdsp, bit_depth);
262− if (ARCH_ARM)
263− ff_hevc_dsp_init_arm(hevcdsp, bit_depth);
264− if (ARCH_PPC)
265− ff_hevc_dsp_init_ppc(hevcdsp, bit_depth);
266− if (ARCH_X86)
267− ff_hevc_dsp_init_x86(hevcdsp, bit_depth);
268− if (ARCH_MIPS)
269− ff_hevc_dsp_init_mips(hevcdsp, bit_depth);
270− if (ARCH_LOONGARCH)
271− ff_hevc_dsp_init_loongarch(hevcdsp, bit_depth);
260+#if ARCH_AARCH64
261+ ff_hevc_dsp_init_aarch64(hevcdsp, bit_depth);
262+#elif ARCH_ARM
263+ ff_hevc_dsp_init_arm(hevcdsp, bit_depth);
264+#elif ARCH_PPC
265+ ff_hevc_dsp_init_ppc(hevcdsp, bit_depth);
266+#elif ARCH_X86
267+ ff_hevc_dsp_init_x86(hevcdsp, bit_depth);
268+#elif ARCH_MIPS
269+ ff_hevc_dsp_init_mips(hevcdsp, bit_depth);
270+#elif ARCH_LOONGARCH
271+ ff_hevc_dsp_init_loongarch(hevcdsp, bit_depth);
272+#endif
272273 }
libavcodec/hevcpred.c+3−2
@@ -75,6 +75,7 @@ void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth) · 74 unmodified lines
7575 break;
7676 }
7777
78− if (ARCH_MIPS)
79− ff_hevc_pred_init_mips(hpc, bit_depth);
78+#if ARCH_MIPS
79+ ff_hevc_pred_init_mips(hpc, bit_depth);
80+#endif
8081 }
libavcodec/hpeldsp.c+15−14
@@ -355,18 +355,19 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags) · 354 unmodified lines
355355 hpel_funcs(avg, [3], 2);
356356 hpel_funcs(avg_no_rnd,, 16);
357357
358− if (ARCH_AARCH64)
359− ff_hpeldsp_init_aarch64(c, flags);
360− if (ARCH_ALPHA)
361− ff_hpeldsp_init_alpha(c, flags);
362− if (ARCH_ARM)
363− ff_hpeldsp_init_arm(c, flags);
364− if (ARCH_PPC)
365− ff_hpeldsp_init_ppc(c, flags);
366− if (ARCH_X86)
367− ff_hpeldsp_init_x86(c, flags);
368− if (ARCH_MIPS)
369− ff_hpeldsp_init_mips(c, flags);
370− if (ARCH_LOONGARCH64)
371− ff_hpeldsp_init_loongarch(c, flags);
358+#if ARCH_AARCH64
359+ ff_hpeldsp_init_aarch64(c, flags);
360+#elif ARCH_ALPHA
361+ ff_hpeldsp_init_alpha(c, flags);
362+#elif ARCH_ARM
363+ ff_hpeldsp_init_arm(c, flags);
364+#elif ARCH_PPC
365+ ff_hpeldsp_init_ppc(c, flags);
366+#elif ARCH_X86
367+ ff_hpeldsp_init_x86(c, flags);
368+#elif ARCH_MIPS
369+ ff_hpeldsp_init_mips(c, flags);
370+#elif ARCH_LOONGARCH64
371+ ff_hpeldsp_init_loongarch(c, flags);
372+#endif
372373 }
libavcodec/huffyuvdsp.c+3−2
@@ -86,6 +86,7 @@ av_cold void ff_huffyuvdsp_init(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt · 85 unmodified lines
8686 c->add_hfyu_median_pred_int16 = add_hfyu_median_pred_int16_c;
8787 c->add_hfyu_left_pred_bgr32 = add_hfyu_left_pred_bgr32_c;
8888
89− if (ARCH_X86)
90− ff_huffyuvdsp_init_x86(c, pix_fmt);
89+#if ARCH_X86
90+ ff_huffyuvdsp_init_x86(c, pix_fmt);
91+#endif
9192 }
libavcodec/huffyuvencdsp.c+3−2
@@ -73,6 +73,7 @@ av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, AVCodecContext *avct · 72 unmodified lines
7373 c->diff_int16 = diff_int16_c;
7474 c->sub_hfyu_median_pred_int16 = sub_hfyu_median_pred_int16_c;
7575
76− if (ARCH_X86)
77− ff_huffyuvencdsp_init_x86(c, avctx);
76+#if ARCH_X86
77+ ff_huffyuvencdsp_init_x86(c, avctx);
78+#endif
7879 }
libavcodec/idctdsp.c+21−19
@@ -53,10 +53,11 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation, · 52 unmodified lines
5353 {
5454 int i;
5555
56− if (ARCH_X86)
57− if (ff_init_scantable_permutation_x86(idct_permutation,
58− perm_type))
59− return;
56+#if ARCH_X86
57+ if (ff_init_scantable_permutation_x86(idct_permutation,
58+ perm_type))
59+ return;
60+#endif
6061
6162 switch (perm_type) {
6263 case FF_IDCT_PERM_NONE:
@@ -238,7 +239,7 @@ static void ff_jref_idct1_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block · 175 unmodified lines
238239
239240 av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
240241 {
241− const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
242+ av_unused const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
242243
243244 if (avctx->lowres==1) {
244245 c->idct_put = ff_jref_idct4_put;
@@ -303,20 +304,21 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx) · 58 unmodified lines
303304 if (CONFIG_MPEG4_DECODER && avctx->idct_algo == FF_IDCT_XVID)
304305 ff_xvid_idct_init(c, avctx);
305306
306− if (ARCH_AARCH64)
307− ff_idctdsp_init_aarch64(c, avctx, high_bit_depth);
308− if (ARCH_ALPHA)
309− ff_idctdsp_init_alpha(c, avctx, high_bit_depth);
310− if (ARCH_ARM)
311− ff_idctdsp_init_arm(c, avctx, high_bit_depth);
312− if (ARCH_PPC)
313− ff_idctdsp_init_ppc(c, avctx, high_bit_depth);
314− if (ARCH_X86)
315− ff_idctdsp_init_x86(c, avctx, high_bit_depth);
316− if (ARCH_MIPS)
317− ff_idctdsp_init_mips(c, avctx, high_bit_depth);
318− if (ARCH_LOONGARCH)
319− ff_idctdsp_init_loongarch(c, avctx, high_bit_depth);
307+#if ARCH_AARCH64
308+ ff_idctdsp_init_aarch64(c, avctx, high_bit_depth);
309+#elif ARCH_ALPHA
310+ ff_idctdsp_init_alpha(c, avctx, high_bit_depth);
311+#elif ARCH_ARM
312+ ff_idctdsp_init_arm(c, avctx, high_bit_depth);
313+#elif ARCH_PPC
314+ ff_idctdsp_init_ppc(c, avctx, high_bit_depth);
315+#elif ARCH_X86
316+ ff_idctdsp_init_x86(c, avctx, high_bit_depth);
317+#elif ARCH_MIPS
318+ ff_idctdsp_init_mips(c, avctx, high_bit_depth);
319+#elif ARCH_LOONGARCH
320+ ff_idctdsp_init_loongarch(c, avctx, high_bit_depth);
321+#endif
320322
321323 ff_init_scantable_permutation(c->idct_permutation,
322324 c->perm_type);
libavcodec/iirfilter.c+3−2
@@ -330,6 +330,7 @@ av_cold void ff_iir_filter_free_coeffsp(struct FFIIRFilterCoeffs **coeffsp) · 329 unmodified lines
330330 void ff_iir_filter_init(FFIIRFilterContext *f) {
331331 f->filter_flt = iir_filter_flt;
332332
333− if (HAVE_MIPSFPU)
334− ff_iir_filter_init_mips(f);
333+#if HAVE_MIPSFPU
334+ ff_iir_filter_init_mips(f);
335+#endif
335336 }
libavcodec/jpeg2000dsp.c+3−2
@@ -96,6 +96,7 @@ av_cold void ff_jpeg2000dsp_init(Jpeg2000DSPContext *c) · 95 unmodified lines
9696 c->mct_decode[FF_DWT53] = rct_int;
9797 c->mct_decode[FF_DWT97_INT] = ict_int;
9898
99− if (ARCH_X86)
100− ff_jpeg2000dsp_init_x86(c);
99+#if ARCH_X86
100+ ff_jpeg2000dsp_init_x86(c);
101+#endif
101102 }
libavcodec/lossless_audiodsp.c+7−6
@@ -59,10 +59,11 @@ av_cold void ff_llauddsp_init(LLAudDSPContext *c) · 58 unmodified lines
5959 c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
6060 c->scalarproduct_and_madd_int32 = scalarproduct_and_madd_int32_c;
6161
62− if (ARCH_ARM)
63− ff_llauddsp_init_arm(c);
64− if (ARCH_PPC)
65− ff_llauddsp_init_ppc(c);
66− if (ARCH_X86)
67− ff_llauddsp_init_x86(c);
62+#if ARCH_ARM
63+ ff_llauddsp_init_arm(c);
64+#elif ARCH_PPC
65+ ff_llauddsp_init_ppc(c);
66+#elif ARCH_X86
67+ ff_llauddsp_init_x86(c);
68+#endif
6869 }
libavcodec/lossless_videodsp.c+5−4
@@ -119,8 +119,9 @@ void ff_llviddsp_init(LLVidDSPContext *c) · 118 unmodified lines
119119 c->add_left_pred_int16 = add_left_pred_int16_c;
120120 c->add_gradient_pred = add_gradient_pred_c;
121121
122− if (ARCH_PPC)
123− ff_llviddsp_init_ppc(c);
124− if (ARCH_X86)
125− ff_llviddsp_init_x86(c);
122+#if ARCH_PPC
123+ ff_llviddsp_init_ppc(c);
124+#elif ARCH_X86
125+ ff_llviddsp_init_x86(c);
126+#endif
126127 }
libavcodec/lossless_videoencdsp.c+3−2
@@ -94,6 +94,7 @@ av_cold void ff_llvidencdsp_init(LLVidEncDSPContext *c) · 93 unmodified lines
9494 c->sub_median_pred = sub_median_pred_c;
9595 c->sub_left_predict = sub_left_predict_c;
9696
97− if (ARCH_X86)
98− ff_llvidencdsp_init_x86(c);
97+#if ARCH_X86
98+ ff_llvidencdsp_init_x86(c);
99+#endif
99100 }
libavcodec/lpc.c+3−2
@@ -314,8 +314,9 @@ av_cold int ff_lpc_init(LPCContext *s, int blocksize, int max_order, · 313 unmodified lines
314314 s->lpc_apply_welch_window = lpc_apply_welch_window_c;
315315 s->lpc_compute_autocorr = lpc_compute_autocorr_c;
316316
317− if (ARCH_X86)
318− ff_lpc_init_x86(s);
317+#if ARCH_X86
318+ ff_lpc_init_x86(s);
319+#endif
319320
320321 return 0;
321322 }
libavcodec/mdct15.c+3−2
@@ -317,8 +317,9 @@ av_cold int ff_mdct15_init(MDCT15Context **ps, int inverse, int N, double scale) · 316 unmodified lines
317317 s->exptab[20].im *= -1;
318318 }
319319
320− if (ARCH_X86)
321− ff_mdct15_init_x86(s);
320+#if ARCH_X86
321+ ff_mdct15_init_x86(s);
322+#endif
322323
323324 *ps = s;
324325
libavcodec/me_cmp.c+11−10
@@ -1061,16 +1061,17 @@ av_cold void ff_me_cmp_init(MECmpContext *c, AVCodecContext *avctx) · 1060 unmodified lines
10611061 ff_dsputil_init_dwt(c);
10621062 #endif
10631063
1064− if (ARCH_ALPHA)
1065− ff_me_cmp_init_alpha(c, avctx);
1066− if (ARCH_ARM)
1067− ff_me_cmp_init_arm(c, avctx);
1068− if (ARCH_PPC)
1069− ff_me_cmp_init_ppc(c, avctx);
1070− if (ARCH_X86)
1071− ff_me_cmp_init_x86(c, avctx);
1072− if (ARCH_MIPS)
1073− ff_me_cmp_init_mips(c, avctx);
1064+#if ARCH_ALPHA
1065+ ff_me_cmp_init_alpha(c, avctx);
1066+#elif ARCH_ARM
1067+ ff_me_cmp_init_arm(c, avctx);
1068+#elif ARCH_PPC
1069+ ff_me_cmp_init_ppc(c, avctx);
1070+#elif ARCH_X86
1071+ ff_me_cmp_init_x86(c, avctx);
1072+#elif ARCH_MIPS
1073+ ff_me_cmp_init_mips(c, avctx);
1074+#endif
10741075
10751076 c->median_sad[0] = pix_median_abs16_c;
10761077 c->median_sad[1] = pix_median_abs8_c;
libavcodec/mlpdsp.c+5−4
@@ -131,8 +131,9 @@ av_cold void ff_mlpdsp_init(MLPDSPContext *c) · 130 unmodified lines
131131 c->mlp_rematrix_channel = ff_mlp_rematrix_channel;
132132 c->mlp_select_pack_output = mlp_select_pack_output;
133133 c->mlp_pack_output = ff_mlp_pack_output;
134− if (ARCH_ARM)
135− ff_mlpdsp_init_arm(c);
136− if (ARCH_X86)
137− ff_mlpdsp_init_x86(c);
134+#if ARCH_ARM
135+ ff_mlpdsp_init_arm(c);
136+#elif ARCH_X86
137+ ff_mlpdsp_init_x86(c);
138+#endif
138139 }
libavcodec/mpegaudiodsp.c+18−8
@@ -74,8 +74,9 @@ static av_cold void mpadsp_init_tabs(void) · 73 unmodified lines
7474 }
7575 }
7676
77− if (ARCH_X86)
78− ff_mpadsp_init_x86_tabs();
77+#if ARCH_X86
78+ ff_mpadsp_init_x86_tabs();
79+#endif
7980 }
8081
8182 av_cold void ff_mpadsp_init(MPADSPContext *s)
@@ -94,10 +95,19 @@ av_cold void ff_mpadsp_init(MPADSPContext *s) · 12 unmodified lines
9495 s->imdct36_blocks_float = ff_imdct36_blocks_float;
9596 s->imdct36_blocks_fixed = ff_imdct36_blocks_fixed;
9697
97− if (ARCH_AARCH64) ff_mpadsp_init_aarch64(s);
98− if (ARCH_ARM) ff_mpadsp_init_arm(s);
99− if (ARCH_PPC) ff_mpadsp_init_ppc(s);
100− if (ARCH_X86) ff_mpadsp_init_x86(s);
101− if (HAVE_MIPSFPU) ff_mpadsp_init_mipsfpu(s);
102− if (HAVE_MIPSDSP) ff_mpadsp_init_mipsdsp(s);
98+#if ARCH_AARCH64
99+ ff_mpadsp_init_aarch64(s);
100+#elif ARCH_ARM
101+ ff_mpadsp_init_arm(s);
102+#elif ARCH_PPC
103+ ff_mpadsp_init_ppc(s);
104+#elif ARCH_X86
105+ ff_mpadsp_init_x86(s);
106+#endif
107+#if HAVE_MIPSFPU
108+ ff_mpadsp_init_mipsfpu(s);
109+#endif
110+#if HAVE_MIPSDSP
111+ ff_mpadsp_init_mipsdsp(s);
112+#endif
103113 }
libavcodec/mpegvideo.c+15−13
@@ -309,19 +309,21 @@ static av_cold int dct_init(MpegEncContext *s) · 308 unmodified lines
309309 s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact;
310310 s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c;
311311
312− if (HAVE_INTRINSICS_NEON)
313− ff_mpv_common_init_neon(s);
314−
315− if (ARCH_ALPHA)
316− ff_mpv_common_init_axp(s);
317− if (ARCH_ARM)
318− ff_mpv_common_init_arm(s);
319− if (ARCH_PPC)
320− ff_mpv_common_init_ppc(s);
321− if (ARCH_X86)
322− ff_mpv_common_init_x86(s);
323− if (ARCH_MIPS)
324− ff_mpv_common_init_mips(s);
312+#if HAVE_INTRINSICS_NEON
313+ ff_mpv_common_init_neon(s);
314+#endif
315+
316+#if ARCH_ALPHA
317+ ff_mpv_common_init_axp(s);
318+#elif ARCH_ARM
319+ ff_mpv_common_init_arm(s);
320+#elif ARCH_PPC
321+ ff_mpv_common_init_ppc(s);
322+#elif ARCH_X86
323+ ff_mpv_common_init_x86(s);
324+#elif ARCH_MIPS
325+ ff_mpv_common_init_mips(s);
326+#endif
325327
326328 return 0;
327329 }
libavcodec/mpegvideo_enc.c+3−2
@@ -290,8 +290,9 @@ static void mpv_encode_defaults(MpegEncContext *s) · 289 unmodified lines
290290
291291 av_cold int ff_dct_encode_init(MpegEncContext *s)
292292 {
293− if (ARCH_X86)
294− ff_dct_encode_init_x86(s);
293+#if ARCH_X86
294+ ff_dct_encode_init_x86(s);
295+#endif
295296
296297 if (CONFIG_H263_ENCODER)
297298 ff_h263dsp_init(&s->h263dsp);
libavcodec/mpegvideodsp.c+5−4
@@ -112,8 +112,9 @@ av_cold void ff_mpegvideodsp_init(MpegVideoDSPContext *c) · 111 unmodified lines
112112 c->gmc1 = gmc1_c;
113113 c->gmc = ff_gmc_c;
114114
115− if (ARCH_PPC)
116− ff_mpegvideodsp_init_ppc(c);
117− if (ARCH_X86)
118− ff_mpegvideodsp_init_x86(c);
115+#if ARCH_PPC
116+ ff_mpegvideodsp_init_ppc(c);
117+#elif ARCH_X86
118+ ff_mpegvideodsp_init_x86(c);
119+#endif
119120 }
libavcodec/mpegvideoencdsp.c+9−8
@@ -245,12 +245,13 @@ av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, · 244 unmodified lines
245245
246246 c->draw_edges = draw_edges_8_c;
247247
248− if (ARCH_ARM)
249− ff_mpegvideoencdsp_init_arm(c, avctx);
250− if (ARCH_PPC)
251− ff_mpegvideoencdsp_init_ppc(c, avctx);
252− if (ARCH_X86)
253− ff_mpegvideoencdsp_init_x86(c, avctx);
254− if (ARCH_MIPS)
255− ff_mpegvideoencdsp_init_mips(c, avctx);
248+#if ARCH_ARM
249+ ff_mpegvideoencdsp_init_arm(c, avctx);
250+#elif ARCH_PPC
251+ ff_mpegvideoencdsp_init_ppc(c, avctx);
252+#elif ARCH_X86
253+ ff_mpegvideoencdsp_init_x86(c, avctx);
254+#elif ARCH_MIPS
255+ ff_mpegvideoencdsp_init_mips(c, avctx);
256+#endif
256257 }
libavcodec/opus_pvq.c+3−2
@@ -905,8 +905,9 @@ int av_cold ff_celt_pvq_init(CeltPVQ **pvq, int encode) · 904 unmodified lines
905905 s->pvq_search = ppp_pvq_search_c;
906906 s->quant_band = encode ? pvq_encode_band : pvq_decode_band;
907907
908− if (CONFIG_OPUS_ENCODER && ARCH_X86)
909− ff_celt_pvq_init_x86(s);
908+#if CONFIG_OPUS_ENCODER && ARCH_X86
909+ ff_celt_pvq_init_x86(s);
910+#endif
910911
911912 *pvq = s;
912913
libavcodec/opusdsp.c+5−5
@@ -56,9 +56,9 @@ av_cold void ff_opus_dsp_init(OpusDSP *ctx) · 55 unmodified lines
5656 ctx->postfilter = postfilter_c;
5757 ctx->deemphasis = deemphasis_c;
5858
59− if (ARCH_X86)
60− ff_opus_dsp_init_x86(ctx);
61−
62− if (ARCH_AARCH64)
63− ff_opus_dsp_init_aarch64(ctx);
59+#if ARCH_AARCH64
60+ ff_opus_dsp_init_aarch64(ctx);
61+#elif ARCH_X86
62+ ff_opus_dsp_init_x86(ctx);
63+#endif
6464 }
libavcodec/pixblockdsp.c+14−13
@@ -80,7 +80,7 @@ static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1, · 79 unmodified lines
8080
8181 av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx)
8282 {
83− const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
83+ av_unused const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
8484
8585 c->diff_pixels_unaligned =
8686 c->diff_pixels = diff_pixels_c;
@@ -101,16 +101,17 @@ av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx) · 14 unmodified lines
101101 break;
102102 }
103103
104− if (ARCH_AARCH64)
105− ff_pixblockdsp_init_aarch64(c, avctx, high_bit_depth);
106− if (ARCH_ALPHA)
107− ff_pixblockdsp_init_alpha(c, avctx, high_bit_depth);
108− if (ARCH_ARM)
109− ff_pixblockdsp_init_arm(c, avctx, high_bit_depth);
110− if (ARCH_PPC)
111− ff_pixblockdsp_init_ppc(c, avctx, high_bit_depth);
112− if (ARCH_X86)
113− ff_pixblockdsp_init_x86(c, avctx, high_bit_depth);
114− if (ARCH_MIPS)
115− ff_pixblockdsp_init_mips(c, avctx, high_bit_depth);
104+#if ARCH_AARCH64
105+ ff_pixblockdsp_init_aarch64(c, avctx, high_bit_depth);
106+#elif ARCH_ALPHA
107+ ff_pixblockdsp_init_alpha(c, avctx, high_bit_depth);
108+#elif ARCH_ARM
109+ ff_pixblockdsp_init_arm(c, avctx, high_bit_depth);
110+#elif ARCH_PPC
111+ ff_pixblockdsp_init_ppc(c, avctx, high_bit_depth);
112+#elif ARCH_X86
113+ ff_pixblockdsp_init_x86(c, avctx, high_bit_depth);
114+#elif ARCH_MIPS
115+ ff_pixblockdsp_init_mips(c, avctx, high_bit_depth);
116+#endif
116117 }
libavcodec/pngdsp.c+3−2
@@ -45,6 +45,7 @@ av_cold void ff_pngdsp_init(PNGDSPContext *dsp) · 44 unmodified lines
4545 dsp->add_bytes_l2 = add_bytes_l2_c;
4646 dsp->add_paeth_prediction = ff_add_png_paeth_prediction;
4747
48− if (ARCH_X86)
49− ff_pngdsp_init_x86(dsp);
48+#if ARCH_X86
49+ ff_pngdsp_init_x86(dsp);
50+#endif
5051 }
libavcodec/proresdsp.c+3−2
@@ -88,8 +88,9 @@ av_cold int ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) · 87 unmodified lines
8888 return AVERROR_BUG;
8989 }
9090
91− if (ARCH_X86)
92− ff_proresdsp_init_x86(dsp, avctx);
91+#if ARCH_X86
92+ ff_proresdsp_init_x86(dsp, avctx);
93+#endif
9394
9495 ff_init_scantable_permutation(dsp->idct_permutation,
9596 dsp->idct_permutation_type);
libavcodec/qpeldsp.c+5−4
@@ -810,8 +810,9 @@ av_cold void ff_qpeldsp_init(QpelDSPContext *c) · 809 unmodified lines
810810 dspfunc(avg_qpel, 0, 16);
811811 dspfunc(avg_qpel, 1, 8);
812812
813− if (ARCH_X86)
814− ff_qpeldsp_init_x86(c);
815− if (ARCH_MIPS)
816− ff_qpeldsp_init_mips(c);
813+#if ARCH_X86
814+ ff_qpeldsp_init_x86(c);
815+#elif ARCH_MIPS
816+ ff_qpeldsp_init_mips(c);
817+#endif
817818 }
libavcodec/rdft.c+3−1
@@ -107,7 +107,9 @@ av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans) · 106 unmodified lines
107107 s->tsin = ff_cos_tabs[nbits] + (n >> 2);
108108 s->rdft_calc = rdft_calc_c;
109109
110− if (ARCH_ARM) ff_rdft_init_arm(s);
110+#if ARCH_ARM
111+ ff_rdft_init_arm(s);
112+#endif
111113
112114 return 0;
113115 }
libavcodec/rv34dsp.c+5−4
@@ -136,8 +136,9 @@ av_cold void ff_rv34dsp_init(RV34DSPContext *c) · 135 unmodified lines
136136 c->rv34_idct_add = rv34_idct_add_c;
137137 c->rv34_idct_dc_add = rv34_idct_dc_add_c;
138138
139− if (ARCH_ARM)
140− ff_rv34dsp_init_arm(c);
141− if (ARCH_X86)
142− ff_rv34dsp_init_x86(c);
139+#if ARCH_ARM
140+ ff_rv34dsp_init_arm(c);
141+#elif ARCH_X86
142+ ff_rv34dsp_init_x86(c);
143+#endif
143144 }
libavcodec/rv40dsp.c+7−6
@@ -705,10 +705,11 @@ av_cold void ff_rv40dsp_init(RV34DSPContext *c) · 704 unmodified lines
705705 c->rv40_loop_filter_strength[0] = rv40_h_loop_filter_strength;
706706 c->rv40_loop_filter_strength[1] = rv40_v_loop_filter_strength;
707707
708− if (ARCH_AARCH64)
709− ff_rv40dsp_init_aarch64(c);
710− if (ARCH_ARM)
711− ff_rv40dsp_init_arm(c);
712− if (ARCH_X86)
713− ff_rv40dsp_init_x86(c);
708+#if ARCH_AARCH64
709+ ff_rv40dsp_init_aarch64(c);
710+#elif ARCH_ARM
711+ ff_rv40dsp_init_arm(c);
712+#elif ARCH_X86
713+ ff_rv40dsp_init_x86(c);
714+#endif
714715 }
libavcodec/sbcdsp.c+5−4
@@ -380,8 +380,9 @@ av_cold void ff_sbcdsp_init(SBCDSPContext *s) · 379 unmodified lines
380380 s->sbc_calc_scalefactors = sbc_calc_scalefactors;
381381 s->sbc_calc_scalefactors_j = sbc_calc_scalefactors_j;
382382
383− if (ARCH_ARM)
384− ff_sbcdsp_init_arm(s);
385− if (ARCH_X86)
386− ff_sbcdsp_init_x86(s);
383+#if ARCH_ARM
384+ ff_sbcdsp_init_arm(s);
385+#elif ARCH_X86
386+ ff_sbcdsp_init_x86(s);
387+#endif
387388 }
libavcodec/sbrdsp_template.c+9−8
@@ -92,13 +92,14 @@ av_cold void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s) · 91 unmodified lines
9292 s->hf_apply_noise[3] = sbr_hf_apply_noise_3;
9393
9494 #if !USE_FIXED
95− if (ARCH_ARM)
96− ff_sbrdsp_init_arm(s);
97− if (ARCH_AARCH64)
98− ff_sbrdsp_init_aarch64(s);
99− if (ARCH_X86)
100− ff_sbrdsp_init_x86(s);
101− if (ARCH_MIPS)
102− ff_sbrdsp_init_mips(s);
95+#if ARCH_ARM
96+ ff_sbrdsp_init_arm(s);
97+#elif ARCH_AARCH64
98+ ff_sbrdsp_init_aarch64(s);
99+#elif ARCH_X86
100+ ff_sbrdsp_init_x86(s);
101+#elif ARCH_MIPS
102+ ff_sbrdsp_init_mips(s);
103+#endif
103104 #endif /* !USE_FIXED */
104105 }
libavcodec/snow_dwt.c+3−2
@@ -853,8 +853,9 @@ av_cold void ff_dwt_init(SnowDWTContext *c) · 852 unmodified lines
853853 c->horizontal_compose97i = snow_horizontal_compose97i;
854854 c->inner_add_yblock = ff_snow_inner_add_yblock;
855855
856− if (HAVE_MMX)
857− ff_dwt_init_x86(c);
856+#if ARCH_X86 && HAVE_MMX
857+ ff_dwt_init_x86(c);
858+#endif
858859 }
859860
860861
libavcodec/svq1enc.c+5−4
@@ -568,10 +568,11 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) · 567 unmodified lines
568568 return AVERROR(ENOMEM);
569569 }
570570
571− if (ARCH_PPC)
572− ff_svq1enc_init_ppc(s);
573− if (ARCH_X86)
574− ff_svq1enc_init_x86(s);
571+#if ARCH_PPC
572+ ff_svq1enc_init_ppc(s);
573+#elif ARCH_X86
574+ ff_svq1enc_init_x86(s);
575+#endif
575576
576577 ff_h263_encode_init(&s->m); // mv_penalty
577578
libavcodec/synth_filter.c+7−6
@@ -175,10 +175,11 @@ av_cold void ff_synth_filter_init(SynthFilterContext *c) · 174 unmodified lines
175175 c->synth_filter_fixed = synth_filter_fixed;
176176 c->synth_filter_fixed_64 = synth_filter_fixed_64;
177177
178− if (ARCH_AARCH64)
179− ff_synth_filter_init_aarch64(c);
180− if (ARCH_ARM)
181− ff_synth_filter_init_arm(c);
182− if (ARCH_X86)
183− ff_synth_filter_init_x86(c);
178+#if ARCH_AARCH64
179+ ff_synth_filter_init_aarch64(c);
180+#elif ARCH_ARM
181+ ff_synth_filter_init_arm(c);
182+#elif ARCH_X86
183+ ff_synth_filter_init_x86(c);
184+#endif
184185 }
libavcodec/takdsp.c+3−2
@@ -77,6 +77,7 @@ av_cold void ff_takdsp_init(TAKDSPContext *c) · 76 unmodified lines
7777 c->decorrelate_sm = decorrelate_sm;
7878 c->decorrelate_sf = decorrelate_sf;
7979
80− if (ARCH_X86)
81− ff_takdsp_init_x86(c);
80+#if ARCH_X86
81+ ff_takdsp_init_x86(c);
82+#endif
8283 }
libavcodec/ttadsp.c+3−2
@@ -56,6 +56,7 @@ av_cold void ff_ttadsp_init(TTADSPContext *c) · 55 unmodified lines
5656 {
5757 c->filter_process = tta_filter_process_c;
5858
59− if (ARCH_X86)
60− ff_ttadsp_init_x86(c);
59+#if ARCH_X86
60+ ff_ttadsp_init_x86(c);
61+#endif
6162 }
libavcodec/ttaencdsp.c+3−2
@@ -54,6 +54,7 @@ av_cold void ff_ttaencdsp_init(TTAEncDSPContext *c) · 53 unmodified lines
5454 {
5555 c->filter_process = ttaenc_filter_process_c;
5656
57− if (ARCH_X86)
58− ff_ttaencdsp_init_x86(c);
57+#if ARCH_X86
58+ ff_ttaencdsp_init_x86(c);
59+#endif
5960 }
libavcodec/utvideodsp.c+3−2
@@ -77,6 +77,7 @@ av_cold void ff_utvideodsp_init(UTVideoDSPContext *c) · 76 unmodified lines
7777 c->restore_rgb_planes = restore_rgb_planes_c;
7878 c->restore_rgb_planes10 = restore_rgb_planes10_c;
7979
80− if (ARCH_X86)
81− ff_utvideodsp_init_x86(c);
80+#if ARCH_X86
81+ ff_utvideodsp_init_x86(c);
82+#endif
8283 }
libavcodec/v210dec_init.h+3−2
@@ -54,8 +54,9 @@ static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u, · 53 unmodified lines
5454 static av_unused av_cold void ff_v210dec_init(V210DecContext *s)
5555 {
5656 s->unpack_frame = v210_planar_unpack_c;
57− if (ARCH_X86)
58− ff_v210_x86_init(s);
57+#if ARCH_X86
58+ ff_v210_x86_init(s);
59+#endif
5960 }
6061
6162 #endif /* AVCODEC_V210DEC_INIT_H */
libavcodec/v210enc_init.h+3−2
@@ -83,8 +83,9 @@ static av_cold av_unused void ff_v210enc_init(V210EncContext *s) · 82 unmodified lines
8383 s->sample_factor_8 = 2;
8484 s->sample_factor_10 = 1;
8585
86− if (ARCH_X86)
87− ff_v210enc_init_x86(s);
86+#if ARCH_X86
87+ ff_v210enc_init_x86(s);
88+#endif
8889 }
8990
9091 #endif /* AVCODEC_V210ENC_INIT_H */
libavcodec/vc1dsp.c+13−12
@@ -1033,16 +1033,17 @@ av_cold void ff_vc1dsp_init(VC1DSPContext *dsp) · 1032 unmodified lines
10331033 dsp->startcode_find_candidate = ff_startcode_find_candidate_c;
10341034 dsp->vc1_unescape_buffer = vc1_unescape_buffer;
10351035
1036− if (ARCH_AARCH64)
1037− ff_vc1dsp_init_aarch64(dsp);
1038− if (ARCH_ARM)
1039− ff_vc1dsp_init_arm(dsp);
1040− if (ARCH_PPC)
1041− ff_vc1dsp_init_ppc(dsp);
1042− if (ARCH_X86)
1043− ff_vc1dsp_init_x86(dsp);
1044− if (ARCH_MIPS)
1045− ff_vc1dsp_init_mips(dsp);
1046− if (ARCH_LOONGARCH)
1047− ff_vc1dsp_init_loongarch(dsp);
1036+#if ARCH_AARCH64
1037+ ff_vc1dsp_init_aarch64(dsp);
1038+#elif ARCH_ARM
1039+ ff_vc1dsp_init_arm(dsp);
1040+#elif ARCH_PPC
1041+ ff_vc1dsp_init_ppc(dsp);
1042+#elif ARCH_X86
1043+ ff_vc1dsp_init_x86(dsp);
1044+#elif ARCH_MIPS
1045+ ff_vc1dsp_init_mips(dsp);
1046+#elif ARCH_LOONGARCH
1047+ ff_vc1dsp_init_loongarch(dsp);
1048+#endif
10481049 }
libavcodec/videodsp.c+13−12
@@ -45,16 +45,17 @@ av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc) · 44 unmodified lines
4545 ctx->emulated_edge_mc = ff_emulated_edge_mc_16;
4646 }
4747
48− if (ARCH_AARCH64)
49− ff_videodsp_init_aarch64(ctx, bpc);
50− if (ARCH_ARM)
51− ff_videodsp_init_arm(ctx, bpc);
52− if (ARCH_PPC)
53− ff_videodsp_init_ppc(ctx, bpc);
54− if (ARCH_X86)
55− ff_videodsp_init_x86(ctx, bpc);
56− if (ARCH_MIPS)
57− ff_videodsp_init_mips(ctx, bpc);
58− if (ARCH_LOONGARCH64)
59− ff_videodsp_init_loongarch(ctx, bpc);
48+#if ARCH_AARCH64
49+ ff_videodsp_init_aarch64(ctx, bpc);
50+#elif ARCH_ARM
51+ ff_videodsp_init_arm(ctx, bpc);
52+#elif ARCH_PPC
53+ ff_videodsp_init_ppc(ctx, bpc);
54+#elif ARCH_X86
55+ ff_videodsp_init_x86(ctx, bpc);
56+#elif ARCH_MIPS
57+ ff_videodsp_init_mips(ctx, bpc);
58+#elif ARCH_LOONGARCH64
59+ ff_videodsp_init_loongarch(ctx, bpc);
60+#endif
6061 }
libavcodec/vorbisdsp.c+9−8
@@ -25,12 +25,13 @@ av_cold void ff_vorbisdsp_init(VorbisDSPContext *dsp) · 24 unmodified lines
2525 {
2626 dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling;
2727
28− if (ARCH_AARCH64)
29− ff_vorbisdsp_init_aarch64(dsp);
30− if (ARCH_ARM)
31− ff_vorbisdsp_init_arm(dsp);
32− if (ARCH_PPC)
33− ff_vorbisdsp_init_ppc(dsp);
34− if (ARCH_X86)
35− ff_vorbisdsp_init_x86(dsp);
28+#if ARCH_AARCH64
29+ ff_vorbisdsp_init_aarch64(dsp);
30+#elif ARCH_ARM
31+ ff_vorbisdsp_init_arm(dsp);
32+#elif ARCH_PPC
33+ ff_vorbisdsp_init_ppc(dsp);
34+#elif ARCH_X86
35+ ff_vorbisdsp_init_x86(dsp);
36+#endif
3637 }
libavcodec/vp3dsp.c+9−8
@@ -455,14 +455,15 @@ av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags) · 454 unmodified lines
455455 c->v_loop_filter = c->v_loop_filter_unaligned = vp3_v_loop_filter_8_c;
456456 c->h_loop_filter = c->h_loop_filter_unaligned = vp3_h_loop_filter_8_c;
457457
458− if (ARCH_ARM)
459− ff_vp3dsp_init_arm(c, flags);
460− if (ARCH_PPC)
461− ff_vp3dsp_init_ppc(c, flags);
462− if (ARCH_X86)
463− ff_vp3dsp_init_x86(c, flags);
464− if (ARCH_MIPS)
465− ff_vp3dsp_init_mips(c, flags);
458+#if ARCH_ARM
459+ ff_vp3dsp_init_arm(c, flags);
460+#elif ARCH_PPC
461+ ff_vp3dsp_init_ppc(c, flags);
462+#elif ARCH_X86
463+ ff_vp3dsp_init_x86(c, flags);
464+#elif ARCH_MIPS
465+ ff_vp3dsp_init_mips(c, flags);
466+#endif
466467 }
467468
468469 /*
libavcodec/vp56dsp.c+5−4
@@ -77,9 +77,10 @@ av_cold void ff_vp6dsp_init(VP56DSPContext *s) · 76 unmodified lines
7777 {
7878 s->vp6_filter_diag4 = ff_vp6_filter_diag4_c;
7979
80− if (ARCH_ARM)
81− ff_vp6dsp_init_arm(s);
82− if (ARCH_X86)
83− ff_vp6dsp_init_x86(s);
80+#if ARCH_ARM
81+ ff_vp6dsp_init_arm(s);
82+#elif ARCH_X86
83+ ff_vp6dsp_init_x86(s);
84+#endif
8485 }
8586 #endif /* CONFIG_VP6_DECODER */
libavcodec/vp8dsp.c+20−18
@@ -675,14 +675,15 @@ av_cold void ff_vp78dsp_init(VP8DSPContext *dsp) · 674 unmodified lines
675675 VP78_BILINEAR_MC_FUNC(1, 8);
676676 VP78_BILINEAR_MC_FUNC(2, 4);
677677
678− if (ARCH_AARCH64)
679− ff_vp78dsp_init_aarch64(dsp);
680− if (ARCH_ARM)
681− ff_vp78dsp_init_arm(dsp);
682− if (ARCH_PPC)
683− ff_vp78dsp_init_ppc(dsp);
684− if (ARCH_X86)
685− ff_vp78dsp_init_x86(dsp);
678+#if ARCH_AARCH64
679+ ff_vp78dsp_init_aarch64(dsp);
680+#elif ARCH_ARM
681+ ff_vp78dsp_init_arm(dsp);
682+#elif ARCH_PPC
683+ ff_vp78dsp_init_ppc(dsp);
684+#elif ARCH_X86
685+ ff_vp78dsp_init_x86(dsp);
686+#endif
686687 }
687688
688689 #if CONFIG_VP7_DECODER
@@ -737,15 +738,16 @@ av_cold void ff_vp8dsp_init(VP8DSPContext *dsp) · 48 unmodified lines
737738 dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;
738739 dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
739740
740− if (ARCH_AARCH64)
741− ff_vp8dsp_init_aarch64(dsp);
742− if (ARCH_ARM)
743− ff_vp8dsp_init_arm(dsp);
744− if (ARCH_X86)
745− ff_vp8dsp_init_x86(dsp);
746− if (ARCH_MIPS)
747− ff_vp8dsp_init_mips(dsp);
748− if (ARCH_LOONGARCH)
749− ff_vp8dsp_init_loongarch(dsp);
741+#if ARCH_AARCH64
742+ ff_vp8dsp_init_aarch64(dsp);
743+#elif ARCH_ARM
744+ ff_vp8dsp_init_arm(dsp);
745+#elif ARCH_X86
746+ ff_vp8dsp_init_x86(dsp);
747+#elif ARCH_MIPS
748+ ff_vp8dsp_init_mips(dsp);
749+#elif ARCH_LOONGARCH
750+ ff_vp8dsp_init_loongarch(dsp);
751+#endif
750752 }
751753 #endif /* CONFIG_VP8_DECODER */
libavcodec/vp9dsp.c+11−5
@@ -96,9 +96,15 @@ av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact) · 95 unmodified lines
9696 ff_vp9dsp_init_12(dsp);
9797 }
9898
99− if (ARCH_AARCH64) ff_vp9dsp_init_aarch64(dsp, bpp);
100− if (ARCH_ARM) ff_vp9dsp_init_arm(dsp, bpp);
101− if (ARCH_X86) ff_vp9dsp_init_x86(dsp, bpp, bitexact);
102− if (ARCH_MIPS) ff_vp9dsp_init_mips(dsp, bpp);
103− if (ARCH_LOONGARCH) ff_vp9dsp_init_loongarch(dsp, bpp);
99+#if ARCH_AARCH64
100+ ff_vp9dsp_init_aarch64(dsp, bpp);
101+#elif ARCH_ARM
102+ ff_vp9dsp_init_arm(dsp, bpp);
103+#elif ARCH_X86
104+ ff_vp9dsp_init_x86(dsp, bpp, bitexact);
105+#elif ARCH_MIPS
106+ ff_vp9dsp_init_mips(dsp, bpp);
107+#elif ARCH_LOONGARCH
108+ ff_vp9dsp_init_loongarch(dsp, bpp);
109+#endif
104110 }
libavcodec/wmv2dsp.c+3−2
@@ -264,6 +264,7 @@ av_cold void ff_wmv2dsp_init(WMV2DSPContext *c) · 263 unmodified lines
264264 c->put_mspel_pixels_tab[6] = put_mspel8_mc22_c;
265265 c->put_mspel_pixels_tab[7] = put_mspel8_mc32_c;
266266
267− if (ARCH_MIPS)
268− ff_wmv2dsp_init_mips(c);
267+#if ARCH_MIPS
268+ ff_wmv2dsp_init_mips(c);
269+#endif
269270 }
libavcodec/x86/mdct15_init.c+4−2
@@ -89,13 +89,15 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s) · 88 unmodified lines
8989 if (EXTERNAL_SSE3(cpu_flags))
9090 s->postreindex = ff_mdct15_postreindex_sse3;
9191
92− if (ARCH_X86_64 && EXTERNAL_AVX(cpu_flags)) {
92+#if ARCH_X86_64
93+ if (EXTERNAL_AVX(cpu_flags)) {
9394 s->fft15 = ff_fft15_avx;
9495 adjust_twiddles = 1;
9596 }
9697
97− if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags))
98+ if (EXTERNAL_AVX2_FAST(cpu_flags))
9899 s->postreindex = ff_mdct15_postreindex_avx2;
100+#endif
99101
100102 if (adjust_twiddles)
101103 perm_twiddles(s);
libavcodec/xvididct.c+5−4
@@ -346,10 +346,11 @@ av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx) · 345 unmodified lines
346346 c->perm_type = FF_IDCT_PERM_NONE;
347347 }
348348
349− if (ARCH_X86)
350− ff_xvid_idct_init_x86(c, avctx, high_bit_depth);
351− if (ARCH_MIPS)
352− ff_xvid_idct_init_mips(c, avctx, high_bit_depth);
349+#if ARCH_X86
350+ ff_xvid_idct_init_x86(c, avctx, high_bit_depth);
351+#elif ARCH_MIPS
352+ ff_xvid_idct_init_mips(c, avctx, high_bit_depth);
353+#endif
353354
354355 ff_init_scantable_permutation(c->idct_permutation, c->perm_type);
355356 }
libavfilter/af_afirdsp.h+3−2
@@ -74,8 +74,9 @@ static av_unused void ff_afir_init(AudioFIRDSPContext *dsp) · 73 unmodified lines
7474 dsp->fcmul_add = fcmul_add_c;
7575 dsp->dcmul_add = dcmul_add_c;
7676
77− if (ARCH_X86)
78− ff_afir_init_x86(dsp);
77+#if ARCH_X86
78+ ff_afir_init_x86(dsp);
79+#endif
7980 }
8081
8182 #endif /* AVFILTER_AFIRDSP_H */
libavfilter/af_anlmdn.c+3−2
@@ -118,8 +118,9 @@ void ff_anlmdn_init(AudioNLMDNDSPContext *dsp) · 117 unmodified lines
118118 dsp->compute_distance_ssd = compute_distance_ssd_c;
119119 dsp->compute_cache = compute_cache_c;
120120
121− if (ARCH_X86)
122− ff_anlmdn_init_x86(dsp);
121+#if ARCH_X86
122+ ff_anlmdn_init_x86(dsp);
123+#endif
123124 }
124125
125126 static int config_filter(AVFilterContext *ctx)
libavfilter/af_volume.c+3−2
@@ -238,8 +238,9 @@ static av_cold void volume_init(VolumeContext *vol) · 237 unmodified lines
238238 break;
239239 }
240240
241− if (ARCH_X86)
242− ff_volume_init_x86(vol);
241+#if ARCH_X86
242+ ff_volume_init_x86(vol);
243+#endif
243244 }
244245
245246 static int set_volume(AVFilterContext *ctx)
libavfilter/avf_showcqt.c+3−2
@@ -1418,8 +1418,9 @@ static int config_output(AVFilterLink *outlink) · 1417 unmodified lines
14181418 s->update_sono = update_sono_yuv;
14191419 }
14201420
1421− if (ARCH_X86)
1422− ff_showcqt_init_x86(s);
1421+#if ARCH_X86
1422+ ff_showcqt_init_x86(s);
1423+#endif
14231424
14241425 if ((ret = init_cqt(s)) < 0)
14251426 return ret;
libavfilter/colorspacedsp.c+3−2
@@ -143,6 +143,7 @@ void ff_colorspacedsp_init(ColorSpaceDSPContext *dsp) · 142 unmodified lines
143143
144144 dsp->multiply3x3 = multiply3x3_c;
145145
146− if (ARCH_X86)
147− ff_colorspacedsp_x86_init(dsp);
146+#if ARCH_X86
147+ ff_colorspacedsp_x86_init(dsp);
148+#endif
148149 }
libavfilter/scene_sad.c+3−2
@@ -59,8 +59,9 @@ void ff_scene_sad_c(SCENE_SAD_PARAMS) · 58 unmodified lines
5959 ff_scene_sad_fn ff_scene_sad_get_fn(int depth)
6060 {
6161 ff_scene_sad_fn sad = NULL;
62− if (ARCH_X86)
63− sad = ff_scene_sad_get_fn_x86(depth);
62+#if ARCH_X86
63+ sad = ff_scene_sad_get_fn_x86(depth);
64+#endif
6465 if (!sad) {
6566 if (depth == 8)
6667 sad = ff_scene_sad_c;
libavfilter/vf_atadenoise.c+3−2
@@ -433,8 +433,9 @@ static int config_input(AVFilterLink *inlink) · 432 unmodified lines
433433 }
434434 }
435435
436− if (ARCH_X86)
437− ff_atadenoise_init_x86(&s->dsp, depth, s->algorithm, s->sigma);
436+#if ARCH_X86
437+ ff_atadenoise_init_x86(&s->dsp, depth, s->algorithm, s->sigma);
438+#endif
438439
439440 return 0;
440441 }
libavfilter/vf_blend_init.h+3−2
@@ -194,8 +194,9 @@ static av_unused void ff_blend_init(FilterParams *param, int depth) · 193 unmodified lines
194194 param->blend = depth > 8 ? depth > 16 ? blend_copybottom_32 : blend_copybottom_16 : blend_copybottom_8;
195195 }
196196
197− if (ARCH_X86)
198− ff_blend_init_x86(param, depth);
197+#if ARCH_X86
198+ ff_blend_init_x86(param, depth);
199+#endif
199200 }
200201
201202 #endif /* AVFILTER_BLEND_INIT_H */
libavfilter/vf_bwdif.c+3−2
@@ -350,8 +350,9 @@ static int config_props(AVFilterLink *link) · 349 unmodified lines
350350 s->filter_edge = filter_edge;
351351 }
352352
353− if (ARCH_X86)
354− ff_bwdif_init_x86(s);
353+#if ARCH_X86
354+ ff_bwdif_init_x86(s);
355+#endif
355356
356357 return 0;
357358 }
libavfilter/vf_eq.h+3−2
@@ -123,8 +123,9 @@ void ff_eq_init_x86(EQContext *eq); · 122 unmodified lines
123123 static av_unused void ff_eq_init(EQContext *eq)
124124 {
125125 eq->process = process_c;
126− if (ARCH_X86)
127− ff_eq_init_x86(eq);
126+#if ARCH_X86
127+ ff_eq_init_x86(eq);
128+#endif
128129 }
129130
130131 #endif /* AVFILTER_EQ_H */
libavfilter/vf_framerate.c+3−2
@@ -264,8 +264,9 @@ void ff_framerate_init(FrameRateContext *s) · 263 unmodified lines
264264 s->blend_factor_max = 1 << BLEND_FACTOR_DEPTH(16);
265265 s->blend = blend_frames16_c;
266266 }
267− if (ARCH_X86)
268− ff_framerate_init_x86(s);
267+#if ARCH_X86
268+ ff_framerate_init_x86(s);
269+#endif
269270 }
270271
271272 static int config_input(AVFilterLink *inlink)
libavfilter/vf_fspp.c+3−2
@@ -525,8 +525,9 @@ static int config_input(AVFilterLink *inlink) · 524 unmodified lines
525525 fspp->row_idct = row_idct_c;
526526 fspp->row_fdct = row_fdct_c;
527527
528− if (ARCH_X86)
529− ff_fspp_init_x86(fspp);
528+#if ARCH_X86
529+ ff_fspp_init_x86(fspp);
530+#endif
530531
531532 return 0;
532533 }
libavfilter/vf_gblur_init.h+3−2
@@ -115,8 +115,9 @@ static av_unused void ff_gblur_init(GBlurContext *s) · 114 unmodified lines
115115 s->horiz_slice = horiz_slice_c;
116116 s->verti_slice = verti_slice_c;
117117 s->postscale_slice = postscale_c;
118− if (ARCH_X86)
119− ff_gblur_init_x86(s);
118+#if ARCH_X86
119+ ff_gblur_init_x86(s);
120+#endif
120121 }
121122
122123 #endif /* AVFILTER_GBLUR_INIT_H */
libavfilter/vf_gradfun.c+3−2
@@ -131,8 +131,9 @@ static av_cold int init(AVFilterContext *ctx) · 130 unmodified lines
131131 s->blur_line = ff_gradfun_blur_line_c;
132132 s->filter_line = ff_gradfun_filter_line_c;
133133
134− if (ARCH_X86)
135− ff_gradfun_init_x86(s);
134+#if ARCH_X86
135+ ff_gradfun_init_x86(s);
136+#endif
136137
137138 av_log(ctx, AV_LOG_VERBOSE, "threshold:%.2f radius:%d\n", s->strength, s->radius);
138139
libavfilter/vf_hflip_init.h+3−2
@@ -101,8 +101,9 @@ static av_unused int ff_hflip_init(FlipContext *s, int step[4], int nb_planes) · 100 unmodified lines
101101 return AVERROR_BUG;
102102 }
103103 }
104− if (ARCH_X86)
105− ff_hflip_init_x86(s, step, nb_planes);
104+#if ARCH_X86
105+ ff_hflip_init_x86(s, step, nb_planes);
106+#endif
106107
107108 return 0;
108109 }
libavfilter/vf_hqdn3d.c+3−2
@@ -278,8 +278,9 @@ static int config_input(AVFilterLink *inlink) · 277 unmodified lines
278278
279279 calc_coefs(ctx);
280280
281− if (ARCH_X86)
282− ff_hqdn3d_init_x86(s);
281+#if ARCH_X86
282+ ff_hqdn3d_init_x86(s);
283+#endif
283284
284285 return 0;
285286 }
libavfilter/vf_idet.c+6−4
@@ -276,8 +276,9 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) · 275 unmodified lines
276276 idet->csp = av_pix_fmt_desc_get(link->format);
277277 if (idet->csp->comp[0].depth > 8){
278278 idet->filter_line = (ff_idet_filter_func)ff_idet_filter_line_c_16bit;
279− if (ARCH_X86)
280− ff_idet_init_x86(idet, 1);
279+#if ARCH_X86
280+ ff_idet_init_x86(idet, 1);
281+#endif
281282 }
282283
283284 if (idet->analyze_interlaced_flag) {
@@ -408,8 +409,9 @@ static av_cold int init(AVFilterContext *ctx) · 124 unmodified lines
408409
409410 idet->filter_line = ff_idet_filter_line_c;
410411
411− if (ARCH_X86)
412− ff_idet_init_x86(idet, 0);
412+#if ARCH_X86
413+ ff_idet_init_x86(idet, 0);
414+#endif
413415
414416 return 0;
415417 }
libavfilter/vf_limiter.c+3−2
@@ -141,8 +141,9 @@ static int config_input(AVFilterLink *inlink) · 140 unmodified lines
141141 s->dsp.limiter = limiter16;
142142 }
143143
144− if (ARCH_X86)
145− ff_limiter_init_x86(&s->dsp, desc->comp[0].depth);
144+#if ARCH_X86
145+ ff_limiter_init_x86(&s->dsp, desc->comp[0].depth);
146+#endif
146147
147148 return 0;
148149 }
libavfilter/vf_lut3d.c+3−3
@@ -1150,9 +1150,9 @@ static int config_input(AVFilterLink *inlink) · 1149 unmodified lines
11501150 av_assert0(0);
11511151 }
11521152
1153− if (ARCH_X86) {
1154− ff_lut3d_init_x86(lut3d, desc);
1155− }
1153+#if ARCH_X86
1154+ ff_lut3d_init_x86(lut3d, desc);
1155+#endif
11561156
11571157 return 0;
11581158 }
libavfilter/vf_maskedclamp.c+3−2
@@ -209,8 +209,9 @@ static int config_input(AVFilterLink *inlink) · 208 unmodified lines
209209 else
210210 s->dsp.maskedclamp = maskedclamp16;
211211
212− if (ARCH_X86)
213− ff_maskedclamp_init_x86(&s->dsp, s->depth);
212+#if ARCH_X86
213+ ff_maskedclamp_init_x86(&s->dsp, s->depth);
214+#endif
214215
215216 return 0;
216217 }
libavfilter/vf_maskedmerge.c+3−2
@@ -202,8 +202,9 @@ static int config_input(AVFilterLink *inlink) · 201 unmodified lines
202202 else
203203 s->maskedmerge = maskedmerge32;
204204
205− if (ARCH_X86)
206− ff_maskedmerge_init_x86(s);
205+#if ARCH_X86
206+ ff_maskedmerge_init_x86(s);
207+#endif
207208
208209 return 0;
209210 }
libavfilter/vf_nlmeans_init.h+5−5
@@ -129,11 +129,11 @@ static av_unused void ff_nlmeans_init(NLMeansDSPContext *dsp) · 128 unmodified lines
129129 dsp->compute_safe_ssd_integral_image = compute_safe_ssd_integral_image_c;
130130 dsp->compute_weights_line = compute_weights_line_c;
131131
132− if (ARCH_AARCH64)
133− ff_nlmeans_init_aarch64(dsp);
134−
135− if (ARCH_X86)
136− ff_nlmeans_init_x86(dsp);
132+#if ARCH_AARCH64
133+ ff_nlmeans_init_aarch64(dsp);
134+#elif ARCH_X86
135+ ff_nlmeans_init_x86(dsp);
136+#endif
137137 }
138138
139139 #endif /* AVFILTER_NLMEANS_INIT_H */
libavfilter/vf_noise.c+3−2
@@ -305,8 +305,9 @@ static av_cold int init(AVFilterContext *ctx) · 304 unmodified lines
305305 n->line_noise = ff_line_noise_c;
306306 n->line_noise_avg = ff_line_noise_avg_c;
307307
308− if (ARCH_X86)
309− ff_noise_init_x86(n);
308+#if ARCH_X86
309+ ff_noise_init_x86(n);
310+#endif
310311
311312 return 0;
312313 }
libavfilter/vf_overlay.c+4−3
@@ -984,9 +984,10 @@ static int config_input_main(AVFilterLink *inlink) · 983 unmodified lines
984984 }
985985
986986 end:
987− if (ARCH_X86)
988− ff_overlay_init_x86(s, s->format, inlink->format,
989− s->alpha_format, s->main_has_alpha);
987+#if ARCH_X86
988+ ff_overlay_init_x86(s, s->format, inlink->format,
989+ s->alpha_format, s->main_has_alpha);
990+#endif
990991
991992 return 0;
992993 }
libavfilter/vf_pp7.c+3−2
@@ -301,8 +301,9 @@ static int config_input(AVFilterLink *inlink) · 300 unmodified lines
301301
302302 pp7->dctB = dctB_c;
303303
304− if (ARCH_X86)
305− ff_pp7_init_x86(pp7);
304+#if ARCH_X86
305+ ff_pp7_init_x86(pp7);
306+#endif
306307
307308 return 0;
308309 }
libavfilter/vf_psnr.c+3−2
@@ -354,8 +354,9 @@ static int config_input_ref(AVFilterLink *inlink) · 353 unmodified lines
354354 s->average_max = lrint(average_max);
355355
356356 s->dsp.sse_line = desc->comp[0].depth > 8 ? sse_line_16bit : sse_line_8bit;
357− if (ARCH_X86)
358− ff_psnr_init_x86(&s->dsp, desc->comp[0].depth);
357+#if ARCH_X86
358+ ff_psnr_init_x86(&s->dsp, desc->comp[0].depth);
359+#endif
359360
360361 s->score = av_calloc(s->nb_threads, sizeof(*s->score));
361362 if (!s->score)
libavfilter/vf_pullup.c+3−2
@@ -207,8 +207,9 @@ static int config_input(AVFilterLink *inlink) · 206 unmodified lines
207207 s->comb = comb_c;
208208 s->var = var_c;
209209
210− if (ARCH_X86)
211− ff_pullup_init_x86(s);
210+#if ARCH_X86
211+ ff_pullup_init_x86(s);
212+#endif
212213 return 0;
213214 }
214215
libavfilter/vf_removegrain.c+3−2
@@ -501,8 +501,9 @@ static int config_input(AVFilterLink *inlink) · 500 unmodified lines
501501 }
502502 }
503503
504− if (ARCH_X86)
505− ff_removegrain_init_x86(s);
504+#if ARCH_X86
505+ ff_removegrain_init_x86(s);
506+#endif
506507
507508 return 0;
508509 }
libavfilter/vf_spp.c+3−2
@@ -343,8 +343,9 @@ static int config_input(AVFilterLink *inlink) · 342 unmodified lines
343343 av_opt_set_int(s->dct, "bits_per_sample", bps, 0);
344344 avcodec_dct_init(s->dct);
345345
346− if (ARCH_X86)
347− ff_spp_init_x86(s);
346+#if ARCH_X86
347+ ff_spp_init_x86(s);
348+#endif
348349
349350 s->hsub = desc->log2_chroma_w;
350351 s->vsub = desc->log2_chroma_h;
libavfilter/vf_ssim.c+3−2
@@ -478,8 +478,9 @@ static int config_input_ref(AVFilterLink *inlink) · 477 unmodified lines
478478 s->ssim_plane = desc->comp[0].depth > 8 ? ssim_plane_16bit : ssim_plane;
479479 s->dsp.ssim_4x4_line = ssim_4x4xn_8bit;
480480 s->dsp.ssim_end_line = ssim_endn_8bit;
481− if (ARCH_X86)
482− ff_ssim_init_x86(&s->dsp);
481+#if ARCH_X86
482+ ff_ssim_init_x86(&s->dsp);
483+#endif
483484
484485 s->score = av_calloc(s->nb_threads, sizeof(*s->score));
485486 if (!s->score)
libavfilter/vf_stereo3d.c+3−2
@@ -591,8 +591,9 @@ static int config_output(AVFilterLink *outlink) · 590 unmodified lines
591591 s->vsub = desc->log2_chroma_h;
592592
593593 s->dsp.anaglyph = anaglyph;
594− if (ARCH_X86)
595− ff_stereo3d_init_x86(&s->dsp);
594+#if ARCH_X86
595+ ff_stereo3d_init_x86(&s->dsp);
596+#endif
596597
597598 return 0;
598599 }
libavfilter/vf_threshold_init.h+3−2
@@ -84,8 +84,9 @@ static av_unused void ff_threshold_init(ThresholdContext *s) · 83 unmodified lines
8484 s->bpc = 2;
8585 }
8686
87− if (ARCH_X86)
88− ff_threshold_init_x86(s);
87+#if ARCH_X86
88+ ff_threshold_init_x86(s);
89+#endif
8990 }
9091
9192 #endif /* AVFILTER_THRESHOLD_INIT_H */
libavfilter/vf_tinterlace.c+6−4
@@ -269,15 +269,17 @@ static int config_out_props(AVFilterLink *outlink) · 268 unmodified lines
269269 tinterlace->lowpass_line = lowpass_line_complex_c_16;
270270 else
271271 tinterlace->lowpass_line = lowpass_line_complex_c;
272− if (ARCH_X86)
273− ff_tinterlace_init_x86(tinterlace);
272+#if ARCH_X86
273+ ff_tinterlace_init_x86(tinterlace);
274+#endif
274275 } else if (tinterlace->flags & TINTERLACE_FLAG_VLPF) {
275276 if (tinterlace->csp->comp[0].depth > 8)
276277 tinterlace->lowpass_line = lowpass_line_c_16;
277278 else
278279 tinterlace->lowpass_line = lowpass_line_c;
279− if (ARCH_X86)
280− ff_tinterlace_init_x86(tinterlace);
280+#if ARCH_X86
281+ ff_tinterlace_init_x86(tinterlace);
282+#endif
281283 }
282284
283285 av_log(ctx, AV_LOG_VERBOSE, "mode:%d filter:%s h:%d -> h:%d\n", tinterlace->mode,
libavfilter/vf_transpose.c+5−5
@@ -235,13 +235,13 @@ static int config_props_output(AVFilterLink *outlink) · 234 unmodified lines
235235 }
236236 }
237237
238− if (ARCH_X86) {
239− for (int i = 0; i < 4; i++) {
240− TransVtable *v = &s->vtables[i];
238+#if ARCH_X86
239+ for (int i = 0; i < 4; i++) {
240+ TransVtable *v = &s->vtables[i];
241241
242− ff_transpose_init_x86(v, s->pixsteps[i]);
243− }
242+ ff_transpose_init_x86(v, s->pixsteps[i]);
244243 }
244+#endif
245245
246246 av_log(ctx, AV_LOG_VERBOSE,
247247 "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
libavfilter/vf_v360.c+3−2
@@ -389,8 +389,9 @@ void ff_v360_init(V360Context *s, int depth) · 388 unmodified lines
389389 break;
390390 }
391391
392− if (ARCH_X86)
393− ff_v360_init_x86(s, depth);
392+#if ARCH_X86
393+ ff_v360_init_x86(s, depth);
394+#endif
394395 }
395396
396397 /**
libavfilter/vf_w3fdif.c+3−2
@@ -317,8 +317,9 @@ static int config_input(AVFilterLink *inlink) · 316 unmodified lines
317317 s->dsp.filter_scale = filter16_scale;
318318 }
319319
320− if (ARCH_X86)
321− ff_w3fdif_init_x86(&s->dsp, depth);
320+#if ARCH_X86
321+ ff_w3fdif_init_x86(&s->dsp, depth);
322+#endif
322323
323324 return 0;
324325 }
libavfilter/vf_yadif.c+3−2
@@ -311,8 +311,9 @@ static int config_output(AVFilterLink *outlink) · 310 unmodified lines
311311 s->filter_edges = filter_edges;
312312 }
313313
314− if (ARCH_X86)
315− ff_yadif_init_x86(s);
314+#if ARCH_X86
315+ ff_yadif_init_x86(s);
316+#endif
316317
317318 return 0;
318319 }
libavutil/cpu.c+26−24
@@ -54,18 +54,19 @@ static atomic_int cpu_count = ATOMIC_VAR_INIT(-1); · 53 unmodified lines
5454
5555 static int get_cpu_flags(void)
5656 {
57− if (ARCH_MIPS)
58− return ff_get_cpu_flags_mips();
59− if (ARCH_AARCH64)
60− return ff_get_cpu_flags_aarch64();
61− if (ARCH_ARM)
62− return ff_get_cpu_flags_arm();
63− if (ARCH_PPC)
64− return ff_get_cpu_flags_ppc();
65− if (ARCH_X86)
66− return ff_get_cpu_flags_x86();
67− if (ARCH_LOONGARCH)
68− return ff_get_cpu_flags_loongarch();
57+#if ARCH_MIPS
58+ return ff_get_cpu_flags_mips();
59+#elif ARCH_AARCH64
60+ return ff_get_cpu_flags_aarch64();
61+#elif ARCH_ARM
62+ return ff_get_cpu_flags_arm();
63+#elif ARCH_PPC
64+ return ff_get_cpu_flags_ppc();
65+#elif ARCH_X86
66+ return ff_get_cpu_flags_x86();
67+#elif ARCH_LOONGARCH
68+ return ff_get_cpu_flags_loongarch();
69+#endif
6970 return 0;
7071 }
7172
@@ -252,18 +253,19 @@ void av_cpu_force_count(int count) · 180 unmodified lines
252253
253254 size_t av_cpu_max_align(void)
254255 {
255− if (ARCH_MIPS)
256− return ff_get_cpu_max_align_mips();
257− if (ARCH_AARCH64)
258− return ff_get_cpu_max_align_aarch64();
259− if (ARCH_ARM)
260− return ff_get_cpu_max_align_arm();
261− if (ARCH_PPC)
262− return ff_get_cpu_max_align_ppc();
263− if (ARCH_X86)
264− return ff_get_cpu_max_align_x86();
265− if (ARCH_LOONGARCH)
266− return ff_get_cpu_max_align_loongarch();
256+#if ARCH_MIPS
257+ return ff_get_cpu_max_align_mips();
258+#elif ARCH_AARCH64
259+ return ff_get_cpu_max_align_aarch64();
260+#elif ARCH_ARM
261+ return ff_get_cpu_max_align_arm();
262+#elif ARCH_PPC
263+ return ff_get_cpu_max_align_ppc();
264+#elif ARCH_X86
265+ return ff_get_cpu_max_align_x86();
266+#elif ARCH_LOONGARCH
267+ return ff_get_cpu_max_align_loongarch();
268+#endif
267269
268270 return 8;
269271 }
libavutil/fixed_dsp.c+3−2
@@ -162,8 +162,9 @@ AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact) · 161 unmodified lines
162162 fdsp->butterflies_fixed = butterflies_fixed_c;
163163 fdsp->scalarproduct_fixed = scalarproduct_fixed_c;
164164
165− if (ARCH_X86)
166− ff_fixed_dsp_init_x86(fdsp);
165+#if ARCH_X86
166+ ff_fixed_dsp_init_x86(fdsp);
167+#endif
167168
168169 return fdsp;
169170 }
libavutil/float_dsp.c+11−10
@@ -150,15 +150,16 @@ av_cold AVFloatDSPContext *avpriv_float_dsp_alloc(int bit_exact) · 149 unmodified lines
150150 fdsp->butterflies_float = butterflies_float_c;
151151 fdsp->scalarproduct_float = avpriv_scalarproduct_float_c;
152152
153− if (ARCH_AARCH64)
154− ff_float_dsp_init_aarch64(fdsp);
155− if (ARCH_ARM)
156− ff_float_dsp_init_arm(fdsp);
157− if (ARCH_PPC)
158− ff_float_dsp_init_ppc(fdsp, bit_exact);
159− if (ARCH_X86)
160− ff_float_dsp_init_x86(fdsp);
161− if (ARCH_MIPS)
162− ff_float_dsp_init_mips(fdsp);
153+#if ARCH_AARCH64
154+ ff_float_dsp_init_aarch64(fdsp);
155+#elif ARCH_ARM
156+ ff_float_dsp_init_arm(fdsp);
157+#elif ARCH_PPC
158+ ff_float_dsp_init_ppc(fdsp, bit_exact);
159+#elif ARCH_X86
160+ ff_float_dsp_init_x86(fdsp);
161+#elif ARCH_MIPS
162+ ff_float_dsp_init_mips(fdsp);
163+#endif
163164 return fdsp;
164165 }
libavutil/lls.c+3−2
@@ -117,6 +117,7 @@ av_cold void avpriv_init_lls(LLSModel *m, int indep_count) · 116 unmodified lines
117117 m->indep_count = indep_count;
118118 m->update_lls = update_lls;
119119 m->evaluate_lls = evaluate_lls;
120− if (ARCH_X86)
121− ff_init_lls_x86(m);
120+#if ARCH_X86
121+ ff_init_lls_x86(m);
122+#endif
122123 }
libswresample/audioconvert.c+7−3
@@ -176,9 +176,13 @@ AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, · 175 unmodified lines
176176 }
177177 }
178178
179− if(HAVE_X86ASM && HAVE_MMX) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);
180− if(ARCH_ARM) swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);
181− if(ARCH_AARCH64) swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);
179+#if ARCH_X86 && HAVE_X86ASM && HAVE_MMX
180+ swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);
181+#elif ARCH_ARM
182+ swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);
183+#elif ARCH_AARCH64
184+ swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);
185+#endif
182186
183187 return ctx;
184188 }
libswresample/rematrix.c+3−2
@@ -565,8 +565,9 @@ av_cold int swri_rematrix_init(SwrContext *s){ · 564 unmodified lines
565565 s->matrix_ch[i][0]= ch_in;
566566 }
567567
568− if(HAVE_X86ASM && HAVE_MMX)
569− return swri_rematrix_init_x86(s);
568+#if ARCH_X86 && HAVE_X86ASM && HAVE_MMX
569+ return swri_rematrix_init_x86(s);
570+#endif
570571
571572 return 0;
572573 }
libswresample/resample_dsp.c+7−3
@@ -68,7 +68,11 @@ void swri_resample_dsp_init(ResampleContext *c) · 67 unmodified lines
6868 break;
6969 }
7070
71− if (ARCH_X86) swri_resample_dsp_x86_init(c);
72− else if (ARCH_ARM) swri_resample_dsp_arm_init(c);
73− else if (ARCH_AARCH64) swri_resample_dsp_aarch64_init(c);
71+#if ARCH_X86
72+ swri_resample_dsp_x86_init(c);
73+#elif ARCH_ARM
74+ swri_resample_dsp_arm_init(c);
75+#elif ARCH_AARCH64
76+ swri_resample_dsp_aarch64_init(c);
77+#endif
7478 }
libswscale/rgb2rgb.c+5−4
@@ -137,10 +137,11 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, · 136 unmodified lines
137137 av_cold void ff_sws_rgb2rgb_init(void)
138138 {
139139 rgb2rgb_init_c();
140− if (ARCH_AARCH64)
141− rgb2rgb_init_aarch64();
142− if (ARCH_X86)
143− rgb2rgb_init_x86();
140+#if ARCH_AARCH64
141+ rgb2rgb_init_aarch64();
142+#elif ARCH_X86
143+ rgb2rgb_init_x86();
144+#endif
144145 }
145146
146147 void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size)
libswscale/swscale.c+9−8
@@ -590,14 +590,15 @@ void ff_sws_init_scale(SwsContext *c) · 589 unmodified lines
590590 {
591591 sws_init_swscale(c);
592592
593− if (ARCH_PPC)
594− ff_sws_init_swscale_ppc(c);
595− if (ARCH_X86)
596− ff_sws_init_swscale_x86(c);
597− if (ARCH_AARCH64)
598− ff_sws_init_swscale_aarch64(c);
599− if (ARCH_ARM)
600− ff_sws_init_swscale_arm(c);
593+#if ARCH_PPC
594+ ff_sws_init_swscale_ppc(c);
595+#elif ARCH_X86
596+ ff_sws_init_swscale_x86(c);
597+#elif ARCH_AARCH64
598+ ff_sws_init_swscale_aarch64(c);
599+#elif ARCH_ARM
600+ ff_sws_init_swscale_arm(c);
601+#endif
601602 }
602603
603604 static void reset_ptr(const uint8_t *src[], enum AVPixelFormat format)
libswscale/swscale_unscaled.c+7−6
@@ -2222,12 +2222,13 @@ void ff_get_unscaled_swscale(SwsContext *c) · 2221 unmodified lines
22222222 c->convert_unscaled = planarCopyWrapper;
22232223 }
22242224
2225− if (ARCH_PPC)
2226− ff_get_unscaled_swscale_ppc(c);
2227− if (ARCH_ARM)
2228− ff_get_unscaled_swscale_arm(c);
2229− if (ARCH_AARCH64)
2230− ff_get_unscaled_swscale_aarch64(c);
2225+#if ARCH_PPC
2226+ ff_get_unscaled_swscale_ppc(c);
2227+#elif ARCH_ARM
2228+ ff_get_unscaled_swscale_arm(c);
2229+#elif ARCH_AARCH64
2230+ ff_get_unscaled_swscale_aarch64(c);
2231+#endif
22312232 }
22322233
22332234 /* Convert the palette to the same packed 32-bit format as the palette */
libswscale/utils.c+4−3
@@ -1044,9 +1044,10 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], · 1043 unmodified lines
10441044 contrast, saturation);
10451045 // FIXME factorize
10461046
1047− if (ARCH_PPC)
1048− ff_yuv2rgb_init_tables_ppc(c, inv_table, brightness,
1049− contrast, saturation);
1047+#if ARCH_PPC
1048+ ff_yuv2rgb_init_tables_ppc(c, inv_table, brightness,
1049+ contrast, saturation);
1050+#endif
10501051 }
10511052
10521053 fill_rgb2yuv_table(c, table, dstRange);
libswscale/yuv2rgb.c+5−4
@@ -679,10 +679,11 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) · 678 unmodified lines
679679 {
680680 SwsFunc t = NULL;
681681
682− if (ARCH_PPC)
683− t = ff_yuv2rgb_init_ppc(c);
684− if (ARCH_X86)
685− t = ff_yuv2rgb_init_x86(c);
682+#if ARCH_PPC
683+ t = ff_yuv2rgb_init_ppc(c);
684+#elif ARCH_X86
685+ t = ff_yuv2rgb_init_x86(c);
686+#endif
686687
687688 if (t)
688689 return t;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t