This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 257f1438a51dc48eb394a7e64a7635e027eace98 Author: Niklas Haas <[email protected]> AuthorDate: Fri May 1 16:22:26 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Tue Jun 9 18:27:20 2026 +0200 swscale/x86/ops: simplify mmsize determination No reason for this to be a separate function also, it just obscures the error path for no reason. Signed-off-by: Niklas Haas <[email protected]> --- libswscale/x86/ops.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c index 2087176cee..6d02c01ec5 100644 --- a/libswscale/x86/ops.c +++ b/libswscale/x86/ops.c @@ -22,6 +22,7 @@ #include "libavutil/avassert.h" #include "libavutil/mem.h" +#include "libavutil/x86/cpu.h" #include "../ops_chain.h" @@ -846,18 +847,6 @@ static const SwsOpTable *const tables[] = { &ops32_avx2, }; -static av_const int get_mmsize(const int cpu_flags) -{ - if (cpu_flags & AV_CPU_FLAG_AVX512) - return 64; - else if (cpu_flags & AV_CPU_FLAG_AVX2) - return 32; - else if (cpu_flags & AV_CPU_FLAG_SSE4) - return 16; - else - return AVERROR(ENOTSUP); -} - /** * Returns true if the operation's implementation only depends on the block * size, and not the underlying pixel type @@ -975,11 +964,16 @@ static void normalize_clear(SwsOp *op) static int compile(SwsContext *ctx, SwsOpList *ops, SwsCompiledOp *out) { - int ret; const int cpu_flags = av_get_cpu_flags(); - const int mmsize = get_mmsize(cpu_flags); - if (mmsize < 0) - return mmsize; + int ret, mmsize; + if (X86_AVX512(cpu_flags)) + mmsize = 64; + else if (X86_AVX2(cpu_flags)) + mmsize = 32; + else if (X86_SSE4(cpu_flags)) + mmsize = 16; + else + return AVERROR(ENOTSUP); /* Special fast path for in-place packed shuffle */ ret = solve_shuffle(ops, mmsize, out); _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
