[FFmpeg-devel] [PATCH 01/17] tests/swscale: improve colorization of speedup
Niklas Haas
ffmpeg at haasn.xyz
Sat Apr 26 20:41:05 EEST 2025
From: Niklas Haas <git at haasn.dev>
The old limits were a bit too tightly clustered around 1.0. Make the
value range much more generous, and also introduce a new highlight
for speedups above 10.0 (order of magnitude improvement).
---
libswscale/tests/swscale.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index 7081058130..0f1f8311c9 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -79,11 +79,12 @@ static int speedup_count;
static const char *speedup_color(double ratio)
{
- return ratio > 1.10 ? "\033[1;32m" : /* bold green */
- ratio > 1.02 ? "\033[32m" : /* green */
- ratio > 0.98 ? "" : /* default */
- ratio > 0.95 ? "\033[33m" : /* yellow */
- ratio > 0.90 ? "\033[31m" : /* red */
+ return ratio > 10.00 ? "\033[1;94m" : /* bold blue */
+ ratio > 2.00 ? "\033[1;32m" : /* bold green */
+ ratio > 1.02 ? "\033[32m" : /* green */
+ ratio > 0.98 ? "" : /* default */
+ ratio > 0.90 ? "\033[33m" : /* yellow */
+ ratio > 0.75 ? "\033[31m" : /* red */
"\033[1;31m"; /* bold red */
}
--
2.49.0
More information about the ffmpeg-devel
mailing list