Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PR] fftools/ffmpeg_filter: Simplify median3() (PR #21346)
@ 2025-12-31 20:54 michaelni via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: michaelni via ffmpeg-devel @ 2025-12-31 20:54 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: michaelni

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 <michael@niedermayer.cc>


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

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 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 -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-31 20:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-31 20:54 [FFmpeg-devel] [PR] fftools/ffmpeg_filter: Simplify median3() (PR #21346) michaelni via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git