[FFmpeg-devel] [PATCH 1/2] Replace FFMIN/FFMAX by type specific macros
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Mon Jun 2 18:47:41 EEST 2025
Michael Niedermayer:
> This allows adjusting them to exactly match whatever is fastest on
> a given CPU for each type.
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
> doc/examples/avio_read_callback.c | 2 +-
> doc/examples/transcode_aac.c | 2 +-
> fftools/cmdutils.c | 2 +-
> fftools/ffmpeg.c | 2 +-
> fftools/ffmpeg_dec.c | 2 +-
> fftools/ffmpeg_demux.c | 14 +--
> fftools/ffmpeg_enc.c | 8 +-
> fftools/ffmpeg_mux.c | 2 +-
> fftools/ffmpeg_mux_init.c | 8 +-
> fftools/ffmpeg_opt.c | 2 +-
> fftools/ffmpeg_sched.c | 4 +-
> fftools/ffmpeg_utils.h | 2 +-
> fftools/ffplay.c | 32 +++----
> fftools/ffprobe.c | 4 +-
> fftools/graph/graphprint.c | 2 +-
> fftools/opt_common.c | 2 +-
> fftools/textformat/avtextformat.c | 4 +-
> libavcodec/4xm.c | 4 +-
> libavcodec/8svx.c | 2 +-
> libavcodec/a64multienc.c | 14 +--
> libavcodec/aac/aacdec.c | 8 +-
> libavcodec/aac/aacdec_ac.c | 2 +-
> libavcodec/aac_ac3_parser.c | 2 +-
> libavcodec/aaccoder.c | 54 ++++++------
> libavcodec/aaccoder_twoloop.h | 60 ++++++-------
> libavcodec/aacenc.c | 24 ++---
> libavcodec/aacenc_is.c | 4 +-
> libavcodec/aacenc_tns.c | 12 +--
> libavcodec/aacenc_utils.h | 8 +-
> libavcodec/aacencdsp.h | 2 +-
> libavcodec/aacps.c | 2 +-
> libavcodec/aacps_common.c | 2 +-
> libavcodec/aacps_tablegen.h | 2 +-
> libavcodec/aacpsy.c | 50 +++++------
> libavcodec/aacsbr.c | 8 +-
> libavcodec/aacsbr_template.c | 4 +-
> libavcodec/aarch64/vvc/dsp_init.c | 2 +-
> libavcodec/aasc.c | 2 +-
> libavcodec/ac3.c | 26 +++---
> libavcodec/ac3_parser.c | 2 +-
> libavcodec/ac3dec.c | 30 +++----
> libavcodec/ac3dsp.c | 4 +-
> libavcodec/ac3enc.c | 12 +--
> libavcodec/ac3enc_fixed.c | 4 +-
> libavcodec/ac3enc_float.c | 2 +-
> libavcodec/ac3enc_template.c | 14 +--
> libavcodec/acelp_pitch_delay.c | 2 +-
> libavcodec/adpcm.c | 22 ++---
> libavcodec/adpcmenc.c | 8 +-
> libavcodec/agm.c | 24 ++---
> libavcodec/aic.c | 2 +-
> libavcodec/alac.c | 8 +-
> libavcodec/alacenc.c | 2 +-
> libavcodec/alsdec.c | 30 +++----
> libavcodec/amrnbdec.c | 6 +-
> libavcodec/amrwbdec.c | 8 +-
> libavcodec/anm.c | 2 +-
> libavcodec/ansi.c | 18 ++--
> libavcodec/apac.c | 2 +-
> libavcodec/apedec.c | 10 +--
> libavcodec/aptxenc.c | 2 +-
> libavcodec/apv_entropy.c | 18 ++--
> libavcodec/arbc.c | 2 +-
> libavcodec/asvenc.c | 4 +-
> libavcodec/atrac3.c | 6 +-
> libavcodec/atrac3plusdec.c | 2 +-
> libavcodec/atrac9dec.c | 20 ++---
> libavcodec/audio_frame_queue.c | 2 +-
> libavcodec/audiotoolboxenc.c | 2 +-
> libavcodec/av1_parse.h | 2 +-
> libavcodec/av1dec.c | 8 +-
> libavcodec/avs2_parser.c | 2 +-
> libavcodec/avs3_parser.c | 2 +-
> libavcodec/bink.c | 4 +-
> libavcodec/binkaudio.c | 10 +--
> libavcodec/bmp.c | 2 +-
> libavcodec/bmp_parser.c | 4 +-
> libavcodec/bonk.c | 4 +-
> libavcodec/bsf/dts2pts.c | 2 +-
> libavcodec/bytestream.h | 14 +--
> libavcodec/cavs.c | 2 +-
> libavcodec/cavsdec.c | 4 +-
> libavcodec/cbs.c | 2 +-
> libavcodec/cbs_av1_syntax_template.c | 4 +-
> libavcodec/cbs_h2645.c | 4 +-
> libavcodec/cbs_h265_syntax_template.c | 2 +-
> libavcodec/cbs_h266_syntax_template.c | 6 +-
> libavcodec/ccaption_dec.c | 2 +-
> libavcodec/cdgraphics.c | 10 +--
> libavcodec/cfhdenc.c | 4 +-
> libavcodec/cinepak.c | 2 +-
> libavcodec/cngdec.c | 2 +-
> libavcodec/cook.c | 4 +-
> libavcodec/cri.c | 6 +-
> libavcodec/d3d12va_encode_hevc.c | 4 +-
> libavcodec/dca_core.c | 8 +-
> libavcodec/dca_lbr.c | 14 +--
> libavcodec/decode.c | 14 +--
> libavcodec/dfa.c | 4 +-
> libavcodec/dirac_arith.c | 2 +-
> libavcodec/dirac_dwt.c | 2 +-
> libavcodec/diracdec.c | 20 ++---
> libavcodec/dnxhddata.c | 2 +-
> libavcodec/dnxhdenc.c | 22 ++---
> libavcodec/dnxuc_parser.c | 2 +-
> libavcodec/dolby_e.c | 18 ++--
> libavcodec/dovi_rpuenc.c | 2 +-
> libavcodec/dpcm.c | 2 +-
> libavcodec/dpx_parser.c | 2 +-
> libavcodec/dpxenc.c | 2 +-
> libavcodec/dsicinvideo.c | 4 +-
> libavcodec/dstdec.c | 4 +-
> libavcodec/dvbsubdec.c | 2 +-
> libavcodec/dvbsubenc.c | 4 +-
> libavcodec/dvdec.c | 2 +-
> libavcodec/dvdsubdec.c | 2 +-
> libavcodec/dvdsubenc.c | 10 +--
> libavcodec/dxva2_av1.c | 2 +-
> libavcodec/dxva2_h264.c | 2 +-
> libavcodec/dxva2_hevc.c | 2 +-
> libavcodec/dxva2_vc1.c | 2 +-
> libavcodec/eac3dec.c | 2 +-
> libavcodec/eatgq.c | 2 +-
> libavcodec/eatgv.c | 4 +-
> libavcodec/elbg.c | 6 +-
> libavcodec/elsdec.c | 4 +-
> libavcodec/encode.c | 4 +-
> libavcodec/error_resilience.c | 26 +++---
> libavcodec/evrcdec.c | 8 +-
> libavcodec/executor.c | 4 +-
> libavcodec/exr.c | 42 ++++-----
> libavcodec/exrenc.c | 2 +-
> libavcodec/fastaudio.c | 2 +-
> libavcodec/ffv1.c | 2 +-
> libavcodec/ffv1.h | 14 +--
> libavcodec/ffv1enc.c | 30 +++----
> libavcodec/ffv1enc_vulkan.c | 4 +-
> libavcodec/fic.c | 4 +-
> libavcodec/flac_parser.c | 22 ++---
> libavcodec/flacenc.c | 8 +-
> libavcodec/flashsv.c | 2 +-
> libavcodec/g2meet.c | 12 +--
> libavcodec/g723_1.c | 6 +-
> libavcodec/g723_1_parser.c | 2 +-
> libavcodec/g723_1dec.c | 10 +--
> libavcodec/g723_1enc.c | 12 +--
> libavcodec/g729dec.c | 6 +-
> libavcodec/g729postfilter.c | 18 ++--
> libavcodec/get_bits.h | 4 +-
> libavcodec/get_buffer.c | 2 +-
> libavcodec/gif.c | 2 +-
> libavcodec/golomb.h | 2 +-
> libavcodec/h2645_parse.c | 6 +-
> libavcodec/h264_direct.c | 2 +-
> libavcodec/h264_levels.c | 2 +-
> libavcodec/h264_mb.c | 16 ++--
> libavcodec/h264_mvpred.h | 2 +-
> libavcodec/h264_parse.c | 2 +-
> libavcodec/h264_parser.c | 2 +-
> libavcodec/h264_ps.c | 4 +-
> libavcodec/h264_refs.c | 6 +-
> libavcodec/h264_slice.c | 12 +--
> libavcodec/h264dec.c | 4 +-
> libavcodec/h265_profile_level.c | 6 +-
> libavcodec/hapdec.c | 2 +-
> libavcodec/hapenc.c | 2 +-
> libavcodec/hdrenc.c | 2 +-
> libavcodec/hevc/cabac.c | 20 ++---
> libavcodec/hevc/filter.c | 4 +-
> libavcodec/hevc/hevcdec.c | 8 +-
> libavcodec/hevc/mvs.c | 2 +-
> libavcodec/hevc/ps.c | 16 ++--
> libavcodec/hevc/refs.c | 2 +-
> libavcodec/hevc/sei.c | 8 +-
> libavcodec/huffyuvdec.c | 4 +-
> libavcodec/huffyuvenc.c | 12 +--
> libavcodec/hw_base_encode.c | 6 +-
> libavcodec/iff.c | 34 +++----
> libavcodec/ilbcdec.c | 22 ++---
> libavcodec/imc.c | 2 +-
> libavcodec/indeo3.c | 4 +-
> libavcodec/interplayacm.c | 8 +-
> libavcodec/intrax8.c | 4 +-
> libavcodec/intrax8dsp.c | 42 ++++-----
> libavcodec/ituh263dec.c | 2 +-
> libavcodec/ivi.c | 4 +-
> libavcodec/j2kenc.c | 38 ++++----
> libavcodec/jpeg2000.c | 24 ++---
> libavcodec/jpeg2000_parser.c | 2 +-
> libavcodec/jpeg2000dec.c | 38 ++++----
> libavcodec/jpeg2000dwt.c | 2 +-
> libavcodec/jpegls.c | 14 +--
> libavcodec/jpegls.h | 4 +-
> libavcodec/jpeglsdec.c | 6 +-
> libavcodec/jpegxl_parse.c | 2 +-
> libavcodec/jpegxl_parser.c | 12 +--
> libavcodec/lagarith.c | 4 +-
> libavcodec/lagarithrac.c | 2 +-
> libavcodec/lcldec.c | 10 +--
> libavcodec/libfdk-aacdec.c | 4 +-
> libavcodec/libfdk-aacenc.c | 2 +-
> libavcodec/liblc3dec.c | 2 +-
> libavcodec/liblc3enc.c | 2 +-
> libavcodec/libopenh264enc.c | 2 +-
> libavcodec/libopenjpegenc.c | 4 +-
> libavcodec/libvpxdec.c | 2 +-
> libavcodec/libvpxenc.c | 2 +-
> libavcodec/libwebpenc_common.c | 12 +--
> libavcodec/libx264.c | 10 +--
> libavcodec/libx265.c | 8 +-
> libavcodec/libzvbi-teletextdec.c | 4 +-
> libavcodec/lpc.c | 2 +-
> libavcodec/lscrdec.c | 2 +-
> libavcodec/lsp.c | 6 +-
> libavcodec/lzwenc.c | 2 +-
> libavcodec/mace.c | 2 +-
> libavcodec/magicyuv.c | 14 +--
> libavcodec/magicyuvenc.c | 8 +-
> libavcodec/mathops.h | 8 +-
> libavcodec/me_cmp.c | 2 +-
> libavcodec/mf_utils.c | 2 +-
> libavcodec/mips/vc1dsp_mmi.c | 4 +-
> libavcodec/mips/vp8dsp_mmi.c | 8 +-
> libavcodec/mjpeg_parser.c | 4 +-
> libavcodec/mjpegbdec.c | 2 +-
> libavcodec/mjpegdec.c | 8 +-
> libavcodec/mjpegenc_common.c | 2 +-
> libavcodec/mlpdec.c | 4 +-
> libavcodec/mlpenc.c | 50 +++++------
> libavcodec/mobiclip.c | 12 +--
> libavcodec/motion_est.c | 50 +++++------
> libavcodec/motion_est_template.c | 40 ++++-----
> libavcodec/motionpixels.c | 4 +-
> libavcodec/movtextdec.c | 2 +-
> libavcodec/movtextenc.c | 2 +-
> libavcodec/mpc8.c | 4 +-
> libavcodec/mpeg12dec.c | 6 +-
> libavcodec/mpeg4videodec.c | 20 ++---
> libavcodec/mpeg4videoenc.c | 6 +-
> libavcodec/mpegaudio_parser.c | 2 +-
> libavcodec/mpegaudiodec_template.c | 10 +--
> libavcodec/mpegutils.c | 2 +-
> libavcodec/mpegvideo.c | 2 +-
> libavcodec/mpegvideo_dec.c | 18 ++--
> libavcodec/mpegvideo_enc.c | 26 +++---
> libavcodec/mpegvideo_motion.c | 20 ++---
> libavcodec/msmpeg4enc.c | 4 +-
> libavcodec/msp2dec.c | 6 +-
> libavcodec/msrle.c | 2 +-
> libavcodec/mss12.c | 8 +-
> libavcodec/mss2.c | 6 +-
> libavcodec/mss3.c | 2 +-
> libavcodec/mss4.c | 2 +-
> libavcodec/mv30.c | 2 +-
> libavcodec/mvcdec.c | 2 +-
> libavcodec/mvha.c | 4 +-
> libavcodec/mxpegdec.c | 4 +-
> libavcodec/nellymoser.c | 2 +-
> libavcodec/nellymoserenc.c | 8 +-
> libavcodec/nuv.c | 8 +-
> libavcodec/nvenc.c | 16 ++--
> libavcodec/opus/celt.c | 44 +++++-----
> libavcodec/opus/dec.c | 6 +-
> libavcodec/opus/dec_celt.c | 22 ++---
> libavcodec/opus/enc.c | 16 ++--
> libavcodec/opus/enc_psy.c | 18 ++--
> libavcodec/opus/pvq.c | 4 +-
> libavcodec/opus/rc.c | 26 +++---
> libavcodec/opus/silk.c | 12 +--
> libavcodec/osq.c | 4 +-
> libavcodec/pcx.c | 2 +-
> libavcodec/pictordec.c | 14 +--
> libavcodec/pixlet.c | 6 +-
> libavcodec/png_parser.c | 2 +-
> libavcodec/pngdec.c | 4 +-
> libavcodec/pngenc.c | 2 +-
> libavcodec/pnm_parser.c | 4 +-
> libavcodec/proresdec.c | 6 +-
> libavcodec/proresenc_anatoliy.c | 12 +--
> libavcodec/proresenc_kostya.c | 22 ++---
> libavcodec/psd.c | 2 +-
> libavcodec/pthread_frame.c | 2 +-
> libavcodec/pthread_slice.c | 4 +-
> libavcodec/qcelpdec.c | 12 +--
> libavcodec/qdmc.c | 2 +-
> libavcodec/qpeg.c | 6 +-
> libavcodec/qsvenc.c | 20 ++---
> libavcodec/qtrleenc.c | 6 +-
> libavcodec/ra144.c | 2 +-
> libavcodec/ra144enc.c | 2 +-
> libavcodec/ra288.c | 2 +-
> libavcodec/ralf.c | 12 +--
> libavcodec/rasc.c | 2 +-
> libavcodec/ratecontrol.c | 10 +--
> libavcodec/rawdec.c | 2 +-
> libavcodec/rectangle.h | 2 +-
> libavcodec/rka.c | 8 +-
> libavcodec/rl2.c | 2 +-
> libavcodec/rle.c | 4 +-
> libavcodec/roqaudioenc.c | 2 +-
> libavcodec/roqvideoenc.c | 2 +-
> libavcodec/rpza.c | 2 +-
> libavcodec/rpzaenc.c | 42 ++++-----
> libavcodec/rv10.c | 4 +-
> libavcodec/rv34.c | 6 +-
> libavcodec/rv60dec.c | 2 +-
> libavcodec/sanm.c | 10 +--
> libavcodec/sbc_parser.c | 2 +-
> libavcodec/sgirledec.c | 2 +-
> libavcodec/shorten.c | 14 +--
> libavcodec/sipr.c | 6 +-
> libavcodec/sipr16k.c | 2 +-
> libavcodec/sipr_parser.c | 2 +-
> libavcodec/smacker.c | 2 +-
> libavcodec/smcenc.c | 32 +++----
> libavcodec/snow.c | 8 +-
> libavcodec/snow.h | 4 +-
> libavcodec/snow_dwt.c | 4 +-
> libavcodec/snowdec.c | 38 ++++----
> libavcodec/snowenc.c | 32 +++----
> libavcodec/sonic.c | 10 +--
> libavcodec/speexdec.c | 6 +-
> libavcodec/svq3.c | 2 +-
> libavcodec/tak_parser.c | 4 +-
> libavcodec/takdec.c | 4 +-
> libavcodec/targa.c | 4 +-
> libavcodec/tdsc.c | 4 +-
> libavcodec/tests/apv.c | 6 +-
> libavcodec/tests/bitstream_template.c | 20 ++---
> libavcodec/tests/dct.c | 4 +-
> libavcodec/tests/jpeg2000dwt.c | 2 +-
> libavcodec/texturedsp_template.c | 2 +-
> libavcodec/tiertexseqv.c | 4 +-
> libavcodec/tiff.c | 18 ++--
> libavcodec/tiffenc.c | 8 +-
> libavcodec/truemotion2.c | 2 +-
> libavcodec/utils.c | 12 +--
> libavcodec/utvideodec.c | 12 +--
> libavcodec/v210dec.c | 2 +-
> libavcodec/v4l2_buffers.c | 6 +-
> libavcodec/vaapi_encode_av1.c | 12 +--
> libavcodec/vaapi_encode_h265.c | 18 ++--
> libavcodec/vc1_pred.c | 8 +-
> libavcodec/vc1dec.c | 10 +--
> libavcodec/vc1dsp.c | 4 +-
> libavcodec/vc2enc.c | 10 +--
> libavcodec/videodsp_template.c | 8 +-
> libavcodec/vlc.c | 14 +--
> libavcodec/vmixdec.c | 2 +-
> libavcodec/vorbis.c | 2 +-
> libavcodec/vorbisdec.c | 2 +-
> libavcodec/vorbisenc.c | 14 +--
> libavcodec/vp3.c | 12 +--
> libavcodec/vp5.c | 2 +-
> libavcodec/vp6.c | 6 +-
> libavcodec/vp8.c | 12 +--
> libavcodec/vp8dsp.c | 4 +-
> libavcodec/vulkan_decode.c | 6 +-
> libavcodec/vulkan_encode.c | 2 +-
> libavcodec/vulkan_encode_h265.c | 18 ++--
> libavcodec/vulkan_ffv1.c | 4 +-
> libavcodec/vvc/cabac.c | 4 +-
> libavcodec/vvc/ctu.c | 30 +++----
> libavcodec/vvc/dec.c | 2 +-
> libavcodec/vvc/filter.c | 26 +++---
> libavcodec/vvc/inter.c | 12 +--
> libavcodec/vvc/intra.c | 2 +-
> libavcodec/vvc/intra_template.c | 40 ++++-----
> libavcodec/vvc/intra_utils.c | 18 ++--
> libavcodec/vvc/mvs.c | 20 ++---
> libavcodec/vvc/ps.c | 8 +-
> libavcodec/vvc/refs.c | 2 +-
> libavcodec/wavarc.c | 4 +-
> libavcodec/wavpackenc.c | 16 ++--
> libavcodec/wbmpdec.c | 2 +-
> libavcodec/webp.c | 8 +-
> libavcodec/webp_parser.c | 4 +-
> libavcodec/wmaenc.c | 4 +-
> libavcodec/wmaprodec.c | 20 ++---
> libavcodec/wmavoice.c | 30 +++----
> libavcodec/wmv2dec.c | 4 +-
> libavcodec/wmv2enc.c | 2 +-
> libavcodec/x86/videodsp_init.c | 8 +-
> libavcodec/xan.c | 4 +-
> libavcodec/xpmdec.c | 2 +-
> libavcodec/xsubenc.c | 2 +-
> libavcodec/xxan.c | 2 +-
> libavcodec/ylc.c | 6 +-
> libavcodec/zmbv.c | 2 +-
> libavcodec/zmbvenc.c | 12 +--
> libavdevice/alsa.c | 2 +-
> libavdevice/fbdev_enc.c | 4 +-
> libavdevice/lavfi.c | 2 +-
> libavdevice/openal-dec.c | 2 +-
> libavdevice/oss_enc.c | 2 +-
> libavdevice/pulse_audio_enc.c | 2 +-
> libavdevice/sndio_enc.c | 2 +-
> libavdevice/timefilter.c | 2 +-
> libavdevice/v4l2.c | 2 +-
> libavdevice/xcbgrab.c | 16 ++--
> libavfilter/aeval.c | 4 +-
> libavfilter/af_aap.c | 4 +-
> libavfilter/af_acrossover.c | 2 +-
> libavfilter/af_acrusher.c | 6 +-
> libavfilter/af_adeclick.c | 10 +--
> libavfilter/af_adecorrelate.c | 2 +-
> libavfilter/af_adelay.c | 14 +--
> libavfilter/af_adenorm.c | 2 +-
> libavfilter/af_adrc.c | 2 +-
> libavfilter/af_adynamicequalizer.c | 2 +-
> libavfilter/af_aecho.c | 4 +-
> libavfilter/af_afftdn.c | 10 +--
> libavfilter/af_afftfilt.c | 4 +-
> libavfilter/af_afir.c | 18 ++--
> libavfilter/af_afreqshift.c | 2 +-
> libavfilter/af_afwtdn.c | 12 +--
> libavfilter/af_agate.c | 10 +--
> libavfilter/af_aiir.c | 16 ++--
> libavfilter/af_alimiter.c | 16 ++--
> libavfilter/af_amerge.c | 2 +-
> libavfilter/af_amix.c | 4 +-
> libavfilter/af_amultiply.c | 2 +-
> libavfilter/af_anequalizer.c | 2 +-
> libavfilter/af_anlms.c | 4 +-
> libavfilter/af_apad.c | 4 +-
> libavfilter/af_apsyclip.c | 18 ++--
> libavfilter/af_apulsator.c | 2 +-
> libavfilter/af_aresample.c | 2 +-
> libavfilter/af_arls.c | 4 +-
> libavfilter/af_arnndn.c | 32 +++----
> libavfilter/af_asdr.c | 4 +-
> libavfilter/af_asetrate.c | 2 +-
> libavfilter/af_asoftclip.c | 2 +-
> libavfilter/af_aspectralstats.c | 2 +-
> libavfilter/af_astats.c | 66 +++++++-------
> libavfilter/af_asubboost.c | 2 +-
> libavfilter/af_atempo.c | 38 ++++----
> libavfilter/af_atilt.c | 2 +-
> libavfilter/af_axcorrelate.c | 2 +-
> libavfilter/af_biquads.c | 2 +-
> libavfilter/af_channelmap.c | 2 +-
> libavfilter/af_chorus.c | 4 +-
> libavfilter/af_compand.c | 10 +--
> libavfilter/af_crystalizer.c | 2 +-
> libavfilter/af_deesser.c | 6 +-
> libavfilter/af_dynaudnorm.c | 10 +--
> libavfilter/af_firequalizer.c | 10 +--
> libavfilter/af_hdcd.c | 14 +--
> libavfilter/af_headphone.c | 6 +-
> libavfilter/af_join.c | 8 +-
> libavfilter/af_ladspa.c | 4 +-
> libavfilter/af_mcompand.c | 10 +--
> libavfilter/af_replaygain.c | 2 +-
> libavfilter/af_sidechaincompress.c | 8 +-
> libavfilter/af_silenceremove.c | 2 +-
> libavfilter/af_sofalizer.c | 6 +-
> libavfilter/af_speechnorm.c | 20 ++---
> libavfilter/af_stereotools.c | 40 ++++-----
> libavfilter/af_surround.c | 8 +-
> libavfilter/af_volume.c | 2 +-
> libavfilter/afir_template.c | 2 +-
> libavfilter/asrc_afdelaysrc.c | 2 +-
> libavfilter/asrc_afirsrc.c | 4 +-
> libavfilter/asrc_anullsrc.c | 2 +-
> libavfilter/asrc_flite.c | 2 +-
> libavfilter/asrc_hilbert.c | 2 +-
> libavfilter/asrc_sinc.c | 2 +-
> libavfilter/avf_a3dscope.c | 2 +-
> libavfilter/avf_abitscope.c | 2 +-
> libavfilter/avf_ahistogram.c | 4 +-
> libavfilter/avf_aphasemeter.c | 8 +-
> libavfilter/avf_avectorscope.c | 28 +++---
> libavfilter/avf_concat.c | 6 +-
> libavfilter/avf_showcqt.c | 28 +++---
> libavfilter/avf_showcwt.c | 16 ++--
> libavfilter/avf_showfreqs.c | 4 +-
> libavfilter/avf_showspatial.c | 4 +-
> libavfilter/avf_showvolume.c | 18 ++--
> libavfilter/avf_showwaves.c | 2 +-
> libavfilter/avfilter.c | 10 +--
> libavfilter/blend_modes.c | 6 +-
> libavfilter/boxblur.c | 4 +-
> libavfilter/bwdifdsp.c | 4 +-
> libavfilter/drawutils.c | 4 +-
> libavfilter/edge_template.c | 4 +-
> libavfilter/f_bench.c | 4 +-
> libavfilter/f_drawgraph.c | 4 +-
> libavfilter/f_latency.c | 4 +-
> libavfilter/f_loop.c | 6 +-
> libavfilter/f_metadata.c | 2 +-
> libavfilter/f_segment.c | 2 +-
> libavfilter/f_select.c | 4 +-
> libavfilter/f_sendcmd.c | 4 +-
> libavfilter/framepool.c | 2 +-
> libavfilter/framesync.c | 2 +-
> libavfilter/graphdump.c | 14 +--
> libavfilter/graphparser.c | 2 +-
> libavfilter/median_template.c | 8 +-
> libavfilter/motion_estimation.c | 80 ++++++++---------
> libavfilter/pthread.c | 2 +-
> libavfilter/scale_eval.c | 8 +-
> libavfilter/signature_lookup.c | 2 +-
> libavfilter/src_movie.c | 2 +-
> libavfilter/trim.c | 14 +--
> libavfilter/vaf_spectrumsynth.c | 2 +-
> libavfilter/vf_alphamerge.c | 2 +-
> libavfilter/vf_amplify.c | 2 +-
> libavfilter/vf_avgblur.c | 12 +--
> libavfilter/vf_avgblur_opencl.c | 2 +-
> libavfilter/vf_backgroundkey.c | 2 +-
> libavfilter/vf_bilateral_cuda.c | 2 +-
> libavfilter/vf_blackdetect.c | 2 +-
> libavfilter/vf_blend.c | 2 +-
> libavfilter/vf_blockdetect.c | 12 +--
> libavfilter/vf_bm3d.c | 10 +--
> libavfilter/vf_boxblur.c | 4 +-
> libavfilter/vf_bwdif.c | 2 +-
> libavfilter/vf_cas.c | 22 ++---
> libavfilter/vf_chromakey.c | 2 +-
> libavfilter/vf_chromakey_cuda.c | 2 +-
> libavfilter/vf_chromanr.c | 8 +-
> libavfilter/vf_ciescope.c | 8 +-
> libavfilter/vf_colorbalance.c | 6 +-
> libavfilter/vf_colorchannelmixer.c | 2 +-
> libavfilter/vf_colorconstancy.c | 6 +-
> libavfilter/vf_colorcontrast.c | 2 +-
> libavfilter/vf_colorcorrect.c | 18 ++--
> libavfilter/vf_colorize.c | 2 +-
> libavfilter/vf_colorkey.c | 2 +-
> libavfilter/vf_colorlevels.c | 10 +--
> libavfilter/vf_colormap.c | 6 +-
> libavfilter/vf_colormatrix.c | 8 +-
> libavfilter/vf_colorspace.c | 14 +--
> libavfilter/vf_colortemperature.c | 2 +-
> libavfilter/vf_convolution.c | 30 +++----
> libavfilter/vf_convolve.c | 4 +-
> libavfilter/vf_corr.c | 4 +-
> libavfilter/vf_cover_rect.c | 4 +-
> libavfilter/vf_cropdetect.c | 8 +-
> libavfilter/vf_datascope.c | 24 ++---
> libavfilter/vf_deblock.c | 10 +--
> libavfilter/vf_dedot.c | 6 +-
> libavfilter/vf_delogo.c | 18 ++--
> libavfilter/vf_deshake.c | 4 +-
> libavfilter/vf_deshake_opencl.c | 6 +-
> libavfilter/vf_despill.c | 12 +--
> libavfilter/vf_detelecine.c | 2 +-
> libavfilter/vf_displace.c | 2 +-
> libavfilter/vf_dnn_detect.c | 4 +-
> libavfilter/vf_drawbox.c | 4 +-
> libavfilter/vf_drawtext.c | 42 ++++-----
> libavfilter/vf_epx.c | 26 +++---
> libavfilter/vf_estdif.c | 2 +-
> libavfilter/vf_exposure.c | 2 +-
> libavfilter/vf_fade.c | 12 +--
> libavfilter/vf_fftdnoiz.c | 12 +--
> libavfilter/vf_fftfilt.c | 16 ++--
> libavfilter/vf_fieldhint.c | 4 +-
> libavfilter/vf_find_rect.c | 16 ++--
> libavfilter/vf_framerate.c | 4 +-
> libavfilter/vf_gblur.c | 6 +-
> libavfilter/vf_gradfun.c | 4 +-
> libavfilter/vf_grayworld.c | 4 +-
> libavfilter/vf_guided.c | 12 +--
> libavfilter/vf_hflip.c | 2 +-
> libavfilter/vf_histogram.c | 14 +--
> libavfilter/vf_hqdn3d.c | 4 +-
> libavfilter/vf_hsvkey.c | 2 +-
> libavfilter/vf_huesaturation.c | 16 ++--
> libavfilter/vf_identity.c | 6 +-
> libavfilter/vf_lagfun.c | 2 +-
> libavfilter/vf_lcevc.c | 4 +-
> libavfilter/vf_lenscorrection.c | 6 +-
> libavfilter/vf_lensfun.c | 4 +-
> libavfilter/vf_libopencv.c | 2 +-
> libavfilter/vf_libplacebo.c | 2 +-
> libavfilter/vf_limitdiff.c | 2 +-
> libavfilter/vf_limiter.c | 6 +-
> libavfilter/vf_lumakey.c | 2 +-
> libavfilter/vf_lut.c | 8 +-
> libavfilter/vf_lut2.c | 4 +-
> libavfilter/vf_maskedclamp.c | 10 +--
> libavfilter/vf_maskedmerge.c | 2 +-
> libavfilter/vf_maskedminmax.c | 2 +-
> libavfilter/vf_maskedthreshold.c | 6 +-
> libavfilter/vf_maskfun.c | 4 +-
> libavfilter/vf_median.c | 2 +-
> libavfilter/vf_mergeplanes.c | 2 +-
> libavfilter/vf_minterpolate.c | 24 ++---
> libavfilter/vf_mix.c | 8 +-
> libavfilter/vf_monochrome.c | 4 +-
> libavfilter/vf_morpho.c | 40 ++++-----
> libavfilter/vf_mpdecimate.c | 4 +-
> libavfilter/vf_multiply.c | 2 +-
> libavfilter/vf_negate.c | 2 +-
> libavfilter/vf_neighbor.c | 42 ++++-----
> libavfilter/vf_nlmeans_vulkan.c | 12 +--
> libavfilter/vf_nnedi.c | 18 ++--
> libavfilter/vf_noise.c | 4 +-
> libavfilter/vf_normalize.c | 32 +++----
> libavfilter/vf_overlay.c | 32 +++----
> libavfilter/vf_overlay_opencl.c | 4 +-
> libavfilter/vf_pad.c | 4 +-
> libavfilter/vf_perspective.c | 2 +-
> libavfilter/vf_photosensitivity.c | 4 +-
> libavfilter/vf_pixelize.c | 14 +--
> libavfilter/vf_pp7.c | 6 +-
> libavfilter/vf_premultiply.c | 14 +--
> libavfilter/vf_pseudocolor.c | 2 +-
> libavfilter/vf_pullup.c | 4 +-
> libavfilter/vf_readeia608.c | 14 +--
> libavfilter/vf_readvitc.c | 4 +-
> libavfilter/vf_remap.c | 2 +-
> libavfilter/vf_remap_opencl.c | 2 +-
> libavfilter/vf_removegrain.c | 122 +++++++++++++-------------
> libavfilter/vf_removelogo.c | 12 +--
> libavfilter/vf_rotate.c | 18 ++--
> libavfilter/vf_scale_cuda.c | 2 +-
> libavfilter/vf_scdet.c | 2 +-
> libavfilter/vf_scdet_vulkan.c | 2 +-
> libavfilter/vf_scroll.c | 2 +-
> libavfilter/vf_shear.c | 6 +-
> libavfilter/vf_shufflepixels.c | 10 +--
> libavfilter/vf_signature.c | 2 +-
> libavfilter/vf_ssim.c | 6 +-
> libavfilter/vf_ssim360.c | 14 +--
> libavfilter/vf_stack.c | 6 +-
> libavfilter/vf_stereo3d.c | 2 +-
> libavfilter/vf_super2xsai.c | 8 +-
> libavfilter/vf_swaprect.c | 4 +-
> libavfilter/vf_telecine.c | 2 +-
> libavfilter/vf_threshold.c | 2 +-
> libavfilter/vf_tiltandshift.c | 2 +-
> libavfilter/vf_tonemap.c | 8 +-
> libavfilter/vf_tonemap_vaapi.c | 14 +--
> libavfilter/vf_transpose.c | 2 +-
> libavfilter/vf_unsharp.c | 4 +-
> libavfilter/vf_unsharp_opencl.c | 2 +-
> libavfilter/vf_v360.c | 26 +++---
> libavfilter/vf_vaguedenoiser.c | 10 +--
> libavfilter/vf_varblur.c | 20 ++---
> libavfilter/vf_vectorscope.c | 36 ++++----
> libavfilter/vf_vfrdet.c | 4 +-
> libavfilter/vf_vibrance.c | 2 +-
> libavfilter/vf_vif.c | 16 ++--
> libavfilter/vf_vpp_qsv.c | 4 +-
> libavfilter/vf_w3fdif.c | 2 +-
> libavfilter/vf_waveform.c | 42 ++++-----
> libavfilter/vf_weave.c | 2 +-
> libavfilter/vf_xbr.c | 2 +-
> libavfilter/vf_xfade.c | 14 +--
> libavfilter/vf_xfade_opencl.c | 2 +-
> libavfilter/vf_xmedian.c | 4 +-
> libavfilter/vf_xpsnr.c | 12 +--
> libavfilter/vf_yadif.c | 18 ++--
> libavfilter/vf_yaepblur.c | 8 +-
> libavfilter/vf_zoompan.c | 4 +-
> libavfilter/vf_zscale.c | 10 +--
> libavfilter/vsrc_ddagrab.c | 4 +-
> libavfilter/vsrc_gradients.c | 2 +-
> libavfilter/vsrc_life.c | 4 +-
> libavfilter/vsrc_mandelbrot.c | 4 +-
> libavfilter/vsrc_mptestsrc.c | 2 +-
> libavfilter/vsrc_sierpinski.c | 2 +-
> libavfilter/vsrc_testsrc.c | 20 ++---
> libavfilter/window_func.h | 2 +-
> libavformat/aacdec.c | 4 +-
> libavformat/ac3dec.c | 2 +-
> libavformat/ac4dec.c | 2 +-
> libavformat/aeadec.c | 2 +-
> libavformat/afc.c | 2 +-
> libavformat/aiffdec.c | 2 +-
> libavformat/amvenc.c | 2 +-
> libavformat/anm.c | 2 +-
> libavformat/argo_asf.c | 4 +-
> libavformat/argo_brp.c | 2 +-
> libavformat/argo_cvg.c | 2 +-
> libavformat/asfdec_f.c | 6 +-
> libavformat/asfenc.c | 4 +-
> libavformat/async.c | 4 +-
> libavformat/au.c | 2 +-
> libavformat/av1dec.c | 8 +-
> libavformat/avc.c | 2 +-
> libavformat/avformat.c | 2 +-
> libavformat/avidec.c | 46 +++++-----
> libavformat/avienc.c | 12 +--
> libavformat/avio.c | 4 +-
> libavformat/aviobuf.c | 20 ++---
> libavformat/cache.c | 10 +--
> libavformat/cafdec.c | 6 +-
> libavformat/cdg.c | 2 +-
> libavformat/concatdec.c | 2 +-
> libavformat/crypto.c | 2 +-
> libavformat/dash.c | 4 +-
> libavformat/dashenc.c | 26 +++---
> libavformat/data_uri.c | 2 +-
> libavformat/demux.c | 34 +++----
> libavformat/dhav.c | 2 +-
> libavformat/dsfdec.c | 2 +-
> libavformat/dtsdec.c | 4 +-
> libavformat/dtshddec.c | 4 +-
> libavformat/dump.c | 2 +-
> libavformat/dvbsub.c | 2 +-
> libavformat/dxa.c | 2 +-
> libavformat/fifo.c | 4 +-
> libavformat/file.c | 4 +-
> libavformat/filmstripdec.c | 2 +-
> libavformat/flvdec.c | 6 +-
> libavformat/flvenc.c | 2 +-
> libavformat/format.c | 12 +--
> libavformat/ftp.c | 4 +-
> libavformat/gxf.c | 2 +-
> libavformat/h261dec.c | 2 +-
> libavformat/hdsenc.c | 2 +-
> libavformat/hevc.c | 18 ++--
> libavformat/hls.c | 14 +--
> libavformat/hls_sample_encryption.c | 4 +-
> libavformat/hlsenc.c | 2 +-
> libavformat/http.c | 6 +-
> libavformat/iamf_parse.c | 8 +-
> libavformat/iamf_reader.c | 6 +-
> libavformat/iamfdec.c | 2 +-
> libavformat/icodec.c | 12 +--
> libavformat/iff.c | 4 +-
> libavformat/jvdec.c | 2 +-
> libavformat/lc3.c | 4 +-
> libavformat/libzmq.c | 2 +-
> libavformat/loasdec.c | 4 +-
> libavformat/matroskadec.c | 8 +-
> libavformat/matroskaenc.c | 24 ++---
> libavformat/mlvdec.c | 2 +-
> libavformat/mmf.c | 2 +-
> libavformat/mmsh.c | 2 +-
> libavformat/moflex.c | 2 +-
> libavformat/mov.c | 98 ++++++++++-----------
> libavformat/movenc.c | 30 +++----
> libavformat/movenc_ttml.c | 2 +-
> libavformat/movenccenc.c | 4 +-
> libavformat/mp3dec.c | 14 +--
> libavformat/mp3enc.c | 8 +-
> libavformat/mpc.c | 2 +-
> libavformat/mpegenc.c | 2 +-
> libavformat/mpegts.c | 14 +--
> libavformat/mpegtsenc.c | 18 ++--
> libavformat/mux.c | 2 +-
> libavformat/mxfenc.c | 8 +-
> libavformat/network.c | 4 +-
> libavformat/nsvdec.c | 2 +-
> libavformat/nutdec.c | 8 +-
> libavformat/nutenc.c | 6 +-
> libavformat/oggenc.c | 4 +-
> libavformat/oggparseopus.c | 4 +-
> libavformat/omadec.c | 4 +-
> libavformat/pp_bnk.c | 4 +-
> libavformat/pva.c | 2 +-
> libavformat/qcp.c | 2 +-
> libavformat/rawdec.c | 2 +-
> libavformat/rawutils.c | 4 +-
> libavformat/riffdec.c | 2 +-
> libavformat/rmdec.c | 4 +-
> libavformat/rtmppkt.c | 6 +-
> libavformat/rtmpproto.c | 12 +--
> libavformat/rtpdec.c | 4 +-
> libavformat/rtpdec_asf.c | 4 +-
> libavformat/rtpdec_mpeg4.c | 4 +-
> libavformat/rtpdec_mpegts.c | 2 +-
> libavformat/rtpdec_opus.c | 2 +-
> libavformat/rtpdec_qdm2.c | 4 +-
> libavformat/rtpenc.c | 6 +-
> libavformat/rtpenc_aac.c | 2 +-
> libavformat/rtpenc_h261.c | 2 +-
> libavformat/rtpenc_h263.c | 2 +-
> libavformat/rtpenc_h263_rfc2190.c | 2 +-
> libavformat/rtpenc_jpeg.c | 2 +-
> libavformat/rtpenc_latm.c | 2 +-
> libavformat/rtpenc_vc2hq.c | 2 +-
> libavformat/rtpenc_vp8.c | 2 +-
> libavformat/rtpenc_vp9.c | 2 +-
> libavformat/rtsp.c | 2 +-
> libavformat/sbgdec.c | 16 ++--
> libavformat/scd.c | 2 +-
> libavformat/sdns.c | 2 +-
> libavformat/seek.c | 12 +--
> libavformat/segment.c | 4 +-
> libavformat/sga.c | 4 +-
> libavformat/smjpegenc.c | 2 +-
> libavformat/smoothstreamingenc.c | 8 +-
> libavformat/spdifdec.c | 2 +-
> libavformat/spdifenc.c | 6 +-
> libavformat/srtp.c | 2 +-
> libavformat/srtpproto.c | 2 +-
> libavformat/subfile.c | 2 +-
> libavformat/swfdec.c | 2 +-
> libavformat/takdec.c | 2 +-
> libavformat/thp.c | 2 +-
> libavformat/tls_schannel.c | 2 +-
> libavformat/tls_securetransport.c | 2 +-
> libavformat/tty.c | 2 +-
> libavformat/usmdec.c | 4 +-
> libavformat/utils.c | 14 +--
> libavformat/vapoursynth.c | 2 +-
> libavformat/voc_packet.c | 2 +-
> libavformat/vqf.c | 4 +-
> libavformat/vvc.c | 18 ++--
> libavformat/wavarc.c | 2 +-
> libavformat/wavdec.c | 6 +-
> libavformat/wavenc.c | 16 ++--
> libavformat/wtvdec.c | 12 +--
> libavformat/xmv.c | 2 +-
> libavformat/xwma.c | 2 +-
> libavformat/yop.c | 2 +-
> libavformat/yuv4mpegdec.c | 2 +-
> libavutil/adler32.c | 2 +-
> libavutil/audio_fifo.c | 6 +-
> libavutil/avstring.c | 4 +-
> libavutil/bprint.c | 20 ++---
> libavutil/buffer.c | 2 +-
> libavutil/channel_layout.c | 2 +-
> libavutil/common.h | 4 +-
> libavutil/executor.c | 4 +-
> libavutil/fifo.c | 8 +-
> libavutil/frame.c | 6 +-
> libavutil/hwcontext_amf.c | 8 +-
> libavutil/hwcontext_d3d11va.c | 4 +-
> libavutil/hwcontext_qsv.c | 2 +-
> libavutil/hwcontext_vulkan.c | 6 +-
> libavutil/imgutils.c | 6 +-
> libavutil/lzo.c | 6 +-
> libavutil/macros.h | 6 ++
> libavutil/mathematics.c | 4 +-
> libavutil/md5.c | 2 +-
> libavutil/mem.c | 8 +-
> libavutil/parseutils.c | 2 +-
> libavutil/pca.c | 2 +-
> libavutil/pixdesc.c | 10 +--
> libavutil/rational.c | 4 +-
> libavutil/refstruct.c | 2 +-
> libavutil/side_data.c | 2 +-
> libavutil/slicethread.c | 4 +-
> libavutil/tests/audio_fifo.c | 2 +-
> libavutil/tests/fifo.c | 4 +-
> libavutil/tests/pca.c | 2 +-
> libavutil/tests/tree.c | 2 +-
> libavutil/timestamp.c | 2 +-
> libavutil/tx.c | 4 +-
> libavutil/vulkan.c | 12 +--
> libswresample/rematrix.c | 4 +-
> libswresample/resample.c | 24 ++---
> libswresample/soxr_resample.c | 2 +-
> libswresample/swresample.c | 14 +--
> libswresample/tests/swresample.c | 4 +-
> libswresample/x86/rematrix_init.c | 4 +-
> libswscale/cms.c | 4 +-
> libswscale/graph.c | 4 +-
> libswscale/loongarch/swscale_lasx.c | 64 +++++++-------
> libswscale/lut3d.c | 14 +--
> libswscale/slice.c | 18 ++--
> libswscale/swscale.c | 42 ++++-----
> libswscale/swscale_unscaled.c | 4 +-
> libswscale/tests/floatimg_cmp.c | 4 +-
> libswscale/tests/swscale.c | 10 +--
> libswscale/utils.c | 12 +--
> libswscale/vscale.c | 12 +--
> libswscale/x86/swscale.c | 4 +-
> libswscale/yuv2rgb.c | 8 +-
> tests/checkasm/audiodsp.c | 16 ++--
> tests/checkasm/hevc_deblock.c | 26 +++---
> tests/checkasm/lls.c | 4 +-
> tests/checkasm/vp9dsp.c | 2 +-
> tools/ismindex.c | 6 +-
> tools/probetest.c | 2 +-
> tools/scale_slice_test.c | 2 +-
> tools/sidxindex.c | 2 +-
> tools/target_dec_fuzzer.c | 4 +-
> tools/target_dem_fuzzer.c | 6 +-
> tools/target_enc_fuzzer.c | 4 +-
> 876 files changed, 3475 insertions(+), 3469 deletions(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index 3b830daf308..f70acaf4cc3 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -409,7 +409,7 @@ static av_always_inline av_const float av_clipf_c(float a, float amin, float ama
> #if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
> if (amin > amax) abort();
> #endif
> - return FFMIN(FFMAX(a, amin), amax);
> + return FFMINF(FFMAXF(a, amin), amax);
> }
>
> /**
> @@ -426,7 +426,7 @@ static av_always_inline av_const double av_clipd_c(double a, double amin, double
> #if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
> if (amin > amax) abort();
> #endif
> - return FFMIN(FFMAX(a, amin), amax);
> + return FFMIND(FFMAXD(a, amin), amax);
> }
>
> /** Compute ceil(log2(x)).
> diff --git a/libavutil/macros.h b/libavutil/macros.h
> index 2a7567c3ea8..141180b3eb4 100644
> --- a/libavutil/macros.h
> +++ b/libavutil/macros.h
> @@ -45,8 +45,14 @@
> #define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
>
> #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
> +#define FFMAXI(a,b) ((a) > (b) ? (a) : (b))
> +#define FFMAXF(a,b) ((a) > (b) ? (a) : (b))
> +#define FFMAXD(a,b) ((a) > (b) ? (a) : (b))
> #define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
> #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
> +#define FFMINI(a,b) ((a) > (b) ? (b) : (a))
> +#define FFMINF(a,b) ((a) > (b) ? (b) : (a))
> +#define FFMIND(a,b) ((a) > (b) ? (b) : (a))
> #define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
>
> #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
1. I don't like that you change the common case (namely the integer one)
and thereby making the name longer (and making this patch huge).
2. This is supposed to be used to provide optimized platform-specific
floating-point min and max functions. How is this supposed to be done
with your approach? Would macros.h get internal plattform-specific
headers like intreadwrite.h that are only included when building FFmpeg
to override the ordinary macros?
3. How about we add float and double inline functions that can be
overridden by target-specific functions for internal uses? (like
intreadwrite.h). The FFMIN macro would stay as is and continue to be
used in integer contexts. (These functions could be internal-only or
public.)
- Andreas
More information about the ffmpeg-devel
mailing list