This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 24914d60df9d88ea52ad48a714949a03cace85f0 Author: Kacper Michajłow <[email protected]> AuthorDate: Mon Sep 7 03:54:24 2026 +0200 Commit: Kacper Michajłow <[email protected]> CommitDate: Sat Sep 12 23:52:20 2026 +0000 avutil: remove libm.h It only wrapped math.h and mathematics.h since the fallbacks went away. Include math.h and mathematics.h directly where needed. internal.h keeps both so that the many translation units relying on them transitively keep building. Signed-off-by: Kacper Michajłow <[email protected]> --- doc/tablegen.txt | 2 +- fftools/cmdutils.c | 1 - fftools/ffprobe.c | 2 +- libavcodec/aaccoder.c | 2 +- libavcodec/aacenc.c | 2 +- libavcodec/aacenc_tns.c | 3 ++- libavcodec/aacps_tablegen.h | 1 - libavcodec/aacsbr.c | 2 +- libavcodec/aacsbr_fixed.c | 1 - libavcodec/ac3.h | 2 +- libavcodec/atrac3.c | 2 +- libavcodec/atrac3plusdsp.c | 2 +- libavcodec/cbrt_data.c | 3 ++- libavcodec/cbrt_tablegen_common.c | 3 --- libavcodec/dds.c | 2 +- libavcodec/faandct.c | 4 +++- libavcodec/kbdwin.c | 3 ++- libavcodec/libjxlenc.c | 2 +- libavcodec/mpegaudiodec_common.c | 2 +- libavcodec/mpegaudiodec_template.c | 3 ++- libavcodec/opus/celt.h | 2 +- libavcodec/pngenc.c | 3 ++- libavcodec/sinewin_fixed_tablegen.h | 2 -- libavcodec/sinewin_tablegen.h | 2 -- libavcodec/snowenc.c | 3 ++- libavcodec/tests/celp_math.c | 1 - libavcodec/texturedsp.c | 2 +- libavfilter/vf_crop.c | 2 +- libavformat/movenc.c | 2 +- libavutil/avsscanf.c | 1 - libavutil/display.c | 1 - libavutil/ffmath.h | 4 +++- libavutil/internal.h | 3 ++- libavutil/libm.h | 30 ------------------------------ libavutil/tests/eval.c | 2 +- libswresample/audioconvert.c | 4 +++- libswscale/utils.c | 1 - 37 files changed, 39 insertions(+), 70 deletions(-) diff --git a/doc/tablegen.txt b/doc/tablegen.txt index 4c4f036e6a..f102c2d697 100644 --- a/doc/tablegen.txt +++ b/doc/tablegen.txt @@ -12,7 +12,7 @@ the tables as a header file using the tableprint.h helpers. Both of these files will be compiled for the host system, so to avoid breakage with cross-compilation neither of them may include, directly or indirectly, config.h or avconfig.h. -This means that e.g. libavutil/mathematics.h is ok but libavutil/libm.h is not. +This means that e.g. libavutil/mathematics.h is ok but libavutil/internal.h is not. Due to this, the .c file or Makefile may have to provide additional defines or stubs, though if possible this should be avoided. In particular, CONFIG_HARDCODED_TABLES should always be defined to 0. diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 8a388f6eba..c535f578a7 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -38,7 +38,6 @@ #include "libavutil/bprint.h" #include "libavutil/display.h" #include "libavutil/getenv_utf8.h" -#include "libavutil/libm.h" #include "libavutil/mem.h" #include "libavutil/parseutils.h" #include "libavutil/eval.h" diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index cc622cfdc3..e918d98cab 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -54,7 +54,7 @@ #include "libavutil/stereo3d.h" #include "libavutil/dict.h" #include "libavutil/intreadwrite.h" -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" #include "libavutil/parseutils.h" #include "libavutil/timecode.h" #include "libavutil/timestamp.h" diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c index 086e5e2f0a..4f30a57e5c 100644 --- a/libavcodec/aaccoder.c +++ b/libavcodec/aaccoder.c @@ -30,7 +30,7 @@ * add sane pulse detection ***********************************/ -#include "libavutil/libm.h" // brought forward to work around cygwin header breakage +#include <math.h> // brought forward to work around cygwin header breakage #include <float.h> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 33a16cd92a..3b7dce27f6 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -29,10 +29,10 @@ * add sane pulse detection ***********************************/ #include <float.h> +#include <math.h> #include "libavutil/channel_layout.h" #include "libavutil/crc.h" -#include "libavutil/libm.h" #include "libavutil/float_dsp.h" #include "libavutil/mem.h" #include "libavutil/opt.h" diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c index e7cbd60161..8c94d83c5f 100644 --- a/libavcodec/aacenc_tns.c +++ b/libavcodec/aacenc_tns.c @@ -25,7 +25,8 @@ * @author Rostislav Pehlivanov ( atomnuker gmail com ) */ -#include "libavutil/libm.h" +#include <math.h> + #include "aacenc.h" #include <float.h> #include "aacenc_tns.h" diff --git a/libavcodec/aacps_tablegen.h b/libavcodec/aacps_tablegen.h index 5fdd7f0a9d..4290f7cd1e 100644 --- a/libavcodec/aacps_tablegen.h +++ b/libavcodec/aacps_tablegen.h @@ -32,7 +32,6 @@ #include "libavcodec/aacps_tables.h" #else #include "libavutil/common.h" -#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/mem_internal.h" #define NR_ALLPASS_BANDS20 30 diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index 78f0aead8e..7d1c33a96f 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -35,7 +35,7 @@ #include "sbrdsp.h" #include "libavutil/internal.h" #include "libavutil/intfloat.h" -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" #include "libavutil/avassert.h" #include "libavutil/mem_internal.h" diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c index 06d07e1941..f217b0d0c7 100644 --- a/libavcodec/aacsbr_fixed.c +++ b/libavcodec/aacsbr_fixed.c @@ -63,7 +63,6 @@ #include "aacps.h" #include "sbrdsp.h" #include "libavutil/internal.h" -#include "libavutil/libm.h" #include "libavutil/avassert.h" #include <stdint.h> diff --git a/libavcodec/ac3.h b/libavcodec/ac3.h index ccd437f700..d337f2a84c 100644 --- a/libavcodec/ac3.h +++ b/libavcodec/ac3.h @@ -57,7 +57,7 @@ typedef unsigned int UINTFLOAT; typedef int16_t SHORTFLOAT; #else /* USE_FIXED */ -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" #define FIXR(x) ((float)(x)) #define FIXR12(x) ((float)(x)) diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 7f362f453d..812af086bc 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -37,7 +37,7 @@ #include "libavutil/attributes.h" #include "libavutil/float_dsp.h" -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" #include "libavutil/mem.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" diff --git a/libavcodec/atrac3plusdsp.c b/libavcodec/atrac3plusdsp.c index 6942cba506..9a89d14b92 100644 --- a/libavcodec/atrac3plusdsp.c +++ b/libavcodec/atrac3plusdsp.c @@ -28,7 +28,7 @@ #include <math.h> #include "libavutil/float_dsp.h" -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" #include "libavutil/mem_internal.h" #include "sinewin.h" diff --git a/libavcodec/cbrt_data.c b/libavcodec/cbrt_data.c index d2e36cd6dd..4e05ca8270 100644 --- a/libavcodec/cbrt_data.c +++ b/libavcodec/cbrt_data.c @@ -18,10 +18,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <math.h> + #include "config.h" #include "cbrt_data.h" -#include "libavutil/libm.h" #if CONFIG_HARDCODED_TABLES #include "libavcodec/cbrt_tables.h" diff --git a/libavcodec/cbrt_tablegen_common.c b/libavcodec/cbrt_tablegen_common.c index 9b95a6e44a..c80ccc407e 100644 --- a/libavcodec/cbrt_tablegen_common.c +++ b/libavcodec/cbrt_tablegen_common.c @@ -24,9 +24,6 @@ #include "cbrt_data.h" #include "libavutil/attributes.h" -#ifdef HAVE_AV_CONFIG_H // Only include libm.h when building for the target, not the host -#include "libavutil/libm.h" -#endif av_cold void ff_cbrt_dbl_tableinit(double tmp_lut[TMP_LUT_SIZE]) { diff --git a/libavcodec/dds.c b/libavcodec/dds.c index 4bbe8c88c9..a71c9d0264 100644 --- a/libavcodec/dds.c +++ b/libavcodec/dds.c @@ -26,10 +26,10 @@ * https://msdn.microsoft.com/en-us/library/bb943982%28v=vs.85%29.aspx */ +#include <math.h> #include <stdint.h> #include "libavutil/attributes.h" -#include "libavutil/libm.h" #include "libavutil/imgutils.h" #include "avcodec.h" diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c index b0b11859a7..a474906c1b 100644 --- a/libavcodec/faandct.c +++ b/libavcodec/faandct.c @@ -25,10 +25,12 @@ * @author Michael Niedermayer <[email protected]> */ +#include <math.h> + #include "faandct.h" #include "libavutil/emms.h" #include "libavutil/internal.h" -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" typedef float FLOAT; diff --git a/libavcodec/kbdwin.c b/libavcodec/kbdwin.c index cb73ceb160..46233b4583 100644 --- a/libavcodec/kbdwin.c +++ b/libavcodec/kbdwin.c @@ -16,8 +16,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <math.h> + #include "libavutil/avassert.h" -#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/attributes.h" #include "kbdwin.h" diff --git a/libavcodec/libjxlenc.c b/libavcodec/libjxlenc.c index a9eb1ffe10..c8c864d266 100644 --- a/libavcodec/libjxlenc.c +++ b/libavcodec/libjxlenc.c @@ -24,6 +24,7 @@ * JPEG XL encoder using libjxl */ +#include <math.h> #include <string.h> #include "libavutil/avutil.h" @@ -31,7 +32,6 @@ #include "libavutil/display.h" #include "libavutil/error.h" #include "libavutil/frame.h" -#include "libavutil/libm.h" #include "libavutil/mem.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" diff --git a/libavcodec/mpegaudiodec_common.c b/libavcodec/mpegaudiodec_common.c index 6446d08967..c6608f92d8 100644 --- a/libavcodec/mpegaudiodec_common.c +++ b/libavcodec/mpegaudiodec_common.c @@ -24,11 +24,11 @@ * mpeg audio layer decoder tables. */ +#include <math.h> #include <stddef.h> #include <stdint.h> #include "libavutil/avassert.h" -#include "libavutil/libm.h" #include "libavutil/thread.h" #include "mpegaudiodata.h" diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 1aa124c0ac..87c89fcd2e 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -24,6 +24,8 @@ * MPEG Audio decoder */ +#include <math.h> + #include "config_components.h" #include "libavutil/attributes.h" @@ -31,7 +33,6 @@ #include "libavutil/channel_layout.h" #include "libavutil/crc.h" #include "libavutil/float_dsp.h" -#include "libavutil/libm.h" #include "libavutil/mem.h" #include "libavutil/mem_internal.h" #include "libavutil/thread.h" diff --git a/libavcodec/opus/celt.h b/libavcodec/opus/celt.h index e957f2c123..bab5fad9ad 100644 --- a/libavcodec/opus/celt.h +++ b/libavcodec/opus/celt.h @@ -24,6 +24,7 @@ #ifndef AVCODEC_OPUS_CELT_H #define AVCODEC_OPUS_CELT_H +#include <math.h> #include <stdint.h> #include "libavcodec/avcodec.h" @@ -32,7 +33,6 @@ #include "rc.h" #include "libavutil/float_dsp.h" -#include "libavutil/libm.h" #include "libavutil/mem_internal.h" #include "libavutil/tx.h" diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 8acd98b551..86380e0c6e 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <math.h> + #include "avcodec.h" #include "codec_internal.h" #include "encode.h" @@ -33,7 +35,6 @@ #include "libavutil/buffer.h" #include "libavutil/crc.h" #include "libavutil/csp.h" -#include "libavutil/libm.h" #include "libavutil/mastering_display_metadata.h" #include "libavutil/mem.h" #include "libavutil/opt.h" diff --git a/libavcodec/sinewin_fixed_tablegen.h b/libavcodec/sinewin_fixed_tablegen.h index 660c0056b5..82ea22ec8a 100644 --- a/libavcodec/sinewin_fixed_tablegen.h +++ b/libavcodec/sinewin_fixed_tablegen.h @@ -38,8 +38,6 @@ #define SINETABLE_CONST const #include "libavcodec/sinewin_fixed_tables.h" #else -// do not use libavutil/libm.h since this is compiled both -// for the host and the target and config.h is only valid for the target #include <math.h> #include "libavutil/attributes.h" diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h index 6887d59cfe..cc51fd9bf1 100644 --- a/libavcodec/sinewin_tablegen.h +++ b/libavcodec/sinewin_tablegen.h @@ -24,8 +24,6 @@ #define AVCODEC_SINEWIN_TABLEGEN_H #include <assert.h> -// do not use libavutil/libm.h since this is compiled both -// for the host and the target and config.h is only valid for the target #include <math.h> #include "libavutil/attributes.h" #include "libavutil/common.h" diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 8eb409d4bf..45446e5479 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -18,9 +18,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <math.h> + #include "libavutil/emms.h" #include "libavutil/intmath.h" -#include "libavutil/libm.h" #include "libavutil/log.h" #include "libavutil/mem.h" #include "libavutil/opt.h" diff --git a/libavcodec/tests/celp_math.c b/libavcodec/tests/celp_math.c index 3bcffb2b1c..c6a3ed1507 100644 --- a/libavcodec/tests/celp_math.c +++ b/libavcodec/tests/celp_math.c @@ -22,7 +22,6 @@ #include "libavutil/avassert.h" #include "libavutil/common.h" #include "libavutil/float_dsp.h" -#include "libavutil/libm.h" #include "libavutil/macros.h" #include "libavcodec/celp_math.h" diff --git a/libavcodec/texturedsp.c b/libavcodec/texturedsp.c index 721bfc17f5..a217b22174 100644 --- a/libavcodec/texturedsp.c +++ b/libavcodec/texturedsp.c @@ -22,13 +22,13 @@ * IN THE SOFTWARE. */ +#include <math.h> #include <stddef.h> #include <stdint.h> #include "libavutil/attributes.h" #include "libavutil/common.h" #include "libavutil/intreadwrite.h" -#include "libavutil/libm.h" #include "texturedsp.h" diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index fb3f30a758..433fcb3c90 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -23,6 +23,7 @@ * video crop filter */ +#include <math.h> #include <stdio.h> #include "avfilter.h" @@ -32,7 +33,6 @@ #include "libavutil/eval.h" #include "libavutil/avstring.h" #include "libavutil/internal.h" -#include "libavutil/libm.h" #include "libavutil/imgutils.h" #include "libavutil/mathematics.h" #include "libavutil/opt.h" diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 550fd88a84..ecc6544bad 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -23,6 +23,7 @@ #include "config_components.h" +#include <math.h> #include <stdint.h> #include <inttypes.h> @@ -54,7 +55,6 @@ #include "libavutil/csp.h" #include "libavutil/intfloat.h" #include "libavutil/mathematics.h" -#include "libavutil/libm.h" #include "libavutil/mem.h" #include "libavutil/opt.h" #include "libavutil/dict.h" diff --git a/libavutil/avsscanf.c b/libavutil/avsscanf.c index daa8f4929e..a0dfb20459 100644 --- a/libavutil/avsscanf.c +++ b/libavutil/avsscanf.c @@ -32,7 +32,6 @@ #include <float.h> #include "avstring.h" -#include "libm.h" typedef struct FFFILE { size_t buf_size; diff --git a/libavutil/display.c b/libavutil/display.c index d31061283c..a0076e067b 100644 --- a/libavutil/display.c +++ b/libavutil/display.c @@ -23,7 +23,6 @@ #include <math.h> #include "display.h" -#include "libm.h" #include "mathematics.h" // fixed point to double diff --git a/libavutil/ffmath.h b/libavutil/ffmath.h index aad1347f26..5e3741825b 100644 --- a/libavutil/ffmath.h +++ b/libavutil/ffmath.h @@ -26,8 +26,10 @@ #ifndef AVUTIL_FFMATH_H #define AVUTIL_FFMATH_H +#include <math.h> + #include "attributes.h" -#include "libm.h" +#include "mathematics.h" /** * Compute 10^x for floating point values. Note: this function is by no means diff --git a/libavutil/internal.h b/libavutil/internal.h index db597cce32..b3482b4258 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -34,13 +34,14 @@ //#define CHECKED #include <limits.h> +#include <math.h> #include <stdint.h> #include <stddef.h> #include <assert.h> #include <stdio.h> #include "config.h" #include "attributes.h" -#include "libm.h" +#include "mathematics.h" #include "macros.h" #ifndef attribute_align_arg diff --git a/libavutil/libm.h b/libavutil/libm.h deleted file mode 100644 index 53a565d8ba..0000000000 --- a/libavutil/libm.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * Wrapper around math.h with platform-specific optimizations - */ - -#ifndef AVUTIL_LIBM_H -#define AVUTIL_LIBM_H - -#include <math.h> -#include "mathematics.h" - -#endif /* AVUTIL_LIBM_H */ diff --git a/libavutil/tests/eval.c b/libavutil/tests/eval.c index 1014e2b936..c81aeb9ee7 100644 --- a/libavutil/tests/eval.c +++ b/libavutil/tests/eval.c @@ -22,7 +22,7 @@ #include <stdio.h> #include <string.h> -#include "libavutil/libm.h" +#include "libavutil/mathematics.h" #include "libavutil/eval.h" static const double const_values[] = { diff --git a/libswresample/audioconvert.c b/libswresample/audioconvert.c index 2085385cce..5956f29676 100644 --- a/libswresample/audioconvert.c +++ b/libswresample/audioconvert.c @@ -25,8 +25,10 @@ * @author Michael Niedermayer <[email protected]> */ +#include <math.h> + #include "libavutil/avassert.h" -#include "libavutil/libm.h" +#include "libavutil/internal.h" #include "libavutil/mem.h" #include "libavutil/samplefmt.h" #include "audioconvert.h" diff --git a/libswscale/utils.c b/libswscale/utils.c index 59b6776f6a..55ac6c9efb 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -34,7 +34,6 @@ #include "libavutil/emms.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" -#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/mem.h" #include "libavutil/opt.h" -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
