From f8503b4c332a4517a2c9534581634a951d79dbae Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 1 Sep 2023 00:23:35 +0200 Subject: [PATCH] avutil/internal: Don't auto-include emms.h Instead include emms.h wherever it is needed. Signed-off-by: Andreas Rheinhardt --- libavcodec/ac3enc.c | 1 + libavcodec/avcodec.c | 1 + libavcodec/bink.c | 1 + libavcodec/cavsdec.c | 1 + libavcodec/dca_core.c | 1 + libavcodec/decode.c | 1 + libavcodec/dvdec.c | 1 + libavcodec/dvenc.c | 1 + libavcodec/encode.c | 1 + libavcodec/faandct.c | 1 + libavcodec/faanidct.c | 1 + libavcodec/h264_picture.c | 1 + libavcodec/h264dec.c | 1 + libavcodec/huffyuvdec.c | 1 + libavcodec/huffyuvenc.c | 1 + libavcodec/mjpegdec.c | 1 + libavcodec/mpeg12dec.c | 1 + libavcodec/mpegutils.c | 1 + libavcodec/mpegvideo_dec.c | 1 + libavcodec/mpegvideo_enc.c | 1 + libavcodec/ratecontrol.c | 1 + libavcodec/sbcenc.c | 1 + libavcodec/snowdec.c | 1 + libavcodec/snowenc.c | 1 + libavcodec/svq1enc.c | 1 + libavcodec/tests/dct.c | 1 + libavcodec/tests/motion.c | 1 + libavcodec/vp3.c | 1 + libavfilter/vf_deshake.c | 1 + libavfilter/vf_fspp.c | 1 + libavfilter/vf_gradfun.c | 1 + libavfilter/vf_hqdn3d.c | 1 + libavfilter/vf_mpdecimate.c | 1 + libavfilter/vf_noise.c | 1 + libavfilter/vf_pp7.c | 1 + libavfilter/vf_pullup.c | 1 + libavfilter/vf_spp.c | 1 + libavutil/{x86 => }/emms.h | 14 +++++++++++--- libavutil/internal.h | 8 -------- libswscale/swscale.c | 1 + libswscale/utils.c | 1 + tests/checkasm/checkasm.h | 1 + tests/checkasm/vp9dsp.c | 1 + 43 files changed, 52 insertions(+), 11 deletions(-) rename libavutil/{x86 => }/emms.h (91%) diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 3cb4e5f029..56c8d239c5 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -33,6 +33,7 @@ #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/crc.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 0700a53b5c..131834b6de 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -28,6 +28,7 @@ #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/imgutils.h" #include "libavutil/mem.h" diff --git a/libavcodec/bink.c b/libavcodec/bink.c index e3822d689c..8d96dee705 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -21,6 +21,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 37071dfbc7..b356da0b04 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "avcodec.h" #include "get_bits.h" #include "golomb.h" diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c index c50d005a56..ff3cc2fe45 100644 --- a/libavcodec/dca_core.c +++ b/libavcodec/dca_core.c @@ -19,6 +19,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "dcaadpcm.h" #include "dcadec.h" #include "dcadata.h" diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 7eada8e9ab..169ee79acd 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -32,6 +32,7 @@ #include "libavutil/bprint.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/fifo.h" #include "libavutil/frame.h" #include "libavutil/hwcontext.h" diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index c57578a208..04282483f4 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -36,6 +36,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index 7bd50174b7..ce21247081 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -29,6 +29,7 @@ #include "config.h" #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/libavcodec/encode.c b/libavcodec/encode.c index 32cc903b1f..b92593770c 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -21,6 +21,7 @@ #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c index 38c392bbae..b0b11859a7 100644 --- a/libavcodec/faandct.c +++ b/libavcodec/faandct.c @@ -26,6 +26,7 @@ */ #include "faandct.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/libm.h" diff --git a/libavcodec/faanidct.c b/libavcodec/faanidct.c index 3921f82dae..f2667fb716 100644 --- a/libavcodec/faanidct.c +++ b/libavcodec/faanidct.c @@ -20,6 +20,7 @@ */ #include "faanidct.h" #include "libavutil/common.h" +#include "libavutil/emms.h" /* To allow switching to double. */ typedef float FLOAT; diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index 3192c70a91..bd31f700cb 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -26,6 +26,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "error_resilience.h" #include "avcodec.h" #include "h264dec.h" diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 1c79d9842f..f13b1081fc 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -30,6 +30,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/thread.h" diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c index f040a27095..fe17c1e82b 100644 --- a/libavcodec/huffyuvdec.c +++ b/libavcodec/huffyuvdec.c @@ -42,6 +42,7 @@ #include "huffyuvdsp.h" #include "lossless_videodsp.h" #include "thread.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 72d6246ebe..b02b3c7a9a 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -39,6 +39,7 @@ #include "huffyuvencdsp.h" #include "lossless_videoencdsp.h" #include "put_bits.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index cef8625791..0a8f3d68dd 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -33,6 +33,7 @@ #include "config_components.h" #include "libavutil/display.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/avassert.h" #include "libavutil/opt.h" diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index e645b8e24a..36461a9ae6 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -31,6 +31,7 @@ #include #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/mem_internal.h" diff --git a/libavcodec/mpegutils.c b/libavcodec/mpegutils.c index 2d812a25be..5e76d7ac66 100644 --- a/libavcodec/mpegutils.c +++ b/libavcodec/mpegutils.c @@ -21,6 +21,7 @@ #include #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/frame.h" #include "libavutil/pixdesc.h" #include "libavutil/motion_vector.h" diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 16e8b9193a..6aa979433c 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -25,6 +25,7 @@ #include "config_components.h" #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/video_enc_params.h" diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 64e66ae958..69e3152c82 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -35,6 +35,7 @@ #include +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/intmath.h" #include "libavutil/mathematics.h" diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index 649f570c9d..55ce054735 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -26,6 +26,7 @@ */ #include "libavutil/attributes.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "avcodec.h" diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c index fccb0e3ea3..9d6e0b9f54 100644 --- a/libavcodec/sbcenc.c +++ b/libavcodec/sbcenc.c @@ -31,6 +31,7 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "avcodec.h" #include "codec_internal.h" diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index bed29d3390..e014d5087f 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/log.h" #include "libavutil/opt.h" diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 1360343aec..c330303317 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/emms.h" #include "libavutil/intmath.h" #include "libavutil/libm.h" #include "libavutil/log.h" diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 5e7f410214..46a484e15f 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -26,6 +26,7 @@ * http://www.pcisys.net/~melanson/codecs/ */ +#include "libavutil/emms.h" #include "avcodec.h" #include "codec_internal.h" #include "encode.h" diff --git a/libavcodec/tests/dct.c b/libavcodec/tests/dct.c index e8d0b8dd1d..010d0c1ac3 100644 --- a/libavcodec/tests/dct.c +++ b/libavcodec/tests/dct.c @@ -37,6 +37,7 @@ #include "libavutil/cpu.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem_internal.h" diff --git a/libavcodec/tests/motion.c b/libavcodec/tests/motion.c index ef6e1ff309..caa8ecb8be 100644 --- a/libavcodec/tests/motion.c +++ b/libavcodec/tests/motion.c @@ -30,6 +30,7 @@ #include "config.h" #include "libavcodec/me_cmp.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/mem.h" diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 9e097c8905..acab098203 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -35,6 +35,7 @@ #include #include +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index a10d59ad80..d44dd71eb0 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -53,6 +53,7 @@ #include "internal.h" #include "video.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/file_open.h" #include "libavutil/mem.h" #include "libavutil/opt.h" diff --git a/libavfilter/vf_fspp.c b/libavfilter/vf_fspp.c index 88e887897e..8f44390117 100644 --- a/libavfilter/vf_fspp.c +++ b/libavfilter/vf_fspp.c @@ -35,6 +35,7 @@ * project, and ported by Arwa Arif for FFmpeg. */ +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 39971b3120..a71a68ecc1 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -32,6 +32,7 @@ * Dither it back to 8bit. */ +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/common.h" #include "libavutil/mem_internal.h" diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c index 2aef7751c4..d95ae8f898 100644 --- a/libavfilter/vf_hqdn3d.c +++ b/libavfilter/vf_hqdn3d.c @@ -31,6 +31,7 @@ #include "config.h" #include "libavutil/attributes.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/pixdesc.h" #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" diff --git a/libavfilter/vf_mpdecimate.c b/libavfilter/vf_mpdecimate.c index 8c7824ed22..baba1f183f 100644 --- a/libavfilter/vf_mpdecimate.c +++ b/libavfilter/vf_mpdecimate.c @@ -24,6 +24,7 @@ * Rich Felker. */ +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavutil/pixelutils.h" diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c index ba843eed4e..9f1e2c3691 100644 --- a/libavfilter/vf_noise.c +++ b/libavfilter/vf_noise.c @@ -24,6 +24,7 @@ * noise generator */ +#include "libavutil/emms.h" #include "libavutil/opt.h" #include "libavutil/imgutils.h" #include "libavutil/lfg.h" diff --git a/libavfilter/vf_pp7.c b/libavfilter/vf_pp7.c index f44a5396ea..24a094f00c 100644 --- a/libavfilter/vf_pp7.c +++ b/libavfilter/vf_pp7.c @@ -27,6 +27,7 @@ * project, and ported by Arwa Arif for FFmpeg. */ +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c index 5a00673c41..7245684085 100644 --- a/libavfilter/vf_pullup.c +++ b/libavfilter/vf_pullup.c @@ -19,6 +19,7 @@ */ #include "libavutil/avassert.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c index 83f062b3bf..bb74b20e0e 100644 --- a/libavfilter/vf_spp.c +++ b/libavfilter/vf_spp.c @@ -31,6 +31,7 @@ * ported by Clément Bœsch for FFmpeg. */ +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" diff --git a/libavutil/x86/emms.h b/libavutil/emms.h similarity index 91% rename from libavutil/x86/emms.h rename to libavutil/emms.h index 8ceec110cf..4ec0127457 100644 --- a/libavutil/x86/emms.h +++ b/libavutil/emms.h @@ -16,12 +16,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVUTIL_X86_EMMS_H -#define AVUTIL_X86_EMMS_H +#ifndef AVUTIL_EMMS_H +#define AVUTIL_EMMS_H #include "config.h" #include "libavutil/attributes.h" +#if ARCH_X86 + void avpriv_emms_asm(void); #if HAVE_MMX_INLINE @@ -55,4 +57,10 @@ static av_always_inline void emms_c(void) # define emms_c avpriv_emms_asm #endif /* HAVE_MMX_INLINE */ -#endif /* AVUTIL_X86_EMMS_H */ +#endif /* ARCH_X86 */ + +#ifndef emms_c +# define emms_c() do {} while(0) +#endif + +#endif /* AVUTIL_EMMS_H */ diff --git a/libavutil/internal.h b/libavutil/internal.h index 001103142b..461c0df9ad 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -43,14 +43,6 @@ #include "macros.h" #include "pixfmt.h" -#if ARCH_X86 -# include "x86/emms.h" -#endif - -#ifndef emms_c -# define emms_c() do {} while(0) -#endif - #ifndef attribute_align_arg #if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2) # define attribute_align_arg __attribute__((force_align_arg_pointer)) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 367d045a02..90e5b299ab 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -26,6 +26,7 @@ #include "libavutil/bswap.h" #include "libavutil/common.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/intreadwrite.h" #include "libavutil/mem_internal.h" #include "libavutil/pixdesc.h" diff --git a/libswscale/utils.c b/libswscale/utils.c index 8e74c6603e..b3cc74331f 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -40,6 +40,7 @@ #include "libavutil/attributes.h" #include "libavutil/avassert.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "libavutil/libm.h" diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index 117d4dd35c..51523c258b 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -37,6 +37,7 @@ #include "libavutil/avstring.h" #include "libavutil/cpu.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/lfg.h" #include "libavutil/timer.h" diff --git a/tests/checkasm/vp9dsp.c b/tests/checkasm/vp9dsp.c index 44b02d60a2..cecd0dee0f 100644 --- a/tests/checkasm/vp9dsp.c +++ b/tests/checkasm/vp9dsp.c @@ -24,6 +24,7 @@ #include "libavcodec/vp9data.h" #include "libavcodec/vp9.h" #include "libavutil/common.h" +#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/mathematics.h"