PR #21346 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21346
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21346.patch

Signed-off-by: Michael Niedermayer <[email protected]>


>From 334bc7276c0a3bca4b0959e4c096ac1f6ce1acbe Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Wed, 31 Dec 2025 21:34:26 +0100
Subject: [PATCH] fftools/ffmpeg_filter: Simplify median3()

Signed-off-by: Michael Niedermayer <[email protected]>
---
 fftools/ffmpeg_filter.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 4387c992da..1ed9681ad2 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -2488,18 +2488,7 @@ early_exit:
 
 static int64_t median3(int64_t a, int64_t b, int64_t c)
 {
-    int64_t max2, min2, m;
-
-    if (a >= b) {
-        max2 = a;
-        min2 = b;
-    } else {
-        max2 = b;
-        min2 = a;
-    }
-    m = (c >= max2) ? max2 : c;
-
-    return (m >= min2) ? m : min2;
+    return a + (uint64_t)b + c - FFMIN3(a,b,c) - FFMAX3(a,b,c);
 }
 
 
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to